File: /home/asjudine/public_html/ing_diligencias_jud.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>
<style type="text/css">
<!--
.Estilo57 {color: #006666}
-->
</style>
</head>
<?php
require_once("mainfile.php");
include ("config.php");
global $dbi;
require_once("Conectarse.php");
// $sqlnom = "select cedula, nombre, direccion, telefono, celular, ciudad, email from asjudinet_cartera where cedula = '$cedulita'";
// $control = mysql_query($sqlnom, $dbi) or die(mysql_error());
$control = mysql_query('SELECT cedula, nombre, direccion, telefono, celular, ciudad, email FROM cartera_serviasjudinet WHERE cedula = "' ."$cedulita". '" ');
if (!$control) {
die('Invalid query: ' . mysql_error());
}
list($cedula_c,$nombre_completo, $direccion, $telefono, $celular, $ciudad, $email) = mysql_fetch_row($control);
//$query_sql = "SELECT * FROM sucursal order by nombre";
//$sql = mysql_query($query_sql, $dbi) or die(mysql_error());
$sql = mysql_query('SELECT * FROM sucursal order by nombre ');
if (!$sql) {
die('Invalid query: ' . 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' || cargo = 'DIRECTOR DE SERVICIOS MOCOA') order by Nombre_Completo";
//$sql2 = mysql_query($query_sql2, $dbi) or die(mysql_error());
$sql2 = mysql_query('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 DE SERVICIOS MONTERIA" || cargo = "DIRECTOR DE SERVICIOS MOCOA" || cargo = "DIRECTORA SERVICIOS VILLAVICENCIO") order by Nombre_Completo');
if (!$sql2) {
die('Invalid query: ' . 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="908" 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 DILIGENCIAS JUDICIALES </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="186" bgcolor="#66CCCC"><div align="right" class="Estilo20">
<div align="left"><strong><span class="Estilo5 Estilo1 Estilo45"> </span><span class="Estilo5 Estilo1 Estilo45 Estilo57">Tipo de Diligencia :</span></strong></div>
</div></td>
<td><input name="tipo_dil" type="text" id="tipo_dil" size="60" maxlength="60"></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">Despacho Judicial:</span></strong></div>
</div></td>
<td><input name="desp_jud" type="text" id="desp_jud" size="60" maxlength="60" ></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"> Ciudad:</span></strong></div>
</div></td>
<td width="360" bordercolor="#ECE9D8" bgcolor="#F2F2E6"><input name="ciudad" type="text" id="ciudad" size="40" maxlength="40" ></td>
<td width="116" bgcolor="#66CCCC"><strong><span class="Estilo5 Estilo1 Estilo45 Estilo57">Fecha Diligencia:</span></strong></td>
<td width="227"><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="360" 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="116" bgcolor="#66CCCC"><strong><span class="Estilo5 Estilo1 Estilo45 Estilo57">Hora Diligencia:</span></strong></td>
<td width="227"><strong><span class="Estilo5 Estilo1 Estilo45 Estilo57">Del:</span></strong>
<input name="horas" type="text" id="horas" value="00:00 am" size="12" maxlength="8" >
-<strong><span class="Estilo5 Estilo1 Estilo45 Estilo57"> Al:</span></strong>
<input name="horas2" type="text" id="horas2" 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="360" 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>
</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($atencionnum!='' && $fechas!='' && $horas!='' && $codigo_sucursal!='' && $ced_funcionario!='' && $tipo_servi!='' )
{
// $sqlnom = "select Nombre_Completo from Usuarios where Cedula = '$ced_funcionario'";
// $control = mysql_query($sqlnom, $dbi) or die(mysql_error());
$control = mysql_query('SELECT Nombre_Completo FROM Usuarios WHERE Cedula = "' ."$ced_funcionario". '" ');
if (!$control) {
die('Invalid query: ' . mysql_error());
}
list($nombre_funcio) = mysql_fetch_row($control);
mysql_query("INSERT INTO record_servicios (cedula, numero_atencion, fecha_servicio , hora_servicio, sucursal, nombre_funcionario, cedula_funcionario,tipo) VALUES ('" . $_POST["ced3"] . "', '" . $_POST["atencionnum"] . "', '" . $_POST["fechas"] . "', '" . $_POST["horas"] . "', '" . $_POST["codigo_sucursal"] . "', '" . $_POST["nombre_funcio"] . "', '" . $_POST["ced_funcionario"] . "', '" . $_POST["tipo_servi"] . "')");
//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());
$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 update 1: ' . mysql_error());
}
// $mssql3 = "update cartera_datos set/ direccion='$dir',/telefono='$tel', / celular='$cel', / ciudad='$ciu', / email='$mail' where cedula = $ced3 ";
// mysql_query($mssql3, $dbi) or die(mysql_error());
$mssql3 = mysql_query("UPDATE cartera_datos set direccion = '" . $_POST[dir] . "', telefono = '" . $_POST[tel] . "', celular = '" . $_POST[cel] . "', ciudad = '" . $_POST[ciu] . "', email = '" . $_POST[mail] . "' WHERE cedula = '" . $_POST[ced3] . "' ");
if (!$mssql3) {
die('Invalid query update 1: ' . mysql_error());
}
echo "<script>alert('La información se ha enviado correctamente ');</script>";
}else{
echo "<script>alert('Falta ingresar informacion en algun campo, Debe ingresar toda la informacion ');</script>";
}
}
?>