File: /home/asjudine/public_html/consultar_actuaciones_cobranzas.php
<?php
require_once("mainfile.php");
include ("config.php");
global $dbi;
require_once("Conectarse.php");
//$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, cedula_funcionario, unidad FROM cobranzas WHERE cedula = "' . $_POST[id] . '" and numero_carpeta = "' . $_POST[carpeta] . '"');
$result = mysql_query('SELECT cedula, nombre,numerocontrato, tipocontrato, saldonuevo,unidad_descuento FROM cartera_serviasjudinet WHERE cedula = "' . $HTTP_GET_VARS["ced2"] . '" ');
if (!$result) {
die('Invalid query: ' . mysql_error());
}
//$sql = "select numero_carpeta, cedula, nombre_completo, numero, tipo, capital_periodo, capital_renovacion, interes_prejuridico, interes_cobroejecutivo, capital_clausula, deuda_total, oficio_numero, fecha_oficio, cedula_funcionario, unidad from cobranzas where cedula = $id and numero_carpeta = $carpeta";
// $control = mysql_query($sql, $dbi) or die(mysql_error());
if ((mysql_num_rows($result) != 0))
{
list($cedula, $nombre_completo, $numero, $tipo, $capital_periodo, $unidadc) = mysql_fetch_row($result);
$tres=substr($fecha_oficio, 0, 4);
$dos=substr($fecha_oficio, 5, 2);
$uno=substr($fecha_oficio, 8, 2);
$fecha_oficio = ($uno."-".$dos."-".$tres);
}
$per = mysql_query('SELECT cuenta_cobro, numero_carpeta, cedula, motivo, capital_recuperado, oficio_dev_num, fecha, unidad FROM devolucion_carpeta WHERE cedula = "' . $HTTP_GET_VARS["ced2"] . '" and numero_carpeta = "' . $HTTP_GET_VARS["carpeta"] . '"');
//$dev = mysql_query("select cuenta_cobro, numero_carpeta, cedula, motivo, capital_recuperado, oficio_dev_num, fecha, unidad from devolucion_carpeta where cedula = $cedula and numero_carpeta = $carpeta",$dbi);
//$per = mysql_num_rows($result);
if ( (mysql_num_rows($per) != 0))
{
list($cuenta_cobro, $num_carpeta, $cedula, $motivo, $capital_recuperado, $oficio_dev_num, $fecha_dev, $unidadd) = mysql_fetch_row($per);
$tres=substr($fecha_dev, 0, 4);
$dos=substr($fecha_dev, 5, 2);
$uno=substr($fecha_dev, 8, 2);
$fecha_dev = ($uno."-".$dos."-".$tres);
}
else
{
$num_carpeta = "";
}
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>REACTIVAR CARPETA A COBRANZAS VIGENTE</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: 11; color: #000000; background-color: #FFFFCC;}
.Estilo21 {font-family: "Arial Narrow"; font-weight: bold; font-size: 11; color: #000000; background-color: #99FFFF;}
.Estilo24 {color: #FF0000}
.fecha {background-color: #CCFFCC; font-size: 12px; font-family: Arial; color: #000099; width:10px display: block;}
.lista { background-color:#99FFFF; font-family: Arial; font-size: 11px; color: #990000;}
body {
background-image: url(ELEMENTOS/gri06.jpg );
}
-->
</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="745" 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">ACTUALIZAR NUMERO DE CARPETA COBRANZAS </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 width="196" align="right" nowrap><span class="Estilo18">Cédula, apellidos y nombres</span></td>
<td><input name="identi" type="text" id="identi" value="<?php echo $cedula; ?>" size="8" maxlength="8" readonly=""></td>
<td colspan="4"><input name="nombre_completo" type="text" id="nombre_completo3" 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="63"><input name="numero" type="text" id="numero" value="<?php echo $numero; ?>" size="6" maxlength="6" readonly=""></td>
<td width="217"><div align="right" class="Estilo18">Tipo:</div></td>
<td width="58"><input name="tipo" type="text" id="tipo" value="<?php echo $tipo; ?>" size="4" maxlength="4" readonly=""></td>
<td width="58" class="Estilo18">Unidad: </td>
<td width="96"><input name="unidad" type="text" id="unidad" value="<?php echo $unidadc; ?>" size="4" maxlength="4" 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="capital_periodo" type="text" id="capital_periodo" value="<?php echo $capital_periodo; ?>" size="10" maxlength="10" readonly=""></td>
<td><div align="right" class="Estilo18">Capital renovación Automática: </div></td>
<td colspan="3"><input name="capital_renovacion" type="text" id="capital_renovacion" value="<?php echo number_format($capital_renovacion, 0, ".",","); ?>" 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="interes_prejuridico" type="text" id="interes_prejuridico" value="<?php echo number_format($interes_prejuridico, 0, ".",","); ?>" size="10" maxlength="10" readonly=""></td>
<td><div align="right" class="Estilo18">Honorarios: </div></td>
<td colspan="3"><input name="interes_cobroejecutivo" type="text" id="interes_cobroejecutivo" value="<?php echo number_format($interes_cobroejecutivo, 0, ".",","); ?>" 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 cláusula penal:</span></div>
</div></td>
<td><input name="capital_clausula" type="text" id="interes_prejuridico3" value="<?php echo number_format($capital_clausula, 0, ".",","); ?>" size="10" maxlength="10" readonly=""></td>
<td><div align="right" class="Estilo18"><span class="Estilo5">Deuda Total:</span></div></td>
<td colspan="3"><input name="deuda_total" type="text" id="deuda_total3" value="<?php echo number_format($deuda_total, 0, ".",","); ?>" size="10" maxlength="10" readonly=""></td>
</tr>
<tr valign="baseline" bgcolor="#0099FF">
<td align="right" nowrap><span class="Estilo18">Oficio de envó No. </span></td>
<td bgcolor="#0099FF"><input name="oficio_numero" type="text" id="oficio_numero" value="<?php echo $oficio_numero; ?>" size="4" maxlength="4" readonly=""></td>
<td><div align="right" class="Estilo19">Fecha dd/mm/aaaa:</div></td>
<td colspan="3"><span class="Estilo18">
<input name="fecha_oficio" type="text" id="fecha_oficio" value="<?php echo $fecha_oficio; ?>" size="10" maxlength="10" readonly="">
</span></td>
</tr>
<tr valign="baseline" bgcolor="#FFFFCC">
<td align="right" nowrap><span class="Estilo1 Estilo29"><strong>Número Carpeta:</strong></span></td>
<td align="right" nowrap><div align="left" class="Estilo19">
<input name="numero_carpeta" type="text" id="numero_carpeta" value="<?php echo $num_carpeta; ?>" size="4" maxlength="4" >
</div></td>
<td align="right" nowrap class="Estilo19">Unidad:</td>
<td colspan="3" align="right" nowrap><div align="left"><span class="Estilo19">
<input name="unidad" type="text" id="unidad" value="<?php echo $unidadd; ?>" size="4" maxlength="4" readonly="">
</span></div></td>
</tr>
<tr valign="baseline" bgcolor="#FFFFCC">
<td align="right" nowrap><span class="Estilo1 Estilo29"><strong>Cuenta de cobro No:</strong></span></td>
<td align="right" nowrap><div align="left"><span class="Estilo19">
<input name="cuenta_cobro" type="text" id="cuenta_cobro" value="<?php echo $cuenta_cobro; ?>" size="4" maxlength="4" readonly="">
</span></div></td>
<td align="right" nowrap><span class="Estilo1 Estilo29"><strong>Capital recuperado:</strong></span></td>
<td colspan="3" align="right" nowrap><div align="left"><span class="Estilo19">
<input name="capital_recuperado" type="text" value="<?php echo number_format($capital_recuperado, 0, ".",","); ?>" size="10" maxlength="10" readonly="">
</span></div></td>
</tr>
<tr valign="baseline" bgcolor="#FFFFCC">
<td align="right" nowrap><span class="Estilo1 Estilo29"><strong>Número de oficio devolución:</strong></span></td>
<td align="right" nowrap><div align="left"><span class="Estilo1">
<input name="oficio_dev_num" type="text" value="<?php echo $oficio_dev_num; ?>" size="4" maxlength="4" readonly="">
</span></div></td>
<td align="right" nowrap><span class="Estilo1 Estilo29"><strong>Fecha devolución <span class="Estilo24">dd/mm/aaaa</span>:</strong></span> </td>
<td colspan="3" align="right" nowrap><div align="left"><span class="Estilo19"><span class="Estilo17">
<input name="fecha_dev" type="text" id="fecha_dev" value="<?php echo $fecha_dev; ?>" size="10" maxlength="10" readonly="">
</span></span></div></td>
</tr>
<tr valign="baseline" bgcolor="#FFFFCC">
<td align="right" nowrap><span class="Estilo1 Estilo29"><strong>Motivo de la devolución:</strong></span></td>
<td colspan="5" align="right" nowrap bgcolor="#FFFFCC"><div align="left" class="Estilo19">
<input name="motivo" type="text" id="deuda_total" value="<?php echo $motivo; ?>" size="40" maxlength="40" readonly="">
</div></td>
</tr>
</table>
<center>
<input name="guardar4" type="submit" class="Estilo53" id="guardar" value="Actualizar " /></center>
</form>
<?php
require_once("mainfile.php");
include ("config.php");
global $dbi;
$i=0;
echo "<table width=750 border=1 align=center cellpadding=1 cellspacing=1>
<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 = "' . $HTTP_GET_VARS["id"] . '" and numero_carpeta = "' . $HTTP_GET_VARS["carpeta"] . '" order by fecha');
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>";
}
?>
<table width="663" align="center">
<tr>
<td><div align="center">
</div></td>
</tr>
<tr>
<td><div align="center">
<h3><center><div id="colorsh" style="cursor:hand"></div></center></h3>
<script>
background_color= "3a6ca3" // use capital letters
text_color= "99FFFF" // use capital letters
mesf[0]= "PARA SALIR HACER CLICK EN EL BOTON CERRAR VENTANA"
shape()
</script>
</div>
</td>
</tr>
</table>
<p> </p><p> </font></p>
</body>
</html>
<?
if(isset($_POST["guardar4"]))
{
if ($cedu==$_GET["cedula"]);
$mssql3 = mysql_query("UPDATE cobranzas set nombre_completo = '" . $_POST[nombre_completo] . "', cedula = '" . $_POST[identi] . "', numero = '" . $_POST[numero] . "', tipo = '" . $_POST[tipo] . "', capital_periodo = '" . $_POST[capital_periodo] . "', capital_renovacion= '" . $_POST[capital_renovacion] . "' , interes_prejuridico= '" . $_POST[interes_prejuridico] . "' , interes_cobroejecutivo= '" . $_POST[interes_cobroejecutivo] . "',deuda_total= '" . $_POST[deuda_total] . "', numero_carpeta= '" . $_POST[numero_carpeta] . "', estado= '2' WHERE cedula = '" . $_GET["ced2"] . "' " );
if (!$mssql3) {
die('Invalid query cartera_serviasjudinet MODIFICAR: ' . mysql_error());
}
echo "<script>alert('Los datos fueron Guardados');</script>";
}
?>