File: /home/asjudine/www/listado_general_damaris.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>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Documento sin título</title>
<style type="text/css">
<!--
.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;
}
.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: #418BAF;
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;
}
.fecha {font-size: 12px; font-family: Arial; color:#990000; display: block; }
.titulos {font: 16px; color: red; font-family:Arial; font-weight:bold}
.col_cre2 {font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 12px;
font-style: normal;
font-weight: bold;
color: #F92F0B;
background-color: #B3D9F0;
height: auto;
width: auto;
border: medium groove #FC9227;
}
.Estilo51 {color: #000099}
.Estilo52 {color: #000099; font-weight: bold; }
.Estilo53 {color: #000066}
-->
</style>
</head>
<body>
<form id="form1" name="form1" method="post" action="">
<div align="center">
<table width="669" border="0" align="center" cellpadding="2" cellspacing="2">
<tr bgcolor="#FFFFCC">
<td class="titulos"><div align="center">LISTADO VENTAS</div></td>
</tr>
<tr>
<td align="center" bgcolor="#FFCC99">
<span class="Estilo3"><span class="Estilo53">Fecha desde </span>:</span>
<input name="fecha1" type="text" class="campo1" id="fecha1" value="" size="12" maxlength="12"> <span class="Estilo52">Hasta </span><span class="Estilo51">:</span>
<input name="fecha2" type="text" class="campo1" id="fecha2" value="" size="12" maxlength="12"></td>
</tr>
<tr bgcolor="#FFCC99">
<td><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_solicitud_credito.php'" value="IR AL MENU" />
<label></label>
</div></td>
</tr>
</table>
<div align="left"></div>
<div align="left"></div>
<div align="right"></div>
</div>
</form>
</body>
</html>
<?php
if(isset($_POST["consultar"]))
{
require_once("mainfile.php");
include ("config.php");
global $dbi;
require_once("Conectarse.php");
$resu = mysql_query('SELECT * FROM cartera_serviasjudinet ');
if (!$resu) {
die('Invalid query: ' . mysql_error());
}
// $mssql = mysql_query("select * from solicitud_credito",$dbi);
if($resu)
{
$filas = mysql_num_rows($resu);
if ($filas > 0)
{
$result = mysql_query('SELECT cedula, nombre, numerocontrato, tipocontrato, numero_libranza, codigo_sucursal, fecha_afiliacion, vendedor FROM cartera_serviasjudinet WHERE fecha_afiliacion >= "' . $_POST["fecha1"] . '" and fecha_afiliacion <= "' . $_POST["fecha2"] . '" and (tipocontrato = "SJ03" || tipocontrato = "SJ04" || tipocontrato = "SJ05" || tipocontrato = "SJ06") ');
if (!$result) {
die('Invalid query: ' . mysql_error());
}
// $sql = "select cedula, nombre, monto_solicitado from solicitud_credito where estado = '1' and tipo_solicitud = '$tiposol' order by fecha DESC";
//$control = mysql_query($sql, $dbi) or die(mysql_error());
if ((mysql_num_rows($result)!=0))
{
echo "<table width='800' border='2' align='center' cellpadding='1' cellspacing='1' class='est_cont5'>
<tr>
<td><div align='center'><strong>Cedula</strong></div></td>
<td ><div align='center'><strong>Nombre</strong></div></td>
<td ><div align='center'><strong>N° Contrato</strong></div></td>
<td ><div align='center'><strong>Tipo</strong></div></td>
<td ><div align='center'><strong>N° Libranza</strong></div></td>
<td ><div align='center'><strong>Sucursal</strong></div></td>
<td ><div align='center'><strong>Fecha Afliacion</strong></div></td>
<td ><div align='center'><strong>Vendedor</strong></div></td>
</tr>";
while(list($ced, $nom, $numcon, $tipo, $libranza, $sucursal, $fecha, $vendedor) = mysql_fetch_row($result))
{
if($sucursal > 0)
{
$resul = mysql_query('SELECT nombre FROM sucursal WHERE codigo = "' .$sucursal. '" ');
if (!$resul) {
die('Invalid query: ' . mysql_error());
}
list($sucursal) = mysql_fetch_row($resul);
}
if($vendedor > 0)
{
$resvvv = mysql_query('SELECT vendedor FROM vendedores WHERE codigo = "' .$vendedor. '" ');
if (!$resvvv) {
die('Invalid query: ' . mysql_error());
}
list($vendedor) = mysql_fetch_row($resvvv);
}
$sum = $sum + 1;
printf("<TR>
<TD bgcolor='#C5D6FC'><div align='center' class='lista'>".$ced."</span></div></TD>
<TD bgcolor='#C5D6FC'><div align='center' class='lista'>".$nom."</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'>".$libranza."</span></div></TD>
<TD bgcolor='#C5D6FC'><div align='center' class='lista'>".$sucursal."</span></div></TD>
<TD bgcolor='#C5D6FC'><div align='center' class='lista'>".$fecha."</span></div></TD>
<TD bgcolor='#C5D6FC'><div align='center' class='lista'>".$vendedor."</span></div></TD> </TR>");
}
echo "</table>";
}
echo "<table width='200' border='2' 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='#FDFFE6'><div align='center' class='lista'>".$sum."</span></div></TD> </TR>");
}
}
echo "</form>";
}
?>