error_reporting(E_ALL ^ E_NOTICE ^ E_WARNING);
session_start();
if (!isset($_SESSION["permiso"])){
echo "Session Expired";
die;
}
include("../common/get_post.php");
include("../config.php");
include ("../lang/admin.php");
//foreach ($arrHttp as $var=>$value) echo "$var=$value
";
if (isset($arrHttp["Expresion"])){
$arrHttp["Expresion"]=stripslashes($arrHttp["Expresion"]);
if (strpos('"',$arrHttp["Expresion"])==0) {
$arrHttp["Expresion"]=str_replace('"','',$arrHttp["Expresion"]);
}
$Expresion=urlencode($arrHttp["Expresion"]);
}
switch ($arrHttp["Opcion"]){
case "vence":
$arrHttp["pft"]="mov";
break;
case "suspen":
$arrHttp["pft"]="susp";
break;
case "fine":
$arrHttp["pft"]="susp";
break;
}
$Formato=$db_path.$arrHttp["base"]."/pfts/".$_SESSION["lang"]."/".$arrHttp["pft"].".pft";
if (!file_exists($Formato)){
$Formato=$db_path.$arrHttp["base"]."/pfts/".$lang_db."/".$arrHttp["pft"].".pft";
}
if (file_exists($Formato)) $Formato="@".$Formato;
// READ THE HEADINGS, IF ANY
$heading="".$arrHttp["title"]."";
$head=$db_path.$arrHttp["base"]."/pfts/".$_SESSION["lang"]."/".$arrHttp["pft"].".tab";
if (!file_exists($head)){
$head=$db_path.$arrHttp["base"]."/pfts/".$lang_db."/".$arrHttp["pft"].".tab";
}
if (file_exists($head)){
$fp=file($head);
$head=implode('',$fp);
$h=explode('|',$head);
foreach ($h as $value)
if (trim($value!="")) $heading.="
".trim($value)." | ";
}
if (isset($arrHttp["Expresion"])) {
$Opcion="buscar";
}else{
$Opcion="rango";
}
$query = "&base=".$arrHttp["base"]."&cipar=$db_path"."par/".$arrHttp["cipar"]."&Expresion=".$Expresion."&Opcion=$Opcion&Word=S&Formato=".$Formato;
$query.="&from=".$arrHttp["Mfn"]."&to=".$arrHttp["to"];
if (!isset($arrHttp["sortkey"])){
$IsisScript=$xWxis."imprime.xis";
}else{
$query.='&sortkey='.urlencode($arrHttp["sortkey"]);
$IsisScript=$xWxis."sort.xis";
}
include("../common/wxis_llamar.php");
$data=$heading;
foreach ($contenido as $linea){
$l=explode('|',$linea);
switch ($arrHttp["Opcion"]){
case "vence":
$user=$l[2];
$usr_data=UserData($l[2]);
$data.="\n| ".$l[4]." | ";
$data.=$usr_data;
$data.="".$l[0]." | ".$l[1]." | ".$l[2]." | ".$l[3]." | ".FormatDate($l[5])." | ".$l[6]." | ";
$data.="".FormatDate($l[7])." | ".$l[8]." | ".$l[9]." | ".$l[10]." | ".$l[11]." | ";
break;
case "suspen":
case "fine":
$user=$l[2];
$usr_data=UserData($l[2]);
$data.="\n
| ".$l[2]." | ";
$data.=$usr_data;
$data.="".$l[0]." | ".$l[1]." | ".FormatDate($l[3])." | ".$l[4]." | ";
$data.="".$l[5]." | ".FormatDate($l[6])." | ".$l[7]." | ".$l[8]." | ".$l[9]." | ";
break;
}
}
$data.="\n";
switch ($arrHttp["vp"]){
case "WP":
$filename=$arrHttp["base"].".doc";
header('Content-Type: application/msword; charset=windows-1252');
header("Content-Disposition: attachment; filename=\"$filename\"");
header("Expires: 0");
header("Cache-Control: must-revalidate, post-check=0,pre-check=0");
header("Pragma: public");
echo '' . "\n";
break;
case "TB":
$filename=$arrHttp["base"].".xls";
header('Content-Type: application/excel; charset=windows-1252');
header("Content-Disposition: attachment; filename=\"$filename\"");
header("Expires: 0");
header("Cache-Control: must-revalidate, post-check=0,pre-check=0");
header("Pragma: public");
echo '' . "\n";
break;
case "TXT":
$filename=$arrHttp["base"].".txt";
header('Content-Type: application/excel; charset=windows-1252');
header("Content-Disposition: attachment; filename=\"$filename\"");
header("Expires: 0");
header("Cache-Control: must-revalidate, post-check=0,pre-check=0");
header("Pragma: public");
break;
default:
}
include("../common/header.php");
echo "
";
echo "\n";
echo "
";
echo $data;
switch ($arrHttp["tipof"]){ //TYPE OF FORMAT
case "T": //TABLE
echo "";
break;
case "P": //PARRAGRAPH
echo "