';
}
function ShowFicheDefInput($p_fiche_def)
{
$r="";
// Save the label
$p_fiche_def->Get();
$p_fiche_def->GetAttribut();
/* we change the main attribute */
if (isset ($_REQUEST['label']) )
{
$p_fiche_def->SaveLabel($_REQUEST['label']);
if ( isset($_REQUEST['create']))
{
$p_fiche_def->set_autocreate(true);
}
else
{
$p_fiche_def->set_autocreate(false);
}
$p_fiche_def->save_class_base($_REQUEST['class_base']);
}
$p_fiche_def->Get();
$r.= '
'.h($p_fiche_def->label).'
';
$r.='';
/* attributes */
$r.='';
return $r;
}
$recherche=true;
// Creation of a new model of card
// in the database
if ( isset($_POST['add_modele']) )
{
$User->can_request(FICCAT);
// insert the model of card in database
$fiche_def=new Fiche_Def($cn);
$fiche_def->Add($_POST);
}
$r="";
if ( isset ($_POST['remove_cat'] ) )
{
$User->can_request(FICCAT);
$fd_id=new Fiche_Def($cn,$_POST['fd_id']);
$remains=$fd_id->remove();
if ( $remains != 0 )
/* some card are not removed because it is used */
alert('Impossible d\'enlever cette catégorie, certaines fiches sont encore utilisées'."\n".
'Les fiches non utilisées ont cependant été effacées');
}
// Add a line in the card model
if ( isset ($_POST["add_line"]) )
{
$User->can_request(FIC);
$r= '
';
$recherche=false;
}
//_________________________________________________________________________
// Display the detail of a card
if ($action== "detail" )
{
echo '
';
$t=false;
if ( $User->check_action(FICADD)==0)
{
echo '
';
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 '
';
$recherche=false;
}
//_________________________________________________________________________
// Display the form where you can enter
// the property of the card model
if ($action == "add_modele" )
{
$User->can_request(FICCAT);
echo '
';
echo '';
echo '
';
$recherche=false;
}
//_________________________________________________________________________
// Modify a card Model
if ($action == "modifier" )
{
$User->can_request(FICCAT);
echo '
';
$recherche=false;
}
//_________________________________________________________________________
// Search a card
if ( $action == "search" )
{
echo '
';
ShowRecherche();
$sql="select distinct f_id,fd_id from fiche join fiche_detail using (f_id)
where
upper(ad_value) like upper('%".FormatString($_GET["search_text"])."%') order by f_id";
$all=$cn->get_array($sql);
// test on the size
//
if ( sizeof($all) != 0 )
{
echo "Résultat : ".sizeof($all).'éléments trouvés ';
foreach ($all as $f_id)
{
$fiche=new Fiche($cn,$f_id['f_id']);
echo ''.
$fiche->getName().'';
}
}
else
{
echo '
';
echo "Aucun résultat trouvé";
}
echo '
';
}
$recherche=false;
}
// Display a blank card from the selected category
if ( isset ($_POST["fiche"]) && isset ($_POST["add"] ) )
{
$User->can_request(FICADD);
echo '
";
exit();
}
//------------------------------------------------------------------------------
// Add the data (attribute) of the card
if ( isset ($_POST["add_fiche"]) )
{
$User->can_request(FICADD);
if ( $write ==0)
{
echo '
';
$recherche=false;
}
//--------------------------------------------------------------------------------
// Move a card to a new category
if ( isset($_POST['move']))
{
echo '