File: /home/asjudine/public_html/afinanciera/cartera_modificar_estado_debit.php
<?php
global $dbi;
require_once("../Conectarse.php");
if(isset($_POST["guardar"]))
{
$ced2 = $_GET["ced2"] ;
$numcon = $_GET["numcon"] ;
if ($_POST[tipousu] == "")
{
$tipousu = $_POST["usuarios"];
}
else {
$tipousu = $_POST[tipousu];
}
/////
if ($_POST[causarechazo] == "")
{
$causarechazo = $_POST["causal"];
}
else {
$causarechazo = $_POST[causarechazo];
}
//******
$mssql = mysql_query("UPDATE debitos_estado_contable set cuota = '".$_POST[cuota]."', valor_cuota = '".$_POST[valor_cuota]."', usuarios = '".$tipousu."', fecha_registro = '" . $_POST[fecha_registro] . "', codigo_descuento = '".$_POST[codigo_descuento]."', unidad_descuento = '".$_POST[unidad_descuento]."' , causal = '".$causarechazo."' WHERE id = '".$_GET["id"]."' ");
if (!$mssql) {
die('Invalid query primer UPDATE: ' . mysql_error());
}
///////////////////////////////////////
$control = mysql_query('SELECT * FROM debitos_estado_contable WHERE id = "' . $_GET["id"] . '" ORDER BY cuota ASC ');
if (!$control) {
die('Invalid query: ' . mysql_error());
}
list($idr, $cedula, $nombre, $cuota, $valor_cuota, $usuarios, $fecha_registro, $codigo_descuento, $unidad_descuento, $causal) = mysql_fetch_row($control);
$result2 = mysql_query('SELECT codigo, unidad FROM descuentos WHERE codigo = "' ."$formapago". '" and unidad = "' ."$uni". '" ');
if (!$result2) {
die('Invalid query 2: ' . mysql_error());
}
list($cod_descuento, $unidad_descuento) = mysql_fetch_row($result2);
echo "<script>alert('Los datos fueron modificados correctamente');</script>";
echo "<SCRIPT LANGUAGE='javascript'>window.location.href='estado_contable_debito.php?ced2=$ced2'</SCRIPT>";
}
if(isset($_POST["elimanar"]))
{
$modificarcob = mysql_query("DELETE FROM debitos_estado_contable WHERE id = '" . $_GET[id] . "' ");
if (! $modificarcob) {
die('Invalid query: ' . mysql_error());
}
echo "<script>alert('Cuota eliminada Correctamente');</script>";
}
$control = mysql_query('SELECT * FROM debitos_estado_contable WHERE id = "' . $_GET["id"] . '" ORDER BY cuota ASC ');
if (!$control) {
die('Invalid query: ' . mysql_error());
}
list($idr, $cedula, $nombre, $cuota, $valor_cuota, $usuarios, $fecha_registro, $codigo_descuento, $unidad_descuento, $causal) = mysql_fetch_row($control);
$sql2 = mysql_query('SELECT * FROM descuentos WHERE estado = "1" order by unidad ');
if (!$sql2) {
die('Invalid query: ' . mysql_error());
}
$row_sql2 = mysql_fetch_assoc($sql2);
$totalRows_sql2 = mysql_num_rows($sql2);
?>
<!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=utf-8" />
<title>Modificación </title>
<style type="text/css">
<!--
.est_cont1 { font-family: "Times New Roman", Times, serif;
font-size: 12px;
font-style: normal;
font-weight: normal;
color: #4068F4;
background-color: #E6FFF1;
margin: 1px;
padding: 1px;
height: auto;
width: auto;
border: thin double #33CC66;
}
.est_cont2 {
font-family: Geneva, Arial, Helvetica, sans-serif;
font-size: 12px;
font-style: normal;
font-weight: normal;
color: #000000;
background-color: #F0F5CF;
height: 18px;
width: auto;
border: thin solid #FABF85;
}
.Estilo1 { color: #FF6600;
font-weight: bold;
}
.Estilo3 {color: #2492FF;
font-weight: bold;
}
.Estilo50 {color: #CC3333;
font-family: "Arial Narrow";
font-weight: bold;
}
.est_cont21 {font-family: Geneva, Arial, Helvetica, sans-serif;
font-size: 12px;
font-style: normal;
font-weight: normal;
color: #2B39EC;
background-color: #F0F5CF;
height: 18px;
width: auto;
border: thin solid #FABF85;
}
body {
background-image: url(ELEMENTOS/lila.jpg);
}
-->
</style>
</head>
<body>
<form id="form1" name="form1" method="post" action="">
<div align="center">
<p><span class="Estilo50">RELACION DE PAGOS</span></p>
<table width="600" border="1" class="est_cont1">
<tr>
<th width="99" bgcolor="#FFFFFF" scope="col"><div align="right"><strong>Cuota :</strong></div></th>
<th width="71" bgcolor="#FFFFFF" scope="col"><div align="left">
<input name="cuota" type="text" class="est_cont2" id="cuota" value="<?php echo $cuota ?>" size="30" maxlength="13"/>
</div></th>
<th width="62" height="19" bgcolor="#FFFFFF" scope="col"><div align="right"><strong>Valor :</strong></div></th>
<th width="73" bgcolor="#FFFFFF" scope="col"><div align="left">
<input name="valor_cuota" type="text" class="est_cont2" id="valor_cuota" value="<?php echo $valor_cuota ?>" size="30" maxlength="13"/>
</div></th>
</tr>
<tr>
<td bgcolor="#FFFFFF"><div align="right"><strong>Usuario:</strong></div></td>
<td bgcolor="#FFFFFF"><div align="left">
<input name="usuarios" type="text" class="est_cont2" id="usuarios" value="<?php echo $usuarios ?>" size="30" maxlength="18"/>
<select name="tipousu" class="Estilo15">
<option value="" selected>--TIPO DE USUARIO--</option>
<option value="CREDITOS">CREDITOS</option>
<option value="COBRANZAS">COBRANZAS</option>
<option value="VENTAS">VENTAS</option>
<option value="GESTION EMPRESARIAL">GESTION EMPRESARIAL</option>
<option value="NOMINAS">NOMINAS</option>
<option value="ALMACEN MUEBLES">ALMACEN MUEBLES</option>
<option value="TESORERIA">TESORERIA</option>
<option value="DEBITOS BANCARIOS">DEBITOS BANCARIOS</option>
<option value="HERNANDO ROSERO">HERNANDO ROSERO</option>
</select>
</div></td>
<td bgcolor="#FFFFFF"><div align="right"><strong>Causal:</strong></div></td>
<td bgcolor="#FFFFFF"><div align="left">
<input name="causal" type="text" class="est_cont2" id="causal" value="<?php echo $causal ?>" size="30" maxlength="30"/>
<select name="causarechazo" class="Estilo15">
<option value="" selected>--CAUSAL RECHAZO--</option>
<option value="FONDOS INSUFICIENTES">FONDOS INSUFICIENTES</option>
<option value="CUENTA SALDADA">CUENTA SALDADA</option>
<option value="CUENTA EMBARGADA">CUENTA EMBARGADA</option>
<option value="CUENTA INEXISTENTE">CUENTA INEXISTENTE</option>
</select>
</div></td>
</tr>
<tr>
<td bgcolor="#FFFFFF"><div align="right"><strong>Codigo Descuento :</strong></div></td>
<td bgcolor="#FFFFFF"><div align="left">
<input name="codigo_descuento" type="text" class="est_cont2" id="codigo_descuento" value="<?php echo $codigo_descuento?>" size="30" maxlength="13" />
</div></td>
<td bgcolor="#FFFFFF"><div align="right"><strong>Unidad Descuento:</strong></div></td>
<td bgcolor="#FFFFFF"><div align="left">
<input name="unidad_descuento" type="text" class="est_cont2" id="unidad_descuento" value="<?php echo $unidad_descuento?>" size="30" maxlength="13" readonly="" />
</div></td>
</tr>
<tr>
<td bgcolor="#FFFFFF"><div align="right"><strong>Fecha Registro :</strong></div></td>
<td bgcolor="#FFFFFF" colspan="4"><div align="left">
<input name="fecha_registro" type="text" class="est_cont2" id="fecha_registro" value="<?php echo $fecha_registro ?>" size="30" maxlength="13" />
</div></td>
</tr>
</table>
<p>
<input name="guardar" type="submit" class="Estilo3" id="guardar" value="Guardar" />
<input name="elimanar" type="submit" class="Estilo3" id="elimanar" value="Eliminar" />
</p>
<p>
<input name="menu2" type="button" class="Estilo50" id="menu2" onclick="window.location.href='menu_recuperacion_car.php'" value="IR AL MENU" />
<?php
$ced2 = $_GET["ced2"] ;
$numcon = $_GET["numcon"] ;
echo "<input type='button' value='Volver al Estado' name=boton class=Estilo50 onClick =window.location.href='estado_contable_debito.php?ced2=$ced2&numcon=$numcon','','top=50,left=100,toolbar=no,scrollbars=yes,width=790,height=280,status=yes'></a>"; ?>
</p>
</div>
</form>
</body>
</html>