File: /home/asjudine/public_html/cartera_consulta_fecha_auxiliar.php
<?php
require_once("Conectarse.php");
echo "<form name='form' action='' method='post'>";
require_once("mainfile.php");
include ("config.php");
global $dbi;
$sql8 = mysql_query('SELECT * FROM planes_contratos WHERE codigo != "7" and codigo != "8" order by codigo ');
if (!$sql8) {
die('Invalid query: ' . mysql_error());
}
$row_sql8 = mysql_fetch_assoc($sql8);
$totalRows_sql8 = mysql_num_rows($sql8);
?>
.<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Consulta por fecha de nacimiento Debito</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<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();
}
.Estilo50 {color: #CC3333;
font-family: "Arial Narrow";
font-weight: bold;
}
.Estilo51 {
color: #3366FF;
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;}
.Estilo53 {font: 16px; color: #009900; font-family: Arial; font-weight: bold; }
.Estilo55 {font-family: "Arial Narrow"}
-->
</style>
<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 language="javascript">
function AbreGral()
{
var menu;
menu=window.open("mostrar_ingreso.php","","toolbar=no,scrollbars=no,width=800,height=500,status=yes");
menu.focus();
var ventana = window.self;
ventana.opener = window.self;
ventana.close();
}
</script>
</head>
<body onLoad="document.formulario.cedula.focus()" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<form name="formulario" action="" method="post">
<table width="671" border="0" cellspacing="0" cellpadding="0" align="center">
<tr>
<td><fieldset><table width="669" border="0" align="center" cellpadding="2" cellspacing="2">
<tr bgcolor="#FFFFCC">
<td colspan="2" class="titulos"><div align="center">CONSULTA POR FECHA DE NACIMIENTO </div></td>
</tr>
<tr bgcolor="#ECE9D8">
<td height="22" colspan="2" class="fecha"><div align="center">
<script languaje="JavaScript">Mostrar_Fecha()</script>
</div></td>
</tr>
<tr bgcolor="#FFCC99">
<td width="338" align="center" bgcolor="#CCFFCC" >
<span class="Estilo53">Seleccione "<span class="Estilo50"># FECHA DE NACIMIENTO </span>"</span> </td>
<td width="338" align="left" bgcolor="#CCFFCC" >
<span class="Estilo53">dia</span>
<select name="dia" class="Estilo66" id="dia">
<option value="01" selected="selected">01</option>
<option value="02">02</option>
<option value="03">03</option>
<option value="04">04</option>
<option value="05">05</option>
<option value="06">06</option>
<option value="07">07</option>
<option value="08">08</option>
<option value="09">09</option>
<option value="10">10</option>
<option value="11">11</option>
<option value="12">12</option>
<option value="13">13</option>
<option value="14">14</option>
<option value="15">15</option>
<option value="16">16</option>
<option value="17">17</option>
<option value="18">18</option>
<option value="19">19</option>
<option value="20">20</option>
<option value="21">21</option>
<option value="22">22</option>
<option value="23">23</option>
<option value="24">24</option>
<option value="25">25</option>
<option value="26">26</option>
<option value="27">27</option>
<option value="28">28</option>
<option value="29">29</option>
<option value="30">30</option>
<option value="31">31</option>
</select>
<span class="Estilo53">mes</span>
<select name="mes" class="Estilo66" id="mes">
<option value="01" selected="selected">01</option>
<option value="02">02</option>
<option value="03">03</option>
<option value="04">04</option>
<option value="05">05</option>
<option value="06">06</option>
<option value="07">07</option>
<option value="08">08</option>
<option value="09">09</option>
<option value="10">10</option>
<option value="11">11</option>
<option value="12">12</option>
</select></td>
</tr>
<tr bgcolor="#FFCC99">
<td colspan="2" bgcolor="#CCFFCC"><div align="center"><span class="Estilo51">
<input name="consultar" id="consultar" type="submit" class="Estilo51" value="Consultar">
</span></div></td>
</tr>
<tr bgcolor="#FFCC99">
<td colspan="2" bgcolor="#CCFFCC"><div align="center" class="Estilo51">
<input name="menu2" type="button" class="Estilo50" id="menu2" onClick="window.location.href='menu_auxiliar_cartera.php'" value="IR AL MENU">
</div></td>
</tr>
</table>
</fieldset></td>
</tr>
</table>
</form>
</body>
</html>
<?php
if(isset($_POST["consultar"]))
{
echo "<form name='form' action='' method='post'>";
require_once("mainfile.php");
include ("config.php");
global $dbi;
$fech = $_POST["dia"].'-'.$_POST["mes"] ;
$mssql = mysql_query('SELECT * FROM cartera_serviasjudinet ');
if (!$mssql) {
die('Invalid query 1: ' . mysql_error());
}
if($mssql)
{
$filas = mysql_num_rows($mssql);
if ($filas > 0)
{
$control = mysql_query('SELECT cedula, nombre, numerocontrato, tipocontrato, tipo_afiliado, estado FROM cartera_serviasjudinet WHERE fecha_nacimiento = "' ."$fech". '" order by nombre ');
if (!$control) {
die('Invalid query 2: ' . mysql_error());
}
if ((mysql_num_rows($control)!=0))
{
echo "<TABLE width='900' border='0' align='center' cellpadding='0' cellspacing='1'>
<TR>
<TD bgcolor='#FFFFCC'><div align='center'><span class='texto'>CEDULA</span></div></TD>
<TD bgcolor='#FFFFCC'><div align='center'><span class='texto'>NOMBRE</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'>TIPO AFILIADO</span></div></TD>
<TD bgcolor='#FFFFCC'><div align='center'><span class='texto'>VIGENTE/HISTORICO </span></div></TD>";
while(list($cedula, $nombres , $numcon, $tipo, $afili, $estado) = mysql_fetch_row($control))
{
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);
}
if ($estado == 0)
{
$esta = "HISTORICO";
}
else
{
$esta = "VIGENTE";
}
printf("<tr>
<TD bgcolor='#ECE9D8'><div align='center' class='lista'><input type='button' value=$cedula name='cedu' class=est_cont1 onClick =window.location.href='cartera_consulta_titular_auxiliar.php?ced2=$cedula&numcon=$numcon'></a></span></div></TD>
<td bgcolor='#C5D6FC'><div align='center' class='lista'>".$nombres."</span></div></td>
<td bgcolor='#C5D6FC'><div align='center' class='lista'>".$tipo."</span></div></td>
<td bgcolor='#C5D6FC'><div align='center' class='lista'>".$afili."</span></div></td>
<td bgcolor='#C5D6FC'><div align='center' class='lista'>".$esta."</span></div></td>");
}
echo "</table>";
}
}
}
echo "</form>";
}
?>