File: /home/asjudine/public_html/debito_cargar_manual.php
<?php
require_once("mainfile.php");
include ("config.php");
global $dbi;
require_once("Conectarse.php");
if(isset($_POST["guardar"]))
{
$fecha_act=date ( "Y-n-j" );
$resu3 = mysql_query('SELECT unidad, codigo FROM debitos_unidad WHERE id = "' ."$unidt". '" ');
if (!$resu3) {
die('Invalid query 4455: ' . mysql_error());
}
list($unidt, $codcd ) = mysql_fetch_row($resu3);
$guardar = mysql_query("INSERT INTO debitos_estado_contable (cedula, nombre, cuota, valor_cuota, fecha_registro, codigo_descuento, unidad_descuento) VALUES ('" . $_POST["cedula"] . "', '" . $_POST["nombre"] . "', '" . $_POST["cuono"] . "','" . $_POST["valcuo"] . "', '" ."$fecha_act". "', '" ."$codcd". "', '" ."$unidt". "')");
if (!$guardar) {
die('Invalid query 1 guardar: ' . mysql_error());
}
$cuotap = $_POST[cuopen] - 1;
$cuotad = $_POST[cuodesc] + 1;
$mssql3 = mysql_query("UPDATE debitos set fecha_registro = '" .$fecha_act. "', cuotas_pend = '" .$cuotap. "' , cuotas_desc = '" .$cuotad. "' WHERE cedula = '" . $HTTP_GET_VARS[ced2] . "' ");
if (!$mssql3) {
die('Invalid query cartera_serviasjudinet MODIFICAR: ' . mysql_error());
}
echo "<script>alert('Cuota Cargada Satisfatoriamente');</script>";
}
$control4 = mysql_query('SELECT cedula, nombres, dirrecion, telefono, celular, ciudad, email, entidad_laboral, banco, cuenta, tipo_debito, valor_credito, valor_juridica, valor_debitar, cuota_debitar, unidad_desc, codigo_desc, cuotas, cuotas_desc, cuotas_pend, fecha_registro, causal_rechazo, fecha_rechazo, fecha_debito, estado FROM debitos WHERE cedula = "' . $HTTP_GET_VARS["ced2"] . '" ');
if (!$control4) {
die('Invalid query 4 aqui: ' . mysql_error());
}
list($cedula, $nombre, $direccion, $telefono, $celular, $ciudad, $email, $entidad_laboral, $banco, $cuenta, $tipodeb, $val_cre, $val_jur, $val_deb, $cuo_deb, $unidad_desc, $codigo_desc, $numcuota, $cuodesc, $cuopen, $fecha_registro, $causal_rechazo, $fecha_rechazo, $fecha_debito, $esta) = mysql_fetch_row($control4);
if ($plan > 0)
{
$cont10 = mysql_query('SELECT codigo_contrato FROM planes_contratos WHERE codigo = "' . "$plan". '" ');
if (!$cont10) {
die('Invalid query 42: ' . mysql_error());
}
list($plan) = mysql_fetch_row($cont10);
}
$sql2 = mysql_query('SELECT * FROM debitos_unidad order by codigo ');
if (!$sql2) {
die('Invalid query 4141: ' . mysql_error());
}
$row_sql2 = mysql_fetch_assoc($sql2);
$totalRows_sql2 = mysql_num_rows($sql2);
?>
<!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=utf-8" />
<title>Estado Contable - Coomanufacturas</title>
<style type="text/css">
<!--
.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;
}
.est_cont1 {
font-family: "Times New Roman", Times, serif;
font-size: 12px;
font-style: normal;
font-weight: normal;
color: #4068F4;
background-color: #E6FFF1;
margin: 1px;
padding: 1px;
height: auto;
width: auto;
border: thin double #33CC66;
}
.est_cont2 {
font-family: Geneva, Arial, Helvetica, sans-serif;
font-size: 12px;
font-style: normal;
font-weight: normal;
color: #000000;
background-color: #F0F5CF;
height: 15px;
width: auto;
border: thin solid #FABF85;
}
.est_cont3 {
font-family: "Courier New", Courier, monospace;
font-size: 12px;
font-style: normal;
font-weight: normal;
color: #EA261C;
background-color: #DEDDE8;
height: auto;
width: auto;
border: thin outset #FC9F67;
}
.est_cont5 {
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 12px;
font-style: normal;
font-weight: normal;
background-color: #D6ECFE;
margin: 2px;
padding: 2px;
height: auto;
width: auto;
border: thin groove #E9AAF0;
color: #C72350;
}
.Estilo50 {color: #CC3333;
font-family: "Arial Narrow";
font-weight: bold;
}
.Estilo55 {font-weight: bold; font-family: "Arial Narrow";}
.Estilo56 {color: #003366; }
.Estilo57 {color: #000099}
.Estilo58 {color: #000000}
.Estilo59 {color: #FF0000}
.Estilo60 {color: #000099; font-weight: bold; }
.Estilo62 {color: #003366; font-weight: bold; }
-->
</style>
</head>
<body>
<form id="form1" name="form1" method="post" action="">
<div align="center">
<div align="center" class="Estilo50">ESTADO CONTABLE DEBITO </div>
<p>
<input name="menu2" type="button" class="Estilo50" id="menu2" onclick="window.location.href='menu_cartera_debito.php'" value="IR AL MENU" />
</p>
<div align="left"></div>
<div align="left"></div>
<div align="right"></div>
<table width="655" border="2" cellpadding="1" cellspacing="1" class="est_cont5">
<tr>
<th width="91" height="28" bgcolor="#FFFFCC"><span class="Estilo57">Cedula :</span></th>
<th width="90" bgcolor="#FFFFCC"><div align="left" class="Estilo56">
<input name="cedula" type="text" class="Estilo55" id="cedula" value="<?php echo $cedula ?>" size="18" maxlength="18" readonly="" />
</div></th>
<th width="93" bgcolor="#FFFFCC"><span class="Estilo57"> Nombres :</span></th>
<th colspan="3" bgcolor="#FFFFCC"><div align="left">
<input name="nombre" type="text" class="Estilo55" id="nombre" value="<?php echo $nombre ?>" size="60" maxlength="60" readonly="" />
</div></th>
</tr>
<tr>
<th bgcolor="#FFFFCC"><span class="Estilo57">Banco :</span></th>
<th bgcolor="#FFFFCC"><div align="left" class="Estilo56">
<input name="banco" type="text" class="Estilo55" id="banco" value="<?php echo $banco ?>" size="18" maxlength="18" readonly="" />
</div></th>
<th bgcolor="#FFFFCC"><span class="Estilo57">No Cuenta :</span></th>
<th width="127" bgcolor="#FFFFCC" colspan=""><div align="left" class="Estilo57">
<input name="cuenta" type="text" class="Estilo55" id="cuenta" value="<?php echo $cuenta ?>" size="20" maxlength="20" readonly="" />
</div></th>
<th width="118" bgcolor="#FFFFCC"><span class="Estilo57">fecha Debito :</span></th>
<th width="101" bgcolor="#FFFFCC" class="Estilo55"><div align="left" class="Estilo58">
<input name="fecha_debito" type="text" class="Estilo55" id="fecha_debito" value="<?php echo $fecha_debito ?>" size="18" maxlength="18" readonly="" />
</div></th>
</tr>
<tr>
<th bgcolor="#FFFFCC"><span class="Estilo57">Valor Debito:</span></th>
<th bgcolor="#FFFFCC"><div align="left" class="Estilo56">
<input name="val_deb" type="text" class="Estilo55" id="val_deb" value="<?php echo $val_deb ?>" size="18" maxlength="18" readonly="" />
</div></th>
<th bgcolor="#FFFFCC"><span class="Estilo57">No Cuotas :</span></th>
<th bgcolor="#FFFFCC"><div align="left" class="Estilo57">
<input name="numcuota" type="text" class="Estilo55" id="numcuota" value="<?php echo $numcuota ?>" size="3" maxlength="2" readonly="" />
</div></th>
<th bgcolor="#FFFFCC"><span class="Estilo57">Valor Cuota :</span></th>
<th bgcolor="#FFFFCC" class="Estilo55"><div align="left" class="Estilo58">
<input name="cuo_deb" type="text" class="Estilo55" id="cuo_deb" value="<?php echo $cuo_deb ?>" size="18" maxlength="18" readonly="" />
</div></th>
</tr>
<tr>
<th bgcolor="#FFFFCC"><span class="Estilo57">Cuotas Pendientes :</span></th>
<th bgcolor="#FFFFCC"><div align="left" class="Estilo57">
<input name="cuopen" type="text" class="Estilo55" id="cuopen" value="<?php echo $cuopen ?>" size="3" maxlength="2" readonly="" />
</div></th>
<th bgcolor="#FFFFCC"><span class="Estilo57">Cuotas Descontadas :</span></th>
<th bgcolor="#FFFFCC"><div align="left" class="Estilo57">
<input name="cuodesc" type="text" class="Estilo55" id="cuodesc" value="<?php echo $cuodesc ?>" size="3" maxlength="2" readonly="" />
</div></th>
<th bgcolor="#FFFFCC"><span class="Estilo57">Fecha Ultimo Descuento :</span></th>
<th bgcolor="#FFFFCC" class="Estilo55"><div align="left" class="Estilo58">
<input name="fecha_registro" type="text" class="Estilo55" id="fecha_registro" value="<?php echo $fecha_registro ?>" size="10" maxlength="10" readonly="" />
</div></th>
</tr>
</table>
<p><span class="Estilo62">INGRESAR PAGO POR RECIBO DE CAJA</span></p>
<table width="424" border="1" class="est_cont1">
<tr>
<th width="84" height="19" bgcolor="#E7F7FE" scope="col"><div align="right" class="Estilo57 Estilo52"><strong>Valor :</strong></div></th>
<th width="79" bgcolor="#E7F7FE" scope="col"><div align="left">
<input name="valcuo" type="text" class="Estilo55" id="valcuo" value="<?php echo $valor ?>" size="13" maxlength="13"/>
</div></th>
<th width="119" bgcolor="#E7F7FE" scope="col"><div align="right" class="Estilo57 Estilo52"><strong>Cuota :</strong></div></th>
<th width="112" bgcolor="#E7F7FE" scope="col"><div align="left">
<input name="cuono" type="text" class="Estilo55" id="cuono" value="<?php echo $cuota ?>" size="13" maxlength="13"/>
</div></th>
</tr>
<tr>
<td bgcolor="#E7F7FE" colspan="2"><div align="right" class="Estilo57 Estilo52"><strong>Unidad de Descuento:</strong></div></td>
<td colspan="2" bgcolor="#E7F7FE"><select name="unidt" class="Estilo55" id="unidt">
<option value="0">--SELECIONE UNIDAD Y CODIGO--</option>
<?php
do {
?>
<option value="<?php echo $row_sql2['id'];?>"><?php echo $row_sql2['unidad'].'-'.$row_sql2['codigo']?></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></td>
</tr>
</table>
<p>
<input name="guardar" type="submit" class="Estilo60" id="guardar" value="Guardar" />
</p>
</div>
</form>
</body>
</html>
<?
echo'<table width="650" border="1" cellspacing="2" cellpadding="2" align = "center">
<tr align="center">
<td colspan="7"><font face="Georgia, Times New Roman, Times, serif" color="#006600"><b align = "center">PAGOS EFECTUADOS</b></font></td>
</tr>
<tr align="center" bgcolor="#FFF9FE">
<td width="90" align="center"><font face="Geneva, Arial, Helvetica, san-serif" size="2" color="#000099">Valor cuota</font></td>
<td width="55" align="center" ><font face="Geneva, Arial, Helvetica, san-serif" size="2" color="#000099"># cuotas</font></td>
<td width="200" align="center"><font face="Geneva, Arial, Helvetica, san-serif" size="2" color="#000099">Entidad</font></td>
<td width="140" align="center"><font face="Geneva, Arial, Helvetica, san-serif" size="2" color="#000099">Fecha registro</font></td>
</tr>';
$control = mysql_query('SELECT * FROM debitos_estado_contable WHERE cedula = "' . $HTTP_GET_VARS["ced2"] . '" ORDER BY cuota ASC ');
if (!$control) {
die('Invalid query debitos: ' . mysql_error());
}
while(list($id, $cedula, $nombre, $cuota, $valorcuota, $fecha_registro, $codesc, $unidesc) = mysql_fetch_row($control))
{
$control5 = mysql_query('SELECT * FROM debitos_unidad WHERE codigo = "' ."$codesc". '" and unidad = "' ."$unidesc". '" ');
if (!$control5) {
die('Invalid query descunetps: ' . mysql_error());
}
list($idr, $codigo, $unidad, $concepto) = mysql_fetch_row($control5);
printf ("<tr align='center' bgcolor='#F9FFEA'>
<td width='100'><font face='Geneva, Arial, Helvetica, san-serif' size='2' color=#740303'><a window.location.href=\"cartera_modificar_estado.php?id=$id\">$valorcuota</a></td>
<td width='100'> <font face='Geneva, Arial, Helvetica, san-serif' size='2' color=#740303'><a window.location.href=\"cartera_modificar_estado.php?id=$id\" top=50,left=100,toolbar=no,scrollbars=no,width=790,height=521,status=yes>$cuota</a></td>
<td width='750'><font face='Geneva, Arial, Helvetica, san-serif' size='2' color=#740303'><a window.location.href=\"cartera_modificar_estado.php?id=$id\" top=50,left=250,toolbar=no,scrollbars=no,width=790,height=521,status=yes>$concepto</a></td>
<td width='100'><font face='Geneva, Arial, Helvetica, san-serif' size='2' color=#740303'><a window.location.href=\"cartera_modificar_estado.php?id=$id\" top=50,left=100,toolbar=no,scrollbars=no,width=790,height=521,status=yes>$fecha_registro</a></td></tr>");
}
echo "</table>";
?>