File: /home/asjudine/public_html/consulta_solicitud_ced.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>Consulta Solicitud Creditos</title>
<style type="text/css">
<!--
.Estilo2 {color: #FF6633;
font-size: 16px;
}
.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;
}
.Estilo4 {
color: #D94B3C;
font-size: 24px;
}
.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}
-->
</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">CONSULTA POR CEDULA - SOLICITUDES</div></td>
</tr>
<tr bgcolor="#ECE9D8">
<td height="22" class="fecha"><div align="center">
<table width="253" border="3" cellpadding="3" cellspacing="3" class="recaudo">
<caption>
</caption>
<tr>
<th colspan="2" scope="col"><label>Digite el Numero de Cedula </label></th>
</tr>
<tr>
<td width="162"><div align="center"><span class="Estilo2">CEDULA : </span></div></td>
<td width="131"><div align="center">
<input name="ced2" type="text" id="ced2" size="20" maxlength="20" />
</div></td>
</tr>
<tr>
<td height="32" colspan="2"><div align="center">
<input name="consultar" type="submit" class="Estilo3" id="consultar" value="Consultar" />
</div></td>
</tr>
</table>
</div>
</td>
</tr>
<tr bgcolor="#FFCC99">
<td><div align="center">
<input name="menu2" type="button" class="Estilo50" id="menu2" onclick="window.location.href='menu_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"]))
{
echo "<form id='form2' name='form2' method='post' action=''>";
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, nombre, fecha, monto_solicitado from solicitud_credito where cedula = $ced2 and estado = '0' order by fecha DESC";
$control = mysql_query($sql, $dbi) or die(mysql_error()); */
$resul = mysql_query('SELECT cedula, nombre, fecha, monto_solicitado FROM solicitud_credito WHERE cedula = "' . $_POST[ced2] . '" and estado = "0" order by fecha DESC');
if (!$resul) {
die('Invalid query: ' . mysql_error());
}
if ((mysql_num_rows($resul)!=0))
{
echo "<table width='700' border='2' align='center' cellpadding='1' cellspacing='1' class='est_cont5'>
<tr>
<td width='100'><div align='center'><strong>CEDULA</strong></div></td>
<td width='200'><div align='center'><strong>NOMBRE</strong></div></td>
<td width='100'><div align='center'><strong>MONTO</strong></div></td>
<td width='200'><div align='center'><strong>EMPRESA</strong></div></td>
<td width='100'><div align='center'><strong>FECHA</strong></div></td>
<td width='100'><div align='center'><strong>CIUDAD</strong></div></td>
</tr>";
while(list($ced, $nom, $fec, $mon) = mysql_fetch_row($resul))
{
/* $sqlnom2 = "select nombre, ciudad from datos_empresa where cedula = '$ced'";
$control2 = mysql_query($sqlnom2, $dbi) or die(mysql_error());*/
$res = mysql_query('SELECT nombre, ciudad FROM datos_empresa WHERE cedula = "' ."$ced". '" ');
if (!$res) {
die('Invalid query: ' . mysql_error());
}
list($nomb, $ciu) = mysql_fetch_row($res);
printf("<TR>
<TD bgcolor='#ECE9D8'><div align='center' class='lista'><input type='button' value=$ced name='cedu' class=est_cont1 onClick =window.open('mostrar_solicitud.php?ced2=$ced','','top=50,left=100,toolbar=yes,scrollbars=yes,width=950,height=650,status=yes')></a></span></div></TD>
<TD bgcolor='#C5D6FC'><div align='center' class='lista'>".$nom."</span></div></TD>
<TD bgcolor='#C5D6FC'><div align='center' class='lista'>".$mon."</span></div></TD>
<TD bgcolor='#C5D6FC'><div align='center' class='lista'>".$nomb."</span></div></TD>
<TD bgcolor='#C5D6FC'><div align='center' class='lista'>".$fec."</span></div></TD>
<TD bgcolor='#C5D6FC'><div align='center' class='lista'>".$ciu."</span></div></TD> </TR>");
}
echo "</table>";
}
echo "</form>";
}
?>