<?php 
session_start();
foreach($_GET as $campo => $valor){${$campo}=trim($valor);} 
foreach($_POST as $campo => $valor){${$campo}=trim($valor);} 

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);

$ztabla='pers';
$zid='cedula_dl';
include('ele_datalist.php');

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

     $src='//'.$domain.'/_lib/nomi_perso.js'.$js_version;
     $script=$dom->appendChild($dom->createElement("script"," "));
     $script->setAttribute("src",$src);
echo $dom->saveXML();


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

$divp = $dom->createElement("div", "");
$dom->appendChild($divp);
$divp->setAttribute("id","dato_emple");

$divc = $dom->createElement("div", "");
$dom->appendChild($divc);
$divc->setAttribute("id","divc");
$divc->setAttribute("style","position:relative;");

$zdom   = $dom;
$zele   = $divc;
$zobj   = 2;
$zid    = 'cedula' ;
$zlabel = "Cédula";
$ztabla='pers';
$zonblur="{nombre_perso();consu_emple();}";
include('ele_input.php');

$zdom = $dom;
$zele = $divc;
$zobj = 2;
$zid ='apellido' ;
$zwidth=15;
$zmaxlen= 25;
$zreado=0;
include('ele_input.php');

$zdom   = $dom;
$zele   = $divc;
$zobj = 2;
$zid ='nombre' ;
$zwidth=15;
$zmaxlen= 25;
$zreado=0;
include('ele_input.php');

$divd = $dom->createElement("div", "");
$dom->appendChild($divd);
$divd->setAttribute("id","divd");
$divd->setAttribute("style","position:relative;");

$zdom   = $dom;
$zele   = $divd;
$zobj = 2;
$zid ='cia' ;
$ztabla="empr" ;
include('ele_select.php');

$zdom   = $dom;
$zele   = $divd;
$zobj = 2;
$zid ='anticipo' ;
$zwidth=3;
$zmaxlen=3;
$zoptions = "-,Elejir;M,Mensual;Q,Quincenal;S,Semanal;";
include('ele_select.php');

// $ztabla = "dpto";
// include('ele_datalist.php');

$zdom   = $dom;
$zele   = $divd;
$zid ='dpto' ;
$ztabla='dpto';
include('ele_select.php');


$zdom   = $dom;
$zele   = $divd;
$zid ='cargo' ;
$ztabla='carg';
include('ele_select.php');

$zdom   = $dom;
$zele   = $divd;
$zobj = 2;
$zid ='contrato' ;
$zwidth=3;
$zmaxlen=3;
$zoptions = "-,Elejir;F,Fijo;T,Temporal;H,Horas;S,Servicio Prestado";
include('ele_select.php');

$zdom   = $dom;
$zele   = $divd;
$zobj = 2;
$zid ='sectorial' ;
$zwidth=10;
$zmaxlen=15;
//$zoptions = "-,Elejir;G,Gerente;M,Jefe Compras;S,Jefe Sistemas;C,Contadora;A,Auxiliar Contable;J,Cajera;";
include('ele_input.php');

$zdom   = $dom;
$zele   = $divd;
$zobj = 2;
$zid ='afilia' ;
$zlabel = "Afiliación";
$ztype='date';
include('ele_input.php');

$zdom   = $dom;
$zele   = $divd;
$zobj = 2;
$zid ='sueldo' ;
$ztype='number';
$zmaxlen=10;
$zwidth=8;
$zvalue = 0.00;
$zclass='numeric-dec';
include('ele_input.php');

$zdom   = $dom;
$zele   = $divd;
$zobj = 2;
$zid ='movil' ;
$ztype='number';
$zlabel = "Movilidad";
$zmaxlen=10;
$zwidth=8;
$zvalue = 0.00;
$zclass='numeric-dec';
include('ele_input.php');

$zdom   = $dom;
$zele   = $divd;
$zobj = 2;
$zid ='poranti' ;
$ztype='number';
$zlabel = "Anticipo";
$zplace="%" ;
$zmaxlen=3;
$zwidth=2;
$zvalue = 0.00;
$zclass='numeric-dec';
include('ele_input.php');

$zdom   = $dom;
$zele   = $divd;
$zobj = 1;
$zid ='valanti' ;
$ztype='number';
$zmaxlen=5;
$zwidth=5;
$zvalue = 0.00;
$zplace="Valor" ;
$zclass='numeric-dec';
include('ele_input.php');

$zdom   = $dom;
$zele   = $divd;
$zobj = 2;
$zid ='transp' ;
$ztype='number';
$zlabel = "Transporte";
$zmaxlen=5;
$zwidth=5;
$zvalue = 0.00;
$zclass='numeric-dec';
include('ele_input.php');

$zdom   = $dom;
$zele   = $divd;
$zobj = 2;
$zid ='alimen' ;
$ztype='number';
$zlabel = "Alimentación";
$zmaxlen=5;
$zwidth=5;
$zvalue = 0.00;
$zclass='numeric-dec';
include('ele_input.php');

$zdom   = $dom;
$zele   = $divd;
$zobj = 2;
$zid ='horae' ;
$zlabel = "Horas Extra";
$zoptions='-,Elejir;S,Si;N,No';
include('ele_select.php');

$zdom   = $dom;
$zele   = $divd;
$zobj = 2;
$zid ='bnavi' ;
$zlabel = "Bono Navideño";
$zoptions='-,Elejir;M,Mensual;A,Acumulado';
include('ele_select.php');

$zdom   = $dom;
$zele   = $divd;
$zobj = 2;
$zid ='besco' ;
$zlabel = "Bono Escolar";
$zoptions='-,Elejir;M,Mensual;A,Acumulado';
include('ele_select.php');

$zdom   = $dom;
$zele   = $divd;
$zobj = 2;
$zid ='fr' ;
$zlabel = "Fondo Reserva";
$zoptions='-,Elejir;N,No Aplica;M,Mensual;A,Acumulado';
include('ele_select.php');

$div3 = $dom->createElement("div", "");
$dom->appendChild($div3);
$div3->setAttribute("id","div3");
$div3->setAttribute("style","float:right;");

$zdom=$dom;
$zele=$div3;
$zobj = 2;
$zid ='grabar' ;
$zlabel="GRABAR";
$zonclick="{graba_emple();}";
include('ele_button.php');

$zdom=$dom;
$zele=$div3;
$zobj = 2;
$zid ='consulta' ;
$zlabel="CONSULTAR";
$zonclick="{consu_emple();}";
include('ele_button.php');

$zdom=$dom;
$zele=$div3;
$zobj = 2;
$zid ='limpiar' ;
$zlabel="CANCELAR";
$zonclick="{limpia_emple();}";
include('ele_button.php');

echo $dom->saveXML();

//Formas = ele_select, ele_input, ele_button,  ele_title
$xtitulo = "Empleado";
?>
<div id="result"></div>

<script>document.title="<?php echo $xtitulo;?>"</script>
<script type="text/javascript">consu_emple();</script>