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/www/cobranzas_cre_envio.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();


	$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 cabranzas_credito  WHERE cedula = "' . $HTTP_GET_VARS["id"] . '" and numero_carpeta = "' . $HTTP_GET_VARS["carpeta"] . '"');
			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, $uni)  = mysql_fetch_row($resul);
   $tres=substr($fecha, 0, 4);
   $dos=substr($fecha, 5, 2);
   $uno=substr($fecha, 8, 2);
  // $fecha = ($uno."-".$dos."-".$tres);	
   $fecha = ($_POST[uno]."-".$_POST[dos]."-".$_POST[tres]);	
  		  				  		  
}
?>

<?php
if ($_POST["guardar"])	
{
    
$result = mysql_query("UPDATE cabranzas_credito  set  oficio_numero = '" . $_POST[oficio_numero] . "',  fecha_oficio = '" . $_POST[fecha_oficio] . "' WHERE cedula = '" . $_POST[id] . "' ");
			if (!$result) {
				die('No se actualizó la BD :  ' . mysql_error());
			}
	
  
}
?>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Capturar envio N° carpeta</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<script Language="JavaScript"><!--
function control(form)
{

 if (form.identi.value == "")
  {
    alert("Ingrese el número de cedula");
    form.identi.focus();
    return (false);
  }

  if (form.numero_carpeta.value == "")
  {
    alert("Ingrese el número de carpeta");
    form.numero_carpeta.focus();
    return (false);
  }

  return (true);
}
//--></script>

<script Language="JavaScript"><!--
function validar(formulario)
{

  if (formulario.cuenta_cobro.value == "")
  {
    alert("Ingrese el número de la cuenta de cobro");
    formulario.cuenta_cobro.focus();
    return (false);
  }

  if (formulario.motivo.value == "")
  {
    alert("seleccione el motivo de la devolución");
    formulario.motivo.focus();
    return (false);
  }

  if (formulario.capital_recuperado.value == "")
  {
    alert("Ingrese el capital recuperado");
    formulario.capital_recuperado.focus();
    return (false);
  }

  if (formulario.oficio_dev_num.value == "")
  {
    alert("Ingrese el número de oficio de la devolución");
    formulario.oficio_dev_num.focus();
    return (false);
  }

  if (formulario.dia_dev.value > 31)
  {
    alert("El número de día no se debe exceder de 31");
    formulario.dia_dev.focus();
    return (false);
  }

  if (formulario.mes_dev.value > 12)
  {
    alert("El número del mes no se debe exceder de 12");
    formulario.mes_dev.focus();
    return (false);
  }

  if (formulario.dia_dev.value == "")
  {
    alert("Ingrese el día de la devolución");
    formulario.dia_dev.focus();
    return (false);
  }

  if (formulario.mes_dev.value == "")
  {
    alert("Ingrese el mes de la devolución");
    formulario.mes_dev.focus();
    return (false);
  }

  if (formulario.ano_dev.value == "")
  {
    alert("Ingrese el año de la devolución");
    formulario.ano_dev.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>
<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}
.Estilo32 {
	font-family: Tahoma;
	font-size: 12px;
	color: #FFFFFF;
	font-weight: bold;
}
.Estilo33 {color: #FF0000}
.Estilo18 {font-family: "Arial Narrow"; font-weight: bold; font-size: 14; }
-->
</style>
</head>
<body onload="document.formulario.identi.focus()">
<form method="post" name="form" action="" onSubmit="return control(this)">
<table width="639" border="0" align="center" cellpadding="3" cellspacing="3">    
  <tr valign="baseline" bgcolor="#0099FF">
    <td colspan="4" align="right" nowrap><div align="center"><span class="Estilo2">CAPTURA DE DEVOLUCIONES </span></div></td>
  </tr>
  <tr valign="baseline" bgcolor="#0099FF">
    <td colspan="4" align="right" 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><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><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="unidad2" type="text" id="unidad2" value="<?php echo $uni; ?>" 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><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><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><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>
  
  </table>
</form>  
	
<form method="post" name="form" action="" onSubmit="return validar(this)">	
<input name="cedula" type= "hidden" value="<?php echo $cedula; ?>" size="10" maxlength="10">
<table width="651" border="0" align="center" cellpadding="3" cellspacing="3">    	
  <tr valign="baseline" bgcolor="#0099FF">
      <td align="right" 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">dd/mm/aaaa:</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>
    <tr valign="baseline" bgcolor="#0099FF">
      <td colspan="4" align="right" 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">
          <input name="button" type="button" style="font-family: Verdana; font-size: 8 pt; color: #000080; background-color: #C0C0C0; border-style: solid" onClick="javascript:window.close()" value="Cerrar Ventana">		   		  
      </div></td>
    </tr>
  </table>
</form>  
</body>
</html>