<?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_perso");

$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="{carga_perso();}";
include('ele_input.php');

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

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

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

$zdom=$dom;
$zele=$div2;
$zobj = 2;
$zid ='sexo' ;
$zoptions='-,Elejir;M,Masculino;F,Femenino;';
include('ele_select.php');

$zdom=$dom;
$zele=$div2;
$zobj = 2;
$zid ='nacimi' ;
$zlabel = "Nacimiento";
$ztype='date';
include('ele_input.php');

$zdom=$dom;
$zele=$div2;
$zobj = 2;
$zid ='direccion' ;
$zwidth=20;
$zlabel = "Dirección";
include('ele_input.php');

$zdom=$dom;
$zele=$div2;
$zobj = 2;
$zid ='telefono' ;
$ztype='number';
$zlabel = "Teléfono";
$zmaxlen=10;
$zwidth=6;
include('ele_input.php');

$zdom=$dom;
$zele=$div2;
$zobj = 2;
$zid ='correo' ;
$zwidth=20;
include('ele_input.php');

$zdom=$dom;
$zele=$div2;
$zobj = 2;
$zid ='ecivil' ;
$zlabel = "Est. Civil";
$zoptions='-,Elejir;S,Soltero;C,Casado;D,Divorciado;V,Viudo;';
include('ele_select.php');

$zdom=$dom;
$zele=$div2;
$zobj = 2;
$zid ='tsangre' ;
$zlabel = "Tipo Sangre";
$zoptions='-,Elejir;O+;O-;B+;B-;A+;A-;AB+;AB-;';
include('ele_select.php');

$zdom=$dom;
$zele=$div2;
$zobj = 2;
$zid ='profesion' ;
$zlabel = "Profesional";
$zvalue = 'NO' ;
$zoptions='-,Elejir;S,Si;N,No';
include('ele_select.php');

$zdom=$dom;
$zele=$div2;
$zobj = 2;
$zid ='titulo' ;
$zlabel = "Título";
$zmaxlen=60;
$zwidth=40;
include('ele_input.php');

$zdom=$dom;
$zele=$div2;
$zobj = 2;
$zid ='contacto' ;
$zwidth=25;
$zmaxlen=40;
include('ele_input.php');

$zdom=$dom;
$zele=$div2;
$zobj = 2;
$zid ='discapa' ;
$zlabel = "Discapacitado";
// $zbool=1;
$zvalue = 'NO' ;
$zoptions='-,Elejir;S,Si;N,No';
include('ele_select.php');

$zdom=$dom;
$zele=$div2;
$zid ='porcentaje' ;
$ztype='number';
$zmaxlen=3;
$zwidth=2;
$zclass='numeric-dec';
include('ele_input.php');

$zdom=$dom;
$zele=$div2;
$zobj = 2;
$zid ='reemp' ;
$zlabel = "Reemplaza";
$zoptions='-,Elejir;S,Si;N,No';
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_perso();}";
include('ele_button.php');

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

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

echo $dom->saveXML();

$xtitulo = "Personal";
?>
<div id="result"></div>
<script>document.title="<?php echo $xtitulo;?>"</script>
<script type="text/javascript">consu_perso();</script>