File: /home/asjudine/public_html/includes/modificar_info_asjudinet.php
<?php
require_once("mainfile.php");
include ("config.php");
global $dbi;
if(isset($_POST["consultar"]))
{
$mssql = "select apellidos_noms, codigo, grado, direccion, celular, telefono, ciudad, email, entidad_laboral, fecha_nacimiento from datos_basicos_rc where cedula = '$ced'";
$control = mysql_query($mssql, $dbi) or die(mysql_error());
$num=mysql_num_rows($control);
list($apellidos_noms, $codigo, $grado, $direccion, $celular, $telefono, $ciudad, $email, $entidad_laboral, $fecha_nacimiento) = mysql_fetch_array($control);
$sqlnom3 = "select cedula, sucursal, pagaduria, unidad_desc, cod_desc, entidad_recaudo, libranza, fecha_libranza, val_contrato, cuotas, valor_cuota, contrato, tipo_contrato, beneficiarios, mes_inicio, ano_inicio, mes_termino, ano_termino, vendedor, renovacion from info_asjudinet where cedula = '$ced'";
$control3 = mysql_query($sqlnom3, $dbi) or die(mysql_error());
list($cedula, $sucursal, $pagaduria, $unidad_desc, $cod_desc, $entidad_recaudo, $libranza, $fecha_libranza, $val_contrato, $cuotas, $valor_cuota, $contrato, $tipo_contrato, $beneficiarios, $mes_inicio, $ano_inicio, $mes_termino, $ano_termino, $vendedor, $renovacion) = mysql_fetch_array($control3);
}
if(isset($_POST["grabar"]))
{
$sqlg = "insert into info_asjudinet(cedula, sucursal, pagaduria, unidad_desc, cod_desc, entidad_recaudo, libranza, fecha_libranza, val_contrato, cuotas, valor_cuota, contrato, tipo_contrato, beneficiarios, mes_inicio, ano_inicio, mes_termino, ano_termino, vendedor, renovacion)
value
('$cedb', '$suc', '$pag', '$uni', '$codcd', '$entrec', '$numlib', '$fecha_lib', '$valcon', '$numcuo','$valcuo', '$numcon', '$tipc' , '$numben', '$mes_inicio', '$aņo_inicio','$submt', '$at', '$vend', '$renovacion')";
mysql_query($sqlg, $dbi) or die(mysql_error());
$sqlg2 = "insert into datos_basicos_rc(cedula, apellidos_noms, codigo, grado, direccion, celular, telefono, ciudad, email, entidad_laboral, fecha_nacimiento)
value
('$cedb', '$apenom', '$cod', '$gra', '$dir', '$cel', '$tel', '$ciud','$email', '$entlab', '$fecha_nac')";
mysql_query($sqlg2, $dbi) or die(mysql_error());
$sqlg3 = "insert into reporte_mindefensa(codigo, cedula, nombre, grado, cod_desc, libranza, fecha_libranza, tipo_doc, valor_descuento, cuotas, pagaduria, mes_inicio, ano_inicio, mes_termino, ano_termino, proveedor) value
('$cod', '$cedb', '$apenom', '$gra', '$codcd', '$numlib', '$fecha_lib','LIB', '$valcuo','$numcuo', '$pag', '$mes_inicio', '$aņo_inicio','$submt', '$at', 'SERVIASJUDINET')";
mysql_query($sqlg3, $dbi) or die(mysql_error());
$sqlg4 = "insert into estado_contable(codigo, saldo_ant, cuotas_pend, nuevo_saldo, cuotas_desc, fecha_udesc) value ('$cod', '$valcon', '$numcuo', '$valcon', '0','')";
mysql_query($sqlg4, $dbi) or die(mysql_error());
echo "<script>alert('La informacion fue grabada correctamente');</script>";
}
$query_sql = "SELECT * FROM empresas order by nombre";
$sql = mysql_query($query_sql, $dbi) or die(mysql_error());
$row_sql = mysql_fetch_assoc($sql);
$totalRows_sql = mysql_num_rows($sql);
$query_sql2 = "SELECT * FROM descuentos order by codigo";
$sql2 = mysql_query($query_sql2, $dbi) or die(mysql_error());
$row_sql2 = mysql_fetch_assoc($sql2);
$totalRows_sql2 = mysql_num_rows($sql2);
$query_sql3 = "SELECT * FROM descuentos order by codigo";
$sql3 = mysql_query($query_sql3, $dbi) or die(mysql_error());
$row_sql3 = mysql_fetch_assoc($sql3);
$totalRows_sql3 = mysql_num_rows($sql3);
$query_sql4 = "SELECT * FROM vendedores order by vendedor";
$sql4 = mysql_query($query_sql4, $dbi) or die(mysql_error());
$row_sql4 = mysql_fetch_assoc($sql4);
$totalRows_sql4 = mysql_num_rows($sql4);
$query_sql5 = "SELECT * FROM sucursal order by nombre";
$sql5 = mysql_query($query_sql5, $dbi) or die(mysql_error());
$row_sql5 = mysql_fetch_assoc($sql5);
$totalRows_sql5 = mysql_num_rows($sql5);
$query_sql6 = "SELECT * FROM entidades_recaudo order by nombre";
$sql6 = mysql_query($query_sql6, $dbi) or die(mysql_error());
$row_sql6 = mysql_fetch_assoc($sql6);
$totalRows_sql6 = mysql_num_rows($sql6);
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Modificacion Datos basicos - Informacion Serviasjudinet</title>
<style type="text/css">
<!--
.Estilo10 { font-size: 14px;
font-weight: bold;
}
.Estilo12 {
font-size: 11px
}
.Estilo15 { font-size: 12px;
color: #000000;
font-weight: bold;
}
.campo1 { background-color: #B7FFFF;
border: thin dashed #B6B6B6;
}
.campo1 { font-family: "Courier New", Courier, monospace;
font-size: 16px;
font-style: normal;
font-weight: bold;
background-color: #E1EFFD;
border: thin doble #009999;
}
.campo1 {
font-family: "Courier New", Courier, monospace;
font-size: 11px;
color: #5151FF;
background-color: #C4E4FD;
border: thin solid #009999;
height: 18px;
width: auto;
}
.datos3 {
font-family: Arial, Helvetica, sans-serif;
font-size: 11px;
font-style: normal;
font-weight: normal;
color: #FF3300;
background-color: #A6ECD7;
margin: 4px;
padding: 4px;
border: medium groove #CCCCFF;
height: auto;
width: auto;
}
body {
background-color: #DCFAF3;
}
.campo {background-color: #FFFFCC; border:1px solid #990000; font-family:Arial; font-size:11px; height: inherit}
.Estilo50 {color: #CC3333;
font-family: "Arial Narrow";
font-weight: bold;
}
.Estilo1 { color: #FF6633;
font-size: 24px;
font-style: italic;
}
.Estilo2 { color: #FF6633;
font-size: 16px;
}
.Estilo3 { color: #2492FF;
font-weight: bold;
}
.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;
}
.datos2 {
font-family: "Courier New", Courier, monospace;
font-size: 10px;
font-style: normal;
font-weight: normal;
color: #0033FF;
background-color: #FFE2C6;
margin: 2px;
padding: 3px;
border: medium doble #EEBFEB;
}
.go {
font-family: "Times New Roman", Times, serif;
font-size: 9px;
font-style: normal;
color: #FF6633;
background-color: #FBDCBD;
padding: 1px;
height: auto;
width: auto;
border-top-style: solid;
border-right-style: solid;
border-bottom-style: solid;
border-left-style: solid;
}
.Estilo8 { font-size: 20px;
font-weight: bold;
}
.datos1 { font-family: Geneva, Arial, Helvetica, sans-serif;
font-size: 16px;
font-style: normal;
text-decoration: blink;
background-color: #CCFFCC;
margin: 5px;
padding: 7px;
height: auto;
width: auto;
border: thin solid #0099FF;
}
.datos1 { font-family: Georgia, "Times New Roman", Times, serif;
font-size: 16px;
background-color: #FDE0C1;
margin: 2px;
padding: 3px;
border: medium doble #DBAED7;
}
.datos1 {
font-family: Georgia, "Times New Roman", Times, serif;
font-size: 11px;
font-weight: normal;
background-color: #B8F5E8;
margin: 4px;
padding: 5px;
border: thin outset #009999;
}
.Estilo51 {font-size: 16px}
.Estilo54 {
color: #FF3300;
font-weight: bold;
}
.Estilo55 {
font-size: 11px;
font-weight: bold;
}
.Estilo56 {font-size: 11px}
.Estilo59 {font-size: 15px}
-->
</style>
</head>
<body>
<form id="form1" name="form1" method="post" action="">
<div align="center">
<table width="727" border="3" cellpadding="3" cellspacing="3" class="datos3">
<caption>
<div align="center"><strong><span class="Estilo12"><br />
</span></strong>
<table width="330" border="3" cellpadding="3" cellspacing="3" class="recaudo">
<caption>
<span class="Estilo1">SERVIASJUDINET</span>
</caption>
<tr>
<th colspan="2" scope="col"><label>Digite el Numero de Cedula </label></th>
</tr>
<tr>
<td width="162"><div align="center"><span class="Estilo2">CEDULA : </span></div></td>
<td width="135"><div align="center">
<input name="ced" type="text" id="ced" size="20" maxlength="20" />
</div></td>
</tr>
<tr>
<td colspan="2"><div align="center">
<input name="consultar" type="submit" class="Estilo3" id="consultar" value="Consultar" />
</div></td>
</tr>
</table>
<strong><br />
</strong>
<table width="691" border="3" cellpadding="3" cellspacing="3" class="datos2">
<caption>
<span class="Estilo8"><br />
<span class="Estilo59">DATOS BASICOS </span></span>
</caption>
<tr>
<td width="132"><div align="right"><span class="Estilo55">Apellidos y Nombres :</span></div></td>
<td colspan="3"><div align="left">
<input name="apenom" type="text" class="campo1" id="apenom" value="<?php echo $apellidos_noms ?>" size="50" maxlength="50" />
</div></td>
</tr>
<tr>
<td><div align="center" class="Estilo55">
<div align="right">Cedula : </div>
</div></td>
<td width="123"><div align="left">
<input name="cedb" type="text" class="campo1" id="cedb" value="<?php echo $cedula ?>" size="15" maxlength="15" />
</div></td>
<td width="83"><div align="center" class="Estilo55">
<div align="right">Codigo : </div>
</div></td>
<td width="298"><div align="left">
<input name="cod" type="text" class="campo1" id="cod" value="<?php echo $codigo ?>" size="15" maxlength="15" />
</div></td>
</tr>
<tr>
<td><div align="center" class="Estilo55">
<div align="right">Grado : </div>
</div></td>
<td><div align="left">
<input name="gra" type="text" class="campo1" id="gra" value="<?php echo $grado ?>" size="15" maxlength="15" />
</div></td>
<td><div align="center" class="Estilo55">
<div align="right">Direccion : </div>
</div></td>
<td><div align="left">
<input name="dir" type="text" class="campo1" id="dir" value="<?php echo $direccion ?>" size="40" maxlength="40" />
</div></td>
</tr>
<tr>
<td><div align="center" class="Estilo55">
<div align="right">Celular : </div>
</div></td>
<td><div align="left">
<input name="cel" type="text" class="campo1" id="cel" value="<?php echo $celular ?>" size="15" maxlength="15" />
</div></td>
<td><div align="center" class="Estilo55">
<div align="right">Telefono : </div>
</div></td>
<td><div align="left">
<input name="tel" type="text" class="campo1" id="tel" value="<?php echo $telefono ?>" size="15" maxlength="15" />
</div></td>
</tr>
<tr>
<td><div align="center" class="Estilo55">
<div align="right">Fecha Nacimiento : </div>
</div></td>
<td><div align="left">
<input name="fecha_nac" type="text" class="campo1" id="fecha_nac" value="<?php echo $fecha_nacimiento ?>" size="6" maxlength="5" />
<span class="Estilo54">MES-DIA </span></div></td>
<td> </td>
<td> </td>
</tr>
<tr>
<td><div align="center" class="Estilo55">
<div align="right">Ciudad : </div>
</div></td>
<td colspan="3"><div align="left">
<input name="ciud" type="text" class="campo1" id="ciud" value="<?php echo $ciudad ?>" size="25" maxlength="25" />
</div></td>
</tr>
<tr>
<td><div align="center" class="Estilo55">
<div align="right">Email : </div>
</div></td>
<td colspan="3"><div align="left">
<input name="email" type="text" class="campo1" id="email" value="<?php echo $email ?>" size="25" maxlength="25" />
</div></td>
</tr>
<tr>
<td><div align="center" class="Estilo55">
<div align="right">Entidad Laboral: </div>
</div></td>
<td colspan="3"><div align="left">
<input name="entlab" type="text" class="campo1" id="entlab" value="<?php echo $entidad_laborall ?>" size="45" maxlength="45" />
</div></td>
</tr>
</table>
<strong><br />
<br />
<span class="Estilo51">INFORMACION SERVIASJUDINET </span><br />
</strong>
<label></label>
</div>
</caption>
<tr>
<th width="113" scope="col"><div align="right"><span class="Estilo12">Sucursal : </span></div></th>
<th width="213" scope="col"><div align="left">
<input name="suc" type="text" class="campo1" id="suc" value="<?php echo $sucursal ?>" size="30" maxlength="30" />
</div></th>
<th width="138" scope="col"><div align="right"><span class="Estilo12">Pagaduria : </span></div></th>
<th width="208" scope="col"><input name="pag" type="text" class="campo1" id="pag" value="<?php echo $pagaduria ?>" size="30" maxlength="30" /></th>
</tr>
<tr>
<th scope="col"> </th>
<th scope="col"><div align="left">
<select name="suc2" id="suc2">
<option value="">--SELECCIONE SUCURSAL--</option>
<?php
do {
?>
<option value="<?php echo $row_sql5['codigo'];?>"><?php echo $row_sql5['nombre']?></option>
<?php
} while ($row_sql5 = mysql_fetch_assoc($sql5));
$rows5 = mysql_num_rows($sql5);
if($rows5 > 0) {
mysql_data_seek($sql5, 0);
$row_sql5 = mysql_fetch_assoc($sql5);
}
?>
</select>
</div></th>
<th scope="col"> </th>
<th scope="col"><div align="left">
<select name="pag2" id="pag2">
<option value="">--SELECCIONE PAGADURIA--</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>
</div></th>
</tr>
<tr>
<td height="30"><div align="center" class="Estilo12">
<div align="right"><strong>Unidad Descuento :</strong></div>
</div></td>
<td><div align="left">
<input name="uni" type="text" class="campo1" id="uni" value="<?php echo $unidad_desc ?>" size="6" maxlength="6" />
</div>
<label>
<div align="left"></div>
</label></td><td><div align="center" class="Estilo12">
<div align="right"><strong>Codigo Descuento : </strong></div>
</div></td>
<td><label>
</label>
<div align="left">
<input name="code" type="text" class="campo1" id="code" value="<?php echo $cod_desc ?>" size="6" maxlength="6" />
</div></td>
</tr>
<tr>
<td height="30"> </td>
<td><div align="left">
<select name="uni2" id="uni2">
<option value="">--SELECIONE UNIDAD--</option>
<?php
do {
?>
<option value="<?php echo $row_sql2['unidad'];?>"><?php echo $row_sql2['unidad']?></option>
<?php
} while ($row_sql2 = mysql_fetch_assoc($sql2));
$rows2 = mysql_num_rows($sql2);
if($rows2 > 0) {
mysql_data_seek($sql2, 0);
$row_sql2 = mysql_fetch_assoc($sql2);
}
?>
</select>
</div></td>
<td> </td>
<td> </td>
</tr>
<tr>
<td height="30"><div align="center" class="Estilo12">
<div align="right"><strong>Entidad Recaudo :</strong></div>
</div></td>
<td><div align="left">
<input name="ent" type="text" class="campo1" id="ent" value="<?php echo $entidad_recaudo ?>" size="30" maxlength="30" />
</div> <label></label></td>
<td><div align="center" class="Estilo12">
<div align="right"><strong>Codigo Vendedor :</strong></div>
</div></td>
<td><div align="left">
<input name="ven" type="text" class="campo1" id="ven" value="<?php echo $vendedor ?>" size="30" maxlength="30" />
</div></td>
</tr>
<tr>
<td height="30"> </td>
<td><div align="left">
<select name="ent2" id="ent2">
<option value="">--SELECIONE ENTIDAD--</option>
<?php
do {
?>
<option value="<?php echo $row_sql6['codigo'];?>"><?php echo $row_sql6['nombre']?></option>
<?php
} while ($row_sql6 = mysql_fetch_assoc($sql6));
$rows6 = mysql_num_rows($sql6);
if($rows6 > 0) {
mysql_data_seek($sql6, 0);
$row_sql6 = mysql_fetch_assoc($sql6);
}
?>
</select>
</div></td>
<td> </td>
<td><div align="left">
<select name="ven2" id="ven2">
<option value="">--SELECIONE VENDEDOR--</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>
</div></td>
</tr>
<tr>
<td><div align="center" class="Estilo12">
<div align="right"><strong>Numero Libranza : </strong></div>
</div></td>
<td><div align="left">
<input name="numlib" type="text" class="campo1" id="numlib" value="<?php echo $libranza ?>" size="15" maxlength="15" />
</div></td>
<td><div align="center" class="Estilo12">
<div align="right"><strong>Valor Contrato : </strong></div>
</div></td>
<td><div align="left">
<input name="valcon" type="text" class="campo1" id="valcon" value="<?php echo $val_contrato ?>" size="15" maxlength="15" />
</div></td>
</tr>
<tr>
<td><div align="center" class="Estilo12">
<div align="right"><strong>Numero Cuotas : </strong></div>
</div></td>
<td><div align="left">
<input name="numcuo" type="text" class="campo1" id="numcuo" value="<?php echo $cuotas ?>" size="4" maxlength="2" />
</div></td>
<td><div align="center" class="Estilo12">
<div align="right"><strong>Valor Cuota: </strong></div>
</div></td>
<td><div align="left">
<input name="valcuo" type="text" class="campo1" id="valcuo" value="<?php echo $valor_cuota ?>" size="15" maxlength="15" />
</div></td>
</tr>
<tr>
<td><div align="center" class="Estilo12">
<div align="right"><strong>Numero Contrato : </strong></div>
</div></td>
<td><div align="left">
<input name="numcon" type="text" class="campo1" id="numcon" value="<?php echo $contrato ?>" size="15" maxlength="15" />
</div></td>
<td><div align="center" class="Estilo12">
<div align="right"><strong>Tipo Contrato : </strong></div>
</div></td>
<td><div align="left">
<input name="tipc" type="text" class="campo1" id="tipc" value="<?php echo $tipo_contrato ?>" size="8" maxlength="8" />
</div></td>
</tr>
<tr>
<td><div align="center" class="Estilo12">
<div align="right"><strong>Inicio Pagos :</strong></div>
</div></td>
<td><span class="Estilo15">MES</span>-
<input name="mes_inicio" type="text" class="campo1" id="mes_inicio" value="<?php echo $mes_inicio ?>" size="2" maxlength="2" readonly=""/>
<label></label>
-<span class="Estilo15">AÑO</span>-
<input name="año_inicio" type="text" class="campo1" id="año_inicio" value="<?php echo $aņo_inicio ?>" size="5" maxlength="4" /></td>
<td><div align="center" class="Estilo10">
<div align="right"><span class="Estilo56">Fecha Termino </span>:</div>
</div></td>
<td><span class="Estilo15">MES</span>-
<input name="mes_term" type="text" class="campo1" id="mes_term" value="<?php echo $mes_termino ?>" size="2" maxlength="2" readonly=""/>
-<span class="Estilo15">AÑO</span>-
<input name="año_term" type="text" class="campo1" id="año_term" value="<?php echo $aņo_termino ?>" size="5" maxlength="4" readonly=""/></td>
</tr>
<tr>
<td height="30"><div align="center" class="Estilo12">
<p align="right"><strong>Fecha Afiliacion</strong><strong>:</strong></p>
</div></td>
<td bordercolor="#1941A5"><label>
</label>
<div align="left">
<input name="fecha_lib" type="text" class="campo1" id="fecha_lib" value="<?php echo $fecha_libranza ?>" size="10" maxlength="10" />
</div></td>
<td><div align="center" class="Estilo12">
<div align="right"><strong>Numero Beneficiarios : </strong></div>
</div></td>
<td><div align="left">
<input name="numben" type="text" class="campo1" id="numben" value="<?php echo $beneficiarios ?>" size="4" maxlength="2" />
</div></td>
</tr>
<tr>
<td height="22"><div align="right"><strong>Renovacion</strong><strong>:</strong></div></td>
<td bordercolor="#1941A5"><label>
<input name="numcuo2" type="text" class="campo1" id="numcuo2" value="<?php echo $cuotas ?>" size="4" maxlength="2" />
<div align="left"></div>
<div align="left"></div>
<div align="left"></div>
</label></td>
<td colspan="2" rowspan="2"> </td>
</tr>
<tr>
<td height="30"> </td>
<td bordercolor="#1941A5"><div align="left">
<select name="ren2" id="ren2">
<option value="0" selected="selected">-SELECCIONE RENOVACION-</option>
<option value="S">SI</option>
<option value="N">NO</option>
</select>
</div></td>
</tr>
</table>
</div>
<p align="center">
<input name="grabar" type="submit" class="Estilo3" id="grabar" value="Enviar" />
</p>
<p align="center">
<input name="menu2" type="button" class="Estilo50" id="menu2" onclick="window.location.href='menu_datos_cartera_servi.php'" value="IR AL MENU" />
</p>
</form>
</body>
</html>