Check(); include ("check_priv.php"); echo '
'; echo ShowMenuCompta($_SESSION['g_dossier']); echo '
'; echo JS_SEARCH_POSTE; if ( !isset($sessid)) { $sessid=$_REQUEST["PHPSESSID"]; } $search='"; include_once("fiche_inc.php"); $cn=DbConnect($_SESSION['g_dossier']); // Security check $read=$User->CheckAction($cn,FICHE_READ); $write=$User->CheckAction($cn,FICHE_WRITE); if ($read+$write == 0 ){ /* Cannot Access */ NoAccess(); } function ShowFicheDefInput($p_fiche_def) { $r=""; // Save the label $p_fiche_def->SaveLabel($_REQUEST['label']); $p_fiche_def->Get(); $p_fiche_def->GetAttribut(); $r.= '

'.$p_fiche_def->label.'

'; $r.= '
'; $r.= ''; $r.= $p_fiche_def->DisplayAttribut(); $r.= ' '; $r.= "
"; return $r; } // Creation of a new model of card // in the database if ( isset($_POST['add_modele']) and $write != 0) { // insert the model of card in database $fiche_def=new fiche_def($cn); $fiche_def->Add($HTTP_POST_VARS); } $r=""; // Add a line in the card model if ( isset ($_POST["add_line"]) ) { $r= '
'; if ( $write ==0) $r.= "

Pas d'accès

"; else { $fiche_def=new fiche_def($cn,$_REQUEST['fd_id']); // Insert Line $fiche_def->InsertAttribut($_REQUEST['ad_id']); $r.=ShowFicheDefInput($fiche_def); } $r.= '
'; } // Change the name of the card model if ( isset ($_POST["change_name"] ) ) { $r= '
'; if ( $write ==0) $r.= "

Pas d'accès

"; else { $fiche_def=new fiche_def($cn,$_REQUEST['fd_id']); $r.=ShowFicheDefInput($fiche_def); } $r.= '
'; } ShowMenuFiche($_SESSION['g_dossier']); echo $r; if ( isset ( $_GET["action"]) ) { $action=$_GET["action"]; // View the details of the selected cat. of cards if ( isset ($_GET["fiche"]) && $action=="vue" && ! isset ($_POST['add_fiche']) && ! isset ($_POST['update_fiche']) && ! isset ($_POST['delete'])) { echo '
'; $fiche_def=new fiche_def($cn,$_GET['fiche']); $fiche_def->myList(); echo '
'; }// Display the detail of a card if ($action== "detail" ) { echo '
'; $t=false; if ( $write == 0) { echo '

Vos changements ne seront pas sauvés

'; $t=true; } $fiche=new fiche($cn,$_GET["fiche_id"]); if ( $_SESSION['g_pagesize'] != -1 ){ // retrieve value // with offet &offset=15&step=15&page=2&size=15 if ( $_SESSION['g_pagesize'] != -1) { $str=sprintf("&offset=%s&step=%s&page=%s&size=%s", $_GET['offset'], $_GET['step'], $_GET['page'], $_GET['size']); } } if ( $write != 0) echo '
'; echo $fiche->Display($t); echo ''; if ( $write != 0 ) { echo ''; echo ''; } $str=""; echo ''; if ( $write != 0 ) echo '
'; echo '
'; } // Display the form where you can enter // the property of the card model if ($action == "add_modele" and $write !=0) { echo '
'; CreateCategory($cn,$search); echo '
'; } // Modify a card Model if ($action == "modifier" ) { echo '
'; if ( $write ==0) echo "

Pas d'accès

"; else { $fiche_def=new fiche_def($cn,$_GET['fiche']); $fiche_def->Get(); $fiche_def->GetAttribut(); echo '

'.$fiche_def->label.'

'; echo '
'; echo ''; echo $fiche_def->DisplayAttribut(); echo ' '; echo "
"; } echo '
'; } } // Display a blank card from the selected category if ( isset ($_POST["fiche"]) && isset ($_POST["add"] ) ) { echo '
'; if ( $write ==0) echo "

Pas d'accès

"; else { $url=$_SERVER['REQUEST_URI']; $fiche=new fiche($cn,0); echo '
'; echo $fiche->blank($_POST['fiche']); echo ''; echo ''. ''; echo '
'; } echo '
'; } // delete a card if (isset($_POST['delete']) ) { echo '
'; if ( $write ==0) echo "

Pas d'accès

"; else { $fiche=new fiche($cn,$_POST["f_id"]); $fiche->remove(); } $fiche_def=new fiche_def($cn,$_GET['fiche']); $fiche_def->myList(); echo "
"; } // Add the data (attribute) of the card if ( isset ($_POST["add_fiche"]) ) { echo '
'; if ( $write ==0) echo "

Pas d'accès

"; else { $fiche=new fiche($cn); $fiche->Save($_REQUEST['fiche']); $fiche_def=new fiche_def($cn,$_GET['fiche']); $fiche_def->myList(); } echo '
'; exit(); } // Update a card if ( isset ($_POST["update_fiche"]) ) { echo '
'; if ( $write ==0) echo "

Pas d'accès

"; else { $fiche=new fiche($cn,$_POST['f_id']); $fiche->Save(); } $fiche_def=new fiche_def($cn,$_GET['fiche']); $fiche_def->myList(); echo '
'; } html_page_stop(); ?>