File: /home/asjudine/www/consultar_debito.php
<?php
require_once("mainfile.php");
include ("config.php");
global $dbi;
require_once("Conectarse.php");
$control4 = mysql_query('SELECT cedula, nombres, dirrecion, telefono, celular, ciudad, email, entidad_laboral, banco, cuenta, tipo_debito, valor_credito, valor_juridica, valor_debitar, unidad_desc, codigo_desc, cuotas, cuotas_desc, cuotas_pend, fecha_registro, causal_rechazo, fecha_debito, situacion,usuarios, estado FROM debitos WHERE cedula = "'.$_GET["ced"].'" ');
if (!$control4) {
die('Invalid query 4 aqui: ' . mysql_error());
}
list($cedulab, $apellidos_nomsb, $direccionb, $telefonob, $celularb, $ciudadb, $emailb, $entidad_laboral, $banco, $cuenta, $tipodeb,$valor_credito, $valor_juridica, $valor_debitar, $unidad_desc, $codigo_desc, $cuotas, $cuodesc ,$cuotas_pend, $fecha_registro, $causal_rechazo,$fecha_debito,$situacion,$usuarios,$esta) = mysql_fetch_row($control4);
if ($esta == 0)
{
$estado = "HISTORICO";
}
else
{
$estado = "VIGENTE";
}
$resu1 = mysql_query('SELECT historico FROM debito_historico WHERE codigo = "' ."$causal_rechazo". '" ');
if (!$resu1) {
die('Invalid query: ' . mysql_error());
}
list($histo) = mysql_fetch_row($resu1);
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Consulta Datos debito</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css">
<!--
.Estilo1 {font-family: "Arial Narrow"}
.Estilo2 {
font-family: Arial, Helvetica, sans-serif;
font-weight: bold;
}
.Estilo10 {font-weight: bold}
.Estilo17 {font-size: 14}
.Estilo18 {font-family: "Arial Narrow"; font-weight: bold; font-size: 14; }
.Estilo19 {font-family: "Arial Narrow"; font-weight: bold; }
.Estilo24 {color: #FF0000}
-->
</style>
<script Language="JavaScript"><!--
function validar(formulario)
{
if (formulario.dia_act.value > 31)
{
alert("El número de día no se debe exceder de 31");
formulario.dia_act.focus();
return (false);
}
if (formulario.mes_act.value > 12)
{
alert("El número del mes no se debe exceder de 12");
formulario.mes_act.focus();
return (false);
}
return (true);
}
//--></script>
<script languaje="JavaScript">
function Mostrar_Fecha()
{
var mydate=new Date()
var year=mydate.getYear()
if (year < 1000)
year+=1900
var day=mydate.getDay()
var month=mydate.getMonth()
var daym=mydate.getDate()
if (daym<10)
daym="0"+daym
var dayarray=new Array("Domingo","Lunes","Martes","Miercoles","Jueves","Viernes","Sabado")
var montharray=new Array("Enero","Febrero","Marzo","Abril","Mayo","Junio","Julio","Agosto","Septiembre","Octubre","Noviembre","Diciembre")
document.write("<b><font face='Arial, Helvetica, sans-serif'>"+dayarray[day]+" "+daym+" de "+montharray[month]+" de "+year+"</font></b>")
}
</script>
<script>
mesk=new Array();mesk[10]="A";mesk[11]="B";mesk[12]="C";mesk[13]="D";mesk[14]="E";mesk[15]="F";A=10;B=11;C=12;D=13;E=14;F=15;let="ABCDEF";function mes(num){if(let.indexOf(num) != -1){return eval(num)};else{if(num < 10){return eval(num)};else{return mesk[num]}}};
function color(begin,einde,stappen,stap){
hh1=(mes(begin.charAt(0))*16)+mes(begin.charAt(1));
hh2=(mes(begin.charAt(2))*16)+mes(begin.charAt(3));
hh3=(mes(begin.charAt(4))*16)+mes(begin.charAt(5));
pp1=(mes(einde.charAt(0))*16)+mes(einde.charAt(1));
pp2=(mes(einde.charAt(2))*16)+mes(einde.charAt(3));
pp3=(mes(einde.charAt(4))*16)+mes(einde.charAt(5));
if(hh1 < pp1){ff1=hh1+Math.floor((pp1-hh1)/stappen*stap);
ff1=eval("\'"+mes(Math.floor(ff1/16))+"\'")+eval("\'"+mes(ff1-(Math.floor(ff1/16)*16))+"\'");}
;else{ff1=hh1-Math.floor((hh1-pp1)/stappen*stap);
ff1=eval("\'"+mes(Math.floor(ff1/16))+"\'")+eval("\'"+mes(ff1-(Math.floor(ff1/16)*16))+"\'");}
if(hh2 < pp2){ff2=hh2+Math.floor((pp2-hh2)/stappen*stap);
ff2=eval("\'"+mes(Math.floor(ff2/16))+"\'")+eval("\'"+mes(ff2-(Math.floor(ff2/16)*16))+"\'");}
;else{ff2=hh2-Math.floor((hh2-pp2)/stappen*stap);
ff2=eval("\'"+mes(Math.floor(ff2/16))+"\'")+eval("\'"+mes(ff2-(Math.floor(ff2/16)*16))+"\'");}
if(hh3 < pp3){ff3=hh3+Math.floor((pp3-hh3)/stappen*stap);
ff3=eval("\'"+mes(Math.floor(ff3/16))+"\'")+eval("\'"+mes(ff3-(Math.floor(ff3/16)*16))+"\'");}
;else{ff3=hh3-Math.floor((hh3-pp3)/stappen*stap);
ff3=eval("\'"+mes(Math.floor(ff3/16))+"\'")+eval("\'"+mes(ff3-(Math.floor(ff3/16)*16))+"\'");}
;return ff1+ff2+ff3}
mesf=new Array();mesh=new Array();num2=0;num3=0;num4=0;txt="";function shape(){colorsh.innerHTML="<font color='#"+background_color+"'>"+mesf[num2]+"<\/font>";for(i=0;i != mesf[num2].length;i++){mesh[i]=background_color;};for(i=0;i != mesf[num2].length;i++){mesh[i+mesf[num2].length]=color(background_color,text_color,mesf[num2].length,i);};for(i=(mesf[num2].length*2);i != (mesf[num2].length*3);i++){mesh[i]=text_color};shape2()};function shape2(){for(i=0;i != mesf[num2].length;i++){txt=txt+"<font color='"+mesh[i+num3]+"'>"+mesf[num2].charAt(i)+"<\/font>";};colorsh.innerHTML=txt;txt="";if(num3 != (mesf[num2].length*2)){num3++;setTimeout("shape2()",50)};else{num2=0;num3=0;txt=background_color;background_color=text_color;text_color=txt;txt="";setTimeout("shape()",1000);}}
</script>
</head>
<body onload="document.formulario.cedula.focus()">
<form method="post" name="formulario" action="" onSubmit="return validar(this)">
<table width="420" border="1" align="center" cellpadding="3" cellspacing="3">
<tr >
<td colspan="6" align="right" nowrap bgcolor="#F9FFEA"><div align="center"><span class="Estilo2">CONSULTA DE DATOS DE DEBITO </span></div></td>
</tr>
<tr valign="baseline" bgcolor="#0099FF">
<td colspan="6" align="right" nowrap bgcolor="#F9FFEA"><div align="center" class="Estilo2"><script languaje="JavaScript">Mostrar_Fecha()</script></div></td>
</tr>
<tr valign="baseline" bgcolor="#0099FF">
<td width="196" align="right" nowrap bgcolor="#F9FFEA"><span class="Estilo18">Cédula y Nombre</span></td>
<td bgcolor="#F9FFEA"><input name="identi" type="text" id="identi" value="<?php echo $cedulab; ?>" size="8" maxlength="8" readonly=""></td>
<td colspan="4" bgcolor="#F9FFEA"><input name="apenom" type="text" id="apenom" value="<?php echo $apellidos_nomsb; ?>" size="50" maxlength="50" readonly=""></td>
</tr>
<tr valign="baseline" bgcolor="#0099FF">
<td bgcolor="#F9FFEA"><div align="right" class="Estilo18">Direccion: </div></td>
<td width="40" bgcolor="#F9FFEA"><input name="dire" type="text" id="dire" value="<?php echo $direccionb; ?>" size="30" maxlength="40" readonly=""></td>
<td width="150" bgcolor="#F9FFEA"><div align="right" class="Estilo18">Ciudad:</div></td>
<td width="10" bgcolor="#F9FFEA"><input name="ciu" type="text" id="ciu" value="<?php echo $ciudadb; ?>" size="30" maxlength="40" readonly=""></td>
</tr>
<tr valign="baseline" bgcolor="#0099FF">
<td bgcolor="#F9FFEA"><div align="left" class="Estilo4 Estilo10 Estilo17 Estilo1">
<div align="right"><span class="Estilo5">Telefono:</span></div>
</div></td>
<td width="40" bgcolor="#F9FFEA"><input name="telefono" type="text" id="telefono" value="<?php echo $telefonob; ?>" size="8" maxlength="8" readonly=""></td>
<td align="right" nowrap bgcolor="#F9FFEA"><div align="left" class="Estilo4 Estilo10 Estilo17 Estilo1">
<div align="right"><span class="Estilo5">Celular </span></div>
</div></td>
<td bgcolor="#F9FFEA"><input name="celu" type="text" id="celu" value="<?php echo $celularb; ?>" size="10" maxlength="10" readonly=""></td>
</tr>
<tr valign="baseline" bgcolor="#0099FF">
<td height="29" align="right" nowrap bgcolor="#F9FFEA"><div align="left" class="Estilo4 Estilo10 Estilo17 Estilo1">
<div align="right"><span class="Estilo5">Fecha a Debitar </span></div>
</div></td>
<td bgcolor="#F9FFEA"><input name="fecha_deb" type="text" id="fecha_deb" value="<?php echo $fecha_debito; ?>" size="10" maxlength="10" readonly=""></td>
<td bgcolor="#F9FFEA"><div align="right" class="Estilo18">Email: </div></td>
<td colspan="3" bgcolor="#F9FFEA"><input name="ema" type="text" id="ema" value="<?php echo $emailb; ?>" size="30" maxlength="50" readonly=""></td>
</tr>
<tr valign="baseline" bgcolor="#FFFFCC">
<td align="right" nowrap bgcolor="#F9FFEA"><span class="Estilo1 Estilo29"><strong>Banco:</strong></span></td>
<td align="right" nowrap bgcolor="#F9FFEA"><div align="left" class="Estilo19">
<input name="ban" type="text" id="ban" value="<?php echo $banco; ?>" size="20" maxlength="15" readonly="">
</div></td>
<td align="right" nowrap bgcolor="#F9FFEA" class="Estilo19">Cuenta:</td>
<td colspan="3" align="right" nowrap bgcolor="#F9FFEA"><div align="left"><span class="Estilo19">
<input name="cuen" type="text" id="cuen" value="<?php echo $cuenta; ?>" size="30" maxlength="30" readonly="">
</span></div></td>
</tr>
<tr valign="baseline" bgcolor="#FFFFCC">
<td align="right" nowrap bgcolor="#F9FFEA"><span class="Estilo1 Estilo29"><strong>Valor Credito:</strong></span></td>
<td align="right" nowrap bgcolor="#F9FFEA"><div align="left"><span class="Estilo19">
<input name="val_cre" type="text" id="val_cre" value="<?php echo $valor_credito; ?>" size="10" maxlength="10" readonly="">
</span></div></td>
<td align="right" nowrap bgcolor="#F9FFEA"><span class="Estilo1 Estilo29"><strong>Valor Juridica:</strong></span></td>
<td colspan="3" align="right" nowrap bgcolor="#F9FFEA"><div align="left"><span class="Estilo19">
<input name="val_jur" type="text" id="val_jur" value="<?php echo $valor_juridica; ?>" size="10" maxlength="10" readonly="">
</span></div></td>
</tr>
<tr valign="baseline" bgcolor="#FFFFCC">
<td align="right" nowrap bgcolor="#F9FFEA"><span class="Estilo1 Estilo29"><strong>Valor Total Debito:</strong></span></td>
<td align="right" nowrap bgcolor="#F9FFEA"><div align="left"><span class="Estilo1">
<input name="val_deb" type="text" id="val_deb" value="<?php echo $valor_debitar; ?>" size="10" maxlength="10" readonly="">
</span></div></td>
<td align="right" nowrap bgcolor="#F9FFEA"><span class="Estilo1 Estilo29"><strong>Valor cuota a Debitar:</strong></span> </td>
<td colspan="3" align="right" nowrap bgcolor="#F9FFEA"><div align="left"><span class="Estilo19"><span class="Estilo17">
<input name="valcuota" type="text" id="valcuota" value="<?php echo $valor_debitar; ?>" size="10" maxlength="10" readonly="">
</span></span></div></td>
</tr>
<tr valign="baseline" bgcolor="#FFFFCC">
<td align="right" nowrap bgcolor="#F9FFEA"><span class="Estilo1 Estilo29"><strong>Unidad y Codigo:</strong></span></td>
<td align="right" nowrap bgcolor="#F9FFEA"><div align="left"><span class="Estilo1">
<input name="unidad" type="text" id="unidad" value="<?php echo $unidad_desc; ?>" size="10" maxlength="10" readonly="">
<input name="cod" type="text" id="cod" value="<?php echo $codigo_desc; ?>" size="10" maxlength="10" readonly=""> </span></div></td>
<td align="right" nowrap bgcolor="#F9FFEA"><span class="Estilo1 Estilo29"><strong>N° Cuotas</strong></span></td>
<td align="right" nowrap bgcolor="#F9FFEA"><div align="left"><span class="Estilo1">
<input name="cuotas" type="text" id="cuotas" value="<?php echo $cuotas; ?>" size="10" maxlength="10" readonly=""> </span></div></td>
</tr>
<tr valign="baseline" bgcolor="#FFFFCC">
<td align="right" nowrap bgcolor="#F9FFEA"><span class="Estilo1 Estilo29"><strong>Cuotas Descontadas</strong></span></td>
<td align="right" nowrap bgcolor="#F9FFEA"><div align="left"><span class="Estilo1">
<input name="cuodesc" type="text" id="cuodesc" value="<?php echo $cuodesc; ?>" size="10" maxlength="10" readonly=""> </span></div></td>
<td align="right" nowrap bgcolor="#F9FFEA"><span class="Estilo1 Estilo29"><strong>Cuotas Pendientes:</strong></span> </td>
<td colspan="3" align="right" nowrap bgcolor="#F9FFEA"><div align="left"><span class="Estilo19"><span class="Estilo17">
<input name="pend" type="text" id="pend" value="<?php echo $cuotas_pend; ?>" size="10" maxlength="10" readonly="">
</span></span></div></td>
</tr>
<tr>
<td align="right" nowrap bgcolor="#F9FFEA"><span class="Estilo1 Estilo29"><strong>Fecha ultimo Descuento:</strong></span> </td>
<td align="right" nowrap bgcolor="#F9FFEA"><div align="left"><span class="Estilo19"><span class="Estilo17">
<input name="fecha_registro" type="text" id="fecha_registro" value="<?php echo $fecha_registro; ?>" size="10" maxlength="10" readonly="">
</span></span></div></td>
<td align="right" nowrap bgcolor="#F9FFEA"><span class="Estilo1 Estilo29"><strong>Situacion:</strong></span> </td>
<td align="right" nowrap bgcolor="#F9FFEA"><div align="left"><span class="Estilo19"><span class="Estilo17">
<input name="situacion" type="text" id="situacion" value="<?php echo $situacion; ?>" size="10" maxlength="10" readonly="">
</span></span></div></td>
</tr>
<tr valign="baseline" bgcolor="#FFFFCC">
<td align="right" nowrap bgcolor="#F9FFEA"><span class="Estilo1 Estilo29"><strong>Causal Terminacion:</strong></span></td>
<td align="right" nowrap bgcolor="#F9FFEA"><div align="left"><span class="Estilo1">
<input name="histo" type="text" id="histo" value="<?php echo $histo; ?>" size="20" maxlength="25" readonly="">
</span></div></td>
<td align="right" nowrap bgcolor="#F9FFEA"><span class="Estilo1 Estilo29"><strong>Fecha Terminacion:</strong></span> </td>
<td colspan="3" align="right" nowrap bgcolor="#F9FFEA"><div align="left"><span class="Estilo19"><span class="Estilo17">
<input name="fecha_rechazo" type="text" id="fecha_rechazo" value="<?php echo $fecha_rechazo; ?>" size="10" maxlength="10" readonly="">
</span></span></div></td>
</tr>
<tr valign="baseline" bgcolor="#FFFFCC">
<td align="right" nowrap bgcolor="#F9FFEA"><span class="Estilo1 Estilo29"><strong>Vigente o historico:</strong></span></td>
<td align="right" nowrap bgcolor="#F9FFEA"><div align="left"><span class="Estilo1">
<input name="estad" type="text" id="estad" value="<?php echo $estado; ?>" size="20" maxlength="25" readonly="">
</span></div></td>
<td align="right" nowrap bgcolor="#F9FFEA"><span class="Estilo1 Estilo29"><strong>Tipo Debito:</strong></span> </td>
<td colspan="3" align="right" nowrap bgcolor="#F9FFEA"><div align="left"><span class="Estilo19"><span class="Estilo17">
<input name="tipodeb" type="text" id="tipodeb" value="<?php echo $tipodeb; ?>" size="25" maxlength="20" readonly="">
</span></span></div></td>
</tr>
<tr valign="baseline" bgcolor="#FFFFCC">
<td align="right" nowrap bgcolor="#F9FFEA"><span class="Estilo1 Estilo29"><strong>Usuario:</strong></span></td>
<td colspan="3" align="right" nowrap bgcolor="#F9FFEA"><div align="left"><span class="Estilo1">
<input name="usuario" type="text" id="usuario" value="<?php echo $usuarios; ?>" size="30" maxlength="30" readonly="">
</span></div></td>
</tr>
</table>
</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["ced"] . '" ORDER BY fecha_registro 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>";
?>