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_viaticos_aprobados_gerencia.php
<?php 
  require_once("mainfile.php");
   include ("config.php");
   require_once("Conectarse.php");

$Recordset1 = mysql_query('SELECT * FROM Usuarios WHERE (codigo!="472"  and 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!="RECEPCION" and Cargo!="PRESIDENTE SERVIASJUDINET" and Cargo!="ASISTENTE COBRANZAS" ) order by Nombre_Completo '); 
			if (!$Recordset1) {
				die('Invalid query: ' . mysql_error());
			} 
$row_Recordset1 = mysql_fetch_assoc($Recordset1);
$totalRows_Recordset1 = mysql_num_rows($Recordset1);


	
		
$control = mysql_query('SELECT nombre_funcionario,sucursal,fecha_recorrido,municipios_recorridos,
contratos_realizados,kilometros_recorridos,galones_consumidos,novedades,valor_combustible,valor_hotel,valor_alimentacion,valor_imprevistos,modificaciones FROM control_recorridos WHERE id = "'.$_GET["id"].'" ');
		  if (!$control) {  
				die('Invalid query 1: ' . mysql_error());
			}
	$num=mysql_num_rows($control); 

list($nombre,$sucur,$fecha,$municipios,$contratos,$kilometros,$galones,$novedades,$combustible,$hotel,$alimentacion,$imprevistos,$modificaciones) = mysql_fetch_row($control);
		
	$total= $combustible+$hotel+$alimentacion+$imprevistos;		
  
$control2 = mysql_query('SELECT nombre FROM sucursal WHERE codigo = "'.$sucur.'" ');
		  if (!$control2) {  
				die('Invalid query 1: ' . mysql_error());
			}
	$numa=mysql_num_rows($control2); 

list($sucursal) = mysql_fetch_row($control2);
  
  

?>

<html>
<head>
<title>Consulta Desplazamiento</title>
<style type="text/css">
<!--
img {border: 0}
body,td {font-family: Verdana,Arial; font-size: 10pt; color: #000000}
input,select {font-family: Verdana,Arial; font-size: 10pt}
a:link, a:visited {text-decoration: none; color: #2030F0}
a:hover, a:active {text-decoration: underline; color: #D02010}
body table tr td table tr td form table {
	font-size: 14px;
	font-family: Georgia, "Times New Roman", Times, serif;
}
body table tr td table tr td form table tr td div strong {
	font-size: 10pt;
}
body table tr td table tr td form table tr td div strong {
	font-size: 9pt;
}
body table tr td table tr td form table tr td b {
	font-size: 9pt;
}
body table tr td table tr td form table tr td div {
	font-size: 7pt;
}
.polici {background-color: #FFCC66; font-size: 14px; font-family: Arial; color: #000099; width:10px display: block;}

.polici2 {background-color: #CC3300; font-size: 14px; font-family: Arial; color: #000099; width:10px display: block;}
-->
</style>

<script>
function Verificar() {
	
  if(document.frm.actuacion_gerencia.value == "") {
  alert("Por Favor Seleccione El Funcionario");
  document.frm.actuacion_gerencia.focus();
  return false;
 }	
	
if(document.frm.funcionario.value == "") {
  alert("Por Favor Seleccione Funcionario");
  document.frm.funcionario.focus();
  return false;
 }	

 if(document.frm.nombre.value == "") {
  alert("Por Favor Escriba El Nombre");
  document.frm.nombre.focus();
  return false;
 }
 
  if(document.frm.actuacion_gerencia.value == "") {
  alert("Por Favor Escriba La Actuacion");
  document.frm.actuacion_gerencia.focus();
  return false;
 }
 
 
 


 
 return true;
}
</script>
 


</head>
 
<body bgcolor="#EFEFEF" text="#000000" topmargin="0" leftmargin="0">
<br>
<center> <img src="ELEMENTOS\CABEZOTE SERVIASJUDINET.jpg" WIDTH=80% > </center>
<br>
<table width="100%" height="75%" bgcolor="#FFFFFF" border="0" cellspacing="0" cellpadding="0">
         
  <tr>
    <td height="10" valign="top">
 
      <table width="70%" border="0" cellspacing="0" cellpadding="0">
 
      </table>
    </td>
  </tr>
 
  <tr>
    <td align="center">
 
      <table width="58%" bgcolor="#EFEFEF" align="center" border="5" cellspacing="0" cellpadding="6">
 <tr>
   <td align="center" bgcolor="#2E7068"><big style="color:#FFFFFF"><b>CONSULTA DESPLAZAMIENTO</b></big></td>
  
 </tr>
 
 <tr>
   <td align="center" colspan="2">
 
<script>
function Verificar() {
	
	
if(document.frm.apellidos.value == "") {
  alert("Por Favor Escriba Los Apellidos");
  document.frm.apellidos.focus();
  return false;
 }	

 if(document.frm.nombre.value == "") {
  alert("Por Favor Escriba El Nombre");
  document.frm.nombre.focus();
  return false;
 }
 
 if(document.frm.ced.value == "") {
  alert("Por Favor Escriba El Numero De Cedula");
  document.frm.ced.focus();
  return false;
 }
 
 if(document.frm.ecivil.value == "") {
  alert("Por Favor Escriba El Estado Civil");
  document.frm.ecivil.focus();
  return false;
 } 
 
  if(document.frm.funcionario.value == "") {
  alert("Por Favor Seleccione El Funcionario");
  document.frm.funcionario.focus();
  return false;
 } 

if(document.frm.actuacion_gerencia.value == "") {
  alert("Por Favor Escriba La Actuacion");
  document.frm.actuacion_gerencia.focus();
  return false;
 } 

  if(document.frm.actuacion_gerencia.value == "") {
  alert("Por Favor Seleccione El Funcionario");
  document.frm.actuacion_gerencia.focus();
  return false;
 }
 
 return true;
}
</script>
 
   <form method="post" name="frm" onSubmit="return Verificar()">
       <table border="0" bgcolor="#EFEFEF" cellspacing="5">
 <!--<td><div align="right"><strong> Fecha Registro</strong></div></td>
    <td><div align="left">
      <input name="dia2" type="text" id="dia2" value="<?php echo date("d"); ?>" size="2" maxlength="2" readonly>
      <input name="mes2" type="text" id="mes2" value="<?php echo date("m"); ?>" size="2" maxlength="2" readonly>
      <input name="ano2" type="text" id="ano2" value="<?php echo date("Y"); ?>" size="4" maxlength="4" readonly>
    </div></td> 
  </tr>  -->
 
     <form method="post" name="frm" onSubmit="return Verificar()">
     
       <table border="2" bgcolor="#EFEFEF" cellspacing="5">

       
     <tr>
     <td align="right"><b>Funcionario:</b></td>
     <td><input type="text" name="funcionario" value="<? echo $nombre?>"size="50" maxlength="40" readonly></td>
     </tr>
       
         <tr>
  <td align="right"><b>Sucursal:</b></td> 
  <td><input type="text" name="sucursal"  value="<? echo $sucursal?>"size="50" maxlength="40"  readonly></td>
       </tr>
 
 
  
  <tr>
  <td align="right"><b>Fecha:</b></td>
  <td><input type="text" name="fecha" value="<? echo $fecha ?>"size="15" maxlength="15" readonly></td>
       </tr>
 
 
 
       <tr>
  <td align="right"><b>Kilometros Recorridos:</b></td>
  <td><input type="text" name="kilometros"  value="<? echo $kilometros?>"size="10"  readonly></td>
       </tr>
       
  <!--     <tr>
  <td align="right"><b>Galones Consumidos:</b></td>
  <td><input type="text" name="galones"  value="<? echo $galones?>"size="10"  readonly></td>
       </tr>
       -->
       
       <tr>
  <td align="right"><b>Contratos Realizados :</b></td>
  <td><input type="text" name="contratos"   value="<? echo $contratos?> "size="10"  readonly></td>
       </tr>
       
        <tr>
  <td align="right"><b>Valor Combustible:</b></td>
  <td><input type="text" name="combustible"   value="<? echo $combustible?> "size="10" readonly></td>
       </tr>
       
          <tr>
  <td align="right"><b>Valor Hotel:</b></td>
  <td><input type="text" name="hotel"   value="<? echo $hotel?> "size="10" readonly></td>
       </tr>
       
        <tr>
  <td align="right"><b>Valor Alimentacion:</b></td>
  <td><input type="text" name="alimentacion"   value="<? echo $alimentacion?> "size="10" readonly></td>
       </tr>
       
        <tr>
  <td align="right" bgcolor="#EFEFEF"><b>Descargar Foto Inicial:</b>
 </td>
   
  <td colspan="1" bgcolor="#EFEFEF" align="left"><center><span class="label2"><?php  
		echo "<a href='descargar_archivos_desplazamiento.php?id=$id'>Realizar Descarga</a>"?></span></center></td>

  </tr> 

<tr>
  <td align="right" bgcolor="#EFEFEF"><b>Descargar Foto Final:</b>
 </td>
   
  <td colspan="1" bgcolor="#EFEFEF" align="left"><center><span class="label2"><?php  
		echo "<a href='descargar_archivos_desplazamiento_dos.php?id=$id'>Realizar Descarga</a>"?></span></center></td>

  </tr> 


<tr>
  <td align="right" bgcolor="#EFEFEF"><b>Descargar Foto Poblaciones Visitadas:</b>
 </td>
   
  <td colspan="1" bgcolor="#EFEFEF" align="left"><center><span class="label2"><?php  
		echo "<a href='descargar_archivos_desplazamiento_tres.php?id=$id'>Realizar Descarga</a>"?></span></center></td>

  </tr> 

       
   <!--    <tr>
  <td align="right"><b>Valor Imprevistos:</b></td>
  <td><input type="text" name="imprevistos"   value="<? echo $imprevistos?> "size="10" readonly></td>
       </tr>
-->
       
   </table><br>
 
     <b>Municipios Recorridos</b><br>
    
     <textarea name="municipios" cols="50" rows="5" readonly><? echo $municipios?></textarea readonly><br><br>
     
     <b>Novedades</b><br>
     <textarea name="novedades" cols="70" rows="7" readonly><? echo $novedades?></textarea readonly><br><br>
     
     <b>Modificaciones</b><br>
     <textarea name="modificaciones" cols="70" rows="7" readonly><? echo $modificaciones?></textarea readonly><br><br>
     
      <b>Actuacion Gerencia Comercial</b><br>
     <textarea name="actuacion_gerencia" cols="70" rows="7"><? echo $modificaciones?></textarea><br><br>
     
     
 	 <table>
     
     <tr>
     <table>
    <td align="right"><b>Valor Total</b></td>
  <td><input type="text" name="total"   value="<? echo $total?> "size="10"  readonly></td>
 
    </tr>
      
 
     
      
      <tr>  
     <input name="guardar" type="submit" class="polici" id="guardar" value="Guardar Informacion" />
       </tr>
 </table>
     </form>
 </table>
   </td>
 </tr>
      </table><br> 
 
    </td>
  </tr>
 
 
  <td height="22" colspan="2" bgcolor="#EFEFEF" class="fecha"><div align="center">
  

 <br>
 


</body>
</html>

<?

//////////
if(isset($_POST["guardar"]))
{
	$fechast = date("y").'-'.date("m").'-'.date("d");
	
$control = mysql_query('SELECT sucursal FROM control_recorridos WHERE id = "'.$_GET["id"].'" ');
		  if (!$control) {  
				die('Invalid query 1: ' . mysql_error());
			}
	$num=mysql_num_rows($control); 

list($sucur) = mysql_fetch_row($control);
	
	$controlsucu = mysql_query('SELECT nombre FROM sucursal WHERE codigo = "'.$sucur.'" ');
		  if (!$controlsucu) {   
				die('Invalid query 1: ' . mysql_error());
			}
		
		$num=mysql_num_rows($controlsucu); 
		
		list($nombresucu) = mysql_fetch_row($controlsucu);	

	
$mssql3 = mysql_query("UPDATE  control_recorridos set  regional = '1',estado= '3',actuacion_gerencia= '".$_POST["actuacion_gerencia"]."'  WHERE fecha = '".$_GET["fecha"]."' and sucursal = '".$sucur."'  " );     
           
            if (!$mssql3) {   
				die('Invalid query cartera_serviasjudinet MODIFICAR: ' . mysql_error());
			}   
			


	echo "<script>alert('Los datos fueron Guardados');</script>";
	echo "<script languaje='javascript' type='text/javascript'>window.close();</script>";	


/////

}


?>