public function fillCategory() { if (isset($this->data['cat_id'])) { if ($res = Yii::app()->functions->getItemByCategory($this->data['cat_id'])) { $cat_info = Yii::app()->functions->getCategory($this->data['cat_id']); $this->code = 1; $this->msg = array('currency' => getCurrencyCode(), 'category_name' => $cat_info['category_name']); $this->details = $res; } else { $this->msg = Yii::t("default", "Category is empty"); } } else { $this->msg = Yii::t("default", "Category not found"); } }
?> <div class="normal-price left"> <?php echo displayPrice(getCurrencyCode(), prettyFormat($val_item['prices'][0]['price'])); ?> </div> <div class="sale-price left"> <?php echo displayPrice(getCurrencyCode(), prettyFormat($val_item['prices'][0]['price'] - $val_item['discount'])); ?> </div> <?php } else { ?> <?php echo displayPrice(getCurrencyCode(), prettyFormat($val_item['prices'][0]['price'])); ?> <?php } ?> <?php } ?> </div> <div class="clear"></div> </a> </li> <?php $x++; ?> <?php
</td> <td width="5%"><?php echo t($val['trans_type']); ?> </td> <td width="5%"> <a href="javascript:;" class="view-receipt" data-id="<?php echo $val['order_id']; ?> "><?php echo $val['order_id']; ?> </a> </td> <!--<td width="5%"><?php echo displayPrice(getCurrencyCode(), standardPrettyFormat($val['voucher_amount'])); ?> </td>--> <td width="5%"><?php echo FormatDateTime($val['date_created']); ?> </td> </tr> <?php } ?> </tbody> </table> <?php
public function searchArea() { $resto_cuisine = ''; $rating = ''; $minimum = ''; $pay_by = ''; $minus_has_delivery_rates = 0; $cuisine_list = Yii::app()->functions->Cuisine(true); $country_list = Yii::app()->functions->CountryList(); $this->data['s'] = isset($this->data['s']) ? $this->data['s'] : ""; $search_str = explode(",", $this->data['s']); if (is_array($search_str) && count($search_str) >= 2) { $city = isset($search_str[1]) ? trim($search_str[1]) : ''; $state = isset($search_str[2]) ? trim($search_str[2]) : ''; } else { $city = trim($this->data['s']); $state = trim($this->data['s']); } $from_address = $this->data['s']; if (empty($from_address)) { $from_address = isset($this->data['st']) ? $this->data['st'] : ''; if (!empty($this->data['st'])) { $_SESSION['kr_search_address'] = $this->data['st']; } } if ($res = Yii::app()->functions->searchByArea($city, $state)) { if (is_array($res) && count($res) >= 1) { $total = Yii::app()->functions->search_result_total; $feed_datas['sEcho'] = $this->data['sEcho']; $feed_datas['iTotalRecords'] = $total; $feed_datas['iTotalDisplayRecords'] = $total; /*dump($feed_datas); die();*/ foreach ($res as $val) { $merchant_address = $val['street'] . " " . $val['city'] . " " . $val['post_code']; $miles = 0; $kms = 0; $ft = false; $new_distance_raw = 0; if ($distance = getDistance($from_address, $merchant_address, $val['country_code'], false)) { $miles = $distance->rows[0]->elements[0]->distance->text; //dump($miles); if (preg_match("/ft/i", $miles)) { $ft = true; $miles_raw = $miles; $new_distance_raw = str_replace("ft", '', $miles); $new_distance_raw = ft2kms(trim($new_distance_raw)); } else { $miles_raw = str_replace(array(" ", "mi"), "", $miles); $kms = miles2kms(unPrettyPrice($miles_raw)); $new_distance_raw = $kms; $kms = standardPrettyFormat($kms); } } /*get merchant distance */ $mt_delivery_miles = Yii::app()->functions->getOption("merchant_delivery_miles", $val['merchant_id']); $merchant_distance_type = Yii::app()->functions->getOption("merchant_distance_type", $val['merchant_id']); /*dump($mt_delivery_miles); dump($miles_raw);*/ $resto_cuisine = ''; $cuisine = !empty($val['cuisine']) ? (array) json_decode($val['cuisine']) : false; if ($cuisine != false) { foreach ($cuisine as $valc) { if (array_key_exists($valc, (array) $cuisine_list)) { $resto_cuisine .= $cuisine_list[$valc] . ", "; } } $resto_cuisine = !empty($resto_cuisine) ? substr($resto_cuisine, 0, -2) : ''; } $resto_info = "<h5><a href=\"" . baseUrl() . "/store/menu/merchant/" . $val['restaurant_slug'] . "\">" . $val['restaurant_name'] . "</a></h5>"; //$resto_cuisine="<span class=\"cuisine-list\">".$resto_cuisine."</span>"; $resto_cuisine = wordwrap($resto_cuisine, 50, "<br />\n"); $resto_info .= "<p class=\"uk-text-muted\">" . $val['street'] . " " . $val['city'] . " " . $val['post_code'] . "</p>"; if (array_key_exists($val['country_code'], (array) $country_list)) { $resto_info .= "<p class=\"uk-text-bold\">" . $country_list[$val['country_code']] . "</p>"; } $resto_info .= "<p class=\"uk-text-bold\">" . Yii::t('default', "Cuisine") . " - " . $resto_cuisine . "</p>"; $delivery_est = Yii::app()->functions->getOption("merchant_delivery_estimation", $val['merchant_id']); $distancesya = $miles_raw; $unit_distance = $merchant_distance_type; if (!empty($from_address)) { if ($ft == TRUE) { $resto_info .= "<p><span class=\"uk-text-bold\">" . Yii::t("default", "Distance") . ": </span> {$miles_raw} </p>"; if ($merchant_distance_type == "km") { $distance_type = Yii::t("default", "km"); } else { $distance_type = Yii::t("default", "miles"); } } else { if ($merchant_distance_type == "km") { $distance_type = Yii::t("default", "km"); $resto_info .= "<p><span class=\"uk-text-bold\">" . Yii::t("default", "Distance") . ": </span> {$kms} " . Yii::t("default", "km") . "</p>"; $distancesya = $kms; } else { $resto_info .= "<p><span class=\"uk-text-bold\">" . Yii::t("default", "Distance") . ": </span> {$miles_raw} " . Yii::t("default", "miles") . "</p>"; $distance_type = Yii::t("default", "miles"); } } } $resto_info .= "<p><span class=\"uk-text-bold\">" . Yii::t("default", "Delivery Est") . ": </span> " . $delivery_est . "</p>"; if (is_numeric($mt_delivery_miles)) { $resto_info .= "<p><span class=\"uk-text-bold\">" . Yii::t("default", "Delivery Distance") . ": </span> " . $mt_delivery_miles . " " . $distance_type . "</p>"; } $shipping_enabled = Yii::app()->functions->getOption("shipping_enabled", $val['merchant_id']); //delivery rates table $delivery_fee = $val['delivery_charges']; if ($shipping_enabled == 2) { $FunctionsK = new FunctionsK(); //$distancesya=round($distancesya); //dump($distancesya); $delivery_fee = $FunctionsK->getDeliveryChargesByDistance($val['merchant_id'], $distancesya, $unit_distance, $delivery_fee); if ($delivery_fee >= 0.01) { if (isset($_GET['filter_promo'])) { if (preg_match("/free-delivery/i", $_GET['filter_promo'])) { $minus_has_delivery_rates++; continue; } } } } if (is_numeric($delivery_fee) && $delivery_fee >= 1) { $resto_info .= "<p><span class=\"uk-text-bold\">" . Yii::t("default", "Delivery Fee") . ":</span> " . displayPrice(getCurrencyCode(), prettyFormat($delivery_fee)) . "</p>"; } else { $resto_info .= "<p><span class=\"uk-text-bold\">" . Yii::t("default", "Delivery Fee") . ":</span> " . "<span class=\"uk-text-success\">" . Yii::t("default", "Free Delivery") . "</span>" . "</p>"; } $image = ''; $merchant_photo = Yii::app()->functions->getOption("merchant_photo", $val['merchant_id']); if (!empty($merchant_photo)) { $image .= "<a href=\"" . baseUrl() . "/store/menu/merchant/" . $val['restaurant_slug'] . "\">"; $image .= "<img class=\"uk-thumbnail uk-thumbnail-mini\" src=\"" . baseUrl() . "/upload/" . $merchant_photo . "\" alt=\"\" title=\"\">"; $image .= "</a>"; } if (empty($image)) { $image .= "<a href=\"" . baseUrl() . "/store/menu/merchant/" . $val['restaurant_slug'] . "\">"; $image .= "<img class=\"uk-thumbnail uk-thumbnail-mini\" src=\"" . baseUrl() . "/assets/images/thumbnail-medium.png\" alt=\"\" title=\"\">"; $image .= "</a>"; } $ratings = Yii::app()->functions->getRatings($val['merchant_id']); $rating_meanings = ''; if ($ratings['ratings'] >= 1) { $rating_meaning = Yii::app()->functions->getRatingsMeaning($ratings['ratings']); $rating_meanings = ucwords($rating_meaning['meaning']); } $rating = "<div class=\"rate-wrap\">\r\n\t \t\t\t\t<h6 class=\"rounded2\" data-uk-tooltip=\"{pos:'bottom-left'}\" title=\"{$rating_meanings}\" >" . number_format($ratings['ratings'], 1) . "</h6>\r\n\t \t\t\t\t<span>" . $ratings['votes'] . " " . Yii::t("default", "Votes") . "</span>\r\n\t \t\t\t\t</div>"; $stores_open_day = Yii::app()->functions->getOption("stores_open_day", $val['merchant_id']); $stores_open_starts = Yii::app()->functions->getOption("stores_open_starts", $val['merchant_id']); $stores_open_ends = Yii::app()->functions->getOption("stores_open_ends", $val['merchant_id']); $stores_open_custom_text = Yii::app()->functions->getOption("stores_open_custom_text", $val['merchant_id']); $stores_open_day = !empty($stores_open_day) ? (array) json_decode($stores_open_day) : false; $stores_open_starts = !empty($stores_open_starts) ? (array) json_decode($stores_open_starts) : false; $stores_open_ends = !empty($stores_open_ends) ? (array) json_decode($stores_open_ends) : false; $stores_open_custom_text = !empty($stores_open_custom_text) ? (array) json_decode($stores_open_custom_text) : false; $tip = ''; $open_starts = ''; $open_ends = ''; $open_text = ''; $tip .= "<ul class=\"hr_op rounded2\"><i class=\"fa fa-caret-up\"></i>"; if (is_array($stores_open_day) && count($stores_open_day) >= 1) { foreach ($stores_open_day as $val_open) { if (array_key_exists($val_open, (array) $stores_open_starts)) { $open_starts = timeFormat($stores_open_starts[$val_open], true); } if (array_key_exists($val_open, (array) $stores_open_ends)) { $open_ends = timeFormat($stores_open_ends[$val_open], true); } if (array_key_exists($val_open, (array) $stores_open_custom_text)) { $open_text = $stores_open_custom_text[$val_open]; } $tip .= '<li><span>' . ucwords(Yii::t("default", $val_open)) . '</span><value>' . $open_starts . " - " . $open_ends . " " . ucfirst($open_text) . '</value></li>'; $open_starts = ''; $open_ends = ''; $open_text = ''; } } else { $tip .= '<li>' . Yii::t("default", "Not available.") . '</li>'; } $tip .= "<div class=\"clear\"></div>"; $tip .= "</ul>"; $tips = "<a class=\"opening-hours-wrap\" href=\"javascript:;\">" . Yii::t("default", "Hours of Operation") . "{$tip}</a>"; $resto_info .= $tips; $resto_info .= "<div class=\"spacer\"></div>"; $resto_info .= "<div>\r\n\t\t\t\t\t\t<a class=\"uk-button uk-button-success uk-width-1-2\" href=\"" . baseUrl() . "/store/menu/merchant/" . $val['restaurant_slug'] . "\">"; $resto_info .= Yii::t("default", "Order Now"); $resto_info .= "</a></div>"; $resto_info .= "<div class=\"spacer\"></div>"; $table_book = Yii::app()->functions->getOption("merchant_table_booking", $val['merchant_id']); if ($table_book == "") { $resto_info .= "<div>\r\n\t\t\t\t\t\t<a class=\"uk-button uk-button-success uk-width-1-2\" href=\"" . baseUrl() . "/store/menu/merchant/" . $val['restaurant_slug'] . "/?tab=booking" . "\">"; $resto_info .= Yii::t("default", "Book a Table"); $resto_info .= "</a></div>"; } $is_sponsored = ''; if ($val['is_sponsored'] == 2) { $is_sponsored = "<br/><div class=\"uk-badge uk-badge-warning\">" . Yii::t("default", "sponsored") . "</div>"; } $is_merchant_open = Yii::app()->functions->isMerchantOpen($val['merchant_id']); $merchant_preorder = Yii::app()->functions->getOption("merchant_preorder", $val['merchant_id']); $now = date('Y-m-d'); $is_holiday = false; if ($m_holiday = Yii::app()->functions->getMerchantHoliday($val['merchant_id'])) { if (in_array($now, (array) $m_holiday)) { $is_merchant_open = false; } } $tag_open = ''; if ($is_merchant_open == TRUE) { $tag_open = '<div class="uk-badge uk-badge-success">' . t("Open") . '</div>'; } else { if ($merchant_preorder) { $tag_open = '<div class="uk-badge uk-badge-warning">' . t("Pre-Order") . '</div>'; } else { $tag_open = '<div class="uk-badge uk-badge-danger">' . t("Closed") . '</div>'; } } $is_sponsored .= $tag_open; $offers = Widgets::offers($val['merchant_id'], 2); $is_sponsored .= $offers; $merchant_latitude = Yii::app()->functions->getOption("merchant_latitude", $val['merchant_id']); $merchant_longtitude = Yii::app()->functions->getOption("merchant_longtitude", $val['merchant_id']); $merchant_latitude = !empty($merchant_latitude) ? $merchant_latitude : '0'; $merchant_longtitude = !empty($merchant_longtitude) ? $merchant_longtitude : '0'; $feed_data[] = array($image, $resto_info, $rating, !empty($val['minimum_order']) ? displayPrice(getCurrencyCode(), prettyFormat($val['minimum_order'])) . "<br/>" . $is_sponsored : "{$is_sponsored}", $miles_raw, $merchant_latitude, $merchant_longtitude, addslashes($val['restaurant_name']), $merchant_address, $val['restaurant_slug'], $image, $new_distance_raw); } $this->data['sort_filter'] = isset($this->data['sort_filter']) ? $this->data['sort_filter'] : ''; //dump($feed_data); if ($this->data['sort_filter'] == "distance") { Yii::app()->functions->arraySortByColumn($feed_data, 11); $feed_datas['aaData'] = $feed_data; } else { /** sort by distance */ if (Yii::app()->functions->getOptionAdmin('search_result_bydistance') == 2) { Yii::app()->functions->arraySortByColumn($feed_data, 11); $feed_datas['aaData'] = $feed_data; } else { $feed_datas['aaData'] = $feed_data; } } //dump("minus_has_delivery_rates->".$minus_has_delivery_rates); if ($minus_has_delivery_rates >= 1) { $feed_datas['iTotalRecords'] = $feed_datas['iTotalRecords'] - $minus_has_delivery_rates; $feed_datas['iTotalDisplayRecords'] = $feed_datas['iTotalDisplayRecords'] - $minus_has_delivery_rates; if ($feed_datas['iTotalRecords'] <= 0) { $this->otableNodata(); } } $this->otableOutput($feed_datas); } } $this->otableNodata(); }
public function faxSendNotification($merchant_info = '', $package_id = '', $payment_method = '', $price) { $fax_email_notification = Yii::app()->functions->getOptionAdmin("fax_email_notification"); /*dump($merchant_info); dump($package_id); dump($payment_method);*/ $package_info = $this->getFaxPackagesById($package_id); if (!empty($fax_email_notification) && is_array($package_info) && count($package_info) >= 1) { $tpl = EmailTPL::faxNotification(); $tpl = smarty('merchant-name', $merchant_info['restaurant_name'], $tpl); $tpl = smarty('amount', displayPrice(getCurrencyCode(), prettyFormat($price)), $tpl); $tpl = smarty('payment-method', $payment_method, $tpl); $tpl = smarty('package-name', $package_info['title'], $tpl); sendEmail($fax_email_notification, '', "New Fax Payment Has been receive", $tpl); } }
if (empty($client_info['city'])) { $client_info['city'] = $city; } } if (isset($client_info['state'])) { if (empty($client_info['state'])) { $client_info['state'] = $state; } } } if (isset($s['kr_merchant_id']) && Yii::app()->functions->isClientLogin() && is_array($merchant_info)) { $continue = true; } } echo CHtml::hiddenField('mobile_country_code', Yii::app()->functions->getAdminCountrySet(true)); echo CHtml::hiddenField('admin_currency_set', getCurrencyCode()); echo CHtml::hiddenField('admin_currency_position', Yii::app()->functions->getOptionAdmin("admin_currency_position")); ?> <div class="page-right-sidebar payment-option-page"> <div class="main"> <div class="inner"> <?php //if (isset($s['kr_merchant_id']) && Yii::app()->functions->isClientLogin() && is_array($merchant_info) ): if ($continue == TRUE) { ?> <?php $merchant_id = $s['kr_merchant_id']; ?> <?php echo CHtml::hiddenField('merchant_id', $merchant_id);
?> <a href="javascript:;" class="qty-addon-plus"><i class="fa fa-plus"></i></a> <div class="clear"></div> </div> <?php } ?> </div> <div class="uk-width-1-3" style="text-indent:100px;"> <!--<span class="hide-food-price"><?php echo !empty($val_addon['price']) ? getCurrencyCode() . $val_addon['price'] : "-"; ?> </span>--> <span class="hide-food-price"><?php echo !empty($val_addon['price']) ? displayPrice(getCurrencyCode(), $val_addon['price']) : "-"; ?> </span> </div> </div> </li> <?php $x++; ?> <?php } ?> </ul> <div class="clear"></div> <?php }
public function displayMenu($menu = '', $mode = '', $mtid = '') { ?> <?php if ($mode == 2 || $mode == 1) { ?> <div class="<?php echo $mode == 2 ? "active-menu-2" : "active-menu-{$mode}"; ?> "> <div class="categories-wrap-mobile"> <div data-uk-dropdown="{mode:'click'}" class="uk-button-dropdown"> <button class="uk-button"><?php echo Yii::t("default", "Categories"); ?> <span class="sortby_text"></span><i class="uk-icon-caret-down"></i></button> <div class="uk-dropdown" > <ul class="uk-nav uk-nav-dropdown"> <?php foreach ($menu as $val) { ?> <li> <a href="javascript:;" data-id="cat-<?php echo $val['category_id']; ?> " class="goto-category"> <?php echo ucwords($val['category_name']); ?> </a> </li> <?php } ?> </ul> </div> </div> </div> <!--categories-wrap--> <!--<div class="clear"></div>--> <?php foreach ($menu as $val) { //dump($val); ?> <h2 class="cat-<?php echo $val['category_id']; ?> "> <?php echo qTranslate($val['category_name'], 'category_name', $val); ?> <?php //echo Widgets::displayCatSpicyIconByID($val['category_id']) ?> <?php echo Widgets::displaySpicyIconNew($val['dish']); ?> </h2> <?php if (!empty($val['category_description'])) { ?> <p><?php echo qTranslate($val['category_description'], 'category_description', $val); ?> </p> <?php } ?> <p style="margin-top:-10px;" class="uk-text-small uk-text-muted"><?php echo Widgets::categorySpicyNotes($val['category_id']); ?> </span> <?php if (is_array($val['item']) && count($val['item']) >= 1) { ?> <?php $x = 1; ?> <?php foreach ($val['item'] as $item) { //dump($item); ?> <?php $atts = ''; if ($item['single_item'] == 2) { $atts .= 'data-price="' . $item['single_details']['price'] . '"'; $atts .= " "; $atts .= 'data-size="' . $item['single_details']['size'] . '"'; } ?> <a href="javascript:;" rel="<?php echo $item['item_id']; ?> " class="menu-item" data-single="<?php echo $item['single_item']; ?> " <?php echo $atts; ?> > <div class="table-div <?php echo count($val['item']) == $x ? "last" : ''; ?> "> <div class="table-col-1"><?php Widgets::displayMenuPic($item['photo']); ?> </div> <div class="table-col-2"> <div class="ux-price"> <samp></samp> <h4> <?php echo qTranslate($item['item_name'], 'item_name', $item); ?> <?php echo Widgets::displaySpicyIconNew($item['dish']); ?> </h4> <?php //echo Widgets::displaySpicyIcon($item['spicydish'],'',$mtid); ?> <h5 class="hide-food-price"> <?php if (!empty($item['discount'])) { ?> <span class="strike-tru"> <?php echo displayPrice(getCurrencyCode(), prettyFormat($item['prices'][0]['price'])); ?> </span> <?php echo displayPrice(getCurrencyCode(), prettyFormat($item['prices'][0]['price'] - $item['discount'])); ?> <?php } else { ?> <?php echo displayPrice(getCurrencyCode(), prettyFormat($item['prices'][0]['price'])); ?> <?php } ?> </h5> </div> <p><?php echo qTranslate($item['item_description'], 'item_description', $item); ?> </p> </div> </div> </a> <?php $x++; ?> <?php } ?> <?php } else { ?> <p class="uk-text-muted"><?php echo t("No food item"); ?> </p> <?php } ?> <?php } ?> </div> <!--active-menu-2--> <?php } ?> <?php }
<div class="quantity-wrap quantity-wrap-small" > <a href="javascript:;" class="qty-addon-minus" ><i class="fa fa-minus"></i></a> <?php echo CHtml::textField("addon_qty[{$subcat_id}][]", $qty_selected, array('class' => "uk-form-width-mini numeric_only left addon_qty")); ?> <a href="javascript:;" class="qty-addon-plus"><i class="fa fa-plus"></i></a> <div class="clear"></div> </div> <?php } ?> </div> <div class="uk-width-1-3" style="text-indent:100px;"> <?php echo !empty($val_addon['price']) ? getCurrencyCode() . $val_addon['price'] : "-"; ?> </div> </div> </li> <?php $x++; ?> <?php } ?> </ul> <div class="clear"></div> <?php } ?>
<?php if (!empty($val_item['discount'])) { ?> <div class="normal-price"><?php echo getCurrencyCode() . prettyFormat($val_item['prices'][0]['price']); ?> </div> <div class="sale-price"><?php echo getCurrencyCode() . prettyFormat($val_item['prices'][0]['price'] - $val_item['discount']); ?> </div> <?php } else { ?> <?php echo getCurrencyCode() . prettyFormat($val_item['prices'][0]['price']); ?> <?php } ?> <?php } ?> </div> </div> </li> <?php } ?> <div class="clear"></div> </ul>