コード例 #1
0
ファイル: CatsController.php プロジェクト: alegalliard/aug
 public function details()
 {
     Phalanx::loadClasses('Cats');
     $cat_data = Cats::get($this->get->cat_id);
     $template = new Template("public", "cats_full_page.phtml");
     $template->og = new stdClass();
     $template->og->title = $cat_data->name;
     $template->og->description = $cat_data->description;
     $template->og->img = MEDIA_DIR . 'uploads/cats/' . $cat_data->picture;
     $this->views = new Views($template);
     $this->views->data = $cat_data;
     $this->views->display("cat_detail.phtml");
 }
コード例 #2
0
 public function form()
 {
     $this->views = new Views(new Template("admin"));
     if (isset($this->get->cat_id)) {
         Phalanx::loadClasses('Cats');
         $this->views->data = Cats::get($this->get->cat_id, $this->session->user->id);
         $this->views->title = "Editar gato";
     } else {
         $this->views->title = "Adicionar gato";
     }
     $this->views->special = true;
     $this->views->display('cats_form.phtml');
 }
コード例 #3
0
ファイル: AjaxController.php プロジェクト: alegalliard/aug
 public function parserInterests()
 {
     Phalanx::loadClasses('Cats');
     $response = Cats::get_interests();
     $result = array();
     foreach ($response as $item) {
         $cats = Cats::get($item->cats_id);
         $mdl = Model::Factory('cats_interests1');
         $mdl->cat_name = $cats->name;
         $mdl->where("id='{$item->id}'");
         $mdl->update();
         echo "1";
     }
 }
コード例 #4
0
ファイル: CatsController.php プロジェクト: alegalliard/aug
 public function deactivated()
 {
     if (!$this->get->page) {
         Request::redirect(HOST . 'adm/gatos/desativados/1');
     }
     $this->views = new Views(new Template("admin"));
     $this->views->total_pages = Cats::get_pages("cats", "inactive=1");
     $this->views->current_page = isset($this->get->page) ? $this->get->page : 1;
     $this->views->title = "Gatos (Desativados)";
     $this->views->search = $this->post->search;
     $this->views->order = $this->post->order;
     $parameters = "inactive=1 AND (name LIKE '%{$this->post->search}%' OR id LIKE '%{$this->post->search}%')";
     $this->views->data = Cats::get($parameters, $this->views->current_page, $this->post->order);
     if ($this->post->search) {
         $this->views->total_pages = ceil(count($this->views->data) / 100);
     }
     $this->views->display("cats_list_deactivated.phtml");
 }