File: /home/asjudine/public_html/modificar_cobranzas.php
<?php
if ($_POST[consultar])
{
require_once("mainfile.php");
require_once("Conectarse.php");
include ("config.php");
global $dbi;
if($cedula)
{
$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 FROM cobranzas WHERE cedula = "' . $_POST[cedula] . '" ');
if (!$result) {
die('Invalid query: ' . mysql_error());
}
/* $msql = "select numero_carpeta, cedula, nombre_completo, numero, tipo, capital_periodo, capital_renovacion, interes_prejuridico, interes_cobroejecutivo,
capital_clausula, deuda_total, oficio_numero, fecha_oficio from cobranzas where cedula = $cedula";
$con = mysql_query($msql, $dbi) or die(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) = mysql_fetch_row($result);
$tres=substr($fecha, 0, 4);
$dos=substr($fecha, 5, 2);
$uno=substr($fecha, 8, 2);
$fecha_oficio = ($uno."-".$dos."-".$tres);
}
}
}
/*
if ($_POST[modificar])
{
if($id)
{
$fecha = $fecha_oficio;
$uno=substr($fecha, 0, 2);
$dos=substr($fecha, 3, 2);
$tres=substr($fecha, 6, 4);
$fecha_oficio = ($tres."-".$dos."-".$uno);
$nombre_completo = strtoupper($nombre_completo);
$tc = strtoupper($tc);
$result = mysql_query('UPDATE cobranzas set oficio_numero = '$on', fecha_oficio ='$fecha_oficio', cedula_funcionario = '$cf' WHERE cedula = "' . $_POST[id] . ' ');
if (!$result) {
die('Invalid query: ' . mysql_error());
}
// $sql = "update cobranzas set oficio_numero = '$on', fecha_oficio ='$fecha_oficio', cedula_funcionario = '$cf' where cedula = $id";
// mysql_query($sql, $dbi) or die(mysql_error());
$resu = 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 FROM cobranzas WHERE cedula = "' . $_POST[id] . ' ');
if (!$resu) {
die('Invalid query: ' . mysql_error());
}
/* $msql = "select numero_carpeta, cedula, nombre_completo, numero, tipo, capital_periodo, capital_renovacion, interes_prejuridico, interes_cobroejecutivo,
capital_clausula, deuda_total, oficio_numero, fecha_oficio from cobranzas where cedula = $id";
$con = mysql_query($msql, $dbi) or die(mysql_error()); */
if ((mysql_num_rows($resu)!=0))
{
list($numero_carpeta, $cedula, $nombre_completo, $numero, $tipo, $capital_periodo, $capital_renovacion, $interes_prejuridico, $interes_cobroejecutivo,$capital_clausula, $deuda_total, $oficio_numero, $fecha) = mysql_fetch_row($resu);
$tres=substr($fecha, 0, 4);
$dos=substr($fecha, 5, 2);
$uno=substr($fecha, 8, 2);
$fecha_oficio = ($uno."-".$dos."-".$tres);
}
}
}
?>
<html>
<head>
<title>Documento sin título</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; }
.Estilo21 {font-family: "Arial Narrow"; font-weight: bold; font-size: 14; color: #FF0000; }
.Estilo23 {font-family: "Arial Narrow"; color: #FF0000; }
.Estilo24 {color: #FF0000}
.Estilo25 {
color: #FFFFFF;
font-weight: bold;
}
.Estilo26 {
color: #000000;
font-weight: bold;
}
-->
</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">MODIFICACION DATOS DE 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="#FFFFCC">
<td width="191" align="right" nowrap><span class="Estilo21">Escriba Número de Cédula: </span></td>
<td><input name="cedula" type="text" id="cedula" size="15" maxlength="15"></td>
<td colspan="4"><span class="Estilo23">Escriba el número de cédula y hacer click en el botón <span class="Estilo26">Buscar</span> </span></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><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="cp" type="text" id="cp" value="<?php echo $capital_periodo; ?>" size="10" maxlength="10" readonly=""></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" readonly=""></td>
<td colspan="2"><div align="right" class="Estilo18">Interés Cobro Ejecutivo: </div></td>
<td colspan="2"><input name="ice" type="text" id="ice" value="<?php echo $interes_cobroejecutivo; ?>" 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="cc" type="text" id="cc" value="<?php echo $capital_clausula; ?>" size="10" maxlength="10" readonly=""></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" 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="on" type="text" id="on" value="<?php echo $oficio_numero; ?>" size="4" maxlength="4"></td>
<td colspan="2"><div align="right" class="Estilo19">Fecha dd/mm/aaaa:</div></td>
<td colspan="2"><span class="Estilo18">
<input name="fecha_oficio" type="text" id="fecha_oficio" value="<?php echo $fecha_oficio; ?>" size="10" maxlength="10">
</span></td>
</tr>
</table>
<table width="711" height="60" align="center">
<tr>
<td height="26" bgcolor="#0099FF"><div align="center">
<input name="consultar" type="submit" id="consultar"value ="Buscar" style="font-family: Verdana; font-size: 8 pt; color: #000080; background-color: #C0C0C0; border-style: solid">
<input name="modificar" type="submit" id="modificar" value ="Modificar" style="font-family: Verdana; font-size: 8 pt; color: #000080; background-color: #C0C0C0; border-style: solid">
<input name="button" type="button" style="font-family: Verdana; font-size: 8 pt; color: #000080; background-color: #C0C0C0; border-style: solid" onClick="history.back()" value="Atrás">
<input name="button" type="button" style="font-family: Verdana; font-size: 8 pt; color: #000080; background-color: #C0C0C0; border-style: solid" 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>