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/www/acorreos/consulta_funcionario_contrato.php
<?php
require_once("../Conectarse.php");

////////////////

$Recordset1 = mysql_query('SELECT * FROM Usuarios WHERE (Cargo!="ABOGADO" and Cargo!="ABOGADA" and Cargo!= "MANTENIMIENTO ELECTRONICO" and Cargo!= "SECRETARIA TESORERIA" and Cargo!="Ingeniero de sistemas" and Cargo!="ARCHIVO Y CORRESPONDENCIA" and Cargo!="ASISTENTE COBRANZAS" and Cargo!="ASISTENTE COBRANZAS DOS" and Cargo!="ASISTENTE DE PRESIDENCIA" and Cargo!="ASISTENTE DIRECTOR DE SERVICIOS" and Cargo!="BANCOS" and Cargo!="CARTERA NOMINAS" and Cargo!="COBRANZAS" and Cargo!="CONSULTORIO JURIDICO" and Cargo!="CONTADOR" and Cargo!="CONTROL INTERNO" and Cargo!="DIRECTOR COMERCIAL" and Cargo!="DIRECTORA ACTUACIONES JURIDICAS" and Cargo!= "GERENTE ADMINISTRATIVA" and Cargo!= "Gerente Control de Calidad" and Cargo!= "GERENTE GENERAL" and Cargo!= "HISTOSER" and Cargo!= "JEFE COBRANZAS" and Cargo!="FINANCIERA"  and Cargo!="JEFE MANTENIMIENTO LOCATIVO"  and Cargo!="MENSAJES DE TEXTO"  and Cargo!="POSTVENTA" and Cargo!="PRESIDENTE SERVIASJUDINET" and Cargo!="ASISTENTE COBRANZAS" and Cargo!="RECEPCION" and Cargo!= "DIRECTOR REGIONAL" and codigo!="472" and codigo!="547"  and codigo!="555"  and codigo!="570"  and codigo!="499"  and codigo!="564") order by Nombre_Completo'); 
$row_Recordset1 = mysql_fetch_assoc($Recordset1);
$totalRows_Recordset1 = mysql_num_rows($Recordset1);

////////////////

$Recordset2 = mysql_query('SELECT * FROM sucursal order by nombre'); 
$row_Recordset2 = mysql_fetch_assoc($Recordset2);
$totalRows_Recordset2 = mysql_num_rows($Recordset2);

////////////////  


?>

<!DOCTYPE HTML>

<html>
<head>
<title>Consulta Funcionario</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;}
    
    .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: 150px;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{padding: 1px; border: 1px solid #a0a0a0;}
    .td{background-color: #e5e5e5; padding: 1px 30px;color: #00135F;font-size: 14px;font-weight: 600; text-align: center;}
    .boton1{width:150px;;background-color: #ffffff;color: #000;padding: 2px;border:2px solid #580000;border-radius:10px;}
    .boton1:hover{background-color: #6f0000;color: #fff;cursor: pointer;}
    input[type=text]{border-radius: 5px; padding: 3px;background-color: #fffde8;}
	
	.tdtitulo{background-color: #e3dec0; color: #b20606; padding: 2px; text-align: center; font-size: 12px;}
    .tdfull{background-color: #fff; color: #000; padding: 1px; text-align: center; font-size: 12px;}
    .botonnew{width: 90px; background-color: #e3dec0;color: #b20606;padding: 1px;border-radius:5px;}
    .botonnew:hover{width: 90px; background-color: #cbbd6a;color: #000;padding: 1px;border-radius:5px;}
</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">CONSULTA CONTRATOS FUNCIONARIO</h3>

<form name="formulario" action="" method="post">
<table width="651"  border="3" cellpadding="2" cellspacing="2">

<tr>
  	<td class="td">SELECCIONE EL FUNCIONARIO: </td>
   	<td class="td"><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="tdder" colspan="5">
  		<input name="menu2" type="button" class="irmenu" id="menu2" onClick="window.location.href='menu_guias_correo.php'" value="IR AL MENU">
    	<input name="consultar" type="submit" class="boton1" id="consultar" value="CONSULTAR">
   	</td>
</tr>

</table>

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

<?php

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

if ($_POST["consultar"])
{   

	$nom = $_POST["nombre"];


	$res = mysql_query("SELECT cedula, nombre_titular, nombre, contenido, tipo, sucursal, funcionario, empresa, estado, seguimiento, fecha_envio, id, numero_contrato FROM consulta_contratos  WHERE funcionario= '".$_POST[funcionario]."' order by nombre_titular ");	
	if (!$res) {
		die('Invalid query: ' . mysql_error());
	} 


	if ((mysql_num_rows($res)!=0))  
	{
		printf("<table width='900' border='4' align='center' cellpadding='2' cellspacing='2'>
    	<tr>
    	<th colspan='10' scope='col'>LISTADO COTRATOS POR FUNCIONARIO </th>
    	</tr>
    
		<tr>
		<th class='tdtitulo' scope='col'>CEDULA</th>
        <th class='tdtitulo' scope='col'>NOMBRES Y APELLIDOS</th>				   				
		<th class='tdtitulo' scope='col'>SUCURSAL</th>
		<th class='tdtitulo' scope='col'>FUNCIONARIO</th>
		<th class='tdtitulo' scope='col'>CAMBIO ESTADO</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></div></td>
		printf("<tr> 
		<td class='tdfull'>".$cedula."</div></td>
		<td class='tdfull'>".$nombre_titular."</div></td>
		<td class='tdfull'>".$sucursal."</div></td>
		<td class='tdfull'>".$usuari."</div></td>
		<td class='tdfull'><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></div></td>
			   
         </tr>");
  	}
	echo "</table>";   
    mysql_free_result($res);  
					  
	echo "<TABLE width='200' border='4' align='center' cellpadding='0' cellspacing='1'>
    <TR>
   		<th class='tdtitulo' scope='col'>TOTAL REGISTROS</th>";
			 
		printf("<tr>
       	<td class='tdfull'>".$sum."</div></td>");	  
					  
         }
}
?>