File: /home/asjudine/www/consulta_viatico_rech.php
<?php
require_once("mainfile.php");
include ("config.php");
global $dbi;
require_once("Conectarse.php");
$sql2 = mysql_query('SELECT * FROM asjudinet_abogados WHERE vigentes = "1" order by nombre_completo');
if (!$sql2) {
die('Invalid query: ' . mysql_error());
}
$row_sql2 = mysql_fetch_assoc($sql2);
$totalRows_sql2 = mysql_num_rows($sql2);
?>
.<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Revision - VIATICOS</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:30px;
height:22px;
}
body {
background-image: url();
}
.Estilo50 {color: #CC3333;
font-family: "Arial Narrow";
font-weight: bold;
}
.Estilo2 {
color: #FF6633;
font-size: 12px;
}
.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;
}
.est_cont2 { font-family: Geneva, Arial, Helvetica, sans-serif;
font-size: 10px;
font-style: normal;
font-weight: normal;
color: #2B39EC;
background-color: #F0F5CF;
height: 15px;
width: auto;
border: thin solid #FABF85;
}
-->
</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 class="titulos"><div align="center">VIATICOS APROBADOS</div></td>
</tr>
<tr bgcolor="#ECE9D8">
<td height="22" class="fecha"><div align="center">
<script languaje="JavaScript">Mostrar_Fecha()</script>
<table width="475" border="3" cellpadding="3" cellspacing="3" class="recaudo">
<caption>
</caption>
<tr>
<th colspan="4" scope="col"><label>Seleccione el Funcionario</label></th>
</tr>
<tr>
<td colspan="2"><div align="right"><span class="Estilo2">ABOGADO:</span></div></td>
<td width="234" colspan="2"><div align="left">
<select name="cod_funcionariov" class="est_cont2" id="cod_funcionariov">
<option>SELECCIONE FUNCIONARIO</option>
<?php
do {
?>
<option value="<?php echo $row_sql2['cedula'];?>"><?php echo $row_sql2['nombre_completo']?></option>
<?php
} while ($row_sql2 = mysql_fetch_assoc($sql2));
$rows2 = mysql_num_rows($sql2);
if($rows2 > 0) {
mysql_data_seek($sql2, 0);
$row_sql2 = mysql_fetch_assoc($sql2);
}
?>
</select>
</div></td>
</tr>
<tr>
<td colspan="4"><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='consulta_viaticos.php'" value="IR AL MENU">
<label></label>
</div></td>
</tr>
</table>
</fieldset></td>
</tr>
</table>
</form>
</body>
</html>
<?php
echo "<form name='form' action='' method='post'>";
require_once("mainfile.php");
include ("config.php");
global $dbi;
if(isset($_POST["consultar"]))
{
$mssql = mysql_query('SELECT * FROM viaticos WHERE cod_funcionario = "' . $_POST[cod_funcionariov] . '" and estado = "-1" ');
if (!$mssql) {
die('Invalid query: ' . mysql_error());
}
if($mssql)
{
$filas = mysql_num_rows($mssql);
if ($filas > 0)
{
$control = mysql_query('SELECT solicitud_no, fecha, cod_funcionario, cod_sucursal, municipio, fecha_diligencia FROM viaticos WHERE estado = "-1" and cod_funcionario = "' . $_POST[cod_funcionariov] . '" ORDER BY fecha DESC ');
if (!$control) {
die('Invalid query: ' . mysql_error());
}
if ((mysql_num_rows($control)!=0))
{
echo "<TABLE width='850' border='0' align='center' cellpadding='0' cellspacing='1'>
<TR>
<TD bgcolor='#FFFFCC'><div align='center'><span class='texto'>No SOLICITUD</span></div></TD>
<TD bgcolor='#FFFFCC'><div align='center'><span class='texto'>FUNCIONARIO</span></div></TD>
<TD bgcolor='#FFFFCC'><div align='center'><span class='texto'>SUCURSAL</span></div></TD>
<TD bgcolor='#FFFFCC'><div align='center'><span class='texto'>FECHA</span></div></TD>
<TD bgcolor='#FFFFCC'><div align='center'><span class='texto'>MUNICIPIO</span></div></TD>
<TD bgcolor='#FFFFCC'><div align='center'><span class='texto'>FECHA DILIGENCIA</span></div></TD>";
while(list($solicitud_no, $fecha, $cod_funcionario, $cod_sucursal, $munic, $fechadg) = mysql_fetch_row($control))
{
$control3 = mysql_query('SELECT nombre FROM sucursal WHERE codigo = "' ."$cod_sucursal". '" ');
if (!$control3) {
die('Invalid query: ' . mysql_error());
}
$num3=mysql_num_rows($control3);
list($sucu) = mysql_fetch_row($control3);
$control4 = mysql_query('SELECT Nombre_Completo FROM Usuarios WHERE Cedula = "' ."$cod_funcionario". '" ');
if (!$control4) {
die('Invalid query: ' . mysql_error());
}
$num4=mysql_num_rows($control4);
list($funcionario) = mysql_fetch_row($control4);
printf("<tr>
<td bgcolor='#ECE9D8'><div align='center' class='lista'><input type='button' value=$solicitud_no name='soli' class=estilo1 onClick =window.open('solicitud_viaticos_rechaza.php?solicitud=$solicitud_no','','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'>".$funcionario."</span></div></td>
<td bgcolor='#C5D6FC'><div align='center' class='lista'>".$sucu."</span></div></td>
<td bgcolor='#C5D6FC'><div align='center' class='lista'>".$fecha."</span></div></td>
<td bgcolor='#C5D6FC'><div align='center' class='lista'>".$munic."</span></div></td>
<td bgcolor='#C5D6FC'><div align='center' class='lista'>".$fechadg."</span></div></td>");
}
echo "</table>";
}
}
}
}
echo "</form>";
?>