noalyss Version-9
popup.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
20require_once '../include/constant.php';
21require_once NOALYSS_INCLUDE.'/lib/ac_common.php';
22require_once NOALYSS_INCLUDE.'/lib/function_javascript.php';
23require_once NOALYSS_INCLUDE.'/lib/html_input.class.php';
24require_once NOALYSS_INCLUDE.'/lib/icon_action.class.php';
25require_once NOALYSS_INCLUDE.'/class/dossier.class.php';
26require_once NOALYSS_INCLUDE.'/class/database.class.php';
27require_once NOALYSS_INCLUDE.'/lib/http_input.class.php';
28require_once NOALYSS_INCLUDE . '/class/noalyss_user.class.php';
29require_once NOALYSS_INCLUDE.'/class/periode.class.php';
30
32/*
33 * Check if the user is still connected
34 */
35if ( ! isset ($_SESSION[SESSION_KEY.'g_user'] ) )
36{
37 echo "<h2>"._('Vous êtes déconnecté')."</h2>";
38 $backurl=$_SERVER['REQUEST_URI'];
39 $url="index.php?".http_build_query(array('reconnect'=>1,'backurl'=>urlencode($backurl)));
41 exit();
42}
43
44
45html_page_start($_SESSION[SESSION_KEY.'g_theme']);
46echo '<div style="float:left;">';
47?>
48<script>
49/**
50 * All the onload must be here otherwise the other will overwritten
51 * @returns {undefined}
52 */
53window.onload=function ()
54{
55 create_anchor_up();
56 init_scroll();
57 sorttable.init
58}
59</script>
60<?php
61global $g_user;
63$g_user=new Noalyss_user($cn);
64$g_user->Check();
65$g_user->check_dossier(Dossier::id());
66
67if ( basename($_GET['op']) == 'history' )
68 {
69 $href=dossier::get();
70
71 $exercice=$http->get("exercice","number",0);
72
73 /* current year */
74 if ($exercice == 0 ) {
75 $exercice=$g_user->get_exercice();
76 }
77
78 /* get date limit */
79 $periode=new Periode($cn);
80 $limit=$periode->get_limit($exercice);
81
82 $from_periode='from_periode='.format_date($limit[0]->p_start);
83 $to_periode='to_periode='.format_date($limit[1]->p_end);
84 if (isset($_GET['ex']))
85 {
86 $ex=$http->get("ex","number");
87 if ( $exercice > $ex)
88 {
89 $limit_periode=$periode->get_limit($ex);
90 $from_periode='from_periode='.format_date($limit_periode[0]->p_start);
91 }
92 else
93 {
94 $limit_periode=$periode->get_limit($ex);
95 $to_periode='to_periode='.format_date($limit_periode[1]->p_end);
96
97 }
98 }
99
100 if (isset($_GET['pcm_val']) )
101 {
102 $pcm_val=$http->get("pcm_val");
103 $href_csv="export.php?".$href.'&poste_id='.$pcm_val.'&ople=0&type=poste&'.$from_periode.'&'.$to_periode."&act=CSV:postedetail";
104 $href_pdf="export.php?".$href.'&poste_id='.$pcm_val.'&ople=0&type=poste&'.$from_periode.'&'.$to_periode."&act=PDF:postedetail";;
105 }
106 else
107 {
108 $f_id=$http->get("f_id","number");
109 $href_csv="export.php?".$href.'&f_id='.$f_id.'&ople=0&type=poste&'.$from_periode.'&'.$to_periode."&act=CSV:fichedetail";
110 $href_pdf="export.php?".$href.'&f_id='.$f_id.'&ople=0&type=poste&'.$from_periode.'&'.$to_periode."&act=PDF:fichedetail";
111 }
113 echo '<a class="smallbutton" href="'.$href_csv.'">'._("Export CSV").'</a>';
114 echo '<a class="smallbutton" href="'.$href_pdf.'">'._("Export PDF").'</a>';
115 }
116 else {
118 }
119echo '</div>';
120echo HtmlInput::hidden('inpopup',1);
122
123$str=$_SERVER['QUERY_STRING']."&div=popup";
124$ajax=$http->get("ajax");
126 var obj={id:'popup',fixed:1,cssclass:'content',style:'width:auto',html:loading(),qs:'$str',js_success:'success_box',js_error:null,callback:'".$ajax."'};
127 show_box(obj);
128 ";
130?>
html_page_start($p_theme="", $p_script="", $p_script2="")
Default page header for each page.
Definition: ac_common.php:275
$href
Definition: adm.inc.php:31
$url
catch(Exception $e) $exercice
$ex
Definition: balance.inc.php:45
$limit_periode
$_GET['qcode']
static id()
return the 'gDossier' value after a check
static connect()
static print_window()
Javascript to print the current window.
static hidden($p_name, $p_value, $p_id="")
manage the http input (get , post, request) and extract from an array
For the periode tables parm_periode and jrn_periode.
for($e=0; $e< count($afiche); $e++) exit
load_all_script()
load all the javascript only one time
create_script($p_string)
create the HTML for adding the script tags around of the script
$cn
Definition: popup.php:62
$str
Definition: popup.php:123
$http
Definition: popup.php:31
global $g_user
Definition: popup.php:61
$ajax
Definition: popup.php:124
$script
Definition: popup.php:125
redirect($p_string, $p_time=0)