noalyss  Version-6.7.2
 All Data Structures Namespaces Files Functions Variables Enumerations
balance_card.inc.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 // Copyright Author Dany De Bontridder danydb@aevalys.eu
00021 
00022 /*!\file
00023  * \brief show the status of a card
00024  */
00025 if ( ! defined ('ALLOWED') ) die('Appel direct ne sont pas permis');
00026 require_once('class_exercice.php');
00027 global $g_user;
00028 echo '<div class="content" style="width:90%;margin-left:5%">';
00029 $exercice=new Exercice($cn);
00030 $old='';
00031 $fiche=new Fiche($cn,$_GET['f_id']);
00032 $year=$g_user->get_exercice();
00033 if ( $year == 0 )
00034   {
00035     $html=_("erreur aucune période par défaut, allez dans préférence pour en choisir une");
00036   }
00037 else
00038   {
00039     $per=new Periode($cn);
00040     $limit_periode=$per->get_limit($year);
00041     $array['from_periode']=$limit_periode[0]->first_day();
00042     $array['to_periode']=$limit_periode[1]->last_day();
00043     if (isset($_GET['ex']))
00044       {
00045         $limit_periode=$per->get_limit($_GET['ex']);
00046         $array['from_periode']=$limit_periode[0]->first_day();
00047       }
00048 
00049     /*
00050      * Add button to select another year
00051      */
00052     if ($exercice->count() > 1 )
00053       {
00054         $default=(isset($_GET['ex']))?$_GET['ex']:$year;
00055         $dossier=dossier::id();
00056 
00057             $old='<form method="get" action="do.php">';
00058             $is=$exercice->select('ex',$default,'onchange = "submit(this)"');
00059             $old.="Autre exercice ".$is->input();
00060             $old.=HtmlInput::hidden('f_id',$_GET['f_id']);
00061             $old.=HtmlInput::hidden('ac',$_GET['ac']);
00062             $old.=HtmlInput::hidden('sb',$_GET['sb']);
00063             $old.=HtmlInput::hidden('sc',$_GET['sc']);
00064             $old.=dossier::hidden();
00065             $old.='</form>';
00066       }
00067 
00068     if (   $fiche->HtmlTable($array,0,0)==-1){
00069       echo h2(_("Aucune opération pour l'exercice courant"),'class="error"');
00070     }
00071     echo $old;
00072 
00073   }
00074 
00075 echo '</div>';
 All Data Structures Namespaces Files Functions Variables Enumerations