check(true);$user->check_dossier($gDossier,true); $html=var_export($_REQUEST,true); switch($op) { /* ------------------------------------------------------------ */ /* Remove a attribut */ /* ------------------------------------------------------------ */ case 'rmfa': ob_start(); if( ! isset($_GET['ad_id']) || isNumber($_GET['ad_id']) ==0) throw new Exception ( "Parametre ad_id est invalide",11); $ad_id= $_GET['ad_id']; try { $cn->start(); $fa=new Fiche_Attr($cn,$ad_id); $fa->delete(); $cn->commit(); } catch (Exception $e) { $cn->rollback(); echo $e->getMessage(); } $html=ob_get_contents(); ob_clean(); break; /* ------------------------------------------------------------ */ /* Display card detail */ /* ------------------------------------------------------------ */ case 'dc': $f=new Fiche($cn); $f->get_by_qcode($qcode); $html=$f->Display(true); break; /* ------------------------------------------------------------ */ /* Blank card */ /* ------------------------------------------------------------ */ case 'bc': if ( $user->check_action(FICADD)==1 ) { $r=''; $f=new Fiche($cn); $popup=str_replace('_content','',$ctl); $r.='
'; $html=$r; } else { $html=alert(_('Action interdite'),true); } break; /* ------------------------------------------------------------ */ /* Show Type */ /* Before inserting a new card, the type must be selected */ /* ------------------------------------------------------------ */ case 'st': $sql="select fd_id,fd_label from fiche_def"; if ( isset($cat)) { $sql=$sql.sprintf(' where frd_id = '.FormatString ($cat)); } if ( !isset($cat) && isset($fil) && strlen(trim($fil)) > 0 ){ $sql=$sql.sprintf(" where fd_id in (%s)", FormatString($fil)); } $array=$cn->make_array($sql); if ( empty($array)) { $html=_("Aucune catégorie de fiche ne correspondant à". " votre demande"); $html.=$sql; } else { $r=''; $isel=new ISelect('fd_id'); $isel->value=$array; $popup=str_replace('_content','',$ctl); $r.=''; $html=$r; } break; /*---------------------------------------------------------------------- * SC save card * save the new card (insert) * ----------------------------------------------------------------------*/ case 'sc': if ( $user->check_action(FICADD)==1 ) { $f=new Fiche($cn); $f->insert($fd_id,$_POST); $html='