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/afinanciera/grab_deb.php
<?php
global $dbi;

require_once("../Conectarse.php");
	

$credi = mysql_query('SELECT cedula, codigo_militar, nombre, grado, direccion, telefono,  celular, ciudad,  email, entidad_laboral FROM cartera_serviasjudinet WHERE cedula = "' . $_GET["cedu"]  . '" and numerocontrato = "'.$_GET[numcon].'" ');
		  if (!$credi) {
				die('Invalid query 1: ' . mysql_error());
			}
			
	if ((mysql_num_rows($credi)==0)) 
	   {	
	
			 $credi = mysql_query('SELECT cedula,codigo, nombre,grado,direccion,telefono,celular,ciudad,email,empresa,cuotas_pendientes FROM creditos_serviasjudinet WHERE cedula = "' . $_GET["cedu"]  . '" ');
			  if (!$credi) {
					die('Invalid query 1: ' . mysql_error());
				}
			
		}
		
list($cedula, $codigo, $nombre, $grado, $direccion, $telefono, $celular, $ciudad, $email, $empre,$cuotas_pendientescre) = mysql_fetch_row($credi);

 $control = mysql_query('SELECT  fecha_credito, valor_credito, cuotas_credito, valor_cuota , cuotas_descontadas, cuotas_pendientes, cuenta_ahorros, banco, fecha_ultimo_descuento, empresa, proveedor FROM creditos_serviasjudinet WHERE cedula = "' . $_GET["cedu"]  . '" ');
		  if (!$control) {
				die('Invalid query 1: ' . mysql_error());
			}

		list($fechacre, $valcre, $cuocre, $valcuo, $cuodes, $cuopen, $cuenta, $banco, $fechaul, $empres, $prove) = mysql_fetch_row($control);
		

if($cuenta=="0")
{
$resu = mysql_query('SELECT cuenta_ahorros FROM creditos_serviasjudinet   WHERE cedula =   "' . $_GET["cedu"].'"');


list($cuenta) = mysql_fetch_row($resu);
	
	}

		
$control6 = mysql_query('SELECT saldonuevo,valorcuota,cuotaspendientes FROM cartera_serviasjudinet WHERE cedula = "' . $_GET["cedu"]  . '" and numerocontrato = "'.$_GET[numcon].'" ');
		  if (!$control6) {
				die('Invalid query 4: ' . mysql_error());
			}
		list($valjur,$valorcuota,$cuotaspend) = mysql_fetch_row($control6);
		
			$res3 = mysql_query('SELECT codigo, nombre  FROM entidad_laboral WHERE codigo = "' . $empre . '" '); 	
						if (!$res3) {
								die('Invalid query 78: ' . mysql_error());
							}	 			
                      list( $codf, $empre) = mysql_fetch_row($res3);
		
		
		
	$res13 = mysql_query('SELECT cuenta FROM cuentas_bancarias WHERE  cedula = "' . $_GET["cedu"]  . '"  '); 	
						if (!$res13) {
								die('Invalid query 78: ' . mysql_error());
							}	 			
                      list( $cuenta) = mysql_fetch_row($res13);	

		
		$res103 = mysql_query('SELECT saldo_nuevo,valor_cuota FROM creditos_serviasjudinet WHERE  cedula = "' . $_GET["cedu"]  . '"  '); 	
						if (!$res103) {
								die('Invalid query 78: ' . mysql_error());
							}	 			
                      list( $saldo_nuevo,$valor_cuota) = mysql_fetch_row($res103);	
					  
					  
					     
if(isset($_POST["grabar"]))
{
    $mt = floor(($mes_inicio + $numcuo)/12);
	$submt = (($mes_inicio + $numcuo)%12)-1;
	$at = $mt + $año_inicio;
	if($submt==0)
	{
		$submt = 12;
		$at = $at-1;
	}
	
	
	
	$debitos = mysql_query('SELECT *  FROM debitos WHERE cedula = "' . $_POST["cedula"] . '" '); 	
						if (!$debitos) {
								die('Invalid query 78: ' . mysql_error());
							}	
	
	
	if ((mysql_num_rows($debitos)==0)) 
	   {
	
	
			$resu3 = mysql_query('SELECT unidad, codigo FROM debitos_unidad  WHERE id =  "'.$_POST["unidt2"].'" ');
			if (!$resu3) {      
				die('Invalid query 4455: ' . mysql_error());
			}	 
			list($unidad_desc, $codigo_desc ) = mysql_fetch_row($resu3);
	
			
			$res3 = mysql_query('SELECT codigo, nombre  FROM entidad_laboral WHERE codigo = "' .$_POST["empresa"]. '" '); 	
						if (!$res3) {
								die('Invalid query 78: ' . mysql_error());
							}	 			
                      list( $codf, $entlab) = mysql_fetch_row($res3);

$dat = mysql_query("INSERT INTO debitos (cedula, nombres, dirrecion, telefono, celular, ciudad, email, entidad_laboral, banco, cuenta, tipo_debito,  valor_credito, valor_juridica, valor_debitar,valor_cuota_credito,valor_cuota_juridica, unidad_desc, codigo_desc, cuotas, cuotas_desc,  cuotas_pend, fecha_registro, causal_rechazo,fecha_debito, usuarios,situacion,estado) VALUES ('" . $_POST["cedula"] . "', '" . $_POST["nombre"] . "', '" . $_POST["direccion"] . "', '" . $_POST["telefono"] . "', '" . $_POST["celular"] . "', '" . $_POST["ciudad"] . "', '" . $_POST["email"] . "', '" .$_POST["empresa"]. "', '" . $_POST["ban"] . "', '" . $_POST["cuenta"] . "', '" . $_POST["tipodeb"] . "', '" . $_POST["valcre"] . "', '" . $_POST["valjur"] . "', '" . $_POST["val_deb"] . "','" . $_POST["valorcuotacredito"] . "','" . $_POST["valorcuotajuridi"] . "','" . "$unidad_desc". "', '" . "$codigo_desc". "', '" . $_POST["cuo_deb"] . "', '0','".$_POST["cuo_deb"]."', '" . $_POST["fecha_registro"] . "', '" . "$causal". "', '" . $_POST["fecha_deb"] . "' , '" . $_POST["tipousu"] . "' , '" . $_POST["situacion"] . "' , '1')");
				     if (!$dat) {  
				die('Invalid query datos insert: ' . mysql_error());  
			}
		
			 $msql1 = mysql_query("UPDATE  creditos_serviasjudinet  set ciudad = '" . $_POST[ciudad] . "', nombre = '" . $_POST[nombre] . "', direccion = '" . $_POST[direccion] . "', telefono = '" . $_POST[telefono] . "' , celular = '" . $_POST[celular] . "',  email = '" . $_POST[email] . "', cuenta_ahorros = '" . $_POST[cuenta] . "', banco = '" . $_POST[banco] . "' WHERE cedula = '" . $_POST[cedula] . "' ");
		    if (!$msql1) {
				die('Invalid query msql1 creditos: ' . mysql_error());
			}
	  
	/*		
	SE DESHABILITO PARA QUE SOLO CARGUE EN DEBITOS
	
	
 $msql1 = mysql_query("UPDATE  cartera_serviasjudinet set ciudad = '" . $_POST[ciudad] . "', nombre = '" . $_POST[nombre] . "', direccion = '" . $_POST[direccion] . "', telefono = '" . $_POST[telefono] . "' , celular = '" . $_POST[celular] . "',  email = '" . $_POST[email] . "', cuenta = '" . $_POST[cuenta] . "', banco = '" . $_POST[banco] . "' WHERE cedula = '" . $_POST[cedula] . "' ");
		    if (!$msql1) {
				die('Invalid query msql1 cart4a: ' . mysql_error());
			}
			
			*/
			
		//////////////
		
		$msql1 = mysql_query("UPDATE  cuentas_bancarias set cuenta = '" . $_POST["cuenta"] . "', banco = '" . $_POST["ban"] . "' WHERE cedula = '" . $_POST[cedula] . "' ");
		    if (!$msql1) {
				die('Invalid query msql1 cuentas_bancarias: ' . mysql_error());
			}	
			
			////////////////
			
			
            echo "<script>alert('La informacion fue grabada correctamente');</script>";

echo "<SCRIPT LANGUAGE='javascript'>window.location.href='consul_deb.php?'</SCRIPT>";			

}else
{
	
	
 echo "<script>alert('Afiliado ya tiene debito');</script>";
 echo "<SCRIPT LANGUAGE='javascript'>window.location.href='consul_deb.php?'</SCRIPT>";	
}			
				 
}

$sql = mysql_query('SELECT * FROM entidad_laboral order by nombre '); 	
			if (!$sql) {
				die('Invalid query 87: ' . mysql_error());
			}
$row_sql = mysql_fetch_assoc($sql);
$totalRows_sql = mysql_num_rows($sql);

$sql2 = mysql_query('SELECT * FROM debitos_unidad order by codigo ');
			if (!$sql2) {
				die('Invalid query 4141: ' . mysql_error());
			}
$row_sql2 = mysql_fetch_assoc($sql2);
$totalRows_sql2 = mysql_num_rows($sql2);  

/*$sql6 = mysql_query('SELECT * FROM debito_causal  order by codigo ');
			if (!$sql6) {
				die('Invalid query 77: ' . mysql_error());
			}
$row_sql6 = mysql_fetch_assoc($sql6);
$totalRows_sql6 = mysql_num_rows($sql6);*/
  

?> 
<!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>Ingresar Debito</title>
<style type="text/css">
<!--
.Estilo15 {	font-size: 12px;
	color: #000000;
	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: 11px;
	color: #5151FF;
	background-color: #C4E4FD;
	border: thin solid #009999;
	height: 18px;
	width: auto;
}
.datos3 {
	font-family: Arial, Helvetica, sans-serif;
	font-size: 11px;
	font-style: normal;
	font-weight: normal;
	color: #FF3300;
	background-color: #A6ECD7;
	margin: 4px;
	padding: 4px;
	border: medium groove #CCCCFF;
}
body {
	background-color: #DCFAF3;
}
.campo {background-color: #FFFFCC; border:1px solid #990000; font-family:Arial;  font-size:18px; height: inherit}
.Estilo50 {color: #CC3333;
	font-family: "Arial Narrow";
	font-weight: bold;
}
.Estilo1 {	color: #000099;
	font-size: 24px;
	font-style: italic;
}
.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;
}
.datos2 {
	font-family: "Courier New", Courier, monospace;
	font-size: 10px;
	font-style: normal;
	font-weight: normal;
	color: #0033FF;
	background-color: #FFE2C6;
	margin: 2px;
	padding: 3px;
	border: medium doble #EEBFEB;
}
.go {
	font-family: "Times New Roman", Times, serif;    
	font-size: 9px;
	font-style: normal;
	color: #FF6633;
	background-color: #FBDCBD;
	padding: 1px;
	height: auto;
	width: auto;
	border-top-style: solid;
	border-right-style: solid;
	border-bottom-style: solid;
	border-left-style: solid;
}
.Estilo8 {	font-size: 20px;
	font-weight: bold;
}
.datos1 {	font-family: Geneva, Arial, Helvetica, sans-serif;
	font-size: 16px;
	font-style: normal;
	text-decoration: blink;
	background-color: #CCFFCC;
	margin: 5px;
	padding: 7px;
	height: auto;
	width: auto;
	border: thin solid #0099FF;
}
.datos1 {	font-family: Georgia, "Times New Roman", Times, serif;
	font-size: 16px;
	background-color: #FDE0C1;
	margin: 2px;
	padding: 3px;
	border: medium doble #DBAED7;
}
.datos1 {
	font-family: Georgia, "Times New Roman", Times, serif;
	font-size: 11px;
	font-weight: normal;
	background-color: #B8F5E8;
	margin: 4px;
	padding: 5px;
	border: thin outset #009999;
}
.Estilo51 {font-size: 16px}
.Estilo56 {font-size: 11px}
.campo11 {background-color: #B7FFFF;
	border: thin dashed #B6B6B6;
}
.campo11 {font-family: "Courier New", Courier, monospace;
	font-size: 16px;
	font-style: normal;
	font-weight: bold;
	background-color: #E1EFFD;
	border: thin doble #009999;
}
.campo11 {	font-family: "Courier New", Courier, monospace;
	font-size: 12px;
	color: #5151FF;
	background-color: #C4E4FD;
	border: thin solid #009999;
	height: 20px;
	width: auto;
}
.datos21 {	font-family: "Courier New", Courier, monospace;
	font-size: 12px;
	font-style: normal;
	font-weight: normal;
	color: #0033FF;
	background-color: #FFE2C6;
	margin: 2px;
	padding: 3px;
	border: medium doble #EEBFEB;
}
.est_cont2 {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;
}
.Estilo58 {
	color: #000066;
	font-weight: bold;
	font-size: 14px;
}
.Estilo59 {
	font-size: 10pt;
	font-weight: bold;
}
.Estilo69 {color: #000066; font-weight: bold; font-size: 10pt; }
.Estilo75 {font-size: 10pt; color: #000066; }
.Estilo84 {font-size: 12px; color: #000099; font-weight: bold; }
.Estilo85 {font-size: 10pt; color: #000099; font-weight: bold; }
.Estilo86 {font-size: 12px; color: #000099; }
.Estilo87 {color: #0000CC}
-->


</style>
</head>


<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>")
}					

function Valida_Fecha(formulario)
{

  if (formulario.valcuota.value == "")
  {
    alert("Falta Seleccionar Entidad Laboral");
    formulario.valcuota.focus();
    return (false);
  }
  
      if (formulario.val_deb.value == "")
  {
    alert("Falta digitar valor a debitar44564465");
    formulario.val_deb.focus();
    return (false);
  }
  
  
    if (formulario.valcuota.value == "")
  {
    alert("Falta digitar valor de la Cuota");
    formulario.valcuota.focus();
    return (false);
  }
  

      if (formulario.cuo_deb.value == "")
  {
    alert("Falta digitar número de cuotas a debitar");
    formulario.cuo_deb.focus();
    return (false);
  }
  
       if (formulario.unidt2.value == "")
  {
    alert("Falta seleccionar unidad de Descuento");
    formulario.unidt2.focus();
    return (false);
  }
  
       if (formulario.fecha_deb.value == "00")
  {
    alert("Falta digitar fecha a debitar");
    formulario.fecha_deb.focus();
    return (false);
  }
  
      if (formulario.ban.value == "")
  {
    alert("Falta seleccionar Banco");
    formulario.ban.focus();
    return (false);
  }
      if (formulario.cuenta.value == "")
  {
    alert("Falta digitar Número de cuenta");
    formulario.cuenta.focus();
    return (false);
  }
  
     if (formulario.tipodeb.value == "")
  {
    alert("Falta seleccionar tipo de Debito");
    formulario.tipodeb.focus();
    return (false);
  }


    if (formulario.tipousu.value == "")
  {
    alert("Falta seleccionar Usuario");
    formulario.tipousu.focus();
    return (false);
  }


    if (formulario.situacion.value == "")
  {
    alert("Falta seleccionar Situacion");
    formulario.situacion.focus();
    return (false);
  }


  if (confirm("Es correcta está información "))
  {   
    return (true);
  }
  else
  {
   return (false);
   }

  return (true);
}

var timerID = null;
var timerRunning = false; 
var id,pause=0,position=0; 
function stopclock () 
{
    if(timerRunning) 
        clearTimeout(timerID); 
    timerRunning = false;
}
function showtime ()
{ 
    var now = new Date();
    var hours = now.getHours(); 
    var minutes = now.getMinutes(); 
    var seconds = now.getSeconds() 
    var timeValue = "" + ((hours >12) ? hours -12 :hours)
    timeValue += ((minutes < 10) ? ":0" : ":") + minutes
    timeValue += ((seconds < 10) ? ":0" : ":") + seconds
    timeValue += (hours >= 12) ? " pm" : " am" 
    document.formulario.Hora_Envio.value = timeValue;
    timerID = setTimeout("showtime()",1000);
    timerRunning = true; 
}
function startclock ()
{ 
    stopclock ();
    showtime ();
}

</SCRIPT> 

<body>

<form action="" method="post" name="formulario" onSubmit="return Valida_Fecha(this)">

  <table width="763"  align="center" border="3" cellpadding="3" cellspacing="3" >
    <caption>
    <div align="center"><strong><span class="Estilo56"><br />
      </span></strong>
        <table width="213" border="3" cellpadding="3" cellspacing="3" >
          <caption>
          <span class="Estilo1">INGRESAR DEBITOS SERVIASJUDINET</span>
          </caption>
      </table>
      <strong><br />
      </strong><br />
        <table width="817" " " border="3" cellpadding="3" cellspacing="3" class="campo1">
          <caption>
          <span class="Estilo8"><br />
          <span class="Estilo51">DATOS BASICOS </span></span>
          </caption>
          <tr>
            <td width="89" align="center" bgcolor="#FCFECD" class="Estilo15"><span class="Estilo75">Nombres:</span></td>
            <td colspan="3" bgcolor="#FCFECD"><div align="left">
                <input name="nombre" type="text" class="Estilo15" id="nombre" value="<?php echo $nombre ?>" size="75" maxlength="75"  />
            </div></td>
          </tr>
          <tr>
            <td bgcolor="#FCFECD" class="Estilo15"><div align="center" class="Estilo75">Cedula: </div></td>
            <td width="178" bgcolor="#FCFECD"><input name="cedula" type="text" class="Estilo15" id="cedula" value="<?php echo $cedula ?>" size="15" maxlength="15" readonly="" /></td>
            <td width="131" bgcolor="#FCFECD" class="Estilo15"><div align="center" class="Estilo58 Estilo59">Codigo: </div></td>
            <td width="306" bgcolor="#FCFECD"><div align="left">
                <input name="codigo" type="text" class="Estilo15" id="codigo" value="<?php echo $codigo ?>" size="15" maxlength="15"  />
            </div></td>
          </tr>
          <tr>
            <td bgcolor="#FCFECD" class="Estilo15"><div align="center" class="Estilo75">Ciudad: </div></td>
            <td bgcolor="#FCFECD"><input name="ciudad" type="text" class="Estilo15" id="ciudad" value="<?php echo $ciudad ?>" size="15" maxlength="15"  /></td>
            <td bgcolor="#FCFECD" class="Estilo15"><div align="center" class="Estilo69">Direccion: </div></td>
            <td bgcolor="#FCFECD"><input name="direccion" type="text" class="Estilo15" id="direccion" value="<?php echo $direccion ?>" size="45" maxlength="45"  /></td>
          </tr>
          <tr>
            <td bgcolor="#FCFECD" class="Estilo15"><div align="center" class="Estilo75">Celular: </div></td>
            <td bgcolor="#FCFECD"><input name="celular" type="text" class="Estilo15" id="celular" value="<?php echo $celular ?>" size="15" maxlength="15" /></td>
            <td bgcolor="#FCFECD" class="Estilo15"><div align="center" class="Estilo69">Telefono: </div></td>
            <td bgcolor="#FCFECD"><div align="left">
                <input name="telefono" type="text" class="Estilo15" id="telefono" value="<?php echo $telefono ?>" size="15" maxlength="15"/>
            </div></td>
          </tr>

          <tr>
            <td bgcolor="#FCFECD" class="Estilo15"><div align="center" class="Estilo75">Valor Credito: </div></td>
            <td bgcolor="#FCFECD"><input name="valcre" type="text" class="Estilo15" id="valcre" value="<?php echo $saldo_nuevo ?>" size="15" maxlength="15" /></td>
            <td bgcolor="#FCFECD" class="Estilo15"><div align="center" class="Estilo69">Valor Juridica: </div></td>
            <td bgcolor="#FCFECD"><div align="left">
                <input name="valjur" type="text" class="Estilo15" id="valjur" value="<?php echo $valjur ?>" size="15" maxlength="15"/>
            </div></td>
          </tr>
          
            <tr>
            <td bgcolor="#FCFECD" class="Estilo15"><div align="center" class="Estilo75">Valor Cuota Credito: </div></td>
            <td bgcolor="#FCFECD"><input name="valorcuotacredito" type="text" class="Estilo15" id="valorcuotacredito" value="<?php echo $valor_cuota ?>" size="15" maxlength="15" /></td>
            <td bgcolor="#FCFECD" class="Estilo15"><div align="center" class="Estilo69">Valor Cuota Juridica: </div></td>
            <td bgcolor="#FCFECD"><div align="left">
                <input name="valorcuotajuridi" type="text" class="Estilo15" id="valorcuotajuridi" value="<?php echo $valorcuota?>" size="15" maxlength="15"/>
            </div></td>
          </tr>
          
            
          
          
          
                   
          
          <tr>
            <td bgcolor="#FCFECD" class="Estilo15"><div align="center" class="Estilo75">Email: </div></td>
            <td colspan="0" bgcolor="#FCFECD"><div align="left">
                <input name="email" type="text" class="Estilo15" id="email" value="<?php echo $email ?>" size="35" maxlength="35"  />
            </div></td>
              <td bgcolor="#FCFECD" class="Estilo15"><div align="center" class="Estilo69">Cuotas Pendientes Juridica: </div></td>
            <td bgcolor="#FCFECD"><div align="left">
                <input name="cuotas" type="text" class="Estilo15" id="cuotas" value="<?php echo $cuotaspend?>" size="15" maxlength="15"/>
            
            
          </tr>
          <tr>
          
           <td height="36" bgcolor="#FCFECD" class="Estilo15" ><div align="center" class="Estilo50"><strong>Valor Cuota Credito:</strong></div></td>
            <td height="36" bgcolor="#FCFECD"><input name="valorcuotacre" type="text"  class="Estilo15" id="valorcuotacre" value="<?php echo $valcuo?>" size="30" maxlength="30" />      
          
          
            
            <td width="12" bgcolor="#FCFECD" class="Estilo15"><div align="center" class="Estilo50">Cuotas Pendientes Credito:</div></td>
            <td bgcolor="#FCFECD"><div align="left">
                <input name="cuotascredito" type="text" class="Estilo15" id="cuotascredito" value="<?php echo $cuotas_pendientescre?>" size="15" maxlength="15"/>
                 
       
          </tr>
          
            <tr>
            <td height="36" bgcolor="#FCFECD" class="Estilo50" ><div align="center" class="Estilo75">Entidad Laboral: </div></td>
            <td height="36" colspan="" bgcolor="#FCFECD"><input name="empresa" type="text"  class="Estilo15" id="empresa" value="<?php echo $empre ?>" size="30" maxlength="30" />      
            
           
            <td colspan="3"  bgcolor="#FCFECD"><p>
               
            </p></td>
          </tr>
          
          
        </table>
      <strong><br />
        <br />
        <span class="Estilo51">CAPTURAR DEBITOS </span><br />
        <br />
      </strong>
        <label></label>
    </div>
    </caption>
    <tr>
      <td width="146" bgcolor="#FFFFFF" class="Estilo51"><div align="center" class="Estilo84">
          <div align="right">Valor Cuota a Debitar : </div>
      </div></td>
      <td width="322" bgcolor="#FFFFFF">
          <input name="val_deb" type="text" class="Estilo15" id="val_deb" size="15" maxlength="15" />

      </span> </td>
      <td width="60" bgcolor="#FFFFFF" class="Estilo51"><div align="center" class="Estilo86">
          <div align="right"><strong>Cuotas a Debitar: </strong></div>
      </div></td>
      <td width="182" bgcolor="#FFFFFF"><div align="left">
          <input name="cuo_deb" type="text" class="Estilo15" id="cuo_deb" size="15" maxlength="15" />
      </div></td>
    </tr>
    <tr>
      <td height="26" bgcolor="#FFFFFF" class="Estilo51"><div align="center" class="Estilo84">
          <div align="right">Unidad y Codigo Descuento  :</div>
      </div></td>
      <td bgcolor="#FFFFFF"><label> </label>
          <div align="left">
            <select name="unidt2" class="Estilo15" id="unidt2">
              <option value="">--SELECIONE UNIDAD--</option>
              <?php
     do {   
?>
              <option value="<?php echo $row_sql2['id'];?>"><?php echo $row_sql2['unidad'].'-'.$row_sql2['codigo']?></option>
              <?php
} while ($row_sql2 = mysql_fetch_assoc($sql2));
  $rows2 = mysql_num_rows($sql2);
  if($rows2 > 0) {
      mysql_data_seek($sql2, 0);
       $row_sql2 = mysql_fetch_assoc($sql2);
  }
?>
            </select>
      </div></td>
      <td bgcolor="#FFFFFF" class="Estilo51"><div align="center" class="Estilo86">
          <div align="right"><strong>Dia a Debitar: </strong></div>
      </div></td>
      <td bgcolor="#FFFFFF"><div align="left">
          <input name="fecha_deb" type="text" class="Estilo15" id="fecha_deb" value="00" size="4" maxlength="2" />
      </div></td>
    </tr>
	  <tr width="">
        <td bgcolor="#FFFFFF" class="Estilo51" ><div align="center" class="Estilo85">
          <div align="right">Banco: </div>
        </div></td>
            <td width="322" bgcolor="#FFFFFF"><select name="ban" class="Estilo15">
                <option value="" selected>--TIPO DE BANCO--</option>
                <option value="BBVA">BBVA</option>
                <option value="AGRARIO">AGRARIO</option>
                <option value="CAJA SOCIAL BCSC">CAJA SOCIAL BCSC</option>
                <option value="GNB SUDAMERIS ">GNB SUDAMERIS </option>
                <option value="POPULAR ">POPULAR </option>
                <option value="SANTANDER COLOMBIA">SANTANDER COLOMBIA </option>
                <option value="AVVILLAS ">AVVILLAS </option>
                <option value="BOGOTA ">BOGOTA </option>
                <option value="OCCIDENTE ">OCCIDENTE </option>
                <option value="BANCOLOMBIA ">BANCOLOMBIA </option>
                <option value="CITIBANK ">CITIBANK </option>
                <option value="COLPATRIA ">COLPATRIA </option>
                <option value="COOMEVA ">COOMEVA </option>
                <option value="DAVIVIENDA ">DAVIVIENDA </option>
                <option value="PAGOS POR OFICINA">PAGOS POR OFICINA </option>
                <option value="ITAU">ITAU </option>
                </select>            </td>
        <td width="60" bgcolor="#FFFFFF" class="Estilo51"><div align="center" class="Estilo85">
          <div align="right">Cuenta N°: </div>
        </div></td>
            <td bgcolor="#FFFFFF"><div align="left">
                <input name="cuenta" type="text" class="Estilo15" id="cuenta" value="<?php echo $cuenta ?>" size="30" maxlength="30"/>
        </div></td>
    </tr>
		  <tr width="">
            <td bgcolor="#FFFFFF" class="Estilo51" ><div align="center" class="Estilo85">
              <div align="right">Tipo: </div>
            </div></td>
            <td  colspan="1" bgcolor="#FFFFFF"><select name="tipodeb" class="Estilo15">
                <option value="" selected>--TIPO DE DEBITO--</option>
                <option value="CREDITO">CREDITO</option>
                <option value="JURIDICA">JURIDICA</option>
                <option value="CUOTA AFILIACION">CUOTA AFILIACION</option>
                <option value="OTROS">OTROS</option>
                <option value="MIXTO">MIXTO</option>
                
            </select>           
            
            
            
           <td width="60" bgcolor="#FFFFFF" class="Estilo51"><div align="center" class="Estilo85">
          <div align="right">Usuario: </div>
        </div></td>
                        
             <td  colspan="2" bgcolor="#FFFFFF"><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>
            </td>
            
          </tr>
          
            <tr width="">
            <td bgcolor="#FFFFFF" class="Estilo51" ><div align="center" class="Estilo85">
              <div align="right">Situacion: </div>
            </div></td>
            <td  colspan="1" bgcolor="#FFFFFF"><select name="situacion" class="Estilo15">
                <option value="" selected>--TIPO DE SITUACION--</option>
                <option value="NORMAL">NORMAL</option>
                <option value="ESPECIAL">ESPECIAL</option>
          >
                
            </select>           
            
            
            
              <td bgcolor="#FFFFFF" class="Estilo51"><div align="center" class="Estilo86">
       
      </div></td>
      <td bgcolor="#FFFFFF"><div align="left"></div></td>
            
          
            
          </tr>
          
          
          
  </table>
  
  
  
  <p align="center">
    <input name="grabar" type="submit" class="Estilo3" id="grabar" value="GRABAR DEBITO" />
  </p>
  <p align="center">
    <input name="menu2" type="button" class="Estilo50" id="menu2" onclick="window.location.href='menu_cartera_debito.php'" value="IR AL MENU" />
  </p>
</form>
</body>
</html>
<!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>Ingresar Debito</title>
<style type="text/css">
<!--
.Estilo15 {	font-size: 12px;
	color: #000000;
	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: 11px;
	color: #5151FF;
	background-color: #C4E4FD;
	border: thin solid #009999;
	height: 18px;
	width: auto;
}
.datos3 {
	font-family: Arial, Helvetica, sans-serif;
	font-size: 11px;
	font-style: normal;
	font-weight: normal;
	color: #FF3300;
	background-color: #A6ECD7;
	margin: 4px;
	padding: 4px;
	border: medium groove #CCCCFF;
}
body {
	background-color: #DCFAF3;
}
.campo {background-color: #FFFFCC; border:1px solid #990000; font-family:Arial;  font-size:11px; height: inherit}
.Estilo50 {color: #CC3333;
	font-family: "Arial Narrow";
	font-weight: bold;
}
.Estilo1 {	color: #000099;
	font-size: 24px;
	font-style: italic;
}
.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;
}
.datos2 {
	font-family: "Courier New", Courier, monospace;
	font-size: 10px;
	font-style: normal;
	font-weight: normal;
	color: #0033FF;
	background-color: #FFE2C6;
	margin: 2px;
	padding: 3px;
	border: medium doble #EEBFEB;
}
.go {
	font-family: "Times New Roman", Times, serif;
	font-size: 9px;
	font-style: normal;
	color: #FF6633;
	background-color: #FBDCBD;
	padding: 1px;
	height: auto;
	width: auto;
	border-top-style: solid;
	border-right-style: solid;
	border-bottom-style: solid;
	border-left-style: solid;
}
.Estilo8 {	font-size: 20px;
	font-weight: bold;
}
.datos1 {	font-family: Geneva, Arial, Helvetica, sans-serif;
	font-size: 16px;
	font-style: normal;
	text-decoration: blink;
	background-color: #CCFFCC;
	margin: 5px;
	padding: 7px;
	height: auto;
	width: auto;
	border: thin solid #0099FF;
}
.datos1 {	font-family: Georgia, "Times New Roman", Times, serif;
	font-size: 16px;
	background-color: #FDE0C1;
	margin: 2px;
	padding: 3px;
	border: medium doble #DBAED7;
}
.datos1 {
	font-family: Georgia, "Times New Roman", Times, serif;
	font-size: 11px;
	font-weight: normal;
	background-color: #B8F5E8;
	margin: 4px;
	padding: 5px;
	border: thin outset #009999;
}
.Estilo51 {font-size: 16px}
.Estilo56 {font-size: 11px}
.campo11 {background-color: #B7FFFF;
	border: thin dashed #B6B6B6;
}
.campo11 {font-family: "Courier New", Courier, monospace;
	font-size: 16px;
	font-style: normal;
	font-weight: bold;
	background-color: #E1EFFD;
	border: thin doble #009999;
}
.campo11 {	font-family: "Courier New", Courier, monospace;
	font-size: 12px;
	color: #5151FF;
	background-color: #C4E4FD;
	border: thin solid #009999;
	height: 20px;
	width: auto;
}
.datos21 {	font-family: "Courier New", Courier, monospace;
	font-size: 12px;
	font-style: normal;
	font-weight: normal;
	color: #0033FF;
	background-color: #FFE2C6;
	margin: 2px;
	padding: 3px;
	border: medium doble #EEBFEB;
}
.est_cont2 {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;
}
.Estilo58 {
	color: #000066;
	font-weight: bold;
	font-size: 14px;
}
.Estilo59 {
	font-size: 10pt;
	font-weight: bold;
}
.Estilo69 {color: #000066; font-weight: bold; font-size: 10pt; }
.Estilo50 {color: #990033; font-weight: bold; font-size: 12pt; }
.Estilo75 {font-size: 10pt; color: #000066; }
.Estilo84 {font-size: 12px; color: #000099; font-weight: bold; }
.Estilo85 {font-size: 10pt; color: #000099; font-weight: bold; }
.Estilo86 {font-size: 12px; color: #000099; }
.Estilo87 {color: #0000CC}
-->


</style>
</head>


<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>")
}					
/////////////////////  ACA FUNCIONA LA VALIDACION/////////////////
function Valida_Fecha(formulario)
{

  
     if (formulario.valcre.value == "")
  {
    alert("Falta digitar Valor Credito");
    formulario.valcre.focus();
    return (false);
  }
  
  
    if (formulario.valjur.value == "")
  {
    alert("Falta digitar Valor Juridica");
    formulario.valjur.focus();
    return (false);
  }
  
  if (formulario.valorcuotacredito.value == "")
  {
    alert("Falta digitar Valor De La Cuota Credito");
    formulario.valorcuotacredito.focus();
    return (false);
  }
  
  if (formulario.valorcuotajuridi.value == "")
  {
    alert("Falta digitar Valor Cuota Juridica");
    formulario.valorcuotajuridi.focus();
    return (false);
  }
  
  
   
      if (formulario.val_deb.value == "")
  {
    alert("Falta digitar valor a debitar");
    formulario.val_deb.focus();
    return (false);
  }
  

  

      if (formulario.cuo_deb.value == "")
  {
    alert("Falta digitar número de cuotas a debitar");
    formulario.cuo_deb.focus();
    return (false);
  }
  
       if (formulario.unidt2.value == "")
  {
    alert("Falta seleccionar unidad de Descuento");
    formulario.unidt2.focus();
    return (false);
  }
  
       if (formulario.fecha_deb.value == "00")
  {
    alert("Falta digitar fecha a debitar");
    formulario.fecha_deb.focus();
    return (false);
  }
  
      if (formulario.ban.value == "")
  {
    alert("Falta seleccionar Banco");
    formulario.ban.focus();
    return (false);
  }
      if (formulario.cuenta.value == "")
  {
    alert("Falta digitar Número de cuenta");
    formulario.cuenta.focus();
    return (false);
  }
  
     if (formulario.tipodeb.value == "")
  {
    alert("Falta seleccionar tipo de Debito");
    formulario.tipodeb.focus();
    return (false);
  }


    if (formulario.tipousu.value == "")
  {
    alert("Falta seleccionar Usuario");
    formulario.tipousu.focus();
    return (false);
  }


    if (formulario.situacion.value == "")
  {
    alert("Falta seleccionar Situacion");
    formulario.situacion.focus();
    return (false);
  }


  if (confirm("Es correcta está información "))
  {   
    return (true);
  }
  else
  {
   return (false);
   }

  return (true);
}

var timerID = null;
var timerRunning = false; 
var id,pause=0,position=0; 
function stopclock () 
{
    if(timerRunning) 
        clearTimeout(timerID); 
    timerRunning = false;
}
function showtime ()
{ 
    var now = new Date();
    var hours = now.getHours(); 
    var minutes = now.getMinutes(); 
    var seconds = now.getSeconds() 
    var timeValue = "" + ((hours >12) ? hours -12 :hours)
    timeValue += ((minutes < 10) ? ":0" : ":") + minutes
    timeValue += ((seconds < 10) ? ":0" : ":") + seconds
    timeValue += (hours >= 12) ? " pm" : " am" 
    document.formulario.Hora_Envio.value = timeValue;
    timerID = setTimeout("showtime()",1000);
    timerRunning = true; 
}
function startclock ()
{ 
    stopclock ();
    showtime ();
}

</SCRIPT>