24if (!defined(
'ALLOWED')) die(
'Appel direct ne sont pas permis');
27if (
$g_user->check_module(
'CCARD') == 0)
return;
32}
catch (\Exception
$e) {
33 echo
$e->getMessage();
41 $row =
$cn->get_row(
'select ad_id , ad_text from attr_def where ad_id=$1',[
$ad_id]);
46 $row =
$cn->get_row(
'select ad_id , ad_text from attr_def where ad_id=$1',[
$ad_id]);
50 $str_Attribut=
$http->post(
"attribut");
51 parse_str($str_Attribut,
$row);
52 $aAttribut=
$row[
'attribut_card'];
53 $nb_attribut=count($aAttribut);
56 $cn->exec_sql(
"create temporary table xxattribut (x_order int, x_adid int, x_fdid int)");
58 for(
$i = 0;
$i < $nb_attribut;
$i++) {
60 $cn->exec_sql(
"insert into xxattribut values ($1,$2,$3)",[$o,$aAttribut[
$i],
$fiche_def]);
62 $cn->exec_sql(
"delete from jnt_fic_attr where fd_id=$1 and ad_id not in (select x_adid from xxattribut)",[
$fiche_def]);
63 $cn->exec_sql(
"insert into jnt_fic_attr(ad_id,fd_id,jnt_order)
64 select x_adid,x_fdid,x_order
66 on conflict do nothing ");
67 $cn->exec_sql(
'update jnt_fic_attr set jnt_order = x_order from xxattribut where ad_id=x_adid and fd_id=x_fdid');
70 }
catch (\Exception
$e) {
71 echo
$e->getMessage();
76 die(
"[$op2] action inconnue");
global $g_user
if no group available , then stop
static print_existing_attribut($attribut_id, $attribut_text)
display existing attribut
static print_available_attribut($attribut_id, $attribut_text, $class)
display available attribut
if( $delta< 0) elseif( $delta==0)