20,12 → 20,16 |
|
// Récupération des infos sur les categories existantes |
$tab_pc = $ProjetCategorie->consulter(ProjetCategorie::GPC_TOUS); |
foreach ($tab_pc as $pc) { |
if ($pc->getIdCategorie() != 0) { |
$aso_categ['id'] = $pc->getIdCategorie(); |
$aso_categ['libelle'] = $pc->getLibelle(); |
$aso_admin_categ['categories'][] = $aso_categ; |
} |
if (false == $tab_pc) { |
$aso_admin_categ['categories'] = false; |
} else { |
foreach ($tab_pc as $pc) { |
if ($pc->getIdCategorie() != 0) { |
$aso_categ['id'] = $pc->getIdCategorie(); |
$aso_categ['libelle'] = $pc->getLibelle(); |
$aso_admin_categ['categories'][] = $aso_categ; |
} |
} |
} |
// Modification des titres, légendes et bouton |
$aso_admin_categ['form_legend'] = 'Ajouter une categorie'; |
79,9 → 83,6 |
$ProjetCategorie = new ProjetCategorie(); |
$bool_existe = $ProjetCategorie->consulter(ProjetCategorie::GPC_LIBELLE, array($_POST['caaj_libelle'])); |
if ($bool_existe == false) { |
$ProjetCategorieMax = $ProjetCategorie->consulter(ProjetCategorie::GPC_ID_MAX); |
$id_max = $ProjetCategorieMax->getIdCategorie(); |
$ProjetCategorie->setIdCategorie(++$id_max); |
$ProjetCategorie->setLibelle($_POST['caaj_libelle']); |
$ProjetCategorie->setAbreviation($_POST['caaj_abreviation']); |
$ProjetCategorie->ajouter(); |