File: /home/asjudine/public_html/afinanciera/cartera_cambio_contrato.php
<?php
global $dbi;
$espacio = ' ';
$linea = '-';
require_once("../Conectarse.php");
$control = mysql_query('SELECT cedula, codigo_militar, nombre, grado, numerocontrato, tipocontrato , numero_libranza , tipo_afiliado, codigo_sucursal, direccion , telefono, celular, ciudad , email, cuenta, banco, entidad_laboral, unidad_descuento, codigo_descuento, entidad_recaudo, fecha_nacimiento, fecha_afiliacion, valorcontrato, numerocuotas, valorcuota, fecha_inicio_contrato, fecha_termino_contrato, fecha_ultimo_registro, mes_inicio, ano_inicio, mes_termino, ano_termino, saldoanteior, cuotaspendientes, cuotasdescontadas, saldonuevo, vendedor, director, beneficiarios, renovacion, causal_terminacion, fecha_terminacion, estado FROM cartera_serviasjudinet WHERE cedula = "' . $_GET["ced2"] . '" and numerocontrato = "' . $_GET["numcon"] . '" ');
if (!$control) {
die('Invalid query 1: ' . mysql_error());
}
$num=mysql_num_rows($control);
list($cedula, $codi, $apes, $grad, $numero_contrato, $plan, $numero_libranza, $titular, $sucur, $dire, $tele, $celul, $ciue, $email, $numero_cuenta, $banco, $enti, $unides, $codides, $entre, $fecna, $fecafi, $valcon, $numcuo, $valcuo, $fechainicio, $fechatermino, $fechaul, $mesini, $anoini, $mesfin, $anofin, $salant, $cupen, $cudesc, $salnue, $ven, $director, $bene, $renova, $causal, $fechater, $esta) = mysql_fetch_row($control);
$inipag = $anoini.'-'.$mesini;
$cont10 = mysql_query('SELECT nombre FROM entidad_laboral WHERE codigo = "' . "$enti". '"');
if (!$cont10) {
die('Invalid query 2: ' . mysql_error());
}
list($enti) = mysql_fetch_row($cont10);
$cont10 = mysql_query('SELECT nombre FROM director_ventas WHERE codigo = "' . "$director". '"');
if (!$cont10) {
die('Invalid query 3: ' . mysql_error());
}
list($director) = mysql_fetch_row($cont10);
$cont10 = mysql_query('SELECT concepto FROM descuentos WHERE id = "' . "$entre". '"');
if (!$cont10) {
die('Invalid query 11: ' . mysql_error());
}
list($entre) = mysql_fetch_row($cont10);
$cont10 = mysql_query('SELECT vendedor FROM vendedores WHERE codigo = "' . "$ven". '" ');
if (!$cont10) {
die('Invalid query 12: ' . mysql_error());
}
list($ven) = mysql_fetch_row($cont10);
/*list($cedula, $ced_ciudad, $apes, $fecafi,$dire, $ciue, $tele, $celul, $email, $deven, $desc, $sala, $uni, $mon, $codigo_plan, $numero_cuenta, $banco, $codigo_asesor, $codi, $grad, $sucur, $numero_libranza, $valcuo, $valcon, $fecna, $numero_contrato) = mysql_fetch_row($resu);*/
$cont = mysql_query('SELECT nombre FROM sucursal WHERE codigo = "' . "$sucur". '" ');
if (!$cont) {
die('Invalid query cont: ' . mysql_error());
}
list($sucur) = mysql_fetch_row($cont);
if(isset($_POST["guardar"]))
{
$consultass = mysql_query('SELECT codigo_contrato, cantidad_procesos, numero_bene FROM planes_contratos WHERE codigo_contrato = "' . $_POST[plan] . '" ');
if (!$consultass) {
die('Invalid query consultass : ' . mysql_error());
}
list($planta, $canpro, $canben) = mysql_fetch_row($consultass);
$proceso = mysql_query('SELECT * FROM procesos WHERE numero_contrato= "' . $_GET[numcon] . '" and tipo_contrato= "' . $_GET[tipoa] . '"');
if (!$proceso) {
die('Invalid query proceso: ' . mysql_error());
}
$beneficiario = mysql_query('SELECT * FROM beneficiarios WHERE numero_contrato_titular= "' . $_GET[numcon] . '" and tipo_contrato_titular= "' . $_GET[tipoa] . '" ');
if (!$beneficiario) {
die('Invalid query beneficiario: ' . mysql_error());
}
$pross = mysql_num_rows($proceso);
$benn = mysql_num_rows($beneficiario);
//echo " $pross <= $canpro,,,,, $benn <= $canben---$planta ";
if ($canpro >= $pross)
{
if ($canben >= $benn)
{
$dis = date("d");
$mes = date("m");
$anos = date("Y");
$mt = floor(($mes_inicio + $numcuo)/12);
$submt = (($mes_inicio + $numcuo)%12)-1;
$at = $mt + $ano_inicio;
if($submt==0)
{
$submt = 12;
$at = $at-1;
}
$control3 = mysql_query('SELECT codigo, unidad FROM descuentos WHERE id = "' . "$unidt2". '" ');
if (!$control3) {
die('Invalid query: ' . mysql_error());
}
list($codcd, $unidt) = mysql_fetch_row($control3);
$res = mysql_query('SELECT cedula, nombre FROM cartera_serviasjudinet WHERE cedula = "'.$_GET["ced2"].'" ');
if (!$res) {
die('Invalid query PES: ' . mysql_error());
}
$rest=mysql_num_rows($res);
list($cedud, $nombr) = mysql_fetch_row($res);
$inipag = $_POST[ano_inicio] .'-'.$_POST[mes_inicio];
$finpag = $at.'-'.$submt;
$res = mysql_query('SELECT codigo FROM sucursal WHERE nombre = "' . $_POST[sucur] . '" ');
if (!$res) {
die('Invalid query sucursal: ' . mysql_error());
}
list($codigo_sucursal) = mysql_fetch_row($res);
if ( $plan == 0)
{
$res = mysql_query('SELECT codigo_contrato FROM planes_contratos WHERE codigo_contrato = "' . $_POST[plant] . '" ');
if (!$res) {
die('Invalid query sucursal: ' . mysql_error());
}
list($plan) = mysql_fetch_row($res);
}
else
{
$res = mysql_query('SELECT codigo_contrato FROM planes_contratos WHERE codigo_contrato = "' . $_POST[plan] . '" ');
if (!$res) {
die('Invalid query sucursal: ' . mysql_error());
}
list($plan) = mysql_fetch_row($res);
}
$control6 = mysql_query('SELECT codigo, numero_bene FROM planes_contratos WHERE codigo_contrato = "' ."$plan". '"');
if (!$control6) {
die('Invalid query BIEN: ' . mysql_error());
}
list($cod_p, $numben) = mysql_fetch_row($control6);
$cont10 = mysql_query('SELECT codigo FROM entidad_laboral WHERE nombre = "' . $_POST[entidad] . '" ');
if (!$cont10) {
die('Invalid query 2: ' . mysql_error());
}
list($entidad) = mysql_fetch_row($cont10);
$cont10 = mysql_query('SELECT codigo FROM director_ventas WHERE nombre = "' . $_POST[director] . '"');
if (!$cont10) {
die('Invalid query 3: ' . mysql_error());
}
list($director) = mysql_fetch_row($cont10);
$cont10 = mysql_query('SELECT id FROM descuentos WHERE concepto = "' . $_POST[recaudo] . '" ');
if (!$cont10) {
die('Invalid query 11: ' . mysql_error());
}
list($recaudo) = mysql_fetch_row($cont10);
$cont10 = mysql_query('SELECT codigo FROM vendedores WHERE vendedor = "' . $_POST[vendedor] . '" ');
if (!$cont10) {
die('Invalid query 12: ' . mysql_error());
}
list($vendedor) = mysql_fetch_row($cont10);
$mssql4 = mysql_query("INSERT INTO cartera_serviasjudinet (cedula, codigo_militar, nombre, grado , numerocontrato, tipocontrato, numero_libranza, tipo_afiliado, codigo_sucursal, direccion, telefono, celular, ciudad, email, cuenta, banco, entidad_laboral, unidad_descuento, codigo_descuento, entidad_recaudo, fecha_nacimiento, fecha_afiliacion, valorcontrato, numerocuotas, valorcuota, fecha_inicio_contrato, fecha_termino_contrato, fecha_ultimo_registro, mes_inicio, ano_inicio, mes_termino, ano_termino, saldoanteior, cuotaspendientes, cuotasdescontadas, saldonuevo, vendedor, director, renovacion, causal_terminacion, estado,cifin) VALUES ('" . $_POST["cedb"] . "', '" . $_POST["cod"] . "', '" . $_POST["apenom"] . "', '" . $_POST["gra"] . "', '" . $_POST["numcont"] . "', '" .$_POST["plan"]. "', '" . $_POST["num_lib"] . "', 'TITULAR', '" ."$codigo_sucursal". "' , '" . $_POST["dire"] . "', '" . $_POST["tel"] . "', '" . $_POST["cel"] . "', '" . $_POST["ciud"] . "', '" . $_POST["email"] . "', '" .$_POST["cue"] . "', '" .$_POST["ban"] . "', '" . "$entidad". "', '" .$_POST["unidt"]. "', '" .$_POST["codcd"]. "', '" ."$recaudo". "', '" . $_POST["fecna"] . "', '" . $_POST["fechas"] . "', '" . $_POST["valcon"] . "', '" . $_POST["numcuo"] . "', '" . $_POST["valcuo"] . "', '" . $_POST["fechainicio"] . "', '" . $_POST["fechatermino"] . "', '', '" . $_POST["mes_inicio"] . "', '" . $_POST["ano_inicio"] . "', '" ."$submt". "', '" ."$at". "', '" . $_POST["salant"] . "', '" . $_POST["cuopen"] . "', '" . $_POST["cuodesc"] . "', '" . $_POST["salnue"] . "', '" . "$vendedor". "', '" . "$director". "', 'S', '', '1','" . $_POST["cifin"] . "' )");
if (!$mssql4) {
die('Invalid query cartera_serviasjudinet insertar: ' . mysql_error());
}
$mss = mysql_query("INSERT INTO reporte_pagadurias (cedula, codigo, nombre, grado, contrato, plan, libranza, fecha_contrato, valor_contrato, fecha_libranza, valor_descuento, cuotas, pagaduria, mesini_pago, anoini_pago, mesfin_pago, anofin_pago, tipo, codigo_descuento, unidad ,estado) VALUES ('" . $_POST["cedb"] . "', '" . $_POST["cod"] . "', '" . $_POST["apenom"] . "', '" . $_POST["gra"] . "', '" . $_POST["numcont"] . "', '" .$_POST["plan"]. "', '" . $_POST["num_lib"] . "', '" . $_POST["fechainicio"] . "', '" . $_POST["valcon"] . "', '" . $_POST["fechas"] . "', '" . $_POST["valcuo"] . "', '" . $_POST["numcuo"] . "', '" . $_POST["entidad"] . "', '" . $_POST["mes_inicio"] . "', '" . $_POST["ano_inicio"] . "', '" ."$submt". "', '" ."$at". "', 'JUR', '" . $_POST["codcd"] . "', '" . $_POST["unidt"] . "' ,'0')");
if (!$mss) {
die('Invalid query reporte_minidefensa insertar: ' . mysql_error());
}
$mssql = mysql_query("UPDATE beneficiarios set numero_contrato_titular = '" . $_POST[numcont] . "', tipo_contrato_titular= '" . $_POST[plan] . "' WHERE numero_contrato_titular = '" . $_GET[numcon] . "' and tipo_contrato_titular= '" . $_GET[tipoa] . "'");
if (!$mssql) {
die('Invalid query primer UPDATE: ' . mysql_error());
}
$msdwd = mysql_query("UPDATE procesos set numero_contrato = '" . $_POST[numcont] . "', tipo_contrato= '" . $_POST[plan] . "' WHERE numero_contrato= '" . $_GET[numcon] . "' and tipo_contrato= '" . $_GET[tipoa] . "'");
if (!$msdwd) {
die('Invalid query primer msdwd: ' . mysql_error());
}
$control = mysql_query("UPDATE control_procesos set contrato = '" . $_POST[numcont] . "', tipo= '" . $_POST[plan] . "' WHERE contrato= '" . $_GET[numcon] . "' and tipo= '" . $_GET[tipoa] . "'");
if (!$control) {
die('Invalid query primer control: ' . mysql_error());
}
$susta = mysql_query("UPDATE control_sustanciacion set contrato = '" . $_POST[numcont] . "', tipo= '" . $_POST[plan] . "' WHERE contrato= '" . $_GET[numcon] . "' and tipo= '" . $_GET[tipoa] . "'");
if (!$susta) {
die('Invalid query primer sustSSSSSa: ' . mysql_error());
}
$califi = mysql_query("UPDATE calificacion_servicio_juridico set numero_contrato = '" . $_POST[numcont] . "', tipo_contrato = '" . $_POST[plan] . "' WHERE numero_contrato= '" . $_GET[numcon] . "' and tipo_contrato= '" . $_GET[tipoa] . "'");
if (!$califi) {
die('Invalid query primer califi: ' . mysql_error());
}
$comisi = mysql_query("UPDATE comisiones_ventas set contrato = '" . $_POST[numcont] . "', tipo = '" . $_POST[plan] . "' WHERE contrato= '" . $_GET[numcon] . "' and tipo= '" . $_GET[tipoa] . "'");
if (!$comisi) {
die('Invalid query primer comisi: ' . mysql_error());
}
$terminacion = date("Y").'-'.date("m").'-'.date("d");
/////SE MODIFICA EL NUMERO DE LIBRANZA DICHO POR LORENA BLANCO EL DIA 21/05/2013 A LAS 2:58 PM
$cartera = mysql_query("UPDATE cartera_serviasjudinet set estado = '0', causal_terminacion = 'POR CAMBIO DE CONTRATO', fecha_terminacion = '" .$terminacion. "' WHERE cedula = '" . $_GET[ced2] . "' and numerocontrato = '" . $_GET[numcon] . "' and tipocontrato = '" . $_GET[tipoa] . "'");
if (!$cartera) {
die('Invalid query primer cartera: ' . mysql_error());
}
echo "<script>alert('La Informacion Fue Grabada Correctamente');</script>";
}
else
{
echo "<script>alert('Cantidad de Beneficiarios es mayor al Cambio de Plan Solicitado $canpro----$canben');</script>";
}
}
else
{
echo "<script>alert('Cantidad de Procesoso es mayor al Cambio de Plan Solicitado');</script>";
}
}
$sql = mysql_query('SELECT * FROM entidad_laboral order by nombre ');
if (!$sql) {
die('Invalid query: ' . mysql_error());
}
$row_sql = mysql_fetch_assoc($sql);
$totalRows_sql = mysql_num_rows($sql);
$sql2 = mysql_query('SELECT * FROM descuentos WHERE estado = "1" order by codigo ');
if (!$sql2) {
die('Invalid query: ' . 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: ' . mysql_error());
}
$row_sql3 = mysql_fetch_assoc($sql3);
$totalRows_sql3 = mysql_num_rows($sql3);
$sql4 = mysql_query('SELECT * FROM vendedores WHERE 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);
$sql6 = mysql_query('SELECT * FROM descuentos WHERE estado = "1" order by codigo ');
if (!$sql6) {
die('Invalid query: ' . mysql_error());
}
$row_sql6 = mysql_fetch_assoc($sql6);
$totalRows_sql6 = mysql_num_rows($sql6);
$sql7 = mysql_query('SELECT * FROM director_ventas WHERE estado = "1" order by nombre');
if (!$sql7) {
die('Invalid query: ' . mysql_error());
}
$row_sql7 = mysql_fetch_assoc($sql7);
$totalRows_sql7 = mysql_num_rows($sql7);
$sql8 = mysql_query('SELECT * FROM planes_contratos WHERE estado = "1" order by codigo ');
if (!$sql8) {
die('Invalid query: ' . mysql_error());
}
$row_sql8 = mysql_fetch_assoc($sql8);
$totalRows_sql8 = mysql_num_rows($sql8);
?>
<!DOCTYPE HTML>
<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>Cambio Plan Contrato</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
}
}
function valida_envia(){
//valido LOS APELLIDOS
if (document.form1.ape.value.length==0){
alert("Tiene que escribir sus apellidos")
document.form1.ape.focus()
return (false);
}
//valido el nombre
if (document.form1.noms.value.length==0){
alert("Tiene que escribir sus nombres")
document.form1.noms.focus()
return (false);
}
//valido la cedula
if (document.form1.ced.value.length==0){
alert("Tiene que escribir el numero de cedula")
document.form1.ced.focus()
return (false);
}
return (true);
}
</script>
</head>
<body >
<form action="" method="post" onsubmit="return valida_envia()" enctype="multipart/form-data" name="form1" id="form1">
<header>
<img src="../ELEMENTS/bannerInterasjudinet.png" alt="" width=" 700" height="70">
</header>
<div class="Estilo1">
<h3 class="titulo">CAMBIO PLAN CONTRATO</h3>
<table width="822" height="397" border="2" cellpadding="1" cellspacing="1" class="sol_cre1">
<caption>
<div align="center">
<h3 class="titulo">INGRESAR DATOS</h3>
</caption>
<tr>
<td class="tdder"> </td>
<td class="tdder">Fecha Afiliacion :</td>
<td class="tdizq">
<input name="fechas" type="text" id="fechas" value="0000-00-00" size="10" maxlength="10" />
</th>
<td class="tdder">Sucursal :</td>
<td colspan="3" class="tdizq"><input name="sucur" type="text" id="sucur" value="<?php echo $sucur ?>" size="20" maxlength="20"/>
</th>
</tr>
<tr>
<td class="tdder">Apellidos y Nombres:</td>
<td colspan="3" class="tdizq"><input name="apenom" type="text" id="apenom" value="<?php echo $apes ?>" size="60" maxlength="65" readonly/></td>
<td class="tdder">Cedula No:</td>
<td class="tdizq">
<input name="cedb" type="text" id="cedb" value="<?php echo $cedula ?>" size="20" maxlength="20" readonly />
</td>
</tr>
<tr>
<td class="tdder">Cogido Militar:</td>
<td class="tdizq">
<input name="cod" type="text" id="cod" value="<?php echo $codi ?>" size="14" maxlength="20" readonly/>
</td>
<td class="tdder">Grado :</td>
<td class="tdizq">
<input name="gra" type="text" id="gra" value="<?php echo $grad ?>" size="12" maxlength="10" readonly/>
</td>
<td class="tdder">Fecha Nacimiento :</td>
<td class="tdizq"><input name="fecna" type="text" id="fecna" value="<?php echo $fecna ?>" size="5" maxlength="5" readonly/>
<span class="tdder">DIA-MES</span> </td>
</tr>
<tr>
<td class="tdder">Ciudad :</td>
<td class="tdizq">
<input name="ciud" type="text" id="ciud" value="<?php echo $ciue ?>" size="14" maxlength="20" readonly/>
</td>
<td class="tdder">Direccion :</td>
<td colspan="2" class="tdizq">
<input name="dire" type="text" id="dire" value="<?php echo $dire ?>" size="45" maxlength="45" readonly/>
</td>
</tr>
<tr>
<td class="tdder">Telefono :</td>
<td class="tdizq">
<input name="tel" type="text" id="tel" value="<?php echo $tele ?>" size="10" maxlength="20" readonly/>
</td>
<td class="tdder">Celular :</td>
<td class="tdizq">
<input name="cel" type="text" id="cel" value="<?php echo $celul ?>" size="20" maxlength="20" readonly/>
</td>
<td class="tdder">E-mail :</td>
<td colspan="2" class="tdizq">
<input name="email" type="text" id="email" value="<?php echo $email ?>" size="30" maxlength="35" readonly/>
</td>
</tr>
<tr>
<td class="tdder">Cuenta No :</td>
<td class="tdizq">
<input name="cue" type="text" id="cue" value="<?php echo $numero_cuenta ?>" size="20" maxlength="20" readonly/>
</td>
<td class="tdder">Banco :</td>
<td class="tdizq">
<input name="ban" type="text" id="ban" value="<?php echo $banco ?>" size="20" maxlength="20" readonly/>
</td>
<td class="tdder">Numero libranza:</td>
<td class="tdizq">
<input name="num_lib" type="text" id="num_lib" value="<?php echo $numero_libranza ?>" size="12" maxlength="12"/>
</td>
</tr>
<tr>
<td class="tdder">Vendedor :</td>
<td class="tdizq"><input name="vendedor" type="text" id="vendedor" value="<?php echo $ven ?>" size="30" maxlength="30" readonly/></td>
</tr>
<tr>
<td class="tdder">Plan :</td>
<td class="tdizq">
<select name="plan" id="plan">
<option value="0">-PLAN-</option>
<?php
do {
?>
<option value="<?php echo $row_sql8['codigo_contrato'];?>"><?php echo $row_sql8['codigo_contrato']?></option>
<?php
} while ($row_sql8 = mysql_fetch_assoc($sql8));
$rows8 = mysql_num_rows($sql8);
if($rows8 > 0) {
mysql_data_seek($sql8, 0);
$row_sql8 = mysql_fetch_assoc($sql8);
}
?>
</select>
</td>
<td class="tdder">Numero Contrato :</td>
<td class="tdizq">
<input name="numcont" type="text" id="numcont" value="<?php echo $numero_contrato ?>" size="12" maxlength="10" />
</td>
<td class="tdder">Valor Contrato :</td>
<td class="tdizq">
<input name="valcon" type="text" id="valcon" value="" size="12" maxlength="10" />
</td>
</tr>
<tr>
<td class="tdder">Numero de Cuotas:</td>
<td class="tdizq">
<input name="numcuo" type="text" id="numcuo" value="" size="12" maxlength="12" />
</td>
<td class="tdder">Valor Cuota :</td>
<td class="tdizq">
<input name="valcuo" type="text" id="valcuo" value="" size="12" maxlength="12" />
</td>
<td class="tdder">Cuotas Pendientes :</td>
<td class="tdizq">
<input name="cuopen" type="text" id="cuopen" value="" size="12" maxlength="10" />
</td>
</tr>
<tr>
<td class="tdder">Cuotas Descontadas:</td>
<td class="tdizq">
<input name="cuodesc" type="text" id="cuodesc" value="" size="12" maxlength="12" />
</td>
<td class="tdder">Saldo Anterior:</td>
<td class="tdizq">
<input name="salant" type="text" id="salant" value="" size="12" maxlength="12" />
</td>
<td class="tdder">Saldo Nuevo:</td>
<td class="tdizq">
<input name="salnue" type="text" id="salnue" value="" size="12" maxlength="10" />
</td>
</tr>
<tr>
<td class="tdder">Fecha Inicio Contrato:</td>
<td class="tdizq">
<input name="fechainicio" type="text" id="fechainicio" value="0000-00-00" size="10" maxlength="14" />
</td>
<td class="tdder">Fecha Termino Contrato:</td>
<td class="tdizq">
<input name="fechatermino" type="text" id="fechatermino" value="0000-00-00" size="10" maxlength="14" />
</td>
<td class="tdder">Fecha Inicio Pagos:</td>
<td><span class="tdder">MES</span><span class="tdizq">-
<label>
<select name="mes_inicio" id="mes_inicio">
<option value="01" selected="selected">01</option>
<option value="02">02</option>
<option value="03">03</option>
<option value="04">04</option>
<option value="05">05</option>
<option value="06">06</option>
<option value="07">07</option>
<option value="08">08</option>
<option value="09">09</option>
<option value="10">10</option>
<option value="11">11</option>
<option value="12">12</option>
</select>
</label>
<strong class="tdder">-AÑo</strong>
<input name="ano_inicio" type="text" id="ano_inicio" value="0000" size="5" maxlength="4" />
</span></td>
</tr>
<tr>
<td class="tdder">Entidad Recaudo:
</td>
<td colspan="3" class="tdizq"><input name="recaudo" type="text" id="recaudo" value="<?php echo $entre ?>" size="60" maxlength="65" readonly/></td>
<td class="tdder">Unidad y Codigo Descuento:
</td>
<td class="tdizq">
<input name="unidt" type="text" id="unidt" value="<?php echo $unides ?>" size="5" maxlength="5" readonly/> -
<input name="codcd" type="text" id="codcd" value="<?php echo $codides ?>" size="4" maxlength="4" readonly/>
</td>
</tr>
<tr>
<td></td>
<td class="tdder">Entidad Laboral:
</td>
<td colspan="2" class="tdizq"><input name="entidad" type="text" id="entidad" value="<?php echo $enti ?>" size="40" maxlength="40" readonly/></td>
<td class="tdder">Director :</td>
<td class="tdizq"><input name="director" type="text" id="director" value="<?php echo $director ?>" size="30" maxlength="30" readonly/> </td>
</tr>
<tr>
<td class="tdder">Cifin:</td>
<td class="tdizq">
<select name="cifin" class=""Estilo66"" id="cifin">
<option value="">-ESTADO-</option>
<option value="SI">SI</option>
<option value="NO">NO</option>
</select>
</td>
</tr>
</table>
<p align="center">
<label>
<input name="guardar" type="submit" class="direcciona" id="guardar" value ="GUARDAR" >
</label>
</p>
</form>
</body>
</html>