File: /home/asjudine/www/listado_entrega_cartera.php
<?php
require_once("mainfile.php");
include ("config.php");
global $dbi;
$espacio = ' ';
$linea = '-';
require_once("Conectarse.php");
?>
<!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>
<center> <img src="ELEMENTOS\cabezote.gif" WIDTH=60% > </center>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Entrega Contratos Cartera</title>
<style type="text/css">
<!--
.titulos {font: 16px; color: red; font-family:Arial; font-weight:bold}
.boton {background-color: #FFCCCC; color:#FFFFFF; width:90px; height:25; border: 3px solid #0000CC; font-family:Arial; color:#990000;}
.texto {background-color: #CCFFCC; font-size: 11px; font-family: Arial; color:#0000CC; display: block;}
.fecha {font-size: 12px; font-family: Arial; color:#990000; display: block; }
.campo {background-color:#FFFFAA; width: 100px; border:2px solid #990000;}
.lista {font-family: Arial; font-size: 11px; color: #990000;}
.lista2 {font-family: Arial; font-size: 16px; color: #FF6600;}
.boton2 {
font-family: Verdana;
font-size: 8 pt;
color: #000080;
background-color: #C0C0C0;
border-style: solid;
width:90px;
height:22px;
}
body {
background-image: url(ELEMENTOS/gri06.jpg );
}
.Estilo50 {
color: #900;
font-family: "Arial Narrow";
font-weight: bold;
}
.boton1 {background-color: #FFCCCC; color:#FFFFFF; width:90px; height:25; border: 3px solid #0000CC; font-family:Arial; color:#990000;}
.boton11 {background-color: #FFCCCC; color:#FFFFFF; width:90px; height:25; border: 3px solid #0000CC; font-family:Arial; color:#990000;}
.Estilo54 {color: #333399; font-family: "Arial Narrow"; font-weight: bold; }
.Estilo57 {color: #006600}
-->
</style>
<script type="text/JavaScript">
<!--
function MM_jumpMenu(targ,selObj,restore){ //v3.0
eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
if (restore) selObj.selectedIndex=0;
}
//-->
</script>
</head>
<body>
<form action="" method="post" name="form1" class="provd" id="form1">
<div align="center">
<table width="655" border="3" cellpadding="3" cellspacing="3" bgcolor="#CCFFFF">
</table>
<br>
<td><fieldset><table width="669" border="0" align="center" cellpadding="2" cellspacing="2">
<td colspan="3" bgcolor="#CCCCCC"><div align="center" class="Estilo50">ENTREGA CONTRATOS CARTERA</div></td>
</tr>
<tr bgcolor="#ECE9D8">
<td colspan="2" height="22" class="fecha"><div align="center">
<script languaje="JavaScript">Mostrar_Fecha()</script>
</div></td>
</tr>
<tr bgcolor="#ECE9D8">
<td height="22" bgcolor="#ECE9D8" class="fecha"><div align="center">FECHA DESDE
<input name="fecha1" type="text" class="campo1" id="fecha1" value="0000-00-00" size="10" maxlength="10">
</div></td>
<td height="22" class="fecha"><div align="center">FECHA HASTA
<input name="fecha2" type="text" class="campo1" id="fecha2" value="0000-00-00" size="10" maxlength="10">
</div></td>
</tr>
<tr bgcolor="#ECE9D8">
<td colspan="2" height="22" class="fecha"><div align="center">
<input name="consultar" id="consultar" type="submit" class="Estilo51" value="Consultar">
<input name="menu2" type="button" class="Estilo50" id="menu2" onClick="window.location.href='menu_aprovacion_contrato.php'" value="IR AL MENU">
</div></td>
</tr>
</table>
</fieldset></td>
</tr>
</table>
</form>
</form>
</body>
</html>
<?php
require_once("Conectarse.php");
if(isset($_POST["consultar"]))
{
echo "<form name='form' action='' method='post'>";
require_once("mainfile.php");
include ("config.php");
global $dbi;
$mssql = mysql_query('SELECT * FROM solicitud_credito ');
if (!$mssql) {
die('Invalid query 1: ' . mysql_error());
}
if($mssql)
{
$filas = mysql_num_rows($mssql);
if ($filas > 0)
{
$control = mysql_query("SELECT cedula,nombre, contrato,tipo_contrato,fecha,unidad,vendedor FROM impresion_carnet WHERE fecha between '".$_POST [fecha1]."' AND '".$_POST[fecha2]."' and estado= '0' and contrato!= '' ");
if (!$control) {
die('Invalid query: ' . mysql_error());
}
if ((mysql_num_rows($control)!=0))
{
echo "<TABLE width='900' border='0' align='center' cellpadding='0' cellspacing='1'>
<TR>
<TD bgcolor='#ECE9D8'><div align='center'><span class='texto'>CEDULA</span></div></TD>
<TD bgcolor='#ECE9D8'><div align='center'><span class='texto'>NOMBRE</span></div></TD>
<TD bgcolor='#ECE9D8'><div align='center'><span class='texto'>CONTRATO</span></div></TD>
<TD bgcolor='#FFFFCC'><div align='center'><span class='texto'>TIPO CONTRATO</span></div></TD>
<TD bgcolor='#FFFFCC'><div align='center'><span class='texto'>FECHA </span></div></TD>
<TD bgcolor='#FFFFCC'><div align='center'><span class='texto'>UNIDAD </span></div></TD>
<TD bgcolor='#FFFFCC'><div align='center'><span class='texto'>VENDEDOR </span></div></TD>";
while(list($cedula,$apes,$numcon, $tipo, $fecha,$unidad,$ase1) = mysql_fetch_row($control))
{
$tota = $tota + 1;
if ($tipo > 0)
{
$cont10 = mysql_query('SELECT codigo_contrato FROM planes_contratos WHERE codigo = "' . "$tipo". '" ');
if (!$cont10) {
die('Invalid query 42: ' . mysql_error());
}
list($tipo) = mysql_fetch_row($cont10);
}
printf("<tr>
<td bgcolor='#C5D6FC'><div align='center' class='lista'>".$cedula."</span></div></td>
<td bgcolor='#C5D6FC'><div align='center' class='lista'>".$apes."</span></div></td>
<td bgcolor='#C5D6FC'><div align='center' class='lista'>".$numcon."</span></div></td>
<td bgcolor='#C5D6FC'><div align='center' class='lista'>".$tipo."</span></div></td>
<td bgcolor='#C5D6FC'><div align='center' class='lista'>".$fecha."</span></div></td>
<td bgcolor='#C5D6FC'><div align='center' class='lista'>".$unidad."</span></div></td>
<td bgcolor='#C5D6FC'><div align='center' class='lista'>".$ase1."</span></div></td>");
}
echo "</table>";
}
echo "<table width='150' border='10' align='center' cellpadding='1' cellspacing='1' class='est_cont5'>
<tr>
<td width='100'><div align='center'><strong>TOTAL</strong></div></td></tr>";
printf("<TR>
<TD bgcolor='#CCCCCC'><div align='center' class='lista'>".$tota."</span></div></TD> </TR>");
}
}
}
echo "</form>";
?>