public function process() { global $cookie; parent::process(); $swhere = parent::getSearchWhere(); $featureCount = HotelFeature::getFeatureCount($swhere); $this->pagination($featureCount); $hotelList = HotelFeature::getFeatureList($swhere, $this->p, $this->n); self::$smarty->assign("listData", $hotelList); self::$smarty->assign("featureList", $this->FeatureType); }
public function process() { global $cookie; parent::process(); $member = new Member(); $member->getByLoginUserName($cookie->LoginUserName); $swhere = parent::getSearchWhere(); $agentCount = $member->getAdminCount($swhere); $this->pagination($agentCount); $hotelList = $member->getAdminList($swhere, $this->p, $this->n); self::$smarty->assign("listData", $hotelList); }
public function process() { global $cookie; parent::process(); $iso = Language::getIsoById((int) $cookie->LanguageID); $member = new Member(); $member->getByLoginUserName($cookie->LoginUserName); $swhere = parent::getSearchWhere(); if ($swhere == "") { $swhere .= " 1 = 1 "; } if (Tools::getValue("HotelName") != "") { $swhere .= " AND HotelName_" . $iso . " like '%" . Tools::getValue("HotelName") . "%'"; } $hotelCount = $member->getHotelCount($swhere); $this->pagination($hotelCount); $hotelList = $member->getHotelList($swhere, $this->p, $this->n); self::$smarty->assign("listData", $hotelList); }
public function process() { parent::process(); $type = $this->type; $swhere = parent::getSearchWhere(); //if not admin, add date condition /* if(self::$cookie -> RoleID <= 3 ){ $swhere.= ($swhere=='')?'':" AND "; $swhere.= " (CURDATE() BETWEEN A.`StaDate` AND A.`EndDate`) "; }*/ $promotionCount = Promotion::getPromotionCount($type, $swhere); $this->pagination($promotionCount); $promotionList = Promotion::getPromotionList($type, $swhere, $this->p, $this->n); self::$smarty->assign("listData", $promotionList); self::$smarty->assign("areaList", Tools::getJapanAreas()); self::$smarty->assign("count", $promotionCount); }
public function process() { global $cookie; $iso = Language::getIsoById((int) $cookie->LanguageID); parent::process(); $swhere = parent::getSearchWhere(); if ($swhere == "") { $swhere .= " 1 = 1 "; } if (Tools::getValue("HotelName") != "") { $swhere .= " AND HotelName_" . $iso . " like '" . Tools::getValue("HotelName") . "'"; } $OrderStatusId = Tools::getValue("OrderStatusId"); if (!empty($OrderStatusId)) { if (self::$cookie->RoleID != 1) { if (Tools::getValue("OrderStatusId") == 4) { $swhere .= " AND OrderStatusId in ('4', '10') "; } else { $swhere .= " AND OrderStatusId = '" . Tools::getValue("OrderStatusId") . "'"; } } else { if (Tools::getValue("OrderStatusId") == 3) { $swhere .= " AND OrderStatusId in ('3','4','8','9','10') "; } else { $swhere .= " AND OrderStatusId = '" . Tools::getValue("OrderStatusId") . "'"; } } } if (Tools::getValue("CheckInDate") != "") { $swhere .= " AND CheckInDate = '" . Tools::getValue("CheckInDate") . "'"; } if (Tools::getValue("CheckOutDate") != "") { $swhere .= " AND CheckOutDate <= '" . Tools::getValue("CheckOutDate") . "'"; } if (Tools::getValue("DueDate") != "") { $swhere .= " AND DATE_SUB(CheckOutDate,INTERVAL 5 DAY) = '" . Tools::getValue("DueDate") . "'"; } if (Tools::getValue("CheckInDateFrom") != "") { $CheckInDateFrom = Tools::getValue("CheckInDateFrom"); $swhere .= " AND CheckInDate >= '" . Tools::getValue("CheckInDateFrom") . "'"; } if (Tools::getValue("CheckInDateTo") != "") { $CheckInDateTo = Tools::getValue("CheckInDateTo"); $swhere .= " AND CheckInDate <= '" . Tools::getValue("CheckInDateTo") . "'"; } if ((Tools::getValue("CheckInDateFrom") == "" || Tools::getValue("CheckInDateTo") == "") && self::$cookie->RoleID == 1) { $CheckInDateTo = date("Y-m-d"); $CheckInDateFrom = date("Y-m-d", mktime(0, 0, 0, date("m") - 2, date("d"), date("Y"))); $swhere .= " AND '{$CheckInDateFrom} 00:00:00' <= OrderedDate AND OrderedDate <= '{$CheckInDateTo} 23:59:59'"; } if (self::$cookie->RoleID != 1) { if (Tools::getValue("OrderEndDate") != "") { $OrderEndDate = Tools::getValue("OrderEndDate"); } else { $OrderEndDate = date("Y-m-d"); } if (Tools::getValue("OrderStartDate") != "") { $OrderStartDate = Tools::getValue("OrderStartDate"); } else { $OrderStartDate = date("Y-m-d", mktime(0, 0, 0, date("m") - 2, date("d"), date("Y"))); } //$swhere .= " AND '{$OrderStartDate} 00:00:00' <= OrderedDate AND OrderedDate <= '{$OrderEndDate} 23:59:59'"; } $paymentMethod = 1; if (self::$cookie->RoleID == 3) { $swhere .= " AND HT_Company.CompanyId = " . self::$cookie->CompanyID; $paymentMethod = Member::getPaymentMethod(self::$cookie->CompanyID); } else { if (self::$cookie->RoleID == 2) { $swhere .= " AND OrderUserId = " . self::$cookie->UserID; $paymentMethod = Member::getPaymentMethod(self::$cookie->CompanyID); } else { if (self::$cookie->RoleID == 1) { $swhere .= " AND HT_Hotel.HotelId = " . self::$cookie->HotelID; $paymentMethod = Member::getPaymentMethod(self::$cookie->CompanyID); } } } $settle = Tools::getValue("settle"); if ($settle == 1) { $swhere .= " AND (OrderStatusId = 3 OR OrderStatusId = 4)"; } $bookingCount = Booking::getBookingCount($swhere); $this->pagination($bookingCount); $bookingList = Booking::getBookingList($swhere, $this->p, $this->n); foreach ($bookingList as $key => $value) { if (self::$cookie->RoleID > 3) { if ($value['CheckInDate'] >= date('Y-m-d')) { $bookingList[$key]['isCancell'] = 1; } else { $bookingList[$key]['isCancell'] = 0; } } if ($value['CheckInDate'] < date('Y-m-d')) { $bookingList[$key]['exp'] = 1; } else { $bookingList[$key]['exp'] = 0; } $bookingList[$key]['money'] = $value['TotalPrice'] - $value['otherPrice']; } //get paymentMethod for show pay button self::$smarty->assign("listData", $bookingList); self::$smarty->assign("paymentMethod", $paymentMethod); self::$smarty->assign("statusList", booking::getBookingStatus()); self::$smarty->assign("settle", $settle); self::$smarty->assign("orderStartDate", $OrderStartDate); self::$smarty->assign("orderEndDate", $OrderEndDate); self::$smarty->assign("CheckInDateFrom", $CheckInDateFrom); self::$smarty->assign("CheckInDateTo", $CheckInDateTo); }
public function process() { global $cookie; parent::process(); $member = new Member(); $member->getByLoginUserName($cookie->LoginUserName); $swhere = parent::getSearchWhere(); if ($member->RoleID < 4) { if ($swhere != "") { $swhere .= " AND "; } $swhere = "A.CompanyID = " . $member->CompanyID; } $agentCount = $member->getAgentCount($swhere); $this->pagination($agentCount); $hotelList = $member->getAgentList($swhere, $this->p, $this->n); self::$smarty->assign("listData", $hotelList); }