File: /home/asjudine/public_html/recepcion_modifcar_datos.php
<?php
require_once("Conectarse.php");
require_once("mainfile.php");
include ("config.php");
global $dbi;
$result = mysql_query('SELECT numero_carpeta, cedula, nombre_completo, numero, tipo,capital_periodo, capital_renovacion, interes_prejuridico, interes_cobroejecutivo, capital_clausula, deuda_total, oficio_numero, fecha_oficio, unidad, codigo_gestion,cuotas_mora ,valor_mora,clausula_permanencia ,carta_aceptacion FROM cobranzas WHERE cedula = "' .$_GET[id]. '" ');
if (!$result) {
die('Invalid query: ' . mysql_error());
}
if ((mysql_num_rows($result)!=0))
{
list($numero_carpeta, $cedula, $nombre_completo, $numero, $tipo,$capital_periodo, $capital_renovacion, $interes_prejuridico, $interes_cobroejecutivo,$capital_clausula, $deuda_total, $oficio_numero, $fecha_oficio, $unidad, $codiges, $cuotas_mora ,$valor_mora,$clausula_permanencia , $carta_aceptacion) = mysql_fetch_row($result);
$deuda_total=$interes_prejuridico+ $capital_periodo+$capital_clausula;
$sqlnom = mysql_query('SELECT fecha_inicio_contrato, fecha_terminacion FROM cartera_serviasjudinet WHERE cedula = "' . "$cedula". '" and numerocontrato = "' . "$numero". '" ');
if (!$sqlnom) {
die('Invalid query cartera_serviasjudinet 11: ' . mysql_error());
}
list($fecha_afiliacion,$fecha_anulacion) = mysql_fetch_row($sqlnom);
}
else
{
echo "<script>alert('Afiliado no esta en cobranzas ó no Pertenece a su Gestión ');</script>";
}
?>
<html>
<head>
<title>Modificar Cobranzas Gestion Juridica</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;
}
.Estilo10 {font-weight: bold}
.Estilo17 {font-size: 14}
.Estilo18 {font-family: "Arial Narrow"; font-weight: bold; font-size: 14; }
.Estilo19 {font-family: "Arial Narrow"; font-weight: bold; }
.Estilo20 {font-family: "Arial Narrow"; font-size: 12; color: #000000; background-color: #FFFFCC;}
.Estilo21 {font-family: "Arial Narrow"; font-weight: bold; font-size: 12; color: #000000; background-color: #99FFFF;}
.Estilo23 {font-family: "Arial Narrow"; color: #FF0000; }
.Estilo24 {color: #AA0000}
.Estilo25 {
color: #FFFFFF;
font-weight: bold;
}
.Estilo26 {
color: #000000;
font-weight: bold;
}
.Estilo29 {font-family: Tahoma; font-size: 12px; }
-->
</style>
<script Language="JavaScript"><!--
function validar(formulario)
{
if (formulario.dia_act.value > 31)
{
alert("El número de día no se debe exceder de 31");
formulario.dia_act.focus();
return (false);
}
if (formulario.mes_act.value > 12)
{
alert("El número del mes no se debe exceder de 12");
formulario.mes_act.focus();
return (false);
}
return (true);
}
//--></script>
<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>
</head>
<body onLoad="document.formulario.cedula.focus()">
<form method="post" name="formulario" action="" onSubmit="return validar(this)">
<table width="711" border="0" align="center" cellpadding="3" cellspacing="3">
<tr valign="baseline" bgcolor="#0099FF">
<td colspan="6" align="right" nowrap><div align="center"><span class="Estilo2">MODIFICAR LIQUIDACION DEUDA</span></div></td>
</tr>
<tr valign="baseline" bgcolor="#0099FF">
<td colspan="6" align="right" nowrap><div align="center" class="Estilo2">
<script languaje="JavaScript">Mostrar_Fecha()</script>
</div></td>
</tr>
<tr valign="baseline" bgcolor="#0099FF">
<td><div align="right"><span class="Estilo1 Estilo5"><strong>Número cédula:</strong></span></div></td>
<td><input name="id" type="text" id="id" value="<?php echo $cedula ?>" size="15" maxlength="15" readonly=""></td>
<td colspan="4"><input name="nombre" type="text" id="nombre" value="<?php echo $nombre_completo; ?>" size="50" maxlength="50" readonly="" ></td>
</tr>
<tr valign="baseline" bgcolor="#0099FF">
<td><div align="left" class="Estilo4 Estilo10 Estilo17 Estilo1">
<div align="right"><span class="Estilo5">Número de Contrato:</span></div>
</div></td>
<td width="96"><input name="con" type="text" id="con" value="<?php echo $numero; ?>" size="6" maxlength="6" readonly="" ></td>
<td width="130"><div align="right" class="Estilo18">Tipo:</div></td>
<td width="79"><input name="tc" type="text" id="tc" value="<?php echo $tipo; ?>" size="4" maxlength="4" readonly="" ></td>
<td width="59"><span class="Estilo18">Carpeta:</span></td>
<td width="99"><input name="nc" type="text" id="nc" value="<?php echo $numero_carpeta; ?>" size="4" maxlength="4" readonly ></td>
</tr>
<tr valign="baseline" bgcolor="#0099FF">
<td align="right" nowrap bgcolor="#0099FF" class="Estilo18"><div align="right" class="Estilo24">Carta Aceptacion </div></td>
<td bgcolor="#0099FF">
<input name="cartan" type="text" id="cartan" value="<?php echo $carta_aceptacion ?>" size="15" maxlength="15" readonly="">
<select name="carta">
<option value="">---SELECCIONE OPCION---</option>
<option value="SI">SI</option>
<option value="NO">NO</option>
</select></td>
<td bgcolor="#0099FF"><div align="right" class="Estilo24"><strong>Fecha Afiliacion: </strong></div></td>
<td colspan="3" bgcolor="#0099FF"><input name="fecha_afiliacion" type="text" id="fecha_afiliacion" value="<?php echo $fecha_afiliacion; ?>" size="10" maxlength="10" readonly></td>
</tr>
<tr valign="baseline" bgcolor="#0099FF">
<td align="right" nowrap bgcolor="#0099FF"><div align="right" class="Estilo24"><strong>Cuotas En Mora:</strong></div></td>
<td bgcolor="#0099FF"><input name="cuotas_mora" type="text" id="cuotas_mora" value="<?php echo $cuotas_mora; ?>" size="10" maxlength="10" ></td>
<td bgcolor="#0099FF"><div align="right" class="Estilo24"><strong>Valor Cuotas En Mora:</strong></div></td>
<td colspan="3" bgcolor="#0099FF"><input name="valor_mora" type="text" id="valor_mora" value="<?php echo $valor_mora; ?>" size="10" maxlength="10" ></td>
</tr>
<tr valign="baseline" bgcolor="#0099FF">
<td align="right" nowrap bgcolor="#0099FF" class="Estilo18"><div align="right" class="Estilo24">Clausula De Permanencia Meses:</div></td>
<td bgcolor="#0099FF"><input name="clausula_permanencia" type="text" id="clausula_permanencia" size="10" maxlength="10" value="<?php echo $clausula_permanencia; ?>"></td>
<td bgcolor="#0099FF"><div align="right" class="Estilo24"><strong>Fecha Anulacion:</strong></div></td>
<td colspan="3" bgcolor="#0099FF"><input name="fecha_anulacion" type="text" id="fecha_anulacion" value="<?php echo $fecha_anulacion; ?>" size="10" maxlength="10" readonly ></td>
</tr>
<tr valign="baseline" bgcolor="#0099FF">
<td align="right" nowrap><div align="left" class="Estilo4 Estilo10 Estilo17 Estilo1">
<div align="right"><span class="Estilo5">Capital Período actual </span></div>
</div></td>
<td><input name="capitalp" type="text" id="capitalp" value="<?php echo $capital_periodo; ?>" size="10" maxlength="10" ></td>
<td colspan="2"><div align="right" class="Estilo18">Capital renovación Automática: </div></td>
<td colspan="2"><input name="cr" type="text" id="cr" value="<?php echo $capital_renovacion; ?>" size="10" maxlength="10" readonly></td>
</tr>
<tr valign="baseline" bgcolor="#0099FF">
<td align="right" nowrap><span class="Estilo18">Intereses Cobro Prejurídico </span></td>
<td><input name="icp" type="text" id="icp" value="<?php echo $interes_prejuridico; ?>" size="10" maxlength="10" ></td>
<td colspan="2"><div align="right" class="Estilo18">Honorarios: </div></td>
<td colspan="2"><input name="ice" type="text" id="ice" value="<?php echo $interes_cobroejecutivo; ?>" size="10" maxlength="10"></td>
</tr>
<tr valign="baseline" bgcolor="#0099FF">
<td align="right" nowrap><div align="left" class="Estilo4 Estilo10 Estilo17 Estilo1">
<div align="right"><span class="Estilo5">Capital cláusula penal:</span></div>
</div></td>
<td><input name="ccl" type="text" id="cc" value="<?php echo $capital_clausula; ?>" size="10" maxlength="10"></td>
<td colspan="2"><div align="right" class="Estilo18"><span class="Estilo5">Deuda Total:</span></div></td>
<td colspan="2"><input name="dt" type="text" id="dt" value="<?php echo $deuda_total; ?>" size="10" maxlength="10"></td>
</tr>
<tr valign="baseline" bgcolor="#0099FF">
<td align="right" nowrap><span class="Estilo18">Unidad Juridica</span></td>
<td bgcolor="#0099FF"><input name="un" type="text" id="un" value="<?php echo $unidad; ?>" size="5" maxlength="5" ></td>
<td align="right" nowrap><span class="Estilo18">Codigo De Gestion</span></td>
<td bgcolor="#0099FF"><input name="codiges" type="text" id="codiges" value="<?php echo $codiges; ?>" size="5" maxlength="5"></td>
<td colspan="2" ><span class="Estilo18"></span></td>
</tr>
</table>
<table width="711" height="60" align="center">
<tr>
<td height="26" bgcolor="#0099FF"><div align="center">
<input name="modificar" type="submit" class="Estilo24" id="modificar" value ="Modificar" >
<input name="button" type="button" class="Estilo21" onClick="window.location.href='consulta_gen_cob_recepcion.php'" value="Atrás">
<input name="button" type="button" class="Estilo21" onClick="window.location.reload()" value="Actualizar">
</div></td>
</tr>
<tr>
<td height="26" bgcolor="#0099FF"><div align="center" class="Estilo1 Estilo24">Luego ubíque el puntero del mouse sobre el campo que desea modificar, reemplace y haga click en <span class="Estilo25">Modificar </span></div></td>
</tr>
</table>
</form>
</body>
</html>
<?
echo "<table width=750 border=2 align=center cellpadding=2 cellspacing=2>
<tr align=center>
<td width='34' class=Estilo21>#</td>
<td width='400' class=Estilo21>ACTUACION</td>
<td width='60' class=Estilo21>FECHA</td>
<td width='200' class=Estilo21>NOMBRE DEL FUNCIONARIO</td>
<td width='34' class=Estilo21>CODIGO</td>
</tr>";
$result = mysql_query('SELECT actuacion, fecha, cedula_usuario, codigo_gestion FROM actuaciones_cobranzas WHERE cedula = "' . $_POST["cedula"] . '" ');
if (!$result) {
die('Invalid query: ' . mysql_error());
}
if($result)
{
while(list($act, $fecha, $cedula, $cod) = mysql_fetch_row($result))
{
$i=$i + 1;
$tres=substr($fecha, 0, 4);
$dos=substr($fecha, 5, 2);
$uno=substr($fecha, 8, 2);
$fecha = ($uno."-".$dos."-".$tres);
$user = mysql_query('SELECT Nombre_Completo FROM Usuarios WHERE Cedula = "' . "$cedula". '" ');
if (!$user) {
die('Invalid query user: ' . mysql_error());
}
if($result){list($nom) = mysql_fetch_row($user);}
//$result = mysql_query("select Nombre_Completo from Usuarios where Cedula = $cedula",$dbi);
/* printf("<tr>
<td bgcolor='#ECE9D8'><div align='center' class='Estilo14 Estilo1'>".$i."</a></span></div></td>
<td bgcolor='#C5D6FC'><div align='left' class='Estilo14 Estilo1'>".$act."</span></div></td>
<td bgcolor='#C5D6FC'><div align='center' class='Estilo14 Estilo1'>".$fecha."</span></div></td>
<td bgcolor='#C5D6FC'><div align='center' class='Estilo14 Estilo1'>".$nom."</span></div></td>
<td bgcolor='#C5D6FC'><div align='center' class='Estilo14 Estilo1'>".$cod."</span></div></td>");*/
echo "<tr class=Estilo20>
<td align=center>$i</td>
<td><a top=50,left=100,toolbar=no,scrollbars=no,width=790,height=521,status=yes>$act</a></td>
<td align=center>$fecha</td>
<td align=center>$nom</td>
<td align=center>$cod</td></tr>";
} //Terminación del ciclo while
echo "</tr></table>";
}
?>
<?
if ($_POST[modificar])
{
require_once("mainfile.php");
include ("config.php");
global $dbi;
$modificar;
$cartica;
if ($_POST["carta"] == "")
{
$cartica =$_POST["cartan"];
}else
{
$cartica = $_POST["carta"];
}
$result = mysql_query("UPDATE cobranzas set nombre_completo = '" . $_POST[nombre] . "', numero = '" . $_POST[con] . "', tipo = '" . $_POST[tc] . "', numero_carpeta = '" . $_POST[nc] ."', capital_periodo = '" . $_POST["capitalp"] . "', capital_renovacion = '" . $_POST[cr] . "', interes_prejuridico = '" . $_POST[icp] . "', interes_cobroejecutivo = '" . $_POST[ice] . "', capital_clausula = '" . $_POST[ccl] . "', deuda_total = '" . $_POST[dt] . "', oficio_numero = '" . $_POST[on] . "', fecha_oficio = '" . $_POST[fecha_oficio] . "', cedula_funcionario = '" . $_POST[cf] . "', unidad = '" . $_POST[un] . "', codigo_gestion = '" . $_POST[codiges] . "' ,cuotas_mora = '" . $_POST["cuotas_mora"] . "' ,valor_mora = '" . $_POST["valor_mora"] . "' ,clausula_permanencia = '" . $_POST["clausula_permanencia"] . "', fecha_anulacion = '" . $_POST["fecha_anulacion"] . "', carta_aceptacion = '" . $cartica. "', fecha_afiliacion = '" . $_POST["fecha_afiliacion"] . "' WHERE cedula = '" . $_POST[id] . "' and numero = '" . $_POST[con] . "' ");
if (!$result) {
die('No se actualizó la BD : ' . mysql_error());
}
echo "<script>alert('Datos Actualizados');</script>";
}
?>