File: /home/asjudine/public_html/programacion_consulta_hist.php
<html>
<head>
<title>PROGRAMACION CONSULTAS</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css">
<!--
.Estilo1 {font-family: "Arial Narrow"}
.Estilo2 {
font-family: Arial, Helvetica, sans-serif;
font-weight: bold;
}
.Estilo18 {font-family: "Arial Narrow"; font-weight: bold; font-size: 14; }
.Estilo19 {font-family: "Arial Narrow"; font-weight: bold; }
.Estilo20 {color: #990000}
.Estilo21 {font-family: "Arial Narrow"; font-weight: bold; font-size: 14; color: #990000; }
.Estilo23 {color: #990000; font-family: "Arial Narrow";}
.Estilo13 {font-size: 12px; font-weight: bold; }
.Estilo41 {font-family: "Times New Roman", Times, serif}
.Estilo42 {color: #009933}
.Estilo44 {font-family: "Arial Narrow"; font-weight: bold; font-size: 16px; color: #3366FF; }
.Estilo45 {
color: #0066FF;
font-size: 16px;
}
.Estilo46 {color: #666699}
.Estilo47 {font-family: "Arial Narrow"; font-weight: bold; font-size: 14; color: #666699; }
.Estilo48 {
color: #CC3333;
font-weight: bold;
}
.Estilo49 {color: #CC3333}
.Estilo50 {
color: #CC3333;
font-family: "Arial Narrow";
font-weight: bold;
}
.Estilo51 {color: #003333}
.Estilo52 {
font-size: 14px;
color: #0066FF;
font-weight: bold;
}
.Estilo53 {color: #666633}
.Estilo54 {
font-size: 14px;
font-family: "Courier New", Courier, mono;
color: #FF0033;
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 validar(formulario)
{
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;
}
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">
<!--
.Estilo57 {color: #006666}
-->
</style>
</head>
<?php
require_once("mainfile.php");
include ("config.php");
global $dbi;
$sqlnom = "select cedula, nombre, direccion, telefono, celular, ciudad, email from asjudinet_cartera where cedula = '$cedulita'";
$control = mysql_query($sqlnom, $dbi) or die(mysql_error());
list($cedula_c,$nombre_completo, $direccion, $telefono, $celular, $ciudad, $email) = mysql_fetch_array($control);
$query_sql = "SELECT * FROM sucursal order by nombre";
$sql = mysql_query($query_sql, $dbi) or die(mysql_error());
$row_sql = mysql_fetch_assoc($sql);
$totalRows_sql = mysql_num_rows($sql);
$query_sql2 = "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') order by Nombre_Completo";
$sql2 = mysql_query($query_sql2, $dbi) or die(mysql_error());
$row_sql2 = mysql_fetch_assoc($sql2);
$totalRows_sql2 = mysql_num_rows($sql2);
$cedulafun = $cedu;
?>
<body onLoad="document.formulario.ciudad.focus();startclock()">
<form method="post" name="formulario" action="<?php echo $editFormAction; ?>" onSubmit="return validar(this)">
<table width="863" border="0" align="center" cellpadding="3" cellspacing="3" bgcolor="#FAFAF5">
<tr valign="baseline" bgcolor="#FF6600">
<td colspan="8" align="right" nowrap><div align="center"><span class="Estilo2">INGRESO PROGRAMACION CONSULTA </span></div></td>
</tr>
<tr valign="baseline" bgcolor="#FAFAF5">
<td colspan="8" align="right" nowrap><div align="center" class="Estilo2">
<script languaje="JavaScript">Mostrar_Fecha()</script></div></td>
</tr>
<tr valign="baseline" bgcolor="#F2F2E6">
<td colspan="8"><table width="852">
<tr>
<td width="265"><div align="center"></div></td>
<td width="289"><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 width="215" align="right" nowrap bordercolor="#ECE9D8" bgcolor="#99CCCC"><div align="left"></div></td>
<td colspan="7"> </td>
</tr>
<tr valign="baseline" bgcolor="#F2F2E6">
<td bgcolor="#66CCCC"><div align="right" class="Estilo20">
<div align="left"><strong><span class="Estilo5 Estilo1 Estilo45"> </span><span class="Estilo5 Estilo1 Estilo45 Estilo57">Numero de Cedula:</span></strong></div>
</div></td>
<td><input name="ced3" type="text" value="<?php echo $cedula_c ?>" size="30" maxlength="30" readonly=""></td>
<td bgcolor="#66CCCC"><strong><span class="Estilo5 Estilo1 Estilo45 Estilo57">Nombre:</span></strong></td>
<td><input name="name_full" type="text" id="name_full" value="<?php echo $nombre_completo ?>" size="30" maxlength="30" readonly=""></td>
</tr>
<tr valign="baseline" bgcolor="#F2F2E6">
<td bgcolor="#66CCCC"><div align="right" class="Estilo20">
<div align="left"><strong><span class="Estilo5 Estilo1 Estilo45"> </span><span class="Estilo5 Estilo1 Estilo45 Estilo57">Direccion:</span></strong></div>
</div></td>
<td><input name="dir" type="text" id="dir" value="<?php echo $direccion ?>" size="30" maxlength="30" ></td>
<td bgcolor="#66CCCC"><strong><span class="Estilo5 Estilo1 Estilo45 Estilo57">Telefono:</span></strong></td>
<td><input name="tel" type="text" id="tel" value="<?php echo $telefono ?>" size="30" maxlength="30" ></td>
</tr>
<tr valign="baseline" bgcolor="#F2F2E6">
<td bgcolor="#66CCCC"><div align="right" class="Estilo20">
<div align="left"><strong><span class="Estilo5 Estilo1 Estilo45"> </span><span class="Estilo5 Estilo1 Estilo45 Estilo57">Numero Celular:</span></strong></div>
</div></td>
<td><input name="cel" type="text" id="cel" value="<?php echo $celular ?>" size="30" maxlength="30" ></td>
<td bgcolor="#66CCCC"><strong><span class="Estilo5 Estilo1 Estilo45 Estilo57">Ciudad:</span></strong></td>
<td><input name="ciu" type="text" id="ciu" value="<?php echo $ciudad ?>" size="30" maxlength="30"></td>
</tr>
<tr valign="baseline" bgcolor="#F2F2E6">
<td width="215" align="right" nowrap bordercolor="#ECE9D8" bgcolor="#66CCCC"><div align="left" class="Estilo20"><strong><span class="Estilo5 Estilo1 Estilo45 Estilo57">Email:</span></strong></div></td>
<td colspan="7"><input name="mail" type="text" id="mail" value="<?php echo $email ?>" size="30" maxlength="30" ></td>
</tr>
<tr valign="baseline" bgcolor="#F2F2E6">
<td bgcolor="#66CCCC"><div align="right" class="Estilo20">
<div align="left"><strong><span class="Estilo5 Estilo1 Estilo45 Estilo57"> Numero de Atencion:</span></strong></div>
</div></td>
<td width="229" bordercolor="#ECE9D8" bgcolor="#F2F2E6"><input name="atencionnum" type="text" size="15" maxlength="15" ></td>
<td width="137" bgcolor="#66CCCC"><strong><span class="Estilo5 Estilo1 Estilo45 Estilo57">Fecha de Servicio:</span></strong></td>
<td width="234"><input name="fechas" type="text" value="0000-00-00" size="15" maxlength="15" ></td>
</tr>
<tr valign="baseline" bgcolor="#F2F2E6">
<td bgcolor="#66CCCC"><div align="right" class="Estilo20">
<div align="left"><strong><span class="Estilo5 Estilo1 Estilo45 Estilo57"> Sucursal:</span></strong> </div>
</div></td>
<td width="229" bordercolor="#ECE9D8" bgcolor="#F2F2E6"><select name="codigo_sucursal" class="campo">
<option value="">--SELECCIONE SUCURSAL--</option>
<?php
do {
?>
<option value="<?php echo $row_sql['codigo'];?>"><?php echo $row_sql['nombre']?></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>
<td width="137" bgcolor="#66CCCC"><strong><span class="Estilo5 Estilo1 Estilo45 Estilo57">Hora de Servicio:</span></strong></td>
<td width="234"><input name="horas" type="text" id="horas" value="00:00 am" size="12" maxlength="8" ></td>
</tr>
<tr valign="baseline" bgcolor="#F2F2E6">
<td bgcolor="#66CCCC"><div align="right" class="Estilo20">
<div align="left"><strong><span class="Estilo5 Estilo1 Estilo45 Estilo57"> Nombre Funcionario:</span></strong></div>
</div></td>
<td width="229" bordercolor="#ECE9D8" bgcolor="#F2F2E6"><select name="ced_funcionario" id="ced_funcionario">
<option>SELECCIONE FUNCIONARIO</option>
<?php
do {
?>
<option value="<?php echo $row_sql2['Cedula'];?>"><?php echo $row_sql2['Nombre_Completo']?></option>
<?php
} while ($row_sql2 = mysql_fetch_assoc($sql2));
$rows2 = mysql_num_rows($sql2);
if($rows2 > 0) {
mysql_data_seek($sql2, 0);
$row_sql2 = mysql_fetch_assoc($sql2);
}
?>
</select></td>
<td width="137" bgcolor="#66CCCC"><strong><span class="Estilo5 Estilo1 Estilo45 Estilo57">Tipo de servicio :</span></strong></td>
<td width="234"><select name="tipo_servi" class="sel3">
<option value="" selected>--TIPO DE SERVICIO--</option>
<option value="ASESORIA JURIDICA">ASESORIA JURIDICA</option>
<option value="DISCIPLINARIA">DISCIPLINARIA</option>
<option value="SUSTANCIACION">SUSTANCIACION</option>
<option value="MEDICA LABORAL">MEDICA LABORAL</option>
<option value="TRAMITE DOCUMENTOS">TRAMITE DOCUMENTOS</option>
<option value="TELEFONICO">TELEFONICO</option>
</select> </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='index.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;
if($ced3)
{
$sqlnom = "select Nombre_Completo from Usuarios where Cedula = '$ced_funcionario'";
$control = mysql_query($sqlnom, $dbi) or die(mysql_error());
list($nombre_funcio) = mysql_fetch_array($control);
$sql = "INSERT INTO record_servicios (cedula, numero_atencion, fecha_servicio , hora_servicio, sucursal, nombre_funcionario, cedula_funcionario,tipo)
VALUES ('$ced3', '$atencionnum', '$fechas', '$horas', '$codigo_sucursal','$nombre_funcio', '$ced_funcionario', '$tipo_servi')";
mysql_query($sql, $dbi) or die(mysql_error());
$mssql2 = "update asjudinet_cartera set direccion='$dir', telefono='$tel', celular='$cel', ciudad='$ciu', email='$mail' where cedula = $ced3";
mysql_query($mssql2, $dbi) or die(mysql_error());
echo "<script>alert('La información se ha enviado correctamente ');</script>";
}
}
?>