File: /home/asjudine/public_html/envio_contrato_por_afiliado_cali.php
<?
require_once("mainfile.php");
include ("config.php");
require_once("Conectarse.php");
$Recordset1 = mysql_query('SELECT * FROM Usuarios WHERE Sucursal="CALI" order by Nombre_Completo');
if (!$Recordset1) {
die('Invalid query: ' . mysql_error());
}
$row_Recordset1 = mysql_fetch_assoc($Recordset1);
$totalRows_Recordset1 = mysql_num_rows($Recordset1);
?>
.<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Listado Fecha Gestion</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: 14px; color: #990000;}
.boton2 {font-family: Verdana; font-size: 8 pt; color: #000080; background-color: #C0C0C0; border-style: solid; width:70px; height:22px;}
body {
background-image: url(ELEMENTOS/gri06.jpg );
.Estilo50 {color: #CC3333;
font-family: "Arial Narrow";
font-weight: bold;
}
-->
</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">
<center> <img src="ELEMENTOS\CABEZOTE SERVIASJUDINET.jpg" WIDTH=60% > </center>
<form name="formulario" action="" method="post">
<tr>
<td>
<form name="formulario" action="" method="post">
<table width="480" border="0" cellspacing="0" cellpadding="0" align="center">
<tr>
<td><fieldset><table width="505" border="6" align="center" cellpadding="2" cellspacing="2" bgcolor="#FFFFFF">
<tr bgcolor="#FFFFCC">
<td colspan="2" bgcolor="#ECE9D8" class="titulos" style="color:#FFFFFF"><div align="center" class="Estilo2">CONSULTA ENVIO CONTRATOS POR FUNCIONARIO</div></td>
</tr>
<tr bgcolor="#ECE9D8">
<td height="22" colspan="2" bgcolor="#FFCC99" class="fecha"><div align="center">
<script languaje="JavaScript">Mostrar_Fecha()</script>
</div></td>
</tr>
<td bgcolor="#CCCCCC" class="Estilo2"><div align="center">FUNCIONARIO
<td bgcolor="#CCCCCC"><SELECT NAME="funcionario">
<OPTION value="">--Nombre Funcionario--</OPTION>
<?php
do {
?>
<option value="<?php echo $row_Recordset1['codigo']?>"><?php echo $row_Recordset1['Nombre_Completo']?></option>
<?php
} while ($row_Recordset1 = mysql_fetch_assoc($Recordset1));
$rows = mysql_num_rows($Recordset1);
if($rows > 0) {
mysql_data_seek($Recordset1, 0);
$row_Recordset1 = mysql_fetch_assoc($Recordset1);
}
?>
</SELECT>
</td>
<tr bgcolor="#ECE9D8">
<td height="22" colspan="2" bgcolor="#CCCCCC" class="titulos"><div align="center">
<input name="consultar" id="consultar" type="submit" class="Estilo2" value="Consultar">
<input name="menu2" type="button" class="Estilo2" id="menu2" onClick="window.location.href='menu_consultorio_policia_cali.php'" value="IR AL MENU">
</div></td>
</tr>
</table>
</fieldset></td>
</tr>
</table>
</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;
$control3 = mysql_query("SELECT Nombre_Completo FROM Usuarios WHERE codigo = '".$_POST[funcionario]."' ");
if (!$control3) {
die('Invalid query 0: ' . mysql_error());
}
list($nomfunciona) = mysql_fetch_row($control3);
$control= mysql_query("SELECT apellidos,nombres,cedula,celular,email,unidad,grado FROM consultorio_policia WHERE estado = '5' and (unidad='MECAL' || unidad='DEVAL' || unidad='ESBOL')");
if (!$control) {
die('Invalid query 0: ' . mysql_error());
}
if ((mysql_num_rows($control)!=0))
{
echo "<TABLE width='700' border='3' align='center' cellpadding ='0' cellspacing='1' bgcolor='black'>
<TR>
<TD bgcolor='#FFCC99'><div align='center'><span class='fecha'>CEDULA</span></div></TD> <TD bgcolor='#FFCC99'><div align='center'><span class='fecha'>APELLIDOS</span></div></TD>
<TD bgcolor='#FFCC99'><div align='center'><span class='fecha'>NOMBRES</span></div></TD>
<TD bgcolor='#FFCC99'><div align='center'><span class='fecha'>CELULAR</span></div></TD>
<TD bgcolor='#FFCC99'><div align='center'><span class='fecha'>CORREO</span></div></TD>
<TD bgcolor='#FFCC99'><div align='center'><span class='fecha'>GRADO</span></div></TD>
<TD bgcolor='#FFCC99'><div align='center'><span class='fecha'>UNIDAD</span></div></TD>";
while(list($apellidos,$nombres,$cedula,$celular,$email,$unidad,$grado) = mysql_fetch_row($control))
{
// $godr = mysql_query('SELECT MAX(fecha) FROM actuaciones_consultorio_policia WHERE cedula = "'.$cedula.'" and funcionario = "'.$nomfunciona.'" and codigo_funcionario = "'.$_POST[funcionario].'" ');
// if (!$godr) {
// die('Error de godr: ' . mysql_error());
// }
$godr = mysql_query('SELECT MAX(fecha) FROM actuaciones_consultorio_policia WHERE cedula = "'.$cedula.'"');
if (!$godr) {
die('Error de godr: ' . mysql_error());
}
list($maxfecha) = mysql_fetch_row($godr);
$control2 = mysql_query("SELECT fecha,funcionario FROM actuaciones_consultorio_policia WHERE cedula = '".$cedula."' and codigo_funcionario = '".$_POST[funcionario]."' and fecha = '".$maxfecha."' ");
if (!$control2) {
die('Invalid query 0: ' . mysql_error());
}
list($fecha) = mysql_fetch_row($control2);
if ((mysql_num_rows($control2)!=0))
{
$tota = $tota + 1;
printf("<tr>
<td bgcolor='#CCCCCC'><div align='center' class='Estilo21'><input type='button' value=$cedula name='proceso' class=Estilo21 onClick = window.open('formulario_consultorio_juridico2_policia2_cali.php?cedula=$cedula&celular=$celular','','top=30,left=50,toolbar=yes,scrollbars=yes,width=980,height=800,status=yes')></a></span></div></td>
<td bgcolor='#CCCCCC'><div align='center' class='lista'>".$apellidos."</a></span></div></td>
<td bgcolor='#CCCCCC'><div align='center' class='lista'>".$nombres."</a></span></div></td>
<td bgcolor='#CCCCCC'><div align='center' class='lista'>".$celular."</a></span></div></td>
<td bgcolor='#CCCCCC'><div align='center' class='lista'>".$email."</a></span></div></td>
<td bgcolor='#CCCCCC'><div align='center' class='lista'>".$grado."</a></span></div></td>
<td bgcolor='#CCCCCC'><div align='center' class='lista'>".$unidad."</a></span></div></td>");
}
}
}
else
{
echo "<script>alert('No Hay Registros Para Ese Usuario');</script>";
}
echo "<TABLE width='100' border='0' align='center' cellpadding ='0' cellspacing='1'>
<TR>
<TD bgcolor='#FFCC99'><div align='center'><span class='fecha'>TOTAL</span></div></TD>";
printf("<tr>
<td bgcolor='#CCCCCC'><div align='center' class='lista'>".$tota."</a></span></div></td>");
echo "</form>"; }
?>