File: /home/asjudine/www/ingresar_gestion_deb.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();
$control4 = mysql_query('SELECT cedula, nombres, dirrecion, telefono, celular, ciudad, email, entidad_laboral, banco, cuenta, valor_credito, valor_juridica, valor_debitar, cuota_debitar, unidad_desc, codigo_desc, debito_jur, debito_cre, cuotas_pend, fecha_registro, causal_rechazo, fecha_rechazo, fecha_debito, estado, historico FROM debitos WHERE cedula = "' . $HTTP_GET_VARS["id"] . '" ');
if (!$control4) {
die('Invalid query 4 aqui: ' . mysql_error());
}
list($cedulab, $apellidos_nomsb, $direccionb, $telefonob, $celularb, $ciudadb, $emailb, $entidad_laboral, $banco, $cuenta, $valcre, $valjur, $val_deb, $cuo_deb, $unidad_desc, $codigo_desc, $debito_jur, $debito_cre, $cuotas_pend, $fecha_registro, $causal_rechazo, $fecha_rechazo, $fecha_debito, $esta, $historico) = mysql_fetch_row($control4);
$eldia = $_POST[dia_act];
$elmes = $_POST[mes_act];
$elano = $_POST[ano_act];
$fec = ($_POST[eldia]."-".$_POST[elmes]."-".$_POST[elano]);
$resu1 = mysql_query('SELECT historico FROM debito_historico WHERE codigo = "' ."$historico". '" ');
if (!$resu1) {
die('Invalid query: ' . mysql_error());
}
list($histo) = mysql_fetch_row($resu1);
if ($_POST[guardar])
{
$fec = ($_POST[dia_act]."-".$_POST[mes_act]."-".$_POST[ano_act]);
$eldia = $_POST[dia_act];
$elmes = $_POST[mes_act];
$elano = $_POST[ano_act];
$fec = ($_POST[eldia]."-".$_POST[elmes]."-".$_POST[elano]);
$nuevafecha = $_POST[ano_act]."-".$_POST[mes_act]."-".$_POST[dia_act];
mysql_query("INSERT INTO debitos_gestion (cedula, gestion, fecha_gestion) VALUES ('" . $HTTP_GET_VARS[id] . "', '" . $_POST["actuacion"] . "', '$nuevafecha')");
echo "<script>alert('La gestion fue grabada correctamente');</script>";
}
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Documento sin título</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<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_campos(form)
{
if (form.dia_act.value == "")
{
alert("Ingrese el día de la actuación");
form.dia_act.focus();
return (false);
}
if (form.mes_act.value == "")
{
alert("Ingrese el mes de la actuación");
form.mes_act.focus();
return (false);
}
if (form.ano_act.value == "")
{
alert("Ingrese el año de la actuación");
form.ano_act.focus();
return (false);
}
if (form.actuacion.value == "")
{
alert("Escriba el texto correspondiente a la actuación de cobranza");
form.actuacion.focus();
return (false);
}
if (form.dia_act.value > 31)
{
alert("El número de día no se debe exceder de 31");
form.dia_act.focus();
return (false);
}
if (form.mes_act.value > 12)
{
alert("El número del mes no se debe exceder de 12");
form.mes_act.focus();
return (false);
}
return (true);
}
//--></script>
<style type="text/css">
<!--
.Estilo2 {
font-family: Arial, Helvetica, sans-serif;
font-weight: bold;
}
.Estilo29 {font-family: Tahoma; font-size: 12px; }
.Estilo32 {
font-family: Tahoma;
font-size: 12px;
color: #FFFFFF;
font-weight: bold;
}
.Estilo33 {color: #FF0000}
.Estilo10 {font-size: 11px; font-family: Arial, Helvetica, sans-serif; }
.Estilo35 {font-family: Tahoma; font-size: 14px; color: #FFFF00; }
.Estilo36 {
font-family: "Arial Narrow";
font-weight: bold;
}
.Estilo37 {
font-family: "Arial Narrow";
color: #990000;
}
-->
</style>
</head>
<body onload="document.form.actuacion.focus()">
<form method="post" name="formulario" action="">
<table width="651" border="2" align="center" cellpadding="3" cellspacing="3">
<tr valign="baseline" bgcolor="#0099FF">
<td colspan="6" align="right" nowrap><div align="center"><span class="Estilo2">CONSULTA DE DATOS DE DEBITO </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 align="right" nowrap><span class="Estilo1 Estilo37"><strong>Cédula y Nombre:</strong></span></td>
<td><input name="identi" type="text" id="identi" value="<?php echo $cedulab; ?>" size="8" maxlength="8" readonly=""></td>
<td colspan="4"><input name="apenom" type="text" id="apenom" value="<?php echo $apellidos_nomsb; ?>" size="30" maxlength="40" readonly=""></td>
</tr>
<tr valign="baseline" bgcolor="#0099FF">
<td align="right" nowrap><span class="Estilo1 Estilo37"><strong>Dirección:</strong></span></td>
<td width="40"><input name="dire" type="text" id="dire" value="<?php echo $direccionb; ?>" size="30" maxlength="40" readonly=""></td>
<td align="right" nowrap><span class="Estilo1 Estilo37"><strong>Ciudad:</strong></span></td>
<td width="10"><input name="ciu" type="text" id="ciu" value="<?php echo $ciudadb; ?>" size="30" maxlength="40" readonly=""></td>
</tr>
<tr valign="baseline" bgcolor="#0099FF">
<td align="right" nowrap><span class="Estilo1 Estilo37"><strong>Telefono:</strong></span></td>
<td width="40"><input name="telefono" type="text" id="telefono" value="<?php echo $telefonob; ?>" size="8" maxlength="8" readonly=""></td>
<td align="right" nowrap><span class="Estilo1 Estilo37"><strong>Celular:</strong></span></td>
<td><input name="celu" type="text" id="celu" value="<?php echo $celularb; ?>" size="10" maxlength="10" readonly=""></td>
</tr>
<tr valign="baseline" bgcolor="#0099FF">
<td align="right" nowrap><span class="Estilo1 Estilo37"><strong>Fecha a Debitar:</strong></span></td>
<td><input name="fecha_deb" type="text" id="fecha_deb" value="<?php echo $fecha_debito; ?>" size="10" maxlength="10" readonly=""></td>
<td align="right" nowrap><span class="Estilo1 Estilo37"><strong>Email:</strong></span></td>
<td colspan="3"><input name="ema" type="text" id="ema" value="<?php echo $emailb; ?>" size="30" maxlength="50" readonly=""></td>
</tr>
<tr valign="baseline" bgcolor="#0099FF">
<td align="right" nowrap><span class="Estilo1 Estilo37"><strong>Banco:</strong></span></td>
<td align="right" nowrap><div align="left" class="Estilo19">
<input name="ban" type="text" id="ban" value="<?php echo $banco; ?>" size="20" maxlength="15" readonly="">
</div></td>
<td align="right" nowrap><span class="Estilo1 Estilo37"><strong>Cuenta:</strong></span></td>
<td colspan="3" align="right" nowrap><div align="left"><span class="Estilo19">
<input name="cuen" type="text" id="cuen" value="<?php echo $cuenta; ?>" size="15" maxlength="15" readonly="">
</span></div></td>
</tr>
<tr valign="baseline" bgcolor="#FFFFCC">
<td align="right" nowrap><span class="Estilo1 Estilo29"><strong>Valor Credito:</strong></span></td>
<td align="right" nowrap><div align="left"><span class="Estilo19">
<input name="val_cre" type="text" id="val_cre" value="<?php echo $debito_cre; ?>" size="10" maxlength="10" readonly="">
</span></div></td>
<td align="right" nowrap><span class="Estilo1 Estilo29"><strong>Valor Juridica:</strong></span></td>
<td colspan="3" align="right" nowrap><div align="left"><span class="Estilo19">
<input name="val_jur" type="text" id="val_jur" value="<?php echo $debito_jur; ?>" size="10" maxlength="10" readonly="">
</span></div></td>
</tr>
<tr valign="baseline" bgcolor="#FFFFCC">
<td align="right" nowrap><span class="Estilo1 Estilo29"><strong>Valor Total Debito:</strong></span></td>
<td align="right" nowrap><div align="left"><span class="Estilo1">
<input name="val_deb" type="text" id="val_deb" value="<?php echo $val_deb; ?>" size="10" maxlength="10" readonly="">
</span></div></td>
<td align="right" nowrap><span class="Estilo1 Estilo29"><strong>Cuotas a Debitar:</strong></span> </td>
<td colspan="3" align="right" nowrap><div align="left"><span class="Estilo19"><span class="Estilo17">
<input name="cuota_deb" type="text" id="cuota_deb" value="<?php echo $cuo_deb; ?>" size="10" maxlength="10" readonly="">
</span></span></div></td>
</tr>
<tr valign="baseline" bgcolor="#FFFFCC">
<td align="right" nowrap><span class="Estilo1 Estilo29"><strong>Unidad y Codigo:</strong></span></td>
<td align="right" nowrap><div align="left"><span class="Estilo1">
<input name="unidad" type="text" id="unidad" value="<?php echo $unidad_desc; ?>" size="10" maxlength="10" readonly="">
<input name="cod" type="text" id="cod" value="<?php echo $codigo_desc; ?>" size="10" maxlength="10" readonly=""> </span></div></td>
<td align="right" nowrap><span class="Estilo1 Estilo29"><strong>Cuotas Pendientes:</strong></span> </td>
<td colspan="3" align="right" nowrap><div align="left"><span class="Estilo19"><span class="Estilo17">
<input name="pend" type="text" id="pend" value="<?php echo $cuotas_pend; ?>" size="10" maxlength="10" readonly="">
</span></span></div></td>
</tr>
<tr valign="baseline" bgcolor="#FFFFCC">
<td align="right" nowrap><span class="Estilo1 Estilo29"><strong>Casusal Rechazo:</strong></span></td>
<td align="right" nowrap><div align="left"><span class="Estilo1">
<input name="causal" type="text" id="causal" value="<?php echo $causala; ?>" size="20" maxlength="25" readonly="">
</span></div></td>
<td align="right" nowrap><span class="Estilo1 Estilo29"><strong>Fecha Rechazo:</strong></span> </td>
<td colspan="3" align="right" nowrap><div align="left"><span class="Estilo19"><span class="Estilo17">
<input name="fecha_rechazo" type="text" id="fecha_rechazo" value="<?php echo $fecha_rechazo; ?>" size="10" maxlength="10" readonly="">
</span></span></div></td>
</tr>
<tr valign="baseline" bgcolor="#FFFFCC">
<td align="right" nowrap><span class="Estilo1 Estilo29"><strong>Vigente o historico:</strong></span></td>
<td align="right" nowrap><div align="left"><span class="Estilo1">
<input name="estad" type="text" id="estad" value="<?php echo $esta; ?>" size="20" maxlength="25" readonly="">
</span></div></td>
<td align="right" nowrap><span class="Estilo1 Estilo29"><strong>Causal Historico:</strong></span> </td>
<td colspan="3" align="right" nowrap><div align="left"><span class="Estilo19"><span class="Estilo17">
<input name="historico" type="text" id="historico" value="<?php echo $histo; ?>" size="25" maxlength="20" readonly="">
</span></span></div></td>
</tr>
</table>
</form>
<form method="post" name="form" action="" onSubmit="return validar_campos(this)">
<table width="651" border="0" align="center" cellpadding="3" cellspacing="3">
<tr valign="baseline" bgcolor="#0099FF">
<td colspan="4" align="right" nowrap><div align="center"><span class="Estilo32">INGRESAR GESTION DEBITO</span></div></td>
</tr>
<tr valign="baseline" bgcolor="#0099FF">
<td width="167" align="right" nowrap><span class="Estilo35">FECHA DE LA GESTION:</span></td>
<td width="229" align="right" nowrap>
<div align="left"><span class="Estilo29">
<input name="dia_act" type="text" id="dia" value="<?php echo date("d"); ?>" size="2" maxlength="2" readonly="">
-
<input name="mes_act" type="text" id="mes" value="<?php echo date("m"); ?>" size="2" maxlength="2" readonly="">
-
<input name="ano_act" type="text" id="ano" value="<?php echo date("Y"); ?>" size="4" maxlength="4" readonly="">
<span class="Estilo33">dd/mm/aaaa</span></span></div></td>
</tr>
<tr valign="baseline" bgcolor="#0099FF">
<td colspan="4" align="right" nowrap>
<textarea name="actuacion" cols="70" rows="5" id="actuacion"></textarea></td>
</tr>
<tr valign="baseline" bgcolor="#0099FF">
<td colspan="4" align="right" nowrap><div align="center">
<input name="guardar" type="submit" id="guardar" value ="Guardar" class="Estilo2">
<input name="button" type="button" class="Estilo2" onclick="window.location.href='menu_deb.php'" value="Volver al Menú">
</div></td>
</tr>
</table>
<input name="cu" type="hidden" id="cu" value="<?php echo $ced; ?>">
</form>
</body>
</html>