File: /home/asjudine/public_html/consulta_ced_ingreso_histoser_2.php
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Consulta Ingreso Información Histoser</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;}
.Estilo2 {
font-family: Arial;
font-size: 16px;
color: #990000;
font-weight: bold;
}
.boton2 {font-family: Verdana; font-size: 8 pt; color: #000080; background-color: #C0C0C0; border-style: solid; width:70px; height:22px;}
body {
background-image: url();
}
.Estilo50 {color: #CC3333;
font-family: "Arial Narrow";
font-weight: bold;
}
.Estilo52 {color: #000099; font-family: "Arial Narrow"; font-weight: bold; }
.Estilo54 {color: #000099; font-family: "Arial Narrow"; font-weight: bold; font-size: 16px; }
.Estilo55 {font-family: Arial}
-->
</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 border="0" cellspacing="0" cellpadding="0" align="center">
<tr>
<td >
<table width="507" border="2" align="center" cellpadding="2" cellspacing="2">
<tr bgcolor="#FFFFCC">
<td width="446" class="titulos"><div align="center">CONSULTA HISTOSER POR CEDULA </div></td>
</tr>
<tr bgcolor="#ECE9D8">
<td class="fecha"><div align="center">
<script languaje="JavaScript">Mostrar_Fecha()</script>
</div></td>
</tr>
<tr bgcolor="#FFCC99">
<td height="42" bgcolor="#F7FFE1">
<table width="502" border="2" cellpadding="0" cellspacing="0">
<tr>
<td width="246" align="right" ><span class="Estilo2">Cédula (Titular-Beneficiario):</span> </td>
<td width="248" ><input name="cedula" type="text" class="Estilo54" id="cedula" value="" size="15" maxlength="15"></td>
</tr>
<tr bgcolor="#FFCC99">
<td colspan="3" bgcolor="#F7FFE1"><div align="center">
<input name="consultar" id="consultar" type="submit" class="Estilo50" value="Consultar">
</div></td>
</tr>
<tr>
<td height="31" align="right"><span class="Estilo54"><span class="Estilo55">Numero de atencion</span>:</span> </td>
<td ><input name="atencion" type="text" class="Estilo54" id="atencion" value="" size="15" maxlength="15"></td>
</tr>
</table>
</td></tr>
<tr bgcolor="#FFCC99">
<td colspan="3" bgcolor="#F7FFE1"><div align="center">
<input name="buscar" id="buscar" type="submit" class="Estilo54" value="Buscar">
</div></td>
</tr>
<tr bgcolor="#FFCC99">
<td bgcolor="#F7FFE1"><div align="center">
<input name="menu2" type="button" class="Estilo50" id="menu2" onClick="window.location.href='menu_admin.php'" value="IR AL MENU">
</div></td>
</tr>
</table>
</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;
require_once("Conectarse.php");
// $mssql = mysql_query("select * from record_servicios where cedula = $cedula ",$dbi);
$mssql = mysql_query('SELECT * FROM record_servicios WHERE cedula = "' . $_POST["cedula"] . '" and estado = "4"');
if (!$mssql) {
die('Invalid query: ' . mysql_error());
}
if($mssql)
{
$filas = mysql_num_rows($mssql);
if ($filas > 0)
{
//$sql = "select cedula, numero_atencion, fecha_servicio, nombre_funcionario, tipo from record_servicios where cedula = $cedula";
// $control = mysql_query($sql, $dbi) or die(mysql_error());
$control = mysql_query('SELECT cedula, numero_atencion, fecha_servicio, nombre_funcionario, cedula_funcionario , tipo FROM record_servicios WHERE cedula = "' . $_POST["cedula"] . '" and estado = "4" ');
if (!$control) {
die('Invalid query: ' . mysql_error());
}
if ((mysql_num_rows($control)!=0))
{
echo "<TABLE width='1000' 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'>NUMERO ATENCION</span></div></TD>
<TD bgcolor='#FFFFCC'><div align='center'><span class='texto'>FECHA SERVICIO</span></div></TD>
<TD bgcolor='#FFFFCC'><div align='center'><span class='texto'>NOMBRE FUNCIONARIO</span></div></TD>
<TD bgcolor='#FFFFCC'><div align='center'><span class='texto'>TIPO</span></div></TD>
<TD bgcolor='#FFFFCC'><div align='center'><span class='texto'>CANCELAR CITA</span></div></TD>";
while(list($cedula, $numero_atencion, $fecha_servicio, $nombre_funcionario, $ced, $tipo) = mysql_fetch_row($control))
{
// $sql8 = "select * from actuaciones_servicios where cedula = $cedula and numero_atencion = $numero_atencion";
// $control8 = mysql_query($sql8, $dbi) or die(mysql_error());
$control8 = mysql_query('SELECT * FROM actuaciones_servicios WHERE cedula = "'.$_POST[cedula].'" and numero_atencion = "'.$_POST[numero_atencion].'" and estado = "4"');
if (!$control8) {
die('Invalid query: ' . mysql_error());
}
if ((mysql_num_rows($control8)==0))
{
$control2 = mysql_query('SELECT nombre FROM cartera_serviasjudinet WHERE cedula = "'.$cedula.'" ');
if (!$control2) {
die('Invalid query: ' . mysql_error());
}
$fil = mysql_num_rows($control2);
if ($fil == 0)
{
$control2 = mysql_query('SELECT nombre FROM beneficiarios WHERE cedula = "' .$cedula. '" ');
if (!$control2) {
die('Error de consulta: ' . mysql_error());
}
list($nombre) = mysql_fetch_row($control2);
$fil = mysql_num_rows($control2);
if($fil == 0){
$control2 = mysql_query('SELECT nombre FROM solicitud_credito WHERE cedula = "'.$cedula.'" ');
if (!$control2) {
die('Error de consulta: ' . mysql_error());
}
list($nombre) = mysql_fetch_row($control2);
}
}
printf("<tr>
<td bgcolor='#C5D6FC'><div align='center' class='lista'>".$cedula."</span></div></td>
<td bgcolor='#C5D6FC'><div align='center' class='lista'>".$nombre."</span></div></td>
<td bgcolor='#ECE9D8'><div align='center' class='lista'><input type='button' value=$numero_atencion name='atencion' class=Estilo51 onClick =window.open('ingresar_atencion_histoser_func.php?atencion=$numero_atencion&id=$cedula&cedf=$ced','','top=50,left=100,toolbar=no,scrollbars=yes,width=850,height=550,status=yes')></a></span></div></td>
<td bgcolor='#C5D6FC'><div align='center' class='lista'>".$fecha_servicio."</span></div></td> <td bgcolor='#C5D6FC'><div align='center' class='lista'>".$nombre_funcionario."</span></div></td>
<td bgcolor='#C5D6FC'><div align='center' class='lista'>".$tipo."</span></div></td>
<td bgcolor='#ECE9D8'><div align='center' class='lista'><input type='button' value=CANCELAR name='CANCELAR' class=Estilo51 onClick =window.open('histo_cancelar_cita.php?atencion=$numero_atencion&cedula=$cedula&cedf=$ced','','top=50,left=100,toolbar=no,scrollbars=yes,width=850,height=550,status=yes')></a></span></div></td>
");
}
}
echo "</table>";
}
}
}
else
{
echo "<script>alert('El número de cédula no se encuentra en la base de datos');</script>";
}
}
if(isset($_POST["buscar"]))
{
echo "<form name='form' action='' method='post'>";
require_once("mainfile.php");
include ("config.php");
global $dbi;
require_once("Conectarse.php");
// $mssql = mysql_query("select * from record_servicios where cedula = $cedula ",$dbi);
$mssql = mysql_query('SELECT * FROM record_servicios WHERE numero_atencion = "'.$_POST[atencion].'" and estado = "4"');
if (!$mssql) {
die('Invalid query: ' . mysql_error());
}
if($mssql)
{
$filas = mysql_num_rows($mssql);
if ($filas > 0)
{
// $sql = "select cedula, numero_atencion, fecha_servicio, nombre_funcionario, tipo from record_servicios where cedula = $cedula";
// $control = mysql_query($sql, $dbi) or die(mysql_error());
$control = mysql_query('SELECT cedula, numero_atencion, fecha_servicio, nombre_funcionario, cedula_funcionario , tipo FROM record_servicios WHERE numero_atencion = "'.$_POST[atencion].'" and estado = "4" ');
if (!$control) {
die('Invalid query: ' . mysql_error());
}
if ((mysql_num_rows($control)!=0))
{
echo "<TABLE width='1000' 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'>NUMERO ATENCION</span></div></TD>
<TD bgcolor='#FFFFCC'><div align='center'><span class='texto'>FECHA SERVICIO</span></div></TD>
<TD bgcolor='#FFFFCC'><div align='center'><span class='texto'>NOMBRE FUNCIONARIO</span></div></TD>
<TD bgcolor='#FFFFCC'><div align='center'><span class='texto'>TIPO</span></div></TD>
<TD bgcolor='#FFFFCC'><div align='center'><span class='texto'>CANCELAR CITA</span></div></TD>";
while(list($cedula, $numero_atencion, $fecha_servicio, $nombre_funcionario, $ced, $tipo) = mysql_fetch_row($control))
{
// $sql8 = "select * from actuaciones_servicios where cedula = $cedula and numero_atencion = $numero_atencion";
// $control8 = mysql_query($sql8, $dbi) or die(mysql_error());
$control8 = mysql_query('SELECT * FROM actuaciones_servicios WHERE cedula = "'.$_POST[cedula].'" and numero_atencion = "'.$_POST[numero_atencion].'" and estado = "4"');
if (!$control8) {
die('Invalid query: ' . mysql_error());
}
if ((mysql_num_rows($control8)==0))
{
$control2 = mysql_query('SELECT nombre FROM cartera_serviasjudinet WHERE cedula = "'.$cedula.'" ');
if (!$control2) {
die('Invalid query: ' . mysql_error());
}
list($nombre) = mysql_fetch_row($control2);
$fil = mysql_num_rows($control2);
if ($fil == 0)
{
$control2 = mysql_query('SELECT nombre FROM beneficiarios WHERE cedula = "' .$cedula. '" ');
if (!$control2) {
die('Error de consulta: ' . mysql_error());
}
list($nombre) = mysql_fetch_row($control2);
$fil = mysql_num_rows($control2);
if($fil == 0)
{
$control2 = mysql_query('SELECT nombre FROM solicitud_credito WHERE cedula = "'.$cedula.'" ');
if (!$control2) {
die('Error de consulta: ' . mysql_error());
}
list($nombre) = mysql_fetch_row($control2);
}
}
}
printf("<tr>
<td bgcolor='#C5D6FC'><div align='center' class='lista'>".$cedula."</span></div></td>
<td bgcolor='#C5D6FC'><div align='center' class='lista'>".$nombre."</span></div></td>
<td bgcolor='#ECE9D8'><div align='center' class='lista'><input type='button' value=$numero_atencion name='atencion' class=Estilo51 onClick =window.open('ingresar_atencion_histoser_func.php?atencion=$numero_atencion&id=$cedula&cedf=$ced','','top=50,left=100,toolbar=no,scrollbars=yes,width=850,height=550,status=yes')></a></span></div></td>
<td bgcolor='#C5D6FC'><div align='center' class='lista'>".$fecha_servicio."</span></div></td>
<td bgcolor='#C5D6FC'><div align='center' class='lista'>".$nombre_funcionario."</span></div></td>
<td bgcolor='#C5D6FC'><div align='center' class='lista'>".$tipo."</span></div></td>
<td bgcolor='#ECE9D8'><div align='center' class='lista'><input type='button' value=CANCELAR name='CANCELAR' class=Estilo51 onClick =window.open('histo_cancelar_cita.php?atencion=$numero_atencion&cedula=$cedula&cedf=$ced','','top=50,left=100,toolbar=no,scrollbars=yes,width=850,height=550,status=yes')></a></span></div></td>
");
}
echo "</table>";
}
}
}
else
{
echo "<script>alert('El número de cédula no se encuentra en la base de datos');</script>";
}
}
echo "</form>";
?>