File: /home/asjudine/public_html/adirectoress/ingresar_atencion_histoser_func.php
<?php
global $dbi;
require_once("../Conectarse.php");
//$sql = "select id, cedula, numero_atencion, fecha_servicio, nombre_funcionario, cedula_funcionario, tipo from record_servicios where cedula = $id and numero_atencion = $atencion ";
//$control = mysql_query($sql, $dbi) or die(mysql_error());
$resul = mysql_query('SELECT id, cedula, numero_atencion, fecha_servicio, nombre_funcionario, cedula_funcionario, tipo FROM record_servicios WHERE cedula = "' . $_GET["id"] . '" and numero_atencion ="'.$_GET["atencion"].'"');
if (!$resul) {
die('Invalid query: ' . mysql_error());
}
if ((mysql_num_rows($resul)!=0))
{
list($id_at, $cedula_at, $numero_atencion_at, $fecha_servicio_at, $nombre_funcionario_at, $cedu_funcionario_at,$tipo_at) = mysql_fetch_row($resul);
// $sqlnom = "select nombre from asjudinet_cartera where cedula = $cedula_at";
// $control = mysql_query($sqlnom, $dbi) or die(mysql_error());
$resu = mysql_query('SELECT nombre FROM cartera_serviasjudinet WHERE cedula = "'.$cedula_at.'" ');
if (!$resu) {
die('Invalid query: ' . mysql_error());
}
$fil = mysql_num_rows($resu);
if ($fil == 0)
{
$resu = mysql_query('SELECT nombre FROM beneficiarios WHERE cedula = "'.$cedula_at.'"');
if (!$resu) {
die('Error de consulta: ' . mysql_error());
}
}
list($nombre_completo) = mysql_fetch_row($resu);
}
?>
<html>
<head>
<title>INGRESO ATENCION AL AFILIADO</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:#FFF;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{text-align: center;color: #b20606;padding: 2px 0;font-size: 14px;}
table{margin: 0 auto;border: 1px solid #bebebe; text-align: center; }
.irmenu{width:200px; background-color: #1c4fa0;color: #fff; padding: 4px; border-radius:3px;}
.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; height:28px;}
.tdizq{background-color: #EEE; color: #C70000;font-size: 12px;font-weight: 400; text-align: left;}
.tdcen{background-color: #EEE; color: #00135F;font-size: 13px;font-weight: 600; text-align: center;}
.tdder{background-color: #EEE; color: #630000;font-size: 13px;font-weight: 600; text-align: right;}
.tdroja{background-color: #EEE; color: #CC0005;font-size: 13px;font-weight: 400; text-align: right;}
.tdi{background-color: #F4F4F4; color: #00135F;font-size: 13px;font-weight: 200; text-align: left;}
.tdc{background-color: #F4F4F4; color: #00135F;font-size: 13px;font-weight: 200; text-align: center;}
.tdd{background-color: #F4F4F4; color: #00135F;font-size: 13px;font-weight: 200; text-align: right;}
.exp{color:#C22529; font-size:14px;}
.boton1{width:150px;background-color: #ffffff;color: #000;padding: 4px;border:1px solid #580000;border-radius:3px;}
.boton1:hover{background-color: #6f0000;color: #fff;cursor: pointer;}
.direcciona{width:200px; background-color: #640001;color: #fff; padding: 4px;border-radius: 3px;}
.direcciona:hover{background-color: #67a0d9; color: #000;}
input[type=text]{height: 24px; font-size: 13px; padding:0 0 0 1px;}
select{color:#C7292E; height: 24px; font-size: 13px; padding:0 0 0 1px;}
textarea{padding:5px;}
/*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;}
.roja{color:#DC181E; text-align:center;}
.texto{ color:#001900;text-align:justify; padding:8px; font-size:13px; }
.explica{background-color:#FEFEED; color:#001900;text-align:justify; padding:8px; font-size:14px; }
.explicar{background-color:#F5EBAD; color:#001900;text-align:justify; padding:8px; font-size:14px;}
</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 validar(formulario)
{
if (formulario.asesoria.value == "")
{
alert("Ingrese la asesoria");
formulario.asesoria.focus();
return (false);
}
if (formulario.documentosap.value == "")
{
alert("Ingrese documentos aportados");
formulario.documentosap.focus();
return (false);
}
if (formulario.solucion.value == "")
{
alert("Ingrese solucion dada");
formulario.solucion.focus();
return (false);
}
if (formulario.documentosre.value == "")
{
alert("Ingrese documentosre requeridos");
formulario.documentosre.focus();
return (false);
}
if (formulario.concepto.value == "")
{
alert("Ingrese concepto del servicio");
formulario.concepto.focus();
return (false);
}
observaciones
if (formulario.observaciones.value == "")
{
alert("Ingrese observaciones");
formulario.observaciones.focus();
return (false);
}
if (formulario.ciudad.value == "")
{
alert("Ingrese el nombre de la ciudad");
formulario.ciudad.focus();
return (false);
}
if (formulario.cedula.value == "")
{
alert("Ingrese el número de la cédula");
formulario.cedula.focus();
return (false);
}
if (formulario.nombre_completo.value == "")
{
alert("Ingrese apellidos y nombres");
formulario.nombre_completo.focus();
return (false);
}
if (formulario.expedicion_cedula.value == "")
{
alert("Ingrese la ciudad donde expidió su cédula");
formulario.expedicion_cedula.focus();
return (false);
}
if (formulario.edad.value == "")
{
alert("Ingrese su edad");
formulario.edad.focus();
return (false);
}
if (formulario.estado_civil.value == "")
{
alert("Ingrese su estado civil");
formulario.estado_civil.focus();
return (false);
}
if (formulario.ciudad.value == "")
{
alert("Ingrese el nombre de la ciudad");
formulario.ciudad.focus();
return (false);
}
if (formulario.natural_de.value == "")
{
alert("Ingrese de donde es usted");
formulario.natural_de.focus();
return (false);
}
if (formulario.residente_en.value == "")
{
alert("Ingrese la dirección de residencia");
formulario.residente_en.focus();
return (false);
}
if (formulario.ciudad_reside.value == "")
{
alert("Ingrese la ciudad donde reside");
formulario.ciudad_reside.focus();
return (false);
}
if (formulario.telefono_fijo.value == "")
{
alert("Ingrese el su número de teléfono fijo");
formulario.telefono_fijo.focus();
return (false);
}
if (formulario.celular.value == "")
{
alert("Ingrese el número de su celular");
formulario.celular.focus();
return (false);
}
if (formulario.grado.value == "")
{
alert("Ingrese su grado militar");
formulario.grado.focus();
return (false);
}
if (formulario.cargo.value == "")
{
alert("Ingrese su cargo actual");
formulario.cargo.focus();
return (false);
}
if (formulario.hechos.value == "")
{
alert("Redacte los hechos por el cual se le imputan los cargos");
formulario.hechos.focus();
return (false);
}
if (formulario.nom_funcionario.value == "")
{
alert("Escriba el nombre del funcionario investigador");
formulario.nom_funcionario.focus();
return (false);
}
if (formulario.cargo_funcionario.value == "")
{
alert("Escriba el cargo del funcionario investigador");
formulario.cargo_funcionario.focus();
return (false);
}
if (formulario.dia_noti.value == "")
{
alert("Escriba el día de la notificación");
formulario.dia_noti.focus();
return (false);
}
if (formulario.mes_noti.value == "")
{
alert("Escriba el mes de la notificación");
formulario.mes_noti.focus();
return (false);
}
return (true);
}
//--></script>
<script Language="JavaScript"><!--
var timerID = null;
var timerRunning = false;
var id,pause=0,position=0;
function stopclock ()
{
if(timerRunning)
clearTimeout(timerID);
timerRunning = false;
}
var timerID = null;
var timerRunning = false;
var id,pause=0,position=0;
function stopclock ()
{
if(timerRunning)
clearTimeout(timerID);
timerRunning = false;
}
function showtime ()
{
var now = new Date();
var hours = now.getHours();
var minutes = now.getMinutes();
var seconds = now.getSeconds()
var timeValue = "" + ((hours >12) ? hours -12 :hours)
timeValue += ((minutes < 10) ? ":0" : ":") + minutes
timeValue += ((seconds < 10) ? ":0" : ":") + seconds
timeValue += (hours >= 12) ? " pm" : " am"
document.formulario.Hora_Envio.value = timeValue;
timerID = setTimeout("showtime()",1000);
timerRunning = true;
}
function startclock ()
{
stopclock ();
showtime ();
}
//--></script>
<link href="file:///C|/Documents%20and%20Settings/web%20master/Mis%20documentos/job9.css" rel="stylesheet" type="text/css">
<style type="text/css">
<!--
.Estilo57 {color: #006666}
-->
</style>
</head>
<body onLoad="document.formulario.ciudad.focus();startclock()">
<header>
<img src="../ELEMENTS/bannerInterasjudinet.png" alt="" width=" 700" height="70">
</header>
<h3 class="titulo">INGRESO ATENCIONES AL AFILIADO</h3>
<form method="post" name="formulario" action="<?php echo $editFormAction; ?>" onSubmit="return validar(this)">
<table width="863" border="0" align="center" cellpadding="3" cellspacing="3">
<!--<tr valign="baseline" bgcolor="#FF6600">
<td colspan="8" align="right" nowrap><div align="center"><span class="Estilo2">INGRESO ATENCIONES AL AFILIADO </span></div></td>
</tr>-->
<tr>
<td colspan="8" class="fecha">
<script languaje="JavaScript">Mostrar_Fecha()</script>
</td>
</tr>
<tr>
<td colspan="8">
<table width="852">
<tr>
<td width="80" class="tdc"></td>
<td width="289">Fecha dd-mm/aaaa:
<input name="dia" type="text" id="dia2" value="<?php echo date("d"); ?>" size="2" maxlength="2" readonly="">
<input name="mes" type="text" id="mes2" value="<?php echo date("m"); ?>" size="2" maxlength="2" readonly="">
<input name="ano" type="text" id="ano2" value="<?php echo date("Y"); ?>" size="4" maxlength="4" readonly="">
</td>
<td width="80" class="tdc"></td>
</tr>
</table></td>
</tr>
<!--
<tr>
<td colspan="8"><div align="right" class="Estilo19 Estilo20">
<div align="left" class="Estilo41">
<div align="center" class="Estilo42">
<p> </p>
</div>
</div>
</div> </td>
</tr>
-->
<tr>
<td class="tdcen">Cedula:</td>
<td class="tdizq"><input name="ced_at" type="text" id="ced_at" value="<?php echo $cedula_at ?>" size="35" maxlength="35" readonly=""> </td>
<td class="tdcen">Nombre :</td>
<td class="tdizq"><input name="tipo_s" type="text" value="<?php echo $nombre_completo ?>" size="35" maxlength="35" readonly=""> </td>
</tr>
<tr>
<td class="tdcen">Numero de Atencion:</td>
<td class="tdizq"><input name="atencionnum" type="text" value="<?php echo $numero_atencion_at ?>" size="15" maxlength="15" readonly=""></td>
<td class="tdcen">Fecha de servicio:</span></strong></td>
<td class="tdizq"><input name="fechas" type="text" value="<?php echo $fecha_servicio_at ?>" size="15" maxlength="15" readonly=""></td>
</tr>
<tr>
<td class="tdcen">Nombre Funcionario:</td>
<td class="tdizq"><input name="nombre_funci" type="text" value="<?php echo $nombre_funcionario_at ?>" size="35" maxlength="35" readonly=""> </td>
<td class="tdcen">Tipo de servicio :</span></strong></td>
<td class="tdizq"><input name="tipo_s" type="text" value="<?php echo $tipo_at ?>" size="35" maxlength="35" readonly=""> </td>
</tr>
<tr>
<td class="tdcen">ASESORIA<p class="Estilo18">SOLICITADA</p></td>
<td class="tdc" colspan="7" >
<table width="508" align="center">
<tr>
<td width="500" class="subtitulos">ASESORIA</td>
</tr>
</table>
<table>
<tr>
<td width="500"><textarea name="asesoria" cols="70" rows="4" id="asesoria"></textarea></td>
</tr>
</table>
</div>
</td>
</tr>
<tr>
<td class="tdcen">DOCUMENTOS APORTADOS</td>
<td class="tdc" colspan="7" >
<table width="508" align="center">
<tr>
<td width="500" class="subtitulos">DOCUMENTOS</td>
</tr>
</table>
<table width="508" align="center">
<tr>
<td width="500"><textarea name="documentosap" cols="70" rows="4" id="textarea7"></textarea></td>
</tr>
</table>
</td>
</tr>
<tr>
<td class="tdcen">SOLUCION DADA</td>
<td class="tdc" colspan="7" >
<table width="508" align="center">
<tr>
<td width="500" class="subtitulos">SOLUCION</td>
</tr>
</table>
<table width="508" align="center">
<tr>
<td width="500"><textarea name="solucion" cols="70" rows="4" id="textarea7"></textarea></td>
</tr>
</table>
</td>
</tr>
<tr>
<td class="tdcen">DOCUMENTOS REQUERIDOS</td>
<td class="tdc" colspan="7" >
<table width="508" align="center">
<tr>
<td width="500" class="subtitulos">DOCUMENTOS</td>
</tr>
</table>
<table width="508" align="center">
<tr>
<td width="500"><textarea name="documentosre" cols="70" rows="4" id="textarea9"></textarea></td>
</tr>
</table>
</td>
</tr>
<tr>
<td class="tdcen">CONCEPTO DEL SERVICIO</td>
<td class="tdc" colspan="7" >
<table width="508" align="center">
<tr>
<td width="500" class="subtitulos">CONCEPTO</td>
</tr>
</table>
<table width="508" align="center">
<tr>
<td width="500"><textarea name="concepto" cols="70" rows="4" id="textarea9"></textarea></td>
</tr>
</table>
</td>
</tr>
<tr>
<td class="tdcen">OBSERVACIONES</td>
<td class="tdc" colspan="7" >
<table width="508" align="center">
<tr>
<td width="500" class="subtitulos">OBSERVACIONES</td>
</tr>
</table>
<table width="508" align="center">
<tr>
<td width="500"><textarea name="observaciones" cols="70" rows="4" id="textarea9"></textarea></td>
</tr>
</table>
</td>
</tr>
<tr>
<td colspan="8" >
<p align="center">
<input name="submit" type="submit" class="direcciona" value="ENVIAR" >
<input name="button" type="button" class="irmenu" onClick="window.location.href='../index.php'" value="IR A LA PAGINA PRINCIPAL">
<input name="button" type="button" class="boton1" onClick="window.location.reload()" value="Actualizar">
</p>
<p> </p>
</div></td>
</tr>
</table>
<div align="center">
<input type="hidden" name="MM_insert" value="formulario">
</div>
</form>
</body>
</html>
<?php
if ((isset($_POST["MM_insert"])) && ($_POST["MM_insert"] == "formulario"))
{
global $dbi;
if($_POST[ced_at]!='' && $_POST[atencionnum]!='' && $_POST[nombre_funci]!='' && $_POST[asesoria]!='' && $_POST[solucion]!='' && $_POST[documentosre] !='' && $_POST[documentosap] !='' && $_POST[concepto] !='' && $_POST[observaciones]!='')
{
//$mssql4 = mysql_query("select * from actuaciones_servicios where cedula = '$ced_at' and numero_atencion = '$atencionnum'",$dbi);
$resul4 = mysql_query('SELECT * FROM actuaciones_servicios WHERE cedula = "' . $_POST[ced_at] . '" and numero_atencion = "' . $_POST[atencionnum] . '"');
if (!$resul4) {
die('Invalid query: ' . mysql_error());
}
$num=mysql_num_rows($resul4);
if($num=='0')
{
$observaciones = strtoupper ($_POST[observaciones]);
$concepto = strtoupper ($_POST[concepto]);
$asesoria = strtoupper ($_POST[asesoria]);
$solucion = strtoupper ($_POST[solucion]);
$documentosre = strtoupper ($_POST[documentosre]);
$documentosap = strtoupper ($_POST[documentosap]);
mysql_query("INSERT INTO actuaciones_servicios (cedula, numero_atencion, nombre_funcionario, asesoria, solucion, documentos_re, documentos_ap, concepto, observaciones, estado) VALUES ('" . $_POST["ced_at"] . "', '" . $_POST["atencionnum"] . "', '" . $_POST["nombre_funci"] . "', '" . $_POST["asesoria"] . "', '" ."$solucion". "', '" . "$documentosre". "', '" . "$documentosap" . "', '" . "$concepto". "', '" . "$observaciones". "', '5')");
$mssql2 = mysql_query(" UPDATE record_servicios set estado = '5' WHERE cedula = '".$_GET[id]."' and numero_atencion = '" .$_GET[atencion]."' and estado = '4' ");
if (! $mssql2) {
die('Invalid query: ' . mysql_error());
}
echo "<script>alert('La información se ha enviado correctamente ');</script>";
echo "<SCRIPT LANGUAGE='javascript'> window.close();</SCRIPT>";
}else{
echo "<script>alert('Ya fue ingresada esta informacion');</script>";
}
}else{
echo "<script>alert('Falta ingresar informacion en algun campo, Debe ingresar toda la informacion ');</script>";
}
}
?>