noalyss Version-10
NOALYSS : serveur de comptabilité et ERP (2002)
Loading...
Searching...
No Matches
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)));
40 redirect($url);
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;
62$cn=Dossier::connect();
63$g_user=new Noalyss_user($cn);
64$g_user->Check();
65/**
66 * check if 2FA is completed
67 */
68if ( ! $g_user->is_double_identified()) {
69 exit();
70}
71$g_user->check_dossier(Dossier::id());
72
73if ( basename($_GET['op']) == 'history' )
74 {
75 $href=dossier::get();
76
77 $exercice=$http->get("exercice","number",0);
78
79 /* current year */
80 if ($exercice == 0 ) {
81 $exercice=$g_user->get_exercice();
82 }
83
84 /* get date limit */
85 $periode=new Periode($cn);
86 $limit=$periode->get_limit($exercice);
87
88 $from_periode='from_periode='.format_date($limit[0]->p_start);
89 $to_periode='to_periode='.format_date($limit[1]->p_end);
90 if (isset($_GET['ex']))
91 {
92 $ex=$http->get("ex","number");
93 if ( $exercice > $ex)
94 {
95 $limit_periode=$periode->get_limit($ex);
96 $from_periode='from_periode='.format_date($limit_periode[0]->p_start);
97 }
98 else
99 {
100 $limit_periode=$periode->get_limit($ex);
101 $to_periode='to_periode='.format_date($limit_periode[1]->p_end);
102
103 }
104 }
105
106 if (isset($_GET['pcm_val']) )
107 {
108 $pcm_val=$http->get("pcm_val");
109 $href_csv="export.php?".$href.'&poste_id='.$pcm_val.'&ople=0&type=poste&'.$from_periode.'&'.$to_periode."&act=CSV:postedetail";
110 $href_pdf="export.php?".$href.'&poste_id='.$pcm_val.'&ople=0&type=poste&'.$from_periode.'&'.$to_periode."&act=PDF:postedetail";;
111 }
112 else
113 {
114 $f_id=$http->get("f_id","number");
115 $href_csv="export.php?".$href.'&f_id='.$f_id.'&ople=0&type=poste&'.$from_periode.'&'.$to_periode."&act=CSV:fichedetail";
116 $href_pdf="export.php?".$href.'&f_id='.$f_id.'&ople=0&type=poste&'.$from_periode.'&'.$to_periode."&act=PDF:fichedetail";
117 }
119 echo '<a class="smallbutton" href="'.$href_csv.'">'._("Export CSV").'</a>';
120 echo '<a class="smallbutton" href="'.$href_pdf.'">'._("Export PDF").'</a>';
121 }
122 else {
123 echo HtmlInput::print_window();
124 }
125echo '</div>';
126echo HtmlInput::hidden('inpopup',1);
128
129$str=$_SERVER['QUERY_STRING']."&div=popup";
130$ajax=$http->get("ajax");
132 var obj={id:'popup',fixed:1,cssclass:'content',style:'width:auto',html:loading(),qs:'$str',js_success:'success_box',js_error:null,callback:'".$ajax."'};
133 show_box(obj);
134 ";
136?>
html_page_start($p_theme="", $p_script="", $p_script2="")
Default page header for each page.
global $g_user
if no group available , then stop
$href
Definition adm.inc.php:31
catch(Exception $e) $exercice
_("actif, passif,charge,...")
$ex
$limit_periode
$_GET['qcode']
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($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
$ajax
Definition popup.php:130
$script
Definition popup.php:131