Main Page | Namespace List | Class Hierarchy | Data Structures | Directories | File List | Data Fields | Globals | Related Pages

central.php

Go to the documentation of this file.
00001 <?
00002 
00003 /*
00004  *   This file is part of PhpCompta.
00005  *
00006  *   PhpCompta is free software; you can redistribute it and/or modify
00007  *   it under the terms of the GNU General Public License as published by
00008  *   the Free Software Foundation; either version 2 of the License, or
00009  *   (at your option) any later version.
00010  *
00011  *   PhpCompta is distributed in the hope that it will be useful,
00012  *   but WITHOUT ANY WARRANTY; without even the implied warranty of
00013  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00014  *   GNU General Public License for more details.
00015  *
00016  *   You should have received a copy of the GNU General Public License
00017  *   along with PhpCompta; if not, write to the Free Software
00018  *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00019 */
00020 // Copyright Author Dany De Bontridder ddebontridder@yahoo.fr
00021 /* $Revision: 1.16 $ */
00025 include_once ("ac_common.php");
00026 
00027 html_page_start($_SESSION['g_theme']);
00028 
00029 if ( ! isset ( $_SESSION['g_dossier'] ) ) {
00030   echo "You must choose a Dossier ";
00031   exit -2;
00032 }
00033 include_once ("postgres.php");
00034 /* Admin. Dossier */
00035 $rep=DbConnect();
00036 include_once ("class_user.php");
00037 $User=new cl_user($rep);
00038 $User->Check();
00039 include ("check_priv.php");
00040 include_once("preference.php");
00041 
00042 
00043 include_once ("user_menu.php");
00044 echo ShowMenuCompta($_SESSION['g_dossier'],"user_advanced.php");
00045 
00046 $cn=DbConnect($_SESSION['g_dossier']);
00047 if ( $User->CheckAction($cn,CENTRALIZE)==0 ) {
00048     /* Cannot Access */
00049     NoAccess();
00050 }
00051 
00052 include_once("central_inc.php");
00053 
00054 echo '<div class="u_subtmenu">';
00055 echo ShowMenuAdvanced("central.php");
00056 echo '</div>';
00057 
00058 
00059 echo '<DIV CLASS="u_redcontent">';
00060 echo '<H2 CLASS="info"> Centralise </H2><BR>';
00061 if ( isset ($_POST["central"] )) {
00062 
00063   //demande centralise
00064 if ( $_POST["periode"] != "" ) {
00065     $ret=Centralise($cn,$_POST["periode"]);
00066     if ($ret==NOERROR) {
00067       echo '<H2 class="info">La période '.$_POST["periode"].' est centralisée</H2>';
00068     } else {
00069       echo '<H2 class="error">La période '.$_POST["periode"].' n\' a pu être centralisée</H2>';
00070     }
00071   } 
00072 }// if ( isset ($_POST["central"] ))
00073 
00074 $ret=FormPeriode($cn,0,NOTCENTRALIZED);
00075 if ( $ret != null) {
00076   echo '<FORM METHOD="POST" action="central.php">';
00077   echo $ret;
00078   echo '<INPUT TYPE="SUBMIT" name="central" VALUE="Centralise">';
00079   echo '</FORM>';
00080 } else {
00081   echo '<H2 class="info"> Aucune période à centraliser</H2>';
00082 }
00083 
00084 echo "</DIV>";
00085 html_page_stop();
00086 ?>