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/consulta_concep_fun.php
.<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Consulta Histoser por Funcionario y Concepto </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;}
.texto2 {background-color: #CCCCCC; 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;}
.Estilo2 {font-family: Arial;	font-size: 16px;	color: #990000;}
.boton2 {font-family: Verdana; font-size: 8 pt; color: #000080; background-color: #C0C0C0; border-style: solid; width:70px; height:22px;}
body {
	background-image: url();
}
.Estilo50 {color: #CC3333;
	font-family: "Arial Narrow";
	font-weight: bold;
}
-->
</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>
<?php
   
   require_once("mainfile.php");
   include ("config.php");
   global $dbi;
   
      require_once("Conectarse.php");
 
	$sql = mysql_query('SELECT * FROM Usuarios WHERE (cargo = "ABOGADO" || cargo = "DIRECTORA DE SERVICIO BARRANQUILLA" || cargo = "DIRECTOR DE SERVICIOS BUCARAMANGA" || cargo = "DIRECTOR DE SERVICIOS CALI" || cargo = "DIRECTOR DE SERVICIOS FLORENCIA" || cargo = "DIRECTOR DE SERVICIOS IBAGUE" || cargo = "DIRECTOR DE SERVICIOS MEDELLIN" || cargo = "DIRECTOR DE SERVICIOS NEIVA" || cargo = "DIRECTORA DE SERVICIOS PEREIRA" || cargo = "DIRECTORA DE SERVICIOS TUNJA"  || cargo = "DIRECTORA SERVICIOS VILLAVICENCIO" || cargo = "DIRECTOR DE SERVICIOS MOCOA"  || cargo = "SUSTANCIADOR"  || cargo = "MEDICO")  order by Nombre_Completo ');
			if (!$sql) {
				die('Invalid query: ' . mysql_error());
			}
	$row_sql = mysql_fetch_assoc($sql);
	$totalRows_sql = mysql_num_rows($sql);
?>
<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">CONSULTAS</div></td>
  </tr>
  <tr bgcolor="#ECE9D8">
    <td height="22" class="fecha"><div align="center">
      <script languaje="JavaScript">Mostrar_Fecha()</script>
    </div></td>
  </tr>
  <tr bgcolor="#FFCC99">
    <td height="42"><fieldset>
   <legend><span class="texto">Ingrese Funcionario :</span></legend>
   <table width="509" border="0" cellspacing="0" cellpadding="0">
     <tr>
       <td><span class="Estilo2">Funcionario:</span></td>
       <td><select name="ced_funcionario" id="ced_funcionario">
         <option>SELECCIONE FUNCIONARIO</option>
         <?php
     do {  
?>
         <option value="<?php echo $row_sql['Cedula'];?>"><?php echo $row_sql['Nombre_Completo']?></option>
         <?php
} while ($row_sql = mysql_fetch_assoc($sql));
  $rows = mysql_num_rows($sql);
  if($rows > 0) {
      mysql_data_seek($sql, 0);
       $row_sql = mysql_fetch_assoc($sql);
  }
?>
       </select></td>
     </tr>
	 
     
   </table>
   <table width="509" border="0" cellspacing="0" cellpadding="0">
     <tr>
       <td><span class="texto">Ingrese  Concepto:</span></td>
       
       <td>&nbsp;</td>
     </tr>
	 <tr>
       <td width="157"><span class="Estilo2">Concepto:
         
       </span></td>
	   <td width="311"><select name="concept" id="concept">
	     <option>SELECCIONE CONCEPTO</option>
	     <option value="EXCELENTE">EXCELENTE</option>
	     <option value="BUENO">BUENO</option>
	     <option value="REGULAR">REGULAR</option>
	     <option value="MALO">MALO</option>
	     <option value="NINGUNA">NINGUNA</option>
	     </select>	   </td>
	 </tr>
     
   </table>
    
    </fieldset></td></tr>
    
       <tr>
	
       <td bgcolor="#FFCC99" align="center"> <span class="Estilo2"> De:
         <input name="fecha1" type="text" class="campo" id="fecha1" value="0000-00-00" size="10" maxlength="10">
       </span><span class="Estilo2"> Hasta:
	     <input name="fecha2" type="text" class="campo" id="fecha2" value="0000-00-00" size="10" maxlength="10">
        </span></td>
     </tr>
    
  <tr bgcolor="#FFCC99">
    <td><div align="center">
      <input name="menu2" type="button" class="Estilo50" id="menu2" onClick="window.location.href='menu_histoser.php'" value="IR AL MENU">
    </div></td>
  </tr>
  <tr bgcolor="#FFCC99">
    <td><div align="center">
      <input name="consultar" id="consultar" type="submit" class="boton" value="Consultar">
      <input name="button" type="button" class="boton" onclick="history.back()" value="Atr&aacute;s">
      <input name="button" type="button" class="boton" onclick="window.location.reload()" value="Actualizar">
    </div></td>
  </tr>
</table>
</fieldset></td>
  </tr>
</table>
</form>
</body>
</html>

<?php
if(isset($_POST["consultar"]))
{
	$cont=0;
	
    echo "<form name='form' action='' method='post'>";
    require_once("mainfile.php");
    include ("config.php");
    global $dbi;

    $mssql = mysql_query('SELECT * FROM accion_tomada WHERE cedula_funcionario = "' . $_POST[ced_funcionario] . '" and  concepto_servicio = "' . $_POST[concept] . '"');
			if (!$mssql) {
				die('Invalid query: ' . mysql_error());
			}
   if($mssql)
   {
      

	  $misql3 = mysql_query('SELECT Nombre_Completo FROM Usuarios WHERE Cedula = "' .$_POST[ced_funcionario] . '" ');
			if (!$misql3) {
				die('Invalid query: ' . mysql_error());
			} 	 
	  list($nomfun) = mysql_fetch_row($misql3);
	 
					  $control = mysql_query('SELECT id, cedula_afiliado, numero_atencion, cedula_funcionario, numero_orden, tipo_orden, concepto_servicio FROM accion_tomada WHERE cedula_funcionario = "' .$_POST[ced_funcionario] . '" and  concepto_servicio = "' .$_POST[concept]. '" order by numero_atencion ');
			if (!$control) {
				die('Invalid query 25: ' . mysql_error());
			} 
					  
                      if ((mysql_num_rows($control)!=0)) 
	                    {	 

							  echo "<TABLE width='1000' border='0' align='center' cellpadding='5' cellspacing='3'>
                              
							  <TR>
                              <TD bgcolor='#FFCC66'><div align='center'><span class='texto2'>NOMBRE FUNCIONARIO</span></div></TD>
                              <TD bgcolor='#FFCC66'><div align='center'><span class='texto2'>CONCEPTO </span></div></TD>";	
														   printf("<tr>						   
		                           <td bgcolor='#C5D6FC'><div align='center' class='lista'>".$nomfun."</span></div></td>
								   <td bgcolor='#C5D6FC'><div align='center' class='lista'>".$_POST[concept]."</span></div></td>");
					 		echo "</table>";			  
							  
							  echo "<TABLE width='1000' border='0' align='center' cellpadding='0' cellspacing='1'>
                              
							  <TR>
                              <TD bgcolor='#FFFFCC'><div align='center'><span class='texto'>NUMERO ATENCION</span></div></TD>
                              <TD bgcolor='#FFFFCC'><div align='center'><span class='texto'>CEDULA</span></div></TD>	
							  <TD bgcolor='#FFFFCC'><div align='center'><span class='texto'>FECHA SERVICIO</span></div></TD>
                              <TD bgcolor='#FFFFCC'><div align='center'><span class='texto'>TIPO</span></div></TD>
                              <TD bgcolor='#FFFFCC'><div align='center'><span class='texto'>NUMERO ORDEN</span></div></TD>
                              <TD bgcolor='#FFFFCC'><div align='center'><span class='texto'>TIPO ORDEN</span></div></TD>				  							  
                              
							  <TD bgcolor='#FFFFCC'><div align='center'><span class='texto'>CONCEPTO</span></div></TD>";		 		  
                              
     
                  while(list($id, $cedula_afiliado, $numero_atencion, $cedula_funcionario, $numero_orden, $tipo_orden, $concepto_servicio) = mysql_fetch_row($control)) 
                              {  
                                  

 $misql2 = mysql_query('SELECT fecha_servicio, tipo FROM record_servicios WHERE cedula = "' ."$cedula_afiliado". '" and  numero_atencion = "' ."$numero_atencion". '"  and (fecha_servicio  between "' . $_POST[fecha1] . '" and "' . $_POST[fecha2] . '") and (estado = "2" || estado = "3") ');
			if (!$misql2) {
				die('Invalid query 25: ' . mysql_error());
			} 	 
	  list($fs, $ti) = mysql_fetch_row($misql2);
								   
								    if ((mysql_num_rows($misql2)!=0)) 
	                    {	
						 $cont++;
								   printf("<tr>
								   <td bgcolor='#ECE9D8'><div align='center' class='lista'><input type='button' value=$numero_atencion name='cedu' class=boton2 onClick =window.open('modificar_atencion.php?id=$cedula_afiliado&atencion=$numero_atencion','','top=50,left=100,toolbar=no,scrollbars=no,width=800,height=700,status=yes')></a></span></div></td>
					               
                                   <td bgcolor='#ECE9D8'><div align='center' class='lista'>".$cedula_afiliado."</a></span></div></td>												   
                                   	<td bgcolor='#C5D6FC'><div align='center' class='lista'>".$fs."</span></div></td>								   
		                           <td bgcolor='#C5D6FC'><div align='center' class='lista'>".$ti."</span></div></td>							   
		                           <td bgcolor='#C5D6FC'><div align='center' class='lista'>".$numero_orden."</span></div></td>								   
		                           <td bgcolor='#C5D6FC'><div align='center' class='lista'>".$tipo_orden."</span></div></td>
								    <td bgcolor='#C5D6FC'><div align='center' class='lista'>".$concepto_servicio."</span></div></td>");
									
						}
                               }
			                       echo "</table>";		  
                        
		        
	      }
     }
    else
    {
          echo "<script>alert('La informacion no se encuentra en la base de datos');</script>";
    }
	
	echo  "<TD bgcolor='#FF3300'><div align='center'><span class='texto'>TOTAL POR CONCEPTO </span></div></TD>";
						echo "	  <td bgcolor='#0000CC'><div align='center' class='lista'>".$cont."</a></span></div></td>";
}	
	
?>