Exemple #1
0
 function modifclasseAction()
 {
     $classe = new Classe();
     $id = (int) $this->_request->getParam('id');
     $nom = $classe->getNameById($id);
     $classe = $classe->findByNom($nom);
     $this->view->title = "Modification de la classe " . $nom;
     $this->view->classe = $classe;
     // Tester si tous les champs sont correctement remplis.
     if ($this->_request->isPost()) {
         $data = array('att_classe' => $this->_request->getPost('att'), 'attsp_classe' => $this->_request->getPost('attspe'), 'def_classe' => $this->_request->getPost('def'), 'defsp_classe' => $this->_request->getPost('defspe'), 'vit_classe' => $this->_request->getPost('vit'), 'hp_classe' => $this->_request->getPost('hp'), 'mp_classe' => $this->_request->getPost('mp'));
         $classe = new Classe();
         $where = $classe->getAdapter()->quoteInto('id_classe=?', (string) $id);
         $classe->update($data, $where);
         $this->_redirect('admin/classe');
         return;
     }
 }