File: /home/asjudine/public_html/deb_historico.php
<?php
/*
function Conectarse()
{
if (!($link=@mysql_connect("localhost","asjudine","as2006")))
{
echo "Error conectando con el servidor.";
exit();
}
$dbname = "asjudinet";
if (!@mysql_select_db($dbname,$link))
{
echo "Error seleccionando la base de datos.";
exit();
}
return $link;
}
Conectarse();*/
require_once("Conectarse.php");
require_once("mainfile.php");
include ("config.php");
global $dbi;
$control4 = mysql_query('SELECT cedula, nombres, dirrecion, telefono, celular, ciudad, email, entidad_laboral, banco, cuenta, valor_credito, valor_juridica, valor_debitar, unidad_desc, codigo_desc, cuotas_pend, fecha_registro, causal_rechazo, estado FROM debitos WHERE cedula = "' . $_GET["cedu"] . '" ');
if (!$control4) {
die('Invalid query 4 aqui: ' . mysql_error());
}
list($cedulab, $apellidos_nomsb, $direccionb, $telefonob, $celularb, $ciudadb, $emailb, $entidad_laboral, $banco, $cuenta, $valcre, $valjur, $val_deb, $unidad_desc, $codigo_desc, $cuotas_pend, $fecha_registro, $causal_rechazo,$esta) = mysql_fetch_row($control4);
if(isset($_POST["grabar"]))
{
$mt = floor(($mes_inicio + $numcuo)/12);
$submt = (($mes_inicio + $numcuo)%12)-1;
$at = $mt + $aņo_inicio;
if($submt==0)
{
$submt = 12;
$at = $at-1;
}
$dis = date("d");
$mes = date("m");
$anos = date("Y");
$fechas = $anos.'-'.$mes.'-'.$dis;
$resu4 = mysql_query('SELECT codigo FROM debito_historico WHERE codigo = "' ."$unidt2". '" ');
if (!$resu4) {
die('Invalid query: ' . mysql_error());
}
list($codi) = mysql_fetch_row($resu4);
$datos = mysql_query("UPDATE debitos set estado = '0' , causal_rechazo = '" .$_POST["unidt2"]. "' WHERE cedula = '" . $_GET["cedu"] . "' ");
if (!$datos) {
die('Invalid query datos: ' . mysql_error());
}
echo "<script>alert('La informacion fue grabada correctamente');</script>";
}
$sql2 = mysql_query('SELECT * FROM debito_historico order by codigo ');
if (!$sql2) {
die('Invalid query: ' . mysql_error());
}
$row_sql2 = mysql_fetch_assoc($sql2);
$totalRows_sql2 = mysql_num_rows($sql2);
?>
<html>
<head>
<title>Pasar Historico</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css">
<!--
.Estilo12 {
font-size: 11px
}
.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;
}
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;
}
.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}
.Estilo57 {
font-size: 14px;
font-weight: bold;
}
.campo11 {background-color: #B7FFFF;
border: thin dashed #B6B6B6;
}
.campo11 {font-family: "Courier New", Courier, monospace;
font-size: 16px;
font-style: normal;
font-weight: bold;
background-color: #E1EFFD;
border: thin doble #009999;
}
.campo11 { font-family: "Courier New", Courier, monospace;
font-size: 12px;
color: #5151FF;
background-color: #C4E4FD;
border: thin solid #009999;
height: 20px;
width: auto;
}
.datos21 { font-family: "Courier New", Courier, monospace;
font-size: 12px;
font-style: normal;
font-weight: normal;
color: #0033FF;
background-color: #FFE2C6;
margin: 2px;
padding: 3px;
border: medium doble #EEBFEB;
}
.est_cont2 {font-family: Geneva, Arial, Helvetica, sans-serif;
font-size: 12px;
font-style: normal;
font-weight: normal;
color: #2B39EC;
background-color: #F0F5CF;
height: 18px;
width: auto;
border: thin solid #FABF85;
}
.Estilo61 {
font-size: 11px;
color: #000066;
font-weight: bold;
}
.Estilo62 {
font-size: 11px;
color: #000099;
font-weight: bold;
}
-->
</style>
</head>
<body>
<form id="form1" name="form1" method="post" action="">
<div align="center">
<table width="650" border="3" cellpadding="3" cellspacing="3" >
<caption>
<div align="center"><strong><span ><br />
</span></strong>
<table width="330" border="3" cellpadding="3" cellspacing="3" >
<caption>
<span class="Estilo1">PASAR A HISTORICO DEBITOS SERVIASJUDINET</span>
</caption>
</table>
<strong><br />
</strong><br />
<table width="655" border="3" cellpadding="3" cellspacing="3" class="Estilo61">
<caption>
<span class="Estilo8"><br />
<span class="Estilo51">DATOS BASICOS </span></span>
</caption>
<tr>
<td width="88" bgcolor="#E7F7FE">Apellidos y Nombres </td>
<td colspan="3" bgcolor="#E7F7FE"><div align="left">
<input name="apenom" type="text" class="Estilo61" id="apenom" value="<?php echo $apellidos_nomsb ?>" size="75" maxlength="75" />
</div></td>
</tr>
<tr>
<td bgcolor="#E7F7FE"><div align="center" class="Estilo61">Cedula : </div></td>
<td width="109" bgcolor="#E7F7FE"><input name="cedb" type="text" class="Estilo61" id="cedb" value="<?php echo $cedulab ?>" size="15" maxlength="15" readonly="" /></td>
<td width="84" bgcolor="#E7F7FE"><div align="center" class="Estilo61">Codigo : </div></td>
<td width="319" bgcolor="#E7F7FE"><div align="left">
<input name="cod" type="text" class="Estilo61" id="cod" value="<?php echo $codigob ?>" size="15" maxlength="15" />
</div></td>
</tr>
<tr>
<td bgcolor="#E7F7FE"><div align="center" class="Estilo61">Ciudad : </div></td>
<td bgcolor="#E7F7FE"><input name="ciu" type="text" class="Estilo61" id="ciu" value="<?php echo $ciudadb ?>" size="15" maxlength="15" /></td>
<td bgcolor="#E7F7FE"><div align="center" class="Estilo61">Direccion : </div></td>
<td bgcolor="#E7F7FE"><input name="dir" type="text" class="Estilo61" id="dir" value="<?php echo $direccionb ?>" size="45" maxlength="45" /></td>
</tr>
<tr>
<td bgcolor="#E7F7FE"><div align="center" class="Estilo61">Celular : </div></td>
<td bgcolor="#E7F7FE"><input name="celu" type="text" class="Estilo61" id="celu" value="<?php echo $celularb ?>" size="15" maxlength="15" /></td>
<td bgcolor="#E7F7FE"><div align="center" class="Estilo62">Telefono : </div></td>
<td bgcolor="#E7F7FE"><div align="left">
<input name="tel" type="text" class="Estilo61" id="tel" value="<?php echo $telefonob ?>" size="15" maxlength="15"/>
</div></td>
</tr>
<tr>
<td bgcolor="#E7F7FE"><div align="center" class="Estilo61">Banco : </div></td>
<td bgcolor="#E7F7FE"><input name="ban" type="text" class="Estilo61" id="ban" value="<?php echo $banco ?>" size="15" maxlength="15" /></td>
<td bgcolor="#E7F7FE"><div align="center" class="Estilo62">Cuenta N° : </div></td>
<td bgcolor="#E7F7FE"><div align="left">
<input name="cuen" type="text" class="Estilo61" id="cuen" value="<?php echo $cuenta ?>" size="15" maxlength="15"/>
</div></td>
</tr>
<tr>
<td bgcolor="#E7F7FE"><div align="center" class="Estilo61">Valor Credito : </div></td>
<td bgcolor="#E7F7FE"><input name="cre" type="text" class="Estilo61" id="cre" value="<?php echo $valcre ?>" size="15" maxlength="15" /></td>
<td bgcolor="#E7F7FE"><div align="center" class="Estilo62">Valor Juridica : </div></td>
<td bgcolor="#E7F7FE"><div align="left">
<input name="jur" type="text" class="Estilo61" id="jur" value="<?php echo $valjur ?>" size="15" maxlength="15"/>
</div></td>
</tr>
<tr>
<td bgcolor="#E7F7FE"><div align="center" class="Estilo61">Email : </div></td>
<td colspan="3" bgcolor="#E7F7FE"><div align="left">
<input name="ema" type="text" class="Estilo61" id="ema" value="<?php echo $emailb ?>" size="35" maxlength="35" />
</div></td>
<tr>
<td bgcolor="#E7F7FE"><div align="center" class="Estilo61">
<div align="right">Entidad Laboral: </div>
</div></td>
<td colspan="3" bgcolor="#E7F7FE"><div align="left">
<input name="entlab" type="text" class="Estilo61" id="entlab" value="<?php echo $entidad_laboral ?>" size="45" maxlength="45" />
</div></td>
</tr>
</table>
<strong><br />
<br />
<span class="Estilo51">PASAR A HISTORICO </span><br />
<br />
</strong>
<label></label>
</div>
</caption>
<tr>
<td height="26" bgcolor="#FFFFCC" class="Estilo12"><div align="center" class="Estilo12">
<div align="right" class="Estilo57">Unidad y Codigo Descuento :</div>
</div></td>
<td bgcolor="#FFFFCC"><label> </label>
<div align="left">
<select name="unidt2" class="Estilo50" id="unidt2">
<option value="">--SELECCIONE HISTORICO--</option>
<?php
do {
?>
<option value="<?php echo $row_sql2['codigo'];?>"><?php echo $row_sql2['historico']?></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>
</tr>
</table>
</div>
<p align="center">
<input name="grabar" type="submit" class="Estilo3" id="grabar" value="PASAR A HISTORICO" />
</p>
</form>
</body>
</html>
<?
echo'<table width="650" border="0" 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="#DDDDDD">
<td width="90" align="center"><font face="Geneva, Arial, Helvetica, san-serif" size="2" color="#000099">Valor cuota</font></td>
<td bgcolor="#DDDDDD" width="55" ><font face="Geneva, Arial, Helvetica, san-serif" size="2" color="#000099"># cuotas</font></td>
<td width="300" ><font face="Geneva, Arial, Helvetica, san-serif" size="2" color="#000099">Causal Rechazo</font></td>
<td width="300" ><font face="Geneva, Arial, Helvetica, san-serif" size="2" color="#000099">Usuarios</font></td>
<td width="300" ><font face="Geneva, Arial, Helvetica, san-serif" size="2" color="#000099">Entidad</font></td>
<td width="140"><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 = "' . $_GET["cedu"] . '" ORDER BY cuota ASC ');
if (!$control) {
die('Invalid query debitos: ' . mysql_error());
}
while(list($id, $cedula, $nombre, $cuota, $valorcuota,$usuarios, $fecha_registro, $codesc, $unidesc,$causalrecha) = mysql_fetch_row($control))
{
if($codesc == 0)
{
$concepto = $unidesc;
}
else
{
$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='#f4f4f4'>
<td width='100'><font face='Geneva, Arial, Helvetica, san-serif' size='2' color=#993300'><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=#993300'><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='100'> <font face='Geneva, Arial, Helvetica, san-serif' size='2' color=#993300'><a window.location.href=\"cartera_modificar_estado.php?id=$id\" top=50,left=100,toolbar=no,scrollbars=no,width=790,height=521,status=yes>$causalrecha</a></td>
<td width='100'> <font face='Geneva, Arial, Helvetica, san-serif' size='2' color=#993300'><a window.location.href=\"cartera_modificar_estado.php?id=$id\" top=50,left=100,toolbar=no,scrollbars=no,width=790,height=521,status=yes>$usuarios</a></td>
<td width='750'><font face='Geneva, Arial, Helvetica, san-serif' size='2' color=#993300'><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=#993300'><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>";
?>