Ejemplo n.º 1
0
 public function render($args = NULL)
 {
     parent::render($args);
     $this->template->database = $this->context->database;
     $this->template->subjects = $this->subjects->fetchAd($this->strict);
     $this->template->type = $this->type;
     $this->template->setFile(__DIR__ . "/BannerSubjects.latte");
     dibi::begin();
     foreach ($this->subjects as $key => $value) {
         dibi::query('update subject set ad_show_count=ad_show_count+1 where id=' . $key);
     }
     dibi::commit();
     $this->template->render();
 }
Ejemplo n.º 2
0
 public function renderSubjects($args = NULL)
 {
     dump($args);
     if (key_exists('shire', $args)) {
         $this->subjects->where('ad_shire', $args['shire']);
     }
     if (key_exists('locality', $args)) {
         $this->subjects->where('ad_locality', $args['locality']);
     }
     if (key_exists('category', $args)) {
         $this->subjects->where('ad_category', $args['category']);
     }
     $this->subjects->fetchAd($this->strict);
     $this->template->setFile(dirname(__FILE__) . '/subjects.latte');
     $this->render();
 }
Ejemplo n.º 3
0
 public function handleRecommended()
 {
     $this->tab = 'recommended';
     $this->subjects->fetchAd(null, true)->order('created DESC');
     $this->refresh();
 }