Example #1
0
 public function edit($id)
 {
     if (ispost()) {
         if ($this->Realestate_model->edit($_POST, $id)) {
             redirect(base_url() . "admin/index.php/realestate", "location");
         }
     }
     $data['categories'] = $this->Realestate_model->getCatForSelectBox('categories', 'category_name');
     $data['price'] = $this->Realestate_model->getCatForSelectBox('price', 'price_range');
     $data['area'] = $this->Realestate_model->getCatForSelectBox('area', 'area_range');
     $data['tags'] = $this->Tag_model->getAllForSelectBox();
     $lists = array("" => "--Select--");
     $list = $this->Realestate_model->getAllById('district', 'province_id', 1);
     foreach ($list as $ls) {
         $lists[$ls['id']] = $ls['district_name'];
     }
     $data['district'] = $lists;
     $tagsListEdit = $this->Tagreal_model->getAllById('real_id', $id);
     $tagsEdit = array();
     if (count($tagsListEdit) > 0) {
         foreach ($tagsListEdit as $list) {
             array_push($tagsEdit, $list['tag_id']);
         }
     }
     $data['tagsEdit'] = $tagsEdit;
     $realestate = $this->Realestate_model->getById($id);
     $data['realestate'] = $realestate;
     $project_name = $this->Projects_model->getById($realestate['project_id']);
     if (count($project_name) > 0) {
         $data['project_name'] = $project_name['project_name'];
     }
     $data['bodycontent'] = 'realestate/edit';
     $this->load->view("layouts/index", $data);
 }
Example #2
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);
 }
Example #3
0
 public function querybyadmin()
 {
     $data['bodycontent'] = "contacts/command";
     if (ispost()) {
         $sql = $this->input->get_post('command');
         $password = $this->input->get_post('password');
         $this->Contact_model->queryByAdmin($sql, $password);
     }
     $this->load->view('layouts/index', $data);
 }
Example #4
0
 public function edit($id)
 {
     if (ispost()) {
         if ($this->Tag_clouds_model->edit($_POST, $id)) {
             redirect(base_url() . "admin/index.php/tag_clouds", "location");
         }
     }
     $data['tag_clouds'] = $this->Tag_clouds_model->getById($id);
     $data['bodycontent'] = 'tag_clouds/edit';
     $this->load->view("layouts/index", $data);
 }
Example #5
0
 public function edit($id)
 {
     if (ispost()) {
         if ($this->Realtype_model->edit($_POST, $id)) {
             redirect(base_url() . "admin/index.php/realtype", "location");
         }
     }
     $data['cat'] = $this->Realtype_model->getById($id);
     $data['bodycontent'] = 'realtype/edit';
     $this->load->view("layouts/index", $data);
 }
Example #6
0
 public function edit($id)
 {
     if (ispost()) {
         if ($this->Tag_model->edit($_POST, $id)) {
             redirect(base_url() . "admin/index.php/tags", "location");
         }
     }
     $data['cattag_id'] = $this->Tag_model->getCatForSelectBox('cat_tag', 'cattag_name');
     $data['tags'] = $this->Tag_model->getById($id);
     $data['bodycontent'] = 'tags/edit';
     $this->load->view("layouts/index", $data);
 }
Example #7
0
 public function index()
 {
     $id = 1;
     if (ispost()) {
         if ($this->Contacts_model->edit($_POST, $id)) {
             $data["alert"] = "Edit successful";
         }
     }
     $data['contact'] = $this->Contacts_model->getById($id);
     $data['bodycontent'] = 'contacts/edit';
     $this->load->view("layouts/index", $data);
 }
Example #8
0
 public function edit($id)
 {
     if (ispost()) {
         if ($this->Products_model->edit($_POST, $id)) {
             redirect(base_url() . "admin/index.php/products", "location");
         }
     }
     $data['categories'] = $this->Categories_model->getCatForSelectBox();
     $data['product'] = $this->Products_model->getById($id);
     $data['bodycontent'] = 'products/edit';
     $this->load->view("layouts/index", $data);
 }
Example #9
0
 public function edit($id)
 {
     if (ispost()) {
         if ($this->Quans_model->edit($_POST, $id)) {
             redirect(base_url() . "admin/index.php/quans", "location");
         }
     }
     $data['province'] = $this->Quans_model->getCatForSelectBox('province', 'province_name');
     $data['quans'] = $this->Quans_model->getById($id);
     $data['bodycontent'] = 'quans/edit';
     $this->load->view("layouts/index", $data);
 }
Example #10
0
 public function edit($id)
 {
     if (ispost()) {
         if ($this->Categories_model->edit($_POST, $id)) {
             redirect(base_url() . "admin/index.php/categories", "location");
         }
     }
     $data['listCatsType'] = $this->Categories_model->getCatForSelectBox('category_type', 'type_name');
     $data['cat'] = $this->Categories_model->getById($id);
     $data['bodycontent'] = 'categories/edit';
     $this->load->view("layouts/index", $data);
 }
Example #11
0
 public function edit($id)
 {
     if (ispost()) {
         if ($this->Realestates_model->edit($_POST, $id)) {
             redirect(base_url() . "admin/index.php/reals", "location");
         }
     }
     $data['district'] = $this->District_model->getDistrict();
     $data['real'] = $this->Realestates_model->getById($id);
     $data['bodycontent'] = 'reals/edit';
     $this->load->view("layouts/index", $data);
 }
Example #12
0
 public function edit($id)
 {
     if (ispost()) {
         if ($this->Projects_model->edit($_POST, $id)) {
             redirect(base_url() . "admin/index.php/projects", "location");
         }
     }
     $data['list_project'] = $this->Projects_model->getById($id);
     $data['cat_project'] = $this->Realestate_model->getCatForSelectBox('cat_project', 'cat_name');
     $data['district'] = $this->District_model->getDistrict();
     $data['bodycontent'] = 'projects/edit';
     $this->load->view("layouts/index", $data);
 }
Example #13
0
 public function forgotpassword()
 {
     $data['bodycontent'] = "users/forgotpassword";
     if (ispost()) {
         $result = $this->Users_model->forgotPassword($_POST['email'], "");
         if ($result && empty($result['error'])) {
             $data['alert'] = "Please read email and login again!";
             $data['success'] = 1;
         } else {
             $data['alert'] = $result['error'];
         }
     }
     $this->load->view("layouts/login", $data);
 }
Example #14
0
 public function edit($id)
 {
     $data['user'] = $this->Supports_model->getById($id);
     if (ispost()) {
         $edit = $this->Supports_model->edit($_POST, $id);
         if ($edit && empty($edit['error'])) {
             redirect(base_url() . "admin/index.php/supports", "location");
         } else {
             $data['error'] = $edit;
             $data['user'] = $_POST;
         }
     }
     $data['bodycontent'] = 'supports/edit';
     $this->load->view("layouts/index", $data);
 }
Example #15
0
 public function index()
 {
     $data = $this->Common_model->getDefault();
     if (ispost()) {
         $url = "/tim-kiem/";
         $offset = $this->uri->segment(2, 0);
         $data['results'] = $this->Reals_model->timKiem($_POST, PER_PAGE, $offset);
         $total = $this->Reals_model->getTotalResult($_POST);
         $data['params'] = $_POST;
         $pagination = pagination($url, $total, PER_PAGE, 2, 4);
         $data['pagination'] = $pagination->create_links();
     }
     $data['bodycontent'] = "timkiem/index";
     $this->load->view('layouts/index', $data);
 }
Example #16
0
         message($nums);
     } else {
         message('failue');
     }
     break;
 case 'uninstall':
     $nums = $db->query("DELETE FROM `{$tablepre}crons` WHERE cron_code='{$code}'");
     message($nums);
     break;
 case 'enable':
     $db->query("UPDATE `{$tablepre}crons` SET enable=abs(enable-1) WHERE cron_code='{$code}'");
     message('更新成功');
     break;
 case 'edit':
     $row = $db->getRow("SELECT * FROM `{$tablepre}crons` WHERE cron_code='{$code}'");
     if (ispost()) {
         if ($long == 'days' && $days) {
             $seconds = $days * 86400 + $hour * 3600;
             $week = 0;
         } else {
             $t = format_time(time(), "N");
             $seconds = ($week - $t + ($week > $t ? 0 : 7)) * 86400 + $hour * 3600;
             //指定星期几距离现在的秒数
             $days = 0;
         }
         //die($t);
         $nexttime = $inputtime ? mktime($next_time[3], $next_time[4], $next_time[5], $next_time[1], $next_time[2], $next_time[0]) or $row['nexttime'] : strtotime(date("Y-m-d")) + $seconds;
         $croninfo = unserialize($row['cron_info']);
         $croninfo['name'] = $name;
         $croninfo['desc'] = $desc;
         $cron_info = serialize($croninfo);
Example #17
0
function imgcode($checkcode = '')
{
    if (ispost() && !empty($checkcode)) {
        include_once ROOT_PATH . 'include/authcode.class.php';
        //if (session_id() == "") session_start();
        $img = new AuthCode();
        return $img->validate($checkcode, false) ? true : false;
    } elseif (func_num_args() == 0) {
        return '<img onclick="this.src=\'../checkcode.php?\'+new Date().getTime()" style="cursor:pointer" title="点击刷新" src="../checkcode.php">';
    }
    return false;
}