File: /home/asjudine/public_html/modificar_devolucion_cre.php
<?php
require_once("mainfile.php");
include ("config.php");
global $dbi;
function Conectarse()
{
if (!($link=@mysql_connect("localhost","asjudine","as2006")))
{
echo "Error conectando con el servidor.";
exit();
}
$dbname = "asjudinet";
if (!@mysql_select_db($dbname,$link))
{
echo "Error seleccionando la base de datos.";
exit();
}
return $link;
}
Conectarse();
if(isset($_POST["consultar"]))
{
$resul = 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 cabranzas_credito WHERE cedula = "' . $_POST[ced] . '" ');
if (!$resul) {
die('Invalid query: ' . mysql_error());
}
if ((mysql_num_rows($resul)!=0))
{
list($numero_carpeta, $cedula, $nombre_completo, $numero, $tipo, $capital_periodo, $capital_renovacion, $interes_prejuridico, $interes_cobroejecutivo, $capital_clausula, $deuda_total, $oficio_numero, $fecha, $cedfun, $unidad) = mysql_fetch_row($resul);
}
$resu = mysql_query('SELECT cuenta_cobro, numero_carpeta, cedula, motivo, capital_recuperado, oficio_dev_num, fecha, unidad FROM devolucion_carpeta WHERE cedula = "' . $_POST[ced] . '"');
$num2=mysql_num_rows($resu);
if (!$resu) {
die('Invalid query: ' . mysql_error());
}
list($cue_cob, $nc, $cc, $mot_devo, $cap_rec, $no_ofdev, $fecha_d, $uni) = mysql_fetch_row($resu);
}
if(isset($_POST["guardar"]))
{
if($motivo!='1')
{
$motivo_devo=$motivo;
}
else
{
$motivo_devo=$motivo_devo;
}
$mssql = mysql_query(" UPDATE devolucion_carpeta set cuenta_cobro = '" . $_POST[cuenta_cob] . "' , numero_carpeta = '" . $_POST[numero_carp] . "' , motivo ='" . $_POST[motivo_devo] . "' , capital_recuperado = '" . $_POST[capital_rec] . "' , oficio_dev_num = '" . $_POST[oficio_dn] . "', fecha = '" . $_POST[fecha_devo] . "' , unidad = '" . $_POST[unidad_dev] . "' WHERE cedula = '" . $cedula. "' ");
if (! $mssql) {
die('Invalid query: ' . mysql_error());
}
if($motivo=='Por cambio a la CDDC')
{
$sql2 = mysql_query('UPDATE cabranzas_credito set estado = "1", unidad = "CDDC" WHERE cedula = "' . $_POST[cedula] . '" ');
}else{
$sql = mysql_query('UPDATE cabranzas_credito set estado = "0" WHERE cedula = "' . $_POST[cedula] . '" ');
}
echo "<script>alert('La Devolucion fue modificada correctamente');</script>";
$resut = mysql_query('SELECT cuenta_cobro, numero_carpeta, cedula, motivo, capital_recuperado, oficio_dev_num, fecha, unidad FROM devolucion_carpeta WHERE cedula = "' . $_POST[cedula] . '"');
$num3=mysql_num_rows($resut);
if (!$resut) {
die('Invalid query: ' . mysql_error());
}
list($cue_cob, $nc, $cc, $mot_devo, $cap_rec, $no_ofdev, $fecha_d, $uni) = mysql_fetch_row($resut);
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Modificar devolucion Cre</title>
<style type="text/css">
<!--
.Estilo2 { font-family: Arial, Helvetica, sans-serif;
font-weight: bold;
}
.Estilo29 {font-family: Tahoma; font-size: 12px; }
.Estilo30 {font-size: 12px}
.Estilo33 {color: #FF0000}
.Estilo1 {color: #FF6633;
font-size: 24px;
font-style: italic;
}
.Estilo34 {color: #FF6633;
font-size: 16px;
}
.Estilo3 {color: #2492FF;
font-weight: bold;
}
.recaudo {font-family: "Courier New", Courier, monospace;
font-size: 12px;
font-style: normal;
font-weight: bold;
font-variant: normal;
color: #000000;
background-color: #B6CBDC;
margin: 4px;
padding: 8px;
width: auto;
border: medium outset #339966;
}
.Estilo18 {font-family: "Arial Narrow"; font-weight: bold; font-size: 14; }
.Estilo50 {color: #CC3333;
font-family: "Arial Narrow";
font-weight: bold;
}
-->
</style>
</head>
<body>
<form id="form1" name="form1" method="post" action="">
<div align="center">
<table width="330" border="3" cellpadding="3" cellspacing="3" class="recaudo">
<caption>
<span class="Estilo1">DEVOLUCIONES </span>
</caption>
<tr>
<th colspan="2" scope="col"><label>Digite el Numero de Cedula </label></th>
</tr>
<tr>
<td width="162"><div align="center"><span class="Estilo34">CEDULA : </span></div></td>
<td width="135"><div align="center">
<input name="ced" type="text" id="ced" size="20" maxlength="20" />
</div></td>
</tr>
<tr>
<td colspan="2"><div align="center">
<input name="consultar" type="submit" class="Estilo3" id="consultar" value="Consultar" />
</div></td>
</tr>
</table>
<p> </p>
</div>
<table width="639" border="0" align="center" cellpadding="3" cellspacing="3">
<tr valign="baseline" bgcolor="#0099FF">
<td colspan="4" align="right" nowrap="nowrap"><div align="center"><span class="Estilo2">INFORMACION COBRANZAS </span></div></td>
</tr>
<tr valign="baseline" bgcolor="#0099FF">
<td colspan="4" align="right" nowrap="nowrap"><div align="center" class="Estilo2">
<script languaje="JavaScript">Mostrar_Fecha()</script>
</div></td>
</tr>
<tr valign="baseline" bgcolor="#0099FF">
<td width="180" align="right" nowrap="nowrap"><span class="Estilo29">Cédula, apellidos y nombres</span></td>
<td><input name="cedula" type="text" id="cedula" value="<?php echo $cedula; ?>" size="15" maxlength="15" readonly="" /></td>
<td colspan="2"><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 align="right" nowrap="nowrap"><span class="Estilo30"><span class="Estilo29">Número de carpeta:</span></span></td>
<td><input name="numero_carpeta2" type="text" id="numero_carpeta2" value="<?php echo $numero_carpeta; ?>" size="4" maxlength="4" readonly="" /></td>
<td><div align="right" class="Estilo29">Unidad:</div></td>
<td><input name="unidad" type="text" id="unidad" value="<?php echo $unidad; ?>" size="4" maxlength="4" readonly="" /></td>
</tr>
<tr valign="baseline" bgcolor="#0099FF">
<td><div align="right"><span class="Estilo29">Número de Contrato:</span></div></td>
<td width="69"><input name="numero" type="text" id="numero" value="<?php echo $numero; ?>" size="6" maxlength="6" readonly="" /></td>
<td width="196"><div align="right"><span class="Estilo29">Tipo:</span></div></td>
<td><input name="tipo" type="text" id="tipo" value="<?php echo $tipo; ?>" size="4" maxlength="4" readonly="" /></td>
</tr>
<tr valign="baseline" bgcolor="#0099FF">
<td align="right" nowrap="nowrap"><span class="Estilo29">Capital Período actual:</span></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"><span class="Estilo29">Capital renovación Automática:</span></div></td>
<td width="155"><input name="capital_renovacion" type="text" id="capital_renovacion" value="<?php echo $capital_renovacion; ?>" size="10" maxlength="10" readonly="" /></td>
</tr>
<tr valign="baseline" bgcolor="#0099FF">
<td align="right" nowrap="nowrap"><span class="Estilo29">Intereses Cobro Prejurídico:</span></td>
<td><input name="interes_prejuridico" type="text" id="interes_prejuridico" value="<?php echo $interes_prejuridico; ?>" size="10" maxlength="10" readonly="" /></td>
<td><div align="right"><span class="Estilo29">Interés Cobro Ejecutivo:</span></div></td>
<td><input name="interes_cobroejecutivo" type="text" id="interes_cobroejecutivo" value="<?php echo $interes_cobroejecutivo; ?>" size="10" maxlength="10" readonly="" /></td>
</tr>
<tr valign="baseline" bgcolor="#0099FF">
<td align="right" nowrap="nowrap"><span class="Estilo29">Capital cláusula penal:</span></td>
<td><input name="capital_clausula" type="text" id="interes_prejuridico3" value="<?php echo $capital_clausula; ?>" size="10" maxlength="10" readonly="" /></td>
<td><div align="right"><span class="Estilo29">Deuda Total:</span></div></td>
<td><input name="deuda_total" type="text" id="deuda_total3" value="<?php echo $deuda_total; ?>" size="10" maxlength="10" readonly="" /></td>
</tr>
<tr valign="baseline" bgcolor="#0099FF">
<td align="right" nowrap="nowrap"><span class="Estilo29">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"><span class="Estilo29">Fecha <span class="Estilo33">:</span></span></div></td>
<td><span class="Estilo29">
<input name="fecha_oficio" type="text" id="fecha_oficio" value="<?php echo $fecha; ?>" size="10" maxlength="10" readonly="" />
</span></span></td>
</tr>
</table>
<p> </p>
<table width="651" border="0" align="center" cellpadding="3" cellspacing="3">
<tr valign="baseline" bgcolor="#0099FF">
<td colspan="4" align="right" nowrap="nowrap"><div align="center"><span class="Estilo2">MODIFICAR DEVOLUCIONES</span></div></td>
</tr>
<tr valign="baseline" bgcolor="#0099FF">
<td align="right" nowrap="nowrap"><span class="Estilo29">Número Carpeta:</span></td>
<td align="right" nowrap="nowrap"><div align="left">
<input name="numero_carp" type="text" id="numero_carp" value="<?php echo $nc; ?>" size="4" maxlength="4" />
</div></td>
<td align="right" nowrap="nowrap"><span class="Estilo29">Cuenta de cobro No.:</span></td>
<td align="right" nowrap="nowrap"><div align="left">
<input name="cuenta_cob" type="text" id="cuenta_cob" value="<?php echo $cue_cob; ?>" size="4" maxlength="4" />
</div></td>
</tr>
<tr valign="baseline" bgcolor="#0099FF">
<td align="right" nowrap="nowrap"><span class="Estilo29">Unidad:</span></td>
<td width="53" align="right" nowrap="nowrap"><div align="left">
<input name="unidad_dev" type="text" id="unidad_dev" value="<?php echo $uni; ?>" size="4" maxlength="4" />
</div></td>
<td width="188" align="right" nowrap="nowrap"><span class="Estilo29">Capital recuperado:</span></td>
<td width="149" align="right" nowrap="nowrap"><div align="left">
<input name="capital_rec" type="text" id="capital_rec" value="<?php echo $cap_rec; ?>" size="10" maxlength="10" />
</div></td>
</tr>
<tr valign="baseline" bgcolor="#0099FF">
<td align="right" nowrap="nowrap"><span class="Estilo29">Número de oficio devolución:</span></td>
<td align="right" nowrap="nowrap"><div align="left">
<input name="oficio_dn" type="text" id="oficio_dn" value="<?php echo $no_ofdev; ?>" size="4" maxlength="4" />
</div></td>
<td align="right" nowrap="nowrap"><span class="Estilo29">Fecha devolución:</span></td>
<td align="right" nowrap="nowrap"><div align="left"><span class="Estilo29">
<input name="fecha_devo" type="text" id="fecha_devo" value="<?php echo $fecha_d; ?>" size="10" maxlength="10" />
</span></div></td>
</tr>
<tr valign="baseline" bgcolor="#0099FF">
<td width="222" align="right" nowrap="nowrap"><span class="Estilo29">Motivo de la devolución:</span></td>
<td colspan="3" align="right" nowrap="nowrap"><div align="left">
<p>
<input name="motivo_devo" type="text" id="nombre_completo" value="<?php echo $mot_devo; ?>" size="50" maxlength="50" />
</p>
<p>
<select name="motivo">
<option value="1" selected="selected">SELECCIONE EL MOTIVO</option>
<option value="Por condonación deuda">Por condonación deuda</option>
<option value="Por paz y salvo">Por paz y salvo</option>
<option value="Por no dar lugar al cobro ejecutivo">Por no dar lugar al cobro ejecutivo</option>
<option value="Por no legalización">Por no legalización</option>
<option value="Por pago total de la obligación">Por pago total de la obligación</option>
<option value="Por solicitud de Serviasjudinet">Por solicitud de Serviasjudinet</option>
<option value="Por cambio a la CDDC">Por cambio a la CDDC</option>
<option value="Por fallecimiento">Por fallecimiento</option>
</select>
</p>
</div></td>
</tr>
<tr valign="baseline" bgcolor="#0099FF">
<td colspan="4" align="right" nowrap="nowrap"><div align="center">
<input name="guardar" type="submit" id="guardar" value ="Guardar" style="font-family: Verdana; font-size: 8 pt; color: #000080; background-color: #C0C0C0; border-style: solid" />
</div></td>
</tr>
</table>
<p align="center">
<input name="menu2" type="button" class="Estilo50" id="menu2" onclick="window.location.href='menu_cobranzas_cre.php'" value="IR AL MENU" />
</p>
</form>
</body>
</html>