<?php 
session_start();
foreach($_GET  as $key => $value){${$key}=trim($value);} 
foreach($_POST as $key => $value){${$key}=trim($value);} 
include_once('lib_main.php');
if(!empty($empr)){$link_data=msql_connect('','','',$empr); $cfg_empr=$empr;}
$user_codigo=$_SESSION['user_codigo'];
$user0=data_maes('user',$user_codigo);
if(empty($user_codigo)){include('user_login0.php');return;}

$cant=0;
$puni=0;

// 1 ver
// 2 modi
// 3 crear
// 4 elim     

$acce['codi']=0;
$acce['prec']=0;
$acce['cupo']=0;
if(mb_stristr('sist.supe',$user0['user_tipo']))
{foreach($acce as $key => $value){$acce[$key]=1;}}


// echo '*/*/*'.$user0['user_descri'];
$info='mt'.strtolower($modu);
// echo '*/*/*'.$user0['user_enti'];

if(!mb_stristr('sist.supe.admi.oper',$user0['user_tipo']) and mb_stristr('user.usrt.adrs',$modu))
{
     $enti=$user0['user_enti'];
     $iuser=$user0['user_codigo'];
}

if(!mb_stristr('sist.supe.admi.oper',$user0['user_tipo']) and mb_stristr('user.usrt',$modu))
{
     $info='';
}

// if(empty($codigo) and mb_stristr('user.usrt',$modu))
// {
//      $codigo=$user0['user_codigo'];
//      $info='';
// }


if(empty($format)){$format=1;}

$info_descri='MAESTRO';

if(empty($user0['user_tipo'])){$cost='false';}


// $modu0=data_maes('docu',$modu);
// $docu0=data_maes('docu',$modu);

// $enti0=data_maes('enti',$enti);
// $item0=data_maes('item',$item);
// $ctas0=data_maes('ctas',$ctas);
// $lsub0=data_maes('lsub',$lsub);
// $ptov0=data_maes('ptov',$ptov);
$nive0=data_maes('nive',$nive);
$liga0=data_maes('liga',$liga);
$team0=data_maes('team',$team);
$torn0=data_maes('torn',$torn);
$posi0=data_maes('posi',$posi);

// $csub0=data_maes('csub',$csub);
//$lote0=data_maes('lote',$lote);

// $sql_tbod='select distinct ptov_tipo from ptov0 where ptov_status not in("I","X") and ptov_tipo!="" and ptov_tipo is not null';
// $res_tbod=msql_query($sql_tbod,$link_data);
// if(msql_num_rows($res_tbod)>1){$tbod_ok=1;}

// $sql_imgi='select * from item0 left join imgi0 on item_codigo=imgi_item where item_status not in ("I","X") and imgi_status not in("I","X") limit 1';
// $res_imgi=msql_query($sql_imgi,$link_data);
// if(msql_num_rows($res_imgi)!=0){$imgi_ok=1;}

// $sql_mrca='select * from mrca0 where mrca_status not in("I","X") limit 1';
// $res_mrca=msql_query($sql_mrca,$link_data);
// if(msql_num_rows($res_mrca)!=0){$mrca_ok=1;}


// $maes=strtolower($maes);
$modu=strtolower($modu);
//$tabla=$docu0['docu_tabla'];
$tabla="liga";
$tabla=$modu;

if(!empty($codigo))
{
     $codi1=$codigo;
     $maes0=data_maes($tabla,$codigo);
     foreach($maes0 as $key => $value){${substr($key,5)}=trim($value);}
     
     $codigo=$maes0[$tabla.'_codigo'];
     $codigo=$codi1;
} 


if($modu=='pcnt')
{
//      {$xwhere='(enti_codigo like "99%") or enti_codigo in(select distinct pcnt from vtas2)  or enti_codigo in(select distinct pcnt from clie2)';}
//      view_maes('enti','pcnt',$xwhere);
}

$modu=strtolower($modu);  
$xtitulo='MAESTROS';
if($modu=='enti'){$xtitulo='ENTIDADES';}
if($modu=='item'){$xtitulo='ITEMS';}
if($modu=='clie'){$xtitulo='CLIENTES';}
if($modu=='pcnt'){$xtitulo='PACIENTES';}
if($modu=='adrs'){$xtitulo='DIRECCIONES';}
if($modu=='user'){$xtitulo='USUARIOS';}
if($modu=='liga'){$xtitulo='MAESTRO';}
if (empty($modu)) $modu = 'liga';
$xtitle=$xtitulo;
// $xtopcenter=$xtitle;
$xtopcenter=$xtitulo;
//$fecha0=fecha0($modu);
$fecha0='2000-01-01';
if(empty($fecha)){$fecha=date('Y-m-d');}


$fecha_min=date('Y-m-d',strtotime('-7 days'));
if(empty($fecha1))
{$fecha1=date('Y-m-d',strtotime('-7 days'));}
if(empty($fecha2))
{$fecha2=date('Y-m-d');}

// $dom = new DOMDocument();
//      $dom->encoding = 'utf-8';
//      $dom->xmlVersion = '1.0';
//      $dom->formatOutput = true;
// echo $dom->saveXML();



// echo '*/*/*/*/';
// echo sal_item2('20109837');
     
//  SELECT DB
//if(!empty($modu))
//{include('sele_info.php');}
//echo '***'.$sql_info;
if(!empty($codigo))
{
//      $info='mt'.$tabla;
//      include('sele_info.php');
}

if(!empty($sql_info))
{
     $res_info=msql_query($sql_info,$link_data);
     if(msql_num_rows($res_info)==0)
     {
     }
//      $msgres=number_format(msql_num_rows($res_info)).' Resultado(s)...';
}



// DATALIST

{
$ztabla='stat';
include('ele_datalist.php');

$zid='dl_tipo';
$ztabla=$modu;
$zcolu=$modu.'_tipo';
include('ele_datalist.php');
     
     
if($tabla=='ctas')
{
     $ztabla='ctas';
     include('ele_datalist.php');
}     
         

if($tabla=='enti' or $tabla=='adrs')
{
     $ztabla='enti';
     include('ele_datalist.php');
     
     $zid='dl_pais';
     $ztabla='adrs';
     $zcolu='adrs_pais';
     include('ele_datalist.php');
     
     $zid='dl_provincia';
     $ztabla='adrs';
     $zcolu='adrs_provincia';
     include('ele_datalist.php');
     
     $zid='dl_ciudad';
     $ztabla='adrs';
     $zcolu='adrs_ciudad';
     include('ele_datalist.php');
     
}
     
if($tabla=='adrs')
{
}
     
//if($tabla=='enti')
if($modu=='pcnt' and mb_stristr('demo.anml',$cfg_empr))
{
     $zid='dl_raza';
     $ztabla='enti';
     $zcolu='enti_raza';
     include('ele_datalist.php');
}
     
if($tabla=='item')
{
     $sql_updt='update item0, mrca0 set item_marca=mrca_descri where item_mrca=mrca_codigo';
     $res_updt=msql_query($sql_updt,$link_data);
     
     $ztabla='item';
     include('ele_datalist.php');
     
     $ztabla='lsub';
     include('ele_datalist.php');

     $ztabla='mrca';
     include('ele_datalist.php');

     $ztabla='umdd';
     include('ele_datalist.php');

     
     $zid='dl_marca';
     $ztabla='item';
     $zcolu='item_marca';
     include('ele_datalist.php');

     $zid='dl_iva';
     $ztabla='item';
     $zcolu='item_iva';
     include('ele_datalist.php');
     
     
//      $ztabla='lote';
//      include('ele_datalist.php');
     
}     

if(!empty($modu))
{
$ztabla=$modu;
include('ele_datalist.php');
}

     
}


include('sele_info.php');
// echo '*/*/*'.$sql_info;
if(!empty($sql_info))
{
     $res_info=msql_query($sql_info,$link_data);
     $date1=date('H:i:s');
     $res_info=msql_query($sql_info,$link_data);
     $date2=date('H:i:s');
     
     $msgres=number_format(msql_num_rows($res_info)).' Resultado(s)...';
//      $msgres.=$date1.$date2;
//      echo '<br>*/*/'.$msgres;
}




// PANTALLA FILTROS
echo '<div id="filtros" noprint >';
{
// OCULTOS
// echo '<input id="format" hide value="'.$format.'">';
     
$zobj=2;     
include('ele_break.php');

$zid='modu';
//$ztabla='docu';
$zlabel='MAESTRO';
$zvalue=$modu; 
if(!empty($modu)){$zreado=1;}
$zondblclick='{document.getElementById("modu").removeAttribute("disabled");}';     
$zonblur='{location.href="?scri='.basename(__FILE__,'.php').'&modu="+document.getElementById("modu").value;}';
$zonchange=$zonblur;
//$zwhere='(docu_tipo="MAES")';
//$zdlist='dl_docu';
$ztabla = '';
$zoptions = "LIGA,LIGA;NIVE,NIVEL;POSI,POSICION;TORN,TORNEO;TEAM,TEAMS;" ;
include('ele_select.php');
     
     
if(!empty($modu))
{
    if($modu == "torn")
      {
        $zid='liga';
        $zlabel='LIGA';
        $zvalue=$liga; 
        $zondblclick='{document.getElementById("liga").removeAttribute("disabled");}';     
        $zonblur ='{location.href="?scri='.basename(__FILE__,'.php').'&modu="+document.getElementById("modu").value';
        $zonblur.= '+"&liga="+document.getElementById("liga").value;}';
        $zonblur='{location.href="?scri='.basename(__FILE__,'.php').'&modu="+document.getElementById("modu").value+"&liga="+document.getElementById("liga").value;}';
        $zonchange=$zonblur;
        if (!empty($zvalue)) $zreado=2;
        $ztabla = 'liga';
        
        include('ele_select.php');
      
        $zid='fecini';
        $ztype='date';
        $zlabel='Inicio';
        include('ele_input.php');  

        $zid='fecfin';
        $ztype='date';
        $zlabel='Final';
        include('ele_input.php');  

      }

    $zid='btn_nuevo'; 
    $zlabel='Nuevo';
    $zalign='right';
    $zonclick='{fn_nuevo();}';
    $zsize=1.2;     
    include('ele_button.php');
     
     
     $zid='codigo';
     $ztabla=$tabla;
     $zlabel='Código';
     $zvalue=$codigo; 
     $zondblclick='{document.getElementById("codigo").removeAttribute("disabled");}';     
     $zonblur='{fn_consulta();}';
     $zreado=1;
     $zobj = 2;
     if($tiporegi==1){$ztabla='';}
  
     if($modu=='user')
     {
          if(!mb_stristr('sist.supe',$user0['user_tipo']))
          {$zreado=1;}
     }
     include('ele_input.php');

     $zid='status';
     $ztabla='stat';
     $zlabel='Status';
     $zvalue=$stat; 
     $zalign='right';
     $zoptions='-,Nuevo;A,Activo;I,Inactivo;';
     include('ele_select.php');
     
     $zid='tipo';
//      $ztabla='stat';
     $zlabel='Tipo';
     $zvalue=$tipo; 
     $zalign='right';
     $zwidth=8;
     $zlist='dl_tipo';
     $zreado=1;
     if(mb_stristr('sist.supe',$user0['user_tipo']))
     {$zreado=2;}
     
//      $zoptions='-,Nuevo;A,Activo;I,Inactivo;';
     
     include('ele_input.php');
     
     
//      $zid='tipo';
//      $zlabel='Tipo';
//      $zvalue=$tipo; 
//      $zalign='right';
// //      $zwidth=4;
// //      $zlist='dl_tipo';
//      $ztabla=$modu;
//      $zcolu2=$modu.'_tipo';
     
//      include('ele_select.php');
     
}


$zobj=2;     
include('ele_break.php');
     
$zid='btn_grabar'; 
$zlabel='Grabar';
$zalign='right';
$zonclick='{save_maes(event);}';
$zsize=1.5;
$zalign='right';     
// if(!empty($codigo) and empty($edit)){$zhide=1;}       
include('ele_button.php');

if(@mb_stristr('user',$modu))
{
     
     $zid='email';
     $zlabel='e-mail';
     $zvalue=$email;
     $zreado=1;
     include('ele_input.php');
     
     $zid='cedula';
     $zlabel='Cédula';
     $zvalue=$cedula;
     $ztabla='enti';
     if(strlen($cedula)==10){$zreado=1;}
     include('ele_input.php');
     
     $zobj=1;     
     include('ele_break.php');

     $zid='descri';
     $zlabel='Nombre';
     $zvalue=$descri;
     include('ele_input.php');
          
     $zid='nickname';
     $zlabel='Seudónimo';
     $zvalue=$nickname;
     include('ele_input.php');
          
     $zobj=1;     
     include('ele_break.php');
     
     
     
     $zid='pais';
     $zlabel='Pais';
     $zvalue=$pais;
     include('ele_input.php');
     
     $zid='provincia';
     $zlabel='Provincia';
     $zvalue=$provincia;
     include('ele_input.php');
     
     $zid='ciudad';
     $zlabel='ciudad';
     $zvalue=$ciudad;
     include('ele_input.php');
     
     $zobj=1;     
     include('ele_break.php');
     
     $zid='calle1';
     $zlabel='Calle 1 /Cdla.';
     $zvalue=$calle1;
     include('ele_input.php');
     
     $zid='calle2';
     $zlabel='Calle 2 /Mz.';
     $zvalue=$calle2;
     include('ele_input.php');
     
     $zid='callen';
     $zlabel='No. /Villa';
     $zvalue=$callen;
     $zwidth=4;
     include('ele_input.php');
     
     $zid='calle3';
     $zlabel='Referencia';
     $zvalue=$calle3;
     include('ele_input.php');
     

     $zobj=1;     
     include('ele_break.php');
     


     $zid='contacto';
     $zlabel='contacto';
     $zvalue=$contacto;
//      $zoptions='0,N/A;1,Masculino;2,Femenino';
     include('ele_input.php');

     
     $zid='telefono';
     $zlabel='telefono';
     $zvalue=$telefono;
//      $zoptions='0,N/A;1,Masculino;2,Femenino';
     include('ele_input.php');

     
     $zid='wsapp';
     $zlabel='wsapp';
     $zvalue=$wsapp;
     $ztype='number';
     $zsize=0.9;
     include('ele_input.php');
     
     $zid='email';
     $zlabel='e-mail';
     $zvalue=$email;
     $zwidth=15;
     include('ele_input.php');
     
//      $zid='emailce';
//      $zlabel='e-mail CE';
//      $zvalue=$emailce;
//      $zwidth=15;
//      include('ele_input.php');
     
}

     
     
if(@mb_stristr('adrs',$modu))
{
     
     $zid='enti';
     $zlabel='Entidad';
     $zvalue=$enti;
     $ztabla='enti';
     $zlist='dl_enti';
     if(!empty($enti)){$zreado=1;}
     $zondblclick='{document.getElementById("enti").removeAttribute("disabled");}';     
     $zonblur='{location.href="?scri='.basename(__FILE__,'.php').'&modu="+document.getElementById("modu").value+"&enti="+document.getElementById("enti").value;}';
     $zonchange=$zonblur;
     if(!mb_stristr('sist.supe.admi',$user0['user_tipo']))
     {$zhide=1;}
     include('ele_input.php');
     
     $zobj=1;     
     include('ele_break.php');
     
     $zid='pais';
     $zlabel='Pais';
     $zvalue=$pais;
     include('ele_input.php');
     
     $zid='provincia';
     $zlabel='Provincia';
     $zvalue=$provincia;
     include('ele_input.php');
     
     $zid='ciudad';
     $zlabel='ciudad';
     $zvalue=$ciudad;
     include('ele_input.php');
     
     $zobj=1;     
     include('ele_break.php');
     
     $zid='calle1';
     $zlabel='Calle 1 /Cdla.';
     $zvalue=$calle1;
     include('ele_input.php');
     
     $zid='calle2';
     $zlabel='Calle 2 /Mz.';
     $zvalue=$calle2;
     include('ele_input.php');
     
     $zid='callen';
     $zlabel='No. /Villa';
     $zvalue=$callen;
     include('ele_input.php');
     
     $zid='calle3';
     $zlabel='Referencia';
     $zvalue=$calle3;
     include('ele_input.php');
     

     $zobj=1;     
     include('ele_break.php');
     


     $zid='contacto';
     $zlabel='contacto';
     $zvalue=$contacto;
//      $zoptions='0,N/A;1,Masculino;2,Femenino';
     include('ele_input.php');

     
     $zid='telefono';
     $zlabel='telefono';
     $zvalue=$telefono;
//      $zoptions='0,N/A;1,Masculino;2,Femenino';
     include('ele_input.php');

     
     $zid='wsapp';
     $zlabel='wsapp';
     $zvalue=$wsapp;
     $ztype='number';
     $zsize=0.9;
     include('ele_input.php');
     
     $zid='email';
     $zlabel='e-mail';
     $zvalue=$email;
     $zwidth=15;
     include('ele_input.php');
     
//      $zid='emailce';
//      $zlabel='e-mail CE';
//      $zvalue=$emailce;
//      $zwidth=15;
//      include('ele_input.php');
     
}

     
if(@mb_stristr('enti.clie.prov.pers.pjur.pcnt',$modu))
{
//      if(@mb_stristr('enti.clie.prov.pjur.',$modu))
     if(strlen(trim($codigo))==13)
     {
     $zid='razsoc';
     $zlabel='Razón Social';
     $zvalue=$razsoc;
     $zwidth=30;
     include('ele_input.php');
     
     $zobj=1;     
     include('ele_break.php');

     $zid='nomcom';
     $zlabel='Nom.Comer. ';
     $zvalue=$nomcom;
     $zwidth=30;
     include('ele_input.php');
     
     $zobj=1;     
     include('ele_break.php');
     
     }
     
     $zid='nom1';
     $zlabel='Nombre 1';
     $zvalue=$nom1;
     include('ele_input.php');
     
//      if($modu=='enti')
     if(mb_stristr('enti.clie',$modu))
     {
     $zid='nom2';
     $zlabel='Nombre 2';
     $zvalue=$nom2;
     include('ele_input.php');
     }
     
$zobj=1;     
include('ele_break.php');
     
     $zid='ape1';
     $zlabel='Apellido 1';
     $zvalue=$ape1;
     include('ele_input.php');
     
     $zid='ape2';
     $zlabel='Apellido 2';
     $zvalue=$ape2;
     include('ele_input.php');

$zobj=2;     
include('ele_break.php');
     
     $zid='fechanac';
     $zlabel='Fec.Nacim.';
     $zvalue=$fechanac;
     if(empty($fechanac)){$zvalue='2000-01-01';}
     $ztype='date';
     $zmax=date('Y-m-d');
     $zmin=date('Y-01-01',strtotime('-99 year'));
     include('ele_input.php');

     $zid='sexo';
     $zlabel='Sexo';
     $zvalue=$sexo;
     $zoptions='0,N/A;1,Masculino;2,Femenino';
     include('ele_select.php');

     $zid='sangre';
     $zlabel='Sangre';
     $zvalue=$sangre;
     $zoptions='0;O-;O+;A-;A+;B-;B+;AB-;AB+';
     include('ele_select.php');

     
$zobj=1;     
include('ele_break.php');

if($modu=='pcnt' and mb_stristr('demo.anml',$cfg_empr))
{
     $zid='raza';
     $zlabel='Raza';
     $zvalue=$raza;
     $zlist='dl_raza';
     include('ele_input.php');
}

     
     
     
$zobj=2;     
include('ele_break.php');

     
     $zid='direccion';
     $zlabel='Dirección';
     $zvalue=$direccion;
     $zwidth=25;    
     $zrows=2;     
     include('ele_input.php');

     $zid='email';
     $zlabel='e-mail';
     $zvalue=$email;
     $zwidth=15;
     include('ele_input.php');
     
     $zid='emailce';
     $zlabel='e-mail CE';
     $zvalue=$emailce;
     $zwidth=15;
     include('ele_input.php');
     
     $zid='telefono';
     $zlabel='Fonos';
     $zvalue=$telefono;
     $zwidth=15;
//      $ztype='number';
     $zsize=0.9;
     include('ele_input.php');
     
     $zid='wsapp';
     $zlabel='wsapp';
     $zvalue=$wsapp;
     $ztype='number';
     $zsize=0.9;
     include('ele_input.php');
     

$zobj=2;     
include('ele_break.php');
     
     $zid='factura';
     $zlabel='Facturar';
     $zvalue=$factura;
     $ztabla='enti';     
     include('ele_input.php');
     
     $zid='pasaporte';
     $zlabel='Pasaporte';
     $zvalue=$pasaporte;
//      $ztabla='enti';     
     include('ele_input.php');
     
     
     
}
     
if(@mb_stristr('item.bien.serv',$modu))
{
     $zid='descri';
     $zlabel='Descripción';
     $zvalue=$descri;
     $zwidth=40;
     $zrows=2;
     include('ele_input.php');
     
$zobj=1;     
include('ele_break.php');
     
     $zid='descri2';
     $zlabel='Info.Adic.';
     $zvalue=$descri2;
     $zwidth=40;
     $zrows=2;
     include('ele_input.php');
     
     
$zobj=2;     
include('ele_break.php');

     $zid='marca';
     $zlabel='Marca';
     $zvalue=$marca;
//      $zdefa='GENERICO';
//      if(empty($zvalue)){$zvalue='GENERICO';}
     $zlist='dl_marca';
     include('ele_input.php');
     
     $zid='modelo';
     $zlabel='Modelo';
     $zvalue=$modelo;
     $zwidth=15;
     include('ele_input.php');

     $zid='lsub';
     $zlabel='Linea-Sub';
     $zvalue=$lsub;
     $zlist='dl_lsub';
     $ztabla='lsub';
     include('ele_select.php');
     
     
$zobj=1;     
include('ele_break.php');
     
     $zid='ean';
     $zlabel='Cod.EAN';
     $zvalue=$ean;
     $ztabla='item';
     $zclass='numeric-int';
     $zlist='nolist';
     include('ele_input.php');
     
     $zid='numpart';
     $zlabel='#Parte';
     $zvalue=$numpart;
     include('ele_input.php');
     
     $zid='codigov';
     $zlabel='Cod.Venta';
     $zvalue=$codigov;
     include('ele_input.php');
     
     
$zobj=1;     
include('ele_break.php');

     $zid='umdd';
     $zlabel='U.Medida';
     $zvalue=$umdd;
     $ztabla='umdd';
     $zlist='dl_umdd';
     include('ele_select.php');
     
     $zid='duni';
     $zlabel='Dec.Unid.';
     $zvalue=$duni;
     $zmin=0;
     $zmax=6;
     $zclass='numeric-dec';
     include('ele_input.php');
     
     $zid='dcos';
     $zlabel='Dec.Costo';
     $zvalue=$dcos;
     $zmin=0;
     $zmax=6;
     $zclass='numeric-dec';
     include('ele_input.php');
     
     $zid='dpre';
     $zlabel='Dec.Precio';
     $zvalue=$dpre;
     $zmin=0;
     $zmax=6;
     $zclass='numeric-dec';
     include('ele_input.php');
     
$zobj=2;     
include('ele_break.php');
     
     $zid='iva';
     $zlabel='I.V.A.';
     $zvalue=$iva;
//      $ztype='numeric-int';
//      $zlist='dl_iva';
     $zmin=0;
     $zmax=999;
     $zoptions='0;12';
     include('ele_select.php');

     
     
     
     
     
$zobj=1;     
include('ele_break.php');

for($idx=1; $idx<=5; $idx++)
{
     $zid='puni'.$idx;
     $zlabel='P.Unit.'.$idx;
     $zvalue=${'puni'.$idx};
     $zmin=0;
     $zmax=9999.99;
     $zclass='numeric-dec';
     $zonchange='calc_precio();';
     $zonblur='calc_precio();';
     include('ele_input.php');
     
     $zid='dcto'.$idx;
     $zlabel='Dcto.'.$idx;
     $zvalue=${'dcto'.$idx};
     $zmin=0;
     $zmax=9999.99;
     $zclass='numeric-dec';
     $zonchange='calc_precio();';
     $zonblur='calc_precio();';
     include('ele_input.php');
     
     $zid='pvp'.$idx;
     $zlabel='P.V.P. '.$idx;
     $zvalue=${'pvp'.$idx};
     $zmin=0;
     $zmax=9999.99;
     $zclass='numeric-dec';
     $zonchange='calc_precio();';
     $zonblur='calc_precio();';
     include('ele_input.php');
     
     
     
//      $zobj=1;     
//      include('ele_break.php');
     
}
     
}

// echo '<span style="float:right; white-space:nowrap;">';     
// echo $msgres;
// echo '</span>';     
  
  
if(@mb_stristr('posi.liga.nive.torn.team',$modu))
  {
     $zid='descri';
     $zlabel='Descripción';
     $zvalue=$descri;
     $zwidth=40;
     $zrows=2;
     include('ele_input.php');
     
     $zobj=1;     
     include('ele_break.php');
     
  }  
  
if(@mb_stristr('posi',$modu))
  {     
     $zid='abrevia';
     $zlabel='Abreviación';
     $zvalue=$abrevia;
     $zwidth=5;
     include('ele_input.php');

  }
// TITULO     
     
}     
// include('ele_break.php');
echo '</div>';


// RESULTADO
//      $zobj=1;     
     include('ele_break.php');

echo '<div id="main2" >';

$sql_idx=1;

//if(1==2)     
for($idx=1; $idx<=$sql_idx; $idx++)
{
     if(gettype($res_info)!='NULL')
     {
          $zreso=$res_info;
          $zinfo=$info;
          $zname=$zname;
          $zhead=0;
          $zgfsize=0.9;
//           $zblockrows=3;
//           $zheightrow='1.5em;';
          $zheightrow='3em;';
          $zblockidnum=1;
          include('ele_grid.php');     
          
//           if($info=='vtblog')
//           {if($idx<msql_num_rows($res_krdx)){echo '<div id="pgbreak" style="height:2em;"></div>';}}

     }
}     

echo '</div>';     


?>

<script>
function fn_nuevo(event)
{
     var enti;
     swal.fire({
          icon:'warning',
          title:'Nuevo Codigo',
          text:'Continuar ?',
          confirmButtonText:'Nuevo',
          confirmButtonColor:color1,
          focusCancel:true,
          showCancelButton:true,
          cancelButtonColor: 'darkred',
          timer:10000
     }).then((result) => 
          {
               if(result.isConfirmed)
               {
//                     fn_consulta();
                    var xhref='';
                    xhref=xhref+'?scri=<?php echo basename(__FILE__,'.php');?>';
                    xhref=xhref+'&modu=<?php echo $modu;?>';
//                document.getElementById("main2").innerHTML='Espere...';
                    location.href=xhref;
               }
          })
}     
     
</script>



<script>
function fn_consulta(event)
{
     var xhref='',dataget;
     xhref=xhref+'?scri=<?php echo basename(__FILE__,'.php');?>';

     xhref=xhref+'&codigo='+document.getElementById('codigo').value;
     dataget=new_FormData('filtros','get');
     xhref=xhref+dataget;
// alert(xhref);
     location.href=xhref;
}
</script>


<script>document.title="<?php echo $xtitle;?>"</script>
<script>document.getElementById('topcenter').innerHTML="<?php echo $xtopcenter;?>"</script>
<!-- <script>set_noback();</script> -->
<!-- <script>window.onbeforeunload = function(){return 'Are you sure you want to leave?';};</script> -->

