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

form.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.15 $ */
00020 // Copyright Author Dany De Bontridder ddebontridder@yahoo.fr
00024 include_once ("ac_common.php");
00025 include_once ("user_menu.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 
00040 include_once("form_inc.php");
00041 
00042 include_once ("user_menu.php");
00043 echo '<div class="u_tmenu">';
00044 echo ShowMenuCompta($_SESSION['g_dossier'],"user_advanced.php");
00045 echo '</div>';
00046 
00047 include ("check_priv.php");
00048 
00049 $cn=DbConnect($_SESSION['g_dossier']);
00050 if ( $User->CheckAction($cn,FORM)==0){
00051   /* Cannot Access */
00052   NoAccess();
00053  }
00054 echo ShowMenuAdvanced("form.php");
00055 if ( isset ($_POST["record"] )) {
00056   echo '<DIV class="u_redcontent">';
00057   AddForm($cn,$HTTP_POST_VARS);
00058   echo "</DIV>";
00059 }
00060 if ( isset ($_POST["del_form"]) ) {
00061   echo '<DIV class="u_redcontent">';
00062   DeleteForm($cn,$_POST['fr_id']);
00063    echo "</DIV>";
00064 }
00065 
00066 ShowMenuComptaForm($_SESSION['g_dossier']);
00067 
00068 if ( isset($_GET["PHPSESSID"] )) {
00069   $sessid=$_GET["PHPSESSID"];
00070 } 
00071 if ( isset($_POST["PHPSESSID"] )) {
00072   $sessid=$_POST["PHPSESSID"];
00073 } 
00074 if ( isset( $_REQUEST['PHPSESSID'])) {
00075         $sessid = $_REQUEST['PHPSESSID'];
00076 }
00077 
00078 
00079 if ( isset ($_GET["action"]) ) {
00080   $action=$_GET["action"];
00081   if ($action == "add" )
00082     {
00083       echo '<DIV class="u_redcontent">';
00084       EncodeForm(1,$sessid);
00085       echo "</DIV>";
00086     }
00087   if ($action=="view" ) {
00088       echo '<DIV class="u_redcontent">';
00089     if ( ! $_GET["fr_id"] ) {
00090       echo_error("fr_id n'est pas donné");
00091       return;
00092     }
00093     ViewForm($cn,$sessid,$_GET["fr_id"]);
00094     echo "</DIV>";
00095   }
00096 } // if $_GET
00097 if ( isset ($_POST["add_line"]) ) {
00098   echo '<DIV class="u_redcontent">';
00099   $line=$_POST["line"];
00100   EncodeForm($line+1,$sessid,$HTTP_POST_VARS);
00101   echo "</DIV>";
00102 }
00103 if ( isset ($_POST["update"]) ) {
00104   echo '<DIV class="u_redcontent">';
00105   UpdateForm($cn,$HTTP_POST_VARS);
00106     ViewForm($cn,$sessid,$_POST["fr_id"]);
00107 
00108   echo "</DIV>";
00109 }
00110 
00111 
00112 //echo "</DIV>";
00113 html_page_stop();
00114 ?>