function edit_by_parent($catalogue_id, $id = 0) { $catalogue = new Estatecatalogue($catalogue_id); $type = new Estatetype($id); if ($_SERVER['REQUEST_METHOD'] == "POST") { $this->load->helper('remove_vn_helper'); $type->name = $this->input->post('name'); $type->name_none = remove_vn($type->name); $type->estatecatalogue_id = $catalogue_id; $type->description = $this->input->post('description'); $type->keyword = $this->input->post('keyword'); if ($type->save()) { flash_message('success', 'Thao tác đã được thực hiện'); redirect($this->admin . 'estatetypes/list_by_parent/' . $catalogue_id); } else { flash_message('error', 'Đã có lỗi xãy ra !'); } } $dis['object'] = $type; $dis['catalogue_id'] = $catalogue_id; $dis['base_url'] = base_url(); $dis['view'] = 'estatetype/edit'; $dis['menu_active'] = 'Hình thức'; $dis['title'] = "Thêm/Sửa loại thuộc <span style='color:#F00;'>" . $catalogue->name . "</span>"; $dis['nav_menu'] = array(array("type" => "back", "text" => "Quay về", "link" => "{$this->admin_url}estatetypes/list_by_parent/" . $catalogue_id, "onclick" => "")); $this->viewadmin($dis); }
function edit($id = 0) { $price = new Estateprice($id); if ($_SERVER['REQUEST_METHOD'] == "POST") { $this->load->helper('remove_vn_helper'); $price->label = $this->input->post('label'); $price->from = $this->input->post('from'); $price->to = $this->input->post('to'); $price->estatecatalogue_id = $this->input->post('estatecatalogue_id'); $price->url = remove_vn($price->label); if ($price->save()) { flash_message('success', 'Thao tác đã được thực hiện'); redirect($this->admin . 'estateprices/list_all'); } else { flash_message('error', 'Đã có lỗi xãy ra !'); } } $estatecatalogues = new Estatecatalogue(); $estatecatalogues->get_iterated(); $dis['estatecatalogues'] = $estatecatalogues; $dis['object'] = $price; $dis['base_url'] = base_url(); $dis['view'] = 'estateprice/edit'; $dis['menu_active'] = 'Mức giá'; $dis['title'] = "Thêm/Sửa Mức giá"; $dis['nav_menu'] = array(array("type" => "back", "text" => "Quay về", "link" => "{$this->admin_url}estateprices/list_all/", "onclick" => "")); $this->viewadmin($dis); }
function edit_by_parent($district_id, $id = 0) { $district = new Estatedistrict($district_id); $wards = new Estateward($id); if ($_SERVER['REQUEST_METHOD'] == "POST") { $this->load->helper('remove_vn_helper'); $wards->name = $this->input->post('name'); $wards->name_none = remove_vn($wards->name); $wards->estatedistrict_id = $district_id; if ($wards->save()) { flash_message('success', 'Thao tác đã được thực hiện'); redirect($this->admin . 'estatewards/list_by_parent/' . $district_id); } else { flash_message('error', 'Đã có lỗi xãy ra !'); } } $dis['object'] = $wards; $dis['district_id'] = $district_id; $dis['base_url'] = base_url(); $dis['view'] = 'estateward/edit'; $dis['menu_active'] = 'Thành phố/Tỉnh'; $dis['title'] = "Thêm/Sửa Xã/Phường thuộc <span style='color:#F00;'>" . $district->name . "</span>"; $dis['nav_menu'] = array(array("type" => "back", "text" => "Quay về", "link" => "{$this->admin_url}estatewards/list_by_parent/" . $district_id, "onclick" => "")); $this->viewadmin($dis); }
function edit($id = 0) { $catalogue = new Estatecatalogue($id); if ($_SERVER['REQUEST_METHOD'] == "POST") { $this->load->helper('remove_vn_helper'); //$catalogue->parentcat_id = $this->input->post('parentcat_id'); $catalogue->name = $this->input->post('name'); $catalogue->name_none = remove_vn($catalogue->name); $catalogue->title = $this->input->post('title'); $catalogue->description = $this->input->post('description'); $catalogue->keyword = $this->input->post('keyword'); if ($catalogue->save()) { flash_message('success', 'Thao tác đã được thực hiện'); redirect($this->admin . 'estatecatalogues/list_all'); } else { flash_message('error', 'Đã có lỗi xãy ra !'); } } $estatesCatalogue = new Estatecatalogue(); $estatesCatalogue->where('parentcat_id', NULL); $estatesCatalogue->order_by('position'); $estatesCatalogue->get_iterated(); $dis['estatesCatalogue'] = $estatesCatalogue; $dis['object'] = $catalogue; $dis['base_url'] = base_url(); $dis['view'] = 'estatecatalogue/edit'; $dis['menu_active'] = 'Hình thức'; $dis['title'] = "Thêm/Sửa Hình thức"; $dis['nav_menu'] = array(array("type" => "back", "text" => "Quay về", "link" => "{$this->admin_url}estatecatalogues/list_all/", "onclick" => "")); $this->viewadmin($dis); }
function edit($id = 0) { $city = new Estatecity($id); if ($_SERVER['REQUEST_METHOD'] == "POST") { $this->load->helper('remove_vn_helper'); $city->name = $this->input->post('name'); $city->name_none = remove_vn($city->name); if ($this->input->post('isDefault') == 1) { $city->isDefault = 1; $city->position = $this->input->post('position'); } else { $city->isDefault = 0; } if ($city->save()) { flash_message('success', 'Thao tác đã được thực hiện'); redirect($this->admin . 'estatecitys/list_all'); } else { flash_message('error', 'Đã có lỗi xãy ra !'); } } $dis['object'] = $city; $dis['base_url'] = base_url(); $dis['view'] = 'estatecity/edit'; $dis['menu_active'] = 'Thành phố/Tỉnh'; $dis['title'] = "Thêm/Sửa Thành phố/Tỉnh"; $dis['nav_menu'] = array(array("type" => "back", "text" => "Quay về", "link" => "{$this->admin_url}estatecitys/list_all/", "onclick" => "")); $this->viewadmin($dis); }
function edit($id = 0) { $newscatalogue = new newscatalogue($id); if ($_SERVER['REQUEST_METHOD'] == "GET") { } else { $newscatalogue->name_vietnamese = $this->input->post('name_vietnamese'); $newscatalogue->name_english = $this->input->post('name_english'); $newscatalogue->name_japanese = $this->input->post('name_japanese'); $parentcat = new newscatalogue(trim($this->input->post('parentcat'))); $newscatalogue->title_bar = $this->input->post('title_bar'); $newscatalogue->slogan = $this->input->post('slogan'); $newscatalogue->keyword = $this->input->post('keyword'); $newscatalogue->group = $this->input->post('group'); if ($this->logged_in_user->adminrole->id == 1) { $newscatalogue->navigation = $this->input->post('navigation'); $newscatalogue->menu_active = $this->input->post('menu_active'); } $this->load->helper('remove_vn_helper'); $newscatalogue->name_none = remove_vn($newscatalogue->name_vietnamese); if ($newscatalogue->save(array('parentcat' => $parentcat))) { redirect($this->admin . 'newscatalogues/list_all/'); } } $parentcat = new newscatalogue(); $parentcat->where('parentcat_id', NULL); if ($newscatalogue->exists()) { $parentcat->where('id !=', $newscatalogue->id); } $parentcat->order_by('position', 'asc'); $parentcat->get(); $sitelanguage = new Sitelanguage(); $sitelanguage->get()->all; $dis['sitelanguage'] = $sitelanguage; $dis['base_url'] = base_url(); $dis['parentcat'] = $parentcat; $dis['title'] = "Thêm/ Sửa danh mục tin tức"; $dis['menu_active'] = "Danh mục tin tức"; $dis['view'] = "newscatalogue/edit"; $dis['object'] = $newscatalogue; $dis['nav_menu'] = array(array("type" => "back", "text" => "Back", "link" => "{$this->admin_url}newscatalogues/", "onclick" => "")); $this->viewadmin($dis); }
function edit($id = 0) { $newstopic = new newstopic($id); if ($_SERVER['REQUEST_METHOD'] == "GET") { } else { $newstopic->name = $this->input->post('name'); $this->load->helper('remove_vn_helper'); $newstopic->name_none = remove_vn($newstopic->name); if ($newstopic->save()) { redirect($this->admin . 'newstopics/edit/' . $newstopic->id); } } $dis['base_url'] = base_url(); $dis['title'] = "Thêm/ Sửa dòng sự kiện tin tức"; $dis['menu_active'] = "Dòng sự kiện"; $dis['view'] = "newstopic/edit"; $dis['object'] = $newstopic; $dis['nav_menu'] = array(array("type" => "back", "text" => "Back", "link" => "{$this->admin_url}newstopics/", "onclick" => ""), array("type" => "add", "text" => "Thêm mới", "link" => "{$this->admin_url}newstopics/edit", "onclick" => "")); $this->viewadmin($dis); }
function edit($id = 0) { $bannercat = new bannercat($id); if ($_SERVER['REQUEST_METHOD'] == "GET") { } else { $bannercat->name = $this->input->post('name'); $bannercat->description = $this->input->post('description'); $this->load->helper('remove_vn_helper'); $bannercat->name_none = remove_vn($bannercat->name); if ($bannercat->save()) { redirect($this->admin . 'bannercats/list_all/'); } } $dis['base_url'] = base_url(); $dis['title'] = "Thêm/ Sửa Banner"; $dis['menu_active'] = "Hình quảng cáo"; $dis['view'] = "banner/edit"; $dis['object'] = $bannercat; $dis['nav_menu'] = array(array("type" => "back", "text" => "Quay về", "link" => "{$this->admin_url}bannercats/", "onclick" => "")); $this->viewadmin($dis); }
function edit($id = 0) { $showrooms = new showroom($id); if ($_SERVER['REQUEST_METHOD'] == "GET") { } else { $showrooms->name_vietnamese = $this->input->post('name_vietnamese'); $showrooms->name_english = $this->input->post('name_english'); $showrooms->kind = $this->input->post('kind'); $showrooms->description = $this->input->post('description'); $showrooms->keyword = $this->input->post('keyword'); $showrooms->txtDescription_vietnamese = $this->input->post('txtDescription_vietnamese'); $showrooms->txtDescription_english = $this->input->post('txtDescription_english'); $showrooms->video = $this->input->post('video'); $this->load->helper('remove_vn_helper'); $showrooms->name_none = remove_vn($showrooms->name_vietnamese); $filePath = 'img/showroom/'; $this->load->library('file_lib'); $dataupload = $this->file_lib->upload('image', $filePath); if (is_array($dataupload)) { $showrooms->image = $filePath . $dataupload['file_name']; } if ($showrooms->save()) { redirect($this->admin . 'showrooms/listAll'); } } $photos = new showroomphoto(); $photos->where('showroom_id', $id); $photos->get_iterated(); $dis['photos'] = $photos; $dis['base_url'] = base_url(); $dis['title'] = "Thêm/ Sửa Showroom"; $dis['menu_active'] = "Showroom"; $dis['view'] = "showroom/edit"; $dis['object'] = $showrooms; $dis['nav_menu'] = array(array("type" => "back", "text" => "Quay về", "link" => "{$this->admin_url}showrooms/", "onclick" => ""), array("type" => "add", "text" => "Thêm Showroomphoto", "link" => "{$this->admin_url}showroomphotos/edit/" . $id, "onclick" => "")); $this->viewadmin($dis); }
function edit($id = 0) { $area = new Estatearea($id); if ($_SERVER['REQUEST_METHOD'] == "POST") { $this->load->helper('remove_vn_helper'); $area->label = $this->input->post('label'); $area->from = $this->input->post('from'); $area->to = $this->input->post('to'); $area->url = remove_vn($area->label); if ($area->save()) { flash_message('success', 'Thao tác đã được thực hiện'); redirect($this->admin . 'estateareas/list_all'); } else { flash_message('error', 'Đã có lỗi xãy ra !'); } } $dis['object'] = $area; $dis['base_url'] = base_url(); $dis['view'] = 'estatearea/edit'; $dis['menu_active'] = 'Diện tích'; $dis['title'] = "Thêm/Sửa Diện tích"; $dis['nav_menu'] = array(array("type" => "back", "text" => "Quay về", "link" => "{$this->admin_url}estateareas/list_all/", "onclick" => "")); $this->viewadmin($dis); }
function edit($id = 0) { $landcategories = new Landcategory($id); if ($_SERVER['REQUEST_METHOD'] == "POST") { $this->load->helper('remove_vn_helper'); /*$landcategories->parentcat_id = $this->input->post('parentcat_id');*/ $landcategories->name = $this->input->post('name'); $landcategories->name_none = remove_vn($landcategories->name); $landcategories->link = $this->input->post('link'); if ($landcategories->save()) { flash_message('success', 'Thao tác đã được thực hiện'); redirect($this->admin . 'landcategories/list_all'); } else { flash_message('error', 'Đã có lỗi xãy ra !'); } } $dis['object'] = $landcategories; $dis['base_url'] = base_url(); $dis['view'] = 'landcategory/edit'; $dis['menu_active'] = 'Danh mục nhà đất'; $dis['title'] = "Thêm/Sửa Danh mục nhà đất"; $dis['nav_menu'] = array(array("type" => "back", "text" => "Quay về", "link" => "{$this->admin_url}landcategories/list_all/", "onclick" => "")); $this->viewadmin($dis); }
function edit($id = 0) { $productcat = new productcat($id); if ($_SERVER['REQUEST_METHOD'] == "POST") { $this->load->library('file_lib'); //get the object parameter $productcat->name_vietnamese = $this->input->post('name_vietnamese'); $productcat->name_english = $this->input->post('name_english'); $productcat->name_japanese = $this->input->post('name_japanese'); $parentcat = new productcat(trim($this->input->post('productCategoryId'))); $productcat->isShowInHot = $this->input->post('isShowInHot'); $productcat->isShowInNew = $this->input->post('isShowInNew'); $productcat->isShowInParentHot = $this->input->post('isShowInParentHot'); $productcat->isHide = $this->input->post('isHide'); $productcat->isShowLogo = $this->input->post('isShowLogo'); $productcat->seo_title_vietnamese = $this->input->post('seo_title_vietnamese'); $productcat->seo_keyword_vietnamese = $this->input->post('seo_keyword_vietnamese'); $productcat->seo_description_vietnamese = $this->input->post('seo_description_vietnamese'); $productcat->seo_title_english = $this->input->post('seo_title_english'); $productcat->seo_keyword_english = $this->input->post('seo_keyword_english'); $productcat->seo_description_english = $this->input->post('seo_description_english'); $productcat->numProductHomepage = $this->input->post('numProductHomepage'); $productcat->tag = $this->input->post('tag'); if ($_FILES['logo']['name'] != "") { $dataupload = $this->file_lib->upload('logo', 'img/category/'); if (is_array($dataupload)) { $productcat->image = 'img/category/' . $dataupload['file_name']; } else { flash_message('error', $dataupload); } } $this->load->helper('remove_vn_helper'); if (!$productcat->exists()) { $productcat->url_vietnamese = remove_vn($productcat->name_vietnamese); $productcat->url_english = remove_vn($productcat->name_english); } else { $productcat->url_vietnamese = $this->input->post('url_vietnamese'); $productcat->url_english = $this->input->post('url_english'); } if ($productcat->save(array('parentcat' => $parentcat))) { flash_message('success', 'Thành công. Thao tác đã được thực hiện.'); redirect($this->admin . 'productcats/edit/' . $productcat->id); } } $dis['base_url'] = base_url(); $sitelanguage = new Sitelanguage(); $sitelanguage->get()->all; $dis['sitelanguage'] = $sitelanguage; $dis['nav_menu'] = array(array("type" => "back", "text" => "Back", "link" => "{$this->admin_url}productcats/listAll/" . $productcat->parentcat->id, "onclick" => ""), array("type" => "add", "text" => "Thêm danh mục khác", "link" => "{$this->admin_url}productcats/edit/", "onclick" => "")); //load any resource if the product category is exist if ($productcat->exists()) { //title depend on category name $dis['title'] = $productcat->name; $dis['productcatspec'] = $productcat->getSpec(); /*$dis['nav_menu'] = array_merge($dis['nav_menu'],array( array( "type"=>"add", "text"=>"Thêm thông số", "link"=>"javascript:void(0)", "onclick"=>"addSpecDialog_show()" ), array( "type"=>"edit", "text"=>"Copy thông số", "link"=>"javascript:void(0)", "onclick"=>"copySpecDialog_show()" ), array( "type"=>"edit", "text"=>"Thêm sp homepage", "link"=>"javascript:void(0)", "onclick"=>"showProductMultiDialog(0)" ) ));*/ $productHome = new producthome(); $productHome->where('productcat_id', $productcat->id); $productHome->order_by('position', 'asc'); $productHome->get_iterated(); $dis['productHome'] = $productHome; } else { $dis['title'] = "Thêm/ Sửa danh mục sản phẩm"; } $dis['menu_active'] = "Danh mục sản phẩm"; $dis['view'] = "productcats/edit"; $dis['object'] = $productcat; //$dis['productspecification'] = $productspecifications; $this->viewadmin($dis); }
function post() { if ($this->session->userdata('userLoginFlag') != 1) { redirect(base_url() . 'dang-nhap'); } $customer = new Estateuser($this->session->userdata('userLoginId')); if (!$customer->exists()) { show_404(); } if ($customer->isLock == 1) { redirect(base_url() . 'chinh-sua-tin-da-dang'); } $dis['customer'] = $customer; if ($_SERVER['REQUEST_METHOD'] == 'POST') { $o = new Estate(); $o->estatecity_id = $this->input->post('estatecity_id'); $o->estatedistrict_id = $this->input->post('estatedistrict_id'); $o->estatedirection_id = $this->input->post('estatedirection_id'); $o->estatecatalogue_id = $this->input->post('estatecatalogue_id'); $o->estatetype_id = $this->input->post('estatetype_id'); $o->estatearea_id = $this->input->post('estatearea_id'); $o->estateprice_id = $this->input->post('estateprice_id'); $o->estateward_id = $this->input->post('estateward_id'); $o->address = $this->input->post('address'); $o->isArea = $this->input->post('IsArea'); $o->area = $this->input->post('area'); $o->legally = $this->input->post('legally'); $o->isPrice = $this->input->post('IsPrice'); $o->price_text = $this->input->post('price_text'); $o->estatedirection_id = $this->input->post('estatedirection_id'); $o->estateuser_id = $this->session->userdata('userLoginId'); $o->title = ucfirst(mb_strtolower($this->input->post('title'), "utf-8")); $o->description = $this->input->post('description'); $o->price_text = $this->input->post('price_text'); $o->area_text = $this->input->post('area_text'); if ($o->estatecatalogue_id == 1) { $o->price_type = $this->input->post('price_type'); } else { $o->price_type = $this->input->post('price_type_2'); } $o->code = $this->add_code(7, $o->max_id() + 1, $o->estatecatalogue_id); $o->title_none = remove_vn($this->input->post('title')) . $o->code; if ($this->securimage->check($_POST['captcha_code']) == false) { $msg = '<div class="frm-error error-capcha">Vui lòng nhập đúng mã xác nhận !</div>'; $type = 0; } else { $folder = 'img/project/'; $dataupload = $this->file_lib->upload('image', $folder, $rename_file = true); if (!is_array($dataupload)) { $o->photo = ''; } else { $o->photo = $folder . $dataupload['file_name']; $img = getimagesize($folder . $dataupload['file_name']); if (!empty($img[2])) { $typeImage = image_type_to_mime_type($img[2]); } $fileWatermark = 'img/watermark/chen-hinh-tin-rao.png'; $fileImage = $folder . $dataupload['file_name']; $stamp = imagecreatefrompng($fileWatermark); if ($typeImage == 'image/jpeg') { $im = imagecreatefromjpeg($fileImage); } else { if ($typeImage == 'image/gif') { $im = imagecreatefromgif($fileImage); } else { $im = imagecreatefrompng($fileImage); } } // Get dimensions $sx = imagesx($im); $sy = imagesy($im); $sx1 = imagesx($stamp); $sy1 = imagesy($stamp); // width to calculate positioning of the stamp. imagecopy($im, $stamp, ($sx - $sx1) / 2, ($sy - $sy1) / 2, 0, 0, imagesx($stamp), imagesy($stamp)); // Output and free memory header('Content-type: image/png'); imagejpeg($im, $fileImage, 100); } if ($o->save()) { $msg = '<div class="frm-success">Thành công. Tin của bạn đã được đăng thành công !</div>'; $type = 1; /*Upload list images for estates*/ $numfile = $this->input->post('numfile'); foreach ($numfile as $row) { $dataupload = $this->file_lib->upload('image' . $row, $folder, $rename_file = true); if (is_array($dataupload)) { $estate_photos = new Estate_photo(); $estate_photos->estate_id = $o->id; $estate_photos->name = $folder . $dataupload['file_name']; $estate_photos->save(); $estate_photos->clear(); $img = getimagesize($folder . $dataupload['file_name']); if (!empty($img[2])) { $typeImage = image_type_to_mime_type($img[2]); } $fileWatermark = 'img/watermark/chen-hinh-tin-rao.png'; $fileImage = $folder . $dataupload['file_name']; $stamp = imagecreatefrompng($fileWatermark); if ($typeImage == 'image/jpeg') { $im = imagecreatefromjpeg($fileImage); } else { if ($typeImage == 'image/gif') { $im = imagecreatefromgif($fileImage); } else { $im = imagecreatefrompng($fileImage); } } // Get dimensions $sx = imagesx($im); $sy = imagesy($im); $sx1 = imagesx($stamp); $sy1 = imagesy($stamp); // width to calculate positioning of the stamp. imagecopy($im, $stamp, ($sx - $sx1) / 2, ($sy - $sy1) / 2, 0, 0, imagesx($stamp), imagesy($stamp)); // Output and free memory header('Content-type: image/png'); imagejpeg($im, $fileImage, 100); } } redirect(base_url() . 'chinh-sua-tin-da-dang'); } } } $project = new Article(); $project->where_in('newscatalogue_id', array(84, 85, 86, 87, 88, 89)); $project->get_iterated(); $dis['project'] = $project; $this->page_title = "Đăng tin rao vặt bất động sản | Rao vặt nhà đất | SotayNhadat.vn"; $dis['base_url'] = base_url(); $dis['view'] = 'front/user/post'; $dis['msg'] = $msg; $dis['type'] = $type; $dis['o'] = $o; $this->viewfront($dis); }
public function postFree() { if ($_SERVER['REQUEST_METHOD'] == 'POST') { $o = new Estate(); $o->estatecity_id = $this->input->post('estatecity_id'); $o->estatedistrict_id = $this->input->post('estatedistrict_id'); $o->estatedirection_id = $this->input->post('estatedirection_id'); $o->estatecatalogue_id = $this->input->post('estatecatalogue_id'); $o->estatetype_id = $this->input->post('estatetype_id'); $o->estatearea_id = $this->input->post('estatearea_id'); $o->estateprice_id = $this->input->post('estateprice_id'); $o->estateward_id = $this->input->post('estateward_id'); $o->address = $this->input->post('address'); $o->isArea = $this->input->post('IsArea'); $o->area = $this->input->post('area'); $o->legally = $this->input->post('legally'); $o->isPrice = $this->input->post('IsPrice'); $o->price_text = $this->input->post('price_text'); $o->estatedirection_id = $this->input->post('estatedirection_id'); $o->estateuser_id = $this->session->userdata('userLoginId'); $o->title = ucfirst($this->input->post('title')); $o->description = $this->input->post('description'); $o->price_text = $this->input->post('price_text'); $o->area_text = $this->input->post('area_text'); if ($o->estatecatalogue_id == 1) { $o->price_type = $this->input->post('price_type'); } else { $o->price_type = $this->input->post('price_type_2'); } $o->name_contact = $this->input->post('name_contact'); $o->address_contact = $this->input->post('address_contact'); $o->phone_contact = $this->input->post('phone_contact'); $o->mobile_contact = $this->input->post('mobile_contact'); $o->email_contact = $this->input->post('email_contact'); $o->isFree = 1; $o->active = 1; $o->code = $this->add_code(7, $o->max_id() + 1, $o->estatecatalogue_id); $o->title_none = remove_vn($this->input->post('title')) . $o->code; if ($this->securimage->check($_POST['captcha_code']) == false) { $msg = '<div class="frm-error error-capcha">Vui lòng nhập đúng mã xác nhận !</div>'; $type = 0; } else { $folder = 'img/project/'; $dataupload = $this->file_lib->upload('image', $folder, $rename_file = true); if (!is_array($dataupload)) { $o->photo = ''; } else { $o->photo = $folder . $dataupload['file_name']; } if ($o->save()) { $msg = '<div class="frm-success">Cảm ơn Bạn! Tin của Bạn đã được gửi đến Chúng tôi thành công. Thông thường sau 30 phút, tin sẽ được kích hoạt<br /><br />Bạn chưa đăng ký thành viên nên Chúng tôi sẽ kiểm duyệt tin đăng của Bạn trước khi hiển thị. Bạn không thể sửa/xóa tin đăng này. Để thuận tiện hơn, Bạn có thể <a style="color: #018e07;font-weight: bolder;" href="' . base_url() . 'dang-ky' . '">đăng ký thành viên</a> - Tin đăng được hiển thị ngay và nhận nhiều hỗ trợ từ Chúng tôi! <br/><br/> Hoặc, Bạn có thể tiếp tục <a style="color: #018e07;font-weight: bolder;" href="' . base_url() . 'dang-tin-rao-vat-nha-dat-mien-phi' . '">đăng tin rao vặt miễn phí</a>!</div>'; $type = 1; /*Upload list images for estates*/ $numfile = $this->input->post('numfile'); foreach ($numfile as $row) { $dataupload = $this->file_lib->upload('image' . $row, $folder); if (is_array($dataupload)) { $estate_photos = new Estate_photo(); $estate_photos->estate_id = $o->id; $estate_photos->name = $folder . $dataupload['file_name']; $estate_photos->save(); $estate_photos->clear(); } } } } } $dis['msg'] = $msg; $dis['type'] = $type; $dis['o'] = $o; $dis['base_url'] = base_url(); $dis['view'] = 'front/estates/post-free'; $this->page_title = "Đăng tin rao vặt nhà đất | rao vặt bất động sản | SotayNhadat.vn"; $this->page_description = "Đăng tin rao vặt nhà đất, căn hộ, đất nền, biệt thự...không cần đăng ký thành viên tại SotayNhadat.vn. Giúp Bạn giao dịch nhà đất đơn giản, nhanh chóng hơn!"; $this->viewfront($dis); }
<div align="justify"> <?php echo $news->full_vietnamese; ?> </div> --> </div> </div> <div class="sreentag2" > <div class="tag"></div> <p style="float:left; width:490px; margin-left:5px; color: #cccccc;"> <?php foreach ($tag as $tagSub) { ?> <a href="<?php echo $base_url . 'tags/' . remove_vn($tagSub); ?> "><?php echo $tagSub; ?> </a> , <?php } ?> </p> </div> <div class="duankhac" style="margin-left: 0px;"> <p style="font-size:16px; font-weight:bold; color:#FFFFFF; margin-left:15px; margin-top:8px;">Dự án khác</p> </div> <div class="sreenduankhac" style="width:610px; float:left; margin-bottom:5px;"> <?php
function edit($id = 0) { $estateuser = new Estateuser($id); if ($_SERVER['REQUEST_METHOD'] == "POST") { $this->load->helper('remove_vn_helper'); $estateuser->name = $this->input->post('name'); $estateuser->mobilePhone = $this->input->post('mobilePhone'); $estateuser->mobile = $this->input->post('mobile'); $estateuser->name_none = remove_vn($estateuser->name); if ($this->input->post('resetPassword') == 1) { $resetPassword = 123456; $estateuser->password = md5($resetPassword); } if ($estateuser->save()) { flash_message('success', 'Thao tác đã được thực hiện'); redirect($this->admin . 'estateusers/list_all'); } else { flash_message('error', 'Đã có lỗi xãy ra !'); } } $dis['object'] = $estateuser; $dis['base_url'] = base_url(); $dis['view'] = 'estateuser/edit'; $dis['menu_active'] = 'Thành viên'; $dis['title'] = "Thêm/Sửa Thành viên"; $dis['nav_menu'] = array(array("type" => "back", "text" => "Quay về", "link" => "{$this->admin_url}estateusers/list_all/", "onclick" => "")); $this->viewadmin($dis); }
<?php } ?> <?php if ($o->tag != '') { ?> <div class="sreentag" > <div class="tag"></div> <p style="float:left; width:490px; margin-left:5px; color:#333333; font-weight:bold;"> <?php $i = 0; foreach ($tag as $tagSub) { $i++; ?> <a href="<?php echo $base_url . 'tags-dang-tin/' . remove_vn($tagSub); ?> .html"><?php echo $tagSub; ?> </a> <?php echo $i < count($tag) ? ',' : ''; ?> <?php } ?> </p> </div> <?php } ?>
/** * Cnews::copy_2_cat() * * @param mixed $id * @return */ function copy_2_cat($id) { $this->load->helper('remove_vn_helper'); $news = new article($id); if (!$news->exists()) { show_404(); } $cat_id = $news->newscatalogue_id; $copy_newscatalogue = $this->input->post('copy_newscatalogue'); $copy_type = $this->input->post('copy_type'); $copy_amount = $this->input->post('copy_amount'); $flag_error = false; if ($copy_newscatalogue == 0) { $newscatalogue = new newscatalogue(); $newscatalogue->where('id !=', $news->newscatalogue_id); $newscatalogue->get(); $vb = new article(); $vb->hot = 0; $vb->home_hot = 0; foreach ($newscatalogue as $row) { for ($i = 0; $i < $copy_amount; $i++) { $vb = $news->get_copy(); $vb->code = ""; if (!$vb->save(array($row))) { foreach ($vb->error->all as $r) { flash_message('error', $r); $flag_error = true; } } else { $vb->title_vietnamese = $vb->code . ": " . $vb->title_vietnamese; $vb->title_none = remove_vn($vb->title_vietnamese) . "-" . md5($vb->id); $vb->save(); } $vb->clear(); } } } else { $newscatalogue = new newscatalogue($copy_newscatalogue); $vb = new article(); $vb->hot = 0; $vb->home_hot = 0; for ($i = 0; $i < $copy_amount; $i++) { $vb = $news->get_copy(); $vb->code = ""; if (!$vb->save(array($newscatalogue))) { foreach ($vb->error->all as $r) { flash_message('error', $r); $flag_error = true; } } else { $vb->title_vietnamese = $vb->code . ": " . $vb->title_vietnamese; $vb->title_none = remove_vn($vb->title_vietnamese) . "-" . md5($vb->id); $vb->save(); } $vb->clear(); } } if ($copy_type == "move") { $news->delete(); } if ($flag_error == false) { flash_message('success', "Thực hiện thành công xong copy/move"); } else { flash_message('info', "Có 1 vài lỗi trên"); } redirect($this->admin . 'cnews/edit/' . $cat_id . '/' . $id); }
function editFree($id = 0) { $estate = new estate($id); if ($_SERVER['REQUEST_METHOD'] == "POST") { $this->load->helper('remove_vn_helper'); $this->load->library('file_lib'); $estate->estatecity_id = $this->input->post('estatecity_id'); $estate->estatedistrict_id = $this->input->post('estatedistrict_id'); $estate->estateward_id = $this->input->post('estateward_id'); $estate->estatedirection_id = $this->input->post('estatedirection_id'); $estate->estatecatalogue_id = $this->input->post('estatecatalogue_id'); $estate->estatetype_id = $this->input->post('estatetype_id'); $estate->estatearea_id = $this->input->post('estatearea_id'); $estate->estateprice_id = $this->input->post('estateprice_id'); $estate->address = $this->input->post('address'); $estate->isArea = $this->input->post('IsArea'); $estate->area = $this->input->post('area'); $estate->legally = $this->input->post('legally'); $estate->isPrice = $this->input->post('IsPrice'); $estate->price_text = $this->input->post('price_text'); $estate->estatedirection_id = $this->input->post('estatedirection_id'); $estate->title = $this->input->post('title'); $estate->description = $this->input->post('description'); $estate->price_text = $this->input->post('price_text'); $estate->area_text = $this->input->post('area_text'); $estate->article_id = $this->input->post('article_id'); $estate->price_type = $this->input->post('price_type'); if ($estate->isVip == 0) { $estate->updateTime = date('Y-m-d H:i:s'); } else { $estate->created = $estate->created; $estate->updated = $estate->updated; $estate->updateTime = date('Y-m-d H:i:s'); } $estate->name_contact = $this->input->post('name_contact'); $estate->address_contact = $this->input->post('address_contact'); $estate->phone_contact = $this->input->post('phone_contact'); $estate->mobile_contact = $this->input->post('mobile_contact'); $estate->email_contact = $this->input->post('email_contact'); $estate->tag = $this->input->post('tag'); $tags = remove_vn($this->input->post('tag') . ' ' . $this->input->post('title')); $tags = explode('-', $tags); $estate->tag_search = implode(' ', $tags); $estate->title_none = remove_vn($this->input->post('title')) . $estate->code; // Change images default if ($_FILES['image']['name'] != "") { $folder = 'img/project/'; $dataupload = $this->file_lib->upload('image', $folder, $rename_file = true); if (!is_array($dataupload)) { flash_message('error', $dataupload); $estate->photo = ''; } else { $estate->photo = $folder . $dataupload['file_name']; } } if ($estate->save()) { flash_message('success', 'Bản tin đã được thay đổi thành công.'); redirect($this->admin_url . 'estates/listFree/'); //redirect($this->admin_url.'estates/editFree/'.$estate->id); } else { flash_message('error', 'Đã có lỗi xãy ra !'); //redirect($this->admin_url.'estates/listFree/'); redirect($this->admin_url . 'estates/editFree/' . $estate->id); } } $estateCategory = new Estatecatalogue(); $estateCategory->get_iterated(); $dis['estateCategory'] = $estateCategory; $estateType = new Estatetype(); $estateType->order_by('id'); $estateType->where('estatecatalogue_id', $estate->estatecatalogue_id); $estateType->get_iterated(); $dis['estateType'] = $estateType; $estateAreas = new Estatearea(); $estateAreas->order_by('position'); $estateAreas->get_iterated(); $dis['estateAreas'] = $estateAreas; $estateDirection = new Estatedirection(); $estateDirection->order_by('id'); $estateDirection->get_iterated(); $dis['estateDirection'] = $estateDirection; $estatePrices = new Estateprice(); $estatePrices->where('estatecatalogue_id', $estate->estatecatalogue_id); $estatePrices->order_by('position', 'asc'); $estatePrices->get_iterated(); $dis['estatePrices'] = $estatePrices; $estateCities = new Estatecity(); $estateCities->order_by('id'); $estateCities->get_iterated(); $dis['estateCities'] = $estateCities; $estateDictricts = new Estatedistrict(); $estateDictricts->where('estatecity_id', $estate->estatecity_id); $estateDictricts->order_by('position', 'asc'); $estateDictricts->get_iterated(); $dis['estateDictricts'] = $estateDictricts; $estateWards = new Estateward(); $estateWards->where('estatedistrict_id', $estate->estatedistrict_id); $estateWards->order_by('position'); $estateWards->get_iterated(); $dis['estateWards'] = $estateWards; $project = new Article(); $project->where('recycle', 0); $project->where('estatecity_id', $estate->estatecity_id); $project->order_by('title_vietnamese', 'asc'); $project->get_iterated(); $dis['project'] = $project; $dis['object'] = $estate; $dis['base_url'] = base_url(); $dis['view'] = 'estate/edit_free'; $dis['menu_active'] = 'Tin bất động sản (miễn phí)'; $dis['title'] = "Thêm/Sửa Tin '" . $estate->title . "'"; $dis['nav_menu'] = array(array("type" => "back", "text" => "Quay về", "link" => "{$this->admin_url}estates/listFree", "onclick" => "")); $this->viewadmin($dis); }