public function getRestoInitData() { if (Efiwebsetting::getData('checkOAuth') == 'yes') { IMBAuth::checkOAuth(); } $rid = $_GET['id_restaurant']; if (!isset($rid) || $rid == null) { Generic::errorMsg("Restaurant ID Not Found"); } $resto = new MasterRestaurantModel(); $resto->getByID($rid); $r["id_restaurant"] = $resto->id_restaurant; $r["name"] = $resto->name; $r["address"] = $resto->address; $r["district"] = $resto->district; $r["city"] = $resto->city; $r["email"] = $resto->email; $r["phone_no"] = $resto->phone_no; $r["time_open"] = date("H:i", strtotime($resto->time_open)); $r["time_close"] = date("H:i", strtotime($resto->time_close)); $r["image_logo"] = trim($resto->image_logo) != "" ? _BPATH . "uploads/" . $resto->image_logo : ""; $r["restaurant_type"] = $resto->restaurant_type; $r["id_cuisine"] = $resto->id_cuisine; $r["halal"] = $resto->halal; $r["latitude"] = $resto->latitude; $r["longitude"] = $resto->longitude; $rawTags = array(); $tagsIds = explode(",", $resto->restaurant_tags); if (count($tagsIds) != 0) { foreach ($tagsIds as $tagsId) { if ($tagsId == null || $tagsId == "") { continue; } $restoTag = new MasterRestaurantTagModel(); $restoTag->getByID($tagsId); $b["id_tag"] = $restoTag->id_tag; $b["name"] = $restoTag->tag_name; $rawTags[] = $b; } } $r["raw_tags"] = $rawTags; $this->jsonResults["restaurant"] = $r; $cuisine = new CuisineModel(); $cs = array(); foreach ($cuisine->getAll() as $cu) { $c["id_cuisine"] = $cu->id_cuisine; $c["name_cuisine"] = $cu->name_cuisine; $cs[] = $c; } if (count($cs) > 0) { $this->jsonResults["cuisine"] = $cs; } $rType = new MasterRestaurantTypeModel(); $rts = array(); foreach ($rType->getAll() as $ty) { $rt["id_restaurant_type"] = $ty->id_restaurant_type; $rt["name"] = $ty->name; $rts[] = $rt; } if (count($rts) > 0) { $this->jsonResults["restaurant_type"] = $rts; } $this->finish(); die; }
public static function getTagNameByID($id_tag) { $objRestoTag = new MasterRestaurantTagModel(); $objRestoTag->getByID($id_tag); return $objRestoTag->tag_name; }