read (intval($_GET['exerciseId'])); $form -> addElement ('hidden','edit','true'); }else { $form = new FormValidator('exercise_admin'); $form -> addElement ('hidden','edit','false'); } $objExercise -> createForm ($form); /********************* * VALIDATE FORM *********************/ if($form -> validate()) { $objExercise -> processCreation($form); if($form -> getSubmitValue('edit') == 'true') { header('Location:exercice.php'); } else { header('Location:admin.php?exerciseId='.$objExercise->id); } } else { /********************* * DISPLAY FORM *********************/ $nameTools=get_lang('ExerciseManagement'); $interbreadcrumb[] = array ("url"=>"exercice.php", "name"=> get_lang('Exercices')); Display::display_header($nameTools,"Exercise"); $form -> display (); }