/*
* This file is part of PhpCompta.
*
* PhpCompta is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* PhpCompta is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with PhpCompta; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
/* $Revision$ */
// Copyright Author Dany De Bontridder ddebontridder@yahoo.fr
/*! \file
* \brief module to manage the card (removing, listing, creating, modify attribut)
*/
?>
ERREUR MAUVAIS APPEL
exit();
include_once ("ac_common.php");
require_once('class_fiche.php');
html_page_start($_SESSION['g_theme']);
if ( ! isset ( $_SESSION['g_dossier'] ) ) {
echo "You must choose a Dossier ";
exit -2;
}
include_once ("postgres.php");
include_once ("user_menu.php");
$rep=DbConnect();
include_once ("class_user.php");
$User=new cl_user($rep);
$User->Check();
include ("check_priv.php");
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.= '";
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($_POST);
}
$r="";
// Add a line in the card model
if ( isset ($_POST["add_line"]) ) {
$r= '
';
}
//_________________________________________________________________________
// 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;
}
$str="";
$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 ( isset($_GET['offset']) && $_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 '
';
}
//_________________________________________________________________________
// 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 '
';
}
//_________________________________________________________________________
// Search a card
if ( $action == "search" )
{
$sql="select distinct f_id,fd_id,av_text from fiche join jnt_fic_att_value using (f_id)
join attr_value using (jft_id) where
upper(av_text) like upper('%".FormatString($_GET["search_text"])."%') order by av_text,f_id";
$all=getArray($cn,$sql);
// test on the size
//
if ( sizeof($all) != 0 )
{
echo '
";
exit();
}
//------------------------------------------------------------------------------
// Add the data (attribute) of the card
if ( isset ($_POST["add_fiche"]) ) {
echo '