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

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

	if($GrupoOpciones1==1||$GrupoOpciones1==-1)
	{
				
				if ($planet == "")
				{
				$ms88 = mysql_query('SELECT codigo_contrato FROM planes_contratos WHERE codigo_contrato  = "' . $_POST["plane"]  . '" ');
						if (!$ms88) {
				die('Invalid query: ' . mysql_error());
							}
				list($planeta) = mysql_fetch_row($ms88);
				}
				else
				{
				$msss = mysql_query('SELECT codigo_contrato  FROM planes_contratos WHERE nombre_plan  = "' . $_POST["planet"]  . '" ');
						if (!$msss) {
				die('Invalid query: ' . mysql_error());
							}
				list($planeta) = mysql_fetch_row($msss);
				}
				
				if($sutar == "")
				{
					$su45 = mysql_query('SELECT codigo FROM sucursal  WHERE nombre  =  "' . $_POST["susu"]  . '" ');
			if (!$su45) {
				die('Invalid query susu: ' . mysql_error());
						}
				list($sutar) = mysql_fetch_row($su45);
				
				}
				else
				{
				$su78 = mysql_query('SELECT codigo FROM sucursal  WHERE codigo  =  "' . $_POST["sutar"]  . '" ');
			if (!$su78) {
				die('Invalid query susu: ' . mysql_error());
						}
				list($sutar) = mysql_fetch_row($su78);
				}
				
				if($asesor == "")
				{
					$su45 = mysql_query('SELECT codigo FROM vendedores  WHERE vendedor  =  "' . $_POST["aset"]  . '" ');
						if (!$su45) {
							die('Invalid query susu: ' . mysql_error());
									}
				list($asesor) = mysql_fetch_row($su45);
				
				}
				else
				{
				$su45 = mysql_query('SELECT codigo FROM vendedores  WHERE vendedor  =  "' . $_POST["asesor"]  . '" ');
						if (!$su45) {
							die('Invalid query susu: ' . mysql_error());
									}
				list($asesor) = mysql_fetch_row($su45);
				}

	$mssql = mysql_query("UPDATE  personas_juridicas set nit = '" . $_POST[nite] . "', razon= '" . $_POST[razon] . "', sigla= '" . $_POST[sigla] . "', sucursal = '" .$sutar. "', ciudad= '" . $_POST[ciudad] . "',  direccion= '" . $_POST[diret] . "', telefono= '" . $_POST[telefono] . "',  email= '" . $_POST[email] . "', fecha = '" . $_POST[fecha] . "', plan = '" .$planeta. "',  valor_contrato= '" . $_POST[valcon] . "', valor_definido= '" . $_POST[valdef] . "', iva= '" . $_POST[iva] . "', retefuente= '" . $_POST[retefuente] . "', valor_mas_iva= '" . $_POST[valiva] . "', valor_menos_retefu= '" . $_POST[valrete] . "', cuota_inicial= '" . $_POST[cuotaini] . "', saldo_financiar= '" . $_POST[saldofin] . "',  cuotas= '" . $_POST[cuotas] . "', valor_cuota = '" . $_POST[valcuo] . "', cuenta= '" . $_POST[cuenta] . "', banco= '" . $_POST[banco] . "', numero_contrato= '" . $_POST[numcontrato] . "', asesor= '" .$asesor. "',  objetivo= '" . $_POST[objetivo] . "',  sucursal_banco= '" . $_POST[sucuban] . "', registro_mercan= '" . $_POST[registro] . "', camara= '" . $_POST[camara] . "', director_comer = '" . $_POST[director] . "', estado = '" . $_POST[GrupoOpciones1] . "' WHERE nit= '" . $_POST[nite] . "' and estado = '0' ");

			
 echo "<script>alert('Aprobada la Solicitud Juridica');</script>";	
		
	}
	else
	{
		echo "<script>alert('Debe Seleccionar aprobar o Rechazar');</script>";
	}
	
}

		
$control = mysql_query('SELECT nit, razon, sigla, sucursal, ciudad, direccion, telefono, email, fecha, plan , valor_contrato, valor_definido, iva, retefuente, valor_mas_iva, valor_menos_retefu,   cuota_inicial , saldo_financiar, cuotas, valor_cuota, cuenta, banco, numero_contrato, asesor, objetivo, sucursal_banco, registro_mercan, camara FROM personas_juridicas   WHERE nit = "' . $HTTP_GET_VARS["cedula"]  . '"  ');
			if (!$control) {
				die('Invalid query nit: ' . mysql_error());
			}		 
		list($nit, $razon, $sigla,  $sucursal, $ciudad, $diret, $telefono, $email, $fecha1, $planes, $valcon, $valdef, $iva, $retefuente, $valiva, $valrete, $cuotaini, $saldofin, $cuotas, $valcuo, $cuenta, $banco, $numcontrato, $aset, $objetivo, $sucuban, $registro, $camara ) = mysql_fetch_row($control);
		
					
$tel = mysql_query('SELECT vendedor FROM vendedores  WHERE codigo = "' . "$aset". '" ');
			if (!$tel) {
				die('Invalid query: ' . mysql_error());
			}
			list($aset) = mysql_fetch_row($tel);

			
$mssql1 = mysql_query('SELECT nombre FROM sucursal  WHERE codigo = "' . "$sucursal". '" ');
			if (!$mssql1) {
				die('Invalid query: ' . mysql_error());
			}
			list($susu) = mysql_fetch_row($mssql1);
	
	$sql7 = mysql_query('SELECT * FROM planes_contratos order by codigo_contrato  ');
			if (!$sql7) {
				die('Invalid query: ' . mysql_error());
			} 
$row_sql7 = mysql_fetch_assoc($sql7);
$totalRows_sql7 = mysql_num_rows($sql7);	

$sql4 = mysql_query('SELECT * FROM vendedores  WHERE tipo = "AE" and estado = "1" order by vendedor ');
			if (!$sql4) {
				die('Invalid query: ' . mysql_error());
			} 
$row_sql4 = mysql_fetch_assoc($sql4);
$totalRows_sql4 = mysql_num_rows($sql4); 

$sql8 = mysql_query('SELECT * FROM sucursal order by nombre ');
			if (!$sql8) {
				die('Invalid query: ' . mysql_error());
			} 
$row_sql8 = mysql_fetch_assoc($sql8);
$totalRows_sql8 = mysql_num_rows($sql8); 

$sql9 = mysql_query('SELECT * FROM director_ventas order by nombre ');
			if (!$sql9) {
				die('Invalid query: ' . mysql_error());
			} 
$row_sql9 = mysql_fetch_assoc($sql9);
$totalRows_sql9 = mysql_num_rows($sql9); 	

?>
<!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;
}
.Estilo1 {
	font-family: Verdana, Arial, Helvetica, sans-serif;
	font-size: 16px;
	font-style: normal;
	font-weight: bold;
	background-color: #D6ECFE;
	margin: 2px;
	padding: 2px;
	height: auto;
	width: auto;
	border: thin groove #E9AAF0;
	color: #C72350;
}
.Estilo2 {
	font-size: 14px;
	font-weight: bold;
}
.est_cont2 {
	font-family: Geneva, Arial, Helvetica, sans-serif;
	font-size: 12px;
	font-style: normal;
	font-weight: normal;
	color: #2B39EC;
	background-color: #FFFFFF;
	height: 18px;
	width: auto;
	border: thin solid #FABF85;
}


.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;
}
.Estilo3 {
	color: #C72350;
	font-weight: bold;
}
.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;
}
.Estilo54 {font-weight: bold}
.sol_cre11 {	font-family: "Times New Roman", Times, serif;
	font-size: 12px;
	font-style: normal;
	font-weight: normal;
	color: #000000;
	background-color: #E6FAFF;
	margin: 1px;
	padding: 1px;
	height: 18px;
	width: auto;
	border: thin outset #56AD95;
}
.Estilo55 {	color: #FF0000;
	font-weight: bold;
}
.Estilo65 {	color: #7DD096;
	font-weight: bold;
}
.Estilo65 {color: #C72350}
.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;
}
.Estilo67 {color: #CCFFCC}
-->
</style>
</head>

<body>
<form action="" method="post" enctype="multipart/form-data" name="form1" class="color_fondo_sc" id="form1">
  <div align="center">
    <div class="Estilo1">SOLICITUD </div>

    <table width="774" border="2" cellpadding="1" cellspacing="1" class="sol_cre11">
      <caption>
      <div align="center"><br />
          <span class="Estilo2">DATOS BASICOS - PERSONAS JURIDICAS </span><br />
      </div>
      </caption>
      <tr>
        <th scope="col">&nbsp;</th>
        <th scope="col"><div align="right">
            <div align="right"><strong>Fecha Solicitud :</strong></div>
        </div></th>
        <th width="96" scope="col"><div align="left">
            <input name="fecha" type="text" class="est_cont2" id="fecha" value="<?php echo $fecha1; ?>" size="10" maxlength="10" />
        </div></th>
        <th width="117" scope="col"><div align="right"><strong>Sucursal :</strong></div></th>
        <th colspan="2"> <input name="susu" type="text" class="est_cont2" id="susu" value="<?php echo $susu ?>" size="20" maxlength="20"  readonly=""/>
            <select name="sutar" class="est_cont8" id="sutar">
              <option value="">-SELECCIONE SUCURSAL-</option>
              <?php
     do {  
?>
              <option value="<?php echo $row_sql8['codigo'];?>"><?php echo $row_sql8['nombre']?></option>
              <?php
} while ($row_sql8 = mysql_fetch_assoc($sql8));
  $rows8 = mysql_num_rows($sql8);
  if($rows8 > 0) {
      mysql_data_seek($sql8, 0);
       $row_sql8 = mysql_fetch_assoc($sql8);
  }
?>
          </select></th>
      </tr>
  <td width="94"><div align="right"><strong>Razon Social:</strong></div></td>
      <td colspan="3"><div align="left">
          <input name="razon" type="text" class="est_cont2" id="razon" value="<?php echo $razon ?>" size="66" maxlength="65" />
      </div></td>
    <td width="115"><div align="right"><strong>Sigla:</strong></div></td>
    <td width="206" ><input name="sigla" type="text" class="est_cont2" id="sigla" value="<?php echo $sigla ?>" size="20" maxlength="20" /></td>
  </tr>
  <tr>
    <td height="21"><div align="right"><strong>Nit:</strong></div></td>
    <td width="111"><div align="left">
      <input name="nite" type="text" class="est_cont2" id="nite" value="<?php echo $nit ?>" size="20" maxlength="20" />
    </div></td>
    <td><div align="right"><strong>Cuidad :</strong></div></td>
    <td><div align="left">
      <input name="ciudad" type="text" class="est_cont2" id="ciudad" value="<?php echo $ciudad ?>" size="20" maxlength="20" />
    </div></td>
    <td><div align="right"><strong>Direccion :</strong></div></td>
    <td colspan="2"><div align="left">
      <input name="diret" type="text" class="est_cont2" id="diret" value="<?php echo $diret ?>" size="40" maxlength="40" />
    </div></td>
  </tr>
  <tr>
    <td><div align="right"><strong>Telefono :</strong></div></td>
    <td><div align="left">
      <input name="telefono" type="text" class="est_cont2" id="telefono" value="<?php echo $telefono ?>" size="20" maxlength="20" />
    </div></td>
    <td><div align="right"><strong>E-mail :</strong></div></td>
    <td colspan="2"><div align="left">
      <input name="email" type="text" class="est_cont2" id="email" value="<?php echo $email ?>" size="35" maxlength="35" />
    </div></td>
  </tr>
  <td height="42"><div align="right"><strong>Plan :</strong></div></td>
      <th> <input name="plane" type="text" class="est_cont2" id="plane" value="<?php echo $planes ?>" size="4" maxlength="4" />
          <select name="planet" class="est_cont8" id="planet">
            <option value="">-PLAN-</option>
            <?php
     do {  
?>
            <option value="<?php echo $row_sql7['nombre_plan'];?>"><?php echo $row_sql7['codigo_contrato']?></option>
            <?php
} while ($row_sql7 = mysql_fetch_assoc($sql7));
  $rows7 = mysql_num_rows($sql7);
  if($rows7 > 0) {
      mysql_data_seek($sql7, 0);
       $row_sql7 = mysql_fetch_assoc($sql7);
  }
?>
          </select>
      </th>
    <td><div align="right" class="Estilo54 Estilo65">Valor Contrato:</div></td>
    <td><div align="left">
          <input name="valcon" type="text" class="est_cont2" id="valcon" value="<?php echo $valcon ?>" size="12" maxlength="10"  />
      </div></td>
    <td><div align="right" class="Estilo3">Valor Definido :</div></td>
    <td colspan="2"><div align="left">
          <input name="valdef" type="text" class="est_cont2" id="valdef" value="<?php echo $valdef ?>" size="12" maxlength="10" />
      </div></td>
  </tr>
  <tr>
    <td height="40"><div align="right"><strong>I.V.A :</strong></div></td>
    <td><div align="left">
      <input name="iva" type="text" class="est_cont2" id="iva" value="<?php echo $iva ?>" size="20" maxlength="20" />
    </div></td>
    <td><div align="right"><strong>Retefuente:</strong></div></td>
    <td><div align="left">
      <input name="retefuente" type="text" class="est_cont2" id="retefuente" value="<?php echo $retefuente ?>" size="20" maxlength="20" />
    </div></td>
    <td><div align="right"><strong>Valor Incluido I.V.A :</strong></div></td>
    <td colspan="2" align="left"><input name="valiva" type="text" class="est_cont2" id="valiva" value="<?php echo $valiva ?>" size="20" maxlength="20" /></td>
  </tr>
  <tr>
    <td><div align="center"><strong>valor menos Retefuente :</strong></div></td>
    <td><div align="left">
      <input name="valrete" type="text" class="est_cont2" id="valrete" value="<?php echo $valrete ?>" size="20" maxlength="20" />
    </div></td>
    <td><div align="right"><strong>Cuota Inicial :</strong></div></td>
    <td><div align="left">
      <input name="cuotaini" type="text" class="est_cont2" id="cuotaini" value="<?php echo $cuotaini ?>" size="20" maxlength="20" />
    </div></td>
    <td><div align="right"><strong>Saldo a financiar:</strong></div></td>
    <td><input name="saldofin" type="text" class="est_cont2" id="saldofin" value="<?php echo $saldofin ?>" size="20" maxlength="20" /></td>
  </tr>
  <tr>
    <td><div align="right"><strong>NĂºmero de Cuotas:</strong></div></td>
    <td><div align="left">
      <input name="cuotas" type="text" class="est_cont2" id="cuotas" value="<?php echo $cuotas ?>" size="20" maxlength="20" />
    </div></td>
    <td><div align="right"><strong>Valor Cuota:</strong></div></td>
    <td><div align="left">
      <input name="valcuo" type="text" class="est_cont2" id="valcuo" value="<?php echo $valcuo ?>" size="20" maxlength="20" />
    </div></td>
    <td><div align="right"><strong>Cuenta :</strong></div></td>
    <td colspan="2" align="left"><input name="cuenta" type="text" class="est_cont2" id="cuenta" value="<?php echo $cuenta ?>" size="35" maxlength="35" /></td>
  </tr>
  <tr>
    <td><div align="right"><strong>Banco:</strong></div></td>
    <td><div align="left">
      <input name="banco" type="text" class="est_cont2" id="banco" value="<?php echo $banco ?>" size="20" maxlength="20" />
    </div></td>
    <td><div align="right"><strong>Sucursal Banco:</strong></div></td>
    <td><div align="left">
      <input name="sucuban" type="text" class="est_cont2" id="sucuban" value="<?php echo $sucuban ?>" size="20" maxlength="20" />
    </div></td>
    <td><div align="right"><strong>Numero Contrato:</strong></div></td>
    <td><div align="left">
      <input name="numcontrato" type="text" class="est_cont2" id="numcontrato" value="<?php echo $numcontrato ?>" size="20" maxlength="20" />
    </div></td>
  </tr>
  <tr>
    <td><div align="right"><strong>Asesor Comercial:</strong></div></td>
    <td colspan="2" align="center"><input name="aset" type="text" class="est_cont2" id="aset" value="<?php echo $aset ?>" size="40" maxlength="40" />
        <select name="asesor" class="est_cont8" id="asesor">
          <option value="">-SELECCIONE ASESOR-</option>
          <?php
     do {  
?>
          <option value="<?php echo $row_sql4['codigo'];?>"><?php echo $row_sql4['vendedor']?></option>
          <?php
} while ($row_sql4 = mysql_fetch_assoc($sql4));
  $rows4 = mysql_num_rows($sql4);
  if($rows4 > 0) {
      mysql_data_seek($sql4, 0);
       $row_sql4 = mysql_fetch_assoc($sql4);
  }
?>
      </select></td>
	  <td>
	  </td>
    <td><div align="right"><strong>Director Comercial:</strong></div></td>
	<td>
	 <select name="director" class="est_cont8" id="director">
          <option value="0">-SELECCIONE DIRECTOR-</option>
          <?php
     do {  
?>
          <option value="<?php echo $row_sql9['codigo'];?>"><?php echo $row_sql9['nombre']?></option>
          <?php
} while ($row_sql9 = mysql_fetch_assoc($sql9));
  $rows9 = mysql_num_rows($sql9);
  if($rows9 > 0) {
      mysql_data_seek($sql9, 0);
       $row_sql9 = mysql_fetch_assoc($sql9);
  }
?>
      </select>
	</td>
  </tr>
    </table>
    <p>&nbsp;</p>
    
    <table width="630" 
	border="2" cellpadding="1" cellspacing="1" class="est_cont2">
     
      <tr>
        <td colspan="6" bgcolor="#CCFFFF"><div align="center"><strong>INFORMACION CAMARA DE COMERCIO</strong></div></td>
      </tr>
      <tr>
        <td height="25" colspan="2" bgcolor="#FFFFCC"><span class="Estilo67"></span>
        <div align="right"><strong>Registro Mercantil No:</strong></div></td>
        <td bgcolor="#FFFFCC"><div align="left">
            <input name="registro" type="text" class="sol_cre11" id="registro" value="<?php echo $registro ?>" size="14" maxlength="14" />
        </div></td>
        <td bgcolor="#FFFFCC"><div align="right"><strong>Camara Comercio de :</strong></div></td>
        <td colspan="2" bgcolor="#FFFFCC"><div align="left">
            <input name="camara" type="text" class="sol_cre11" id="camara" value="<?php echo $camara ?>" size="25" maxlength="25" />
        </div></td>
      </tr>
      <tr>
        <td height="25" colspan="2" bgcolor="#FFFFCC"><div align="right"><strong>Representante Legal :</strong></div></td>
        <td colspan="2" bgcolor="#FFFFCC"><div align="left">
            <input name="repre" type="text" class="sol_cre11" id="repre" value="<?php echo $razon ?>" size="46" maxlength="45" />
        </div></td>
        <td colspan="2" bgcolor="#FFFFCC">&nbsp;</td>
      </tr>
      <tr>
        <td height="55" colspan="2" bgcolor="#FFFFCC"><div align="right"><strong>Objeto Social :</strong></div></td>
        <td colspan="4" bgcolor="#FFFFCC"><label><span class="Estilo54">
        <textarea name="objetivo" id="objetivo" cols="60" rows="3"><?php echo $objetivo ?></textarea>
        </span></label></td>
      </tr>
      <tr>
        <td height="27" colspan="6" bgcolor="#FFFFCC">
            <div align="center">
              <input type="radio" name="GrupoOpciones1" value="1" id="GrupoOpciones1_2" />
              <span class="Estilo55">Aprobar</span>
              <input type="radio" name="GrupoOpciones1" value="-1" id="GrupoOpciones1_3" />
              <span class="Estilo55">Rechazar </span>
              <select name="motem" id="motem">
                <option value="0" selected="selected">--SELECCIONE EL MOTIVO--</option>
                <option value="CAPACIDAD DE ENDEUDAMIENTO">CAPACIDAD DE ENDEUDAMIENTO</option>
                <option value="INEXISTENTE RELACION LABORAL">INEXISTENTE RELACION LABORAL</option>
                <option value="INEXACTITUD BANCARIA">INEXACTITUD BANCARIA</option>
              </select>
            </div>
        <label></label></td>
      </tr>
    </table>
    <p class="Estilo3">&nbsp;</p>
    <p>
      <input name="enviar" type="submit" class="col_cre2" id="enviar" value="Enviar" />
    </p>
  </div>
</form>
</body>
</html>