芝麻web文件管理V1.00
编辑当前文件:/home/p/r/i/prismawe/www/resupres/application/classes/controller/departement.php
template->menuActif = 'region'; if ($this->request->param('id') != '') { $dept = ORM::factory('departement', $this->request->param("id")); if($dept->loaded()) { $urldept = URL::title($dept->nom, '_', true); if($this->request->param("dept") != $urldept) { $this->request->redirect('departement/resultat_election/'.$dept->id.'-'.$urldept); } $resultats = ORM::factory('resultat') ->where_open() ->and_where("departement_id", "=", $this->request->param("id")) ->and_where("candidat_id", "!=", 0) ->where_close() ->order_by("tauxvotes", "DESC") ->find_all(); $regions = ORM::factory('regionrslt')->find_all(); $this->template->content = View::factory('departement/carte'); $this->template->content->dept = $dept; $this->template->content->resultats = $resultats; $this->template->content->regions = $regions; } } else if($_SERVER['REQUEST_METHOD'] == 'POST') { if($this->request->post('insee') != '') { $this->request->redirect('ville/resultat_election/' . $this->request->post("insee")); } else { $this->request->redirect('departement/resultat_election/' . $this->request->post("dept")); } } else { $this->request->redirect('departement/resultat_election/73'); } } public function action_departement() { $this->auto_render = FALSE; $departements = ORM::factory('departement')->where('regionrslt_id', "=", $this->request->post('region'))->find_all(); foreach($departements as $dep) { echo $dep->id.";".$dep->nom."|"; } } }