00001 <?
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
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
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
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 }
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
00113 html_page_stop();
00114 ?>