芝麻web文件管理V1.00
编辑当前文件:/home/prismawe/www/resupres/application/classes/controller/admin/orientations.php
order_by('nom', 'ASC') ->find_all(); $this->template->content = View::factory('admin/orientations/list'); $this->template->content->orientations = $orientations; } public function action_new(){ $this->template->content = View::factory('admin/candidats/new'); $this->template->content->candidats = $candidats; } public function action_newPost(){ $duel = ORM::factory('duel'); $duel->dateDebut = $this->request->post('dateDebut'); $duel->candidat1_id = $this->request->post('candidat1'); $duel->candidat2_id = $this->request->post('candidat2'); $duel->candidat_blanc = 0; $duel->save(); $this->request->redirect('admin/candidats'); } public function action_modify(){ $duel = ORM::factory('duel') ->where('id', '=', $this->request->param('id')) ->and_where('dateDebut', '>', DB::expr('current_date')) ->find(); $candidats = ORM::factory('candidat') ->where('isCandidate', '=', 1) ->order_by('nom', 'ASC') ->order_by('prenom', 'ASC') ->find_all(); if ($duel->loaded()){ $this->template->content = View::factory('admin/duels/modify'); $this->template->content->duel = $duel; $this->template->content->candidats = $candidats; } else $this->request->redirect('admin/duels'); } public function action_modifyPost(){ $duel = ORM::factory('duel') ->where('id', '=', $this->request->param('id')) ->and_where('dateDebut', '>', DB::expr('current_date')) ->find(); if ($duel->loaded()){ $duel->dateDebut = $this->request->post('dateDebut'); $duel->candidat1_id = $this->request->post('candidat1'); $duel->candidat2_id = $this->request->post('candidat2'); $duel->candidat_blanc = 0; $duel->save(); } $this->request->redirect('admin/duels'); } }