File: /home/asjudine/www/elimina_procesos_cc.php
<?php
require_once("mainfile.php");
include ("config.php");
global $dbi;
$dia = date("d");
$mes = date("m");
$ano = date("Y");
$misql = mysql_query("select codigo from Usuarios where Cedula = $cf", $dbi);
if($misql){list($codigo_funcionario) = mysql_fetch_array($misql);}
$sql = "select cedula, nombre, numerocontrato, tipocontrato, tipo_afiliado, codigo_sucursal, direccion, telefono, celular, ciudad, email from asjudinet_cartera where cedula = $id";
$control = mysql_query($sql, $dbi) or die(mysql_error());
if ((mysql_num_rows($control)!=0))
{
list($cedula, $nombre, $contrato, $tipo, $tipo_afiliado, $codsuc, $direccion, $telefono, $celular, $ciudad, $email) = mysql_fetch_array($control);
$suc = mysql_query("select nombre from sucursal where codigo = '$codsuc'", $dbi);
if($suc){list($sucursal) = mysql_fetch_array($suc);}
$tres=substr($fecha_actuacion, 0, 4);
$dos=substr($fecha_actuacion, 5, 2);
$uno=substr($fecha_actuacion, 8, 2);
$fecha_actuacion = ($uno."-".$dos."-".$tres);
}
$msql = "select cedula, numero_proceso, tipo_proceso, numero_contrato, tipo_contrato, tipo_afiliado, 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 = $cedula and numero_proceso = $proceso and tipo_orden = 'INICIO'";
$misql = mysql_query($msql, $dbi) or die(mysql_error());
list($cc, $np, $tp, $nc, $tc, $ta, $cs, $cn, $dj, $cd, $cja, $to, $ncp, $uf, $ca, $fa, $ap, $ep) = mysql_fetch_array($misql);
$uno=substr($fa, 0, 2);
$dos=substr($fa, 3, 2);
$tres=substr($fa, 6, 4);
$fa = ($tres."-".$dos."-".$uno);
if($ap == 'A'){$ap = 'ACTIVO';}else $ap = 'INACTIVO';
if($ep == 'V'){$ep = 'VIGENTE';}else $ep = 'HISTORICO';
$msuc = mysql_query("select codigo, nombre from sucursal where codigo = '$cs'", $dbi);
if($msuc){list($cs, $ns) = mysql_fetch_array($msuc);}
$abogado = mysql_query("select codigo_abogado, nombre_completo from asjudinet_abogados where codigo_abogado = $ca", $dbi);
if($abogado){list($ca, $na) = mysql_fetch_array($abogado);}
if(isset($guardar))
{
$mssql = "update procesos set cedula='$cedula',
numero_proceso='$numero_proceso',
tipo_proceso='$tipo_proceso',
numero_contrato='$numero_contrato',
tipo_contrato='$tipo_contrato',
tipo_afiliado='$tipo_afiliado',
codigo_sucursal='$codigo_sucursal',
clase_negocio='$clase_negocio',
despacho_judicial='$despacho_judicial',
ciudad_despacho='$ciudad_despacho',
calidad_juridica_afiliado='$calidad_juridica_afiliado',
tipo_orden='$tipo_orden',
numero_carpeta='$numero_carpeta',
ultimo_folio='$ultimo_folio',
codigo_abogado='$codigo_abogado',
fecha_actuacion='$fecha_actuacion',
actividad_proceso='$actividad_proceso',
estado_proceso='$estado_proceso' where cedula = $cedula and numero_proceso = $projuridico and tipo_orden = 'INICIO'";
mysql_query($mssql, $dbi) or die(mysql_error());
if($tp1 != "")
{
$mssql = "update procesos set tipo_proceso='$tp1' where cedula = $cedula and numero_proceso = $projuridico";
mysql_query($mssql, $dbi) or die(mysql_error());
}
if($ta1 != "")
{
$mssql = "update procesos set tipo_afiliado='$ta1' where cedula = $cedula and numero_proceso = $projuridico";
mysql_query($mssql, $dbi) or die(mysql_error());
}
if($cja1 != "")
{
$mssql = "update procesos set calidad_juridica_afiliado='$cja1' where cedula = $cedula and numero_proceso = $projuridico";
mysql_query($mssql, $dbi) or die(mysql_error());
}
if($cs1 != "")
{
$mssql = "update procesos set codigo_sucursal='$cs1' where cedula = $cedula and numero_proceso = $projuridico";
mysql_query($mssql, $dbi) or die(mysql_error());
}
if($ca1 != "")
{
$mssql = "update procesos set codigo_abogado='$ca1' where cedula = $cedula and numero_proceso = $projuridico";
mysql_query($mssql, $dbi) or die(mysql_error());
}
if($ap1 != "")
{
$mssql = "update procesos set actividad_proceso='$ap1' where cedula = $cedula and numero_proceso = $projuridico";
mysql_query($mssql, $dbi) or die(mysql_error());
}
if($ep1 != "")
{
$mssql = "update procesos set estado_proceso='$ep1' where cedula = $cedula and numero_proceso = $projuridico";
mysql_query($mssql, $dbi) or die(mysql_error());
}
// list($cedula, $numero_proceso, $tipo_proceso, $numero_contrato, $tipo_contrato, $tipo_afiliado, $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_array($misql);
$msql = "select cedula, numero_proceso, tipo_proceso, numero_contrato, tipo_contrato, tipo_afiliado, 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 = $cedula and numero_proceso = $numero_proceso";
$misql = mysql_query($msql, $dbi) or die(mysql_error());
list($cc, $np, $tp, $nc, $tc, $ta, $cs, $cn, $dj, $cd, $cja, $to, $ncp, $uf, $ca, $fa, $ap, $ep) = mysql_fetch_array($misql);
$uno=substr($fa, 0, 2);
$dos=substr($fa, 3, 2);
$tres=substr($fa, 6, 4);
$fa = ($tres."-".$dos."-".$uno);
if($ap == 'A'){$ap = 'ACTIVO';}else $ap = 'INACTIVO';
if($ep == 'V'){$ep = 'VIGENTE';}else $ep = 'HISTORICO';
$msuc = mysql_query("select codigo, nombre from sucursal where codigo = '$cs'", $dbi);
if($msuc){list($cs, $ns) = mysql_fetch_array($msuc);}
$abogado = mysql_query("select codigo_abogado, nombre_completo from asjudinet_abogados where codigo_abogado = $ca", $dbi);
if($abogado){list($ca, $na) = mysql_fetch_array($abogado);}
}
$con = "SELECT * FROM asjudinet_abogados where vigentes = '1' order by nombre_completo";
$misql = mysql_query($con, $dbi) or die(mysql_error());
$row = mysql_fetch_assoc($misql);
$total = mysql_num_rows($misql);
$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);
?>
<html>
<head>
<title>VENTANA PARA MODIFICAR DATOS DEL PROCESO</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css">
<!--
.titulos {font: 16px; color: red; font-family:Arial; font-weight:bold}
.boton { background-color: #FFCCCC; color:#FFFFFF; width:150px; border: 4px solid #0000CC; font-family:Arial; color:#990000;}
.texto {background-color: #CCFFCC; font-size: 13px; font-family: Arial; color:#0000CC; display: block;}
.fecha {background-color: #CCFFCC; font-size: 12px; font-family: Arial; color: #000099; width:10px display: block;}
.campo {background-color: #FFFFCC; border:1px solid #990000; font-family:Arial; font-size:11px; height: inherit}
.lista { background-color:#99FFFF; font-family: Arial; font-size: 11px; color: #990000;}
.label {background-color: #00CCFF ; font-size: 14px; font-family: Arial; color:#0000CC; display: block;}
.area {background-color: #CCFFCC; font-size: 13px; width:40px font-family: Arial; color:#0000CC; display: block;}
.variables {background-color: #CCFFCC; font-size: 12px; font-family: Arial; color: #003333 ; width:10px display: block; border: 2px solid #006633;}
.sel { background-color:#DDFFFF; width:400px; border: 1px solid #0099FF; font-family:Arial; font-style:italic; color:#990000 }
.sel2{ background-color:#DDFFFF; border: 1px solid #0099FF; font-family:Arial; font-style:italic; font-weight:bold; color:#990000 }
.seleccion { background-color: #CCFFCC; width:340px; border: 1px solid #0099FF; font-family:Arial; color:#990000;}
.boton2 {font-family: Verdana; font-size: 8 pt; color: #000080; background-color: #C0C0C0; border-style: solid; }
.letras {background-color: #99CCFF; font-size: 10px; font-family: Arial; color:#0000CC; display: block;}
.campo2 {background-color: #99CCCC; border:1px solid #0066FF; font-family:Arial; font-size:10px; height: inherit}
.sel3{ background-color:#DDFFFF; font-family:Arial; font-size:10px; color: #000066 }
body {
background-image: url(fondo_argollado.gif);
}
.Estilo10 {font-size: 11px; font-family: Arial, Helvetica, sans-serif; }
-->
</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()
{
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 ACTUACIONES"; // 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()">
<form name="formulario" action="" method="post" onSubmit="return validar(this)">
<input name="codigo_funcionario" type="hidden" value="<?php echo $codigo_funcionario; ?>">
<table width="707" border="0" align="center" cellpadding="2" cellspacing="2">
<tr bgcolor="#FFFFCC">
<td width="699" class="titulos"><div align="center">VISUALIZACION DE DATOS DEL PROCESO SELECCIONADO </div></td>
</tr>
<tr bgcolor="#ECE9D8">
<td height="3" class="fecha"><div align="center">
<script languaje="JavaScript">Mostrar_Fecha()</script>
</div></td>
</tr>
<tr bgcolor="#ECE9D8">
<td height="3" class="fecha"><table width="699" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td width="549" class="letras"><table width="662" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="62" height="19" class="letras"><div align="right">Cédula:</div></td>
<td width="60"><input name="id" type="text" class="campo2" value="<?php echo $id; ?>" size="15" maxlength="15" readonly=""></td>
<td width="59" class="letras"><div align="right">Nombre:</div></td>
<td width="206"><input name="nombre" type="text" class="campo2" value="<?php echo $nombre; ?>" size="51" maxlength="50" readonly=""></td>
<td width="82" class="letras"><div align="right">Contrato:</div></td>
<td width="60"><input name="numero_contrato" type="text" class="campo2" value="<?php echo $contrato; ?>" size="6" maxlength="7" readonly=""></td>
<td width="62" class="letras"><div align="right">Tipo:</div></td>
<td width="71"><input name="tipo_contrato" type="text" class="campo2" value="<?php echo $tipo; ?>" size="4" maxlength="4" readonly=""></td>
</tr>
</table></td>
</tr>
<tr>
<td class="letras"><div align="right"></div>
<div align="right">
<table width="662" border="0" align="left" cellpadding="0" cellspacing="0">
<tr>
<td width="101" class="letras"><div align="right">Tipo de afiliado: </div></td>
<td width="80"><input name="tipo_afiliado" type="text" class="campo2" value="<?php echo $tipo_afiliado; ?>" size="20" maxlength="20" readonly=""></td>
<td width="63" class="letras"><div align="right">Sucursal:</div></td>
<td width="138"><input name="sucursal" type="text" class="campo2" id="sucursal" value="<?php echo $sucursal; ?>" size="30" maxlength="30" readonly=""></td>
<td width="95" class="letras"><div align="right">Dirección:</div></td>
<td width="185"><input name="direccion" type="text" class="campo2" id="direccion" value="<?php echo $direccion; ?>" size="40" maxlength="50" readonly=""></td>
</tr>
</table>
</div></td>
</tr>
<tr>
<td class="letras"><div align="right"></div>
<div align="right">
<table width="662" border="0" align="left" cellpadding="0" cellspacing="0">
<tr>
<td width="61" class="letras"><div align="right">Ciudad:</div></td>
<td width="120"><input name="ciudad" type="text" class="campo2" id="ciudad" value="<?php echo $ciudad; ?>" size="30" maxlength="30" readonly=""></td>
<td width="63" class="letras"><div align="right">Teléfono:</div></td>
<td width="80"><input name="telefono" type="text" class="campo2" id="telefono" value="<?php echo $telefono; ?>" size="20" maxlength="20" readonly=""></td>
<td width="112" class="letras"><div align="right">Celular:</div></td>
<td width="226"><input name="celular" type="text" class="campo2" id="celular" value="<?php echo $celular; ?>" size="20" maxlength="20" readonly=""></td>
</tr>
</table>
</div>
<div align="right"></div></td>
</tr>
<tr>
<td><table width="666" border="1" cellspacing="0" cellpadding="0">
<tr class="letras">
<td width="171" class="letras">Procesos Vigentes: </td>
<td width="169"><input name="vigentes" type="text" class="campo2" id="vigentes" value="<?php echo $vigentes; ?>" size="2" maxlength="2" readonly=""></td>
<td width="188" class="letras">Procesos Históricos: </td>
<td width="138"><input name="historicos" type="text" class="campo2" id="historicos" value="<?php echo $historicos; ?>" size="2" maxlength="2" readonly=""></td>
</tr>
</table></td>
</tr>
</table></td>
</tr>
<tr bgcolor="#FFCC99">
<td height="20" bgcolor="#FFFFFF"><fieldset>
<legend><span class="texto">Datos del proceso:</span></legend>
<table width="691" border="1" align="center" cellpadding="2" cellspacing="0" bordercolor="#ECE9D8">
<tr bgcolor="#FFFFFF">
<td width="204"><span class="label">Cédula (Titular-Beneficiario):</span></td>
<td colspan="2"><input name="cedula" type="text" class="campo" id="cedula" value="<?php echo $cc; ?>" size="15" maxlength="15" readonly="">
<input name="projuridico" type="hidden" class="campo" id="projuridico" value="<?php echo $np ?>" size="6" maxlength="6"></td>
<td width="140"><span class="label">Número de Proceso:</span></td>
<td width="143"><input name="numero_proceso" type="text" class="campo" value="<?php echo $np ?>" size="6" maxlength="6"> </td>
</tr>
<tr bgcolor="#FFFFFF">
<td><span class="label">Tipo de proceso:</span></td>
<td colspan="4"><input name="tipo_proceso" type="text" class="campo" id="tipo_proceso" value="<?php echo $tp ?>" size="20" maxlength="20" readonly="">
</td>
</tr>
<tr bgcolor="#FFFFFF">
<td><span class="label">Clase de negocio:</span></td>
<td colspan="4"><input name="clase_negocio" type="text" class="campo" id="clase_negocio" value="<?php echo $cn ?>" size="50" maxlength="50"></td>
</tr>
<tr bgcolor="#FFFFFF">
<td><span class="label">Despacho judicial:</span></td>
<td colspan="4"><input name="despacho_judicial" type="text" class="campo" id="despacho_judicial" value="<?php echo $dj ?>" size="50" maxlength="50"></td>
</tr>
<tr bgcolor="#FFFFFF">
<td><span class="label">Ciudad del despacho :</span></td>
<td colspan="4"><input name="ciudad_despacho" type="text" class="campo" id="ciudad_despacho" value="<?php echo $cd ?>" size="50" maxlength="50"></td>
</tr>
<tr bgcolor="#FFFFFF">
<td><span class="label">Calidad jurídica afiliado:</span></td>
<td colspan="4"><span class="Estilo10">
<input name="calidad_juridica_afiliado" type="text" class="campo" id="calidad_juridica_afiliado" value="<?php echo $cja ?>" size="25" maxlength="25" readonly="">
-
</span></td>
</tr>
<tr bgcolor="#FFFFFF">
<td><span class="label">Sucursal:</span></td>
<td colspan="4"><span class="Estilo10">
<input name="nombre_sucursal" type="text" class="campo" id="nombre_sucursal" value="<?php echo $ns ?>" size="40" maxlength="40" readonly="">
<input name="codigo_sucursal" type="text" class="campo" id="codigo_sucursal" value="<?php echo $cs ?>" size="3" maxlength="3" readonly="">
</span></td>
</tr>
<tr bgcolor="#FFFFFF">
<td><span class="label">Número carpeta:</span></td>
<td width="49"><input name="numero_carpeta" type="text" class="campo" id="numero_carpeta" value="<?php echo $ncp ?>" size="6" maxlength="6"></td>
<td width="123"><div align="right"><span class="label">Tipo afiliado :</span></div></td>
<td colspan="2"><input name="tipo_afiliado" type="text" class="campo" id="tipo_afiliado" value="<?php echo $ta ?>" size="15" maxlength="15" readonly="">
</td>
</tr>
<tr bgcolor="#FFFFFF">
<td><span class="label">Nombre del Abogado:</span></td>
<td colspan="4"><input name="nombre_abogado" type="text" class="campo" id="nombre_abogado" value="<?php echo $na ?>" size="50" maxlength="50" readonly="">
</td>
</tr>
<tr bgcolor="#FFFFFF">
<td><span class="label">Actividad del proceso:</span></td>
<td colspan="2"><input name="actividad_proceso" type="text" class="campo" id="actividad_proceso" value="<?php echo $ap ?>" size="10" maxlength="10" readonly=""></td>
<td><span class="label">Estado del proceso:</span> </td>
<td><input name="estado_proceso" type="text" class="campo" id="estado_proceso" value="<?php echo $ep ?>" size="10" maxlength="10" readonly=""></td>
</tr>
</table>
</fieldset></td>
</tr>
<tr bgcolor="#FFCC99">
<td height="20" bgcolor="#99CCFF"><div align="center">
<input name = "guardar" type="submit" class="boton2" value="Modificar datos">
</div></td>
</tr>
</table>
</form>
</body>
</html>