File: /home/asjudine/www/listar_carpetas_devolucion_cre.php
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Ingresar Devolucion Credito</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css">
<!--
.Estilo2 {
font-family: Arial, Helvetica, sans-serif;
font-weight: bold;
}
.Estilo19 {font-family: "Arial Narrow"; font-weight: bold; }
.Estilo20 {
font-family: Arial, Helvetica, sans-serif;
font-size: 12px;
}
.Estilo22 {font-size: 12px; font-family: Arial, Helvetica, sans-serif;}
.Estilo23 {font-size: 12px}
-->
</style>
<script Language="JavaScript"><!--
function validar(formulario)
{
if (formulario.cedula.value == "")
{
alert("Ingrese número de cédula del deudor");
formulario.cedula.focus();
return (false);
}
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>
</head>
<body onload="document.formulario.cedula.focus()">
<form method="post" name="formulario" action="" onSubmit="return validar(this)">
<table width="699" border="0" align="center" cellpadding="3" cellspacing="3">
<tr valign="baseline" bgcolor="#0099FF">
<td colspan="4" align="right" nowrap><div align="center" class="Estilo2">CONSULTA DE DATOS PARA INGRESAR DEVOLUCION </div></td>
</tr>
<tr valign="baseline" bgcolor="#FFCC66">
<td colspan="4" align="right" nowrap><div align="center" class="Estilo2">
<script languaje="JavaScript">Mostrar_Fecha()</script></div></td>
</tr>
<tr valign="baseline" bgcolor="#FFCCCC">
<td width="141"><div align="right" class="Estilo19">Cédula del Deudor:</div></td>
<td width="99"><input name="cedula" type="text" id="cedula" value="" size="15" maxlength="15" ></td>
<td width="429" colspan="2"><input name="consultar" type="submit" id="consultar2"value ="Buscar" style="font-family: Verdana; font-size: 8 pt; color: #000080; background-color: #C0C0C0; border-style: solid">
<input name="button" type="button" style="font-family: Verdana; font-size: 8 pt; color: #000080; background-color: #C0C0C0; border-style: solid" onclick="window.location.href='menu_cobranzas_cre.php'" value="Volver al Menú">
<input name="button" type="button" style="font-family: Verdana; font-size: 8 pt; color: #000080; background-color: #C0C0C0; border-style: solid" onclick="window.location.reload()" value="Actualizar">
</td>
</tr>
</table>
</form>
<table width="920" border="1" cellspacing="3" cellpadding="3" align="center">
<tr valign="baseline" bgcolor="#0099FF">
<td width="110" align="right" nowrap><div align="center" class="Estilo22">Cédula</div></td>
<td width="73" align="right" nowrap class="Estilo23"><div align="center" class="Estilo20"># carpeta</div></td>
<td width="300" align="right" nowrap class="Estilo23"><div align="center" class="Estilo20">Apellidos y nombres </div></td>
<td width="72" align="right" nowrap class="Estilo23"><div align="center" class="Estilo20">Contrato</div></td>
<td width="50" align="right" nowrap class="Estilo23"><div align="center" class="Estilo20">Tipo</div></td>
<td width="109" class="Estilo23"><div align="center" class="Estilo20">Núm.Ofic.Devolución</div></td>
<td width="132" colspan="2" class="Estilo23"><div align="center" class="Estilo20">Fecha ofic.Devolución</div></td>
</tr>
<span class="Estilo22">
<?php
require_once("mainfile.php");
include ("config.php");
global $dbi;
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();
//$sql = "select cedula, numero_carpeta, nombre_completo, numero, tipo, oficio_numero, fecha_oficio from cobranzas where cedula = $cedula";
//$control = mysql_query($sql, $dbi);
$resul = mysql_query('SELECT cedula, numero_carpeta, nombre_completo, numero, tipo, oficio_numero, fecha_oficio FROM cabranzas_credito WHERE cedula = "' . $_POST[cedula] . '" ');
if (!$resul) {
die('Invalid query: ' . mysql_error());
}
if($resul)
{
if(mysql_num_rows($resul) != 0)
{
while(list($cc, $nc, $an, $con, $tip, $nof, $fecha) = mysql_fetch_row($resul))
{
$tres=substr($fecha, 0, 4);
$dos=substr($fecha, 5, 2);
$uno=substr($fecha, 8, 2);
$fecha = ($uno."-".$dos."-".$tres);
printf("<tr>
<td bgcolor='#ECE9D8'><div align='center' class='Estilo1 Estilo14'><em>".$cc."</a></span></em></div></td>
<td bgcolor='#ECE9D8'><div align='center' class='Estilo1 Estilo14'><em><a href=\"ingresar_devolucion_cre.php?id=$cedula&carpeta=$nc\" target='_blank'>".$nc."</span></em></div></td>
<td bgcolor='#C5D6FC'><div align='center' class='Estilo1 Estilo14'><em>".$an."</span></em></div></td>
<td bgcolor='#C5D6FC'><div align='center' class='Estilo1 Estilo14'><em>".$con."</span></em></div></td>
<td bgcolor='#C5D6FC'><div align='center' class='Estilo1 Estilo14'><em>".$tip."</span></em></div></td>
<td bgcolor='#C5D6FC'><div align='center' class='Estilo1 Estilo14'><em>".$nof."</span></em></div></td>
<td bgcolor='#C5D6FC'><div align='center' class='Estilo1 Estilo14'><em>".$fecha."</span></em></div></td>");
} //Terminación del ciclo while
echo "</tr></table>";
}
}
?>
</span><span class="Estilo22">
</span>
</body>
</html>