Пример #1
0
 public function listproduct($strId)
 {
     $id = getIdFromStr($strId);
     $data['bodycontent'] = "products/index";
     $data['listProducts'] = $this->Products_model->getAllByCatId($id, 0, ITEM_PRODUCT_HOME);
     $this->load->view('layouts/index', $data);
 }
Пример #2
0
 public function detail($idStr)
 {
     $id = getIdFromStr($idStr);
     $data['news'] = $this->News_model->getNewsById($id);
     $data['other'] = $this->News_model->getOtherReals($id);
     $data['bodycontent'] = "news/detail";
     $this->load->view('layouts/index', $data);
 }
Пример #3
0
 public function bytags($id)
 {
     $id = getIdFromStr($id);
     $data['bodycontent'] = "projects/index";
     $data['listPros'] = $this->ProjectReals_model->getAllByTag($id, 0, 20);
     $data['type'] = 'tag';
     $this->load->view('layouts/index', $data);
 }
Пример #4
0
 public function listproduct($strId)
 {
     $id = getIdFromStr($strId);
     $cat = $this->Categories_model->getCatById($id);
     $data['cat'] = $cat;
     $url = '/products/listproduct/' . convertViToEn($cat['category_name_' . LANG], $id) . "/";
     $total = count($this->Products_model->getAllByCatId($id));
     $pagination = pagination($url, $total, PER_PAGE, 4, 4);
     $data['pagination'] = $pagination->create_links();
     $offset = $this->uri->segment(4, 0);
     $data['bodycontent'] = "products/index";
     $data['listProducts'] = $this->Products_model->getAllByCatId($id, $offset, 1);
     $this->load->view('layouts/index', $data);
 }
Пример #5
0
 /**
  * @author Phuc Duong
  * @desc get detail real estate
  **/
 public function detail($idStr)
 {
     $this->load->model('Captcha_model');
     $data = $this->Common_model->getDefault();
     if (ispost()) {
         $this->load->model("Contact_model");
         $captchaWord = $this->session->userdata('capcha');
         if (strcasecmp(strtoupper($captchaWord[0]), strtoupper($_POST['confirmCaptcha'])) == 0) {
             if ($this->Contact_model->sendEmail()) {
                 $data['msg'] = "Cám ơn bạn đã gửi liên hệ";
             } else {
                 $data['msg'] = "Vui lòng gửi lại";
             }
         } else {
             $data['msg'] = "Vui lòng nhập đúng Captcha";
             $data['lienhe'] = $_POST;
         }
     }
     $captcha = $this->Captcha_model->generateCaptcha();
     $this->session->set_userdata('capcha', array($captcha['word']));
     $data['captcha'] = $captcha;
     $id = getIdFromStr($idStr);
     $data['real'] = $this->Reals_model->getRealById($id);
     $data['bodycontent'] = "reals/detail";
     $data['other'] = $this->Reals_model->getOtherReals($id, $data['real']['project_id']);
     $data['max'] = $this->Reals_model->getMaxReal();
     $data['title'] = !empty($data['real']['seo_title']) ? $data['real']['seo_title'] : $data['real']['title'];
     $data['keyword'] = !empty($data['real']['seo_keyword']) ? $data['real']['seo_keyword'] : $data['real']['title'];
     $data['desc'] = !empty($data['real']['seo_desc']) ? $data['real']['seo_desc'] : $data['real']['title'];
     $this->load->view('layouts/index', $data);
 }