Exemplo n.º 1
0
     $idTutoriel = intval($_GET['idTutoriel']);
     $donneesTutoriel = $bdd->requete('SELECT cours_level, cours_id, cours_nom, cours_texte, cours_gauche, cours_droite FROM ' . TABLE_COURS . ' WHERE cours_id = ?', $idTutoriel);
     $form = new Form(translate('title_edit_form'));
     $form->add_fieldset();
     $form->add_input('cours_nom', 'cours_nom', translate('cours_name_form'))->setValue($donneesTutoriel['cours_nom']);
     $form->add_textarea('cours_introduction', 'cours_introduction', translate('cours_intro_form'))->setValue($donneesTutoriel['cours_texte']);
     $form->add_textarea('cours_conclusion', 'cours_conclusion', translate('cours_conclu_form'))->setValue($donneesTutoriel['cours_texte']);
     $form->add_button();
     $fh = new FormHandle($form);
     $fh->handle();
     if ($fh->okay()) {
         $dataCours['coursNom'] = $fh->get('cours_nom');
         $dataCours['coursIntro'] = $fh->get('cours_introduction');
         $dataCours['coursConclusion'] = $fh->get('cours_conclusion');
         $cours = new Cours();
         $cours->modifier_element($dataCours);
         $error = new Error();
         $error->add_error(translate('cours_edit_okay'), ERROR_PAGE, __FILE__, __LINE__);
     }
     break;
 case 'deplacerTutoriel':
     $idTutoriel = intval($_GET['idTutoriel']);
     $donneesTutoriel = $bdd->requete('SELECT cours_level, cours_id, cours_nom, cours_texte, cours_gauche, cours_droite FROM ' . TABLE_COURS . ' WHERE cours_id = ?', $idTutoriel);
     $form = new Form(translate('title_edit_form'));
     $form->add_fieldset();
     $listeCategories = $form->add_list('cours_categorie', 'cours_categorie', translate('cours_category_form'));
     $requeteCategories = $bdd->query('SELECT cours_level, cours_id, cours_nom, cours_gauche, cours_droite FROM ' . TABLE_COURS . ' WHERE cours_type = 0 ORDER BY cours_gauche');
     $categorieDuTutoriel = 0;
     while ($donneesCategories = $bdd->fetch($requeteCategories)) {
         $suffixe = NULL;
         for ($i = 0; $i < $donneesCategories['cours_level']; $i++) {