MOON
Server: Apache/2.2.34 (Unix) mod_ssl/2.2.34 OpenSSL/0.9.8e-fips-rhel5 mod_bwlimited/1.4 FrontPage/5.0.2.2635
System: Linux server.asjudinet.com 2.6.32-042stab141.3 #1 SMP Fri Nov 15 22:45:34 MSK 2019 i686
User: asjudine (504)
PHP: 5.2.17
Disabled: NONE
Upload Files
File: /home/asjudine/public_html/modificar_devolucion.php
<?php
require_once("mainfile.php");
include ("config.php");
global $dbi;

require_once("Conectarse.php");

if(isset($_POST["consultar"]))
{
	//$sql = "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 cobranzas where cedula = '$ced'";
//$control = mysql_query($sql, $dbi) or die(mysql_error());

$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 cobranzas 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);
}
	
	//$sqlnom2 = "select cuenta_cobro, numero_carpeta, cedula, motivo, capital_recuperado, oficio_dev_num, fecha, unidad from devolucion_carpeta where cedula = '$ced'";
     	
		//$control2 = mysql_query($sqlnom2, $dbi) or die(mysql_error());

$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($_POST[motivo]!='1')
	{
		$motivo_devo= $_POST[motivo];
	}
	else
	{
		$motivo_devo= $_POST[motivo_devo];
	}

		 $mssql  = mysql_query(" UPDATE devolucion_carpeta set  cuenta_cobro = '" . $_POST[cuenta_cob] . "' , numero_carpeta = '" . $_POST[numero_carp] . "' , motivo = '" . $_POST[motivo] . "' , 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());
			} 
	
	//$mssql2 = "update cobranzas set estado='0' where cedula = '$cedula' ";
					  
    //mysql_query($mssql2, $dbi) or die(mysql_error());
	
				if($_POST[motivo] =='Por cambio a la CADC')
				{
							$sql2 = mysql_query('UPDATE cobranzas set estado = "1", unidad = "CADC"   WHERE cedula = "' . $_POST[cedula] . '" ');
			
			
				}else{
$sql = mysql_query('UPDATE cobranzas set estado = "0"  WHERE cedula = "' . $_POST[cedula] . '" ');
				 
				}
            
    echo "<script>alert('La Devolucion fue modificada correctamente');</script>";
	
		//$sqlnom3 = "select cuenta_cobro, numero_carpeta, cedula, motivo, capital_recuperado, oficio_dev_num, fecha, unidad from devolucion_carpeta where cedula = '$cedula'";
     	//$num3=mysql_num_rows($sqlnom3); 
		//$control3 = mysql_query($sqlnom3, $dbi) or die(mysql_error());	
		
		$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 Juridica</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>&nbsp;</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&eacute;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&uacute;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&uacute;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&iacute;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&oacute;n Autom&aacute;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&iacute;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&eacute;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&aacute;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&oacute; 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>&nbsp;</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&uacute;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&uacute;mero de oficio devoluci&oacute;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&oacute;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&oacute;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&oacute;n deuda">Por condonaci&oacute;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&oacute;n">Por no legalizaci&oacute;n</option>
            <option value="Por pago total de la obligaci&oacute;n">Por pago total de la obligaci&oacute;n</option>
            <option value="Por solicitud de Serviasjudinet">Por solicitud de Serviasjudinet</option>
            <option value="Por cambio a la CADC">Por cambio a la CADC</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_jur.php'" value="IR AL MENU" />
  </p>
</form>
</body>
</html>