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

commercial.php

Go to the documentation of this file.
00001 <?
00002 /*
00003  *   This file is part of PhpCompta.
00004  *
00005  *   PhpCompta 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  *   PhpCompta 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 PhpCompta; if not, write to the Free Software
00017  *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00018 */
00019 /* $Revision: 1.9 $ */
00020 // Copyright Author Dany De Bontridder ddebontridder@yahoo.fr
00027 include_once ("ac_common.php");
00028 require_once("constant.php");
00029 include_once ("postgres.php");
00030 
00031 
00032 if ( isset ($_REQUEST['dos'] ) ) {
00033   $_SESSION['g_dossier']=$_REQUEST['dos'];
00034   $g_name=GetDossierName($_SESSION['g_dossier']);
00035   $_SESSION["g_name"]=$g_name;
00036 
00037 }
00038 
00039 
00040 include_once ("postgres.php");
00041 /* Admin. Dossier */
00042 $rep=DbConnect($_SESSION['g_dossier']);
00043 require_once ("class_user.php");
00044 $User=new cl_user($rep);
00045 $User->Check();
00046 
00047 //-----------------------------------------------------
00048 // update preference
00049 //-----------------------------------------------------
00050 if ( isset ( $_POST['style_user']) ) {
00051         $User->update_global_pref('THEME',$_POST['style_user']);
00052       $_SESSION['g_theme']=$_POST['style_user'];
00053 
00054 }
00055 // Met a jour le pagesize
00056 if ( isset ( $_POST['p_size']) ) {
00057         $User->update_global_pref('PAGESIZE',$_POST['p_size']);
00058       $_SESSION['g_pagesize']=$_POST['p_size'];
00059 
00060 }
00061 
00063 html_page_start($_SESSION['g_theme'],"","richtext.js");
00064 
00065 if ( ! isset ( $_SESSION['g_dossier'] ) ) {
00066   echo "You must choose a Dossier ";
00067   exit -2;
00068 }
00069 
00070 include("preference.php");
00071 include_once("user_menu.php");
00072 echo '<div class="u_tmenu">';
00073 echo "<H2 class=\"info\">Commercial ".$_SESSION['g_name']." </H2>";
00074 
00075 $p_action=(isset ($_REQUEST['p_action']))?$_REQUEST['p_action']:"";
00076 // TODO Menu with all the customer
00077 echo ShowItem(array(
00078                     array('?p_action=client','Client'),
00079                     array('?p_action=facture','Facture'),
00080                     array('?p_action=fournisseur','Fournisseur'),
00081                     array('?p_action=depense','D&eacute;pense'),
00082                     array('?p_action=bank','Banque'),
00083                     array('?p_action=contact','Contact'),
00084                     array('?p_action=admin','Administration'),
00085                     array('?p_action=suivi_courrier','Document'),
00086                     array('?p_action=pref','Préférence'),
00087                     array('parametre.php?dos='.$_SESSION['g_dossier'],"Paramètre"),
00088                     array('user_compta.php?dos='.$_SESSION['g_dossier'],"Comptabilité"),
00089                     array('login.php','Accueil',"Accueil"),
00090                     array('logout.php','logout',"Sortie")
00091                     ),
00092               'H',"mtitle","mtitle","?p_action=$p_action",' width="100%"');
00093 
00094 
00095                     //
00096 echo '</div>';
00097 
00098 $cn=DbConnect($_SESSION['g_dossier']);
00099 $User->AccessRequest($cn,SEC_GESTION);
00100 //-----------------------------------------------------
00101 // p_action == pref
00102 //-----------------------------------------------------
00103 if ( $p_action == "pref" ) 
00104 {
00105   require_once("pref.inc.php");
00106 }
00107 //-----------------------------------------------------
00108 // p_action == client
00109 //-----------------------------------------------------
00110 if ( $p_action == "client" ) 
00111 {
00112   require_once("client.inc.php");
00113 }// $p_action == fournisseur
00114 //-----------------------------------------------------
00115 // Fournisseur
00116 if ( $p_action == 'fournisseur') 
00117 {
00118   require_once("supplier.inc.php");
00119 }
00120 //-----------------------------------------------------
00121 // action
00122 if ( $p_action == 'suivi_courrier') 
00123 {
00124   require_once("action.inc.php");
00125 }
00126 //-----------------------------------------------------
00127 // p_action == facture
00128 //-----------------------------------------------------
00129 if ( $p_action == "facture" ) 
00130 {
00131   require_once("facture.inc.php");
00132 }
00133 //-----------------------------------------------------
00134 // Contact
00135 if ( $p_action == 'contact') 
00136 {
00137   require_once("contact.inc.php");
00138 }
00139 //-----------------------------------------------------
00140 // Expense
00141 if ( $p_action == 'depense') 
00142 {
00143   require_once("depense.inc.php");
00144 }
00145 //-----------------------------------------------------
00146 // Administration
00147 if ( $p_action == 'admin') 
00148 {
00149   require_once("admin.inc.php");
00150 }
00151 //-----------------------------------------------------
00152 // Banque
00153 if ( $p_action == 'bank') 
00154 {
00155   require_once("bank.inc.php");
00156 }