session_start(); if(isset($_SESSION["userinfo"])){ $nscript = pathinfo($_SERVER['PHP_SELF'], PATHINFO_FILENAME); $mod = explode("_",$nscript); $modulo = $mod[0]."_".$mod[1]; $modfrm = $mod[2]; $form = $modulo."/".$modfrm.".php"; //echo "nscript: ".$nscript." module: ".$modulo." form: ".$form; date_default_timezone_set("America/Mexico_City"); include "cnx.php"; include "util_list.php"; $conn = getConnection(); $usr = $_SESSION["userinfo"]["username"]; //$cia = $_SESSION["compania"]["idCompania"]; $aut=ValPerPag($usr,$modulo); //$aut=1; if ($aut == 1) { include "util_frame.php"; $idprs = $_GET["id"]; /* $person = isset($_SESSION[$modulo]["personalizacion"])?unserialize($_SESSION[$modulo]["personalizacion"]):null; $idper = !is_null($person)?$person["cve_pers"]:""; */ $sql="select * from sis_prs_trj where cve_prs='$idprs'"; $arrPer=getDataFromTable($conn,$sql); foreach($arrPer as $per){ $trj = $per["cve_trj"]; $nom = $per["nom_cli"]; $fcn = $per["fec_nac"]; $ema = $per["mail_cli"]; $tel = $per["tel_cli"]; $fis = $per["fiscal_id"]; $pic = $per["photo"]; //eliminamos data:image/png; y base64, de la cadena que tenemos list(, $pic) = explode(';', $pic); list(, $pic) = explode(',', $pic); //Decodificamos $pic codificada en base64. $pic = base64_decode($pic); //escribimos la informaciĆ³n obtenida en un archivo $file = "pic_tmp/".$trj.".png"; file_put_contents($file, $pic); } $allJS=""; getHeaderFrm("Personalizacion", $allJS); ?>
if(isset($_SESSION[$modfrm])){ unset($_SESSION[$modfrm]); } getFooterFrm(); } else { header("Location: ./main.phtml"); } }else{ header("Location: ."); } ?>