File: /home/asjudine/public_html/comercial/solicitud_verificacion_personas_juridicas.php
<?php
require_once("../Conectarse.php");
$resu = mysql_query('SELECT nit,razon, sigla, sucursal_serviasjudinet,ciudad_empresa,direccion, telefono,email, fecha_inscripcion,tipo_contrato,numero_contrato,valor_iva,valor_retefuente,
numero_cuotas, valor_cuota, nombre_banco, cuenta_numero,asesor,renovacion_cuotas FROM personas_juridicas
WHERE nit = "' . $_GET[ced2] . '" and numero_contrato = "' . $_GET[numcon] . '" ');
if (!$resu) {
die('Invalid query sasa: ' . mysql_error());
}
list($cedula, $apes, $ced_ciudad, $sucur, $ciudad,$direccion, $telefono, $email,$fechs, $plant,$numero_contrato,$val_ment, $unidad, $celular, $val_menj, $banco, $numero_cuenta, $ase1,$renovacion_cuotas) = mysql_fetch_row($resu);
$sqlo = mysql_query('SELECT vendedor FROM vendedores WHERE codigo = "' ."$ase1". '"');
if (!$sqlo) {
die('Invalid query sa: ' . mysql_error());
}
list($ase98) = mysql_fetch_row($sqlo);
/*$res = mysql_query('SELECT nombre, nit, direccion, ciudad, telefono, email, convenio FROM datos_empresa WHERE cedula = "' . $_GET["ced2"] . '" ');
if (!$res) {
die('Invalid query assa: ' . mysql_error());
}
list($nombreem, $nitem, $direccionem, $ciudadem, $telefonoem, $emailem, $convenio) = mysql_fetch_row($res); */
$resul4 = mysql_query('SELECT nombre FROM sucursal WHERE codigo = "'.$sucur.'" ');
if (!$resul4) {
die('Invalid query ooo: ' . mysql_error());
}
list($sucur) = mysql_fetch_row($resul4);
$resul5 = mysql_query('SELECT codigo_contrato FROM planes_contratos WHERE codigo = "'.$plant5.'" ');
if (!$resul5) {
die('Invalid query ooo: ' . mysql_error());
}
list($plant5) = mysql_fetch_row($resul5);
if(isset($_POST["guardar"]))
{
$tieser = $tie.$espacio.$ma;
if($_POST["plan"] != "")
{
$resul5 = mysql_query('SELECT valor_mensual, valor_total FROM planes_contratos WHERE codigo = "' . $_GET[plan] . '" ');
if (!$resul5) {
die('Invalid query assa: ' . mysql_error());
}
list($vmj, $vmt ) = mysql_fetch_row($resul5);
}
else
{
$resu = mysql_query('SELECT con_valor_mensual, con_valor_total FROM solicitud_credito WHERE cedula = "' . $_GET[ced2] . '" and numero_contrato = "' . $_GET[numcon] . '" ');
if (!$resu) {
die('Invalid query yhj: ' . mysql_error());
}
list( $vmj, $vmt) = mysql_fetch_row($resu);
}
$control3 = mysql_query('SELECT cedula, numero_desembolso FROM solicitud_credito WHERE cedula = "' . $_GET["ced2"] . '" ');
if (!$control3) {
die('Invalid query 45: ' . mysql_error());
}
list($ceduli, $numdem) = mysql_fetch_row($control3);
$num4=mysql_num_rows($control3);
if ($_POST["codigo_sucursal"] == "")
{
$resul4 = mysql_query('SELECT codigo FROM sucursal WHERE nombre = "'.$_POST[sucur].'" ');
if (!$resul4) {
die('Invalid query ooo: ' . mysql_error());
}
list($codigo_sucursal) = mysql_fetch_row($resul4);
}
else
{
$resul4 = mysql_query('SELECT codigo FROM sucursal WHERE codigo = "'.$_POST[codigo_sucursal].'" ');
if (!$resul4) {
die('Invalid query ooo: ' . mysql_error());
}
list($codigo_sucursal) = mysql_fetch_row($resul4);
}
if($_POST[ase] == "")
{
$resul5 = mysql_query('SELECT codigo FROM vendedores WHERE vendedor = "'.$_POST[ase1].'" ');
if (!$resul5) {
die('Invalid query ooo: ' . mysql_error());
}
list($ase45) = mysql_fetch_row($resul5);
}
else
{
$resul5 = mysql_query('SELECT codigo FROM vendedores WHERE codigo = "'.$_POST[ase98].'" ');
if (!$resul5) {
die('Invalid query ooo: ' . mysql_error());
}
list($ase) = mysql_fetch_row($resul5);
}
if($_POST[plan] == "")
{
$resul5 = mysql_query('SELECT codigo FROM planes_contratos WHERE codigo_contrato = "'.$_POST[plant].'" ');
if (!$resul5) {
die('Invalid query ooo: ' . mysql_error());
}
list($plan) = mysql_fetch_row($resul5);
}
else
{
$resul5 = mysql_query('SELECT codigo FROM planes_contratos WHERE codigo = "'.$_POST[plan].'" ');
if (!$resul5) {
die('Invalid query ooo: ' . mysql_error());
}
list($plan) = mysql_fetch_row($resul5);
}
if ($num4 != 0)
{
$mssql = mysql_query("UPDATE solicitud_credito set cedula= '" . $_POST[ced] . "', ced_ciudad= '" . $_POST[ciuced] . "', nombre= '" . $_POST[ape] . "', fecha = '" . $_POST[fechas] . "', direccion='" . $_POST[dir] . "', ciudad= '" . $_POST[ciu] . "', telefono= '" . $_POST[tel] . "', celular= '" . $_POST[cel] . "', email= '" . $_POST[email] . "', unidad= '" . $_POST[uni] . "', codigo_plan= '" . $plan. "', numero_cuenta= '" . $_POST[cue] . "', banco= '" . $_POST[ban] . "', grado= '" . $_POST[gra] . "', codigo_asesor = '" .$ase. "', codigo_militar= '" . $_POST[codigom] . "', codigo_sucursal= '" .$codigo_sucursal. "', numero_libranza= '" . $_POST[num_lib] . "', con_valor_mensual= '" .$vmj. "', con_valor_total= '" .$vmt. "', fecha_nac= '" . $_POST[fechanac] . "', tipo_solicitud = '4', estado= '0', numero_contrato = '" . $_POST[numcont] . "' WHERE cedula= '" . $_GET[ced2] . "' and numero_contrato = '" . $_GET[numcon] . "' ");
if (!$mssql) {
die('Invalid query udate: ' . mysql_error());
}
echo "<script>alert('Los datos fueron Modificados ');</script>";
}
else
{
echo "entro aqui";
/*$guardar = mysql_query("INSERT INTO solicitud_credito (cedula, ced_ciudad, nombre, fecha, direccion, ciudad, telefono, celular, email, unidad, codigo_plan, numero_cuenta, banco, codigo_asesor, codigo_militar, grado, codigo_sucursal, numero_libranza, con_valor_mensual, con_valor_total, fecha_nac, tipo_solicitud, estado, numero_contrato, alerta1, alerta2, alerta3, alerta4, alerta5,renovacion_cuotas) VALUES ('" . $_POST["ced"] . "', '" . $_POST["ciuced"] . "', '" . $_POST["ape"] . "', '" . $_POST["fechas"] . "', '" . $_POST["dir"] . "', '" . $_POST["ciu"] . "', '" . $_POST["tel"] . "', '" . $_POST["cel"] . "', '" . $_POST["email"] . "', '" . $_POST["uni"] . "', '" ."$plan". "', '" . $_POST["cue"] . "', '" . $_POST["ban"] . "', '" ."$ase". "', '" . $_POST["codigom"] . "', '" . $_POST["gra"] . "', '" ."$codigo_sucursal". "', '" . $_POST["num_lib"] . "', '" ."$vmj". "', '" ."$vmt". "', '" . $_POST["fechanac"] . "', '4', '1', '" . $_POST["numcont"] . "', '" . $_GET["alerta1"] . "', '" . $_GET["alerta2"] . "', '" . $_GET["alerta3"] . "', '" . $_GET["alerta4"] . "', '" . $_GET["alerta5"] . "', '" . $_GET["alerta6"] . "','" . $_POST["renovacion_cuotas"] . "' )");*/
$guardar = mysql_query("INSERT INTO solicitud_credito (cedula, ced_ciudad, nombre, fecha, direccion, ciudad, telefono, celular, email, unidad, codigo_plan, numero_cuenta, banco, codigo_asesor, codigo_militar, grado, codigo_sucursal, numero_libranza, con_valor_mensual, con_valor_total, fecha_nac, tipo_solicitud, estado, numero_contrato, alerta1, alerta2, alerta3, alerta4, alerta5,alerta6,renovacion_cuotas) VALUES ('" . $_POST["ced"] . "', '" . $_POST["ciuced"] . "', '" . $_POST["ape"] . "', '" . $_POST["fechas"] . "', '" . $_POST["dir"] . "', '" . $_POST["ciu"] . "', '" . $_POST["tel"] . "', '" . $_POST["cel"] . "', '" . $_POST["email"] . "', '" . $_POST["uni"] . "', '" ."$plan". "', '" . $_POST["cue"] . "', '" . $_POST["ban"] . "', '" ."$ase". "', '" . $_POST["codigom"] . "', '" . $_POST["gra"] . "', '" ."$codigo_sucursal". "', '" . $_POST["num_lib"] . "', '" ."$vmj". "', '" ."$vmt". "', '" . $_POST["fechanac"] . "', '4', '1', '" . $_POST["numcont"] . "', '" . $_GET["alerta1"] . "', '" . $_GET["alerta2"] . "', '" . $_GET["alerta3"] . "', '" . $_GET["alerta4"] . "', '" . $_GET["alerta5"] . "', '" . $_GET["alerta6"] . "','" . $_POST["renovacion_cuotas"] . "' )");
if (!$guardar) {
die('Invalid query udate: ' . mysql_error());
}
echo "<script>alert('Los datos fueron grabados correctamente');</script>";
}
$resu = mysql_query('SELECT cedula, ced_ciudad, nombre, direccion, ciudad, telefono, celular, email, unidad, codigo_plan, numero_cuenta, banco, codigo_militar, grado, codigo_sucursal, con_valor_mensual, con_valor_total, fecha_nac, numero_libranza, numero_contrato FROM solicitud_credito WHERE cedula = "' . $_POST["ced"] . '" ');
if (!$resu) {
die('Invalid query: ' . mysql_error());
}
$ced = $_POST["ced"];
$numcont = $_POST["numcont"];
$codigom = $_POST["codigom"];
echo "<SCRIPT LANGUAGE='javascript'>window.location.href='busqueda_aproba_juridica.php?ced2=$ced&numcon=$numcont&codigo=$codigom'</SCRIPT>";
}
$sql2 = mysql_query('SELECT * FROM descuentos order by codigo ');
if (!$sql2) {
die('Invalid query m2: ' . mysql_error());
}
$row_sql2 = mysql_fetch_assoc($sql2);
$totalRows_sql2 = mysql_num_rows($sql2);
$sql3 = mysql_query('SELECT * FROM descuentos order by codigo ');
if (!$sql3) {
die('Invalid query 3: ' . mysql_error());
}
$row_sql3 = mysql_fetch_assoc($sql3);
$totalRows_sql3 = mysql_num_rows($sql3);
$sql4 = mysql_query('SELECT * FROM vendedores WHERE (tipo = "AC" || 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);
$sql5 = mysql_query('SELECT * FROM sucursal order by nombre ');
if (!$sql5) {
die('Invalid query: ' . mysql_error());
}
$row_sql5 = mysql_fetch_assoc($sql5);
$totalRows_sql5 = mysql_num_rows($sql5);
$sql7 = mysql_query('SELECT * FROM planes_contratos WHERE estado = "1" order by codigo ');
if (!$sql7) {
die('Invalid query: ' . mysql_error());
}
$row_sql7 = mysql_fetch_assoc($sql7);
$totalRows_sql7 = mysql_num_rows($sql7);
$sql8 = mysql_query('SELECT * FROM director_ventas order by nombre ');
if (!$sql8) {
die('Invalid query: ' . mysql_error());
}
$row_sql8 = mysql_fetch_assoc($sql8);
$totalRows_sql8 = mysql_num_rows($sql8);
$sql8 = mysql_query('SELECT * FROM sucursal order by nombre ');
if (!$sql8) {
die('Invalid query: ' . mysql_error());
}
$row_sql8 = mysql_fetch_assoc($sql8);
$totalRows_sql8 = mysql_num_rows($sql8);
?>
<!DOCTYPE HTML>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="X-UA-Compatible" content="IE=8; IE=9; IE=edge" />
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>INGRESAR SOLICITUD DE CREDITO</title>
<style type="text/css">
*{margin: 0;padding: 0;}
body{background-color:#EAEAEA;font-family:Geneva,Arial,Helvetica,sans-serif;}
header {background-color: #B7271F; text-align: center;}
.titulo{width: 100%;text-align: center;background-color: #dbd8c9;color: #b20606;padding: 6px 0;font-size: 18px;}
table{margin: 0 auto;border: 8px solid #bebebe; text-align: center;}
.divirmenu{text-align: center;}
.irmenu{width: 200px;background-color: #1c4fa0;color: #fff; padding: 4px;border-radius: 6px;}
.irmenu:hover{background-color: #67a0d9; color: #000;}
.direcciona{width: 200px;background-color: #D4090C;color: #fff; padding: 4px;border-radius: 3px;}
.direcciona:hover{background-color: #67a0d9; color: #000;}
.fecha{background-color: #d6e08b; padding: 2px;color: #000;font-size: 15px; text-align: center;}
td{padding: 1px; border: 1px solid #a0a0a0;}
.td{background-color: #e5e5e5; padding: 1px 30px;color: #00135F;font-size: 14px;font-weight: 600; text-align: center;}
.boton1{width:30%;background-color: #ffffff;color: #000;padding: 2px;border:2px solid #580000;border-radius:10px;}
.boton1:hover{background-color: #6f0000;color: #fff;cursor: pointer;}
input[type=text]{border-radius: 5px; padding: 3px;background-color: #FFFEF4;}
.tdtitulo{background-color: #e3dec0; color: #b20606; padding: 2px; text-align: center; font-size: 12px; font-weight: 900}
.tdfull{background-color: #fff; color: #000; padding: 1px; text-align: center; font-size: 12px;}
.botonnew{width: 90px; background-color: #e3dec0;color: #b20606;padding: 1px;border-radius:5px;}
.botonnew:hover{width: 90px; background-color: #cbbd6a;color: #000;padding: 1px;border-radius:5px;}
.tdizq{background-color: #e5e5e5; padding: 1px 10px;color: #00135F;font-size: 12px;font-weight: 600; text-align: left;}
.tdcen{background-color: #e5e5e5; padding: 1px 10px;color: #00135F;font-size: 12px;font-weight: 600; text-align: center;}
.tdder{background-color: #e5e5e5; padding: 1px 2px;color: #00135F;font-size: 12px;font-weight: 600; text-align: right;}
.tdbono{background-color: #FFFFCC; padding: 1px 2px;color: #00135F;font-size: 12px;font-weight: 600; text-align: right;}
/*Estilo Complementario*/
.tdi{background-color: #F9FBC8; padding: 1px 10px;color: #00135F;font-size: 12px;font-weight: 600; text-align: left;}
.tdc{background-color: #F9FBC8; padding: 1px 10px;color: #00135F;font-size: 12px;font-weight: 600; text-align: center;}
.tdd{background-color: #F9FBC8; padding: 1px 2px;color: #00135F;font-size: 12px;font-weight: 600; text-align: right;}
</style>
<script Language="JavaScript">
function validarEntero(valor){
//intento convertir a entero.
//si era un entero no le afecta,si no lo era lo intenta convertir
valor = parseInt(valor)
//Compruebo si es un valor numérico
if (isNaN(valor)) {
//entonces (no es numero) devuelvo el valor cadena vacia
return ""
}else{
//En caso contrario (Si era un número) devuelvo el valor
return valor
}
}
</script>
</head>
<body >
<header>
<img src="../ELEMENTS/bannerInterasjudinet.png" alt="" width=" 700" height="70">
</header>
<form action="" method="post" onsubmit="return valida_envia()" enctype="multipart/form-data" name="form1" class="color_fondo_sc" id="form1">
<div align="center">
<h3 class="titulo">APROBACION PERSONAS JURIDICAS</h3>
<table width="901" border="2" cellpadding="1" cellspacing="1" class="est_cont5">
<caption>
<div align="center">
<h3 class="titulo">DATOS BASICOS - DEUDOR</h3>
</div>
</caption>
<tr>
<td class="tdder"> </td>
<td class="tdder">
Fecha Afiliacion: Año-Mes-dia
</td>
<th width="76" scope="col"><div align="left">
<input name="fechas" type="text" id="fechas" value="<?php echo $fechs ?>" size="10" maxlength="10" />
</div></th>
<td class="tdder">Sucursal :</td>
<td colspan="3" scope="col">
<input name="sucur" type="text" id="sucur" value="<?php echo $sucur ?>" size="20" maxlength="20" />
</td>
</tr>
<tr>
<td class="tdder">Apellidos y Nombres:</td>
<td colspan="3"><div align="left">
<input name="ape" type="text" id="ape" value="<?php echo $apes ?>" size="66" maxlength="65" />
</div></td>
<td class="tdder">Cogido Militar :</td>
<td colspan="2"><div align="left">
<input name="codigom" type="text" id="codigom" value="<?php echo $codm ?>" size="20" maxlength="20" />
</div></td>
</tr>
<tr>
<td class="tdder">Cedula No:</td>
<td width="104"><div align="left">
<input name="ced" type="text" id="ced" value="<?php echo $cedula ?>" size="20" maxlength="20" />
</div></td>
<td class="tdder">De:</td>
<td><div align="left">
<input name="ciuced" type="text" id="ciuced" value="<?php echo $ced_ciudad ?>" size="20" maxlength="20" />
</div></td>
<td class="tdder">Unidad :</td>
<td colspan="2"><div align="left">
<input name="uni" type="text" id="uni" value="<?php echo $unidad ?>" size="35" maxlength="35" />
</div></td>
</tr>
<tr>
<td class="tdder">Ciudad :</td>
<td><div align="left">
<input name="ciu" type="text" id="ciu" value="<?php echo $ciudad ?>" size="20" maxlength="20" />
</div></td>
<td class="tdder">Direccion :</td>
<td colspan="2"><div align="left">
<input name="dir" type="text" id="dir" value="<?php echo $direccion ?>" size="50" maxlength="50" />
</div></td>
<td class="tdder">Grado :</td>
<td width="69"><div align="left">
<input name="gra" type="text" id="gra" value="<?php echo $grado ?>" size="12" maxlength="10" />
</div></td>
</tr>
<tr>
<td class="tdder">Telefono :</td>
<td><div align="left">
<input name="tel" type="text" id="tel" value="<?php echo $telefono ?>" size="20" maxlength="20" />
</div></td>
<td class="tdder">Celular :</td>
<td>
<div align="left">
<input name="cel" type="text" id="cel" value="<?php echo $celular ?>" size="20" maxlength="20" />
</div></td>
<td class="tdder">E-mail :</td>
<td colspan="2"><div align="left">
<input name="email" type="text" id="email" value="<?php echo $email ?>" size="35" maxlength="35" />
</div></td>
</tr>
<tr>
<td class="tdder">Plan :</td>
<td><div align="left">
<input name="plant" type="text" id="plant" value="<?php echo $plant ?>" size="5" maxlength="5" />
<select name="plan" id="plan">
<option value="">-PLAN-</option>
<option value="SJ03">SJ03</option>
<option value="SJ04">SJ04</option>
<option value="SJ05">SJ05</option>
<option value="INT10">INT10</option>
<option value="INT11">INT11</option>
<option value="INT12">INT12</option>
</select>
</div></td>
<td class="tdder">Cuenta No :</td>
<td><div align="left">
<input name="cue" type="text" id="cue" value="<?php echo $numero_cuenta ?>" size="20" maxlength="20" />
</div></td>
<td class="tdder">Banco :</td>
<td colspan="2"><div align="left">
<input name="ban" type="text" id="ban" value="<?php echo $banco ?>" size="20" maxlength="20" />
</div></td>
</tr>
<tr>
<td class="tdder">Numero Contrato :</td>
<td><div align="left">
<input name="numcont" type="text" id="numcont" value="<?php echo $numero_contrato ?>" size="12" maxlength="10" />
</div></td>
<td class="tdder">Fecha Nacimiento :</td>
<td><div align="left">
<span class="tdder">dia-mes</span>
<input name="fechanac" type="text" id="fechanac" value="<?php echo $fechanac ?>" size="6" maxlength="6" />
</div></td>
<td class="tdder">Vendedor :</td>
<td colspan="2" align="left">
<input name="ase1" type="text" id="ase1" value="<?php echo $ase1 ?>" size="20" maxlength="20" />
</td>
</tr>
<tr>
<td class="tdder">Renovacion Cuotas :</td>
<td>
<input name="renovacion_cuotas" type="text" id="renovacion_cuotas" value="<?php echo $renovacion_cuotas ?>" size="20" maxlength="20" />
<td class="tdder">Permanencia :</td>
<td><div align="left">
<input name="permanencia" type="text" id="permanencia" value="<?php echo $permanencia?>" size="12" maxlength="10"/>
</div></td>
<td class="tdder">Numero libranza:</td>
<td colspan="2"><div align="left">
<input name="num_lib" type="text" id="num_lib" value="<?php echo $numero_libranza ?>" size="12" maxlength="12" />
</div></td>
</tr>
</table>
<p>
<label>
<input name="guardar" type="submit" class="direcciona" id="guardar" value="GENERA ALERTAS" />
<BR>
<input name="menu2" type="button" class="irmenu" id="menu2" onclick="window.location.href='aprobacion_contrato_empresa_privada.php'" value="IR AL MENU" />
</label>
</p>
</div>
</form>
</body>
</html>