noalyss  Version-6.7.2
 All Data Structures Namespaces Files Functions Variables Enumerations
popup.php
Go to the documentation of this file.
00001 <?php
00002 /*
00003  *   This file is part of NOALYSS.
00004  *
00005  *   NOALYSS is free software; you can redistribute it and/or modify
00006  *   it under the terms of the GNU General Public License as published by
00007  *   the Free Software Foundation; either version 2 of the License, or
00008  *   (at your option) any later version.
00009  *
00010  *   NOALYSS is distributed in the hope that it will be useful,
00011  *   but WITHOUT ANY WARRANTY; without even the implied warranty of
00012  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00013  *   GNU General Public License for more details.
00014  *
00015  *   You should have received a copy of the GNU General Public License
00016  *   along with NOALYSS; if not, write to the Free Software
00017  *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00018  */
00019 
00020 require_once('../include/ac_common.php');
00021 require_once('function_javascript.php');
00022 require_once('class_html_input.php');
00023 require_once('class_dossier.php');
00024 require_once('class_database.php');
00025 require_once('class_user.php');
00026 require_once('class_periode.php');
00027 echo '<div style="float:left;">'.HtmlInput::print_window();
00028 
00029 html_page_start($_SESSION['g_theme']);
00030 global $g_user;
00031 if ( basename($_GET['ajax']) == 'ajax_history.php' )
00032   {
00033     $href=dossier::get();
00034     $cn=new Database(dossier::id());
00035     /* current year  */
00036     $g_user=new User($cn);
00037     $exercice=$g_user->get_exercice();
00038 
00039     /* get date limit */
00040     $periode=new Periode($cn);
00041     $limit=$periode->get_limit($exercice);
00042 
00043     $from_periode='from_periode='.format_date($limit[0]->p_start);
00044     $to_periode='to_periode='.format_date($limit[1]->p_end);
00045     if (isset($_GET['ex']))
00046       {
00047         if ( $exercice > $_GET['ex'])
00048           {
00049             $limit_periode=$periode->get_limit($_GET['ex']);
00050             $from_periode='from_periode='.format_date($limit_periode[0]->p_start);
00051           }
00052         else
00053           {
00054             $limit_periode=$periode->get_limit($_GET['ex']);
00055             $to_periode='to_periode='.format_date($limit_periode[1]->p_end);
00056 
00057           }
00058       }
00059 
00060     if (isset($_GET['pcm_val']) )
00061       {
00062         $href_csv="export.php?".$href.'&poste_id='.$_GET['pcm_val'].'&ople=0&type=poste&'.$from_periode.'&'.$to_periode."&act=CSV:postedetail";
00063         $href_pdf="export.php?".$href.'&poste_id='.$_GET['pcm_val'].'&ople=0&type=poste&'.$from_periode.'&'.$to_periode."&act=PDF:postedetail";;
00064       }
00065     else
00066       {
00067         $href_csv="export.php?".$href.'&f_id='.$_GET['f_id'].'&ople=0&type=poste&'.$from_periode.'&'.$to_periode."&act=CSV:fichedetail";
00068         $href_pdf="export.php?".$href.'&f_id='.$_GET['f_id'].'&ople=0&type=poste&'.$from_periode.'&'.$to_periode."&act=PDF:fichedetail";
00069       }
00070 
00071     echo '<a class="smallbutton"  href="'.$href_csv.'">'._("Export CSV").'</a>';
00072     echo '<a class="smallbutton"  href="'.$href_pdf.'">'._("Export PDF").'</a>';
00073   }
00074 echo '</div>';
00075 echo HtmlInput::hidden('inpopup',1);
00076 load_all_script();
00077 
00078 $str=$_SERVER['QUERY_STRING']."&div=popup";
00079 $script="
00080         var obj={'id':'popup','fixed':1,'class':'content',style:'width:auto','html':loading(),'qs':'$str',js_success:'success_box','js_error':null,'callback':'".$_GET['ajax']."'};
00081         show_box(obj);
00082         ";
00083 echo create_script($script);
00084 ?>
 All Data Structures Namespaces Files Functions Variables Enumerations