File: /home/asjudine/www/consulta_gestio_posventa.php
<?php
require_once("mainfile.php");
include ("config.php");
global $dbi;
$linea = '-';
require_once("Conectarse.php");
$resul4 = mysql_query('SELECT nit, razon, sigla, representante , sucursal , ciudad, direccion, telefono, email, fecha, plan, valor_contrato, valor_cuota, cuenta, banco, cuotas , numero_contrato, asesor FROM personas_juridicas WHERE nit = "' . $HTTP_GET_VARS["ced2"] . '" and numero_contrato = "' . $HTTP_GET_VARS["numcon"] . '"');
if (!$resul4) {
die('Invalid query ooo: ' . mysql_error());
}
list($nit, $razon, $sigla, $represen, $sucursal, $ciudad, $diret, $telefono, $email, $fecha, $plan, $valcon, $valcuo, $cuenta, $banco, $cuotas, $numcontrato, $asesor) = mysql_fetch_row($resul4);
$resugg = mysql_query('SELECT contacto, celular_contacto FROM informe_evaluacion WHERE nit = "' . $HTTP_GET_VARS["ced2"] . '"');
if (!$resugg) {
die('Invalid query ooo: ' . mysql_error());
}
list($contacto, $celconta) = mysql_fetch_row($resugg);
$control = mysql_query('SELECT cedula, codigo_militar, nombre, grado, numerocontrato, tipocontrato , numero_libranza , tipo_afiliado, codigo_sucursal, direccion , telefono, celular, ciudad , email, cuenta, banco, entidad_laboral, unidad_descuento, codigo_descuento, entidad_recaudo, fecha_nacimiento, fecha_afiliacion, valorcontrato, numerocuotas, valorcuota, fecha_inicio_contrato, fecha_termino_contrato, fecha_ultimo_registro, mes_inicio, ano_inicio, mes_termino, ano_termino, saldoanteior, cuotaspendientes, cuotasdescontadas, saldonuevo, vendedor, director, beneficiarios, renovacion, causal_terminacion, fecha_terminacion, estado FROM cartera_serviasjudinet WHERE cedula = "' . $HTTP_GET_VARS["ced2"] . '" and numerocontrato = "' . $HTTP_GET_VARS["numcon"] . '" ');
if (!$control) {
die('Invalid query 1: ' . mysql_error());
}
$num=mysql_num_rows($control);
list($cedula, $codi, $apes, $grad, $numcont, $plan, $num_lib, $titular, $codigosu, $dire, $tele, $celul, $ciud, $email, $cue, $ban, $enti, $unides, $codides, $entre, $fecna, $fechafil, $valcon, $numcuo, $valcuo, $fechainicio, $fechatermino, $fechaul, $mesini, $anoini, $mesfin, $anofin, $salant, $cupen, $cudesc, $salnue, $ven, $director, $bene, $renova, $causal, $fechater, $esta) = mysql_fetch_row($control);
if(isset($_POST["enviar"]))
{
$inser2= mysql_query("INSERT INTO gestion_posventa (cedula, razon, contrato, tipocontrato, sucursal, fecha_gestion, gestion) VALUES ('" . $_POST["nite"] . "', '" . $_POST["razon"] . "', '" . $_POST["numcontrato"] . "', '" . $_POST["plan"] . "', '" . $_POST["sucursal"] . "', '" . $_POST["fechages"] . "', '" . $_POST["gestion"] . "')");
if (! $inser2) {
die('Invalid inser2 : ' . mysql_error());
}
echo "<script>alert('Gestion Guardada Correctamente');</script>";
}
$mssql = mysql_query('SELECT vendedor FROM vendedores WHERE codigo = "' . "$ase". '" ');
if (!$mssql) {
die('Invalid query: ' . mysql_error());
}
list($asesor) = mysql_fetch_row($mssql);
$mssql1 = mysql_query('SELECT nombre FROM sucursal WHERE codigo = "' . "$sucursal". '" ');
if (!$mssql1) {
die('Invalid query: ' . mysql_error());
}
list($sucursal) = mysql_fetch_row($mssql1);
$sql = mysql_query('SELECT * FROM sucursal order by nombre ');
if (!$sql) {
die('Invalid query 12: ' . mysql_error());
}
$row_sql = mysql_fetch_assoc($sql);
$totalRows_sql = mysql_num_rows($sql);
$sql7 = mysql_query('SELECT * FROM planes_contratos WHERE estado = "1" and (codigo = "9" || codigo = "10" || codigo = "11" || codigo = "12" || codigo = "13")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);
?>
<!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>Consulta Gestion Empresarial</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;
}
.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;
height: 18px;
width: auto;
border: thin outset #56AD95;
}
.sol_cre12 { font-family: "Times New Roman", Times, serif;
font-size: 12px;
font-style: normal;
font-weight: normal;
color: #000000;
background-color: #FEFFEC;
height: 18px;
width: auto;
border: thin outset #FEFFEC;
}
.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" id="form1">
<div align="center"> <strong class="Estilo3"> GESTION POSVENTA</strong></div>
<table width="710" height="228" border="" align="center" cellpadding="" cellspacing="" class="sol_cre11">
<caption>
<div align="center"><br/>
<span class="Estilo2">DATOS BASICOS - PERSONAS JURIDICAS </span><br />
</div>
</caption>
<tr>
<th scope="col"> </th>
<th scope="col"><div align="right">
<div align="right"><strong>Fecha Solicitud :</strong></div>
</div></th>
<th width="112" scope="col"><div align="left">
<input name="fecha" type="text" class="est_cont2" id="fecha" value="<?php echo $fecha ?>" size="20" maxlength="20" />
</div></th>
<th width="114" scope="col"><div align="right"><strong>Sucursal :</strong></div></th>
<td colspan="2"> <input name="sucursal" type="text" class="est_cont2" id="sucursal" value="<?php echo $sucursal ?>" size="20" maxlength="20" />
</td>
</tr>
<td width="89"><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="70"><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" readonly=""/></td>
</tr>
<tr>
<td height="21"><div align="right"><strong>Nit:</strong></div></td>
<td width="103"><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="22"><div align="right"><strong>Plan :</strong></div></td>
<td>
<input name="plan" type="text" class="est_cont2" id="plan" value="<?php echo $plan ?>" size="12" maxlength="10" />
</td>
<td><div align="right" class="Estilo54 Estilo65">Valor Contado:</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"><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>
</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>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>
<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 height="28"><div align="right"><strong>Cuotas Pendientes :</strong></div></td>
<td><div align="left">
<input name="cupen" type="text" class="est_cont2" id="cupen" value="<?php echo $cupen ?>" size="12" maxlength="10" readonly=""/>
</div></td>
<td><div align="right"><strong>Cuotas Descontadas:</strong></div></td>
<td ><div align="left">
<input name="cudesc" type="text" class="est_cont2" id="cudesc" value="<?php echo $cudesc ?>" size="12" maxlength="12" readonly=""/>
</div></td>
</tr>
<tr>
<td height="34"><div align="right"><strong>Fecha Inicio Contrato:</strong></div></td>
<td><div align="left">
<input name="fechainicio" type="text" class="est_cont2" id="fechainicio" value="<?php echo $fechainicio ?>" size="10" maxlength="14" readonly=""/>
</div></td>
<td><div align="right"><strong>Fecha Termino Contrato:</strong></div></td>
<td ><div align="left">
<input name="fechatermino" type="text" class="est_cont2" id="fechatermino" value="<?php echo $fechatermino ?>" size="10" maxlength="14" readonly=""/>
</div></td>
</tr>
<tr>
<td><div align="right" class="Estilo55">Contacto:</div></td>
<td colspan="2" ><div align="left" class="est_cont51">
<input name="contacto" type="text" class="est_cont2" id="contacto" value="<?php echo $contacto ?>" size="50" maxlength="50" />
</div></td>
<td><div align="right" class="Estilo55">Celular:</div></td>
<td ><div align="left" class="est_cont51">
<input name="celconta" type="text" class="est_cont2" id="celconta" value="<?php echo $celconta ?>" size="12" maxlength="14" />
</div></td>
</tr>
</table>
<br />
<p align="center">
<input name="menu2" type="button" class="Estilo3" id="menu2" onClick="window.location.href='menu_empresarial.php'" value="MENU PRINCIPAL">
</p>
</form>
</body>
</html>
<?php
$mssql = mysql_query('SELECT * FROM gestion_posventa ');
if (!$mssql) {
die('Invalid query 1: ' . mysql_error());
}
if($mssql)
{
$filas = mysql_num_rows($mssql);
if ($filas > 0)
{
$control = mysql_query('SELECT id, fecha_gestion , gestion FROM gestion_posventa WHERE cedula = "' . $HTTP_GET_VARS["ced2"] . '" and contrato = "' . $HTTP_GET_VARS["numcon"] . '" order by cedula ');
if (!$control) {
die('Invalid query 2: ' . mysql_error());
}
if ((mysql_num_rows($control)!=0))
{
echo "<table width=850 border=1 align=center cellpadding=1 cellspacing=1>
<tr align=center>
<td width='34' class=sol_cre11>ID</td>
<td width='500'class=sol_cre11>GESTION</td>
<td width='155' class=sol_cre11>FECHA GESTION</td>
</tr>";
while(list($id, $fecha , $gestion) = mysql_fetch_row($control))
{
echo "<tr class=sol_cre12>
<td align=center>$id</td>
<td align=center>$gestion</td>
<td align=center>$fecha</td>";
}
}
}
}
echo "</form>";
?>