File: /home/asjudine/www/adirectoress/solicitud_viaticos_respuesta.php
<?PHP extract($_POST,EXTR_SKIP); ?>
<?php
global $dbi;
require_once("../Conectarse.php");
if(isset($_POST["guardar"]))
{
$nombre_titular = strtoupper($nombre_titular);
$convocada = strtoupper($convocada);
$asunto = strtoupper($asunto);
$texto = strtoupper($texto);
$archivo = $_FILES["archivito"]["tmp_name"];
$tamanio = $_FILES["archivito"]["size"];
$tipo = $_FILES["archivito"]["type"];
$nombre = $_FILES["archivito"]["name"];
if ($archivo == "none" || $archivo == NULL)
{
echo "<script>alert('INGRESE UN ARCHIVO');</script>";
}
else
{
if ( $archivo != "none" || $archivo != NULL )
{
$fp = fopen($archivo, "rb");
$contenido = fread($fp, $tamanio);
$contenido = addslashes($contenido);
fclose($fp);
$cont45 = mysql_query("UPDATE viaticos set resultado = '".$_POST[resultado]."',estado_resul = '2',nombre='".$nombre."', contenido='".$contenido."',tipo='".$tipo."' WHERE solicitud_no = '" . $_POST[sol] . "' ");
if (!$cont45) {
die('Invalid query cont45: ' . mysql_error());
}
}
echo "<script>alert('Respuesta Enviada correctamente');</script>";
echo "<script languaje='javascript' type='text/javascript'>window.close();</script>";
}
}
$control3 = mysql_query('SELECT solicitud_no, fecha, cod_funcionario, cod_sucursal, municipio, cedula_afiliado, proceso_no, diligencia, fecha_diligencia, hora_diligencia, tipo_orden, estado, municipio_origen, municipio_destino, tiempo_viaje, valor_transporte, taxi, total_transporte, alimentacion, hotel, otros_gastos, total_gastos, observaciones, observaciones_ca, observaciones_gg, observaciones_ga, ga_transporte, ga_taxi, ga_alimentacion, ga_hotel, ga_otros, ga_total, resultado FROM viaticos WHERE solicitud_no = "' . $_GET["solicitud"] . '" and estado = "3" and estado_resul = "1"');
if (!$control3) {
die('Invalid query: ' . mysql_error());
}
$num3=mysql_num_rows($control3);
list($solicitud_no, $fecha, $cod_funcionario, $cod_sucursal, $municipio, $cedula, $proceso, $diligencia, $fecha_diligencia, $horadil, $tipo_orden, $estado, $municipio_origen, $municipio_destino, $tiempo_viaje, $valor_transporte, $taxi, $total_transporte, $alimentacion, $hotel, $otros_gastos, $total_gastos, $observaciones, $observaciones_ca, $observaciones_gg, $observaciones_ga, $ga_transporte, $ga_taxi, $ga_alimentacion, $ga_hotel, $ga_otros, $ga_total, $resultado) = mysql_fetch_row($control3);
//dividir fecha
$dia=substr($fecha, 8, 2);
$mes=substr($fecha, 5, 2);
$ano=substr($fecha, 0, 4);
//dividir fecha diligencia
$fddia=substr($fecha_diligencia, 8, 2);
$fdmes=substr($fecha_diligencia, 5, 2);
$fdano=substr($fecha_diligencia, 0, 4);
$control = mysql_query('SELECT nombre FROM cartera_serviasjudinet WHERE cedula = "'.$cedula.'" ');
//$num=mysql_num_rows($control);
$fil = mysql_num_rows($control);
if ($fil == 0)
{
$controlas = mysql_query('SELECT nombre FROM beneficiarios WHERE cedula = "'.$cedula.'" ');
if (!$controlas) {
die('Invalid query 2: ' . mysql_error());
}
list($apellidos_noms) = mysql_fetch_row($controlas);
}
else
{
list($apellidos_noms) = mysql_fetch_row($control);
}
$control2 = mysql_query('SELECT contrato,tipo_contrato FROM info_asjudinet WHERE cedula = "'.$cedula.'" ');
if (!$control2) {
die('Invalid query: ' . mysql_error());
}
list($contrato, $tipo_contrato) = mysql_fetch_row($control2);
$control3 = mysql_query('SELECT nombre FROM sucursal WHERE codigo = "'.$cod_sucursal.'" ');
if (!$control3) {
die('Invalid query: ' . mysql_error());
}
list($sucursal) = mysql_fetch_row($control3);
$control4 = mysql_query('SELECT Nombre_Completo FROM Usuarios WHERE Cedula = "'.$cod_funcionario.'" ');
if (!$control4) {
die('Invalid query: ' . mysql_error());
}
list($funcionario) = mysql_fetch_row($control4);
$control5 = mysql_query('SELECT actuacion FROM actuaciones WHERE cedula = "'.$cedula.'" and numero_proceso = "'.$proceso.'" order by fecha ');
if (!$control5) {
die('Invalid query: ' . mysql_error());
}
while(list($actuacion) = mysql_fetch_row($control5))
{
$actuacion2=$actuacion;
}
?>
<!DOCTYPE html>
<html>
<head>
<title>Documento sin título</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:#FFFFFF;font-family:Verdana, Geneva, 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;}
.subtitulos{width: 100%;text-align: left;color: #b20606;padding: 2px 0;font-size: 13px;}
table{margin: 0 auto;border: 8px solid #bebebe; text-align: center;
-webkit-box-shadow: 10px 10px 10px -4px rgba(0,0,0,0.75);
-moz-box-shadow: 10px 10px 10px -4px rgba(0,0,0,0.75);
box-shadow: 10px 10px 10px -4px rgba(0,0,0,0.75);}
.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{border: #D7D7D7 solid 0.2px;}
.tdizq{background-color: #EEE; color: #C70000;font-size: 13px;font-weight: 200; text-align: left;}
.tdcen{background-color: #EEE; color: #00135F;font-size: 13px;font-weight: 200; text-align: center;}
.tdder{background-color: #EEE; color: #630000;font-size: 13px;font-weight: 200; text-align: right;}
.tdroja{background-color: #EEE; color: #CC0005;font-size: 13px;font-weight: 400; text-align: right;}
.tdi{background-color: #FDF7D5; color: #00135F;font-size: 13px;font-weight: 200; text-align: left;}
.tdc{background-color: #FDF7D5; color: #00135F;font-size: 13px;font-weight: 200; text-align: center;}
.tdd{background-color: #FDF7D5; color: #00135F;font-size: 13px;font-weight: 200; text-align: right;}
.exp{color:#8A0000; font-size:12px;}
.boton1{width:150px;background-color: #ffffff;color: #000;padding: 4px;border:1px solid #580000;border-radius:2px;}
.boton1:hover{background-color: #6f0000;color: #fff;cursor: pointer;}
.direcciona{background-color: #640001;color: #fff; padding: 4px;border-radius: 3px;}
.direcciona:hover{background-color: #67a0d9; color: #000;}
input[type=text],select{height: 18px; background-color: #FFFFFF; font-size: 12px; padding:0 0 0 1px;}
/*select{border:solid #191919 0.5px; border-radius: 3px; padding: 1px;background-color: #FFFFFF; font-weight:600px; }*/
.tdtitulo{background-color: #e3dec0; color: #b20606; padding: 2px; text-align: center; font-size: 12px; font-weight: 900}
.tdfull{background-color: #fff; color: #000; padding: 5px; text-align: center; font-size: 12px; font-family:Verdana, Geneva, sans-serif;}
.tdjustify{background-color: #fff; color: #000; padding: 5px; text-align: justify; font-size: 12px; font-family:Verdana, Geneva, sans-serif;}
.botonnew{width: 25px; background-color: #C0292E;color: #FFFFFF;padding: 1px;border-radius:5px;}
.botonnew:hover{background-color: #cbbd6a;color: #000;padding: 1px;border-radius:5px;}
</style>
</head>
<body>
<header>
<img src="../ELEMENTS/bannerInterasjudinet.png" alt="" width=" 700" height="70">
</header>
<h3 class="titulo">SOLICITUD GASTOS DE TRASLADO</h3>
<form name="formulario" method="post" action="" enctype="multipart/form-data" onSubmit="return validar_campos(this)">
<div align="center">
<table width="708" border="1" class="est_cont5">
<!--<caption align="top">
<div align="center" class="Estilo1">SOLICITUD GASTOS DE TRASLADO </div>
</caption>-->
<tr>
<td class="tdder" colspan="2" >Fecha :</td>
<td class="tdizq" colspan="3">año
<input name="fano" type="text" class="est_cont2" id="fano" value="<?php echo $ano ?>" size="4" maxlength="4" />
- mes
<input name="fmes" type="text" class="est_cont2" id="fmes" value="<?php echo $mes ?>" size="2" maxlength="2" />
- dia
<input name="fdia" type="text" class="est_cont2" id="fdia" value="<?php echo $dia ?>" size="2" maxlength="2" />
</td>
<td class="tdder">No. Solicitud :</td>
<td class="tdizq" colspan="2" scope="col"><input name="sol" type="text" class="est_cont2" id="sol" value="<?php echo $solicitud_no ?>" size="10" maxlength="10" /></td>
</tr>
<tr>
<td class="tdder" colspan="2">El Doctor :</td>
<td class="tdizq" colspan="3"><input name="func" type="text" class="est_cont2" id="func" value="<?php echo $funcionario ?>" size="50" maxlength="50" /></td>
<td class="tdder">Sucursal :</td>
<td class="tdizq" colspan="2">
<input name="suc" type="text" class="est_cont2" id="suc" value="<?php echo $sucursal ?>" size="30" maxlength="30" />
</td>
</tr>
<tr>
<td class="tdder" colspan="2">Se desplaza al municipio :</td>
<td class="tdizq" colspan="3"><input name="mun" type="text" class="est_cont2" id="mun" value="<?php echo $municipio ?>" size="30" maxlength="30" /></td>
<td class="tdder">Para atender al afiliado :</td>
<td class="tdizq" colspan="2"><input name="afi" type="text" class="est_cont2" id="afi" value="<?php echo $apellidos_noms ?>" size="60" maxlength="60" readonly/></td>
</tr>
<tr>
<td class="tdder">Contrato No :</td>
<td class="tdizq"><input name="con" type="text" class="est_cont2" id="con" value="<?php echo $contrato ?>" size="10" maxlength="10" /></td>
<td class="tdder">Tipo :</td>
<td class="tdizq"><input name="tip" type="text" class="est_cont2" id="tip" value="<?php echo $tipo_contrato ?>" size="10" maxlength="10" /></td>
<td class="tdder">Cedula No :</td>
<td class="tdizq"><input name="ced" type="text" class="est_cont2" id="ced" value="<?php echo $cedula ?>" size="20" maxlength="20" readonly /></td>
<td class="tdder">Proceso No :</td>
<td class="tdizq"><input name="pro" type="text" class="est_cont2" id="pro" value="<?php echo $proceso ?>" size="15" maxlength="20" />
<input name="button" type="submit" id="button" class="direcciona" onclick="window.open('mostrar_actuaciones2.php?proceso=<?=$proceso;?>&id=<?=$cedula;?>','','top=50,left=100,toolbar=yes,scrollbars=yes,width=800,height=600,status=yes');" value="Ver" />
</td>
</tr>
<tr>
<td class="tdder" colspan="2">Diligencia de caracter :</td>
<td class="tdizq" colspan="3"><input name="dil" type="text" class="est_cont2" id="dil" value="<?php echo $diligencia ?>" size="50" maxlength="50" /></td>
<td class="tdder">Fecha Diligencia :</td>
<td class="tdizq" colspan="2">año
<input name="fano2" type="text" class="est_cont2" id="fano2" value="<?php echo $fdano ?>" size="4" maxlength="4" />
mes
<input name="fmes2" type="text" class="est_cont2" id="fmes2" value="<?php echo $fdmes ?>" size="2" maxlength="2" />
dia
<input name="fdia2" type="text" class="est_cont2" id="fdia2" value="<?php echo $fddia ?>" size="2" maxlength="2" />
</td>
</tr>
<tr>
<td class="tdder" colspan="2">Tipo de Orden :</td>
<td class="tdizq" colspan="3"><input name="tipoo" type="text" class="est_cont2" id="tipoo" value="<?php echo $tipo_orden?>" size="50" maxlength="50" /></td>
<td class="tdder">Hora :</td>
<td class="tdizq"><input name="hord" type="text" class="est_cont2" id="hord" value="<?php echo $horadil ?>" size="6" maxlength="6" /></td>
<td> </td>
</tr>
<tr>
<td class="tdder" colspan="2">Estado actual proceso :</td>
<td class="tdizq" colspan="6">
<textarea name="estadoact" id="estadoact" cols="70" rows="3"><?php echo $actuacion2 ?></textarea></td>
</tr>
</table>
<table width="690" border="1" class="est_cont5">
<!--<caption align="top">
<span class="titulo">RECORRIDO DEL ABOGADO</span>
</caption>-->
<h3 class="titulo">RECORRIDO DEL ABOGADO</h3>
<tr>
<td class="tdd">Del Municipio :</td>
<td class="tdi"><input name="mo" type="text" class="est_cont2" id="mo" value="<?php echo $municipio_origen ?>" size="40" maxlength="40" /></td>
<td class="tdd">Al Municipio :</td>
<td class="tdi"><input name="md" type="text" class="est_cont2" id="md" value="<?php echo $municipio_destino ?>" size="40" maxlength="40" /></td>
</tr>
<tr>
<td class="tdd">Tiempo de Viaje :</td>
<td class="tdi"><input name="tv" type="text" class="est_cont2" id="tv" value="<?php echo $tiempo_viaje ?>" size="5" maxlength="5" />
- Horas</td>
<td class="tdd">Valor Transporte $:</td>
<td class="tdi"><input name="vt" type="text" class="est_cont2" id="vt" value="<?php echo $valor_transporte ?>" size="20" maxlength="20" /></td>
</tr>
<tr>
<td class="tdd">Total Transporte Terrestre $:</td>
<td class="tdi"><input name="ttt" type="text" class="est_cont2" id="ttt" value="<?php echo $total_transporte ?>" size="20" maxlength="20" /></td>
<td class="tdd">Taxi $:</td>
<td class="tdi"><input name="tx" type="text" class="est_cont2" id="tx" value="<?php echo $taxi ?>" size="20" maxlength="20" /></td>
</tr>
<tr>
<td class="tdd">Alimentacion :</td>
<td class="tdi"><input name="ali" type="text" class="est_cont2" id="ali" value="<?php echo $alimentacion ?>" size="10" maxlength="10" /></td>
<td class="tdd">Hotel $:</td>
<td class="tdi"><input name="hot" type="text" class="est_cont2" id="hot" value="<?php echo $hotel ?>" size="20" maxlength="20" /></td>
</tr>
<tr>
<td class="tdd">Otros Gastos $:</td>
<td class="tdi"><input name="og" type="text" class="est_cont2" id="og" value="<?php echo $otros_gastos ?>" size="20" maxlength="20" /></td>
<td class="tdd">Total Gastos $:</td>
<td class="tdi"><input name="tg" type="text" class="est_cont2" id="tg" value="<?php echo $total_gastos ?>" size="20" maxlength="20" /></td>
</tr>
<tr>
<td class="tdd">Observaciones :</td>
<td class="tdi" colspan="3"><textarea name="obv" id="obv" cols="60" rows="2"><?php echo $observaciones ?></textarea></td>
</tr>
</table>
<table width="504" border="1" class="est_cont5">
<!--<caption align="top">
<span class="titulo">OBSERVACIONES</span>
</caption>-->
<h3 class="titulo">OBSERVACIONES</h3>
<tr>
<td class="tdder">Coordinadora Abogados/Motivos :</td>
<td class="tdizq" colspan="2" ><textarea name="obsca" id="obsca" cols="45" rows="2"><?php echo $observaciones_ca ?></textarea></td>
</tr>
<tr>
<td class="tdder">Gerencia General/Motivos :</td>
<td class="tdizq" colspan="2" scope="col"><textarea name="obsgg" id="obsgg" cols="45" rows="2"><?php echo $observaciones_gg ?></textarea></td>
</tr>
<tr>
<td class="tdder">Gerencia Administrativa/Motivos :</td>
<td class="tdizq" colspan="2" scope="col"><textarea name="obsga" id="obsga" cols="45" rows="2"><?php echo $observaciones_ga ?></textarea></td>
</tr>
</table>
<table width="317" border="1" class="est_cont5">
<!--<caption align="top">
<span class="titulo">GASTOS AUTORIZADOS </span>
</caption>-->
<h3 class="titulo">GASTOS AUTORIZADOS</h3>
<tr>
<td class='tdd'>Transporte Terrestre $:</td>
<td><input name="gatt" type="text" class="est_cont2" id="gatt" value="<?php echo $ga_transporte ?>" size="12" maxlength="12" /></td>
<td class='tdd'>Taxis $:</td>
<td ><input name="gatx" type="text" class="est_cont2" id="gatx" value="<?php echo $ga_taxi ?>" size="12" maxlength="12" /></td>
</tr>
<tr>
<td class='tdd'>Alimentacion $:</td>
<td><input name="gaal" type="text" class="est_cont2" id="gaal" value="<?php echo $ga_alimentacion ?>" size="12" maxlength="12" /></td>
<td class='tdd'>Hotel $:</td>
<td><input name="gaho" type="text" class="est_cont2" id="gaho" value="<?php echo $ga_hotel ?>" size="12" maxlength="12" /></td>
</tr>
<tr>
<td class='tdd'>Otros Gastos $:</td>
<td><input name="gaog" type="text" class="est_cont2" id="gaog" value="<?php echo $ga_otros ?>" size="12" maxlength="12" /></td>
<td class='tdd'>Total $:</td>
<td><input name="gatot" type="text" class="est_cont2" id="gatot" value="<?php echo $ga_total ?>" size="12" maxlength="12" /></td>
</tr>
</table>
<table width="519" border="1" class="est_cont5">
<!--<caption align="top">
<span class="titulo">RESULTADO SOLICITUD VIATICOS</span>
</caption>-->
<h3 class="titulo">RESULTADO SOLICITUD VIATICOS</h3>
<tr>
<td class='tdder'>Ingresar Resultado :</td>
<td class="tdcen"><textarea name="resultado" id="resultado" cols="50" rows="4"><?php echo $resultado ?></textarea></td>
</tr>
<tr>
<td class="tdc" colspan="3">Adjuntar Imagen Expediente :
<input type="file" name="archivito" size="40" maxlength="40"></td>
</tr>
</table>
<table width="200" border="1">
<tr>
<td><input name = "guardar" type="submit" class="direcciona" onclick= "valida_envia();" value="Guardar" /></td>
</tr>
</table>
<p> </p>
</div>
</form>
</body>
</html>