if (!empty($_GET['q'])) { $search_title = $_GET['q']; $conditions[] = "model_name like '%" . $search_title . "%'"; } if (!empty($_GET['display'])) { $display = $_GET['display']; $conditions[] = "display = '" . $display . "'"; } } if ($do == "del" && !empty($id)) { $deleted = false; //$deleted = $game->del($id); } if ($do == "edit") { if (!empty($id)) { $item = $handset->read("*", $id); } } } if (empty($pid) || empty($gid)) { flash("Hãy chọn file game và sản phẩm cần thêm thiết bị hỗ trợ!", "product.php"); } $amount = $handset->findCount(null, $conditions); $page->displaypg = 50; $page->setPagenav($amount); //print_r($conditions); $result = $handset->findAll("*", null, $conditions, "brand_name ASC", $page->firstcount, $page->displaypg); //print_r($result); setvar("Items", $result); setvar("ByPages", $page->pagenav); template($tpl_file);
require LIB_PATH . 'time.class.php'; require APP_ROOT . 'libraries/page.class.php'; require LIB_PATH . "cache.class.php"; include CACHE_PATH . "cache_type.php"; $page = new Pages(); $cache = new Caches(); $gamehandset = new Gamehandsets(); $handset = new Handsets(); $conditions = array(); //$conditions[] = "brand_name <> ''"; //$conditions[] = "brand_name = 'nokia'"; $fields = null; $tpl_file = "gamehandset"; if (!empty($id)) { $vals['created'] = $time_stamp; $handsetinfo = $handset->read("*", $id); $vals['device_id'] = $handsetinfo['deviceID']; $vals['brand_name'] = $handsetinfo['brand_name']; $vals['model_name'] = $handsetinfo['model_name']; } if (isset($_REQUEST['del']) && !empty($_REQUEST['id'])) { $deleted = false; $deleted = $gamehandset->del($_REQUEST['id']); } if (isset($_GET['do'])) { $do = trim($_GET['do']); if (isset($_GET['action'])) { $action = trim($_GET['action']); } if (!empty($_GET['id'])) { $id = intval($_GET['id']);