Go to the documentation of this file.00001 <?php
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
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
00036 $g_user=new User($cn);
00037 $exercice=$g_user->get_exercice();
00038
00039
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 ?>