MOON
Server: Apache/2.2.34 (Unix) mod_ssl/2.2.34 OpenSSL/0.9.8e-fips-rhel5 mod_bwlimited/1.4 FrontPage/5.0.2.2635
System: Linux server.asjudinet.com 2.6.32-042stab141.3 #1 SMP Fri Nov 15 22:45:34 MSK 2019 i686
User: asjudine (504)
PHP: 5.2.17
Disabled: NONE
Upload Files
File: /home/asjudine/public_html/afinanciera/solicitud_personas_juridicas.php
<?php 
global $dbi;
$linea = '-';
require_once("../Conectarse.php");

$resul4 = mysql_query('SELECT cedula, nombre, direccion, telefono, ciudad , email, valorcontrato FROM cartera_serviasjudinet  WHERE cedula =  "' . $_GET["ced2"] . '" AND numerocontrato =  "' . $_GET["numcon"] . '" ');
			if (!$resul4) {
				die('Invalid query ooo: ' . mysql_error());
			}
 
	list($nit, $razon, $diret, $telefono, $ciudad, $email,$valcon) = mysql_fetch_row($resul4);
	
	 $fidata = mysql_num_rows($resul4);
			  
			  if ($fidata == 0)
			  {
				  
				  $resul4 = mysql_query('SELECT cedula, nombre, direccion, telefono, ciudad , email FROM beneficiarios  WHERE cedula =  "' . $_GET["ced2"] . '" ');
			if (!$resul4) {
				die('Invalid query ooo: ' . mysql_error());
			}
 
	list($nit, $razon, $diret, $telefono, $ciudad, $email,$valcon) = mysql_fetch_row($resul4);
	
	 $fidata = mysql_num_rows($resul4);
	 
			  }
			  
			  if ($fidata == 0)
			  {
			  $resul4 = mysql_query('SELECT nit, razon, sigla, ciudad, direccion, telefono, email FROM personas_juridicas WHERE nit =  "' . $_GET_VARS["ced2"] . '" ');
							if (!$resul4) {
								die('Invalid query ooo: ' . mysql_error());
							}
				list($nit, $razon, $sigla, $ciudad, $diret, $telefono, $email) = mysql_fetch_row($resul4);
		
			  }

if(isset($_POST["enviar"]))
{

			$mssql = mysql_query('SELECT nit FROM personas_juridicas WHERE nit = "' . $_POST["nite"]  . '" ');
			if (!$mssql) {
				die('Invalid query: ' . mysql_error());
			}
				list($ceduli) = mysql_fetch_row($mssql);
				
				$msss = mysql_query('SELECT codigo_contrato  FROM planes_contratos WHERE nombre_plan  = "' . $_POST["plan"]  . '" ');
			if (!$msss) {
				die('Invalid query: ' . mysql_error());
			}
				list($plan1) = mysql_fetch_row($msss);

if ($nite != $ceduli)
{
	
$inser2= mysql_query("INSERT INTO personas_juridicas (nit, razon, sigla, representante, sucursal, ciudad,  direccion, telefono,   email , fecha, plan, valor_contrato, valor_definido, iva, retefuente, valor_mas_iva, valor_menos_retefu, cuota_inicial, saldo_financiar, cuotas, valor_cuota, cuenta, banco, numero_contrato, asesor, objetivo, sucursal_banco, registro_mercan, camara, tipo_solicitud,estado,,permanencia) VALUES ('".$_POST['nite']."', '".$_POST['razon']."', '".$_POST['sigla']."', '".$_POST['repre']."', '".$_POST['sucu']."', '".$_POST['ciudad']."', '".$_POST['diret'] ."', '".$_POST['telefono']."', '".$_POST['email']."', '".$_POST['fecha']."', '".'$plan1'."', '".$_POST['valcon']."', '".$_POST['valdef']."', '" . $_POST['iva']."', '".$_POST['retefuente']."', '".$_POST['valiva']."', '".$_POST['valrete']."', '".$_POST['cuotaini']."', '".$_POST['saldofin']. "', '".$_POST['cuotas']."', '".$_POST['valcuo']."', '".$_POST['cuenta']."', '".$_POST['banco']."', '".$_POST['numcontrato']."', '".$_POST['ase']  ."', '".$_POST['objetivo']."', '".$_POST['sucuban']."', '".$_POST['registro']."', '".$_POST['camara']."','2','0', '".$_POST['permanencia']."')");

/*
$inser2= mysql_query("INSERT INTO personas_juridicas (
fecha_inscripcion, sucursal_serviasjudinet, razon, sigla, nit, ciudad_empresa, direccion, telefono, email, tipo_contrato, valor_contrato, valor_iva, valor_retefuente, valor_diferencia_iva_menos_retefu, valor_coutas_afiliacion, valor_a_pagar_firma_contrato, numero_cuotas, valor_cuota 
VALUES 
('".$_POST['fecha']."', '".$_POST['sucu']."', '".$_POST['razon']."', '".$_POST['sigla']."', '".$_POST['nite']."', '".$_POST['ciudad']."', 
'".$_POST['diret']."', '".$_POST['telefono']."', '".$_POST['email']."', '".$_POST['plan']."', '".$_POST['valcon']."', 
 '" .$_POST["iva"]."', '".$_POST["retefuente"]."', '".$_POST["valiva"]."' , '".$_POST["valdef"]."',  '".$_POST["valrete"]."',

'" . $_POST["cuotaini"]  . "', '" . $_POST["saldofin"]  . "', '" . $_POST["cuotas"]  . "', '" . $_POST["valcuo"]  . "', '" . $_POST["cuenta"]  . "', '" . $_POST["banco"]  . "', '" . $_POST["numcontrato"]  . "', '" . $_POST["ase"]  . "', '" . $_POST["objetivo"]  . "', '" . $_POST["sucuban"]  . "', '" . $_POST["registro"]  . "', '" . $_POST["camara"]  . "','2','0', '" . $_POST["permanencia"] . ")");
*/

if (! $inser2) {
				die('Invalid inser2 : ' . mysql_error());
			}  
			
 echo "<script>alert('Aprobada la Solicitud Juridica');</script>";

}
else
{
echo "<script>alert('La Solicitud ya tiene Juridica');</script>";

}

}


$mssql = mysql_query('SELECT vendedor FROM vendedores  WHERE codigo = "' . "$ase". '" ');
			if (!$mssql) {
				die('Invalid query: ' . mysql_error());
			}
			list($asesor) = mysql_fetch_row($mssql);
			
$mssql1 = mysql_query('SELECT nombre FROM sucursal  WHERE codigo = "' . "$sucu". '" ');
			if (!$mssql1) {
				die('Invalid query: ' . mysql_error());
			}
			list($sucursal) = mysql_fetch_row($mssql1);
	
	 $sql = mysql_query('SELECT * FROM sucursal  order by nombre ');
		  if (!$sql) {
				die('Invalid query 12: ' . mysql_error());
			}
	$row_sql = mysql_fetch_assoc($sql);
	$totalRows_sql = mysql_num_rows($sql);  
	
	$sql7 = mysql_query('SELECT * FROM planes_contratos WHERE estado = "1" and (codigo = "9" || codigo = "10" || codigo = "11" || codigo = "12" || codigo = "13"|| codigo = "17"|| codigo = "18"|| codigo = "21"|| codigo = "22")order by codigo_contrato  ');
			if (!$sql7) {
				die('Invalid query: ' . mysql_error());
			} 
$row_sql7 = mysql_fetch_assoc($sql7);
$totalRows_sql7 = mysql_num_rows($sql7);	

$sql4 = mysql_query('SELECT * FROM vendedores WHERE tipo = "AE" and estado = "1" order by vendedor ');
			if (!$sql4) {
				die('Invalid query: ' . mysql_error());
			} 
$row_sql4 = mysql_fetch_assoc($sql4);
$totalRows_sql4 = mysql_num_rows($sql4); 	

?>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Ingreso Personas Juridicas</title>
<style type="text/css">
<!--
.est_cont5 {
	font-family: Verdana, Arial, Helvetica, sans-serif;
	font-size: 11px;
	font-style: normal;
	font-weight: normal;
	background-color: #EDFAF4;
	margin: 2px;
	padding: 2px;
	height: auto;
	width: auto;
	border: thin groove #E9AAF0;
	color: #C72350;
}
.color_fondo_sc {
	background-color: #DCE0E4;
}
.Estilo1 {
	font-family: Verdana, Arial, Helvetica, sans-serif;
	font-size: 16px;
	font-style: normal;
	font-weight: bold;
	background-color: #D6ECFE;
	margin: 2px;
	padding: 2px;
	height: auto;
	width: auto;
	border: thin groove #E9AAF0;
	color: #C72350;
}
.Estilo2 {
	font-size: 14px;
	font-weight: bold;
}
.est_cont2 {
	font-family: Geneva, Arial, Helvetica, sans-serif;
	font-size: 12px;
	font-style: normal;
	font-weight: normal;
	color: #2B39EC;
	background-color: #FFFFFF;
	height: 18px;
	width: auto;
	border: thin solid #FABF85;
}


.est_cont8 {
	font-family: Geneva, Arial, Helvetica, sans-serif;
	font-size: 13px;
	font-style: normal;
	font-weight: normal;
	color: #2B39EC;
	background-color: #FFFFFF;
	height: 19px;
	width: auto;
	border: thin solid #FABF85;
}


.est_cont6 {
	font-family: Georgia, "Times New Roman", Times, serif;
	font-size: 11px;
	font-style: normal;
	font-weight: normal;
	color: #006262;
	background-color: #EDFED3;
	margin: 1px;
	padding: 1px;
	height: auto;
	width: auto;
	border: thin solid #D9B6F8;
}
.Estilo3 {
	color: #C72350;
	font-weight: bold;
}
.sol_cre1 {
	font-family: Georgia, "Times New Roman", Times, serif;
	font-size: 12px;
	font-style: normal;
	font-weight: normal;
	color: #0B3495;
	background-color: #E6FAFF;
	margin: 1px;
	padding: 1px;
	height: 15px;
	width: auto;
	border: thin outset #56AD95;
}
.col_cre2 {
	font-family: Verdana, Arial, Helvetica, sans-serif;
	font-size: 12px;
	font-style: normal;
	font-weight: bold;
	color: #F92F0B;
	background-color: #B3D9F0;
	height: auto;
	width: auto;
	border: medium groove #FC9227;
}
.recaudo {font-family: "Courier New", Courier, monospace;
	font-size: 12px;
	font-style: normal;

	font-weight: bold;
	font-variant: normal;
	color: #000000;
	background-color: #B6CBDC;
	margin: 4px;
	padding: 8px;
	width: auto;
	border: medium outset #339966;
}
.Estilo54 {font-weight: bold}
.sol_cre11 {	font-family: "Times New Roman", Times, serif;
	font-size: 12px;
	font-style: normal;
	font-weight: normal;
	color: #000000;
	background-color: #E6FAFF;
	margin: 1px;
	padding: 1px;
	height: 18px;
	width: auto;
	border: thin outset #56AD95;
}
.Estilo55 {	color: #FF0000;
	font-weight: bold;
}
.Estilo65 {	color: #7DD096;
	font-weight: bold;
}
.Estilo65 {color: #C72350}
.est_cont51 {	font-family: Verdana, Arial, Helvetica, sans-serif;
	font-size: 9px;
	font-style: normal;
	font-weight: normal;
	background-color: #FFFFCC;
	margin: 2px;
	padding: 2px;
	height: auto;
	width: auto;
	border: thin groove #E9AAF0;
	color: #C72350;
}
.Estilo67 {color: #CCFFCC}
-->
</style>
</head>

<body>
<form action="" method="post" enctype="multipart/form-data" name="form1" class="color_fondo_sc" id="form1">
  <div align="center">
    <div class="Estilo1">SOLICITUD 
      <table width="774" border="2" cellpadding="1" cellspacing="1" class="sol_cre11">
        <caption>
        <div align="center"><br />
            <span class="Estilo2">DATOS BASICOS - PERSONAS JURIDICAS </span><br />
        </div>
        </caption>
        <tr>
          <th scope="col">&nbsp;</th>
          <th scope="col"><div align="right">
              <div align="right"><strong>Fecha Solicitud :</strong></div>
          </div></th>
          <th width="96" scope="col"><div align="left">
              <input name="fecha" type="text" class="est_cont2" id="fecha" value="0000-00-00" size="10" maxlength="10" />
          </div></th>
          <th width="117" scope="col"><div align="right"><strong>Sucursal :</strong></div></th>
          <td width="186"><select name="sucu">
              <option value = "">SELECCIONE SUCURSAL</option>
              <?php
     do {  
?>
              <option value="<?php echo $row_sql['codigo'];?>"><?php echo $row_sql['nombre']?></option>
              <?php
} while ($row_sql = mysql_fetch_assoc($sql));
  $rows = mysql_num_rows($sql);
  if($rows > 0) {    
      mysql_data_seek($sql, 0);
       $row_sql = mysql_fetch_assoc($sql);
  }
?>
            </select>
          </td>
        </tr>
  <td width="94"><div align="right"><strong>Razon Social:</strong></div></td>
      <td colspan="3"><div align="left">
          <input name="razon" type="text" class="est_cont2" id="razon" value="<?php echo $razon ?>" size="66" maxlength="65" />
      </div></td>
    <td width="115"><div align="right"><strong>Sigla:</strong></div></td>
    <td width="206" ><input name="sigla" type="text" class="est_cont2" id="sigla" value="<?php echo $sigla ?>" size="20" maxlength="20" /></td>
  </tr>
  <tr>
    <td height="21"><div align="right"><strong>Nit:</strong></div></td>
    <td width="111"><div align="left">
      <input name="nite" type="text" class="est_cont2" id="nite" value="<?php echo $nit ?>" size="20" maxlength="20" />
    </div></td>
    <td><div align="right"><strong>Ciudad :</strong></div></td>
    <td><div align="left">
      <input name="ciudad" type="text" class="est_cont2" id="ciudad" value="<?php echo $ciudad ?>" size="20" maxlength="20" />
    </div></td>
    <td><div align="right"><strong>Direccion :</strong></div></td>
    <td colspan="2"><div align="left">
      <input name="diret" type="text" class="est_cont2" id="diret" value="<?php echo $diret ?>" size="40" maxlength="40" />
    </div></td>
  </tr>
  <tr>
    <td><div align="right"><strong>Telefono :</strong></div></td>
    <td><div align="left">
      <input name="telefono" type="text" class="est_cont2" id="telefono" value="<?php echo $telefono ?>" size="20" maxlength="20" />
    </div></td>
    <td><div align="right"><strong>E-mail :</strong></div></td>
    <td colspan="2"><div align="left">
      <input name="email" type="text" class="est_cont2" id="email" value="<?php echo $email ?>" size="40" maxlength="40" />
    </div></td>
  </tr>
    <td><div align="right"><strong>Plan :</strong></div></td>
    
        <td bgcolor="#FFFFCC" class="est_cont2"><div align="left" class="Estilo71">
            <select name="plan" class="Estilo81" id="plan">
              <option value="">-PLAN-</option>
              <option value="SP09">SP09</option>
              <option value="SP10">SP10</option>
              <option value="SP11">SP11</option>
              <option value="SJ12">SJ12</option>
              </select>
        </div></td>
    <td><div align="right" class="Estilo54 Estilo65">Valor Contrato:</div></td>
    <td><div align="left">
          <input name="valcon" type="text" class="est_cont2" id="valcon" value="<?php echo $valcon ?>" size="22" maxlength="22"  />
      </div></td>
    <td><div align="right" class="Estilo3">Valor Diferido :</div></td>
    <td colspan="2"><div align="left">
          <input name="valdef" type="text" class="est_cont2" id="valdef" value="<?php echo $valdef ?>" size="22" maxlength="22" />
      </div></td>
   </tr>
   <tr>
    <td height="40"><div align="right"><strong>I.V.A :</strong></div></td>
    <td><div align="left">
      <input name="iva" type="text" class="est_cont2" id="iva" value="<?php echo $iva ?>" size="20" maxlength="20" />
    </div></td>
    <td><div align="right"><strong>Retefuente:</strong></div></td>
    <td><div align="left">
      <input name="retefuente" type="text" class="est_cont2" id="retefuente" value="<?php echo $retefuente ?>" size="20" maxlength="20" />
    </div></td>
    <td><div align="right"><strong>Valor Incluido I.V.A :</strong></div></td>
    <td colspan="2" align="left"><input name="valiva" type="text" class="est_cont2" id="valiva" value="<?php echo $valiva ?>" size="20" maxlength="20" /></td>
  </tr>
  <tr>
    <td><div align="center"><strong>valor menos Retefuente :</strong></div></td>
    <td><div align="left">
      <input name="valrete" type="text" class="est_cont2" id="valrete" value="<?php echo $valrete ?>" size="20" maxlength="20" />
    </div></td>
    <td colspan="2"  align="right"><strong>Valor a Pagar A La Firma Del Contrato:<br> Cuota De Afiliacion + Valor Diferencia Iva Retefuente</strong>
    </td>
      <td colspan="2" align="left"><input name="cuotaini" type="text" class="est_cont2" id="cuotaini" value="<?php echo $cuotain ?>" size="60" maxlength="60" /></td></tr>
    
      
  <tr>
    <td><div align="right"><strong>NĂºmero de Cuotas:</strong></div></td>
    <td><div align="left">
      <input name="cuotas" type="text" class="est_cont2" id="cuotas" value="<?php echo $cuotas ?>" size="20" maxlength="20" />
    </div></td>
    <td><div align="right"><strong>Valor Cuota:</strong></div></td>
    <td><div align="left">
      <input name="valcuo" type="text" class="est_cont2" id="valcuo" value="<?php echo $valcuo ?>" size="20" maxlength="20" />
    </div></td>
    <td><div align="right"><strong>Cuenta :</strong></div></td>
    <td colspan="2" align="left"><input name="cuenta" type="text" class="est_cont2" id="cuenta" value="<?php echo $cuenta ?>" size="35" maxlength="35" /></td>
  </tr>
  <tr>
    <td><div align="right"><strong>Banco:</strong></div></td>
    <td><div align="left">
      <input name="banco" type="text" class="est_cont2" id="banco" value="<?php echo $banco ?>" size="20" maxlength="20" />
    </div></td>
    <td><div align="right"><strong>Sucursal Banco:</strong></div></td>
    <td><div align="left">
      <input name="sucuban" type="text" class="est_cont2" id="sucuban" value="<?php echo $sucuban ?>" size="20" maxlength="20" />
    </div></td>
    <td><div align="right"><strong>Numero Contrato:</strong></div></td>
    <td><div align="left">
      <input name="numcontrato" type="text" class="est_cont2" id="numcontrato" value="<?php echo $numcontrato ?>" size="20" maxlength="20" />
    </div></td>
  </tr>
 
  <tr>
  
    <td bgcolor="#FFFFCC"><div align="right"><strong>Registro Mercantil No:</strong></div></td>
   <td colspan="1" bgcolor="#FFFFCC"><div align="left">
      <input name="numcontrato" type="text" class="est_cont2" id="numcontrato" value="<?php echo $numcontrato ?>" size="20" maxlength="20" />
    </div></td>
      
  <td bgcolor="#FFFFCC"><div align="right"><strong>Camara Comercio de :</strong></div></td>
        <td colspan="1" bgcolor="#FFFFCC"><div align="left">
            <input name="camara" type="text" class="sol_cre11" id="camara" value="<?php echo BOGOTA?>" size="25" maxlength="25" />
        </div></td>
        
       <td height="25" colspan="1" bgcolor="#FFFFCC"><div align="right"><strong>Nombre Representante Legal :</strong></div></td>
        <td colspan="2" bgcolor="#FFFFCC"><div align="left">
            <input name="repre" type="text" class="sol_cre11" id="repre" value="<?php echo $repre ?>" size="46" maxlength="45" />
        </div></td>
        
        <tr>
        <td height="25" colspan="2" bgcolor="#FFFFCC"><div align="right"><strong>Cedula Representante Legal :</strong></div></td>
        <td colspan="2" bgcolor="#FFFFCC"><div align="left">
            <input name="repre" type="text" class="sol_cre11" id="repre" value="<?php echo $repre ?>" size="46" maxlength="45" />
        </div></td>
 
    <td bgcolor="#FFFFCC"><div align="right"><strong>Asesor Comercial:</strong></div></td>
    
    
    <td colspan="2"bgcolor="#FFFFCC"><select name="ase" class="est_cont8" id="ase">
      <option value="">-SELECCIONE ASESOR-</option>
      <?php
     do {  
?>
      <option value="<?php echo $row_sql4['codigo'];?>"><?php echo $row_sql4['vendedor']?></option>
      <?php
} while ($row_sql4 = mysql_fetch_assoc($sql4));
  $rows4 = mysql_num_rows($sql4);
  if($rows4 > 0) {
      mysql_data_seek($sql4, 0);
       $row_sql4 = mysql_fetch_assoc($sql4);
  }
?>
    </select></td>
  </tr>
      </tr>    <tr>
        <td height="55" colspan="2" bgcolor="#FFFFCC"><div align="right"><strong>Objeto Social :</strong></div></td>
        <td colspan="4" bgcolor="#FFFFCC"><label><span class="Estilo54">
        <textarea name="objetivo" id="objetivo" cols="100" rows="6"><?php echo $objetivo ?></textarea>
        </span></label></td>
      </tr>
      
      
      
      
           <tr>
      
    <td  colspan="2" bgcolor="#FFFFCC"><div align="right"><strong>Clausula De Permanencia :</strong></div></td>
    
    
    <td colspan="5" bgcolor="#FFFFCC"><div align="left"><select name="permanencia" class="est_cont8" id="permanencia">
    <option value="">-PERMANENCIA-</option>
              <option value="12">12</option>   
              <option value="24">24</option>
              <option value="SIN">SIN</option>  
    </select></td>
  		</tr>
   </tr>   
       
      
      
      
      
      </tr>
      </table>
    </div>


    
    <table width="630" 
	border="2" cellpadding="1" cellspacing="1" class="est_cont2">
     
    </table>
  
    <p>
      <input name="enviar" type="submit" class="Estilo55" id="enviar" value="GUARDAR" />
    </p>
	<p align="center">
  <input name="menu2" type="button" class="Estilo3" id="menu2" onClick="window.location.href='menu_solicitud_credito.php'" value="MENU PRINCIPAL">
</p>
  </div>
</form>
</body>
</html>