File: /home/asjudine/www/acalidad/mostrar_proceso_eliminar.php
<?php
require_once("../Conectarse.php");
$dia = date("d");
$mes = date("m");
$ano = date("Y");
if(isset($_POST["eliminar"]))
{
$asignacion = mysql_query('SELECT fecha FROM actuaciones WHERE cedula = "'.$_POST["cedula"].'" and numero_proceso = "'.$_POST["numero_proceso"].'" and tipo_orden = "INICIO"');
if (!$asignacion) {
die('Invalid query 24: ' . mysql_error());
}
list($fecha_asignacion) = mysql_fetch_row($asignacion);
///////////////////////////////////
$controlproces= mysql_query('SELECT cantidad_procesos FROM control_procesos WHERE contrato = "'.$_POST["numero_contrato"].'" and tipo = "'.$_POST["tipo_contrato"].'" ');
if (!$controlproces) {
die('Invalid query 24: ' . mysql_error());
}
list($fgnacion) = mysql_fetch_row($controlproces);
$fgnacion=$fgnacion - "1";
$result = mysql_query('DELETE FROM procesos WHERE cedula = "'.$_POST["cedula"].'" and numero_proceso= "'.$_POST["numero_proceso"].'" ');
if (!$result) {
die('Invalid delete 1: ' . mysql_error());
}
$resulta = mysql_query('DELETE FROM actuaciones WHERE cedula = "'.$_POST["cedula"].'" and numero_proceso = "'.$_POST["numero_proceso"].'" ');
if (!$resulta) {
die('Invalid delete 2: ' . mysql_error());
}
$resultado = mysql_query('DELETE FROM INICIOS_PROCESOS_JURIDICOS WHERE codigo = "'.$_POST["cedula"].'" and clase_de_negocio = "'.$_POST["clase_negocio"].'" and nombre_abogado = "'.$_POST["codigo_abogado"].'" and fecha_asignacion= "'.$fecha_asignacion.'"');
if (!$resultado)
{
die('Invalid delete 882: ' . mysql_error());
}
$modificacontrol = mysql_query("UPDATE control_procesos set cantidad_procesos = '".$fgnacion."' WHERE contrato = '".$_POST["numero_contrato"]. "' and tipo = '".$_POST["tipo_contrato"]."' ");
echo "<script>alert('El proceso se ha eliminado');</script>";
echo "<script languaje='javascript' type='text/javascript'>window.close();</script>";
}
$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,fecha_diagnostico FROM procesos WHERE cedula = "'.$_GET["id"].'" and numero_proceso = "'.$_GET["proceso"] . '" ');
if (!$control) {
die('Error de consulta: ' . 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,$fecha_diagnostico) = 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.'" ');
if (!$sucursal) {
die('Invalid query 14: ' . mysql_error());
}
if($sucursal){list($ns) = mysql_fetch_row($sucursal);}
$abogado = mysql_query('SELECT codigo_abogado, nombre_completo FROM asjudinet_abogados WHERE codigo_abogado = "'.$codigo_abogado.'" ');
if (!$abogado) {
die('Invalid query 24: ' . mysql_error());
}
if($abogado)
{
list($codigo_abogado, $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 = ($uno."-".$dos."-".$tres);
$fd = $fecha_diagnostico;
$control = mysql_query('SELECT nombre FROM cartera_serviasjudinet WHERE cedula = "' ."$cedula". '" ');
if (!$control) {
die('Invalid query 24: ' . mysql_error());
}
list($nombre_completo) = mysql_fetch_row($control);
}
//MUESTRA EL ULTIMO FOLIO, LO TRAE DE ACTUACIONES,LA ULTIMA ACTUACION
$result = mysql_query('SELECT folio2, tipo_orden FROM actuaciones WHERE cedula = "'.$_GET["id"].'" and numero_proceso = "'.$_GET["proceso"] . '" order by fecha');
if (!$result) {
die('Error de consulta: ' . mysql_error());
}
if(mysql_num_rows($result) != 0)
{
while(list($folio_2,$tipo_o) = mysql_fetch_row($result))
{
$tipo_ordenp = $tipo_o;
$fol2 = $folio_2;
}
}
$modificarcod9 = mysql_query("UPDATE procesos set tipo_orden = '" . $_POST[tipo_ordenp] . "' WHERE cedula = '" . $_GET["id"] . "' and numero_proceso = '" . $_GET["proceso"] . "' ");
?>
<!DOCTYPE HTML>
<html>
<head>
<title>Documento sin título</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:#EAEAEA;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; text-align: center;}
.divirmenu{text-align: center;}
.irmenu{width: 200px;background-color: #1c4fa0;color: #fff; padding: 4px;border-radius: 6px;}
.irmenu:hover{background-color: #67a0d9; color: #000;}
.direcciona{width: 200px;background-color: #D4090C;color: #fff; padding: 4px;border-radius: 3px;}
.direcciona:hover{background-color: #67a0d9; color: #000;}
.fecha{background-color: #d6e08b; padding: 2px;color: #000;font-size: 15px; text-align: center;}
td{padding: 1px; border: 1px solid #a0a0a0;}
.td{background-color: #e5e5e5; padding: 1px 30px;color: #00135F;font-size: 14px;font-weight: 600; text-align: center;}
.boton1{width:30%;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: 3px;background-color: #FFFEF4;}
.tdtitulo{background-color: #e3dec0; color: #b20606; padding: 2px; text-align: center; font-size: 12px; font-weight: 900}
.tdfull{background-color: #fff; color: #000; padding: 1px; text-align: center; font-size: 12px;}
.botonnew{width: 40px; background-color: #e3dec0;color: #b20606;padding: 1px;border-radius:5px;}
.botonnew:hover{width: 90px; background-color: #cbbd6a;color: #000;padding: 1px;border-radius:5px;}
.tdizq{background-color: #e5e5e5; padding: 1px 10px;color: #00135F;font-size: 12px;font-weight: 600; text-align: left;}
.tdcen{background-color: #e5e5e5; padding: 1px 10px;color: #00135F;font-size: 12px;font-weight: 600; text-align: center;}
.tdder{background-color: #e5e5e5; padding: 1px 2px;color: #00135F;font-size: 12px;font-weight: 600; text-align: right;}
.tdact{background-color: #fff; padding: 1px 2px;color: #00135F;font-size: 12px;font-weight: 600; text-align: left;}
.tdbono{background-color: #FFFFCC; padding: 1px 2px;color: #00135F;font-size: 12px;font-weight: 600; text-align: right;}
/*Estilo Complementario*/
.tdi{background-color: #F9FBC8; padding: 1px 10px;color: #00135F;font-size: 12px;font-weight: 600; text-align: left;}
.tdc{background-color: #F9FBC8; padding: 1px 10px;color: #00135F;font-size: 12px;font-weight: 600; text-align: center;}
.tdd{background-color: #F9FBC8; padding: 1px 2px;color: #00135F;font-size: 12px;font-weight: 600; text-align: right;}
</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 = formulario.ultimo_folio.value;
pf = formulario.folio1.value;
sf = parseInt(formulario.ultimo_folio.value)+1;
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(formulario.folio2.value < pf)
{
alert('El folio2 no debe ser menor que el folio1');
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 record de actuaciones";
var text3 = "Revise bien las actuaciones y los número de folios";
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()">
<form name="consulta" action="" method="post">
<header>
<img src="../ELEMENTS/bannerInterasjudinet.png" alt="" width=" 700" height="70">
</header>
<h3 class="titulo">VISUALIZACION DE DATOS DEL PROCESO SELECCIONADO</h3>
<table width="671" height="383" border="0" align="center" cellpadding="2" cellspacing="2">
<tr bgcolor="#ECE9D8">
<td height="19" class="fecha"><div align="center">
<script languaje="JavaScript">Mostrar_Fecha()</script>
</div></td>
</tr>
<tr>
<td><fieldset>
<h3 class="titulo">Datos del proceso:</h3>
<table width="662" border="0" cellspacing="1" cellpadding="0">
<tr>
<td class="tdder">Cédula (Titular-Beneficiario):</td>
<td class="tdizq" colspan="2"><input name="cedula" type="text" id="cedula" value="<?php echo $cedula; ?>" size="15" maxlength="15" readonly=""></td>
<td class="tdder">Proceso:</td>
<td class="tdizq"><input name="numero_proceso" type="text" id="numero_proceso" value="<?php echo $numero_proceso; ?>" size="6" maxlength="7" readonly=""></td>
</tr>
<tr>
<td class="tdder">Nombre completo:</td>
<td class="tdizq" colspan="4"><input name="nombre" type="text" id="nombre" value="<?php echo $nombre_completo; ?>" size="50" maxlength="50" readonly=""></td>
</tr>
<tr>
<td class="tdder">Tipo de proceso:</td>
<td class="tdizq" colspan="2"><input name="tipo_proceso" type="text" id="tipo_proceso" value="<?php echo $tipo_proceso; ?>" size="20" maxlength="20" readonly=""></td>
<td class="tdder">Contrato:</td>
<td class="tdizq"><input name="numero_contrato" type="text" id="numero_contrato" value="<?php echo $numero_contrato; ?>" size="6" maxlength="7" readonly=""></td>
</tr>
<tr>
<td class="tdder">Sucursal:</td>
<td class="tdizq" 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="tdder">Tipo:</td>
<td class="tdizq"><input name="tipo_contrato" type="text" id="tipo_contrato" value="<?php echo $tipo_contrato; ?>" size="4" maxlength="4" readonly=""></td>
</tr>
<tr>
<td class="tdder">Clase de negocio:</td>
<td class="tdizq" colspan="4"><input name="clase_negocio" type="text" id="clase_negocio" value="<?php echo $clase_negocio; ?>" size="50" maxlength="50" readonly=""></td>
</tr>
<tr>
<td class="tdder">Despacho judicial:</td>
<td class="tdizq" 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="tdder">Calidad jurídica afiliado:</td>
<td class="tdizq" 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="tdder">Tipo de orden:</td>
<td class="tdizq"><input name="tipo_orden" type="text" id="tipo_orden" value="<?php echo $tipo_ordenp; ?>" size="15" maxlength="20" readonly=""></td>
</tr>
<tr>
<td class="tdder">Número carpeta:</td>
<td class="tdizq"><input name="numero_carpeta" type="text" id="numero_carpeta" value="<?php echo $numero_carpeta; ?>" size="6" maxlength="6" readonly=""></td>
<td class="tdder">Ultimo folio:</td>
<td class="tdizq" colspan="2"><input name="ultimo_folio" type="text" id="ultimo_folio" value="<?php echo $fol2; ?>" size="3" maxlength="5" readonly=""></td>
</tr>
<tr>
<td class="tdder">Abogado:</td>
<td class="tdizq" colspan="4"><input name="nombre_abogado" type="text" id="nombre_abogado" value="<?php echo $nombre_abogado; ?>" size="50" maxlength="50" readonly="">
<input name="codigo_abogado" type="text" id="codigo_abogado" value="<?php echo $codigo_abogado; ?>" size="3" maxlength="3" readonly=""></td>
</tr>
<tr>
<td class="tdder">Fecha última actuación:</td>
<td class="tdizq"><input name="fecha_actuacion" type="text" id="fecha_actuacion" value="<?php echo $fecha_actuacion; ?>" size="10" maxlength="10" readonly=""></td>
<td class="tdder">Actividad del proceso:</td>
<td class="tdizq" 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="tdder">Fecha diagnóstico:</td>
<td class="tdizq" colspan="4"><input name="fecha_diagn" type="text" value="<?php echo $fd; ?>" size="10" maxlength="10"></td>
</tr>
<tr>
<td class="tdder">Estado del proceso:</td>
<td class="tdizq" colspan="4"><input name="estado_proceso" type="text" id="estado_proceso" value="<?php echo $estado_proceso; ?>" size="20" maxlength="20" readonly="">
</td>
</tr>
</table>
</fieldset></td>
</tr>
</table>
<p align="center">
<input name="eliminar" type="submit" class="direcciona" value="Eliminar" id="eliminar">
</p>
</form>
<?php
$result = mysql_query('SELECT id, folio1, folio2, actuacion, fecha, tipo_orden, codigo_funcionario FROM actuaciones WHERE cedula = "'.$_GET["id"] . '" and numero_proceso = "' . $_GET["proceso"] . '" order by fecha');
if (!$result) {
die('Error de consulta: ' . mysql_error());
}
if(mysql_num_rows($result) != 0)
{
echo "<table width=750 border=1 align=center cellpadding=1 cellspacing=1>
<tr>
<td colspan=2><div align=center class=fecha>FOLIOS</span></div></td>
<td colspan=4 bgcolor=#ECE9D8><div align=center class='titulos'>LISTADO DE ACTUACIONES</div></td>
</tr>
<tr align=center>
<td width='34' class=fecha>DEL</td>
<td width='34' class=fecha>AL</td>
<td width='400' class=fecha>Actuación</td>
<td width='75' class=fecha>Fecha</td>
<td width='90' class=fecha>Tipo Orden </td>
<td width='65' class=fecha>Funcionario</td>
</tr>";
while(list($id, $folio1, $folio2, $actuacion, $fecha, $to, $cf) = mysql_fetch_row($result))
{
echo "<tr class='tdact'>
<td class='tdfull'>$folio1</td>
<td class='tdfull'>$folio2</td>
<td><a href=\"modifica_actuacion.php?id=$id\" top=50,left=100,toolbar=no,scrollbars=no,width=790,height=521,status=yes>$actuacion</td>
<td class='tdfull'>$fecha</td>
<td class='tdfull'>$to</td>
<td class='tdfull'>$cf</td>
</tr>";
}
}
?>
</table>