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/ingresar_bono.php
<?php 
require_once("mainfile.php");
include ("config.php");
global $dbi;
$linea = '-';
/*
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();*/
	
	
	
require_once("mainfile.php"); 
include ("config.php");
global $dbi;
$espacio = ' ';
$linea = '-';



require_once("Conectarse.php");

$Recordset2 = mysql_query('SELECT * FROM sucursal  order by nombre'); 

$row_Recordset2 = mysql_fetch_assoc($Recordset2);
$totalRows_Recordset2 = mysql_num_rows($Recordset2);
	
	

if(isset($_POST["guardar"]))
{

$control = mysql_query('SELECT cedula, contrato FROM bonos WHERE cedula  = "'.$_POST[ceduti].'" and contrato  = "' . $_POST[numcon] . '" ');
			if (!$control) {
				die('Invalid query: ' . mysql_error());
			}		 
list($ced, $contrato) = mysql_fetch_row($control);

if ((mysql_num_rows($control)==0))
 {


$termin = mysql_query("INSERT INTO bonos (cedula,nombre,contrato,tipocontrato,consignacion,banco,fecha_consig, nombre_ben,cedula_ben,cargo,valor_bono,estado,sucursal) VALUES ('".$_POST["ceduti"]."','".$_POST["nombreti"]."', '".$_POST["numcon"]."', '".$_POST["tipo"]."','".$_POST["numconsig"]."','".$_POST["banco"]."','".$_POST["consig"]."','".$_POST["nombreben"]."','".$_POST["ceduben"]."', '".$_POST["cargo"]."','".$_POST["valor"]."','0','".$_POST["sucursal"]."')");	
				
				if (!$termin) {
				die('Invalid query termin actuaciones: ' . mysql_error());
							}
 echo "<script>alert('Bono Guardado correctamente');</script>";
}
else
{
 echo "<script>alert('Ha este numero de Contrato ya se le pago Bono');</script>";
}

}

$control = mysql_query('SELECT cedula,nombre,numerocontrato,tipocontrato,fecha_afiliacion FROM cartera_serviasjudinet  WHERE cedula  = "'.$_GET["ced2"].'" and numerocontrato = "'.$_GET["numcon"].'"');
			if (!$control) {
				die('Invalid query: ' . mysql_error());
			}		 
list($ceduti,$nombreti,$numcon,$tipo,$fecha) = mysql_fetch_row($control);

 if ($tipo > 0)
				 {                 		
	$cont10 = mysql_query('SELECT codigo_contrato FROM planes_contratos WHERE codigo = "'.$tipo.'" ');
		  if (!$cont10) {
				die('Invalid query 42: ' . mysql_error());
			}
		list($tipo) = mysql_fetch_row($cont10);  
		}


?>
<!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>Ingreso Personas Juridicas</title>
<style type="text/css">
<!--
.est_cont5 {
	font-family: Verdana, Arial, Helvetica, sans-serif;
	font-size: 11px;
	font-style: normal;
	font-weight: normal;
	background-color: #EDFAF4;
	margin: 2px;
	padding: 2px;
	height: auto;
	width: auto;
	border: thin groove #E9AAF0;
	color: #C72350;
}
.color_fondo_sc {
	background-color: #DCE0E4;
}
.est_cont2 {
	font-family: Geneva, Arial;
	font-size: 12px;
	font-style: normal;
	font-weight: normal;

	background-color: #FFFFFF;
	height: 18px;
	width: auto;

}


.est_cont8 {
	font-family: Geneva, Arial, Helvetica, sans-serif;
	font-size: 13px;
	font-style: normal;
	font-weight: normal;
	color: #2B39EC;
	background-color: #FFFFFF;
	height: 19px;
	width: auto;
	border: thin solid #FABF85;
}


.est_cont6 {
	font-family: Georgia, "Times New Roman", Times, serif;
	font-size: 11px;
	font-style: normal;
	font-weight: normal;
	color: #006262;
	background-color: #EDFED3;
	margin: 1px;
	padding: 1px;
	height: auto;
	width: auto;
	border: thin solid #D9B6F8;
}
.sol_cre1 {
	font-family: Georgia, "Times New Roman", Times, serif;
	font-size: 12px;
	font-style: normal;
	font-weight: normal;
	color: #0B3495;
	background-color: #E6FAFF;
	margin: 1px;
	padding: 1px;
	height: 15px;
	width: auto;
	border: thin outset #56AD95;
}
.col_cre2 {
	font-family: Verdana, Arial, Helvetica, sans-serif;
	font-size: 12px;
	font-style: normal;
	font-weight: bold;
	color: #F92F0B;
	background-color: #B3D9F0;
	height: auto;
	width: auto;
	border: medium groove #FC9227;
}
.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;
}
.sol_cre11 {	font-family: "Times New Roman", Times, serif;
	font-size: 12px;
	background-color: #FFFFFF;
}
.est_cont51 {	font-family: Verdana, Arial, Helvetica, sans-serif;
	font-size: 9px;
	font-style: normal;
	font-weight: normal;
	background-color: #FFFFCC;
	margin: 2px;
	padding: 2px;
	height: auto;
	width: auto;
	border: thin groove #E9AAF0;
	color: #C72350;
}
.Estilo68 {
	color: #CC0000;
	font-weight: bold;
}
.Estilo69 {
	color: #FF0000;
	font-size: 24px;
}
.Estilo70 {font-size: 10px}
.Estilo71 {
	color: #FF0000;
	font-weight: bold;
}
-->
</style>
</head>

<body>
<form action="" method="post" enctype="multipart/form-data" name="form1"  id="form1">
   <div align="center" class="Estilo69" ><strong> Inter@sjudinet Ltda.</strong></div>

    <table align="center" width="728" border="" cellpadding="" cellspacing="" class="sol_cre11">
      <caption>
      <div align="center"><br />
        EMPRESA DE SERVICIOS JURIDICOS PREPAGADOS POR INTERNET <br />
        <span class="Estilo70">www.asjudinet.com<br/>
        </span> <br />
      </div>
	  <br />
	 <p> <span class="Estilo71">TITULAR</span> </p>
      </caption>
  
  <td width="213" align="right" ><strong>Nombre Titular</strong></td>
      <td colspan="2">
          <input name="nombreti" type="text" class="est_cont2" id="nombreti" value="<?php echo $nombreti ?>" size="55" maxlength="55" readonly="" />
     </td>
      <td width="140" height="21" align="right"><strong>Cedula</strong></td>
    <td width="88">
      <input name="ceduti" type="text" class="est_cont2" id="ceduti" value="<?php echo $ceduti ?>" size="12" maxlength="12" readonly="" />
    </td>
  </tr>
  <tr>  </tr>
  <tr>
    <td align="center"><strong>Contrato</strong>
      <input name="numcon" type="text" class="est_cont2" id="numcon" value="<?php echo $numcon ?>" size="10" maxlength="10" readonly="" />
	</td>
    <td width="276"  align="center"><strong>Tipo</strong>
      <input name="tipo" type="text" class="est_cont2" id="tipo" value="<?php echo $tipo ?>" size="10" maxlength="10" readonly="" /></td>
	 <td colspan="2" align="right"><strong>Fecha Afiliación</strong></td>
    <td width="88">
      <input name="fecha" type="text" class="est_cont2" id="fecha" value="<?php echo $fecha ?>" size="14" maxlength="14" readonly="" /></td>
  </tr>
     </tr>
	  <td height="21"><strong>Banco</strong>
      <input name="banco" type="text" class="est_cont2" id="banco" value="<?php echo $banco ?>" size="25" maxlength="25" /></td>
	  <td width="276" align="center" ><strong>Consignación N°</strong>
        <input name="numconsig" type="text" class="est_cont2" id="numconsig" value="<?php echo $numconsig ?>" size="20" maxlength="20" /></td>
  <td colspan="2" align="right"><strong>Fecha Consignación</strong></td>
      <td ><input name="consig" type="text" class="est_cont2" id="consig" value="0000-00-00" size="14" maxlength="14" /></td>
  </tr>
  </table>
  <br />
<P align="center"> <span class="Estilo71">BENEFICIARIO ACREEDOR</span></P>
 <table align="center" width="693" border="" cellpadding="" cellspacing="" class="sol_cre11">
  <td width="154" ><div align="right"><strong>Nombre Beneficiario</strong></div></td>
      <td width="253" ><div align="left">
          <input name="nombreben" type="text" class="est_cont2" id="nombreben" value="<?php echo $nombreben ?>" size="50" maxlength="50" />
      </div></td>
    <td width="92" height="21"><div align="right"><strong>Cedula</strong></div></td>
    <td width="184"><div align="left">
          <input name="ceduben" type="text" class="est_cont2" id="ceduben" value="<?php echo $ceduben ?>" size="20" maxlength="20"  />
      </div></td>
  </tr>
  <tr> </tr>
  <tr>
    <td><div align="right"><strong>Cargo</strong></div></td>
    <td ><select name="cargo" class="sel3" id="cargo">
      <option value="0">---SELECCIONE---</option>
      <option value="FUNCIONARIO">FUNCIONARIO</option>
      <option value="INDEPENDIENTE">INDEPENDIENTE</option>
      <option value="ASESOR COMERCIAL">ASESOR COMERCIAL</option>
    </select>
    </td>
    <td height="21"><div align="right"><strong>valor Bono </strong></div></td>
    <td width="184"><div align="left">
    <input name="valor" type="text" class="est_cont2" id="valor" value="<?php echo $valor ?>" size="30" maxlength="30" />
    </div></td>
  </tr>

 <tr bgcolor="#ECE9D8">
      <td  bgcolor="#FFFFFF" align="right"><b>Sucursal:</b></div></td>
  
   <td bgcolor="#FFFFFF">
<SELECT NAME="sucursal">
            <OPTION value="">--Sucursal--</OPTION>
            <?php
do {  
?>
        <option value="<?php echo $row_Recordset2['codigo']?>"><?php echo $row_Recordset2['nombre']?></option>
            <?php
} while ($row_Recordset2 = mysql_fetch_assoc($Recordset2));
  $rows = mysql_num_rows($Recordset2);
  if($rows > 0) {
      mysql_data_seek($Recordset2, 0);
	  $row_Recordset2 = mysql_fetch_assoc($Recordset2);
  }
?>
          </SELECT></td>

  
    </tr> 


 </table>
 <P align="center">
	<input name="guardar" type="submit"  class="Estilo68"  value ="GUARDAR" > 
  </P>
</form>

</body></html>