$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 ""; break; case "CT": //COLUMNS (TABLE) echo "
"; break; case "CD": break; } die; //========================================================== function UserData($user){ global $db_path,$Wxis,$wxisUrl,$xWxis; $formato_us=$db_path."users/loans/".$_SESSION["lang"]."/tbuser.pft"; if (!isset($formato_us)) $formato_us=$db_path."users/loans/".$lang_db."/tbuser.pft"; $query = "&Expresion=CO_".$user."&base=users&cipar=$db_path/par/users.par&Formato=".$formato_us; $contenido=""; $IsisScript=$xWxis."cipres_usuario.xis"; include("../common/wxis_llamar.php"); $cont=trim(implode("",$contenido)); $c=explode("|",$cont); $output=""; foreach ($c as $linea){ $linea=trim($linea); if ($linea!="") $output.= "".$linea.""; } if ($output=="") $output="  "; return $output; } function FormatDate ($FechaP){ global $locales,$config_date_format; //CONVERT ISO DATE TO LOCAL DATE FORMAT $f_date=explode('/',$config_date_format); switch ($f_date[0]){ case "DD": $exp_date=substr($FechaP,6,2)."-".substr($FechaP,4,2)."-".substr($FechaP,0,4); break; case "MM": $exp_date=substr($FechaP,4,2)."-".substr($FechaP,6,2)."-".substr($FechaP,0,4); break; } return $exp_date; } ?>