public function index() { try { $order = 1; if (isset($_REQUEST["order"])) { $order = intval($_REQUEST["order"]); } $roomDAO = CreateObject("Model_DAO_Room"); $tempOrder = $this->getTempOrder($order); //dieu kien where $where = ""; $where = $roomDAO->getWhere(); //echo $where; if (strlen($where) != 0) { $where = " where " . $where; } $this->getObjectSearch(); // end dieu kien where $sql = "select * from " . table_prefix("room") . " " . $where . " " . $tempOrder; //echo $sql; $page = 1; if (isset($_REQUEST["p"])) { $page = intval($_REQUEST["p"]); } $row_total = getRow($sql); $page_size = 6; $pagegroup_size = 5; if (isset($_REQUEST["order"])) { $url = "index.php?rt=inex/index&order={$order}"; } else { $url = "index.php?rt=inex/index"; } $rooms = $roomDAO->lists($order, $page * $page_size - $page_size, $page_size); $this->registry->template->page = $page; $this->registry->template->row_total = $row_total; $this->registry->template->page_size = $page_size; $this->registry->template->pagegroup_size = $pagegroup_size; $this->registry->template->url = $url; $this->registry->template->rooms = $rooms; $this->registry->template->roomDAO = $roomDAO; if (isset($_SESSION["listSoSanh"])) { $arrs = $_SESSION["listSoSanh"]; $roomSoSanhs = array(); foreach ($arrs as $item) { $obj = $roomDAO->get($item); $roomSoSanhs[] = $obj; } $this->registry->template->roomSoSanhs = $roomSoSanhs; $this->registry->template->order = $order; } $searchObj = $_SESSION["searchObj"]; $this->registry->template->searchObj = $searchObj; $this->registry->template->show('index_index'); } catch (MyException $ex) { $ex->__toString(); } }
public function list_comment() { try { $commentDAO = CreateObject("Model_DAO_Comment"); $page = 1; if (isset($_REQUEST["p"])) { $page = intval($_REQUEST["p"]); } $row_total = getRow("select * from " . table_prefix("comment")); $showResult = 0; if (isset($_REQUEST["showResult"])) { $showResult = $_REQUEST["showResult"]; $page_size = $showResult; } if ($showResult == 0) { $page_size = 5; } $pagegroup_size = 5; $url = "index.php?rt=admin/list_comment"; $comments = $commentDAO->lists($page * $page_size - $page_size, $page_size); $this->registry->template->page = $page; $this->registry->template->row_total = $row_total; $this->registry->template->page_size = $page_size; $this->registry->template->pagegroup_size = $pagegroup_size; $this->registry->template->pagegroup_size = $pagegroup_size; $this->registry->template->url = $url; $this->registry->template->comments = $comments; $this->registry->template->showResult = $showResult; $this->registry->template->showAdmin('list_comment'); } catch (MyException $ex) { header("Location: index.php?admin/index"); } }
public function changepassword($account) { global $dbconfig; $status = false; try { $sql = "update " . table_prefix("account"); $dbconfig->open(); $dbconfig->query($sql); if ($dbconfig->num_affected() != 0) { $status = true; } $dbconfig->close(); return $status; } catch (MyException $ex) { $ex->__toString(); return $status; } }
public function update($phuong) { global $dbconfig; $status = false; try { $sql = "update " . table_prefix("phuong") . " set `name`='" . $dbconfig->sqlQuote($phuong->name) . "', `order` = '" . $dbconfig->sqlQuote($phuong->order) . "', updated = '" . $dbconfig->sqlQuote($phuong->updated) . "', status = '" . $dbconfig->sqlQuote($phuong->status) . "' where id ='" . $dbconfig->sqlQuote($phuong->id) . "';"; echo $sql; $dbconfig->open(); $dbconfig->query($sql); if ($dbconfig->num_affected() != 0) { $status = true; } $dbconfig->close(); return $status; } catch (MyException $ex) { $ex->__toString(); return $status; } }
* @copyright (c) 2005 phpBB Group * @license http://opensource.org/licenses/gpl-license.php GNU Public License * */ /** */ if (!defined('IN_PHPBB')) { exit; } /** * @ignore */ require $phpbb_root_path . "includes/sphinxapi-0.9.8." . $phpEx; define('INDEXER_NAME', 'indexer'); define('SEARCHD_NAME', 'searchd'); define('SPHINX_TABLE', table_prefix() . 'sphinx'); define('MAX_MATCHES', 20000); define('CONNECT_RETRIES', 3); define('CONNECT_WAIT_TIME', 300); /** * Returns the global table prefix * This function is necessary as this file is sometimes included from within a * function and table_prefix is in global space. */ function table_prefix() { global $table_prefix; return $table_prefix; } /** * fulltext_sphinx
public function update($comment) { global $dbconfig; $status = false; $comment->updated = date("now"); var_dump($comment); try { $sql = "update " . table_prefix("comment") . " set title='" . $dbconfig->sqlQuote($comment->title) . "', idroom='" . $dbconfig->sqlQuote($comment->idroom) . "',content = '" . $dbconfig->sqlQuote($comment->content) . "', name = '" . $dbconfig->sqlQuote($comment->name) . "', email = '" . $dbconfig->sqlQuote($comment->email) . "', updated = '" . $dbconfig->sqlQuote($comment->updated) . "' where id ='" . $dbconfig->sqlQuote($comment->id) . "';"; $dbconfig->open(); $dbconfig->query($sql); if ($dbconfig->num_affected() != 0) { $status = true; } $dbconfig->close(); return $status; } catch (MyException $ex) { $ex->__toString(); return $status; } }
public function update($room) { global $dbconfig; $status = false; try { $sql = "update " . table_prefix("room") . " set title='" . $dbconfig->sqlQuote($acount->title) . "',shortdescription = '" . $dbconfig->sqlQuote($acount->shortdescription) . "',description = '" . $dbconfig->sqlQuote($room->description) . "',anh_dai_dien = '" . $dbconfig->sqlQuote($room->anh_dai_dien) . "',new = '" . $dbconfig->sqlQuote($room->new) . "',is_phong_khep_kin = '" . $dbconfig->sqlQuote($room->is_phong_khep_kin) . "',sonha = '" . $dbconfig->sqlQuote($room->sonha) . "',kiet = '" . $dbconfig->sqlQuote($room->kiet) . "',tongsophong = '" . $dbconfig->sqlQuote($room->tongsophong) . "',sophongcontrong = '" . $dbconfig->sqlQuote($room->sophongcontrong) . "',tenchunha = '" . $dbconfig->sqlQuote($room->tenchunha) . "',dt_nha = '" . $dbconfig->sqlQuote($room->dt_nha) . "',dt_didong = '" . $dbconfig->sqlQuote($room->dt_didong) . "',email = '" . $dbconfig->sqlQuote($room->email) . "',gioi_tinh_thue = '" . $dbconfig->sqlQuote($room->gioi_tinh_thue) . "',gia_phong_max ='" . $dbconfig->sqlQuote($room->gia_phong_max) . "',gia_phong_min = '" . $dbconfig->sqlQuote($room->gia_phong_min) . "',giadien ='" . $dbconfig->sqlQuote($room->giadien) . "',gia_nuoc = '" . $dbconfig->sqlQuote($room->gia_nuoc) . "',gan_cho = '" . $dbconfig->sqlQuote($room->gan_cho) . "',gan_duong = '" . $dbconfig->sqlQuote($room->gan_duong) . "',internet = '" . $dbconfig->sqlQuote($room->internet) . "',isGoogleMap ='" . $dbconfig->sqlQuote($room->isGoogleMap) . "',longitude ='" . $dbconfig->sqlQuote($room->longitude) . "',latitude ='" . $dbconfig->sqlQuote($room->latitude) . "',contentGoogleMap = '" . $dbconfig->sqlQuote($room->contentGoogleMap) . "',titleGoogleMap = '" . $dbconfig->sqlQuote($room->titleGoogleMap) . "',stick = '" . $dbconfig->sqlQuote($room->stick) . "',order ='" . $dbconfig->sqlQuote($room->order) . "',create_by ='" . $dbconfig->sqlQuote($room->create_by) . "',create_date = '" . $dbconfig->sqlQuote($room->create_date) . "',updated_by = '" . $dbconfig->sqlQuote($room->updated_by) . "',updated = '" . $dbconfig->sqlQuote($room->updated) . "', status ='" . $dbconfig->sqlQuote($room->status) . "';"; $dbconfig->open(); $dbconfig->query($sql); if ($dbconfig->num_affected() != 0) { $status = true; } $dbconfig->close(); return $status; } catch (MyException $ex) { $ex->__toString(); return $status; } }