".htmlentities($msg[103], ENT_QUOTES, $charset)." "; $tab_categ = suggestions_categ::getCategList(); $parity=1; foreach($tab_categ as $id_categ=>$lib_categ) { if ($parity % 2) { $pair_impair = "even"; } else { $pair_impair = "odd"; } $parity += 1; $tr_javascript=" onmouseover=\"this.className='surbrillance'\" onmouseout=\"this.className='$pair_impair'\" onmousedown=\"document.location='./admin.php?categ=acquisition&sub=categ&action=modif&id=$id_categ';\" "; print "".htmlentities($lib_categ, ENT_QUOTES, $charset).""; print ""; } print " "; } function show_categ_form($id=0) { global $msg; global $charset; global $categ_form; global $ptab; $categ_form = str_replace('!!id!!', $id, $categ_form); if(!$id) { $categ_form = str_replace('!!form_title!!', htmlentities($msg[acquisition_ajout_categ],ENT_QUOTES,$charset), $categ_form); $categ_form = str_replace('!!libelle!!', '', $categ_form); $categ_form = str_replace('!!commentaire!!', '', $categ_form); } else { $categ = new suggestions_categ($id); $categ_form = str_replace('!!form_title!!', htmlentities($msg[acquisition_modif_categ],ENT_QUOTES,$charset), $categ_form); $categ_form = str_replace('!!libelle!!', htmlentities($categ->libelle_categ,ENT_QUOTES,$charset), $categ_form); $ptab = str_replace('!!id!!', $id, $ptab); $ptab = str_replace('!!libelle_suppr!!', addslashes($categ->libelle_categ), $ptab); $categ_form = str_replace('', $ptab, $categ_form); } print confirmation_delete("./admin.php?categ=acquisition&sub=categ&action=del&id="); print $categ_form; } $categ_form = "

!!form_title!!

 
"; $ptab = ""; ?> 0 ) { error_form_message($libelle.$msg["acquisition_categ_already_used"]); break; } $categ = new suggestions_categ($id); $categ->libelle_categ = $libelle; $categ->save(); show_list_categ(); break; case 'del': if($id) { if ($id=='1') { //categorie avec id=1 non supprimable $msg_suppr_err = $msg['acquisition_categ_used'] ; error_message($msg[321], $msg_suppr_err, 1, 'admin.php?categ=acquisition&sub=categ'); } else { $total1 = suggestions_categ::hasSuggestions($id); if ($total1==0) { suggestions_categ::delete($id); } else { $msg_suppr_err = $msg['acquisition_categ_used'] ; if ($total1) $msg_suppr_err .= "
- ".$msg['acquisition_categ_used_sugg'] ; error_message($msg[321], $msg_suppr_err, 1, 'admin.php?categ=acquisition&sub=categ'); } } } else { show_list_categ(); } break; default: show_list_categ(); break; } ?>