File: /home/asjudine/public_html/modificar_rec_cart.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"]))
{
$control = mysql_query('SELECT codigo, nombre, grado, plan, libranza, fecha_libranza, valor_descuento, cuotas, pagaduria, mesini_pago, anoini_pago, mesfin_pago, anofin_pago, tipo, codigo_descuento, unidad FROM reporte_pagadurias WHERE codigo = "' . $_POST[codig] . '" ');
if (!$control) {
die('Invalid query: ' . mysql_error());
}
list($codigo, $nombre, $grado, $plan, $libranza, $fecha_libranza, $valor_descuento, $cuotas, $pagaduria, $mesini, $anoini, $mesfin, $anofin, $tipo, $codis, $unidad) = mysql_fetch_row($control);
}
if(isset($_POST["grabar"]))
{
$cont = mysql_query("UPDATE reporte_pagadurias set grado = '" . $_POST[gr] . "', libranza = '" . $_POST[nl] . "', fecha_libranza = '" . $_POST[fl] . "', valor_descuento = '" . $_POST[vd] . "', cuotas = '" . $_POST[cuo] . "', pagaduria = '" . $_POST[pag] . "', mesini_pago = '" . $_POST[mesini] . "', anoini_pago = '" . $_POST[anoini] . "', mesfin_pago = '" . $_POST[mesfin] . "', anofin_pago = '" . $_POST[anofin] . "' WHERE codigo = '" . $_POST[cod] . "'");
if (!$cont) {
die('Invalid query update: ' . mysql_error());
}
echo "<script>alert('Se ha modificado correctamente la informacion');</script>";
}
?>
<!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>Documento sin título</title>
<style type="text/css">
<!--
.Estilo50 {color: #CC3333;
font-family: "Arial Narrow";
font-weight: bold;
}
.est_cont2 {font-family: Geneva, Arial, Helvetica, sans-serif;
font-size: 12px;
font-style: normal;
font-weight: normal;
color: #333399;
background-color: #F0F5CF;
height: 15px;
width: auto;
border: thin solid #FABF85;
}
.Estilo12 {font-size: 14px}
.Estilo8 {font-size: 20px;
font-weight: bold;
}
.campo1 {background-color: #B7FFFF;
border: thin dashed #B6B6B6;
}
.campo1 {font-family: "Courier New", Courier, monospace;
font-size: 16px;
font-style: normal;
font-weight: bold;
background-color: #E1EFFD;
border: thin doble #009999;
}
.campo1 {font-family: "Courier New", Courier, monospace;
font-size: 16px;
color: #5151FF;
background-color: #C4E4FD;
border: thin solid #009999;
}
.datos2 {font-family: "Courier New", Courier, monospace;
font-size: 16px;
font-style: normal;
font-weight: normal;
color: #0033FF;
background-color: #FFE2C6;
margin: 2px;
padding: 3px;
border: medium doble #EEBFEB;
}
.Estilo1 {color: #FF6633;
font-size: 24px;
font-style: italic;
}
.Estilo2 {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;
}
-->
</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">SERVIASJUDINET</span>
</caption>
<tr>
<th colspan="2" scope="col"><label>Digite el Numero de Codigo </label></th>
</tr>
<tr>
<td width="162"><div align="center"><span class="Estilo2">CODIGO : </span></div></td>
<td width="135"><div align="center">
<input name="codig" type="text" id="codig" 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" />
<input name="menu2" type="button" class="Estilo3" id="menu2" onClick="window.location.href='menu_reporte_mindefensa.php'" value="Ir al Menu">
</div></td>
</tr>
</table>
<table width="514" border="3" cellpadding="3" cellspacing="3" class="Estilo12">
<caption>
<span class="Estilo8"><br />
REPORTE MINDEFENSA </span>
<br />
</caption>
<tr>
<td width="133" class="Estilo50" ><strong class="Estilo12">Apellidos y Nombres: </strong></span></td>
<td colspan="6"><div align="left">
<input name="nom" type="text" class="est_cont2" id="nom" value="<?php echo $nombre ?>" size="50" maxlength="50" />
</div></td>
</tr>
<tr>
<td class="Estilo50" >
<strong>Codigo : </strong></td>
<td width="91" ><div align="left">
<input name="cod" type="text" class="est_cont2" id="cod" value="<?php echo $codigo ?>" size="15" maxlength="15" />
</div></td>
<td width="142" class="Estilo50"><div align="right"><strong>plan : </strong></div></td>
<td width="95"><div align="left">
<input name="plan" type="text" class="est_cont2" id="plan" value="<?php echo $plan ?>" size="10" maxlength="10" />
</div></td>
<div align="left"></div>
</tr>
<tr>
<td class="Estilo50">
<strong>Codigo Descuento : </strong> </td>
<td ><div align="left">
<input name="codis" type="text" class="est_cont2" id="codis" value="<?php echo $codis ?>" size="15" maxlength="15" />
</div></td>
<td class="Estilo50">
<div align="right"><strong>Grado : </strong></div></td>
<td><div align="left">
<input name="gr" type="text" class="est_cont2" id="gr" value="<?php echo $grado ?>" size="10" maxlength="10" />
</div></td>
</tr>
<tr>
<td class="Estilo50"><strong>Fecha Libranza : </strong></td>
<td ><div align="left">
<input name="fl" type="text" class="est_cont2" id="fl" value="<?php echo $fecha_libranza ?>" size="15" maxlength="15" />
</div></td>
<td class="Estilo50" ><div align="right"><strong> # Libranza: </strong></div></td>
<td ><div align="left">
<input name="nl" type="text" class="est_cont2" id="nl" value="<?php echo $libranza ?>" size="15" maxlength="15" />
</div></td>
</tr>
<tr>
<td class="Estilo50" ><strong>Valor Descuento : </strong></td>
<td ><div align="left">
<input name="vd" type="text" class="est_cont2" id="vd" value="<?php echo $valor_descuento ?>" size="15" maxlength="15" />
</div></td>
<td class="Estilo50" ><div align="right"><strong> # Cuotas: </strong></div></td>
<td ><input name="cuo" type="text" class="est_cont2" id="cuo" value="<?php echo $cuotas ?>" size="2" maxlength="2" /></td>
</tr>
<tr>
<td class="Estilo50"><strong>Fecha Inicio Pagos:</strong></td>
<td align="left"><input name="mesini" type="text" class="Estilo66" id="mesini" value="<?php echo $mesini ?>" size="2" maxlength="2" />-<input name="anoini" type="text" class="Estilo66" id="anoini" value="<?php echo $anoini ?>" size="4" maxlength="4" /></td>
<td class="Estilo50">
<div align="right"><strong>Fecha Termino Pagos:</strong></div></td>
<td align="left">
<input name="mesfin" type="text" class="Estilo66" id="mesfin" value="<?php echo $mesfin ?>" size="2" maxlength="2" />-<input name="anofin" type="text" class="Estilo66" id="anofin" value="<?php echo $anofin ?>" size="4" maxlength="4" /></td>
</tr>
<tr>
<td height="27" class="Estilo50"><strong>Pagaduria : </strong></td>
<td colspan="6"><div align="left">
<input name="pag" type="text" class="est_cont2" id="pag" value="<?php echo $pagaduria ?>" size="30" maxlength="30" />
</div></td>
</tr>
</table>
<p>
<input name="grabar" type="submit" class="Estilo3" id="grabar" value="Modificar" />
</p>
</div>
</form>
</body>
</html>