Exemple #1
0
 function down_position()
 {
     $min = new showroom();
     $min->select_min('position');
     $min->where('position >', $this->position);
     $min->get();
     $o = new showroom();
     $o->where('position', $min->position);
     $o->get();
     if ($o->result_count() > 0) {
         $tg = $this->position;
         $this->position = $o->position;
         $o->position = $tg;
         $o->save();
         $this->save();
         return true;
     } else {
         return false;
     }
 }
Exemple #2
0
 function detail($name_none)
 {
     $title_none = $this->uri->segment(3);
     $arrTitle = explode('.', $title_none);
     if ($arrTitle[1] == '' || $arrTitle[1] != 'html') {
         redirect('');
     }
     $title_none = $arrTitle[0];
     $showrooms = new showroom();
     $showrooms->order_by('id', 'DESC');
     $showrooms->where('name_none', $title_none);
     $showrooms->get();
     $dis['showrooms'] = $showrooms;
     $showroomphotos = new showroomphoto();
     $showroomphotos->where('showroom_id', $showrooms->id);
     $showroomphotos->get_iterated();
     $dis['showroomphotos'] = $showroomphotos;
     $this->page_title = $showrooms->name;
     $this->page_description = $showrooms->description;
     $this->page_keyword = $showrooms->keyword;
     $dis['base_url'] = base_url();
     $dis['view'] = 'front/showroom/detail';
     $this->viewfront($dis);
 }