File: /home/asjudine/www/ingresar_accion_tomada.php
<html>
<head><meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>ACCION TOMADA</title>
<style type="text/css">
<!--
.Estilo1 {font-family: "Arial Narrow"}
.Estilo2 {
font-family: Arial, Helvetica, sans-serif;
font-weight: bold;
}
.Estilo19 {font-family: "Arial Narrow"; font-weight: bold; }
.Estilo20 {color: #990000}
.Estilo21 {font-family: "Arial Narrow"; font-weight: bold; font-size: 14; color: #990000; }
.Estilo13 {font-size: 12px; font-weight: bold; }
.Estilo41 {font-family: "Times New Roman", Times, serif}
.Estilo42 {color: #009933}
.Estilo45 {
color: #0066FF;
font-size: 16px;
}
-->
</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.existepro.value == "")
{
alert("Falta Seleccionar existe proceso Juridico");
formulario.existepro.focus();
return (false);
}
if (formulario.existepro.value == "SI")
{
if (formulario.numpro.value == "")
{
alert("Falta Ingresar Número de Proceso");
formulario.numpro.focus();
return (false);
}
}
if (formulario.documento.value == "")
{
alert("Falta Seleccionar Si recibieron Documentos");
formulario.documento.focus();
return (false);
}
if (formulario.documento.value == "SI")
{
if (formulario.docul.value == "")
{
alert("Falta Ingresar N° de orden de trabajo o No proceso");
formulario.docul.focus();
return (false);
}
}
if (formulario.poder.value == "")
{
alert("Falta Seleccionar Si se elaboro poder");
formulario.poder.focus();
return (false);
}
if (formulario.poder.value == "SI")
{
if (formulario.podel.value == "")
{
alert("Falta Ingresar Número orden de trabajo");
formulario.podel.focus();
return (false);
}
}
if (formulario.sucurs.value == "")
{
alert("Falta Seleccionar Si el proceso se adelanta en esta sucursal");
formulario.sucurs.focus();
return (false);
}
if (formulario.sucurs.value == "NO")
{
if (formulario.codigo_sucursal.value == "")
{
alert("Falta Seleccionar sucursal");
formulario.codigo_sucursal.focus();
return (false);
}
}
if (formulario.concepto.value == "")
{
alert("Falta Seleccionar Concepto de Servicio");
formulario.concepto.focus();
return (false);
}
if (formulario.gestionre.value == "")
{
alert("Falta digitar que diligencia ha efectuado");
formulario.gestionre.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;
}
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) ? " p.m." : " a.m."
document.formulario.hora.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">
<!--
.sel3 {background-color:#DDFFFF; font-family:Arial; font-size:10px; color: #000066 }
.Estilo58 {color: #000033}
.Estilo59 {font-size: 16px}
.Estilo60 {color: #000066}
-->
</style>
</head>
<?php
require_once("mainfile.php");
require_once("Conectarse.php");
include ("config.php");
global $dbi;
$resul = mysql_query('SELECT cedula, nombre, tipocontrato , direccion, telefono, celular, ciudad, email FROM cartera_serviasjudinet WHERE cedula = "' . $_GET["cedul"] . '" ');
if (!$resul) {
die('Invalid query: ' . mysql_error());
}
list($cedula_c, $nombre_completo, $tipo, $direccion, $telefono, $celular, $ciudad, $email) = mysql_fetch_row($resul);
$fil = mysql_num_rows($resul);
if($fil == 0)
{
$resul = mysql_query('SELECT cedula, nombre, tipo_contrato_titular , direccion, telefono, celular, ciudad, email FROM beneficiarios WHERE cedula = "' . $_GET["cedul"] . '" ');
if (!$resul) {
die('Invalid query: ' . mysql_error());
}
list($cedula_c, $nombre_completo, $tipo, $direccion, $telefono, $celular, $ciudad, $email) = mysql_fetch_row($resul);
$fil = mysql_num_rows($resul);
if($fil == 0){
$resul = mysql_query('SELECT cedula, nombre, tipo , direccion, telefono, celular, ciudad, email FROM solicitud_credito WHERE cedula = "' . $_GET["cedul"] . '" ');
if (!$resul) {
die('Invalid query: ' . mysql_error());
}
list($cedula_c, $nombre_completo, $tipo, $direccion, $telefono, $celular, $ciudad, $email) = mysql_fetch_row($resul);
$fil = mysql_num_rows($resul);
if($fil == 0){
$resul = mysql_query('SELECT cedula, nombre, plan_titular , direccion, telefono, celular, ciudad, email FROM solicitud_beneficiario WHERE cedula = "' . $_GET["cedul"] . '" ');
if (!$resul) {
die('Invalid query: ' . mysql_error());
}
list($cedula_c, $nombre_completo, $tipo, $direccion, $telefono, $celular, $ciudad, $email) = mysql_fetch_row($resul);
$fil = mysql_num_rows($resul);
}
}
}
//$query_sql = "SELECT * FROM sucursal order by nombre";
//$sql = mysql_query($query_sql, $dbi) or die(mysql_error());
$resu = mysql_query('SELECT * FROM sucursal order by nombre');
if (!$resu) {
die('Invalid query: ' . mysql_error());
}
$row_sql = mysql_fetch_assoc($resu);
$totalRows_sql = mysql_num_rows($resu);
$cedulafun = $cedu;
// $sqlnom2 = "select cedula, numero_atencion, fecha_servicio, nombre_funcionario, cedula_funcionario from record_servicios where cedula = '$cedula_c' and numero_atencion = '$atencion'";
//$control2 = mysql_query($sqlnom2, $dbi) or die(mysql_error());
$resu2 = mysql_query('SELECT cedula, numero_atencion, fecha_servicio, nombre_funcionario, cedula_funcionario, horas_domicilia, horasde, horasalas, visitas FROM record_servicios WHERE cedula = "' .$_GET["cedul"] . '" and numero_atencion = "' .$_GET["atencion"] . '" ');
if (!$resu2) {
die('Invalid query: ' . mysql_error());
}
list($cedafi, $numate, $fecha_con, $nomfun, $cedfun, $horasdo, $horasde, $horas, $visitas) = mysql_fetch_row($resu2);
$sql5 = mysql_query('SELECT * FROM sucursal order by nombre ');
if (!$sql5) {
die('Invalid query: ' . mysql_error());
}
$row_sql5 = mysql_fetch_assoc($sql5);
$totalRows_sql5 = mysql_num_rows($sql5);
?>
<body onLoad="document.formulario.ciudad.focus();startclock()">
<form method="post" name="formulario" action="<?php echo $editFormAction; ?>" onSubmit="return validar(this)">
<table width="1056" border="0" align="center" cellpadding="3" cellspacing="3" >
<tr >
<td colspan="8" align="right" nowrap><div align="center"><span class="Estilo2">INGRESO ACCION TOMADA </span></div></td>
</tr>
<tr bgcolor="#FAFAF5">
<td colspan="8" align="right" nowrap><div align="center" class="Estilo2">
<script languaje="JavaScript">Mostrar_Fecha()</script>
</div></td>
</tr>
<tr bgcolor="#F2F2E6">
<td colspan="8"><table width="852">
<tr>
<td width="265"><div align="center"></div></td>
<td width="350"><div align="center"><span class="Estilo19 Estilo20">Fecha dd-mm/aaaa:</span><span class="Estilo21"> <span class="Estilo13">
<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="">
</span></span></div></td>
<td width="282"><div align="center"></div></td>
</tr>
</table></td>
</tr>
<tr valign="baseline" bgcolor="#FFCC99">
<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 valign="baseline" bgcolor="#F2F2E6">
<td bgcolor="#CCFFCC"><div align="right" class="Estilo60">
<div align="left"><strong> <span class="Estilo5 Estilo1 Estilo59">Fecha de Servicio:</span></strong></div>
</div></td>
<td bgcolor="#CCFFCC"><input name="fechaservi" type="text" value="<?php echo $fecha_con ?>" size="30" maxlength="30" readonly=""></td>
</tr>
<tr valign="baseline" bgcolor="#F2F2E6">
<td bgcolor="#CCFFCC"><div align="right" class="Estilo60">
<div align="left"><strong> <span class="Estilo5 Estilo1 Estilo59">Número de Cedula:</span></strong></div>
</div></td>
<td bgcolor="#CCFFCC"><input name="ced3" type="text" value="<?php echo $cedula_c ?>" size="30" maxlength="30" readonly=""></td>
<td bgcolor="#CCFFCC"><strong><span class="Estilo5 Estilo1 Estilo45 Estilo60">Nombre:</span></strong></td>
<td bgcolor="#CCFFCC"><input name="name_full" type="text" id="name_full" value="<?php echo $nombre_completo ?>" size="40" maxlength="40" readonly=""></td>
</tr>
<tr valign="baseline" bgcolor="#F2F2E6">
<td bgcolor="#CCFFCC"><div align="right" class="Estilo60">
<div align="left"><strong> <span class="Estilo5 Estilo1 Estilo59">Direccion:</span></strong></div>
</div></td>
<td bgcolor="#CCFFCC"><input name="dir" type="text" id="dir" value="<?php echo $direccion ?>" size="30" maxlength="30" ></td>
<td bgcolor="#CCFFCC"><strong><span class="Estilo5 Estilo1 Estilo45 Estilo60">Teléfono:</span></strong></td>
<td bgcolor="#CCFFCC"><input name="tel" type="text" id="tel" value="<?php echo $telefono ?>" size="30" maxlength="30" ></td>
</tr>
<tr valign="baseline" bgcolor="#F2F2E6">
<td bgcolor="#CCFFCC"><div align="right" class="Estilo60">
<div align="left"><strong> <span class="Estilo5 Estilo1 Estilo59">Número Celular:</span></strong></div>
</div></td>
<td bgcolor="#CCFFCC"><input name="cel" type="text" id="cel" value="<?php echo $celular ?>" size="30" maxlength="30" ></td>
<td bgcolor="#CCFFCC"><strong><span class="Estilo5 Estilo1 Estilo45 Estilo60">Ciudad:</span></strong></td>
<td bgcolor="#CCFFCC"><input name="ciu" type="text" id="ciu" value="<?php echo $ciudad ?>" size="30" maxlength="30"></td>
</tr>
<tr valign="baseline" bgcolor="#F2F2E6">
<td height="29" align="right" bordercolor="#ECE9D8" bgcolor="#CCFFCC"><div align="left" class="Estilo60"><strong><span class="Estilo5 Estilo1 Estilo59">Email:</span></strong></div></td>
<td bgcolor="#CCFFCC" ><input name="mail" type="text" id="mail" value="<?php echo $email ?>" size="30" maxlength="30" ></td>
<td width="169" align="right" nowrap bordercolor="#ECE9D8" bgcolor="#CCFFCC"><div align="left" class="Estilo60"><strong><span class="Estilo5 Estilo1 Estilo59">Tipo Plan:</span></strong></div></td>
<td bgcolor="#CCFFCC"><input name="tipo" type="text" id="tipo" value="<?php echo $tipo ?>" size="30" maxlength="30" ></td>
</tr>
<tr valign="baseline" bgcolor="#F2F2E6">
<td bgcolor="#CCFFCC"><div align="right" class="Estilo60">
<div align="left"><strong><span class="Estilo5 Estilo1 Estilo59">Número de Atención:</span></strong></div>
</div></td>
<td width="270" bordercolor="#ECE9D8" bgcolor="#CCFFCC"><input name="atencionnum" type="text" value="<?php echo $numate ?>" size="15" maxlength="15" readonly=""></td>
<td width="169" bgcolor="#CCFFCC"><strong><span class="Estilo5 Estilo1 Estilo45 Estilo60">Funcionario :</span></strong></td>
<td width="378" bgcolor="#CCFFCC"><input name="fechas" type="text" value="<?php echo $nomfun ?>" size="40" maxlength="40" readonly=""></td>
<tr>
<td bgcolor="#CCFFCC"><div align="right" class="Estilo60">
<div align="left"><strong><span class="Estilo5 Estilo1 Estilo59"> Existe proceso jurídico por esta consulta:</span></strong> </div>
</div></td>
<td bordercolor="#ECE9D8" bgcolor="#CCFFCC"><span class="Estilo58">
<select name="existepro" class="concep" id="existepro">
<option value="">-----</option>
<option value="SI">SI</option>
<option value="NO">NO</option>
</select>
<strong><span class="Estilo5 Estilo1 Estilo59 Estilo60">N° Proceso :</span></strong>
<input name="numpro" type="text" id="numpro" value="" size="8" maxlength="8" >
</span></td>
<td bgcolor="#CCFFCC"><div align="left" class="Estilo60"><strong><span class="Estilo5 Estilo1 Estilo59">Se reciben documentos aportados:</span></strong></div></td>
<td bordercolor="#ECE9D8" bgcolor="#CCFFCC"><span class="Estilo58">
<select name="documento" class="concep" id="documento">
<option value="">-----</option>
<option value="SI">SI</option>
<option value="NO">NO</option>
</select>
<strong><span class="Estilo5 Estilo1 Estilo59 Estilo60">N° de orden de trabajo o N° de proceso:</span></strong>
<input name="docul" type="text" id="docul" value="" size="5" maxlength="5" >
</span></td>
</tr>
<tr>
<td bgcolor="#CCFFCC"><div align="right" class="Estilo60">
<div align="left"><strong><span class="Estilo5 Estilo1 Estilo59">Se elaboró poder para actuar:</span></strong> </div>
</div></td>
<td bordercolor="#ECE9D8" bgcolor="#CCFFCC"><span class="Estilo58">
<select name="poder" class="concep" id="poder">
<option value="">-----</option>
<option value="SI">SI</option>
<option value="NO">NO</option>
</select>
<strong><span class="Estilo5 Estilo1 Estilo59 Estilo60">N° Orden de trabajo :</span></strong>
<input name="podel" type="text" id="podel" value="" size="8" maxlength="8" >
</span></td>
<td bgcolor="#CCFFCC"><div align="left" class="Estilo60"><strong><span class="Estilo5 Estilo1 Estilo59">El proceso se adelanta en esta sucursal:</span></strong></div></td>
<td bordercolor="#ECE9D8" bgcolor="#CCFFCC"><span class="Estilo58">
<select name="sucurs" class="concep" id="sucurs">
<option value="">-----</option>
<option value="SI">SI</option>
<option value="NO">NO</option>
</select>
<strong>En cual <span class="Estilo5 Estilo1 Estilo59 Estilo60">:</span></strong>
<select name="codigo_sucursal" class="Estilo66">
<option value="">--SELECCIONE SUCURSAL--</option>
<option value="NINGUNA">NINGUNA</option>
<option value="ARAUCA">ARAUCA</option>
<?php
do {
?>
<option value="<?php echo $row_sql5['nombre'];?>"><?php echo $row_sql5['nombre']?></option>
<?php
} while ($row_sql5 = mysql_fetch_assoc($sql5));
$rows5 = mysql_num_rows($sql5);
if($rows5 > 0) {
mysql_data_seek($sql5, 0);
$row_sql5 = mysql_fetch_assoc($sql5);
}
?>
</select>
</span></td>
</tr>
<tr valign="baseline" bgcolor="#F2F2E6">
<td bgcolor="#CCFFCC"><div align="right" class="Estilo58">
<div align="left"><strong><span class="Estilo5 Estilo1 Estilo59 Estilo60"> Concepto del Servicio:</span></strong></div>
</div></td>
<td width="270" bordercolor="#ECE9D8" bgcolor="#CCFFCC"><select name="concepto" class="concep Estilo58" id="concepto">
<option value="" selected>--CONCEPTO DEL SERVICIO--</option>
<option value="EXCELENTE">EXCELENTE</option>
<option value="BUENO">BUENO</option>
<option value="REGULAR">REGULAR</option>
<option value="MALA">MALA</option>
<option value="NINGUNA">NINGUNA</option>
</select></td>
</tr>
</tr>
<tr bgcolor="#7897DD">
<td bgcolor="#CCFFCC"></td>
<td colspan="4" bgcolor="#CCFFCC"><div align="left"><span class="Estilo21 Estilo59">Que diligencias ha efectuado para tramitar y ejecutar el proceso que el Afiliado Solicita.</span></div></td>
</tr>
<tr bgcolor="#ECE9D8">
<td bgcolor="#CCFFCC"> </td>
<td colspan="3" bordercolordark="#000000" bgcolor="#CCFFCC"><p align="center">
<textarea name="gestionre" cols="90" rows="4" ></textarea>
</p> </td>
</tr>
<tr valign="baseline" bgcolor="#009999">
<td colspan="8" align="right" nowrap><div align="center" class="Estilo20">
<p>
<input name="submit" type="submit" value="ENVIAR" style="font-family: Verdana; font-size: 8 pt; background-color: #C0C0C0; border-style: solid">
<input name="button" type="button" style="font-family: Verdana; font-size: 8 pt; background-color: #C0C0C0; border-style: solid" onClick="window.location.href='menu_admin.php'" value="IR A LA PAGINA PRINCIPAL">
<input name="button" type="button" style="font-family: Verdana; font-size: 8 pt; background-color: #C0C0C0; border-style: solid" onClick="window.location.reload()" value="Actualizar">
</p>
</div></td>
</tr>
</table>
<div align="center">
<input type="hidden" name="MM_insert" value="formulario">
</div>
</form>
</body>
</html>
<?php
$editFormAction = $_SERVER['PHP_SELF'];
if (isset($_SERVER['QUERY_STRING']))
{
$editFormAction .= "?" . htmlentities($_SERVER['QUERY_STRING']);
}
if ((isset($_POST["MM_insert"])) && ($_POST["MM_insert"] == "formulario"))
{
require_once("mainfile.php");
include ("config.php");
global $dbi;
$lafecha = $_POST["ano"] . "-" . $_POST["mes"] . "-" . $_POST["dia"];
echo $lafecha;
// $fechasss = $_GET["fechase"];
//$mssql4 = mysql_query("select * from accion_tomada where cedula_afiliado = '$ced3' and numero_atencion = '$atencionnum'",$dbi);
$resul4 = mysql_query('SELECT * FROM accion_tomada WHERE cedula_afiliado = "' . $_POST["ced3"] . '" and numero_atencion = "' . $_POST["atencionnum"] . '" and estado = "5" ');
if (!$resul4) {
die('Invalid query: ' . mysql_error());
}
$num=mysql_num_rows($resul4);
//SE QUITA POR ORDEN DE DON EFFRAIN 2020-01-16
if ($lafecha <= $_GET["fechase"] || $_GET["esta"] == 7)
{
if($num==0)
{
$mssjj = mysql_query("INSERT INTO accion_tomada (cedula_afiliado, numero_atencion, cedula_funcionario , numero_orden, concepto_servicio, existe_proceso, no_proceso, recibe_documentos, no_orden, elaboro_poder, no_trabajo, diligencia_sucursal, cual_sucursal, diligencia_ejecutar, fecha, estado) VALUES ('" . $_POST["ced3"] . "', '" . $_POST["atencionnum"] . "', '" . "$cedfun". "', '" . $_POST["ordennum"] . "', '" . $_POST["concepto"] . "', '" . $_POST["existepro"] . "', '" . $_POST["numpro"] . "', '" . $_POST["documento"] . "', '" . $_POST["docul"] . "', '" . $_POST["poder"] . "', '" . $_POST["podel"] . "', '" . $_POST["sucurs"] . "', '" . $_POST["codigo_sucursal"] . "', '" . strtoupper($_POST["gestionre"]) . "', '" . $lafecha . "', '0')");
if (! $mssjj) {
die('Invalid query mssjj: ' . mysql_error());
}
$mssql2 = mysql_query(" UPDATE record_servicios set estado = '0' WHERE cedula = '" . $_GET[cedul] . "' and numero_atencion = '" . $_GET[atencion] . "' ");
if (! $mssql2) {
die('Invalid query: ' . mysql_error());
}
$controini = mysql_query(" UPDATE control_inicios_procesos set orden_trabajo = '" . $_POST[podel] . "' , num_proceso = '" . $_POST[numpro] . "' WHERE cedula = '" . $_GET[cedul] . "' and num_atencion = '" . $_GET[atencion] . "' ");
if (! $mssql2) {
die('Invalid query controini: ' . mysql_error());
}
$mssql2 = mysql_query(" UPDATE cartera_serviasjudinet set direccion = '" . $_POST[dir] . "' , telefono = '" . $_POST[tel] . "' , celular = '" . $_POST[cel] . "' , ciudad = '" . $_POST[ciu] . "' , email = '" . $_POST[mail] . "' WHERE cedula = '" . $_POST[ced3] . "' ");
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 Accion Tomada para esta atencion');</script>";
}
}
else
{
echo "<script>alert('Fecha accion tomada no corresponde --> Comuniquese con Sub-Gerencia');</script>";
}
}
?>