noalyss Version-9
NOALYSS : serveur de comptabilité et ERP (2002)
Loading...
Searching...
No Matches
export.php
Go to the documentation of this file.
1<?php
2/*
3 * This file is part of NOALYSS.
4 *
5 * NOALYSS is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
9 *
10 * NOALYSS is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with NOALYSS; if not, write to the Free Software
17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18*/
19
20// Copyright Author Dany De Bontridder danydb@aevalys.eu
21
22/*!\file
23 * \brief manage all the export to CSV or PDF
24 * act can be
25 *
26 */
27define ('ALLOWED',1);
28require_once '../include/constant.php';
29require_once NOALYSS_INCLUDE.'/lib/ac_common.php';
30MaintenanceMode("block.html");
31
33require_once NOALYSS_INCLUDE.'/class/database.class.php';
34require_once NOALYSS_INCLUDE . '/class/noalyss_user.class.php';
35require_once NOALYSS_INCLUDE.'/lib/http_input.class.php';
36
37$g_user=new Noalyss_user(new Database());
39// load message for javascript
40if (isset ($_REQUEST['loadjs']) && $_REQUEST['loadjs']=='message')
41{
42 include_once NOALYSS_INCLUDE."/lib/message_javascript.php";
43 return;
44}
46$g_user=new Noalyss_user($cn);
47$gDossier=dossier::id();
49mb_internal_encoding("UTF-8");
50$g_user->Check();
51$action=$g_user->check_dossier($gDossier);
52
54$action=$hi->get("act");
55
56if ( $action=='X' || $g_user->check_print($action)==0 )
57 {
58 echo alert(_('Accès interdit'));
59 redirect("do.php?".dossier::get());
60 exit();
61 }
62// get file and execute it
63
64 $prfile=$cn->get_value("select me_file from menu_ref where me_code=$1",array($action));
65
66if ( LOGINPUT)
67{
68 $file_loginput=fopen($_ENV['TMP'].'/export-'.$prfile.'-'.$_SERVER['REQUEST_TIME'].'.php','a+');
69 fwrite ($file_loginput,"<?php \n");
70 fwrite ($file_loginput,'//@description: export '.$prfile."\n");
71 fwrite($file_loginput, '$_GET='.var_export($_GET,true));
72 fwrite($file_loginput,";\n");
73 fwrite($file_loginput, '$_POST='.var_export($_POST,true));
74 fwrite($file_loginput,";\n");
75 fwrite($file_loginput, '$_POST[\'gDossier\']=$gDossierLogInput;');
76 fwrite($file_loginput,"\n");
77 fwrite($file_loginput, '$_GET[\'gDossier\']=$gDossierLogInput;');
78 fwrite($file_loginput,"\n");
79 fwrite($file_loginput,' $_REQUEST=array_merge($_GET,$_POST);');
80 fwrite($file_loginput,"\n");
81 fclose($file_loginput);
82}
83
84 if ( $prfile == "" || !file_exists(NOALYSS_INCLUDE."/export/$prfile")) {
86 die (_('Export impossible'));
87 }
88 require_once NOALYSS_INCLUDE."/export/$prfile";
89 ?>
MaintenanceMode($p_file)
When you want to prevent users to connect, create a file in noalyss/ (NOALYSS_BASE) with the message ...
set_language()
set the lang thanks the _SESSION['g_lang'] var.
alert($p_msg, $buffer=false)
alert in javascript
global $g_parameter
global $g_user
if no group available , then stop
$_REQUEST['ac']
_("actif, passif,charge,...")
$_GET['qcode']
contains the class for connecting to Noalyss
static connect()
manage the http input (get , post, request) and extract from an array
Class to manage the company parameter (address, name...)
$_POST['ac']
Definition do.php:312
$hi
Definition export.php:53
if( $action=='X'|| $g_user->check_print($action)==0) $prfile
Definition export.php:64
for($e=0; $e< count($afiche); $e++) exit
print
Type of printing.
redirect($p_string, $p_time=0)