File: /home/asjudine/public_html/consulta_contratos_correo.php
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Consulta Contratos Recibidos</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css">
<!--
.titulos {
font: 16px;
color: #FFF;
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(ELEMENTOS/gri06.jpg);
}
.Estilo50 {color: #CC3333;
font-family: "Arial Narrow";
font-weight: bold;
}
.Estilo51 {
color: #A00;
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;}
-->
</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">
<br>
<center> <img src="ELEMENTOS\CABEZOTE SERVIASJUDINET.jpg" WIDTH=57% height="91" > </center>
<br><br>
<table border="3" cellspacing="2" cellpadding="2" align="center" bgcolor="gray">
<tr>
<td width="665"><fieldset><table width="669" border="0" align="center" cellpadding="2" cellspacing="2" bgcolor="#330066">
<tr bgcolor="#FFFFCC">
<td colspan="2" bgcolor="#330066" class="titulos"><div align="center"> CONSULTA CONTRATOS RECIBIDOS</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 colspan="2" bgcolor="#2E7068"><div align="center" class="Estilo51">
<input name="menu2" type="button" class="Estilo50" id="menu2" onClick="window.location.href='menu_guias_correo.php'" value="IR AL MENU">
</div></td>
</tr>
</table>
</fieldset></td>
</tr>
</table>
</form>
</body>
</html>
<?php
require_once("Conectarse.php");
echo "<form name='form' action='' method='post'>";
require_once("mainfile.php");
include ("config.php");
global $dbi;
//$LaIdentificacion = $HTTP_GET_VARS[cedula];
// $ElID = $HTTP_GET_VARS[Id];
$res = mysql_query("SELECT cedula, nombre_titular, nombre contenido, tipo, sucursal, funcionario, empresa, estado, seguimiento, fecha_envio, id, numero_contrato FROM consulta_contratos WHERE estado= '1' ");
if (!$res) {
die('Invalid query: ' . mysql_error());
}
if ((mysql_num_rows($res)!=0))
{
printf("<style type='text/css'><!--.Estilo5 {font-family: Arial, Helvetica, sans-serif; font-size: 14px; color: #000066; }--></style>");
printf("<table width='900' border='4' align='center' cellpadding='2' cellspacing='2'>
<tr bgcolor='#FFFFCC'>
<th colspan='10' scope='col'><span class='Estilo5'>LISTADO DE GUIAS DEVUELTAS </span></th>
</tr>
<tr bgcolor='#FFFFCC'>
<th scope='col'><span class='Estilo5'>CEDULA</span>
<th scope='col'><span class='Estilo5'>NOMBRES Y APELLIDOS</span></th>
<th scope='col'><span class='Estilo5'>SUCURSAL</span>
<th scope='col'><span class='Estilo5'>FUNCIONARIO</span>
<th scope='col'><span class='Estilo5'>CAMBIO ESTADO</span></th>
</tr>");
//while($Filas = mysql_fetch_row($res))
while(list($cedula, $nombre_titular, $nombre, $contenido, $tipo, $sucursal, $funcionario, $empresa, $estado, $seguimiento, $fecha_envio, $id, $numcon) = mysql_fetch_row($res))
{
$conttr = mysql_query('SELECT nombre FROM sucursal WHERE codigo = "'.$sucursal. '"');
if (!$conttr) {
die('Invalid query proceso bene: ' . mysql_error());
}
list($sucursal) = mysql_fetch_row($conttr);
$usuar = mysql_query('SELECT Nombre_Completo FROM Usuarios WHERE codigo = "'.$funcionario. '"');
if (!$usuar) {
die('Invalid query proceso bene: ' . mysql_error());
}
list($usuari) = mysql_fetch_row($usuar);
$sum = $sum +1;
// printf("<tr><td bgcolor='#ECE9D8'><div align='center'><a href='descargar_archivos_guia.php?id=".$Filas[0]." class='Estilo5 Estilo6'>Descargar</a></div></td>
// printf("<tr>
// <td bgcolor='#ECE9D8'><div align='center' class='Estilo21'><input type='button' value=$Filas[0] name='proceso' class=Estilo21 onClick = window.open('visualizar_contratos_correo.php?id=$Filas[11]&cedula=$Filas[0]','','top=30,left=50,toolbar=yes,scrollbars=yes,width=900,height=800,status=yes')></a></span></div></td>
printf("<tr>
<td bgcolor='#ECE9D8'><div align='center'><span class='Estilo7'>".$cedula."</span></div></td>
<td bgcolor='#ECE9D8'><div align='center'><span class='Estilo7'>".$nombre_titular."</span></div></td>
<td bgcolor='#ECE9D8'><div align='center'><span class='Estilo7'>".$sucursal."</span></div></td>
<td bgcolor='#ECE9D8'><div align='center'><span class='Estilo7'>".$usuari."</span></div></td>
<td bgcolor='#ECE9D8'><div align='center' class='Estilo21'><input type='button' value=ESTADO name='proceso' class=Estilo21 onClick = window.open('formulario_guia_contratos_estado.php?id=$id&cedula=$cedula&empresa=$empresa','','top=30,left=50,toolbar=yes,scrollbars=yes,width=900,height=800,status=yes')></a></span></div></td>
</tr>");
}
echo "</table>";
mysql_free_result($res);
echo "<TABLE width='200' border='4' align='center' cellpadding='0' cellspacing='1'>
<TR>
<tr bgcolor='#FFFFCC'><th scope='col'><span class='Estilo5'>TOTAL REGISTROS</span></th>";
printf("<tr>
<td bgcolor='#ECE9D8'><div align='center'><span class='Estilo7'>".$sum."</span></div></td>");
}
?>