<?php
session_start();
include("cls_conexion.php");$CNN=new ClsMySQL();include("conexion23.php");
include("phpmnu_fun.php");
//if(strlen($_SESSION['SYS_USER_ID'])==0){JsDir("login.php");	return;}
//
$HW=V($_SESSION['SYS_HW']);
$IdUsu=vbval(V($_SESSION['SYS_USER_ID']));
$StrGT="";
$SYS_MSG="";
$SYS_FOC="";
//
$StrId=V($_POST['TxtId']);
$StrCmd=V($_POST['TxtAc']);
$LStrPag=V($_POST['TxtPag']);
//
include("planez_fun.php");
//
$VP_RegXPag=5;
$LStrTR=gn("count(*)","web_marcas","id_mar>0");
$LStrPag=PagGet($LStrPag,$StrCmd,$LStrTR,$VP_RegXPag);	
$TI=0;
?>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Planes</title>
<!--INI_SCRIPT------------------------------------------------------------------------------>
<?php AddJs(); ?>
<script type="text/javascript" src="ja/funciones.js"></script>
<script type="text/javascript" src="ja/planez.js"></script>
<!--FIN_SCRIPT------------------------------------->
<link rel="stylesheet" type="text/css" href="css/estiloss.css"  />
<link rel="stylesheet" type="text/css" href="css/basic.css"  />
<link rel="stylesheet" type="text/css" href="css/mnu.css"  />

<style type="text/css">
.cF {height:600px;width:1250px;position:relative;top:0px}
.mM {height:34px;width:1250px;position:relative;top:0px;background-color:#09C; z-index:500;}

</style>
<script>
$(document).ready(function(){  
   Inicializar();
   //
   SYS_LOAD();
});
</script>
</head>

<body  <?php echo $LStrMsg;?>>
<div align="center">

<div class="mM" align="left" style="font-size:12px">
<?php
echo GEN_MENU($IdUsu);
?>
</div>

<div Id="DivFRM"  class="cF" style="background-color:#FFFFFF;">
<form id="Frm" name="Frm" method="post" autocomplete="off"
action="planez.php" enctype="multipart/form-data" 
style="margin:0px; padding:0px; display:inline;" onSubmit="return false;">

<!--INI_TITULO--------------------------------->
<div id="DivT" class="dT" >
<img src="img/categorias.png" width="128" height="128" class="iT" />
<div class="tT">PLANES</div>
</div>
<!--FIN_TITULO--------------------------------->

<div class="s1" style="left:35px; top: 130px; width: 189px;">
NOMBRE</div>
<input name="Nom"  type="text" id="Nom"
class="lt" style="left: 35px; top: 148px; width: 232px"
tabindex="<?php echo ++$TI;?>"
value="<?php echo $Nom;?>"/>


<div class="s1" style="left:279px; top: 114px; width: 72px;">
PRECIO / COSTO</div>
<input name="Pre"  type="text" id="Pre"
class="ndd" style="left: 278px; top: 148px; width: 67px"
tabindex="<?php echo ++$TI;?>"
value="<?php echo $Pre;?>"/>

<?php if(strlen($Hab)==0)$Hab="SI";?>
<div class="s1" style="left: 361px; top: 130px; width: 84px;">
HABILITADO </div>
<select name="Hab" id="Hab" 
class="lt" style="left: 360px; top: 148px; width: 79px;"
tabindex="<?php echo ++$TI;?>">
<?php echo FCBO("aux_nom","auxiliar","aux_des='SN'",$Hab,"","S")?> 
</select>


<div class="s1" style="left:454px; top: 110px; width: 170px;">
<b>SERVICIO NACIONAL</b></div>
<div class="s1" style="left: 454px; top: 130px; width: 69px;">MINUTOS</div>
<input name="MinNac"  type="text" id="MinNac"
class="lt" style="left:454px; top: 148px; width:60px"
tabindex="<?php echo ++$TI;?>"
value="<?php echo $MinNac;?>"/>


<div class="s1" style="left:525px; top: 130px; width: 68px;"> SMS
</div>
<input name="SmsNac"  type="text" id="SmsNac"
class="lt" style="left:524px; top: 148px; width: 60px"
tabindex="<?php echo ++$TI;?>"
value="<?php echo $SmsNac;?>"/>

<div class="s1" style="left:594px; top: 130px; width: 68px;">GIGAS
</div>
<input name="GbNac"  type="text" id="GbNac"
class="lt" style="left:594px; top: 148px; width:60px"
tabindex="<?php echo ++$TI;?>"
value="<?php echo $GbNac;?>"/>

<div class="s1" style="left:669px; top: 110px; width: 193px;">
<b>SERVICIO INTERNACIONAL</b>
</div>
<div class="s1" style="left: 669px; top: 130px; width: 69px;">MINUTOS</div>
<input name="MinInt"  type="text" id="MinInt"
class="lt" style="left:669px; top: 148px; width:60px"
tabindex="<?php echo ++$TI;?>"
value="<?php echo $MinInt;?>"/>


<div class="s1" style="left:739px; top: 130px; width: 68px;"> SMS
</div>
<input name="SmsInt"  type="text" id="SmsInt"
class="lt" style="left:739px; top: 148px; width: 60px"
tabindex="<?php echo ++$TI;?>"
value="<?php echo $SmsInt;?>"/>

<div class="s1" style="left:809px; top: 130px; width: 56px;">GIGAS
</div>
<input name="GbInt"  type="text" id="GbInt"
class="lt" style="left:809px; top: 148px; width: 60px"
tabindex="<?php echo ++$TI;?>"
value="<?php echo $GbInt;?>"/>

<div class="s1" style="left:884px; top: 115px; width: 98px;">
GIGAS ALTA VELOCIDAD
</div>
<input name="GbAv"  type="text" id="GbAv"
class="lt" style="left:884px; top: 148px; width: 75px"
tabindex="<?php echo ++$TI;?>"
value="<?php echo $GbAv;?>"/>

<div class="s1" style="left:969px; top: 115px; width: 77px;">
GIGAS FULL CLARO
</div>
<input name="GvFc"  type="text" id="GvFc"
class="lt" style="left:969px; top: 148px; width: 75px"
tabindex="<?php echo ++$TI;?>"
value="<?php echo $GbFc;?>"/>

<div class="s1" style="left:1050px; top: 115px; width: 77px;">
GIGAS TETHERING</div>
<input name="GbTe"  type="text" id="GbTe"
class="lt" style="left:1050px; top: 148px; width: 75px"
tabindex="<?php echo ++$TI;?>"
value="<?php echo $GbTe;?>"/>

<div class="s1" style="left:1135px; top: 115px; width: 64px;">
GIGAS BONO</div>
<input name="GbBo"  type="text" id="GbBo"
class="lt" style="left:1135px; top: 148px; width: 75px"
tabindex="<?php echo ++$TI;?>"
value="<?php echo $GbBo;?>"/>

<!--INI_BOTONES-------------------------------->
<div id="DivBtn" align="left" style="position:absolute; left: 33px; top: 71px; width:1000px; height: 26px;">
<input name="CmdB" type="button" id="CmdG" class="btm" 
<?php GOM($StrId);?>
onclick="fGuardar();"  
tabindex="<?php echo ++$TI;?>"/>

<input name="CmdB" type="button" id="CmdC"  class="btm" 
value="Nuevo" onClick="fCancelar();"  
tabindex="<?php echo ++$TI;?>" />

<input name="CmdB" type="button" id="CmdE" class="btm" 
value="Eliminar" onClick="fEliminar();"
<?php DIS($StrId);?>
tabindex="<?php echo ++$TI;?>" />

<input name="CmdB" type="button" id="CmdB" class="btm"
value="Buscar" onClick="fBuscar('planez_b.php');"  
tabindex="<?php echo ++$TI;?>" />
</div>
<!--FIN_BOTONES-------------------------------->
<div class="datagrid" 
style="position: absolute; left:35px; top: 185px; ; width: 1175px; height: 388px; overflow:auto">
<table width="100%">
<thead>
<tr>
<td colspan="10" height="18" align="center">
<?php echo PagBtn($LStrTR,$VP_RegXPag,$LStrPag);?>
</td>
</tr>
<tr>
<th width="32%">NOMBRE</th>

<th width="9%">PRECIO</th>
<th width="11%">MIN.NAC</th>
<th width="8%">SMS.NAC</th>
<th width="8%">GB.NAC</th>

<th width="8%">MIN.INT</th>
<th width="10%">SMS.INT</th>
<th width="9%">GB.INT</th>


<th width="3%">HAB</th>
<th width="2%">&nbsp;</th>
</tr>
</thead>
<tbody>
<?php	
$s="SELECT * FROM vis_planes WHERE ID>0 ORDER BY PRE  ";	
$s=PagSql($s,$LStrPag,$VP_RegXPag,$LStrTR);
$rs=grs($s);
while($r=$rs->fetch_assoc()){
?>
<tr onDblClick="fActivar(<?php echo $r['ID'];?>);">
<!----------------------------------------------->
<td><?php echo $r['NOM'];?></td>
<td><?php echo $r['PRE'];?></td>
<td><?php echo $r['MIN_NAC'];?></td>
<td><?php echo $r['SMS_NAC'];?></td>
<td><?php echo $r['GB_NAC'];?></td>
<td><?php echo $r['MIN_INT'];?></td>
<td><?php echo $r['SMS_INT'];?></td>
<td><?php echo $r['GB_INT'];?></td>
<td><?php echo $r['HAB'];?></td>
<!----------------------------------------------->
<td align="center">
<a href="javascript:void(0)" onClick="fActivar(<?php echo $r['ID'];?>);">
<img src="img/b_edit.png"  border="0"/></a></td>
</tr>
<?php
}
?>		  

</tbody>
</table>
</div>

<!--INI_OCULTOS-------------------------------->
<?php include("ocultos.php");?>
<?php
	$IOK=1;
	$IMG="adjuntos/vacio.png";
	if(vbval($StrId)>0){
		$IOK=0;
		$FN=gs("mar_archivo","marcas","id_mar=$StrId");
		if(strlen($FN)>0){
			$FX="adjuntos/".$FN;
			if(file_exists($FX)){
				$IMG=$FX;
				$IOK=1;
			}
		}
	}
?>

<?php if($IOK>0){?>
<?php }?>

<input name="SYS_MSG" type="hidden" id="SYS_MSG" value="<?php echo $SYS_MSG;?>" />
<input name="SYS_FOC" type="hidden" id="SYS_FOC" value="<?php echo $SYS_FOC;?>" />
</form>
</div>
</div>
</body>
</html>
