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_cobranzas_gestion_cre.php
<?php

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 ($_POST[consultar])	
{
require_once("mainfile.php");
include ("config.php");
global $dbi;



  if($_POST[cedula])
  {
  
  $result = 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, unidad, codigo_gestion FROM cabranzas_credito  WHERE cedula = "' ."$cedula". '" ');
			if (!$result) {
				die('Invalid query: ' . mysql_error());
			}
  
      // $msql = "select numero_carpeta, cedula, nombre_completo, numero, tipo, capital_periodo, capital_renovacion, interes_prejuridico, interes_cobroejecutivo, capital_clausula, deuda_total, oficio_numero, fecha_oficio, unidad from cobranzas where cedula = $cedula";
     //  $con = mysql_query($msql, $dbi) or die(mysql_error());	 
       if ((mysql_num_rows($result)!=0)) 
         {	 
                 list($numero_carpeta, $cedula, $nombre_completo, $numero, $tipo, $capital_periodo, $capital_renovacion, $interes_prejuridico, $interes_cobroejecutivo,$capital_clausula, $deuda_total, $oficio_numero, $fecha_oficio, $unidad, $codiges ) = mysql_fetch_row($result);
               /* $uno=substr($fecha, 0, 2);
        		$dos=substr($fecha, 3, 2);
         		$tres=substr($fecha, 6, 4);
         		$fecha_oficio = ($tres."-".$dos."-".$uno);*/

          } 
  }
}  

if ($_POST[modificar])	
{

    if($id)
	{


	     $nombre_completo = strtoupper($nombre_completo);		 
	     $tc = strtoupper($_POST[tc]);		 		 

		$result = mysql_query("UPDATE cabranzas_credito  set  nombre_completo = '" . $_POST[nombre] . "', numero = '" . $_POST[con] . "', tipo = '" . $tc . "', numero_carpeta = '" . $_POST[nc] ."', capital_periodo = '" . $_POST[cp] . "', capital_renovacion = '" . $_POST[cr] . "', interes_prejuridico = '" . $_POST[icp] . "', interes_cobroejecutivo = '" . $_POST[ice] . "', capital_clausula = '" . $_POST[ccl] . "', deuda_total = '" . $_POST[dt] . "', oficio_numero = '" . $_POST[on] . "',  fecha_oficio = '" . $_POST[fecha_oficio] . "', cedula_funcionario = '" . $_POST[cf] . "', unidad = '" . $_POST[un] . "'  WHERE cedula = '" . $_POST[id] . "' ");
			if (!$result) {
				die('No se actualizó la BD :  ' . mysql_error());
			}
		
		// $sql = "update cobranzas set   numero = '$con', tipo = '$tc', numero_carpeta = '$nc', capital_periodo = '$cp', capital_renovacion = '$cr', interes_prejuridico = '$icp', interes_cobroejecutivo = '$ice', capital_clausula = '$ccl', deuda_total = '$dt', oficio_numero = '$on',  fecha_oficio ='$fecha_oficio', cedula_funcionario = '$cf', unidad = '$un' where cedula = $id";
        // mysql_query($sql, $dbi) or die(mysql_error());		

        
		  $result = 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, unidad FROM cabranzas_credito  WHERE cedula = "' . "$id" . '" ');
			if (!$result) {
				die('Invalid query: ' . mysql_error());
			}
		
		//$msql = "select numero_carpeta, cedula, nombre_completo, numero, tipo, capital_periodo, capital_renovacion, interes_prejuridico, interes_cobroejecutivo,  capital_clausula, deuda_total, oficio_numero, fecha_oficio, unidad from cobranzas where cedula = $id";
       // $con = mysql_query($msql, $dbi) or die(mysql_error());	 
        if ((mysql_num_rows($result)!=0)) 
          {	 
                 list($numero_carpeta, $cedula, $nombre_completo, $numero, $tipo, $capital_periodo, $capital_renovacion, $interes_prejuridico, $interes_cobroejecutivo,$capital_clausula, $deuda_total, $oficio_numero, $fecha, $unidad ) = mysql_fetch_row($result);
                /* $uno=substr($fecha, 0, 2);
        		 $dos=substr($fecha, 3, 2);
         			$tres=substr($fecha, 6, 4);
         			$fecha_oficio = ($tres."-".$dos."-".$uno);*/

		
          } 
					
	 }				 
}
?>
<html>
<head>
<title>Modificar Datos Credito</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css">
<!--
.Estilo1 {font-family: "Arial Narrow"}
.Estilo2 {
	font-family: Arial, Helvetica, sans-serif;
	font-weight: bold;
}
.Estilo10 {font-weight: bold}
.Estilo17 {font-size: 14}
.Estilo18 {font-family: "Arial Narrow"; font-weight: bold; font-size: 14; }
.Estilo19 {font-family: "Arial Narrow"; font-weight: bold; }
.Estilo21 {font-family: "Arial Narrow"; font-weight: bold; font-size: 14; color: #FF0000; }
.Estilo23 {font-family: "Arial Narrow"; color: #FF0000; }
.Estilo24 {color: #FF0000}
.Estilo25 {
	color: #FFFFFF;
	font-weight: bold;
}
.Estilo26 {
	color: #000000;
	font-weight: bold;
}
.Estilo29 {font-family: Tahoma; font-size: 12px; }
-->
</style>

<script Language="JavaScript"><!--
function validar(formulario)
{
  if (formulario.dia_act.value > 31)
  {
    alert("El número de día no se debe exceder de 31");
    formulario.dia_act.focus();
    return (false);
  }

  if (formulario.mes_act.value > 12)
  {
    alert("El número del mes no se debe exceder de 12");
    formulario.mes_act.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>
</head>
<body onLoad="document.formulario.cedula.focus()">
<form method="post" name="formulario" action="" onSubmit="return validar(this)">
  <table width="711" border="0" align="center" cellpadding="3" cellspacing="3">
    <tr valign="baseline" bgcolor="#0099FF">
      <td colspan="6" align="right" nowrap><div align="center"><span class="Estilo2">MODIFICACION DATOS DE COBRANZAS CREDITOS</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="#FFFFCC">
      <td width="191" align="right" nowrap><span class="Estilo21">Escriba N&uacute;mero de C&eacute;dula: </span></td>
      <td><input name="cedula" type="text" id="cedula" size="15" maxlength="15"></td>
      <td colspan="4"><span class="Estilo23">Escriba el n&uacute;mero de c&eacute;dula y hacer click en el bot&oacute;n <span class="Estilo26">Buscar</span> </span></td>
    </tr>
    <tr valign="baseline" bgcolor="#0099FF">
      <td><div align="right"><span class="Estilo1 Estilo5"><strong>N&uacute;mero c&eacute;dula:</strong></span></div></td>
      <td><input name="id" type="text" id="id" value="<?php echo $cedula ?>" size="15" maxlength="15" readonly=""></td>
      <td colspan="4"><input name="nombre" type="text" id="nombre" value="<?php echo $nombre_completo; ?>" size="50" maxlength="50" readonly="" ></td>
    </tr>
    <tr valign="baseline" bgcolor="#0099FF">
      <td><div align="left" class="Estilo4 Estilo10 Estilo17 Estilo1">
          <div align="right"><span class="Estilo5">N&uacute;mero de Contrato:</span></div>
      </div></td>
      <td width="96"><input name="con" type="text" id="con" value="<?php echo $numero; ?>" size="6" maxlength="6" readonly="" ></td>
      <td width="130"><div align="right" class="Estilo18">Tipo:</div></td>
      <td width="79"><input name="tc" type="text" id="tc" value="<?php echo $tipo; ?>" size="4" maxlength="4" readonly="" ></td>
      <td width="59"><span class="Estilo18">Carpeta:</span></td>
      <td width="99"><input name="nc" type="text" id="nc" value="<?php echo $numero_carpeta; ?>" size="4" maxlength="4" ></td>
    </tr>
    <tr valign="baseline" bgcolor="#0099FF">
      <td align="right" nowrap><div align="left" class="Estilo4 Estilo10 Estilo17 Estilo1">
          <div align="right"><span class="Estilo5">Capital Per&iacute;odo actual </span></div>
      </div></td>
      <td><input name="cp" type="text" id="cp" value="<?php echo $capital_periodo; ?>" size="10" maxlength="10" readonly="" ></td>
      <td align="right" nowrap><span class="Estilo18">Intereses Cobro Prejur&iacute;dico </span></td>
      <td colspan="3"><input name="icp" type="text" id="icp" value="<?php echo $interes_prejuridico; ?>" size="10" maxlength="10" ></td>
    </tr>
    <tr valign="baseline" bgcolor="#0099FF">
      
      <td ><div align="right" class="Estilo18">Honorarios: </div></td>
      <td ><input name="ice" type="text" id="ice" value="<?php echo $interes_cobroejecutivo; ?>" size="10" maxlength="10" ></td>
	  <td ><div align="right" class="Estilo18"><span class="Estilo5">Deuda Total:</span></div></td>
      <td colspan="3"><input name="dt" type="text" id="dt" value="<?php echo $deuda_total; ?>" size="10" maxlength="10" ></td>
    </tr>
 
 
    <tr valign="baseline" bgcolor="#0099FF">
      <td align="right" nowrap><span class="Estilo18">Unidad Credito</span></td>
      <td bgcolor="#0099FF"><input name="un" type="text" id="un" value="<?php echo $unidad; ?>" size="5" maxlength="5"></td>
    
	  <td align="right" nowrap><span class="Estilo18">Codigo Gestion</span><input name="codiges" type="text" id="codiges" value="<?php echo $codiges; ?>" size="5" maxlength="5"></td>

      <td colspan="3"><span class="Estilo18"><?php echo $fecha_oficio ?> </span></td>
    </tr>
  </table>
  <table width="711" height="60" align="center">
  <tr>
    <td height="26" bgcolor="#0099FF"><div align="center">
        <input name="consultar" type="submit" id="consultar"value ="Buscar" style="font-family: Verdana; font-size: 8 pt; color: #000080; background-color: #C0C0C0; border-style: solid">
        <input name="modificar" type="submit" id="modificar" value ="Modificar" 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="window.location.href='menu_cobranzas_cre.php'" value="Atr&aacute;s">
        <input name="button" type="button" style="font-family: Verdana; font-size: 8 pt; color: #000080; background-color: #C0C0C0; border-style: solid" onClick="window.location.reload()" value="Actualizar">
    </div></td>
  </tr>
  <tr>
    <td height="26" bgcolor="#0099FF"><div align="center" class="Estilo1 Estilo24">Luego ub&iacute;que el puntero del mouse sobre el campo que desea modificar, reemplace y haga click en <span class="Estilo25">Modificar </span></div></td>
  </tr>
</table>
</form>  
</body>
</html>
<?php
/*
   <tr valign="baseline" bgcolor="#0099FF">
      <td align="right" nowrap><span class="Estilo18">Oficio de env&oacute; No. </span></td>
      <td bgcolor="#0099FF"><input name="on" type="text" id="on" value="<?php echo $oficio_numero; ?>" size="4" maxlength="4"></td>
      <td colspan="2"><div align="right" class="Estilo19">Fecha aaaa/mm/dd:</div></td>
      <td colspan="2"><span class="Estilo18">
    <input name="fecha_oficio" type="text" class="campo" id="fecha_oficio" value="0000-00-00" size="13" maxlength="10" >
      </span></td>
    </tr>