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/adirectoress/recorrido_funcionario.php
<?php
require_once("../Conectarse.php");

$Recordset1 = mysql_query('SELECT * FROM Usuarios WHERE (Cargo="ASESOR COMERCIAL") || codigo = 580 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>
<html>
<head>
<title>Listado Fecha Gestion</title>
<meta http-equiv="X-UA-Compatible" content="IE=8; IE=9; IE=edge" />
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    
<style type="text/css">
	*{margin: 0;padding: 0;}
    body{background-color:#EAEAEA;font-family:Geneva, Arial, Helvetica, sans-serif;}
    header {background-color: #B7271F; text-align: center;}
    .cerrarsesion{width: auto;background-color: #DBD8C9;color: #000;font-size: 13px;position:absolute;top: 15px;right:10px;z-index:0;padding: 10px;border-radius: 10px;cursor: pointer;}
    .cerrarsesion:hover{background-color: #ffffff;color: #000;}
    .titulo{width: 100%;text-align: center;background-color: #dbd8c9;color: #b20606;padding: 6px 0;font-size: 18px;}
    table{margin: 0 auto;border: 8px solid #bebebe; text-align: center;}
    .divirmenu{text-align: center;}
    .irmenu{width: 180px;background-color: #1c4fa0;color: #fff; padding: 4px;border-radius: 6px;}
    .irmenu:hover{background-color: #67a0d9; color: #000;}
    
    .fecha{background-color: #d6e08b; padding: 2px;color: #000;font-size: 15px; text-align: center;}
    td{border: #969696 solid 1px;}
    .tdizq{background-color: #EEE; padding: 1px 4px;color: #00135F;font-size: 13px;font-weight: 600; text-align: left;}
    .tdcen{background-color: #EEE; padding: 1px 4px;color: #00135F;font-size: 13px;font-weight: 600; text-align: center;}
    .tdder{background-color: #EEE; padding: 1px 4px;color: #00135F;font-size: 13px;font-weight: 600; text-align: right;}
	.tdi{background-color: #EEE; padding: 1px 4px;color: #87292C;font-size: 13px;font-weight: 600; text-align: left;}
    .tdc{background-color: #EEE; padding: 1px 4px;color: #87292C;font-size: 13px;font-weight: 600; text-align: center;}
    .tdd{background-color: #EEE; padding: 1px 4px;color: #87292C;font-size: 13px;font-weight: 600; text-align: right;}
	
	.exp{color:#8A0000; font-size:10px;}
    .boton1{width:30%;background-color: #ffffff;color: #000;padding: 2px;border:2px solid #580000;border-radius:4px;}
    .boton1:hover{background-color: #6f0000;color: #fff;cursor: pointer;}
	.direcciona{width: 180px; background-color: #8F0E11;color: #fff; padding: 5px;border-radius: 3px;}
	.direcciona:hover{background-color: #67a0d9; color: #000;}
    input[type=text],select{border-radius: 3px; padding: 3px;background-color: #FFFEF4;}
	
	.tdtitulo{background-color: #e3dec0; color: #b20606; padding: 2px; text-align: center; font-size: 12px; font-weight: 900}
    .tdfull{background-color: #fff; color: #000; padding: 1px; text-align: center; font-size: 12px;}
    .botonnew{width: 90px; background-color: #e3dec0;color: #b20606;padding: 1px;}
    .botonnew:hover{width: 90px; background-color: #cbbd6a;color: #000;padding: 1px;}
</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">
<header>
    <img src="../ELEMENTS/bannerInterasjudinet.png" alt="" width=" 700" height="70">
</header>
<h3 class="titulo">RECORRIDO POR FUNCIONARIO</h3>


<form name="formulario" action="" method="post">

<table width="600" border="6" align="center" cellpadding="2" cellspacing="2" bgcolor="#FFFFFF">
<!--<tr bgcolor="#FFFFCC">
    <td colspan="2" bgcolor="#2E7068" class="titulos" style="color:#FFFFFF"><div align="center">RECORRIDO POR FUNCIONARIO</div></td>
</tr>-->
<tr>
	<td  colspan="2" class="fecha"><div align="center">
      <script languaje="JavaScript">Mostrar_Fecha()</script>
    </div></td>
</tr>


<tr>
	<td width="223" class="tdcen">FECHA DESDE &nbsp;&nbsp; <input name="fecha1" type="text" class="campo1" id="fecha1" value="0000-00-00" size="15" maxlength="15"></td>
 	<td width="250" class="tdcen">FECHA HASTA &nbsp;&nbsp;<input name="fecha2" type="text" class="campo1" id="fecha2" value="0000-00-00" size="15" maxlength="15"></td>
</tr>
  
  
<tr>
 	<td class="tdcen">FUNCIONARIO 
	<td class="tdcen">
    	<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>

  
<tr>
	<td class="tdcen" colspan="2">
    <input name="consultar" id="consultar" type="submit" class="boton1" value="Consultar">
    <input name="menu2" type="button" class="irmenu" id="menu2" onClick="window.location.href='menu_recorridos.php'" value="IR AL MENU">
 	</td>
</tr>

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



<?php

require_once("../Conectarse.php");

if(isset($_POST["consultar"]))
{
	echo "<form name='form' action='' method='post'>";
    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 id,nombre_funcionario,sucursal,fecha_recorrido FROM control_recorridos WHERE  nombre_funcionario = "'.$nomfunciona.'" and fecha_recorrido between "'.$_POST [fecha1].'" and "'.$_POST[fecha2].'"');  
	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'>
        <TR>
		<TD class='tdtitulo'>ID</TD>
		<TD class='tdtitulo'>NOMBRE</TD>
		<TD class='tdtitulo'>SUCURSAL</TD>
		<TD class='tdtitulo'>FECHA RECORRIDO</TD>";		 		  
 
 		while(list($id,$nombre,$sucursal,$fecha_recorrido) = mysql_fetch_row($control)) 
        {     
			$controlsucu = mysql_query('SELECT nombre FROM sucursal WHERE codigo = "'.$sucursal.'" ');
		  	if (!$controlsucu) {   
				die('Invalid query 1: ' . mysql_error());
			}
		
			$num=mysql_num_rows($controlsucu); 
		
			list($nombresucu) = mysql_fetch_row($controlsucu);	
	 
	 
	 
	 
			$tota = $tota + 1;     
				
			printf("<tr>
			<td bgcolor='#ECE9D8'><div align='center' class='Estilo21'><input type='button' value=$id name='proceso' class=botonnew onClick =	window.open('consulta_desplazamientos.php?id=$id','','top=30,left=50,toolbar=yes,scrollbars=yes,width=800,height=800,status=yes')></a></td>
  
		  	<td class='tdfull''>".$nombre."</a></td>
		  	<td class='tdfull''>".$nombresucu."</a></td>
		  	<td class='tdfull''>".$fecha_recorrido."</a></td>");
		}
	}
							  
	else
	{
     	echo "<script>alert('No Hay Registros Para El Usuario Seleccionado');</script>";
	}
						
	echo "<TABLE width='200' border='0' align='center' cellpadding ='0' cellspacing='1'>
    <TR>
 	<TD class='tdtitulo'>TOTAL</TD>";			
					
	printf("<tr>   
								   
	<td class='tdfull''>".$tota."</a></td>");	

	echo "</form>"; 

 }
?>