File: /home/asjudine/public_html/abogados/mostrar_ingreso_audiencia.php
<?php
global $dbi;
require_once("../Conectarse.php");
error_reporting(E_ALL ^ E_NOTICE);
$dia = date("d");
$mes = date("m");
$ano = date("Y");
//$misql = mysql_query("select codigo from Usuarios where Cedula = $cc", $dbi);
$misql = mysql_query('SELECT codigo FROM Usuarios WHERE Cedula = "'.$_GET["cc"].'" ');
if (!$misql) {
die('Invalid query 1: ' . mysql_error());
}
if($misql){list($codigo_funcionario) = mysql_fetch_row($misql);}
$control = mysql_query('SELECT cedula, numero_proceso, tipo_proceso, numero_contrato, tipo_contrato, codigo_sucursal, clase_negocio, despacho_judicial, ciudad_despacho, calidad_juridica_afiliado, tipo_orden, numero_carpeta, ultimo_folio, codigo_abogado, fecha_actuacion, actividad_proceso, estado_proceso FROM procesos WHERE cedula = "' . $_GET["id"] . '" and numero_proceso = "' . $_GET["proceso"] . '" ');
if (!$control) {
die('Invalid query 2: ' . mysql_error());
}
if ((mysql_num_rows($control)!=0))
{
list($cedula, $numero_proceso, $tipo_proceso, $numero_contrato, $tipo_contrato, $codigo_sucursal, $clase_negocio, $despacho_judicial, $ciudad_despacho, $calidad_juridica_afiliado, $tipo_orden, $numero_carpeta, $ultimo_folio, $codigo_abogado, $fecha_actuacion, $actividad_proceso, $estado_proceso) = mysql_fetch_row($control);
if($actividad_proceso == 'A'){$actividad_proceso = 'ACTIVO';}else $actividad_proceso = 'INACTIVO';
if($estado_proceso == 'V'){$estado_proceso = 'VIGENTE';}else $estado_proceso = 'HISTORICO';
// $sucursal = mysql_query("select nombre from sucursal where codigo = $codigo_sucursal", $dbi);
$sucursal = mysql_query('SELECT nombre FROM sucursal WHERE codigo = "' . "$codigo_sucursal". '" ');
if (!$sucursal) {
die('Invalid query4: ' . mysql_error());
}
if($sucursal){list($ns) = mysql_fetch_row($sucursal);}
// $abogado = mysql_query("select nombre_completo from asjudinet_abogados where codigo_abogado = $codigo_abogado", $dbi);
$abogado = mysql_query('SELECT nombre_completo FROM asjudinet_abogados WHERE codigo_abogado = "' ."$codigo_abogado". '" ');
if (!$abogado) {
die('Invalid query5: ' . mysql_error());
}
if($abogado){list($nombre_abogado) = mysql_fetch_row($abogado);}
$eldia = $_POST["dia"];
$elmes = $_POST["mes"];
$elano = $_POST["ano"];
$fecha_actuacion = ($_POST["ano"]."-".$_POST["mes"]."-".$_POST["dia"]);
// $sqlnom = "select nombre from asjudinet_cartera where cedula = $cedula";
// $control = mysql_query($sqlnom, $dbi) or die(mysql_error());
$control = mysql_query('SELECT nombre FROM cartera_serviasjudinet WHERE cedula = "' ."$cedula". '" ');
if (!$control) {
die('Invalid query6: ' . mysql_error());
}
list($nombre_completo) = mysql_fetch_row($control);
}
if(isset($_POST["actualiza"]))
{
// $sql = "select cedula, numero_proceso, tipo_proceso, numero_contrato, tipo_contrato, codigo_sucursal, clase_negocio, despacho_judicial, ciudad_despacho, calidad_juridica_afiliado, tipo_orden, numero_carpeta, ultimo_folio, codigo_abogado, fecha_actuacion, actividad_proceso, estado_proceso from procesos where cedula = $id and numero_proceso = '$proceso'";
// $control = mysql_query($sql, $dbi) or die(mysql_error());
$control = mysql_query('SELECT cedula, numero_proceso, tipo_proceso, numero_contrato, tipo_contrato, codigo_sucursal, clase_negocio, despacho_judicial, ciudad_despacho, calidad_juridica_afiliado, tipo_orden, numero_carpeta, ultimo_folio, codigo_abogado, fecha_actuacion, actividad_proceso, estado_proceso FROM procesos WHERE cedula = "' . $_GET["id"] . '" and numero_proceso = "' . $_GET["proceso"] . '" ');
if (!$control) {
die('Invalid query 7: ' . mysql_error());
}
if ((mysql_num_rows($control)!=0))
{
list($cedula, $numero_proceso, $tipo_proceso, $numero_contrato, $tipo_contrato, $codigo_sucursal, $clase_negocio, $despacho_judicial, $ciudad_despacho, $calidad_juridica_afiliado, $tipo_orden, $numero_carpeta, $ultimo_folio, $codigo_abogado, $fecha_actuacion, $actividad_proceso, $estado_proceso) = mysql_fetch_row($control);
if($actividad_proceso == 'A'){$actividad_proceso = 'ACTIVO';}else $actividad_proceso = 'INACTIVO';
if($estado_proceso == 'V'){$estado_proceso = 'VIGENTE';}else $estado_proceso = 'HISTORICO';
// $sucursal = mysql_query("select nombre from sucursal where codigo = $codigo_sucursal", $dbi);
$sucursal = mysql_query('SELECT nombre FROM sucursal WHERE codigo = "' ."$codigo_sucursal". '" ');
if (!$sucursal) {
die('Invalid query9: ' . mysql_error());
}
if($sucursal){list($ns) = mysql_fetch_row($sucursal);}
// $abogado = mysql_query("select nombre_completo from abogados where codigo_abogado = $codigo_abogado", $dbi);
$abogado = mysql_query('SELECT nombre_completo FROM asjudinet_abogados WHERE codigo_abogado = "' ."$codigo_abogado". '" ');
if (!$abogado) {
die('Invalid query 10 este: ' . mysql_error());
}
if($abogado){list($nombre_abogado) = mysql_fetch_row($abogado);}
/* $tres=substr($fecha_actuacion, 0, 4);
$dos=substr($fecha_actuacion, 5, 2);
$uno=substr($fecha_actuacion, 8, 2);
$fecha_actuacion = ($_POST[uno]."-".$_POST[dos]."-".$_POST[tres]);*/
$eldia = $_POST["dia_act"];
$elmes = $_POST["mes_act"];
$elano = $_POST["ano_act"];
$fecha_actuacion = ($_POST["ano"]."-".$_POST["mes"]."-".$_POST["dia"]);
}
}
?>
<html>
<head>
<title>Mostrar Ingreso Audiencias</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>
*{margin: 0;padding: 0;}
body{background-image:url(../ELEMENTS/fondo.jpg);font-family:Geneva, Arial, Helvetica, sans-serif;}
header {background-color: #B7271F; text-align: center;}
.titulo{width: 100%;text-align: center;background-color: #dbd8c9;color: #b20606;padding: 6px 0;font-size: 18px;}
table{margin: 0 auto;border: 8px solid #bebebe;}
/*Dif*/
.fecha{background-color: #d6e08b; padding: 2px;color: #000;font-size: 13px;}
td{border: 1px solid #a0a0a0;}
.td{background-color: #e5e5e5; padding: 1px;color: #00135F;font-size: 13px;font-weight: 600; text-align: center;}
.boton1{width:150px;background-color: #ffffff;color: #000;padding: 2px;border:2px solid #580000;border-radius:10px;}
.boton1:hover{background-color: #6f0000;color: #fff;cursor: pointer;}
input[type=text]{border-radius: 5px; padding: 1px;background-color: #fffde8;}
.marquee{background-color: #ffffff; color: #912828; font-size: 15px;}
.tdlittle{background-color: #e5e5e5; font-size: 11px; width: 70px; text-align: center; font-weight: 900;}
.tdbig{background-color: #e5e5e5; font-size: 12px; width: 162px; text-align: center; font-weight: 900;}
</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()
{
var uf, pf, sf=0;
uf = parseInt(formulario.ultimo_folio.value);
pf = parseInt(formulario.folio1.value);
sf = parseInt(formulario.ultimo_folio.value)+1;
df = parseInt(formulario.folio2.value);
if(!(pf == uf || pf == sf))
{
alert('El folio ingresado debe ser igual o inmediatamente posterior al último');
formulario.folio1.focus();
return (false);
}
if (formulario.folio2.value == "")
{
alert("Falta ingresar el Folio2");
formulario.folio2.focus();
return (false);
}
if( pf > df )
{
alert('El folio1 no debe ser mayor que el folio2');
formulario.folio2.focus();
return (false);
}
if (formulario.actuacion.value == "")
{
alert("Falta ingresar la actuación");
formulario.actuacion.focus();
return (false);
}
if (formulario.codigo_funcionario.value == "")
{
alert("Falta seleccionar el nombre del funcionario");
formulario.codigo_funcionario.focus();
return (false);
}
return (true);
}
</script>
<SCRIPT LANGUAGE='JavaScript'>
var default1 = "VENTANA PARA EL INGRESO DE REVISTAS JURIDICAS"; // only shown once at page load
var text1 = "El primer encabezado muestra en detalle los datos del proceso seleccionado";
var text2 = "la segunda parte muestra el formulario para el ingreso de revistas";
var text3 = "No se le olvide tener en cuenta el número del folio que se entrega en el juzgado";
var changeRate = 3000; // 1000 = 1 second
var messageNumber = 0;
function changeStatus()
{
if (messageNumber == 0) {
window.status=default1;
document.title=default1;
}
else if (messageNumber == 1) {
window.status=text1;
}
else if (messageNumber == 2) {
window.status=text2;
}
else if (messageNumber == 3) {
window.status=text3;
messageNumber = 0;
}
messageNumber++;
setTimeout("changeStatus();",changeRate);
}
changeStatus(); // leave here to run right away
// -->
</SCRIPT>
</head>
<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" onLoad="document.formulario.folio1.focus()">
<header>
<img src="../ELEMENTS/bannerInterasjudinet.png" alt="" width=" 700" height="70">
</header>
<h3 class="titulo">VISUALIZACION DE DATOS DEL PROCESO SELECCIONADO </h3>
<form name="consulta" action="" method="post">
<table width="670" border="0" align="center" cellpadding="2" cellspacing="2">
<tr>
<td class="fecha" align='center'>
<script languaje="JavaScript">Mostrar_Fecha()</script>
</td>
</tr>
<tr>
<td class="td"><fieldset>
<legend>Datos del proceso:</legend>
<table width="662" border="0" cellspacing="1" cellpadding="0">
<tr>
<td class="td">Cédula (Titular-Beneficiario):</td>
<td colspan="2"><input name="cedula" type="text" id="cedula" value="<?php echo $cedula; ?>" size="15" maxlength="15" readonly=""></td>
<td class="td">Proceso:</td>
<td><input name="numero_proceso" type="text" id="numero_proceso" value="<?php echo $numero_proceso; ?>" size="6" maxlength="7" readonly=""></td>
</tr>
<tr>
<td class="td">Nombre completo:</td>
<td colspan="4"><input name="nombre" type="text" id="nombre" value="<?php echo $nombre_completo; ?>" size="50" maxlength="50" readonly=""></td>
</tr>
<tr>
<td class="td">Tipo de proceso:</td>
<td colspan="2"><input name="tipo_proceso" type="text" id="tipo_proceso" value="<?php echo $tipo_proceso; ?>" size="20" maxlength="20" readonly=""></td>
<td class="td">Contrato:</td>
<td><input name="numero_contrato" type="text" id="numero_contrato" value="<?php echo $numero_contrato; ?>" size="6" maxlength="7" readonly=""></td>
</tr>
<tr>
<td class="td">Sucursal:</td>
<td colspan="2"><input name="codigo_sucursal" type="text" id="tipo_contrato" value="<?php echo $codigo_sucursal; ?>" size="2" maxlength="2" readonly="">
-
<input name="sucursal" type="text" id="sucursal" value="<?php echo $ns; ?>" size="30" maxlength="30" readonly=""></td>
<td class="td">Tipo:</td>
<td><input name="tipo_contrato" type="text" id="tipo_contrato" value="<?php echo $tipo_contrato; ?>" size="4" maxlength="4" readonly=""></td>
</tr>
<tr>
<td class="td">Clase de negocio:</td>
<td colspan="4"><input name="clase_negocio" type="text" class="campo" id="clase_negocio" value="<?php echo $clase_negocio; ?>" size="50" maxlength="50" readonly=""></td>
</tr>
<tr>
<td class="td">Despacho judicial:</td>
<td colspan="4"><input name="despacho_judicial" type="text" id="despacho_judicial" value="<?php echo $despacho_judicial; ?>" size="50" maxlength="50" readonly=""></td>
</tr>
<tr>
<td class="td">Calidad jurídica afiliado:</td>
<td colspan="2"><input name="calidad_juridica" type="text" id="calidad_juridica" value="<?php echo $calidad_juridica_afiliado; ?>" size="25" maxlength="50" readonly=""></td>
<td class="td">Tipo de orden:</td>
<td><input name="tipo_orden" type="text" id="tipo_orden" value="<?php echo $tipo_orden; ?>" size="15" maxlength="20" readonly=""></td>
</tr>
<tr>
<td class="td">Número carpeta:</td>
<td><input name="numero_carpeta" type="text" id="numero_carpeta" value="<?php echo $numero_carpeta; ?>" size="6" maxlength="6" readonly=""></td>
<td class="td">Ultimo folio:</td>
<td colspan="2"><input name="ultimo_folio" type="text" id="ultimo_folio" value="<?php echo $ultimo_folio; ?>" size="3" maxlength="5" readonly=""></td>
</tr>
<tr>
<td class="td">Abogado:</td>
<td colspan="4"><input name="nombre_abogado" type="text" id="nombre_abogado" value="<?php echo $nombre_abogado; ?>" size="50" maxlength="50" readonly="">
<input name="codigo_abog" type="text" id="codigo_abog" value="<?php echo $codigo_abogado; ?>" size="3" maxlength="3" readonly=""></td>
</tr>
<tr>
<td class="td">Fecha última actuación:</td>
<td><input name="fecha_actuacion" type="text" id="fecha_actuacion" value="<?php echo $fecha_actuacion; ?>" size="10" maxlength="10" readonly=""></td>
<td class="td">Actividad del proceso:</td>
<td colspan="2"><input name="actividad_proceso" type="text" id="actividad_proceso" value="<?php echo $actividad_proceso; ?>" size="20" maxlength="20" readonly=""></td>
</tr>
<tr>
<td class="td">Estado del proceso:</td>
<td colspan="4"><input name="estado_proceso" type="text" id="estado_proceso" value="<?php echo $estado_proceso; ?>" size="20" maxlength="20" readonly="">
</td>
</tr>
<tr>
<td colspan="5">
<table width="662" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="579"><MARQUEE class=marquee width = 95% scrolldelay = 0>Una vez que haya grabado el registro, haga click sobre el botón **Actualizar** para visualizar el último folio</MARQUEE> </td>
<td><input name="actualiza" type="submit" id="actualiza" class= "boton1" value="Actualizar"></td>
</tr>
</table>
</td>
</tr>
</table>
</fieldset></td>
</tr>
</table>
</form>
<!--/segundo form-->
<form name="formulario" action="<?php echo $editFormAction; ?>" method="post" onSubmit="return validar(this)">
<input name="ultimo_folio" type="hidden" value="<?php echo $ultimo_folio; ?>">
<input name="cedula" type="hidden" value="<?php echo $cedula; ?>">
<input name="numero_proceso" type="hidden" value="<?php echo $numero_proceso; ?>">
<table width="670" height="145" border="1" align="center" cellpadding="0" cellspacing="0">
<tr>
<td colspan="7" class="titulo">INGRESE LOS DATOS DEL AUDIENCIA JURIDICA</td>
</tr>
<tr>
<td class="td">FOLIOS</td>
<td class="td">DEL:</td>
<td><input name="folio1" type="text" id="folio1" size="4" maxlength="4" value="<?php echo $ultimo_folio; ?>" readonly=""></td>
<td class="td">AL:</td>
<td><input name="folio2" type="text" id="folio2" size="4" maxlength="4" required></td>
<td class="td">Cantidad de Folios: </td>
<td><input name="totafo" type="text" id="totafo" size="4" maxlength="4" value="1" readonly=""></td>
</tr>
<tr>
<td colspan="6" rowspan="2"><textarea name="actuacion" cols="80" rows="3" id="actuacion" required></textarea></td>
<td class="fecha">Tipo de orden: </td>
</tr>
<tr>
<td><select name="ordenes">
<option value="AUDIENCIA">AUDIENCIA</option>
</select></td>
</tr>
<tr>
<td colspan='8' align="right">
<input name = "submit" type="submit" class="boton1" value="GRABAR AUDIENCIA" onClick="validar_folios()">
<input name="button" type="reset" class="boton1" onclick="formulario.folio1.focus();" value="Limpiar">
</td>
</tr>
</table>
<input type="hidden" name="MM_insert" value="formulario">
</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"))
{
if(isset($_POST["folio1"]))
{
$dia = date("d");
$mes = date("m");
$ano = date("Y");
$nuevafecha = $ano."-".$mes."-".$dia;
$abogado = mysql_query('SELECT codigo_abogado, cedula FROM asjudinet_abogados WHERE codigo_abogado = "' . $_POST[codigo_abogado] . '" ');
if (!$abogado) {
die('Invalid query5: ' . mysql_error());
}
list($codigo_abogado, $cedu) = mysql_fetch_row($abogado);
$actuacion = mysql_query("INSERT INTO actuaciones (cedula, numero_proceso, folio1, folio2, actuacion, fecha, tipo_orden, codigo_funcionario, codigo_abogado,estado) VALUES ( '".$_POST["cedula"]."', '".$_POST["numero_proceso"]. "', '".$_POST["folio1"]."', '".$_POST["folio2"]."','".$_POST["actuacion"]."','$nuevafecha', '".$_POST["ordenes"]."','".$_GET["codigo_abogado"]."', '".$codigo_abogado."','10')");
if (!$actuacion) {
die('Invalid query actuaciono : ' . mysql_error());
}
$actuac = mysql_query("INSERT INTO memorial (cedula, numero_proceso, folio1, folio2, total_folio, actuacion, fecha_actuacion, tipo_orden, codigo_abogado, estado) VALUES ('".$_POST["cedula"]."', '".$_POST["numero_proceso"]."', '".$_POST["folio1"]."', '". $_POST["folio2"]."', '".$_POST["totafo"]."','".$_POST["actuacion"]."', '$nuevafecha', '".$_POST["ordenes"]."', '".$_GET["codigo_abogado"]."', '1')");
if (!$actuac) {
die('Invalid query actuac : ' . mysql_error());
}
$pro = mysql_query("UPDATE procesos set ultimo_folio = '".$_POST[folio2]."', fecha_actuacion = '".$nuevafecha."', tipo_orden = 'AUDIENCIA' WHERE cedula = '". $_GET["id"]."' and numero_proceso = '".$_GET["proceso"]."' ");
if (!$pro) {
die('Invalid query update ultimo : ' . mysql_error());
}
echo "<script>document.formulario.reset();</script>";
echo "<script>formulario.folio1.focus();</script>";
echo "<script>alert('Los datos fueron grabados correctamente');</script>";
}
}
?>