MOON
Server: Apache/2.2.34 (Unix) mod_ssl/2.2.34 OpenSSL/0.9.8e-fips-rhel5 mod_bwlimited/1.4 FrontPage/5.0.2.2635
System: Linux server.asjudinet.com 2.6.32-042stab141.3 #1 SMP Fri Nov 15 22:45:34 MSK 2019 i686
User: asjudine (504)
PHP: 5.2.17
Disabled: NONE
Upload Files
File: /home/asjudine/public_html/consulta_nombre_viaticos.php
.<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<html>
<head>
<title>Consulta Viaticos Por Municipio</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(ELEMENTOS/gris-blanco.jpg);
}
.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;}
-->
</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">
<center> <img src="ELEMENTOS\CABEZOTE SERVIASJUDINET.jpg" WIDTH=60% > </center>
<br>

 <p>
    
    <center>    <embed wmode="transparent" src="http://www.poodwaddle.com/clock10" width="100" height="100" type="application/x-shockwave-flash" bgcolor="#FFFFFF" /></center> 
    </p>

<table width="671" border="0" cellspacing="0" cellpadding="0" align="center">

  <tr>
    <td><fieldset><table width="669" border="5" align="center" cellpadding="2" cellspacing="2" bgcolor=#5261A4>
  <tr bgcolor="#FFFFCC">
    <td colspan="2" bgcolor="#DDDDDD" class="titulos"><div align="center"> CONSULTA VIATICOS POR NOMBRE DEL MUNICIPIO</div></td>
  </tr>
  <tr bgcolor="#ECE9D8">
    <td height="22" colspan="2" bgcolor="#FFFFCC" class="fecha"><div align="center">
      <script languaje="JavaScript">Mostrar_Fecha()</script>
    </div></td>
  </tr>
  

  <tr bgcolor="#6699FF">
    <td width="355"><div align="center">Nombre Municipio: </div></td>
    <td width="300"><input name="nom" type="text" id="nom" size="50" maxlength="50"></td>
  </tr>
  <tr bgcolor="#6699FF">
    <td colspan="2"><div align="center"><span class="Estilo51">
      <input name="busqueda" id="busqueda" type="submit" class="Estilo51" value="Buscar">
	 
    </span></div></td>
  </tr>
  
  <tr bgcolor="#FFCC99">
    <td colspan="2" bgcolor="#EEEEEE"><div align="center" class="Estilo51">
      <input name="menu2" type="button" class="Estilo50" id="menu2" onClick="window.location.href='menu_viaticos.php'" value="IR AL MENU">
    </div></td>
  </tr>
</table>
</fieldset></td>
  </tr>
</table>

</form>
</body>
</html>

<?php

   
if(isset($_POST["busqueda"]))
{

  require_once("Conectarse.php");
		
	echo "<form name='form' action='' method='post'>";
    require_once("mainfile.php");
    include ("config.php");
    global $dbi;
	
	
	//////////////////////

 $nom = $_POST["nom"];




$control = mysql_query('SELECT solicitud_no,fecha, cod_funcionario, cod_sucursal, municipio_destino, fecha_diligencia,ga_total FROM viaticos WHERE municipio_destino LIKE "' . "%$nom%" . '"  order by fecha DESC');
		  if (!$control) {
				die('Invalid query 2: ' . mysql_error());
			} 

					  if ((mysql_num_rows($control)!=0)) 
	                    {	 
					
                              echo "<TABLE width='900' border='2' align='center' cellpadding='2' cellspacing='1' bgcolor='#0000FF'>
                              <TR>
                              <TD bgcolor='#6699FF'><div align='center'><span class='estilo20'>No SOLICITUD</span></div></TD>
							  <TD bgcolor='#6699FF'><div align='center'><span class='estilo20'>FUNCIONARIO</span></div></TD>	
							  <TD bgcolor='#6699FF'><div align='center'><span class='estilo20'>SUCURSAL</span></div></TD>
                              <TD bgcolor='#6699FF'><div align='center'><span class='estilo20'>FECHA </span></div></TD>
							  <TD bgcolor='#6699FF'><div align='center'><span class='estilo20'>MUNICIPIO DESTINO</span></div></TD>
							  <TD bgcolor='#6699FF'><div align='center'><span class='estilo20'>FECHA DILIGENCIA </span></div></TD>
							  <TD bgcolor='#6699FF'><div align='center'><span class='estilo20'>GASTO TOTAL</span></div></TD>";		  
                           							  
                        
   while(list($solicitud_no, $fecha, $cod_funcionario, $cod_sucursal, $munic, $fechadg, $gastos) = 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);	
								 
								 
	$sum=$sum+1;		
	$valgastos=$valgastos+$gastos;					 
		   
								   printf("<tr>
                                    <td bgcolor='#FFFFFF'><div align='center' class='lista'><input type='button' value=$solicitud_no name='soli' class='Estilo3' onClick =window.open('solicitud_viaticos_apro.php?solicitud=$solicitud_no','','top=50,left=100,toolbar=no,scrollbars=yes,width=850,height=550,status=yes')></a></span></div></td>
                                   <td bgcolor='#FFFFFF'><div align='center' class='lista'>".$funcionario."</span></div></td>
								   <td bgcolor='#FFFFFF'><div align='center' class='lista'>".$sucu."</span></div></td>
								   <td bgcolor='#FFFFFF'><div align='center' class='lista'>".$fecha."</span></div></td>
								   <td bgcolor='#FFFFFF'><div align='center' class='lista'>".$munic."</span></div></td>
								   <td bgcolor='#FFFFFF'><div align='center' class='lista'>".$fechadg."</span></div></td>
								   <td bgcolor='#FFFFFF'><div align='center' class='lista'>".$gastos."</span></div></td>");              								   
                               }
			                       
								   echo "</table>";	
								   
								    echo "<TABLE width='250' border='0' align='center' cellpadding='0' cellspacing='1' bgcolor='#0000FF'>
									<br>
                              <TR>
                              <TD bgcolor='#6699FF'><div align='center'><span class='estilo20'>TOTAL REGISTROS</span></div></TD>
							  <TD bgcolor='#6699FF'><div align='center'><span class='estilo20'>TOTAL GASTOS</span></div></TD>";	
							   printf("<tr>
                                 
                                   <td bgcolor='#FFFFFF'><div align='center' class='lista'>".$sum."</span></div>
								   <td bgcolor='#FFFFFF'><div align='center' class='lista'>".$valgastos."</span></div></td>");   
								    
								   echo "</table>"; 
								   
								   	 	  
                        }
						
		       
	      }
  

echo "</form>";


?>