コード例 #1
0
ファイル: func.php プロジェクト: Optarion/WF3_lesjoiesducode
function getSynopsis($description, $max_length = 0)
{
    if ($max_length <= 0) {
        return nl2br($description);
    }
    return cutString($description, $max_length, ' [..]');
}
コード例 #2
0
ファイル: func.php プロジェクト: budo60/joieducode
function getContent($description, $max_length = 0, $id = 0)
{
    if ($max_length <= 0) {
        return nl2br($description);
    }
    return cutString($description, $max_length, ' <a href="article.php?id=' . $id . '"> [...]</a>');
}
コード例 #3
0
function savePassThruToCookie($_fullname, $_email, $_company, $_question, $_phone, $_customs)
{
    global $INPUTS;
    initData(array("INPUTS"));
    if (!empty($_fullname) && $INPUTS[111]->Cookie && $INPUTS[111]->Active) {
        setCookieValue("form_111", cutString(base64UrlDecode($_fullname), 255), true);
    }
    if (!empty($_email) && $INPUTS[112]->Cookie && $INPUTS[112]->Active) {
        setCookieValue("form_112", cutString(base64UrlDecode($_email), 255), true);
    }
    if (!empty($_company) && $INPUTS[113]->Cookie && $INPUTS[113]->Active) {
        setCookieValue("form_113", cutString(base64UrlDecode($_company), 255), true);
    }
    if (!empty($_question) && $INPUTS[114]->Cookie && $INPUTS[114]->Active) {
        setCookieValue("form_114", base64UrlDecode($_question), true);
    }
    if (!empty($_phone) && $INPUTS[116]->Cookie && $INPUTS[116]->Active) {
        setCookieValue("form_116", base64UrlDecode($_phone), true);
    }
    foreach ($INPUTS as $index => $input) {
        if ($input->Custom && $input->Active && !empty($_customs[$index]) && $input->Cookie) {
            setCookieValue("cf_" . $index, $_customs[$index], true);
        }
    }
}
コード例 #4
0
ファイル: list.php プロジェクト: bamboo0079/shopcart
 public function index()
 {
     $this->language->load('promotion/duonglich');
     $this->load->model('catalog/category');
     $this->load->model('catalog/product');
     $this->load->model('tool/image');
     $banggia = $this->config->get('banggia');
     $this->data['breadcrumbs'] = array();
     $this->data['breadcrumbs'][] = array('text' => $this->language->get('text_home'), 'href' => $this->url->link('common/home'), 'separator' => false);
     $this->data['breadcrumbs'][] = array('text' => $banggia['title'], 'href' => $this->url->link('product/list'), 'separator' => $this->language->get('text_separator'));
     $this->document->setTitle($banggia['customtitle']);
     $this->document->setDescription($banggia['metadesc']);
     $this->document->setKeywords($banggia['metakey']);
     $this->data['heading_title'] = $banggia['title'];
     $this->data['url'] = $this->url->link('product/list');
     $this->data['desc'] = html_entity_decode($banggia['desc'], ENT_QUOTES, 'UTF-8');
     $this->data['list_product'] = $this->data['list_product_box'] = array();
     $this->data['lists'] = $this->config->get('list_product');
     //Product
     $products = $this->data['lists'];
     foreach ($products as $k => $item) {
         $product = explode(',', $item['list_product']);
         foreach ($product as $product_id) {
             $result = $this->model_catalog_product->getProduct($product_id);
             if ($result) {
                 if ($result['price'] != 0) {
                     $price = $this->currency->format($this->tax->calculate($result['price'], $result['tax_class_id'], $this->config->get('config_tax')));
                 } else {
                     $price = false;
                 }
                 if ($result['image'] && file_exists(DIR_IMAGE . $result['image'])) {
                     $image = $this->model_tool_image->cropsize($result['image'], $this->config->get('config_image_product_width'), $this->config->get('config_image_product_height'));
                 } else {
                     $image = $this->model_tool_image->cropsize('no_image.jpg', $this->config->get('config_image_product_width'), $this->config->get('config_image_product_width'));
                 }
                 if ($result['special']) {
                     $special = $this->currency->format($this->tax->calculate($result['special'], $result['tax_class_id'], $this->config->get('config_tax')));
                 } else {
                     $special = false;
                 }
                 if (isset($result['custom_link'])) {
                     $custom_link = '&path=' . $result['custom_link'];
                 }
                 $this->data['list_product_box'][$k][] = array('product_id' => $result['product_id'], 'thumb' => $image, 'name' => $result['name_tour'] ? $result['name_tour'] : $result['name'], 'name_title' => cutString($result['name_tour'] ? $result['name_tour'] : $result['name'], 16), 'description' => cutString(preg_replace('/\\n/', "", strip_tags(html_entity_decode($result['description'], ENT_QUOTES, 'UTF-8'))), 50), 'model' => $result['model'], 'start_time' => $result['start_time'], 'start_time_holiday' => $result['start_time_holiday'] ? $result['start_time_holiday'] : '&nbsp;', 'duration' => $result['duration'], 'product_type' => $result['product_type'], 'transport' => $result['transport'], 'price' => $price, 'special' => $special ? $special : 'Liên hệ', 'href' => $this->url->link('product/product', $custom_link . '&product_id=' . $result['product_id']));
             }
         }
     }
     $this->data['button_view_more'] = $this->language->get('button_view_more');
     if (file_exists(DIR_TEMPLATE . $this->config->get('config_template') . '/template/product/list.tpl')) {
         $this->template = $this->config->get('config_template') . '/template/product/list.tpl';
     } else {
         $this->template = 'default/template/product/list.tpl';
     }
     $this->children = array('common/column_left', 'common/column_right', 'common/content_top', 'common/content_bottom', 'common/footer', 'common/header');
     $this->response->setOutput($this->render());
 }
コード例 #5
0
ファイル: db_post.php プロジェクト: Cassioblu55/aesop_php
function getInsertStatement($table, $data)
{
    $columns = " (";
    $values = " (";
    foreach ($data as $columnName => $value) {
        $columns .= "`" . $columnName . "`, ";
        $values .= "" . getCleanValue($value) . ", ";
    }
    $columns = cutString($columns, 2) . ")";
    $values = cutString($values, 2) . ")";
    return "INSERT INTO " . getTableQuote($table) . $columns . " VALUES " . $values . ";";
}
コード例 #6
0
ファイル: content.core.php プロジェクト: tech-nik89/lpm4
 function getPages()
 {
     global $db;
     $pages = $db->queryToList("\r\n\t\t\t\tselect `key` as k,\r\n\t\t\t\t(\r\n\t\t\t\tselect count(*) \r\n\t\t\t\tfrom " . MYSQL_TABLE_PREFIX . "content as c2\r\n\t\t\t\twhere c2.`key` = c.`key`\r\n\t\t\t\t) as version_count,\r\n\t\t\t\t(\r\n\t\t\t\tselect title\r\n\t\t\t\tfrom " . MYSQL_TABLE_PREFIX . "content as c3\r\n\t\t\t\twhere c3.`key` = c.`key`\r\n\t\t\t\torder by version desc\r\n\t\t\t\tlimit 1\r\n\t\t\t\t) as title\r\n\t\t\t\tfrom " . MYSQL_TABLE_PREFIX . "content as c\r\n\t\t\t\tgroup by `key`\r\n\t\t\t\torder by `key` asc\r\n\t\t\t");
     if (count($pages) > 0) {
         foreach ($pages as $i => $v) {
             $pages[$i]['title'] = cutString($v['title']);
             $pages[$i]['edit_url'] = makeURL('admin', array('mode' => 'content', 'action' => 'edit', 'key' => $v['k']));
             $pages[$i]['remove_url'] = makeURL('admin', array('mode' => 'content', 'action' => 'remove', 'key' => $v['k']));
             $pages[$i]['url'] = makeURL($v['k']);
         }
     }
     return $pages;
 }
コード例 #7
0
ファイル: latest.php プロジェクト: bamboo0079/shopcart
 protected function index($setting)
 {
     $this->language->load('module/latest');
     $this->data['heading_title'] = $this->language->get('heading_title');
     $this->data['button_cart'] = $this->language->get('button_cart');
     $this->load->model('catalog/product');
     $this->load->model('tool/image');
     $this->data['products'] = array();
     $data = array('filter_price_on' => true, 'sort' => 'p.date_added', 'order' => 'DESC', 'start' => 0, 'limit' => $setting['limit']);
     $results = $this->model_catalog_product->getProducts($data);
     foreach ($results as $result) {
         if ($result['image']) {
             $image = $this->model_tool_image->onesize($result['image'], $setting['image_width'], $setting['image_height']);
         } else {
             $image = false;
         }
         if ($this->config->get('config_customer_price') && $this->customer->isLogged() || !$this->config->get('config_customer_price') && $result['price'] != 0) {
             $price = $this->currency->format($this->tax->calculate($result['price'], $result['tax_class_id'], $this->config->get('config_tax')));
         } else {
             $price = false;
         }
         if ((double) $result['special']) {
             $special = $this->currency->format($this->tax->calculate($result['special'], $result['tax_class_id'], $this->config->get('config_tax')));
         } else {
             $special = false;
         }
         if ((double) $result['special1']) {
             $special1 = $this->currency->format($this->tax->calculate($result['special1'], $result['tax_class_id'], $this->config->get('config_tax')));
         } else {
             $special1 = false;
         }
         if ($this->config->get('config_review_status')) {
             $rating = $result['rating'];
         } else {
             $rating = false;
         }
         if (isset($result['custom_link'])) {
             $custom_link = '&path=' . $result['custom_link'];
         }
         $this->data['products'][] = array('product_id' => $result['product_id'], 'thumb' => $image, 'name' => cutString($result['name'], 12), 'price' => $price, 'special' => $special, 'special1' => $special1, 'rating' => $rating, 'reviews' => sprintf($this->language->get('text_reviews'), (int) $result['reviews']), 'href' => $this->url->link('product/product', $custom_link . '&product_id=' . $result['product_id']));
     }
     if (file_exists(DIR_TEMPLATE . $this->config->get('config_template') . '/template/module/latest.tpl')) {
         $this->template = $this->config->get('config_template') . '/template/module/latest.tpl';
     } else {
         $this->template = 'default/template/module/latest.tpl';
     }
     $this->render();
 }
コード例 #8
0
ファイル: news.php プロジェクト: tech-nik89/lpm4
function news($s)
{
    global $db, $lang;
    $tbl = MYSQL_TABLE_PREFIX . 'news';
    $return = array();
    $result = $db->selectList($tbl, "*", "INSTR(`title`, '" . $s . "') > 0 OR\r\n\t\t\t\t\t\t\t\t\t\t\t\tINSTR(`text`, '" . $s . "') > 0");
    if (count($result) > 0) {
        foreach ($result as $i => $r) {
            $engine = $lang->get('engines_news');
            $title = cutString($r['title']);
            $description = $r['text'];
            $url = makeURL('news', array('newsid' => $r['newsid']));
            $relevance = strcount($r['text'] . $r['title'], $s);
            $return[] = array('engine' => $engine, 'title' => $title, 'description' => $description, 'url' => $url, 'relevance' => $relevance);
        }
    }
    return $return;
}
コード例 #9
0
ファイル: content.php プロジェクト: tech-nik89/lpm4
function content($s)
{
    global $db, $lang;
    $tbl = MYSQL_TABLE_PREFIX . 'content';
    $return = array();
    $result = $db->queryToList("select c.key, c.title, c.text, c.box_content\r\n\t\t\tfrom (\r\n\t\t\tselect `key`, max(version) as latest\r\n\t\t\tfrom " . $tbl . "\r\n\t\t\tgroup by `key`\r\n\t\t\t)\r\n\t\t\tas x\r\n\t\t\tinner join " . $tbl . " as c\r\n\t\t\ton c.key = x.key and c.version = x.latest\r\n\t\t\twhere title like '%" . $s . "%'\r\n\t\t\tor text like '%" . $s . "%'\r\n\t\t\tor box_content like '%" . $s . "%'");
    if (count($result) > 0) {
        foreach ($result as $i => $r) {
            $engine = $lang->get('engines_content');
            $title = cutString($r['title']);
            $description = $r['text'];
            $url = makeURL($r['key']);
            $relevance = strcount($r['text'] . ' ' . $r['title'] . ' ' . $r['title'] . ' ' . $r['title'], $s);
            $return[] = array('engine' => $engine, 'title' => $title, 'description' => $description, 'url' => $url, 'relevance' => $relevance);
        }
    }
    return $return;
}
コード例 #10
0
" /></td>
    <td class="listview_id"><?php 
    echo $row["id"];
    ?>
</td>
    <td><?php 
    echo $row["title"];
    ?>
</td>
    <td><i class="fa fa-link"></i> 浏览</td>
    <td class="text-center"><i class="fa fa-photo showpic"></td>
    <td align="center"> <a href="?pid=<?php 
    echo $row["sort_id"];
    ?>
"><?php 
    echo cutString($row["sort_title"], 10);
    ?>
</a></td>
    <td>
      <?php 
    echo $row["att"];
    ?>
    </td>
    <td><?php 
    echo $row["hits"];
    ?>
</td>
    <td class="ajax_weight"><?php 
    echo $row["weight"];
    ?>
</td>
コード例 #11
0
ファイル: right1.php プロジェクト: hungnv0789/vhtm
    ?>
                      				<li class="color">
                      					<a href="<?php 
    echo base_url() . '/tintuc/detail/' . $list_tintuc_right[$i]->id;
    ?>
">
                      						<p><?php 
    echo $tieude;
    ?>
</p>
                      						<i>
                      						<?php 
    if ($lang == "vn") {
        echo cutString(strip_tags($list_tintuc_right[$i]->noidung_v), 100) . '...';
    } else {
        echo cutString(strip_tags($list_tintuc_right[$i]->noidung_e), 100) . '...';
    }
    ?>
                      						</i>
                      					</a>
                      				</li>
                      			<?php 
}
?>
                      	
                    </marquee>	
                   <!-- <div style="width:80%; float:left;padding:8px 17px;">
                    <marquee direction="down" width="100%" onmouseover="this.stop()" scrollamount="2" onmouseout="this.start()" height="280" align="left"> 
         <table cellspacing="0" cellpadding="0" border="0" width="100%"> 
        <tbody><tr><td>
         <div style="padding:10px 0px;">
コード例 #12
0
ファイル: beamer.mod.php プロジェクト: tech-nik89/lpm4
 		makeURL($mod, array('mode' => 'newmovie', 'beamerid' => $beamerid))
 	)
 );
 */
 $smarty->assign('custom', false);
 require_once $mod_dir . "/available_modules.php";
 if (isset($available) && count($available) > 0) {
     foreach ($available as $i => $av) {
         $available[$i]['url'] = str_replace("&amp;", "&", $av['url']);
     }
 }
 $messages = $db->selectList('beamer_message', "*", "`beamerid`=" . $beamerid);
 if (isset($messages) && count($messages) > 0) {
     $available[] = array('name' => '---', 'url' => '-');
     foreach ($messages as $message) {
         $available[] = array('name' => cutString($message['text'], 30), 'url' => str_replace('&amp;', '&', makeURL($mod, array('mode' => 'message', 'messageid' => $message['messageid']))));
     }
 }
 /*
 $movies = $db->selectList('beamer_movie', "*",
 	"`beamerid`=".$beamerid);
 	
 if (isset($movies) && count($movies) > 0) {
 	$available[] = array('name' => '---', 'url' => '-');
 	foreach ($movies as $movie) {
 		$available[] = array(
 			'name' => cutString($movie['file'], 30),
 			'url' => str_replace('&amp;', '&',
 				makeURL($mod, array('mode' => 'movie', 'movieid' => $movie['movieid'])))
 		);
 	}
コード例 #13
0
 function LoadFromLogin($_group)
 {
     if (Server::$Inputs[111]->IsServerInput()) {
         $this->Fullname = cutString($_group->GetServerInput(Server::$Inputs[111]), 255);
     }
     if (Server::$Inputs[112]->IsServerInput()) {
         $this->Email = cutString($_group->GetServerInput(Server::$Inputs[112]), 255);
     }
     if (Server::$Inputs[113]->IsServerInput()) {
         $this->Company = cutString($_group->GetServerInput(Server::$Inputs[113]), 255);
     }
     if (Server::$Inputs[114]->IsServerInput()) {
         $this->Text = cutString($_group->GetServerInput(Server::$Inputs[114]), MAX_INPUT_LENGTH);
     }
     if (Server::$Inputs[116]->IsServerInput()) {
         $this->Phone = cutString($_group->GetServerInput(Server::$Inputs[116]), 255);
     }
     foreach (Server::$Inputs as $index => $input) {
         if ($input->Active && $input->Custom) {
             if ($input->IsServerInput()) {
                 $this->Customs[$index] = $_group->GetServerInput($input);
             }
         }
     }
 }
コード例 #14
0
ファイル: search.php プロジェクト: bamboo0079/shopcart
 public function index()
 {
     $this->language->load('product/search');
     $this->load->model('catalog/category');
     $this->load->model('catalog/product');
     $this->load->model('tool/image');
     if (isset($this->request->get['search'])) {
         $search = $this->request->get['search'];
     } else {
         $search = '';
     }
     if (isset($this->request->get['tag'])) {
         $tag = $this->request->get['tag'];
     } elseif (isset($this->request->get['search'])) {
         $tag = $this->request->get['search'];
     } else {
         $tag = '';
     }
     if (isset($this->request->get['description'])) {
         $description = $this->request->get['description'];
     } else {
         $description = '';
     }
     if (isset($this->request->get['category_id'])) {
         $category_id = $this->request->get['category_id'];
     } else {
         $category_id = 0;
     }
     if (isset($this->request->get['sub_category'])) {
         $sub_category = $this->request->get['sub_category'];
     } else {
         $sub_category = '';
     }
     if (isset($this->request->get['sort'])) {
         $sort = $this->request->get['sort'];
     } else {
         $sort = 'p.sort_order';
     }
     if (isset($this->request->get['order'])) {
         $order = $this->request->get['order'];
     } else {
         $order = 'ASC';
     }
     if (isset($this->request->get['page'])) {
         $page = $this->request->get['page'];
     } else {
         $page = 1;
     }
     if (isset($this->request->get['limit'])) {
         $limit = $this->request->get['limit'];
     } else {
         $limit = $this->config->get('config_catalog_limit');
     }
     if (isset($this->request->get['search'])) {
         $this->document->setTitle($this->language->get('heading_title') . ' - ' . $this->request->get['search']);
     } else {
         $this->document->setTitle($this->language->get('heading_title'));
     }
     $this->document->addScript('catalog/view/javascript/jquery/jquery.total-storage.min.js');
     $this->data['breadcrumbs'] = array();
     $this->data['breadcrumbs'][] = array('text' => $this->language->get('text_home'), 'href' => $this->url->link('common/home'), 'separator' => false);
     $url = '';
     if (isset($this->request->get['search'])) {
         $url .= '&search=' . urlencode(html_entity_decode($this->request->get['search'], ENT_QUOTES, 'UTF-8'));
     }
     if (isset($this->request->get['tag'])) {
         $url .= '&tag=' . urlencode(html_entity_decode($this->request->get['tag'], ENT_QUOTES, 'UTF-8'));
     }
     if (isset($this->request->get['description'])) {
         $url .= '&description=' . $this->request->get['description'];
     }
     if (isset($this->request->get['category_id'])) {
         $url .= '&category_id=' . $this->request->get['category_id'];
     }
     if (isset($this->request->get['sub_category'])) {
         $url .= '&sub_category=' . $this->request->get['sub_category'];
     }
     if (isset($this->request->get['sort'])) {
         $url .= '&sort=' . $this->request->get['sort'];
     }
     if (isset($this->request->get['order'])) {
         $url .= '&order=' . $this->request->get['order'];
     }
     if (isset($this->request->get['page'])) {
         $url .= '&page=' . $this->request->get['page'];
     }
     if (isset($this->request->get['limit'])) {
         $url .= '&limit=' . $this->request->get['limit'];
     }
     $this->data['breadcrumbs'][] = array('text' => $this->language->get('heading_title') . ' - ' . $this->request->get['search'], 'href' => $this->url->link('product/search', $url), 'separator' => $this->language->get('text_separator'));
     if (isset($this->request->get['search'])) {
         $this->data['heading_title'] = $this->language->get('heading_title') . ' - ' . $this->request->get['search'];
     } else {
         $this->data['heading_title'] = $this->language->get('heading_title');
     }
     $this->data['text_empty'] = $this->language->get('text_empty');
     $this->data['text_critea'] = $this->language->get('text_critea');
     $this->data['text_search'] = $this->language->get('text_search');
     $this->data['text_keyword'] = $this->language->get('text_keyword');
     $this->data['text_category'] = $this->language->get('text_category');
     $this->data['text_sub_category'] = $this->language->get('text_sub_category');
     $this->data['text_quantity'] = $this->language->get('text_quantity');
     $this->data['text_manufacturer'] = $this->language->get('text_manufacturer');
     $this->data['text_model'] = $this->language->get('text_model');
     $this->data['text_price'] = $this->language->get('text_price');
     $this->data['text_percent'] = $this->language->get('text_percent');
     $this->data['text_price_save'] = $this->language->get('text_price_save');
     $this->data['text_tax'] = $this->language->get('text_tax');
     $this->data['text_points'] = $this->language->get('text_points');
     $this->data['text_compare'] = sprintf($this->language->get('text_compare'), isset($this->session->data['compare']) ? count($this->session->data['compare']) : 0);
     $this->data['text_display'] = $this->language->get('text_display');
     $this->data['text_list'] = $this->language->get('text_list');
     $this->data['text_grid'] = $this->language->get('text_grid');
     $this->data['text_sort'] = $this->language->get('text_sort');
     $this->data['text_limit'] = $this->language->get('text_limit');
     $this->data['entry_search'] = $this->language->get('entry_search');
     $this->data['entry_description'] = $this->language->get('entry_description');
     $this->data['entry_price'] = $this->language->get('entry_price');
     $this->data['entry_duration'] = $this->language->get('entry_duration');
     $this->data['entry_departure'] = $this->language->get('entry_departure');
     $this->data['entry_start_time'] = $this->language->get('entry_start_time');
     $this->data['entry_start_time_holiday'] = $this->language->get('entry_start_time_holiday');
     $this->data['entry_start_time_tet'] = $this->language->get('entry_start_time_tet');
     $this->data['entry_not_start_time'] = $this->language->get('entry_not_start_time');
     $this->data['entry_location_to'] = $this->language->get('entry_location_to');
     $this->data['entry_location_from'] = $this->language->get('entry_location_from');
     $this->data['entry_transport'] = $this->language->get('entry_transport');
     $this->data['entry_schedule'] = $this->language->get('entry_schedule');
     $this->data['button_search'] = $this->language->get('button_search');
     $this->data['button_car_rent'] = $this->language->get('button_car_rent');
     $this->data['button_cart'] = $this->language->get('button_cart');
     $this->data['button_wishlist'] = $this->language->get('button_wishlist');
     $this->data['button_compare'] = $this->language->get('button_compare');
     $this->data['button_view_more'] = $this->language->get('button_view_more');
     $this->data['button_view_more_car'] = $this->language->get('button_view_more_car');
     $this->data['compare'] = $this->url->link('product/compare');
     $this->load->model('catalog/category');
     // 3 Level Category Search
     $this->data['categories'] = array();
     $categories_1 = $this->model_catalog_category->getCategories(0);
     foreach ($categories_1 as $category_1) {
         $level_2_data = array();
         $categories_2 = $this->model_catalog_category->getCategories($category_1['category_id']);
         foreach ($categories_2 as $category_2) {
             $level_3_data = array();
             $categories_3 = $this->model_catalog_category->getCategories($category_2['category_id']);
             foreach ($categories_3 as $category_3) {
                 $level_3_data[] = array('category_id' => $category_3['category_id'], 'name' => $category_3['name']);
             }
             $level_2_data[] = array('category_id' => $category_2['category_id'], 'name' => $category_2['name'], 'children' => $level_3_data);
         }
         $this->data['categories'][] = array('category_id' => $category_1['category_id'], 'name' => $category_1['name'], 'children' => $level_2_data);
     }
     $this->data['products'] = array();
     if (isset($this->request->get['search']) || isset($this->request->get['tag'])) {
         $data = array('filter_name' => $search, 'filter_tag' => $tag, 'filter_description' => $description, 'filter_category_id' => $category_id, 'filter_sub_category' => $sub_category, 'sort' => $sort, 'order' => $order, 'start' => ($page - 1) * $limit, 'limit' => $limit);
         $product_total = $this->model_catalog_product->getTotalProducts($data);
         $results = $this->model_catalog_product->getProducts($data);
         foreach ($results as $result) {
             if ($result['image'] && file_exists(DIR_IMAGE . $result['image'])) {
                 $image = $this->model_tool_image->cropsize($result['image'], $this->config->get('config_image_product_width'), $this->config->get('config_image_product_height'));
             } else {
                 $image = $this->model_tool_image->cropsize('no_image.jpg', $this->config->get('config_image_product_width'), $this->config->get('config_image_product_width'));
             }
             if ($this->config->get('config_customer_price') && $this->customer->isLogged() || !$this->config->get('config_customer_price') && $result['price'] != 0) {
                 $price = $this->currency->format($this->tax->calculate($result['price'], $result['tax_class_id'], $this->config->get('config_tax')));
             } else {
                 $price = false;
             }
             if ((double) $result['special']) {
                 $special = $this->currency->format($this->tax->calculate($result['special'], $result['tax_class_id'], $this->config->get('config_tax')));
             } else {
                 $special = false;
             }
             $price_save_c = $result['price'] - $result['special'];
             if ($price_save_c > 0) {
                 $price_save = $this->currency->format($this->tax->calculate($price_save_c, $result['tax_class_id'], $this->config->get('config_tax')));
                 //					$percent = round(($price_save_c / $result['price']) * 100);
                 $percent = $this->currency->format(round($price_save_c));
             } else {
                 $price_save = false;
                 $percent = false;
             }
             if ($this->config->get('config_tax')) {
                 $tax = $this->currency->format((double) $result['special'] ? $result['special'] : $result['price']);
             } else {
                 $tax = false;
             }
             if ($this->config->get('config_review_status')) {
                 $rating = (int) $result['rating'];
             } else {
                 $rating = false;
             }
             if (isset($result['custom_link'])) {
                 $custom_link = '&path=' . $result['custom_link'];
             }
             $this->data['products'][] = array('product_id' => $result['product_id'], 'thumb' => $image, 'name' => $result['name_tour'] ? $result['name_tour'] : $result['name'], 'description' => cutString(strip_tags(html_entity_decode($result['description'], ENT_QUOTES, 'UTF-8')), 50), 'model' => $result['model'], 'start_time' => $result['start_time'], 'start_time_holiday' => $result['start_time_holiday'], 'start_time_tet' => $result['start_time_tet'], 'not_start_time' => $result['not_start_time'], 'departure' => $result['departure'], 'location_to' => $result['location_to'], 'location_from' => $result['location_from'], 'transport' => $result['transport'], 'duration' => $result['duration'], 'schedule' => $result['schedule'], 'product_type' => $result['product_type'], 'product_class' => $result['product_class'], 'price' => $price ? $price : $this->language->get('text_contact'), 'special' => $special, 'price_save' => $price_save, 'percent' => $percent, 'tax' => $tax, 'rating' => $result['rating'], 'reviews' => sprintf($this->language->get('text_reviews'), (int) $result['reviews']), 'href' => $this->url->link('product/product', $custom_link . '&product_id=' . $result['product_id']));
         }
         $url = '';
         if (isset($this->request->get['search'])) {
             $url .= '&search=' . urlencode(html_entity_decode($this->request->get['search'], ENT_QUOTES, 'UTF-8'));
         }
         if (isset($this->request->get['tag'])) {
             $url .= '&tag=' . urlencode(html_entity_decode($this->request->get['tag'], ENT_QUOTES, 'UTF-8'));
         }
         if (isset($this->request->get['description'])) {
             $url .= '&description=' . $this->request->get['description'];
         }
         if (isset($this->request->get['category_id'])) {
             $url .= '&category_id=' . $this->request->get['category_id'];
         }
         if (isset($this->request->get['sub_category'])) {
             $url .= '&sub_category=' . $this->request->get['sub_category'];
         }
         if (isset($this->request->get['limit'])) {
             $url .= '&limit=' . $this->request->get['limit'];
         }
         $this->data['sorts'] = array();
         $this->data['sorts'][] = array('text' => $this->language->get('text_default'), 'value' => 'p.sort_order-ASC', 'href' => $this->url->link('product/search', 'sort=p.sort_order&order=ASC' . $url));
         $this->data['sorts'][] = array('text' => $this->language->get('text_name_asc'), 'value' => 'pd.name-ASC', 'href' => $this->url->link('product/search', 'sort=pd.name&order=ASC' . $url));
         $this->data['sorts'][] = array('text' => $this->language->get('text_name_desc'), 'value' => 'pd.name-DESC', 'href' => $this->url->link('product/search', 'sort=pd.name&order=DESC' . $url));
         $this->data['sorts'][] = array('text' => $this->language->get('text_price_asc'), 'value' => 'p.price-ASC', 'href' => $this->url->link('product/search', 'sort=p.price&order=ASC' . $url));
         $this->data['sorts'][] = array('text' => $this->language->get('text_price_desc'), 'value' => 'p.price-DESC', 'href' => $this->url->link('product/search', 'sort=p.price&order=DESC' . $url));
         if ($this->config->get('config_review_status')) {
             $this->data['sorts'][] = array('text' => $this->language->get('text_rating_desc'), 'value' => 'rating-DESC', 'href' => $this->url->link('product/search', 'sort=rating&order=DESC' . $url));
             $this->data['sorts'][] = array('text' => $this->language->get('text_rating_asc'), 'value' => 'rating-ASC', 'href' => $this->url->link('product/search', 'sort=rating&order=ASC' . $url));
         }
         $this->data['sorts'][] = array('text' => $this->language->get('text_model_asc'), 'value' => 'p.model-ASC', 'href' => $this->url->link('product/search', 'sort=p.model&order=ASC' . $url));
         $this->data['sorts'][] = array('text' => $this->language->get('text_model_desc'), 'value' => 'p.model-DESC', 'href' => $this->url->link('product/search', 'sort=p.model&order=DESC' . $url));
         $url = '';
         if (isset($this->request->get['search'])) {
             $url .= '&search=' . urlencode(html_entity_decode($this->request->get['search'], ENT_QUOTES, 'UTF-8'));
         }
         if (isset($this->request->get['tag'])) {
             $url .= '&tag=' . urlencode(html_entity_decode($this->request->get['tag'], ENT_QUOTES, 'UTF-8'));
         }
         if (isset($this->request->get['description'])) {
             $url .= '&description=' . $this->request->get['description'];
         }
         if (isset($this->request->get['category_id'])) {
             $url .= '&category_id=' . $this->request->get['category_id'];
         }
         if (isset($this->request->get['sub_category'])) {
             $url .= '&sub_category=' . $this->request->get['sub_category'];
         }
         if (isset($this->request->get['sort'])) {
             $url .= '&sort=' . $this->request->get['sort'];
         }
         if (isset($this->request->get['order'])) {
             $url .= '&order=' . $this->request->get['order'];
         }
         $this->data['limits'] = array();
         $limits = array_unique(array($this->config->get('config_catalog_limit'), 50, 100, 150, 200));
         sort($limits);
         foreach ($limits as $value) {
             $this->data['limits'][] = array('text' => $value, 'value' => $value, 'href' => $this->url->link('product/search', $url . '&limit=' . $value));
         }
         $url = '';
         if (isset($this->request->get['search'])) {
             $url .= '&search=' . urlencode(html_entity_decode($this->request->get['search'], ENT_QUOTES, 'UTF-8'));
         }
         if (isset($this->request->get['tag'])) {
             $url .= '&tag=' . urlencode(html_entity_decode($this->request->get['tag'], ENT_QUOTES, 'UTF-8'));
         }
         if (isset($this->request->get['description'])) {
             $url .= '&description=' . $this->request->get['description'];
         }
         if (isset($this->request->get['category_id'])) {
             $url .= '&category_id=' . $this->request->get['category_id'];
         }
         if (isset($this->request->get['sub_category'])) {
             $url .= '&sub_category=' . $this->request->get['sub_category'];
         }
         if (isset($this->request->get['sort'])) {
             $url .= '&sort=' . $this->request->get['sort'];
         }
         if (isset($this->request->get['order'])) {
             $url .= '&order=' . $this->request->get['order'];
         }
         if (isset($this->request->get['limit'])) {
             $url .= '&limit=' . $this->request->get['limit'];
         }
         $pagination = new Pagination();
         $pagination->total = $product_total;
         $pagination->page = $page;
         $pagination->limit = $limit;
         /*$pagination->text = $this->language->get('text_pagination');*/
         $pagination->text = '';
         $pagination->url = $this->url->link('product/search', $url . '&page={page}');
         $this->data['pagination'] = $pagination->render();
     }
     $this->data['search'] = $search;
     $this->data['description'] = $description;
     $this->data['category_id'] = $category_id;
     $this->data['sub_category'] = $sub_category;
     $this->data['sort'] = $sort;
     $this->data['order'] = $order;
     $this->data['limit'] = $limit;
     if (file_exists(DIR_TEMPLATE . $this->config->get('config_template') . '/template/product/search.tpl')) {
         $this->template = $this->config->get('config_template') . '/template/product/search.tpl';
     } else {
         $this->template = 'default/template/product/search.tpl';
     }
     $this->children = array('common/column_left', 'common/column_right', 'common/content_top', 'common/content_bottom', 'common/footer', 'common/header');
     $this->response->setOutput($this->render());
 }
コード例 #15
0
function login()
{
    global $INTERNAL, $USER, $CONFIG;
    if (empty($_POST[POST_EXTERN_USER_NAME]) && !isnull(getCookieValue("form_111"))) {
        $USER->Browsers[0]->Fullname = cutString(getCookieValue("form_111"), 254);
    } else {
        $USER->Browsers[0]->Fullname = cutString(AJAXDecode($_POST[POST_EXTERN_USER_NAME]), 254);
    }
    if (empty($_POST[POST_EXTERN_USER_EMAIL]) && !isnull(getCookieValue("form_112"))) {
        $USER->Browsers[0]->Email = cutString(getCookieValue("form_112"), 254);
    } else {
        $USER->Browsers[0]->Email = cutString(AJAXDecode($_POST[POST_EXTERN_USER_EMAIL]), 254);
    }
    if (empty($_POST[POST_EXTERN_USER_COMPANY]) && !isnull(getCookieValue("form_113"))) {
        $USER->Browsers[0]->Company = cutString(getCookieValue("form_113"), 254);
    } else {
        $USER->Browsers[0]->Company = cutString(AJAXDecode($_POST[POST_EXTERN_USER_COMPANY]), 254);
    }
    $USER->Browsers[0]->Question = cutString(AJAXDecode($_POST[POST_EXTERN_USER_QUESTION]), 254);
    $USER->Browsers[0]->SaveLoginData();
    for ($i = 0; $i <= 9; $i++) {
        if (isset($_POST["p_cf" . $i]) && !empty($_POST["p_cf" . $i]) && isset($CONFIG["gl_ci_list"][$i])) {
            $USER->Browsers[0]->Customs[$i] = AJAXDecode($_POST["p_cf" . $i]);
            setCookieValue("cf_" . $i, $USER->Browsers[0]->Customs[$i]);
        }
    }
    if (isset($_POST[POST_EXTERN_USER_NAME]) && !empty($_POST[POST_EXTERN_USER_NAME])) {
        setCookieValue("form_111", $USER->Browsers[0]->Fullname);
    }
    if (isset($_POST[POST_EXTERN_USER_EMAIL]) && !empty($_POST[POST_EXTERN_USER_EMAIL])) {
        setCookieValue("form_112", $USER->Browsers[0]->Email);
    }
    if (isset($_POST[POST_EXTERN_USER_COMPANY]) && !empty($_POST[POST_EXTERN_USER_COMPANY])) {
        setCookieValue("form_113", $USER->Browsers[0]->Company);
    }
    $USER->AddFunctionCall("lz_chat_set_status(lz_chat_data.STATUS_INIT);", false);
}
コード例 #16
0
ファイル: track.php プロジェクト: bgabor/RenaniaOpencart
 if ($INPUTS[111]->IsServerInput()) {
     $BROWSER->Fullname = cutString($INPUTS[111]->GetServerInput(), 255);
 } else {
     if ($INPUTS[111]->Cookie) {
         $BROWSER->Fullname = getCookieValue("form_111");
     }
 }
 if ($INPUTS[112]->IsServerInput()) {
     $BROWSER->Email = cutString($INPUTS[112]->GetServerInput(), 255);
 } else {
     if ($INPUTS[112]->Cookie) {
         $BROWSER->Email = getCookieValue("form_112");
     }
 }
 if ($INPUTS[113]->IsServerInput()) {
     $BROWSER->Company = cutString($INPUTS[113]->GetServerInput(), 255);
 } else {
     if ($INPUTS[113]->Cookie) {
         $BROWSER->Company = getCookieValue("form_113");
     }
 }
 if ($INPUTS[114]->IsServerInput()) {
     $BROWSER->Question = $INPUTS[114]->GetServerInput();
 } else {
     if (isset($INPUTS[114]->Cookie) && $INPUTS[114]->Cookie) {
         $BROWSER->Question = getCookieValue("form_114");
     }
 }
 if ($INPUTS[116]->IsServerInput()) {
     $BROWSER->Phone = $INPUTS[116]->GetServerInput();
 } else {
コード例 #17
0
ファイル: amlich.php プロジェクト: bamboo0079/shopcart
 public function index()
 {
     $this->language->load('promotion/duonglich');
     $this->load->model('catalog/product');
     $this->load->model('catalog/tag');
     $this->load->model('tool/image');
     $this->data['breadcrumbs'] = array();
     $this->data['breadcrumbs'][] = array('text' => $this->language->get('text_home'), 'href' => $this->url->link('common/home'), 'separator' => false);
     $this->data['breadcrumbs'][] = array('text' => $this->config->get('khtetamlich_title'), 'href' => $this->url->link('promotion/amlich'), 'separator' => $this->language->get('text_separator'));
     $this->document->setTitle($this->config->get('khtetamlich_customtitle'));
     $this->document->setDescription($this->config->get('khtetamlich_metadesc'));
     $this->document->setKeywords($this->config->get('khtetamlich_metakey'));
     $this->data['heading_title'] = $this->config->get('khtetamlich_title');
     $this->data['url'] = $this->url->link('promotion/duonglich');
     $this->data['desc'] = html_entity_decode($this->config->get('khtetamlich_desc'), ENT_QUOTES, 'UTF-8');
     $this->document->addScript('catalog/view/javascript/jquery/tabs.js');
     $this->document->addScript('catalog/view/javascript/jquery/colorbox/jquery.colorbox-min.js');
     $this->document->addStyle('catalog/view/javascript/jquery/colorbox/colorbox.css');
     $this->document->addScript('catalog/view/javascript/jquery/jquery.jcarousel.min.js');
     if (file_exists('catalog/view/theme/' . $this->config->get('config_template') . '/stylesheet/carousel.css')) {
         $this->document->addStyle('catalog/view/theme/' . $this->config->get('config_template') . '/stylesheet/carousel.css');
     } else {
         $this->document->addStyle('catalog/view/theme/default/stylesheet/carousel.css');
     }
     $this->data['text_local_start_1'] = $this->language->get('text_local_start_1');
     $this->data['text_local_start_2'] = $this->language->get('text_local_start_2');
     $this->data['text_local_start_3'] = $this->language->get('text_local_start_3');
     $this->data['text_promotion_content_label'] = $this->language->get('text_promotion_content_label');
     $this->data['text_name'] = $this->language->get('text_name');
     $this->data['text_price'] = $this->language->get('text_price');
     $this->data['text_start_time_holiday'] = $this->language->get('text_start_time_holiday');
     $this->data['text_top'] = $this->language->get('text_top');
     $this->data['text_promotion'] = $this->language->get('text_promotion');
     $this->data['text_location'] = $this->language->get('text_location');
     $this->data['text_sg'] = $this->language->get('text_sg');
     $this->data['text_dn'] = $this->language->get('text_dn');
     $this->data['text_hn'] = $this->language->get('text_hn');
     $this->data['text_saigon'] = $this->language->get('text_saigon');
     $this->data['text_danang'] = $this->language->get('text_danang');
     $this->data['text_hanoi'] = $this->language->get('text_hanoi');
     $this->data['text_list_location'] = $this->language->get('text_list_location');
     $this->data['entry_price'] = $this->language->get('entry_price');
     $this->data['entry_duration'] = $this->language->get('entry_duration');
     $this->data['entry_start_time'] = $this->language->get('entry_start_time');
     $this->data['entry_start_time_holiday'] = $this->language->get('entry_start_time_holiday');
     $this->data['entry_start_time_tet'] = $this->language->get('entry_start_time_tet');
     /**********************cats**********************/
     $cat_id_promotion = 76;
     $this->data['cats'] = array();
     $cats = $this->model_catalog_tag->getTags($cat_id_promotion);
     foreach ($cats as $item) {
         if ($item['image'] && file_exists(DIR_IMAGE . $item['image'])) {
             $name = $item['name_menu'] ? $item['name_menu'] : $item['name'];
             $array = array('Tour Du Lịch ', 'Tết Nguyên Đán', 'Tết Nguyên Đán 2015', 'tết nguyên đán', 'Tour du lịch ', 'Tết Âm Lịch', 'Tour', '2016');
             $name = str_replace($array, '', $name);
             $product_total = $this->model_catalog_tag->getTotalProductByTagId($item['tag_id']);
             $this->data['cats'][] = array('id' => $item['tag_id'], 'name' => $name . ' ' . sprintf($this->language->get('text_product_total'), $product_total), 'thumb' => $this->model_tool_image->onesize($item['image'], 250, 150), 'href' => $this->url->link('product/tag', 'tag_id=' . $item['tag_id']));
         }
     }
     /**********************products1**********************/
     $this->data['products1'] = array();
     $product = explode(',', $this->config->get('khmntal_product'));
     if ($product) {
         foreach ($product as $product_id) {
             $result = $this->model_catalog_product->getProduct($product_id);
             if ($result['image'] && file_exists(DIR_IMAGE . $result['image'])) {
                 $image = $this->model_tool_image->cropsize($result['image'], $this->config->get('config_image_product_width'), $this->config->get('config_image_product_height'));
             } else {
                 $image = $this->model_tool_image->cropsize('no_image.jpg', $this->config->get('config_image_product_width'), $this->config->get('config_image_product_width'));
             }
             if ((double) $result['special']) {
                 $special = $this->currency->format($this->tax->calculate($result['special'], $result['tax_class_id'], $this->config->get('config_tax')));
             } else {
                 $special = false;
             }
             if ((double) $result['special1']) {
                 $special1 = $this->currency->format($this->tax->calculate($result['special1'], $result['tax_class_id'], $this->config->get('config_tax')));
             } else {
                 $special1 = false;
             }
             if (isset($result['custom_link'])) {
                 $custom_link = '&path=' . $result['custom_link'];
             }
             $this->data['products1'][] = array('product_id' => $result['product_id'], 'thumb' => $image, 'name' => $result['name_tour'] ? $result['name_tour'] : $result['name'], 'name_title' => cutString($result['name_tour'] ? $result['name_tour'] : $result['name'], 16), 'description' => cutString(preg_replace('/\\n/', "", strip_tags(html_entity_decode($result['description'], ENT_QUOTES, 'UTF-8'))), 50), 'model' => $result['model'], 'start_time' => $result['start_time'], 'start_time_holiday' => $result['start_time_holiday'] ? $result['start_time_holiday'] : '&nbsp;', 'start_time_tet' => $result['start_time_tet'] ? $result['start_time_tet'] : '&nbsp;', 'start_time_tet_before' => $result['start_time_tet_before'] ? $result['start_time_tet_before'] : '&nbsp;', 'start_time_tet_after' => $result['start_time_tet_after'] ? $result['start_time_tet_after'] : '&nbsp;', 'duration' => $result['duration'], 'product_type' => $result['product_type'], 'special' => $special ? $special : 'Liên hệ', 'special1' => $special1 ? $special1 : 'Liên hệ', 'href' => $this->url->link('product/product', $custom_link . '&product_id=' . $result['product_id']));
         }
     }
     /**********************products2**********************/
     $this->data['products2'] = array();
     $product = explode(',', $this->config->get('khmttal_product'));
     if ($product) {
         foreach ($product as $product_id) {
             $result = $this->model_catalog_product->getProduct($product_id);
             if ($result['image'] && file_exists(DIR_IMAGE . $result['image'])) {
                 $image = $this->model_tool_image->cropsize($result['image'], $this->config->get('config_image_product_width'), $this->config->get('config_image_product_height'));
             } else {
                 $image = $this->model_tool_image->cropsize('no_image.jpg', $this->config->get('config_image_product_width'), $this->config->get('config_image_product_width'));
             }
             if ((double) $result['special']) {
                 $special = $this->currency->format($this->tax->calculate($result['special'], $result['tax_class_id'], $this->config->get('config_tax')));
             } else {
                 $special = false;
             }
             if ((double) $result['special1']) {
                 $special1 = $this->currency->format($this->tax->calculate($result['special1'], $result['tax_class_id'], $this->config->get('config_tax')));
             } else {
                 $special1 = false;
             }
             if (isset($result['custom_link'])) {
                 $custom_link = '&path=' . $result['custom_link'];
             }
             $this->data['products2'][] = array('product_id' => $result['product_id'], 'thumb' => $image, 'name' => $result['name_tour'] ? $result['name_tour'] : $result['name'], 'name_title' => cutString($result['name_tour'] ? $result['name_tour'] : $result['name'], 16), 'description' => cutString(preg_replace('/\\n/', "", strip_tags(html_entity_decode($result['description'], ENT_QUOTES, 'UTF-8'))), 50), 'model' => $result['model'], 'start_time' => $result['start_time'], 'start_time_holiday' => $result['start_time_holiday'] ? $result['start_time_holiday'] : '&nbsp;', 'start_time_tet' => $result['start_time_tet'] ? $result['start_time_tet'] : '&nbsp;', 'start_time_tet_before' => $result['start_time_tet_before'] ? $result['start_time_tet_before'] : '&nbsp;', 'start_time_tet_after' => $result['start_time_tet_after'] ? $result['start_time_tet_after'] : '&nbsp;', 'duration' => $result['duration'], 'product_type' => $result['product_type'], 'special' => $special ? $special : 'Liên hệ', 'special1' => $special1 ? $special1 : 'Liên hệ', 'href' => $this->url->link('product/product', $custom_link . '&product_id=' . $result['product_id']));
         }
     }
     /**********************products3**********************/
     $this->data['products3'] = array();
     $product = explode(',', $this->config->get('khmbtal_product'));
     if ($product) {
         foreach ($product as $product_id) {
             $result = $this->model_catalog_product->getProduct($product_id);
             if ($result['image'] && file_exists(DIR_IMAGE . $result['image'])) {
                 $image = $this->model_tool_image->cropsize($result['image'], $this->config->get('config_image_product_width'), $this->config->get('config_image_product_height'));
             } else {
                 $image = $this->model_tool_image->cropsize('no_image.jpg', $this->config->get('config_image_product_width'), $this->config->get('config_image_product_width'));
             }
             if ((double) $result['special']) {
                 $special = $this->currency->format($this->tax->calculate($result['special'], $result['tax_class_id'], $this->config->get('config_tax')));
             } else {
                 $special = false;
             }
             if ((double) $result['special1']) {
                 $special1 = $this->currency->format($this->tax->calculate($result['special1'], $result['tax_class_id'], $this->config->get('config_tax')));
             } else {
                 $special1 = false;
             }
             if (isset($result['custom_link'])) {
                 $custom_link = '&path=' . $result['custom_link'];
             }
             $this->data['products3'][] = array('product_id' => $result['product_id'], 'thumb' => $image, 'name' => $result['name_tour'] ? $result['name_tour'] : $result['name'], 'name_title' => cutString($result['name_tour'] ? $result['name_tour'] : $result['name'], 16), 'description' => cutString(preg_replace('/\\n/', "", strip_tags(html_entity_decode($result['description'], ENT_QUOTES, 'UTF-8'))), 50), 'model' => $result['model'], 'start_time' => $result['start_time'], 'start_time_holiday' => $result['start_time_holiday'] ? $result['start_time_holiday'] : '&nbsp;', 'start_time_tet' => $result['start_time_tet'] ? $result['start_time_tet'] : '&nbsp;', 'start_time_tet_before' => $result['start_time_tet_before'] ? $result['start_time_tet_before'] : '&nbsp;', 'start_time_tet_after' => $result['start_time_tet_after'] ? $result['start_time_tet_after'] : '&nbsp;', 'duration' => $result['duration'], 'product_type' => $result['product_type'], 'special' => $special ? $special : 'Liên hệ', 'special1' => $special1 ? $special1 : 'Liên hệ', 'href' => $this->url->link('product/product', $custom_link . '&product_id=' . $result['product_id']));
         }
     }
     if (file_exists(DIR_TEMPLATE . $this->config->get('config_template') . '/template/promotion/amlich.tpl')) {
         $this->template = $this->config->get('config_template') . '/template/promotion/amlich.tpl';
     } else {
         $this->template = 'default/template/promotion/amlich.tpl';
     }
     $this->children = array('common/column_left', 'common/column_right', 'common/content_top', 'common/content_bottom', 'common/footer', 'common/header', 'module/comment');
     $this->response->setOutput($this->render());
 }
コード例 #18
0
ファイル: track.php プロジェクト: beardon/stillwaterlife-web
     $BROWSER->Destroy();
     exit("lz_tracking_stop_tracking();");
 }
 $BROWSER->Customs = getCustomArray();
 if (isset($_GET[GET_EXTERN_USER_NAME]) && !empty($_GET[GET_EXTERN_USER_NAME])) {
     $BROWSER->Fullname = cutString(base64UrlDecode($_GET[GET_EXTERN_USER_NAME]), 254);
 } else {
     $BROWSER->Fullname = getCookieValue("form_111");
 }
 if (isset($_GET[GET_EXTERN_USER_EMAIL]) && !empty($_GET[GET_EXTERN_USER_EMAIL])) {
     $BROWSER->Email = cutString(base64UrlDecode($_GET[GET_EXTERN_USER_EMAIL]), 254);
 } else {
     $BROWSER->Email = getCookieValue("form_112");
 }
 if (isset($_GET[GET_EXTERN_USER_COMPANY]) && !empty($_GET[GET_EXTERN_USER_COMPANY])) {
     $BROWSER->Company = cutString(base64UrlDecode($_GET[GET_EXTERN_USER_COMPANY]), 254);
 } else {
     $BROWSER->Company = getCookieValue("form_113");
 }
 if (isset($_GET[GET_EXTERN_USER_QUESTION]) && !empty($_GET[GET_EXTERN_USER_QUESTION])) {
     $BROWSER->Question = base64UrlDecode($_GET[GET_EXTERN_USER_QUESTION]);
 }
 $referrer = isset($_GET[GET_TRACK_REFERRER]) ? trim(slashesStrip(base64UrlDecode($_GET[GET_TRACK_REFERRER]))) : "";
 if (JAVASCRIPT) {
     if (isset($_GET[GET_TRACK_RESOLUTION_WIDTH])) {
         if (!isset($_GET[GET_TRACK_URL])) {
             abortTracking(9);
         } else {
             if (empty($_GET[GET_TRACK_URL])) {
                 abortTracking(3);
             }
コード例 #19
0
ファイル: cree_client3.php プロジェクト: savant1/rodeo
 * Created by PhpStorm.
 * User: ferry francois
 * Date: 29/11/2015
 * Time: 16:27
 */
session_start();
include '../contr/controller.php';
$err = "";
$num_compte = "";
$i = 4;
$un = cutString(htmlspecialchars($_POST['nom']), $i);
$creat = check_id($_COOKIE['technicien']);
$check = check_mail($_POST['email']);
$num_compte .= '411' . $un;
$check1 = check_num_compte($num_compte);
if ($num_compte == $check1['num_compte']) {
    $i = $i + 1;
    $num_compte = "";
    $num_compte .= '411' . cutString(htmlspecialchars($_POST['nom']), $i);
}
if ($check['email'] == $_POST['email']) {
    $err .= "<li class='btn btn-warning'>Votre client exite deja</li>";
    header('Location:../technicien/cree_client.php?code_retour=' . $err);
} else {
    if (cree_client($num_compte, htmlspecialchars($_POST['nom']), $un, htmlspecialchars($_POST['qualite']), htmlspecialchars($_POST['adres']), htmlspecialchars($_POST['compl']), htmlspecialchars($_POST['cpv']), htmlspecialchars($_POST['pays']), htmlspecialchars($_POST['id']), htmlspecialchars($_POST['tel']), htmlspecialchars($_POST['email']), htmlspecialchars($_POST['site']), $creat['id'])) {
        $err .= "<li class='btn btn-success'>Votre client est bien crée</li>";
        header('Location:../technicien/cree_client.php?code_retour=' . $err);
    } else {
        header('Location:../technicien/cree_client.php?code_retour=' . $err);
    }
}
コード例 #20
0
</td></tr>";<?php 
    }
    echo "mensaje = mensaje + '</table>';";
}
// aviso de alarmas
if ($var_cntavisohoy > 0) {
    ?>
mensaje = mensaje + '<p>Trámites con Aviso de hoy</p><table width=100% class=list_tbl><tr><th align=center>Dirección</th><th align=center>N° Kardex</th><th align=center>Título</th><th align=center>Fecha</th></tr>';<?php 
    while ($row = mysql_fetch_array($var_alarmahoy)) {
        // propiedad
        $sql_prop = "select * from acsa_totvs_propiedades where codigo='" . mysql_real_escape_string($row["propiedad_id"]) . "' limit 1";
        $result_prop = executeSelect($sql_prop, $conn);
        $propiedad = mysql_fetch_array($result_prop);
        ?>
mensaje = mensaje + "<tr><td><?php 
        echo is_blank(cutString(htmlentities(ucfirst(strtolower($propiedad["direccion"]))), 30));
        ?>
</td>";<?php 
        ?>
mensaje = mensaje + "<td><?php 
        echo is_blank(htmlentities($propiedad["kardex"]));
        ?>
</td>";<?php 
        ?>
mensaje = mensaje + "<td><a href=viewticket.php?&mt=y&tk=<?php 
        echo $row["nTicketId"];
        ?>
&us=<?php 
        echo $row["nUserId"];
        ?>
&stylename=<?php 
コード例 #21
0
ファイル: event.php プロジェクト: bamboo0079/shopcart
 public function index()
 {
     $this->language->load('promotion/duonglich');
     $this->load->model('catalog/product');
     $this->load->model('catalog/tag');
     $this->load->model('tool/image');
     $this->load->model('event/event');
     $event = $this->model_event_event->getEventIDByAlias(substr($_SERVER['REQUEST_URI'], 1));
     $this->data['breadcrumbs'] = array();
     $this->data['breadcrumbs'][] = array('text' => $this->language->get('text_home'), 'href' => $this->url->link('common/home'), 'separator' => false);
     $this->data['breadcrumbs'][] = array('text' => $event['customtitle'], 'href' => $this->url->link('event/event'), 'separator' => $this->language->get('text_separator'));
     $this->document->setTitle($event['event_title']);
     $this->document->setDescription($event['event_description']);
     $this->document->setKeywords($event['event_keywords']);
     $this->data['heading_title'] = $event['event_customtitle'];
     $this->data['url'] = $this->url->link('event/event');
     $this->data['desc'] = html_entity_decode($event['event_contents'], ENT_QUOTES, 'UTF-8');
     $this->document->addScript('catalog/view/javascript/jquery/tabs.js');
     $this->document->addScript('catalog/view/javascript/jquery/colorbox/jquery.colorbox-min.js');
     $this->document->addStyle('catalog/view/javascript/jquery/colorbox/colorbox.css');
     $this->document->addScript('catalog/view/javascript/jquery/jquery.jcarousel.min.js');
     if (file_exists('catalog/view/theme/' . $event['event_code'] . '/stylesheet/carousel.css')) {
         $this->document->addStyle('catalog/view/theme/' . $event['event_code'] . '/stylesheet/carousel.css');
     } else {
         $this->document->addStyle('catalog/view/theme/default/stylesheet/carousel.css');
     }
     $this->data['text_local_start_1'] = $this->language->get('text_local_start_1');
     $this->data['text_local_start_2'] = $this->language->get('text_local_start_2');
     $this->data['text_local_start_3'] = $this->language->get('text_local_start_3');
     $this->data['text_promotion_content_label'] = $this->language->get('text_promotion_content_label');
     $this->data['even_date'] = 2;
     $this->data['text_name'] = $this->language->get('text_name');
     $this->data['text_price'] = $this->language->get('text_price');
     $this->data['text_start_time_holiday'] = $this->language->get('text_start_time_holiday');
     $this->data['text_top'] = $this->language->get('text_top');
     $this->data['text_promotion'] = $this->language->get('text_promotion');
     $this->data['text_location'] = $this->language->get('text_location');
     $this->data['text_sg'] = $this->language->get('text_sg');
     $this->data['text_dn'] = $this->language->get('text_dn');
     $this->data['text_pt'] = $this->language->get('text_pt');
     $this->data['text_saigon'] = $this->language->get('text_saigon');
     $this->data['text_danang'] = $this->language->get('text_danang');
     $this->data['text_phanthiet'] = $this->language->get('text_phanthiet');
     $this->data['text_list_location'] = $this->language->get('text_list_location');
     $this->data['entry_price'] = $this->language->get('entry_price');
     $this->data['entry_duration'] = $this->language->get('entry_duration');
     $this->data['entry_start_time'] = $this->language->get('entry_start_time');
     $this->data['entry_start_time_holiday'] = $this->language->get('entry_start_time_holiday');
     $this->data['entry_start_time_tet'] = $this->language->get('entry_start_time_tet');
     /**********************cats**********************/
     /*carosual*/
     $cat_id_promotion = 76;
     /* id tag am lich*/
     $this->data['cats'] = array();
     $cats = $this->model_catalog_tag->getTags($cat_id_promotion);
     /* lay cac tag con co tag duong lich la cha*/
     foreach ($cats as $item) {
         if ($item['image'] && file_exists(DIR_IMAGE . $item['image'])) {
             $name = $item['name_menu'] ? $item['name_menu'] : $item['name'];
             $array = array('Tour Du Lịch ', 'Tết Dương Lịch', 'Tết Dương Lịch 2016', '2016');
             $name = str_replace($array, '', $name);
             $product_total = $this->model_catalog_tag->getTotalProductByTagId($item['tag_id']);
             $this->data['cats'][] = array('id' => $item['tag_id'], 'name' => $name . ' ' . sprintf($this->language->get('text_product_total'), $product_total), 'thumb' => $this->model_tool_image->onesize($item['image'], 250, 150), 'href' => $this->url->link('product/tag', 'tag_id=' . $item['tag_id']));
         }
     }
     /**********************cats**********************/
     /*carosual*/
     /**********************products**********************/
     $this->data['products'] = array();
     $event_group = $this->model_event_event->getEventGroup($event['id']);
     foreach ($event_group as $key => $value) {
         if ($value['value'] != null) {
             $product = explode(',', $value['value']);
             if ($product) {
                 foreach ($product as $product_id) {
                     $result = $this->model_catalog_product->getProduct($product_id);
                     if ($result['image'] && file_exists(DIR_IMAGE . $result['image'])) {
                         $image = $this->model_tool_image->cropsize($result['image'], $this->config->get('config_image_product_width'), $this->config->get('config_image_product_height'));
                     } else {
                         $image = $this->model_tool_image->cropsize('no_image.jpg', $this->config->get('config_image_product_width'), $this->config->get('config_image_product_width'));
                     }
                     if ((double) $result['special']) {
                         $special = $this->currency->format($this->tax->calculate($result['special'], $result['tax_class_id'], $this->config->get('config_tax')));
                     } else {
                         $special = false;
                     }
                     if ((double) $result['price']) {
                         $price = $this->currency->format($this->tax->calculate($result['price'], $result['tax_class_id'], $this->config->get('config_tax')));
                     } else {
                         $price = false;
                     }
                     if (isset($result['custom_link'])) {
                         $custom_link = '&path=' . $result['custom_link'];
                     } else {
                         $custom_link = "";
                     }
                     //  san pham o day
                     $this->data['options'] = array();
                     $option_even = array();
                     foreach ($this->model_catalog_product->getProductOptionsDL($result['product_id']) as $option) {
                         if ($option['type'] == 'select' || $option['type'] == 'radio' || $option['type'] == 'checkbox' || $option['type'] == 'image') {
                             $option_value_data = array();
                             foreach ($option['option_value'] as $option_value) {
                                 if (!$option_value['subtract'] || $option_value['quantity'] > 0) {
                                     if (($this->config->get('config_customer_price') && $this->customer->isLogged() || !$this->config->get('config_customer_price')) && (double) $option_value['price']) {
                                         $price = $this->currency->format($option_value['price']);
                                     } else {
                                         $price = false;
                                     }
                                     $option_value_data[0] = array('product_option_value_id' => $option_value['product_option_value_id'], 'option_value_id' => $option_value['option_value_id'], 'name' => $option_value['name'], 'image' => $this->model_tool_image->onesize($option_value['image'], 50, 50), 'price' => $price);
                                 }
                             }
                             $option_even[] = array('product_option_id' => $option['product_option_id'], 'option_id' => $option['option_id'], 'name' => $option['name'], 'type' => $option['type'], 'category' => $option['category'], 'class' => $option['class'], 'option_value' => $option_value_data, 'required' => $option['required']);
                         }
                     }
                     $location = '';
                     if (preg_match('/Sài Gòn/', $value['name'])) {
                         $location = 'Sài Gòn';
                     }
                     if (preg_match('/Miền Tây/', $value['name'])) {
                         $location = 'Miền Tây';
                     }
                     if (preg_match('/Vũng Tàu/', $value['name'])) {
                         $location = 'Vũng Tàu';
                     }
                     if (preg_match('/Phú Quốc/', $value['name'])) {
                         $location = 'Phú Quốc';
                     }
                     if (preg_match('/Phan Thiết/', $value['name'])) {
                         $location = 'Phan Thiết';
                     }
                     if (preg_match('/Đà Lạt/', $value['name'])) {
                         $location = 'Đà Lạt';
                     }
                     if (preg_match('/Nha Trang/', $value['name'])) {
                         $location = 'Nha Trang';
                     }
                     if (preg_match('/Đà Nẵng/', $value['name'])) {
                         $location = 'Đà Nẵng';
                     }
                     if (preg_match('/Hội An/', $value['name'])) {
                         $location = 'Hội An';
                     }
                     if (preg_match('/Huế/', $value['name'])) {
                         $location = 'Huế';
                     }
                     if (preg_match('/Hà Nội/', $value['name'])) {
                         $location = 'Hà Nội';
                     }
                     if (preg_match('/Hạ Long/', $value['name'])) {
                         $location = 'Hạ Long';
                     }
                     if (preg_match('/Sapa/', $value['name'])) {
                         $location = 'Sapa';
                     }
                     $this->data['products'][] = array('product_id' => $result['product_id'], 'location' => $location, 'thumb' => $image, 'name' => $result['name_tour'] ? $result['name_tour'] : $result['name'], 'name_title' => cutString($result['name_tour'] ? $result['name_tour'] : $result['name'], 16), 'model' => $result['model'], 'schedule_title' => $result['schedule'], 'schedule' => cutString($result['schedule'], 18), 'price' => $price, 'special' => $result['special'], 'duration' => $result['duration'] ? $result['duration'] : 'Nữa ngày', 'special' => $special ? $special : 'Liên hệ', 'href' => $this->url->link('product/product', $custom_link . '&product_id=' . $result['product_id']), 'product_option_id' => $option_even);
                     $option_even = array();
                 }
             }
         }
     }
     if (file_exists(DIR_TEMPLATE . $this->config->get('config_template') . '/template/event/event.tpl')) {
         $this->template = $this->config->get('config_template') . '/template/event/event.tpl';
     } else {
         $this->template = 'default/template/promotion/duonglich.tpl';
     }
     $this->children = array('common/column_left', 'common/column_right', 'common/content_top', 'common/content_bottom', 'common/footer', 'common/header', 'module/comment');
     $this->response->setOutput($this->render());
 }
コード例 #22
0
 public function index()
 {
     $this->language->load('product/category');
     $this->load->model('catalog/category');
     $this->load->model('catalog/product');
     $this->load->model('tool/image');
     if (isset($this->request->get['filter'])) {
         $filter = $this->request->get['filter'];
     } else {
         $filter = '';
     }
     if (isset($this->request->get['sort'])) {
         $sort = $this->request->get['sort'];
     } else {
         $sort = 'p.model';
     }
     if (isset($this->request->get['order'])) {
         $order = $this->request->get['order'];
     } else {
         $order = 'ASC';
     }
     if (isset($this->request->get['page'])) {
         $page = $this->request->get['page'];
     } else {
         $page = 1;
     }
     if (isset($this->request->get['limit'])) {
         $limit = $this->request->get['limit'];
     } else {
         $limit = $this->config->get('config_catalog_limit');
     }
     $this->data['breadcrumbs'] = array();
     $this->data['breadcrumbs'][] = array('text' => $this->language->get('text_home'), 'href' => $this->url->link('common/home'), 'separator' => false);
     if (isset($this->request->get['path'])) {
         $url = '';
         if (isset($this->request->get['sort'])) {
             $url .= '&sort=' . $this->request->get['sort'];
         }
         if (isset($this->request->get['order'])) {
             $url .= '&order=' . $this->request->get['order'];
         }
         if (isset($this->request->get['limit'])) {
             $url .= '&limit=' . $this->request->get['limit'];
         }
         $path = '';
         $parts = explode('_', (string) $this->request->get['path']);
         $category_id = (int) array_pop($parts);
         foreach ($parts as $path_id) {
             if (!$path) {
                 $path = (int) $path_id;
             } else {
                 $path .= '_' . (int) $path_id;
             }
             $category_info = $this->model_catalog_category->getCategory($path_id);
             if ($category_info) {
                 $this->data['breadcrumbs'][] = array('text' => $category_info['name'], 'href' => $this->url->link('product/category', 'path=' . $path . $url), 'separator' => $this->language->get('text_separator'));
             }
         }
     } else {
         $category_id = 0;
     }
     $category_info = $this->model_catalog_category->getCategory($category_id);
     if ($category_info) {
         $this->document->setTitle($category_info['custom_title'] ? $category_info['custom_title'] : $category_info['name']);
         $this->document->setDescription($category_info['meta_description']);
         $this->document->setKeywords($category_info['meta_keyword']);
         $pathx = explode('_', $this->request->get['path']);
         $pathx = end($pathx);
         $this->document->addLink($this->url->link('product/category', 'path=' . $pathx), 'canonical');
         $this->document->addScript('catalog/view/javascript/jquery/jquery.total-storage.min.js');
         $this->data['heading_title'] = $category_info['name'];
         $this->data['url'] = $this->url->link('product/category', 'path=' . $pathx);
         $this->data['text_refine'] = $this->language->get('text_refine');
         $this->data['text_empty'] = $this->language->get('text_empty');
         $this->data['text_quantity'] = $this->language->get('text_quantity');
         $this->data['text_manufacturer'] = $this->language->get('text_manufacturer');
         $this->data['text_model'] = $this->language->get('text_model');
         $this->data['text_price'] = $this->language->get('text_price');
         $this->data['text_percent'] = $this->language->get('text_percent');
         $this->data['text_price_save'] = $this->language->get('text_price_save');
         $this->data['text_tax'] = $this->language->get('text_tax');
         $this->data['text_points'] = $this->language->get('text_points');
         $this->data['text_compare'] = sprintf($this->language->get('text_compare'), isset($this->session->data['compare']) ? count($this->session->data['compare']) : 0);
         $this->data['text_display'] = $this->language->get('text_display');
         $this->data['text_list'] = $this->language->get('text_list');
         $this->data['text_grid'] = $this->language->get('text_grid');
         $this->data['text_sort'] = $this->language->get('text_sort');
         $this->data['text_limit'] = $this->language->get('text_limit');
         $this->data['text_contact'] = $this->language->get('text_contact');
         $this->data['entry_price'] = $this->language->get('entry_price');
         $this->data['entry_duration'] = $this->language->get('entry_duration');
         $this->data['entry_departure'] = $this->language->get('entry_departure');
         $this->data['entry_start_time'] = $this->language->get('entry_start_time');
         $this->data['entry_start_time_holiday'] = $this->language->get('entry_start_time_holiday');
         $this->data['entry_start_time_tet'] = $this->language->get('entry_start_time_tet');
         $this->data['entry_not_start_time'] = $this->language->get('entry_not_start_time');
         $this->data['entry_location_to'] = $this->language->get('entry_location_to');
         $this->data['entry_location_from'] = $this->language->get('entry_location_from');
         $this->data['entry_transport'] = $this->language->get('entry_transport');
         $this->data['entry_schedule'] = $this->language->get('entry_schedule');
         $this->data['button_cart'] = $this->language->get('button_cart');
         $this->data['button_car_rent'] = $this->language->get('button_car_rent');
         $this->data['button_wishlist'] = $this->language->get('button_wishlist');
         $this->data['button_compare'] = $this->language->get('button_compare');
         $this->data['button_continue'] = $this->language->get('button_continue');
         $this->data['button_view_more'] = $this->language->get('button_view_more');
         $this->data['button_view_more_car'] = $this->language->get('button_view_more_car');
         // Set the last category breadcrumb
         $url = '';
         if (isset($this->request->get['sort'])) {
             $url .= '&sort=' . $this->request->get['sort'];
         }
         if (isset($this->request->get['order'])) {
             $url .= '&order=' . $this->request->get['order'];
         }
         if (isset($this->request->get['page'])) {
             $url .= '&page=' . $this->request->get['page'];
         }
         if (isset($this->request->get['limit'])) {
             $url .= '&limit=' . $this->request->get['limit'];
         }
         $this->data['breadcrumbs'][] = array('text' => $category_info['name'], 'href' => $this->url->link('product/category', 'path=' . $this->request->get['path']), 'separator' => $this->language->get('text_separator'));
         if ($category_info['image']) {
             $this->data['thumb'] = $this->model_tool_image->onesize($category_info['image'], $this->config->get('config_image_category_width'), $this->config->get('config_image_category_height'));
         } else {
             $this->data['thumb'] = '';
         }
         $this->data['description'] = html_entity_decode($category_info['description'], ENT_QUOTES, 'UTF-8');
         $this->data['desc_footer'] = html_entity_decode($category_info['desc_footer'], ENT_QUOTES, 'UTF-8');
         $this->data['compare'] = $this->url->link('product/compare');
         $url = '';
         if (isset($this->request->get['filter'])) {
             $url .= '&filter=' . $this->request->get['filter'];
         }
         if (isset($this->request->get['sort'])) {
             $url .= '&sort=' . $this->request->get['sort'];
         }
         if (isset($this->request->get['order'])) {
             $url .= '&order=' . $this->request->get['order'];
         }
         if (isset($this->request->get['limit'])) {
             $url .= '&limit=' . $this->request->get['limit'];
         }
         $this->data['categories'] = array();
         $results = $this->model_catalog_category->getCategories($category_id);
         foreach ($results as $result) {
             $data = array('filter_category_id' => $result['category_id'], 'filter_sub_category' => true);
             $product_total = $this->model_catalog_product->getTotalProducts($data);
             $this->data['categories'][] = array('name' => $result['name_menu'] ? $result['name_menu'] : $result['name'] . ($this->config->get('config_product_count') ? ' (' . $product_total . ')' : ''), 'href' => $this->url->link('product/category', 'path=' . $result['category_id'] . $url));
         }
         $this->data['products'] = array();
         $data = array('filter_category_id' => $category_id, 'filter_filter' => $filter, 'sort' => $sort, 'order' => $order, 'start' => ($page - 1) * $limit, 'limit' => $limit);
         $product_total = $this->model_catalog_product->getTotalProducts($data);
         $results = $this->model_catalog_product->getProducts($data);
         foreach ($results as $result) {
             if ($result['image'] && file_exists(DIR_IMAGE . $result['image'])) {
                 $image = $this->model_tool_image->cropsize($result['image'], $this->config->get('config_image_product_width'), $this->config->get('config_image_product_height'));
             } else {
                 $image = $this->model_tool_image->cropsize('no_image.jpg', $this->config->get('config_image_product_width'), $this->config->get('config_image_product_width'));
             }
             if ($this->config->get('config_customer_price') && $this->customer->isLogged() || !$this->config->get('config_customer_price') && $result['price'] != 0) {
                 $price = $this->currency->format($this->tax->calculate($result['price'], $result['tax_class_id'], $this->config->get('config_tax')));
             } else {
                 $price = false;
             }
             if ((double) $result['special']) {
                 $special = $this->currency->format($this->tax->calculate($result['special'], $result['tax_class_id'], $this->config->get('config_tax')));
             } else {
                 $special = false;
             }
             $price_save_c = $result['price'] - $result['special'];
             if ($price_save_c > 0) {
                 $price_save = $this->currency->format($this->tax->calculate($price_save_c, $result['tax_class_id'], $this->config->get('config_tax')));
                 $percent = ceil($price_save_c / $result['price'] * 100);
             } else {
                 $price_save = false;
                 $percent = false;
             }
             if ($this->config->get('config_tax')) {
                 $tax = $this->currency->format((double) $result['special'] ? $result['special'] : $result['price']);
             } else {
                 $tax = false;
             }
             if ($this->config->get('config_review_status')) {
                 $rating = (int) $result['rating'];
             } else {
                 $rating = false;
             }
             if (isset($result['custom_link'])) {
                 $custom_link = '&path=' . $result['custom_link'];
             }
             $this->data['products'][] = array('product_id' => $result['product_id'], 'thumb' => $image, 'name' => $result['name_tour'] ? $result['name_tour'] : $result['name'], 'description' => cutString(strip_tags(html_entity_decode($result['description'], ENT_QUOTES, 'UTF-8')), 50), 'model' => $result['model'], 'start_time' => $result['start_time'], 'start_time_tet' => $result['start_time_tet'], 'not_start_time' => $result['not_start_time'], 'departure' => $result['departure'], 'location_to' => $result['location_to'], 'location_from' => $result['location_from'], 'transport' => $result['transport'], 'duration' => $result['duration'], 'schedule' => $result['schedule'], 'product_type' => $result['product_type'], 'product_class' => $result['product_class'], 'price' => $price ? $price : $this->language->get('text_contact'), 'special' => $special, 'price_save' => $price_save, 'percent' => $percent, 'tax' => $tax, 'rating' => $result['rating'], 'reviews' => sprintf($this->language->get('text_reviews'), (int) $result['reviews']), 'href' => $this->url->link('product/product', $custom_link . '&product_id=' . $result['product_id'] . $url));
         }
         $url = '';
         if (isset($this->request->get['filter'])) {
             $url .= '&filter=' . $this->request->get['filter'];
         }
         if (isset($this->request->get['limit'])) {
             $url .= '&limit=' . $this->request->get['limit'];
         }
         $this->data['sorts'] = array();
         $this->data['sorts'][] = array('text' => $this->language->get('text_default'), 'value' => 'p.sort_order-ASC', 'href' => $this->url->link('product/category', 'path=' . $this->request->get['path'] . '&sort=p.sort_order&order=ASC' . $url));
         $this->data['sorts'][] = array('text' => $this->language->get('text_name_asc'), 'value' => 'pd.name-ASC', 'href' => $this->url->link('product/category', 'path=' . $this->request->get['path'] . '&sort=pd.name&order=ASC' . $url));
         $this->data['sorts'][] = array('text' => $this->language->get('text_name_desc'), 'value' => 'pd.name-DESC', 'href' => $this->url->link('product/category', 'path=' . $this->request->get['path'] . '&sort=pd.name&order=DESC' . $url));
         $this->data['sorts'][] = array('text' => $this->language->get('text_price_asc'), 'value' => 'p.price-ASC', 'href' => $this->url->link('product/category', 'path=' . $this->request->get['path'] . '&sort=p.price&order=ASC' . $url));
         $this->data['sorts'][] = array('text' => $this->language->get('text_price_desc'), 'value' => 'p.price-DESC', 'href' => $this->url->link('product/category', 'path=' . $this->request->get['path'] . '&sort=p.price&order=DESC' . $url));
         if ($this->config->get('config_review_status')) {
             $this->data['sorts'][] = array('text' => $this->language->get('text_rating_desc'), 'value' => 'rating-DESC', 'href' => $this->url->link('product/category', 'path=' . $this->request->get['path'] . '&sort=rating&order=DESC' . $url));
             $this->data['sorts'][] = array('text' => $this->language->get('text_rating_asc'), 'value' => 'rating-ASC', 'href' => $this->url->link('product/category', 'path=' . $this->request->get['path'] . '&sort=rating&order=ASC' . $url));
         }
         $this->data['sorts'][] = array('text' => $this->language->get('text_model_asc'), 'value' => 'p.model-ASC', 'href' => $this->url->link('product/category', 'path=' . $this->request->get['path'] . '&sort=p.model&order=ASC' . $url));
         $this->data['sorts'][] = array('text' => $this->language->get('text_model_desc'), 'value' => 'p.model-DESC', 'href' => $this->url->link('product/category', 'path=' . $this->request->get['path'] . '&sort=p.model&order=DESC' . $url));
         $url = '';
         if (isset($this->request->get['filter'])) {
             $url .= '&filter=' . $this->request->get['filter'];
         }
         if (isset($this->request->get['sort'])) {
             $url .= '&sort=' . $this->request->get['sort'];
         }
         if (isset($this->request->get['order'])) {
             $url .= '&order=' . $this->request->get['order'];
         }
         $this->data['limits'] = array();
         $limits = array_unique(array($this->config->get('config_catalog_limit'), 50, 100, 150, 200));
         sort($limits);
         foreach ($limits as $value) {
             $this->data['limits'][] = array('text' => $value, 'value' => $value, 'href' => $this->url->link('product/category', 'path=' . $this->request->get['path'] . $url . '&limit=' . $value));
         }
         $url = '';
         if (isset($this->request->get['filter'])) {
             $url .= '&filter=' . $this->request->get['filter'];
         }
         if (isset($this->request->get['sort'])) {
             $url .= '&sort=' . $this->request->get['sort'];
         }
         if (isset($this->request->get['order'])) {
             $url .= '&order=' . $this->request->get['order'];
         }
         if (isset($this->request->get['limit'])) {
             $url .= '&limit=' . $this->request->get['limit'];
         }
         $pagination = new Pagination();
         $pagination->total = $product_total;
         $pagination->page = $page;
         $pagination->limit = $limit;
         $pagination->text = $this->language->get('text_pagination');
         $pagination->url = $this->url->link('product/category', 'path=' . $this->request->get['path'] . $url . '&page={page}');
         $this->data['pagination'] = $pagination->render();
         $this->data['sort'] = $sort;
         $this->data['order'] = $order;
         $this->data['limit'] = $limit;
         $this->data['continue'] = $this->url->link('common/home');
         if (file_exists(DIR_TEMPLATE . $this->config->get('config_template') . '/template/product/category.tpl')) {
             $this->template = $this->config->get('config_template') . '/template/product/category.tpl';
         } else {
             $this->template = 'default/template/product/category.tpl';
         }
         $this->children = array('common/column_left', 'common/column_right', 'common/content_top', 'common/content_bottom', 'common/footer', 'common/header', 'module/comment');
         $this->response->setOutput($this->render());
     } else {
         $url = '';
         if (isset($this->request->get['path'])) {
             $url .= '&path=' . $this->request->get['path'];
         }
         if (isset($this->request->get['filter'])) {
             $url .= '&filter=' . $this->request->get['filter'];
         }
         if (isset($this->request->get['sort'])) {
             $url .= '&sort=' . $this->request->get['sort'];
         }
         if (isset($this->request->get['order'])) {
             $url .= '&order=' . $this->request->get['order'];
         }
         if (isset($this->request->get['page'])) {
             $url .= '&page=' . $this->request->get['page'];
         }
         if (isset($this->request->get['limit'])) {
             $url .= '&limit=' . $this->request->get['limit'];
         }
         $this->data['breadcrumbs'][] = array('text' => $this->language->get('text_error'), 'href' => $this->url->link('product/category', $url), 'separator' => $this->language->get('text_separator'));
         $this->document->setTitle($this->language->get('text_error'));
         $this->data['heading_title'] = $this->language->get('text_error');
         $this->data['text_error'] = $this->language->get('text_error');
         $this->data['button_continue'] = $this->language->get('button_continue');
         $this->data['continue'] = $this->url->link('common/home');
         $this->response->addHeader($this->request->server['SERVER_PROTOCOL'] . '/1.1 404 Not Found');
         if (file_exists(DIR_TEMPLATE . $this->config->get('config_template') . '/template/error/not_found.tpl')) {
             $this->template = $this->config->get('config_template') . '/template/error/not_found.tpl';
         } else {
             $this->template = 'default/template/error/not_found.tpl';
         }
         $this->children = array('common/column_left', 'common/column_right', 'common/content_top', 'common/content_bottom', 'common/footer', 'common/header');
         $this->response->setOutput($this->render());
     }
 }
コード例 #23
0
 public function index()
 {
     $this->language->load('product/product');
     $this->data['breadcrumbs'] = array();
     $this->data['breadcrumbs'][] = array('text' => $this->language->get('text_home'), 'href' => $this->url->link('common/home'), 'separator' => false);
     $this->load->model('catalog/category');
     $this->load->model('catalog/manufacturer');
     $this->data['tour4n'] = array();
     $tour3n = '90,97,122,135,139,144,156,159,223,235,240,248,290,334,345,346,353,356,357,359,360,365,388,411,441,449,475,486,491,503,50';
     $tour1n = $this->config->get('khmsg1nevendl_product') . ',' . $this->config->get('khmmt1nevendl_product') . ',' . $this->config->get('khmvt1nevendl_product') . ',' . $this->config->get('khmpq1nevendl_product') . ',' . $this->config->get('khmpt1nevendl_product') . ',' . $this->config->get('khmdl1nevendl_product') . ',' . $this->config->get('khmnt1nevendl_product') . ',' . $this->config->get('khmdn1nevendl_product') . ',' . $this->config->get('khmha1nevendl_product') . ',' . $this->config->get('khmhue1nevendl_product') . ',' . $this->config->get('khmhn1nevendl_product') . ',' . $this->config->get('khmhl1nevendl_product') . ',' . $this->config->get('khmsp1nevendl_product') . ',' . $tour3n;
     $tour4up = $this->config->get('khmsg3nevendl_product') . ',' . $this->config->get('khmsg6nevendl_product') . ',' . $this->config->get('khmmt3nevendl_product') . ',' . $this->config->get('khmmt6nevendl_product') . ',' . $this->config->get('khmvt3nevendl_product') . ',' . $this->config->get('khmvt6nevendl_product') . ',' . $this->config->get('khmpq3nevendl_product') . ',' . $this->config->get('khmpq6nevendl_product') . ',' . $this->config->get('khmpt3nevendl_product') . ',' . $this->config->get('khmpt6nevendl_product') . ',' . $this->config->get('khmdl3nevendl_product') . ',' . $this->config->get('khmdl6nevendl_product') . ',' . $this->config->get('khmnt3nevendl_product') . ',' . $this->config->get('khmnt6nevendl_product') . ',' . $this->config->get('khmdn3nevendl_product') . ',' . $this->config->get('khmdn6nevendl_product') . ',' . $this->config->get('khmha3nevendl_product') . ',' . $this->config->get('khmha6nevendl_product') . ',' . $this->config->get('khmhue3nevendl_product') . ',' . $this->config->get('khmhue6nevendl_product') . ',' . $this->config->get('khmhn3nevendl_product') . ',' . $this->config->get('khmhn6nevendl_product') . ',' . $this->config->get('khmhl3nevendl_product') . ',' . $this->config->get('khmhl6nevendl_product') . ',' . $this->config->get('khmsp3nevendl_product') . ',' . $this->config->get('khmsp6nevendl_product');
     $tour1nto3n = explode(',', $tour1n);
     $tour4n = explode(',', $tour4up);
     if (isset($this->request->get['manufacturer_id'])) {
         $this->data['breadcrumbs'][] = array('text' => $this->language->get('text_brand'), 'href' => $this->url->link('product/manufacturer'), 'separator' => $this->language->get('text_separator'));
         $url = '';
         if (isset($this->request->get['sort'])) {
             $url .= '&sort=' . $this->request->get['sort'];
         }
         if (isset($this->request->get['order'])) {
             $url .= '&order=' . $this->request->get['order'];
         }
         if (isset($this->request->get['page'])) {
             $url .= '&page=' . $this->request->get['page'];
         }
         if (isset($this->request->get['limit'])) {
             $url .= '&limit=' . $this->request->get['limit'];
         }
         $manufacturer_info = $this->model_catalog_manufacturer->getManufacturer($this->request->get['manufacturer_id']);
         if ($manufacturer_info) {
             $this->data['breadcrumbs'][] = array('text' => $manufacturer_info['name'], 'href' => $this->url->link('product/manufacturer/info', 'manufacturer_id=' . $this->request->get['manufacturer_id'] . $url), 'separator' => $this->language->get('text_separator'));
         }
     }
     if (isset($this->request->get['search']) || isset($this->request->get['tag'])) {
         $url = '';
         if (isset($this->request->get['search'])) {
             $url .= '&search=' . $this->request->get['search'];
         }
         if (isset($this->request->get['tag'])) {
             $url .= '&tag=' . $this->request->get['tag'];
         }
         if (isset($this->request->get['description'])) {
             $url .= '&description=' . $this->request->get['description'];
         }
         if (isset($this->request->get['category_id'])) {
             $url .= '&category_id=' . $this->request->get['category_id'];
         }
         if (isset($this->request->get['sub_category'])) {
             $url .= '&sub_category=' . $this->request->get['sub_category'];
         }
         if (isset($this->request->get['sort'])) {
             $url .= '&sort=' . $this->request->get['sort'];
         }
         if (isset($this->request->get['order'])) {
             $url .= '&order=' . $this->request->get['order'];
         }
         if (isset($this->request->get['page'])) {
             $url .= '&page=' . $this->request->get['page'];
         }
         if (isset($this->request->get['limit'])) {
             $url .= '&limit=' . $this->request->get['limit'];
         }
         $this->data['breadcrumbs'][] = array('text' => $this->language->get('text_search'), 'href' => $this->url->link('product/search', $url), 'separator' => $this->language->get('text_separator'));
     }
     if (isset($this->request->get['product_id'])) {
         $product_id = (int) $this->request->get['product_id'];
     } else {
         $product_id = 0;
     }
     if (isset($product_id)) {
         if (in_array($product_id, $tour1nto3n) == true) {
             $this->data['linkbannergroup'] = 'http://www.vietfuntravel.com.vn/image/data/banner-promotion/tet-2016/tour-1-den-2-ngay.jpg';
         } elseif (in_array($product_id, $tour1nto3n) == false && in_array($product_id, $tour4n) == true) {
             echo "aaaa";
             exit;
             $this->data['linkbannergroup'] = 'http://www.vietfuntravel.com.vn/image/data/banner-promotion/tet-2016/tour-4-ngay.jpg';
         }
     }
     $this->load->model('catalog/product');
     $product_info = $this->model_catalog_product->getProduct($product_id);
     if ($product_info) {
         $url = '';
         if (isset($this->request->get['path'])) {
             $url .= '&path=' . $this->request->get['path'];
         }
         if (isset($this->request->get['filter'])) {
             $url .= '&filter=' . $this->request->get['filter'];
         }
         if (isset($this->request->get['manufacturer_id'])) {
             $url .= '&manufacturer_id=' . $this->request->get['manufacturer_id'];
         }
         if (isset($this->request->get['search'])) {
             $url .= '&search=' . $this->request->get['search'];
         }
         if (isset($this->request->get['tag'])) {
             $url .= '&tag=' . $this->request->get['tag'];
         }
         if (isset($this->request->get['description'])) {
             $url .= '&description=' . $this->request->get['description'];
         }
         if (isset($this->request->get['category_id'])) {
             $url .= '&category_id=' . $this->request->get['category_id'];
         }
         if (isset($this->request->get['sub_category'])) {
             $url .= '&sub_category=' . $this->request->get['sub_category'];
         }
         if (isset($this->request->get['sort'])) {
             $url .= '&sort=' . $this->request->get['sort'];
         }
         if (isset($this->request->get['order'])) {
             $url .= '&order=' . $this->request->get['order'];
         }
         if (isset($this->request->get['page'])) {
             $url .= '&page=' . $this->request->get['page'];
         }
         if (isset($this->request->get['limit'])) {
             $url .= '&limit=' . $this->request->get['limit'];
         }
         if ($product_info['custom_breadcrumb']) {
             /* Set parent category breadcrumb	*/
             $category_parent = $this->model_catalog_category->getParentByCategoriesId($product_info['custom_breadcrumb']);
             foreach ($category_parent as $path_id) {
                 $category_info = $this->model_catalog_category->getCategory($path_id);
                 if ($category_info) {
                     $this->data['breadcrumbs'][] = array('text' => $category_info['name'], 'href' => $this->url->link('product/category', 'path=' . $path_id), 'separator' => $this->language->get('text_separator'));
                 }
             }
             /* Set the last category breadcrumb		*/
             $category_info = $this->model_catalog_category->getCategory($product_info['custom_breadcrumb']);
             if ($category_info) {
                 $this->data['breadcrumbs'][] = array('text' => $category_info['name'], 'href' => $this->url->link('product/category', 'path=' . $product_info['custom_breadcrumb']), 'separator' => $this->language->get('text_separator'));
             }
         }
         $this->data['breadcrumbs'][] = array('text' => $product_info['name'], 'href' => $this->url->link('product/product', $url . '&product_id=' . $this->request->get['product_id']), 'separator' => $this->language->get('text_separator'));
         $this->document->setTitle($product_info['custom_title'] ? $product_info['custom_title'] : $product_info['name']);
         $this->document->setDescription($product_info['meta_description']);
         $this->document->setKeywords($product_info['meta_keyword']);
         $this->document->addLink($this->url->link('product/product', 'path=' . $product_info['custom_link'] . '&product_id=' . $this->request->get['product_id']), 'canonical');
         $this->document->addScript('catalog/view/javascript/jquery/minitip/jquery.miniTip.min.js');
         $this->document->addScript('catalog/view/javascript/jquery/tabs.js');
         $this->document->addScript('catalog/view/javascript/jquery/colorbox/jquery.colorbox-min.js');
         $this->document->addStyle('catalog/view/javascript/jquery/colorbox/colorbox.css');
         $this->document->addScript('catalog/view/javascript/jquery/jquery-scrolltofixed-min.js');
         $this->document->addScript('catalog/view/javascript/jquery/jquery.jcarousel.min.js');
         $this->document->addStyle('catalog/view/javascript/jquery/minitip/miniTip.min.css');
         if (file_exists('catalog/view/theme/' . $this->config->get('config_template') . '/stylesheet/carousel.css')) {
             $this->document->addStyle('catalog/view/theme/' . $this->config->get('config_template') . '/stylesheet/carousel.css');
         } else {
             $this->document->addStyle('catalog/view/theme/default/stylesheet/carousel.css');
         }
         if ($product_info['robot_index']) {
             $this->document->addMeta('noindex, nofollow', '', 'robots');
         }
         $this->data['heading_title'] = $product_info['name_tour'] ? $product_info['name_tour'] : $product_info['name'];
         $this->data['text_select'] = $this->language->get('text_select');
         $this->data['text_manufacturer'] = $this->language->get('text_manufacturer');
         $this->data['text_model'] = $this->language->get('text_model');
         $this->data['text_reward'] = $this->language->get('text_reward');
         $this->data['text_points'] = $this->language->get('text_points');
         $this->data['text_discount'] = $this->language->get('text_discount');
         $this->data['text_stock'] = $this->language->get('text_stock');
         $this->data['text_price'] = $this->language->get('text_price');
         $this->data['text_tax'] = $this->language->get('text_tax');
         $this->data['text_option'] = $this->language->get('text_option');
         $this->data['text_qty'] = $this->language->get('text_qty');
         $this->data['text_minimum'] = sprintf($this->language->get('text_minimum'), $product_info['minimum']);
         $this->data['text_or'] = $this->language->get('text_or');
         $this->data['text_write'] = $this->language->get('text_write');
         $this->data['text_review'] = sprintf($this->language->get('text_review'), $this->data['heading_title']);
         $this->data['text_note'] = $this->language->get('text_note');
         $this->data['text_share'] = $this->language->get('text_share');
         $this->data['text_wait'] = $this->language->get('text_wait');
         $this->data['text_tags'] = $this->language->get('text_tags');
         /*V2*/
         $this->data['text_percent'] = $this->language->get('text_percent');
         $this->data['text_price_special'] = $this->language->get('text_price_special');
         $this->data['text_price_special1'] = $this->language->get('text_price_special1');
         $this->data['text_time_special'] = $this->language->get('text_time_special');
         $this->data['text_time_special1'] = $this->language->get('text_time_special1');
         $this->data['text_price_save'] = $this->language->get('text_price_save');
         $this->data['text_info'] = $this->language->get('text_info');
         $this->data['text_info_details'] = $this->language->get('text_info_details');
         $this->data['text_desc'] = sprintf($this->language->get('text_desc'), $this->data['heading_title']);
         $this->data['text_highlights'] = $this->language->get('text_highlights');
         $this->data['text_schedule'] = $this->language->get('text_schedule');
         $this->data['text_price_details'] = sprintf($this->language->get('text_price_details'), $this->data['heading_title']);
         $this->data['text_type'] = $this->language->get('text_type');
         $this->data['text_price_list'] = $this->language->get('text_price_list');
         $this->data['text_hotel_details'] = sprintf($this->language->get('text_hotel_details'), $this->data['heading_title']);
         $this->data['text_location'] = $this->language->get('text_location');
         $this->data['text_hotel'] = $this->language->get('text_hotel');
         $this->data['text_slideshow'] = $this->language->get('text_slideshow');
         $this->data['text_terms'] = $this->language->get('text_terms');
         $this->data['text_not_menu'] = $this->language->get('text_not_menu');
         /*END V2*/
         $this->data['entry_name'] = $this->language->get('entry_name');
         $this->data['entry_review'] = $this->language->get('entry_review');
         $this->data['entry_rating'] = $this->language->get('entry_rating');
         $this->data['entry_good'] = $this->language->get('entry_good');
         $this->data['entry_bad'] = $this->language->get('entry_bad');
         $this->data['entry_captcha'] = $this->language->get('entry_captcha');
         /*V2*/
         $this->data['entry_duration'] = $this->language->get('entry_duration');
         $this->data['entry_departure'] = $this->language->get('entry_departure');
         $this->data['entry_start_time'] = $this->language->get('entry_start_time');
         $this->data['entry_start_time_holiday'] = $this->language->get('entry_start_time_holiday');
         $this->data['entry_start_time_tet'] = $this->language->get('entry_start_time_tet');
         $this->data['entry_not_start_time'] = $this->language->get('entry_not_start_time');
         $this->data['entry_location_to'] = $this->language->get('entry_location_to');
         $this->data['entry_location_from'] = $this->language->get('entry_location_from');
         $this->data['entry_transport'] = $this->language->get('entry_transport');
         $this->data['entry_schedule'] = $this->language->get('entry_schedule');
         $this->data['entry_included'] = $this->language->get('entry_included');
         $this->data['entry_notincluded'] = $this->language->get('entry_notincluded');
         $this->data['entry_info_extra'] = $this->language->get('entry_info_extra');
         $this->data['entry_meeting'] = $this->language->get('entry_meeting');
         $this->data['entry_tag'] = $this->language->get('entry_tag');
         $this->data['entry_model'] = $this->language->get('entry_model');
         /*END V2*/
         $this->data['button_cart'] = $this->language->get('button_cart');
         $this->data['button_car_rent'] = $this->language->get('button_car_rent');
         $this->data['button_wishlist'] = $this->language->get('button_wishlist');
         $this->data['button_compare'] = $this->language->get('button_compare');
         $this->data['button_upload'] = $this->language->get('button_upload');
         $this->data['button_continue'] = $this->language->get('button_continue');
         $this->load->model('catalog/review');
         $this->data['tab_description'] = $this->language->get('tab_description');
         $this->data['tab_attribute'] = $this->language->get('tab_attribute');
         $this->data['tab_review'] = sprintf($this->language->get('tab_review'), $product_info['reviews']);
         $this->data['tab_related'] = $this->language->get('tab_related');
         /*V2*/
         $this->data['tab_schedule'] = $this->language->get('tab_schedule');
         $this->data['tab_price'] = $this->language->get('tab_price');
         $this->data['tab_hotel'] = $this->language->get('tab_hotel');
         $this->data['tab_payment'] = $this->language->get('tab_payment');
         $this->data['tab_terms'] = $this->language->get('tab_terms');
         $this->data['tab_info'] = $this->language->get('tab_info');
         $this->data['tab_menu'] = $this->language->get('tab_menu');
         /*END V2*/
         $this->data['product_id'] = $this->request->get['product_id'];
         $this->data['manufacturer'] = $product_info['manufacturer'];
         $this->data['manufacturers'] = $this->url->link('product/manufacturer/info', 'manufacturer_id=' . $product_info['manufacturer_id']);
         $this->data['model'] = $product_info['model'];
         $this->data['reward'] = $product_info['reward'];
         $this->data['points'] = $product_info['points'];
         $this->data['promotion_title'] = $this->config->get('promotion_title');
         $this->data['promotion_title2'] = $this->config->get('promotion_title2');
         $this->data['start_time'] = $product_info['start_time'];
         //
         $this->data['start_time_holiday'] = $product_info['start_time_holiday'];
         $this->data['start_time_tet'] = $product_info['start_time_tet'];
         $this->data['not_start_time'] = $product_info['not_start_time'];
         $this->data['departure'] = $product_info['departure'];
         $this->data['location_to'] = $product_info['location_to'];
         $this->data['location_from'] = $product_info['location_from'];
         $this->data['transport'] = $product_info['transport'];
         $this->data['duration'] = $product_info['duration'];
         $this->data['sub_duration'] = $product_info['sub_duration'];
         $this->data['schedule'] = $product_info['schedule'];
         $this->data['product_class'] = $product_info['product_class'];
         $this->data['print_product'] = 'print/' . str_replace(HTTP_SERVER, '', $this->url->link('product/product', 'path=' . $product_info['custom_link'] . '&product_id=' . $this->request->get['product_id']));
         /*UPDATE DATE PROMOTION*/
         $this->data['promotion_date'] = $price_date1 = $price_date2 = $price_date3 = '';
         $duration = explode(' ', $product_info['duration']);
         $duration = $duration[0];
         if ($duration > 5) {
             $this->data['promotion_date'] = 3;
             $price_date1 = '220000';
             $price_date2 = '230000';
             $price_date3 = '240000';
         } elseif ($duration >= 2 && $duration <= 5) {
             $this->data['promotion_date'] = 2;
             $price_date1 = '150000';
             $price_date2 = '160000';
             $price_date3 = '170000';
         } else {
             $this->data['promotion_date'] = 1;
             $price_date1 = '80000';
             $price_date2 = '90000';
             $price_date3 = '100000';
         }
         /*END UPDATE DATE PROMOTION
           //UPDATE DATE PROMOTION 2	*/
         $this->data['promotion_date2'] = $price_date12 = $price_date22 = $price_date32 = '';
         $price_date12 = '100000';
         $price_date22 = '150000';
         $price_date32 = '200000';
         /*END UPDATE DATE PROMOTION 2*/
         if ($product_info['quantity'] <= 0) {
             $this->data['stock'] = $product_info['stock_status'];
         } elseif ($this->config->get('config_stock_display')) {
             $this->data['stock'] = $product_info['quantity'];
         } else {
             $this->data['stock'] = $this->language->get('text_instock');
         }
         $this->load->model('tool/image');
         if ($product_info['image'] && file_exists(DIR_IMAGE . $product_info['image'])) {
             $this->data['popup'] = $this->model_tool_image->onesize($product_info['image'], $this->config->get('config_image_popup_width'), $this->config->get('config_image_popup_height'));
         } else {
             $this->data['popup'] = $this->model_tool_image->onesize('no_image.jpg', $this->config->get('config_image_popup_width'), $this->config->get('config_image_popup_height'));
         }
         if ($product_info['image'] && file_exists(DIR_IMAGE . $product_info['image'])) {
             $this->data['thumb'] = $this->model_tool_image->cropsize($product_info['image'], $this->config->get('config_image_thumb_width'), $this->config->get('config_image_thumb_height'));
         } else {
             $this->data['thumb'] = $this->model_tool_image->cropsize('no_image.jpg', $this->config->get('config_image_thumb_width'), $this->config->get('config_image_thumb_height'));
         }
         $this->data['images'] = array();
         $results = $this->model_catalog_product->getProductImages($this->request->get['product_id']);
         foreach ($results as $result) {
             $this->data['images'][] = array('popup' => $this->model_tool_image->onesize($result['image'], $this->config->get('config_image_popup_width'), $this->config->get('config_image_popup_height')), 'thumb' => $this->model_tool_image->cropsize($result['image'], $this->config->get('config_image_thumb_width'), $this->config->get('config_image_thumb_height')));
         }
         if ($this->config->get('config_customer_price') && $this->customer->isLogged() || !$this->config->get('config_customer_price') && $product_info['price'] != 0) {
             $this->data['price'] = $this->currency->format($this->tax->calculate($product_info['price'], $product_info['tax_class_id'], $this->config->get('config_tax')));
         } else {
             $this->data['price'] = false;
         }
         if ((double) $product_info['special']) {
             $this->data['special'] = $this->currency->format($this->tax->calculate($product_info['special'], $product_info['tax_class_id'], $this->config->get('config_tax')));
         } else {
             $this->data['special'] = false;
         }
         if ((double) $product_info['special1']) {
             $this->data['special1'] = $this->currency->format($this->tax->calculate($product_info['special1'], $product_info['tax_class_id'], $this->config->get('config_tax')));
         } else {
             $this->data['special1'] = false;
         }
         $price_save = $product_info['price'] - $product_info['special'];
         if ($price_save > 0) {
             $this->data['price_save'] = $this->currency->format($this->tax->calculate($price_save, $product_info['tax_class_id'], $this->config->get('config_tax')));
             /*$this->data['percent'] = ceil(($price_save / $product_info['price']) * 100);*/
             $this->data['percent'] = $this->currency->format($price_save);
         } else {
             $this->data['price_save'] = false;
             $this->data['percent'] = false;
         }
         if ($this->config->get('config_tax')) {
             $this->data['tax'] = $this->currency->format((double) $product_info['special'] ? $product_info['special'] : $product_info['price']);
         } else {
             $this->data['tax'] = false;
         }
         $discounts = $this->model_catalog_product->getProductDiscounts($this->request->get['product_id']);
         $this->data['discounts'] = array();
         foreach ($discounts as $discount) {
             $this->data['discounts'][] = array('quantity' => $discount['quantity'], 'price' => $this->currency->format($this->tax->calculate($discount['price'], $product_info['tax_class_id'], $this->config->get('config_tax'))));
         }
         $this->data['policy'] = array();
         if ($product_info['policy']) {
             $this->load->model('catalog/policy');
             $policy = $this->model_catalog_policy->getPolicy($product_info['policy']);
             $this->data['policy'] = array('name' => $policy['name'], 'description' => html_entity_decode($policy['description'], ENT_QUOTES, 'UTF-8'));
         }
         $this->data['phuthu'] = array(22, 28, 96, 97, 99, 117);
         $this->data['check_maybay'] = $this->data['check_vetau'] = false;
         $this->data['options'] = array();
         foreach ($this->model_catalog_product->getProductOptions($this->request->get['product_id']) as $option) {
             if ($option['type'] == 'select' || $option['type'] == 'radio' || $option['type'] == 'checkbox' || $option['type'] == 'image') {
                 $option_value_data = array();
                 foreach ($option['option_value'] as $option_value) {
                     if (!$option_value['subtract'] || $option_value['quantity'] > 0) {
                         if (($this->config->get('config_customer_price') && $this->customer->isLogged() || !$this->config->get('config_customer_price')) && (double) $option_value['price']) {
                             $price = $this->currency->format($this->tax->calculate($option_value['price'], $product_info['tax_class_id'], $this->config->get('config_tax')));
                         } else {
                             $price = false;
                         }
                         $option_value_data[] = array('product_option_value_id' => $option_value['product_option_value_id'], 'option_value_id' => $option_value['option_value_id'], 'name' => $option_value['name'], 'image' => $this->model_tool_image->onesize($option_value['image'], 50, 50), 'price' => $price, 'price_text' => $option_value['price'], 'price1' => $option_value['price'] - $price_date1, 'price2' => $option_value['price'] - $price_date2, 'price3' => $option_value['price'] - $price_date3, 'price12' => $option_value['price'] - $price_date12, 'price22' => $option_value['price'] - $price_date22, 'price32' => $option_value['price'] - $price_date32, 'price_prefix' => '');
                     }
                 }
                 /*Check Ve May Bay		*/
                 if ($option['class'] == 1) {
                     $this->data['check_maybay'] = true;
                 }
                 /*Check Vé tàu*/
                 if ($option['class'] == 3) {
                     $this->data['check_vetau'] = true;
                 }
                 $this->data['options'][] = array('product_option_id' => $option['product_option_id'], 'option_id' => $option['option_id'], 'name' => $option['name'], 'type' => $option['type'], 'category' => $option['category'], 'class' => $option['class'], 'option_value' => $option_value_data, 'required' => $option['required']);
             } elseif ($option['type'] == 'text' || $option['type'] == 'textarea' || $option['type'] == 'file' || $option['type'] == 'date' || $option['type'] == 'datetime' || $option['type'] == 'time') {
                 $this->data['options'][] = array('product_option_id' => $option['product_option_id'], 'option_id' => $option['option_id'], 'name' => $option['name'], 'type' => $option['type'], 'category' => $option['category'], 'class' => $option['class'], 'option_value' => $option['option_value'], 'required' => $option['required']);
             }
         }
         if ($product_info['minimum']) {
             $this->data['minimum'] = $product_info['minimum'];
         } else {
             $this->data['minimum'] = 1;
         }
         if ($product_info['delay_book']) {
             $this->data['day'] = date($this->language->get('date_format_short'), time() + $product_info['delay_book'] * 86400);
         } else {
             $this->data['day'] = date($this->language->get('date_format_short'), time());
         }
         $this->data['delay_book'] = (int) $product_info['delay_book'];
         $this->data['product_type'] = (int) $product_info['product_type'];
         $this->data['product_class'] = (int) $product_info['product_class'];
         $this->data['promotion_date_start'] = $this->language->get('promotion_date_start');
         $this->data['promotion_date_end'] = $this->language->get('promotion_date_end');
         $this->data['promotion1_date_start'] = $this->language->get('promotion1_date_start');
         $this->data['promotion1_date_end'] = $this->language->get('promotion1_date_end');
         $this->data['review_status'] = $this->config->get('config_review_status');
         $this->data['reviews'] = sprintf($this->language->get('text_reviews'), (int) $product_info['reviews']);
         $this->data['rating'] = (int) $product_info['rating'];
         $this->data['description'] = html_entity_decode($product_info['description'], ENT_QUOTES, 'UTF-8');
         $this->data['attribute_groups'] = $this->model_catalog_product->getProductAttributes($this->request->get['product_id']);
         $this->data['url'] = $this->url->link('product/product', 'path=' . $product_info['custom_link'] . '&product_id=' . $this->request->get['product_id']);
         $this->data['review_no'] = $product_info['reviews'];
         $this->data['quantity'] = $product_info['quantity'];
         $this->data['shortdescription'] = html_entity_decode($product_info['shortdescription'], ENT_QUOTES, 'UTF-8');
         $this->data['highlights'] = html_entity_decode($product_info['highlights'], ENT_QUOTES, 'UTF-8');
         $this->data['included'] = html_entity_decode($product_info['included'], ENT_QUOTES, 'UTF-8');
         $this->data['notincluded'] = html_entity_decode($product_info['notincluded'], ENT_QUOTES, 'UTF-8');
         $this->data['info'] = html_entity_decode($product_info['info'], ENT_QUOTES, 'UTF-8');
         $this->data['meeting'] = html_entity_decode($product_info['meeting'], ENT_QUOTES, 'UTF-8');
         $this->data['terms'] = html_entity_decode($product_info['terms'], ENT_QUOTES, 'UTF-8');
         $this->data['suggest'] = html_entity_decode($product_info['suggest'], ENT_QUOTES, 'UTF-8');
         $this->data['payment_content'] = html_entity_decode($this->config->get('payment_content'), ENT_QUOTES, 'UTF-8');
         $this->data['payment_menu'] = html_entity_decode($this->config->get('payment_menu'), ENT_QUOTES, 'UTF-8');
         $this->data['product_details'] = array();
         $product_details = $this->model_catalog_product->getProductDetails($this->request->get['product_id']);
         $this->load->model('catalog/attribute_meal');
         $this->data['check_menu'] = false;
         foreach ($product_details as $product_detail) {
             if ($product_detail['image'] && file_exists(DIR_IMAGE . $product_detail['image'])) {
                 $image = $product_detail['image'];
             } else {
                 $image = 'no_image.jpg';
             }
             $product_detail_meals = array();
             $attribute_meal_info = $this->model_catalog_attribute_meal->getAttributeMeals();
             foreach ($attribute_meal_info as $result) {
                 $s = $this->model_catalog_product->getProductDetailMeal($product_detail['product_detail_id'], $result['attribute_meal_id']);
                 if ($s) {
                     $product_detail_meals[] = array('attribute_meal_id' => $result['attribute_meal_id'], 'image' => HTTP_SERVER . 'image/' . $result['image'], 'name' => $result['name']);
                 }
             }
             if ($product_detail['menu']) {
                 $this->data['check_menu'] = true;
             }
             $this->data['product_details'][] = array('product_detail_id' => $product_detail['product_detail_id'], 'meals' => $product_detail_meals, 'label' => $product_detail['label'], 'title' => $product_detail['title'], 'text' => html_entity_decode($product_detail['text'], ENT_QUOTES, 'UTF-8'), 'menu' => html_entity_decode($product_detail['menu'], ENT_QUOTES, 'UTF-8'), 'image' => $image, 'thumb' => $this->model_tool_image->cropsize($image, $this->config->get('config_image_thumb_width'), $this->config->get('config_image_thumb_height')), 'status' => $product_detail['status'], 'sort_order' => $product_detail['sort_order']);
         }
         /*Attribute Meal*/
         $this->data['attribute_meals'] = array();
         $attribute_meal_info = $this->model_catalog_attribute_meal->getAttributeMeals();
         foreach ($attribute_meal_info as $result) {
             $this->data['attribute_meals'][] = array('attribute_meal_id' => $result['attribute_meal_id'], 'image' => HTTP_SERVER . 'image/' . $result['image'], 'name' => $result['name']);
         }
         $this->load->model('account/customer');
         if ($this->customer->isLogged()) {
             $customer_info = $this->model_account_customer->getCustomer($this->customer->getId());
             $this->data['customer_name'] = $customer_info['lastname'] . ' ' . $customer_info['firstname'];
         } else {
             $this->data['customer_name'] = false;
         }
         $this->data['products'] = array();
         $results = $this->model_catalog_product->getProductRelated($this->request->get['product_id']);
         foreach ($results as $result) {
             if ($result['image']) {
                 $image = $this->model_tool_image->onesize($result['image'], $this->config->get('config_image_related_width'), $this->config->get('config_image_related_height'));
                 $tooltip = $this->model_tool_image->onesize($result['image'], $this->config->get('config_image_popup_width'), $this->config->get('config_image_popup_height'));
             } else {
                 $image = false;
                 $tooltip = false;
             }
             if ($this->config->get('config_customer_price') && $this->customer->isLogged() || !$this->config->get('config_customer_price')) {
                 $price = $this->currency->format($this->tax->calculate($result['price'], $result['tax_class_id'], $this->config->get('config_tax')));
             } else {
                 $price = false;
             }
             if ((double) $result['special']) {
                 $special = $this->currency->format($this->tax->calculate($result['special'], $result['tax_class_id'], $this->config->get('config_tax')));
             } else {
                 $special = false;
             }
             if ($this->config->get('config_review_status')) {
                 $rating = (int) $result['rating'];
             } else {
                 $rating = false;
             }
             $this->data['products'][] = array('product_id' => $result['product_id'], 'thumb' => $image, 'tooltip' => $tooltip, 'name' => $result['name'], 'price' => $price, 'special' => $special, 'rating' => $rating, 'reviews' => sprintf($this->language->get('text_reviews'), (int) $result['reviews']), 'href' => $this->url->link('product/product', 'product_id=' . $result['product_id']));
         }
         $data = array('product_id' => $product_id, 'filter_duration' => $product_info['duration'], 'filter_category' => $product_info['custom_breadcrumb']);
         $this->data['products_orther'] = array();
         $results = $this->model_catalog_product->getOrtherProducts($data);
         /*var_dump($results)*/
         shuffle($results);
         $results = array_slice($results, 0, 6);
         foreach ($results as $result) {
             if ($result['image']) {
                 $image = $this->model_tool_image->onesize($result['image'], $this->config->get('config_image_related_width'), $this->config->get('config_image_related_height'));
                 $tooltip = $this->model_tool_image->onesize($result['image'], $this->config->get('config_image_popup_width'), $this->config->get('config_image_popup_height'));
             } else {
                 $image = false;
                 $tooltip = false;
             }
             if ($this->config->get('config_customer_price') && $this->customer->isLogged() || !$this->config->get('config_customer_price') && $result['price'] != 0) {
                 $price = $this->currency->format($this->tax->calculate($result['price'], $result['tax_class_id'], $this->config->get('config_tax')));
             } else {
                 $price = false;
             }
             if ((double) $result['special']) {
                 $special = $this->currency->format($this->tax->calculate($result['special'], $result['tax_class_id'], $this->config->get('config_tax')));
             } else {
                 $special = false;
             }
             if ($this->config->get('config_review_status')) {
                 $rating = (int) $result['rating'];
             } else {
                 $rating = false;
             }
             if (isset($result['custom_link'])) {
                 $custom_link = '&path=' . $result['custom_link'];
             }
             $this->data['products_orther'][] = array('product_id' => $result['product_id'], 'thumb' => $image, 'tooltip' => $tooltip, 'name' => cutString($result['name'], 20), 'full_name' => $result['name'], 'model' => $result['model'], 'start_time' => $result['start_time'], 'start_time_holiday' => $result['start_time_holiday'], 'start_time_tet' => $result['start_time_tet'], 'departure' => $result['departure'], 'location_to' => $result['location_to'], 'location_from' => $result['location_from'], 'transport' => $result['transport'], 'duration' => $result['duration'], 'schedule' => $result['schedule'], 'product_type' => $result['product_type'], 'price' => $price ? $price : $this->language->get('text_contact'), 'special' => $special, 'rating' => $rating, 'reviews' => sprintf($this->language->get('text_reviews'), (int) $result['reviews']), 'href' => $this->url->link('product/product', $custom_link . '&product_id=' . $result['product_id']));
         }
         /*Tags*/
         $this->load->model('catalog/tag');
         $this->data['tags'] = array();
         $tags = $this->model_catalog_product->getTags($product_info['product_id']);
         foreach ($tags as $item) {
             $result = $this->model_catalog_tag->getTag($item['tag_id']);
             if ($result) {
                 $this->data['tags'][] = array('name' => $result['name_menu'] ? $result['name_menu'] : $result['name'], 'href' => $this->url->link('product/tag', 'tag_id=' . $result['tag_id']));
             }
         }
         $this->data['text_payment_profile'] = $this->language->get('text_payment_profile');
         $this->data['profiles'] = $this->model_catalog_product->getProfiles($product_info['product_id']);
         $this->model_catalog_product->updateViewed($this->request->get['product_id']);
         if ($product_info['product_type'] == 0) {
             if (file_exists(DIR_TEMPLATE . $this->config->get('config_template') . '/template/product/product.tpl')) {
                 $this->template = $this->config->get('config_template') . '/template/product/product.tpl';
             } else {
                 $this->template = 'default/template/product/product.tpl';
             }
         }
         if ($product_info['product_type'] == 1) {
             if (file_exists(DIR_TEMPLATE . $this->config->get('config_template') . '/template/product/openbus.tpl')) {
                 $this->template = $this->config->get('config_template') . '/template/product/openbus.tpl';
             } else {
                 $this->template = 'default/template/product/openbus.tpl';
             }
         } elseif ($product_info['product_type'] == 2) {
             if (file_exists(DIR_TEMPLATE . $this->config->get('config_template') . '/template/product/car_rent.tpl')) {
                 $this->template = $this->config->get('config_template') . '/template/product/car_rent.tpl';
             } else {
                 $this->template = 'default/template/product/car_rent.tpl';
             }
         }
         $this->children = array('common/column_left', 'common/column_right', 'common/content_top', 'common/content_bottom', 'common/footer', 'common/header', 'module/comment');
         $this->response->setOutput($this->render());
     } else {
         $url = '';
         if (isset($this->request->get['path'])) {
             $url .= '&path=' . $this->request->get['path'];
         }
         if (isset($this->request->get['filter'])) {
             $url .= '&filter=' . $this->request->get['filter'];
         }
         if (isset($this->request->get['manufacturer_id'])) {
             $url .= '&manufacturer_id=' . $this->request->get['manufacturer_id'];
         }
         if (isset($this->request->get['search'])) {
             $url .= '&search=' . $this->request->get['search'];
         }
         if (isset($this->request->get['tag'])) {
             $url .= '&tag=' . $this->request->get['tag'];
         }
         if (isset($this->request->get['description'])) {
             $url .= '&description=' . $this->request->get['description'];
         }
         if (isset($this->request->get['category_id'])) {
             $url .= '&category_id=' . $this->request->get['category_id'];
         }
         if (isset($this->request->get['sub_category'])) {
             $url .= '&sub_category=' . $this->request->get['sub_category'];
         }
         if (isset($this->request->get['sort'])) {
             $url .= '&sort=' . $this->request->get['sort'];
         }
         if (isset($this->request->get['order'])) {
             $url .= '&order=' . $this->request->get['order'];
         }
         if (isset($this->request->get['page'])) {
             $url .= '&page=' . $this->request->get['page'];
         }
         if (isset($this->request->get['limit'])) {
             $url .= '&limit=' . $this->request->get['limit'];
         }
         $this->data['breadcrumbs'][] = array('text' => $this->language->get('text_error'), 'href' => $this->url->link('product/product', $url . '&product_id=' . $product_id), 'separator' => $this->language->get('text_separator'));
         $this->document->setTitle($this->language->get('text_error'));
         $this->data['heading_title'] = $this->language->get('text_error');
         $this->data['text_error'] = $this->language->get('text_error');
         $this->data['button_continue'] = $this->language->get('button_continue');
         $this->data['continue'] = $this->url->link('common/home');
         $this->response->addHeader($this->request->server['SERVER_PROTOCOL'] . '/1.1 404 Not Found');
         if (file_exists(DIR_TEMPLATE . $this->config->get('config_template') . '/template/error/not_found.tpl')) {
             $this->template = $this->config->get('config_template') . '/template/error/not_found.tpl';
         } else {
             $this->template = 'default/template/error/not_found.tpl';
         }
         $this->children = array('common/column_left', 'common/column_right', 'common/content_top', 'common/content_bottom', 'common/footer', 'common/header');
         $this->response->setOutput($this->render());
     }
 }
コード例 #24
0
ファイル: media.function.php プロジェクト: tech-nik89/lpm4
function listMovies($categoryid)
{
    global $db;
    $tbl_mov = MYSQL_TABLE_PREFIX . 'media_movies';
    $c = (int) $categoryid;
    $list = $db->selectList($tbl_mov, "*", "`categoryid`=" . $c, "`name` ASC");
    if (count($list) > 0) {
        foreach ($list as $i => $l) {
            $list[$i]['url'] = makeURL('media', array('categoryid' => $categoryid, 'movieid' => $l['movieid']));
            $list[$i]['description'] = cutString($l['description']);
        }
    }
    return $list;
}
コード例 #25
0
</a>
                                                </span><?php 
        echo $counttxt;
        ?>
                                            </div>
                                        </td>
                                        <td class="text-center" width="9%" class="listing"><?php 
        echo date("d/m/Y  H:i", strtotime($row["dLastAttempted"]));
        ?>
</td>
                                        <td class="text-center" width="12%"><?php 
        echo utf8_encode($row["sector_nombre"]);
        ?>
</td>
                                        <td class="text-center" width="12%"><?php 
        echo cutString(utf8_encode($row["tramite_nombre"]), 30);
        ?>
</td>
                                        <td class="text-center"><span class="badge"><?php 
        echo $row['respuestas'];
        ?>
</span></td>
                                    </tr>

                                    <?php 
        $cntr++;
        $count++;
        $newcount++;
    }
} else {
    ?>
コード例 #26
0
 /**
  * @desc Searches Twitter.com For Trends and gets the tweets and Updates Your Status                
  * @param null 
  * @since 04.11.2009
  * @acces Public 
  * @author  Faruk Yagbasan <*****@*****.**>
  * @return Null
  */
 public function tweetTrends($addTrendsToDB = true)
 {
     $trends = $this->trends();
     if (empty($trends)) {
         return false;
     }
     $messages = $this->searchFor($trends[rand(0, 9)]);
     for ($i = 0; $i < count($messages); $i++) {
         try {
             if ($addTrendsToDB) {
                 $tweets['tweet'] = $messages[$i];
                 //remember this tweet is the table field in the database
                 !$this->db->query_insert($this->DBTable, $tweets) ? $this->logger->error('ERROR on Insert Trends To DB') : $this->logger->error('Something is Wrong');
             }
             $this->twitter->updateStatus(cutString($messages[$i], 140)) ? $this->logger->debug('updating status') : $this->logger->error('Couldnt Update status');
         } catch (Exception $e) {
             $this->logger->error('' . $e->getMessage() . 'Cant Update Status :\\n' . $messages[$i]);
         }
     }
     unset($messages);
 }
コード例 #27
0
ファイル: product-block.php プロジェクト: birny/shop
" alt="">
                            <div class="caption">
                                <h4 class="pull-right"><?php 
echo $product['price'];
?>
 €</h4>
                                <h4><a href="product.php?id=<?php 
echo $product['id'];
?>
"><?php 
echo cutString($product['name'], 20);
?>
</a>
                                </h4>
                                <p><?php 
echo cutString($product['description'], 50);
?>
</p>
                            </div>
                            <div class="ratings">
                                <?php 
echo getProductRating($product['rating'], mt_rand(0, 15));
?>
                            </div>
                            <div class="btns clearfix">
                                <a class="btn btn-info pull-left" href="product.php?id=<?php 
echo $product['id'];
?>
"><span class="glyphicon glyphicon-eye-open"></span> View</a>
                                <a class="btn btn-primary pull-right" href="product.php?id=<?php 
echo $product['id'];
コード例 #28
0
function demandTickets($xml = "", $q_filter = "", $q_searchw = "", $q_searchf = "", $c_total = 0, $c_totalread = 0, $c_totalquery = 0, $c_lmc = 0, $c_name = "", $c_text = "", $loads = 0)
{
    $permission = Server::$Operators[CALLER_SYSTEM_ID]->GetPermission(PERMISSION_TICKETS);
    if ($permission != PERMISSION_NONE) {
        if (!CacheManager::IsDataUpdate(POST_INTERN_DUT_TICKETS, DATA_UPDATE_KEY_TICKETS) && CacheManager::$DataUpdateTimes[DATA_UPDATE_KEY_TICKETS] != 0) {
            return;
        }
        if (!isset($_POST["p_dt_c_id"])) {
            $_POST["p_dt_c_id"] = $_POST["p_dt_u_id"] = "";
        }
        if (!empty($_POST["p_dt_q"])) {
            unset($_POST["p_dt_f"], $_POST["p_dt_fc"], $_POST["p_dt_fp"], $_POST["p_dt_fg"]);
        }
        if (!isset($_POST["p_dt_f"])) {
            $_POST["p_dt_f"] = "0123";
        } else {
            if ($_POST["p_dt_f"] == "") {
                $_POST["p_dt_f"] = "9";
            }
        }
        if (!isset($_POST["p_dt_fc"])) {
            $_POST["p_dt_fc"] = "01234567";
        } else {
            if ($_POST["p_dt_fc"] == "") {
                $_POST["p_dt_fc"] = "9";
            }
        }
        $loads = !empty($_POST["p_dt_l"]) && is_numeric($_POST["p_dt_l"]) ? $_POST["p_dt_l"] : DATA_DEMAND_LOADS;
        $limit = !empty($_POST["p_dt_p"]) && is_numeric($_POST["p_dt_p"]) && $_POST["p_dt_p"] > 1 ? ($_POST["p_dt_p"] - 1) * $loads : 0;
        $q_sort = array();
        $q_sort["id"] = " AND `deleted`=0 GROUP BY `" . DB_PREFIX . DATABASE_TICKETS . "`.`id` ORDER BY `" . DB_PREFIX . DATABASE_TICKETS . "`.`id` " . (!empty($_POST["p_dt_s_d"]) ? $_POST["p_dt_s_d"] : "DESC");
        $q_sort["update"] = " AND `deleted`=0 GROUP BY `" . DB_PREFIX . DATABASE_TICKETS . "`.`id` ORDER BY `" . DB_PREFIX . DATABASE_TICKETS . "`.`last_update` " . (!empty($_POST["p_dt_s_d"]) ? $_POST["p_dt_s_d"] : "DESC");
        $q_sort["wait"] = " AND `deleted`=0 GROUP BY `" . DB_PREFIX . DATABASE_TICKETS . "`.`id` ORDER BY `" . DB_PREFIX . DATABASE_TICKETS . "`.`wait_begin` " . (!empty($_POST["p_dt_s_d"]) ? $_POST["p_dt_s_d"] : "ASC");
        $sort_index = !empty($_POST["p_dt_s"]) && !empty($q_sort[$_POST["p_dt_s"]]) ? $_POST["p_dt_s"] : "id";
        if (!(!empty($_POST["p_dt_mr"]) && is_numeric($_POST["p_dt_mr"]))) {
            $max_last_update_read = time() - 14 * 86400;
        } else {
            $max_last_update_read = $_POST["p_dt_mr"];
        }
        $fchars = str_split($_POST["p_dt_f"]);
        foreach ($fchars as $fchar) {
            if (is_numeric($fchar)) {
                if (!empty($fchar)) {
                    $q_filter .= empty($q_filter) ? " `te`.`status`=" . $fchar : " OR `te`.`status`=" . $fchar;
                } else {
                    $q_filter .= empty($q_filter) ? " `te`.`status` IS NULL OR `te`.`status`=0" : " OR `te`.`status` IS NULL OR `te`.`status`=0";
                }
            }
        }
        $fchars = str_split($_POST["p_dt_fc"]);
        $q_filter_channel = "";
        foreach ($fchars as $fchar) {
            if (is_numeric($fchar)) {
                if (!empty($fchar)) {
                    $q_filter_channel .= empty($q_filter_channel) ? "`creation_type`=" . $fchar : " OR `creation_type`=" . $fchar;
                } else {
                    $q_filter_channel .= empty($q_filter_channel) ? "`creation_type` IS NULL OR `creation_type`=0" : " OR `creation_type` IS NULL OR `creation_type`=0";
                }
            }
        }
        $q_filter = empty($q_filter) ? $q_filter_channel : "(" . $q_filter . ") AND ( " . $q_filter_channel . ")";
        if (!empty($_POST["p_dt_fp"])) {
            if (empty($q_filter)) {
                $q_filter .= "`te`.`editor_id`='" . DBManager::RealEscape(CALLER_SYSTEM_ID) . "'";
            } else {
                $q_filter = "(" . $q_filter . ") AND `te`.`editor_id`='" . DBManager::RealEscape(CALLER_SYSTEM_ID) . "'";
            }
        }
        if (!empty($_POST["p_dt_fg"]) && $permission == PERMISSION_FULL) {
            if (empty($q_filter)) {
                $q_filter .= "`target_group_id` IN ('" . implode("','", Server::$Operators[CALLER_SYSTEM_ID]->Groups) . "')";
            } else {
                $q_filter = "(" . $q_filter . ") AND `target_group_id` IN ('" . implode("','", Server::$Operators[CALLER_SYSTEM_ID]->Groups) . "')";
            }
        }
        if (!empty($_POST["p_dt_q"])) {
            $q = DBManager::RealEscape(strtolower($_POST["p_dt_q"]), true);
            $q_searchf = " LEFT JOIN `" . DB_PREFIX . DATABASE_TICKET_CUSTOMS . "` AS `tc` ON `" . DB_PREFIX . DATABASE_TICKETS . "`.`id`=`tc`.`ticket_id`";
            $q_searchf .= " LEFT JOIN `" . DB_PREFIX . DATABASE_TICKET_MESSAGES . "` AS `tm` ON `" . DB_PREFIX . DATABASE_TICKETS . "`.`id`=`tm`.`ticket_id` ";
            $q_searchf .= " LEFT JOIN `" . DB_PREFIX . DATABASE_OPERATORS . "` AS `do` ON `te`.`editor_id`=`do`.`system_id` ";
            $q_searchw = "LOWER(`" . DB_PREFIX . DATABASE_TICKETS . "`.`hash`) LIKE '%" . $q . "%' OR LOWER(`do`.`fullname`) LIKE '%" . $q . "%' OR `tm`.`sender_id` LIKE '%" . $q . "%' OR `tm`.`ticket_id` LIKE '%" . $q . "%' OR LOWER(`tc`.`value`) LIKE '%" . $q . "%' OR LOWER(`tm`.`text`) LIKE '%" . $q . "%' OR LOWER(`tm`.`fullname`) LIKE '%" . $q . "%'  OR LOWER(`tm`.`email`) LIKE '%" . $q . "%' OR LOWER(`tm`.`company`) LIKE '%" . $q . "%' OR LOWER(`tm`.`phone`) LIKE '%" . $q . "%' OR LOWER(`tm`.`subject`) LIKE '%" . $q . "%'";
            if (!empty($_POST["p_dt_q_e"])) {
                $q_e = DBManager::RealEscape(strtolower($_POST["p_dt_q_e"]));
                $emails = explode(",", $q_e);
                foreach ($emails as $email) {
                    $q_searchw .= " OR LOWER(`tm`.`email`) LIKE '%" . DBManager::RealEscape(trim($email), true) . "%'";
                }
            }
            $q_searchw = " AND (" . $q_searchw . ")";
        }
        Server::InitDataBlock(array("INPUTS"));
        $q_grperm = $permission == PERMISSION_FULL ? "" : "`target_group_id` IN ('" . implode("','", Server::$Operators[CALLER_SYSTEM_ID]->Groups) . "') AND ";
        $q_inner = "FROM `" . DB_PREFIX . DATABASE_TICKETS . "` LEFT JOIN `" . DB_PREFIX . DATABASE_TICKET_EDITORS . "` AS `te` ON `" . DB_PREFIX . DATABASE_TICKETS . "`.`id`=`te`.`ticket_id` " . $q_searchf . "WHERE " . $q_grperm . "`deleted`=0 AND (" . $q_filter . ")" . $q_searchw . $q_sort[$sort_index];
        $result = DBManager::Execute(true, $d = "SELECT * " . $q_inner . " LIMIT " . $limit . "," . DBManager::RealEscape($loads) . ";");
        if ($result) {
            while ($row = DBManager::FetchArray($result)) {
                $ticket = new Ticket($row, null, null);
                $ticket->LoadLogs();
                if (count($ticket->Messages) > 0) {
                    $xml .= $ticket->GetXML(true, true);
                }
            }
        }
        $q_grperm = $permission == PERMISSION_FULL ? "" : " WHERE `target_group_id` IN ('" . implode("','", Server::$Operators[CALLER_SYSTEM_ID]->Groups) . "')";
        $q_count["total"] = "SELECT COUNT(*) AS `total`";
        $q_count["totalperm"] = "(SELECT COUNT(*) FROM (SELECT `" . DB_PREFIX . DATABASE_TICKETS . "`.`id` FROM `" . DB_PREFIX . DATABASE_TICKETS . "`" . $q_grperm . ") AS `sta`) AS `totalperm`";
        $q_count["totalquery"] = "(SELECT COUNT(*) FROM (SELECT `" . DB_PREFIX . DATABASE_TICKETS . "`.`id` " . $q_inner . ") AS `stb`) AS `totalquery`";
        $q_count["totalread"] = Server::$Operators[CALLER_SYSTEM_ID]->ClientWeb ? ",(SELECT COUNT(*) FROM `" . DB_PREFIX . DATABASE_TICKETS . "` WHERE `deleted`=0 AND `last_update`>" . DBManager::RealEscape($max_last_update_read) . ") AS `totalread`" : "";
        $result = DBManager::Execute(true, $q_count["total"] . "," . $q_count["totalperm"] . "," . $q_count["totalquery"] . $q_count["totalread"] . " FROM `" . DB_PREFIX . DATABASE_TICKETS . "` WHERE `deleted`=0;");
        $row = DBManager::FetchArray($result);
        if (!isset($row["totalread"])) {
            $row["totalread"] = 0;
        }
        $c_total = min($row["total"], $row["totalperm"]);
        $c_totalread = min($row["totalread"], $row["totalperm"]);
        $c_totalquery = min($row["totalquery"], $row["totalperm"]);
        $q_grperm = $permission == PERMISSION_FULL ? "" : "`target_group_id` IN ('" . implode("','", Server::$Operators[CALLER_SYSTEM_ID]->Groups) . "') AND ";
        $result = DBManager::Execute(true, "SELECT `t1`.`last_update` AS `lmc`,`fullname`,`text` FROM `" . DB_PREFIX . DATABASE_TICKETS . "` AS `t1` INNER JOIN `" . DB_PREFIX . DATABASE_TICKET_MESSAGES . "` AS `t2` ON `t1`.`id`=`t2`.`ticket_id` WHERE " . $q_grperm . "(`t2`.`type`=0 OR `t2`.`type`=3) ORDER BY `t1`.`last_update` DESC LIMIT 1;");
        if ($result && ($row = DBManager::FetchArray($result))) {
            $c_lmc = $row["lmc"];
            $c_name = cutString($row["fullname"], 90);
            $c_text = cutString($row["text"], 90);
        }
    }
    Server::$Response->Messages .= "<dt u=\"" . base64_encode($_POST["p_dt_u_id"]) . "\" c=\"" . base64_encode($_POST["p_dt_c_id"]) . "\" dut=\"" . base64_encode(CacheManager::$DataUpdateTimes[DATA_UPDATE_KEY_TICKETS]) . "\" lmc=\"" . base64_encode($c_lmc) . "\" lmn=\"" . base64_encode($c_name) . "\" lmt=\"" . base64_encode($c_text) . "\" p=\"" . base64_encode($loads) . "\" t=\"" . base64_encode($c_total) . "\" r=\"" . base64_encode($c_totalread) . "\" q=\"" . base64_encode($c_totalquery) . "\">\r\n" . $xml . "\r\n</dt>";
}
コード例 #29
0
ファイル: duonglich.php プロジェクト: bamboo0079/shopcart
 public function index()
 {
     $this->language->load('promotion/duonglich');
     $this->load->model('catalog/product');
     $this->load->model('catalog/tag');
     $this->load->model('tool/image');
     $this->data['breadcrumbs'] = array();
     $this->data['breadcrumbs'][] = array('text' => $this->language->get('text_home'), 'href' => $this->url->link('common/home'), 'separator' => false);
     $this->data['breadcrumbs'][] = array('text' => $this->config->get('khtetduonglich_title'), 'href' => $this->url->link('promotion/duonglich'), 'separator' => $this->language->get('text_separator'));
     $this->document->setTitle($this->config->get('khtetduonglich_customtitle'));
     $this->document->setDescription($this->config->get('khtetduonglich_metadesc'));
     $this->document->setKeywords($this->config->get('khtetduonglich_metakey'));
     $this->data['heading_title'] = $this->config->get('khtetduonglich_title');
     $this->data['url'] = $this->url->link('promotion/duonglich');
     $this->data['desc'] = html_entity_decode($this->config->get('khtetduonglich_desc'), ENT_QUOTES, 'UTF-8');
     $this->document->addScript('catalog/view/javascript/jquery/tabs.js');
     $this->document->addScript('catalog/view/javascript/jquery/colorbox/jquery.colorbox-min.js');
     $this->document->addStyle('catalog/view/javascript/jquery/colorbox/colorbox.css');
     $this->document->addScript('catalog/view/javascript/jquery/jquery.jcarousel.min.js');
     if (file_exists('catalog/view/theme/' . $this->config->get('config_template') . '/stylesheet/carousel.css')) {
         $this->document->addStyle('catalog/view/theme/' . $this->config->get('config_template') . '/stylesheet/carousel.css');
     } else {
         $this->document->addStyle('catalog/view/theme/default/stylesheet/carousel.css');
     }
     $this->data['text_local_start_1'] = $this->language->get('text_local_start_1');
     $this->data['text_local_start_2'] = $this->language->get('text_local_start_2');
     $this->data['text_local_start_3'] = $this->language->get('text_local_start_3');
     $this->data['text_promotion_content_label'] = $this->language->get('text_promotion_content_label');
     $this->data['even_date'] = 2;
     $this->data['text_name'] = $this->language->get('text_name');
     $this->data['text_price'] = $this->language->get('text_price');
     $this->data['text_start_time_holiday'] = $this->language->get('text_start_time_holiday');
     $this->data['text_top'] = $this->language->get('text_top');
     $this->data['text_promotion'] = $this->language->get('text_promotion');
     $this->data['text_location'] = $this->language->get('text_location');
     $this->data['text_sg'] = $this->language->get('text_sg');
     $this->data['text_dn'] = $this->language->get('text_dn');
     $this->data['text_hn'] = $this->language->get('text_hn');
     $this->data['text_saigon'] = $this->language->get('text_saigon');
     $this->data['text_danang'] = $this->language->get('text_danang');
     $this->data['text_hanoi'] = $this->language->get('text_hanoi');
     $this->data['text_list_location'] = $this->language->get('text_list_location');
     $this->data['entry_price'] = $this->language->get('entry_price');
     $this->data['entry_duration'] = $this->language->get('entry_duration');
     $this->data['entry_start_time'] = $this->language->get('entry_start_time');
     $this->data['entry_start_time_holiday'] = $this->language->get('entry_start_time_holiday');
     $this->data['entry_start_time_tet'] = $this->language->get('entry_start_time_tet');
     /**********************cats**********************/
     $cat_id_promotion = 275;
     $this->data['cats'] = array();
     $cats = $this->model_catalog_tag->getTags($cat_id_promotion);
     foreach ($cats as $item) {
         if ($item['image'] && file_exists(DIR_IMAGE . $item['image'])) {
             $name = $item['name_menu'] ? $item['name_menu'] : $item['name'];
             $array = array('Tour Du Lịch ', 'Tết Dương Lịch', 'Tết Dương Lịch 2016', '2016');
             $name = str_replace($array, '', $name);
             $product_total = $this->model_catalog_tag->getTotalProductByTagId($item['tag_id']);
             $this->data['cats'][] = array('id' => $item['tag_id'], 'name' => $name . ' ' . sprintf($this->language->get('text_product_total'), $product_total), 'thumb' => $this->model_tool_image->onesize($item['image'], 250, 150), 'href' => $this->url->link('product/tag', 'tag_id=' . $item['tag_id']));
         }
     }
     /**********************products1**********************/
     $this->data['products1'] = array();
     $product = explode(',', $this->config->get('khmsg1nevendl_product'));
     if ($product) {
         foreach ($product as $product_id) {
             $result = $this->model_catalog_product->getProduct($product_id);
             if ($result['image'] && file_exists(DIR_IMAGE . $result['image'])) {
                 $image = $this->model_tool_image->cropsize($result['image'], $this->config->get('config_image_product_width'), $this->config->get('config_image_product_height'));
             } else {
                 $image = $this->model_tool_image->cropsize('no_image.jpg', $this->config->get('config_image_product_width'), $this->config->get('config_image_product_width'));
             }
             if ((double) $result['special']) {
                 $special = $this->currency->format($this->tax->calculate($result['special'], $result['tax_class_id'], $this->config->get('config_tax')));
             } else {
                 $special = false;
             }
             if ((double) $result['price']) {
                 $price = $this->currency->format($this->tax->calculate($result['price'], $result['tax_class_id'], $this->config->get('config_tax')));
             } else {
                 $price = false;
             }
             if (isset($result['custom_link'])) {
                 $custom_link = '&path=' . $result['custom_link'];
             } else {
                 $custom_link = "";
             }
             //  san pham o day
             $this->data['options'] = array();
             foreach ($this->model_catalog_product->getProductOptionsDL($result['product_id']) as $option) {
                 if ($option['type'] == 'select' || $option['type'] == 'radio' || $option['type'] == 'checkbox' || $option['type'] == 'image') {
                     $option_value_data = array();
                     foreach ($option['option_value'] as $option_value) {
                         if (!$option_value['subtract'] || $option_value['quantity'] > 0) {
                             if (($this->config->get('config_customer_price') && $this->customer->isLogged() || !$this->config->get('config_customer_price')) && (double) $option_value['price']) {
                                 $price = $this->currency->format($option_value['price']);
                             } else {
                                 $price = false;
                             }
                             $option_value_data[0] = array('product_option_value_id' => $option_value['product_option_value_id'], 'option_value_id' => $option_value['option_value_id'], 'name' => $option_value['name'], 'image' => $this->model_tool_image->onesize($option_value['image'], 50, 50), 'price' => $price);
                         }
                     }
                     $option_even[] = array('product_option_id' => $option['product_option_id'], 'option_id' => $option['option_id'], 'name' => $option['name'], 'type' => $option['type'], 'category' => $option['category'], 'class' => $option['class'], 'option_value' => $option_value_data, 'required' => $option['required']);
                 }
             }
             $this->data['products1'][] = array('product_id' => $result['product_id'], 'thumb' => $image, 'name' => $result['name_tour'] ? $result['name_tour'] : $result['name'], 'name_title' => cutString($result['name_tour'] ? $result['name_tour'] : $result['name'], 16), 'model' => $result['model'], 'schedule_title' => $result['schedule'], 'schedule' => cutString($result['schedule'], 18), 'price' => $price, 'special' => $result['special'], 'duration' => $result['duration'] ? $result['duration'] : 'Nữa ngày', 'special' => $special ? $special : 'Liên hệ', 'href' => $this->url->link('product/product', $custom_link . '&product_id=' . $result['product_id']), 'product_option_id' => $option_even);
             $option_even = array();
         }
     }
     /**********************products2**********************/
     $this->data['products2'] = array();
     $product = explode(',', $this->config->get('khmsg3nevendl_product'));
     if ($product) {
         foreach ($product as $product_id) {
             $result = $this->model_catalog_product->getProduct($product_id);
             if ($result['image'] && file_exists(DIR_IMAGE . $result['image'])) {
                 $image = $this->model_tool_image->cropsize($result['image'], $this->config->get('config_image_product_width'), $this->config->get('config_image_product_height'));
             } else {
                 $image = $this->model_tool_image->cropsize('no_image.jpg', $this->config->get('config_image_product_width'), $this->config->get('config_image_product_width'));
             }
             if ((double) $result['special']) {
                 $special = $this->currency->format($this->tax->calculate($result['special'], $result['tax_class_id'], $this->config->get('config_tax')));
             } else {
                 $special = false;
             }
             if ((double) $result['price']) {
                 $price = $this->currency->format($this->tax->calculate($result['price'], $result['tax_class_id'], $this->config->get('config_tax')));
             } else {
                 $price = false;
             }
             if (isset($result['custom_link'])) {
                 $custom_link = '&path=' . $result['custom_link'];
             } else {
                 $custom_link = "";
             }
             //  san pham o day
             $this->data['options'] = array();
             foreach ($this->model_catalog_product->getProductOptionsDL($result['product_id']) as $option) {
                 if ($option['type'] == 'select' || $option['type'] == 'radio' || $option['type'] == 'checkbox' || $option['type'] == 'image') {
                     $option_value_data = array();
                     foreach ($option['option_value'] as $option_value) {
                         if (!$option_value['subtract'] || $option_value['quantity'] > 0) {
                             if (($this->config->get('config_customer_price') && $this->customer->isLogged() || !$this->config->get('config_customer_price')) && (double) $option_value['price']) {
                                 $price = $this->currency->format($option_value['price']);
                             } else {
                                 $price = false;
                             }
                             $option_value_data[0] = array('product_option_value_id' => $option_value['product_option_value_id'], 'option_value_id' => $option_value['option_value_id'], 'name' => $option_value['name'], 'image' => $this->model_tool_image->onesize($option_value['image'], 50, 50), 'price' => $price);
                         }
                     }
                     $option_even[] = array('product_option_id' => $option['product_option_id'], 'option_id' => $option['option_id'], 'name' => $option['name'], 'type' => $option['type'], 'category' => $option['category'], 'class' => $option['class'], 'option_value' => $option_value_data, 'required' => $option['required']);
                 }
             }
             $this->data['products2'][] = array('product_id' => $result['product_id'], 'thumb' => $image, 'name' => $result['name_tour'] ? $result['name_tour'] : $result['name'], 'name_title' => cutString($result['name_tour'] ? $result['name_tour'] : $result['name'], 16), 'model' => $result['model'], 'schedule_title' => $result['schedule'], 'schedule' => cutString($result['schedule'], 18), 'price' => $price, 'special' => $result['special'], 'duration' => $result['duration'] ? $result['duration'] : 'Nữa ngày', 'special' => $special ? $special : 'Liên hệ', 'href' => $this->url->link('product/product', $custom_link . '&product_id=' . $result['product_id']), 'product_option_id' => $option_even);
             $option_even = array();
         }
     }
     /**********************products3**********************/
     $this->data['products3'] = array();
     $product = explode(',', $this->config->get('khmsg6nevendl_product'));
     if ($product) {
         foreach ($product as $product_id) {
             $result = $this->model_catalog_product->getProduct($product_id);
             if ($result['image'] && file_exists(DIR_IMAGE . $result['image'])) {
                 $image = $this->model_tool_image->cropsize($result['image'], $this->config->get('config_image_product_width'), $this->config->get('config_image_product_height'));
             } else {
                 $image = $this->model_tool_image->cropsize('no_image.jpg', $this->config->get('config_image_product_width'), $this->config->get('config_image_product_width'));
             }
             if ((double) $result['special']) {
                 $special = $this->currency->format($this->tax->calculate($result['special'], $result['tax_class_id'], $this->config->get('config_tax')));
             } else {
                 $special = false;
             }
             if ((double) $result['price']) {
                 $price = $this->currency->format($this->tax->calculate($result['price'], $result['tax_class_id'], $this->config->get('config_tax')));
             } else {
                 $price = false;
             }
             if (isset($result['custom_link'])) {
                 $custom_link = '&path=' . $result['custom_link'];
             } else {
                 $custom_link = "";
             }
             //  san pham o day
             $this->data['options'] = array();
             foreach ($this->model_catalog_product->getProductOptionsDL($result['product_id']) as $option) {
                 if ($option['type'] == 'select' || $option['type'] == 'radio' || $option['type'] == 'checkbox' || $option['type'] == 'image') {
                     $option_value_data = array();
                     foreach ($option['option_value'] as $option_value) {
                         if (!$option_value['subtract'] || $option_value['quantity'] > 0) {
                             if (($this->config->get('config_customer_price') && $this->customer->isLogged() || !$this->config->get('config_customer_price')) && (double) $option_value['price']) {
                                 $price = $this->currency->format($option_value['price']);
                             } else {
                                 $price = false;
                             }
                             $option_value_data[0] = array('product_option_value_id' => $option_value['product_option_value_id'], 'option_value_id' => $option_value['option_value_id'], 'name' => $option_value['name'], 'image' => $this->model_tool_image->onesize($option_value['image'], 50, 50), 'price' => $price);
                         }
                     }
                     $option_even[] = array('product_option_id' => $option['product_option_id'], 'option_id' => $option['option_id'], 'name' => $option['name'], 'type' => $option['type'], 'category' => $option['category'], 'class' => $option['class'], 'option_value' => $option_value_data, 'required' => $option['required']);
                 }
             }
             $this->data['products3'][] = array('product_id' => $result['product_id'], 'thumb' => $image, 'name' => $result['name_tour'] ? $result['name_tour'] : $result['name'], 'name_title' => cutString($result['name_tour'] ? $result['name_tour'] : $result['name'], 16), 'model' => $result['model'], 'schedule_title' => $result['schedule'], 'schedule' => cutString($result['schedule'], 18), 'price' => $price, 'special' => $result['special'], 'duration' => $result['duration'] ? $result['duration'] : 'Nữa ngày', 'special' => $special ? $special : 'Liên hệ', 'href' => $this->url->link('product/product', $custom_link . '&product_id=' . $result['product_id']), 'product_option_id' => $option_even);
             $option_even = array();
         }
     }
     /**********************products4**********************/
     $this->data['products4'] = array();
     $product = explode(',', $this->config->get('khmmt1nevendl_product'));
     if ($product) {
         foreach ($product as $product_id) {
             $result = $this->model_catalog_product->getProduct($product_id);
             if ($result['image'] && file_exists(DIR_IMAGE . $result['image'])) {
                 $image = $this->model_tool_image->cropsize($result['image'], $this->config->get('config_image_product_width'), $this->config->get('config_image_product_height'));
             } else {
                 $image = $this->model_tool_image->cropsize('no_image.jpg', $this->config->get('config_image_product_width'), $this->config->get('config_image_product_width'));
             }
             if ((double) $result['special']) {
                 $special = $this->currency->format($this->tax->calculate($result['special'], $result['tax_class_id'], $this->config->get('config_tax')));
             } else {
                 $special = false;
             }
             if ((double) $result['price']) {
                 $price = $this->currency->format($this->tax->calculate($result['price'], $result['tax_class_id'], $this->config->get('config_tax')));
             } else {
                 $price = false;
             }
             if (isset($result['custom_link'])) {
                 $custom_link = '&path=' . $result['custom_link'];
             } else {
                 $custom_link = "";
             }
             //  san pham o day
             $this->data['options'] = array();
             foreach ($this->model_catalog_product->getProductOptionsDL($result['product_id']) as $option) {
                 if ($option['type'] == 'select' || $option['type'] == 'radio' || $option['type'] == 'checkbox' || $option['type'] == 'image') {
                     $option_value_data = array();
                     foreach ($option['option_value'] as $option_value) {
                         if (!$option_value['subtract'] || $option_value['quantity'] > 0) {
                             if (($this->config->get('config_customer_price') && $this->customer->isLogged() || !$this->config->get('config_customer_price')) && (double) $option_value['price']) {
                                 $price = $this->currency->format($option_value['price']);
                             } else {
                                 $price = false;
                             }
                             $option_value_data[0] = array('product_option_value_id' => $option_value['product_option_value_id'], 'option_value_id' => $option_value['option_value_id'], 'name' => $option_value['name'], 'image' => $this->model_tool_image->onesize($option_value['image'], 50, 50), 'price' => $price);
                         }
                     }
                     $option_even[] = array('product_option_id' => $option['product_option_id'], 'option_id' => $option['option_id'], 'name' => $option['name'], 'type' => $option['type'], 'category' => $option['category'], 'class' => $option['class'], 'option_value' => $option_value_data, 'required' => $option['required']);
                 }
             }
             $this->data['products4'][] = array('product_id' => $result['product_id'], 'thumb' => $image, 'name' => $result['name_tour'] ? $result['name_tour'] : $result['name'], 'name_title' => cutString($result['name_tour'] ? $result['name_tour'] : $result['name'], 16), 'model' => $result['model'], 'schedule_title' => $result['schedule'], 'schedule' => cutString($result['schedule'], 18), 'price' => $price, 'special' => $result['special'], 'duration' => $result['duration'] ? $result['duration'] : 'Nữa ngày', 'special' => $special ? $special : 'Liên hệ', 'href' => $this->url->link('product/product', $custom_link . '&product_id=' . $result['product_id']), 'product_option_id' => $option_even);
             $option_even = array();
         }
     }
     /**********************products5**********************/
     $this->data['products5'] = array();
     $product = explode(',', $this->config->get('khmmt3nevendl_product'));
     if ($product) {
         foreach ($product as $product_id) {
             $result = $this->model_catalog_product->getProduct($product_id);
             if ($result['image'] && file_exists(DIR_IMAGE . $result['image'])) {
                 $image = $this->model_tool_image->cropsize($result['image'], $this->config->get('config_image_product_width'), $this->config->get('config_image_product_height'));
             } else {
                 $image = $this->model_tool_image->cropsize('no_image.jpg', $this->config->get('config_image_product_width'), $this->config->get('config_image_product_width'));
             }
             if ((double) $result['special']) {
                 $special = $this->currency->format($this->tax->calculate($result['special'], $result['tax_class_id'], $this->config->get('config_tax')));
             } else {
                 $special = false;
             }
             if ((double) $result['price']) {
                 $price = $this->currency->format($this->tax->calculate($result['price'], $result['tax_class_id'], $this->config->get('config_tax')));
             } else {
                 $price = false;
             }
             if (isset($result['custom_link'])) {
                 $custom_link = '&path=' . $result['custom_link'];
             } else {
                 $custom_link = "";
             }
             //  san pham o day
             $this->data['options'] = array();
             foreach ($this->model_catalog_product->getProductOptionsDL($result['product_id']) as $option) {
                 if ($option['type'] == 'select' || $option['type'] == 'radio' || $option['type'] == 'checkbox' || $option['type'] == 'image') {
                     $option_value_data = array();
                     foreach ($option['option_value'] as $option_value) {
                         if (!$option_value['subtract'] || $option_value['quantity'] > 0) {
                             if (($this->config->get('config_customer_price') && $this->customer->isLogged() || !$this->config->get('config_customer_price')) && (double) $option_value['price']) {
                                 $price = $this->currency->format($option_value['price']);
                             } else {
                                 $price = false;
                             }
                             $option_value_data[0] = array('product_option_value_id' => $option_value['product_option_value_id'], 'option_value_id' => $option_value['option_value_id'], 'name' => $option_value['name'], 'image' => $this->model_tool_image->onesize($option_value['image'], 50, 50), 'price' => $price);
                         }
                     }
                     $option_even[] = array('product_option_id' => $option['product_option_id'], 'option_id' => $option['option_id'], 'name' => $option['name'], 'type' => $option['type'], 'category' => $option['category'], 'class' => $option['class'], 'option_value' => $option_value_data, 'required' => $option['required']);
                 }
             }
             $this->data['products5'][] = array('product_id' => $result['product_id'], 'thumb' => $image, 'name' => $result['name_tour'] ? $result['name_tour'] : $result['name'], 'name_title' => cutString($result['name_tour'] ? $result['name_tour'] : $result['name'], 16), 'model' => $result['model'], 'schedule_title' => $result['schedule'], 'schedule' => cutString($result['schedule'], 18), 'price' => $price, 'special' => $result['special'], 'duration' => $result['duration'] ? $result['duration'] : 'Nữa ngày', 'special' => $special ? $special : 'Liên hệ', 'href' => $this->url->link('product/product', $custom_link . '&product_id=' . $result['product_id']), 'product_option_id' => $option_even);
             $option_even = array();
         }
     }
     /**********************products6**********************/
     $this->data['products6'] = array();
     $product = explode(',', $this->config->get('khmmt6nevendl_product'));
     if ($product) {
         foreach ($product as $product_id) {
             $result = $this->model_catalog_product->getProduct($product_id);
             if ($result['image'] && file_exists(DIR_IMAGE . $result['image'])) {
                 $image = $this->model_tool_image->cropsize($result['image'], $this->config->get('config_image_product_width'), $this->config->get('config_image_product_height'));
             } else {
                 $image = $this->model_tool_image->cropsize('no_image.jpg', $this->config->get('config_image_product_width'), $this->config->get('config_image_product_width'));
             }
             if ((double) $result['special']) {
                 $special = $this->currency->format($this->tax->calculate($result['special'], $result['tax_class_id'], $this->config->get('config_tax')));
             } else {
                 $special = false;
             }
             if ((double) $result['price']) {
                 $price = $this->currency->format($this->tax->calculate($result['price'], $result['tax_class_id'], $this->config->get('config_tax')));
             } else {
                 $price = false;
             }
             if (isset($result['custom_link'])) {
                 $custom_link = '&path=' . $result['custom_link'];
             } else {
                 $custom_link = "";
             }
             //  san pham o day
             $this->data['options'] = array();
             foreach ($this->model_catalog_product->getProductOptionsDL($result['product_id']) as $option) {
                 if ($option['type'] == 'select' || $option['type'] == 'radio' || $option['type'] == 'checkbox' || $option['type'] == 'image') {
                     $option_value_data = array();
                     foreach ($option['option_value'] as $option_value) {
                         if (!$option_value['subtract'] || $option_value['quantity'] > 0) {
                             if (($this->config->get('config_customer_price') && $this->customer->isLogged() || !$this->config->get('config_customer_price')) && (double) $option_value['price']) {
                                 $price = $this->currency->format($option_value['price']);
                             } else {
                                 $price = false;
                             }
                             $option_value_data[0] = array('product_option_value_id' => $option_value['product_option_value_id'], 'option_value_id' => $option_value['option_value_id'], 'name' => $option_value['name'], 'image' => $this->model_tool_image->onesize($option_value['image'], 50, 50), 'price' => $price);
                         }
                     }
                     $option_even[] = array('product_option_id' => $option['product_option_id'], 'option_id' => $option['option_id'], 'name' => $option['name'], 'type' => $option['type'], 'category' => $option['category'], 'class' => $option['class'], 'option_value' => $option_value_data, 'required' => $option['required']);
                 }
             }
             $this->data['products6'][] = array('product_id' => $result['product_id'], 'thumb' => $image, 'name' => $result['name_tour'] ? $result['name_tour'] : $result['name'], 'name_title' => cutString($result['name_tour'] ? $result['name_tour'] : $result['name'], 16), 'model' => $result['model'], 'schedule_title' => $result['schedule'], 'schedule' => cutString($result['schedule'], 18), 'price' => $price, 'special' => $result['special'], 'duration' => $result['duration'] ? $result['duration'] : 'Nữa ngày', 'special' => $special ? $special : 'Liên hệ', 'href' => $this->url->link('product/product', $custom_link . '&product_id=' . $result['product_id']), 'product_option_id' => $option_even);
             $option_even = array();
         }
     }
     /**********************products7**********************/
     $this->data['products7'] = array();
     $product = explode(',', $this->config->get('khmvt1nevendl_product'));
     if ($product) {
         foreach ($product as $product_id) {
             $result = $this->model_catalog_product->getProduct($product_id);
             if ($result['image'] && file_exists(DIR_IMAGE . $result['image'])) {
                 $image = $this->model_tool_image->cropsize($result['image'], $this->config->get('config_image_product_width'), $this->config->get('config_image_product_height'));
             } else {
                 $image = $this->model_tool_image->cropsize('no_image.jpg', $this->config->get('config_image_product_width'), $this->config->get('config_image_product_width'));
             }
             if ((double) $result['special']) {
                 $special = $this->currency->format($this->tax->calculate($result['special'], $result['tax_class_id'], $this->config->get('config_tax')));
             } else {
                 $special = false;
             }
             if ((double) $result['price']) {
                 $price = $this->currency->format($this->tax->calculate($result['price'], $result['tax_class_id'], $this->config->get('config_tax')));
             } else {
                 $price = false;
             }
             if (isset($result['custom_link'])) {
                 $custom_link = '&path=' . $result['custom_link'];
             } else {
                 $custom_link = "";
             }
             //  san pham o day
             $this->data['options'] = array();
             foreach ($this->model_catalog_product->getProductOptionsDL($result['product_id']) as $option) {
                 if ($option['type'] == 'select' || $option['type'] == 'radio' || $option['type'] == 'checkbox' || $option['type'] == 'image') {
                     $option_value_data = array();
                     foreach ($option['option_value'] as $option_value) {
                         if (!$option_value['subtract'] || $option_value['quantity'] > 0) {
                             if (($this->config->get('config_customer_price') && $this->customer->isLogged() || !$this->config->get('config_customer_price')) && (double) $option_value['price']) {
                                 $price = $this->currency->format($option_value['price']);
                             } else {
                                 $price = false;
                             }
                             $option_value_data[0] = array('product_option_value_id' => $option_value['product_option_value_id'], 'option_value_id' => $option_value['option_value_id'], 'name' => $option_value['name'], 'image' => $this->model_tool_image->onesize($option_value['image'], 50, 50), 'price' => $price);
                         }
                     }
                     $option_even[] = array('product_option_id' => $option['product_option_id'], 'option_id' => $option['option_id'], 'name' => $option['name'], 'type' => $option['type'], 'category' => $option['category'], 'class' => $option['class'], 'option_value' => $option_value_data, 'required' => $option['required']);
                 }
             }
             $this->data['products7'][] = array('product_id' => $result['product_id'], 'thumb' => $image, 'name' => $result['name_tour'] ? $result['name_tour'] : $result['name'], 'name_title' => cutString($result['name_tour'] ? $result['name_tour'] : $result['name'], 16), 'model' => $result['model'], 'schedule_title' => $result['schedule'], 'schedule' => cutString($result['schedule'], 18), 'price' => $price, 'special' => $result['special'], 'duration' => $result['duration'] ? $result['duration'] : 'Nữa ngày', 'special' => $special ? $special : 'Liên hệ', 'href' => $this->url->link('product/product', $custom_link . '&product_id=' . $result['product_id']), 'product_option_id' => $option_even);
             $option_even = array();
         }
     }
     /**********************products8**********************/
     $this->data['products8'] = array();
     $product = explode(',', $this->config->get('khmvt3nevendl_product'));
     if ($product) {
         foreach ($product as $product_id) {
             $result = $this->model_catalog_product->getProduct($product_id);
             if ($result['image'] && file_exists(DIR_IMAGE . $result['image'])) {
                 $image = $this->model_tool_image->cropsize($result['image'], $this->config->get('config_image_product_width'), $this->config->get('config_image_product_height'));
             } else {
                 $image = $this->model_tool_image->cropsize('no_image.jpg', $this->config->get('config_image_product_width'), $this->config->get('config_image_product_width'));
             }
             if ((double) $result['special']) {
                 $special = $this->currency->format($this->tax->calculate($result['special'], $result['tax_class_id'], $this->config->get('config_tax')));
             } else {
                 $special = false;
             }
             if ((double) $result['price']) {
                 $price = $this->currency->format($this->tax->calculate($result['price'], $result['tax_class_id'], $this->config->get('config_tax')));
             } else {
                 $price = false;
             }
             if (isset($result['custom_link'])) {
                 $custom_link = '&path=' . $result['custom_link'];
             } else {
                 $custom_link = "";
             }
             //  san pham o day
             $this->data['options'] = array();
             foreach ($this->model_catalog_product->getProductOptionsDL($result['product_id']) as $option) {
                 if ($option['type'] == 'select' || $option['type'] == 'radio' || $option['type'] == 'checkbox' || $option['type'] == 'image') {
                     $option_value_data = array();
                     foreach ($option['option_value'] as $option_value) {
                         if (!$option_value['subtract'] || $option_value['quantity'] > 0) {
                             if (($this->config->get('config_customer_price') && $this->customer->isLogged() || !$this->config->get('config_customer_price')) && (double) $option_value['price']) {
                                 $price = $this->currency->format($option_value['price']);
                             } else {
                                 $price = false;
                             }
                             $option_value_data[0] = array('product_option_value_id' => $option_value['product_option_value_id'], 'option_value_id' => $option_value['option_value_id'], 'name' => $option_value['name'], 'image' => $this->model_tool_image->onesize($option_value['image'], 50, 50), 'price' => $price);
                         }
                     }
                     $option_even[] = array('product_option_id' => $option['product_option_id'], 'option_id' => $option['option_id'], 'name' => $option['name'], 'type' => $option['type'], 'category' => $option['category'], 'class' => $option['class'], 'option_value' => $option_value_data, 'required' => $option['required']);
                 }
             }
             $this->data['products8'][] = array('product_id' => $result['product_id'], 'thumb' => $image, 'name' => $result['name_tour'] ? $result['name_tour'] : $result['name'], 'name_title' => cutString($result['name_tour'] ? $result['name_tour'] : $result['name'], 16), 'model' => $result['model'], 'schedule_title' => $result['schedule'], 'schedule' => cutString($result['schedule'], 18), 'price' => $price, 'special' => $result['special'], 'duration' => $result['duration'] ? $result['duration'] : 'Nữa ngày', 'special' => $special ? $special : 'Liên hệ', 'href' => $this->url->link('product/product', $custom_link . '&product_id=' . $result['product_id']), 'product_option_id' => $option_even);
             $option_even = array();
         }
     }
     /**********************products9**********************/
     $this->data['products9'] = array();
     $product = explode(',', $this->config->get('khmvt6nevendl_product'));
     if ($product) {
         foreach ($product as $product_id) {
             $result = $this->model_catalog_product->getProduct($product_id);
             if ($result['image'] && file_exists(DIR_IMAGE . $result['image'])) {
                 $image = $this->model_tool_image->cropsize($result['image'], $this->config->get('config_image_product_width'), $this->config->get('config_image_product_height'));
             } else {
                 $image = $this->model_tool_image->cropsize('no_image.jpg', $this->config->get('config_image_product_width'), $this->config->get('config_image_product_width'));
             }
             if ((double) $result['special']) {
                 $special = $this->currency->format($this->tax->calculate($result['special'], $result['tax_class_id'], $this->config->get('config_tax')));
             } else {
                 $special = false;
             }
             if ((double) $result['price']) {
                 $price = $this->currency->format($this->tax->calculate($result['price'], $result['tax_class_id'], $this->config->get('config_tax')));
             } else {
                 $price = false;
             }
             if (isset($result['custom_link'])) {
                 $custom_link = '&path=' . $result['custom_link'];
             } else {
                 $custom_link = "";
             }
             //  san pham o day
             $this->data['options'] = array();
             foreach ($this->model_catalog_product->getProductOptionsDL($result['product_id']) as $option) {
                 if ($option['type'] == 'select' || $option['type'] == 'radio' || $option['type'] == 'checkbox' || $option['type'] == 'image') {
                     $option_value_data = array();
                     foreach ($option['option_value'] as $option_value) {
                         if (!$option_value['subtract'] || $option_value['quantity'] > 0) {
                             if (($this->config->get('config_customer_price') && $this->customer->isLogged() || !$this->config->get('config_customer_price')) && (double) $option_value['price']) {
                                 $price = $this->currency->format($option_value['price']);
                             } else {
                                 $price = false;
                             }
                             $option_value_data[0] = array('product_option_value_id' => $option_value['product_option_value_id'], 'option_value_id' => $option_value['option_value_id'], 'name' => $option_value['name'], 'image' => $this->model_tool_image->onesize($option_value['image'], 50, 50), 'price' => $price);
                         }
                     }
                     $option_even[] = array('product_option_id' => $option['product_option_id'], 'option_id' => $option['option_id'], 'name' => $option['name'], 'type' => $option['type'], 'category' => $option['category'], 'class' => $option['class'], 'option_value' => $option_value_data, 'required' => $option['required']);
                 }
             }
             $this->data['products9'][] = array('product_id' => $result['product_id'], 'thumb' => $image, 'name' => $result['name_tour'] ? $result['name_tour'] : $result['name'], 'name_title' => cutString($result['name_tour'] ? $result['name_tour'] : $result['name'], 16), 'model' => $result['model'], 'schedule_title' => $result['schedule'], 'schedule' => cutString($result['schedule'], 18), 'price' => $price, 'special' => $result['special'], 'duration' => $result['duration'] ? $result['duration'] : 'Nữa ngày', 'special' => $special ? $special : 'Liên hệ', 'href' => $this->url->link('product/product', $custom_link . '&product_id=' . $result['product_id']), 'product_option_id' => $option_even);
             $option_even = array();
         }
     }
     /**********************products10**********************/
     $this->data['products10'] = array();
     $product = explode(',', $this->config->get('khmpq1nevendl_product'));
     if ($product) {
         foreach ($product as $product_id) {
             $result = $this->model_catalog_product->getProduct($product_id);
             if ($result['image'] && file_exists(DIR_IMAGE . $result['image'])) {
                 $image = $this->model_tool_image->cropsize($result['image'], $this->config->get('config_image_product_width'), $this->config->get('config_image_product_height'));
             } else {
                 $image = $this->model_tool_image->cropsize('no_image.jpg', $this->config->get('config_image_product_width'), $this->config->get('config_image_product_width'));
             }
             if ((double) $result['special']) {
                 $special = $this->currency->format($this->tax->calculate($result['special'], $result['tax_class_id'], $this->config->get('config_tax')));
             } else {
                 $special = false;
             }
             if ((double) $result['price']) {
                 $price = $this->currency->format($this->tax->calculate($result['price'], $result['tax_class_id'], $this->config->get('config_tax')));
             } else {
                 $price = false;
             }
             if (isset($result['custom_link'])) {
                 $custom_link = '&path=' . $result['custom_link'];
             } else {
                 $custom_link = "";
             }
             //  san pham o day
             $this->data['options'] = array();
             foreach ($this->model_catalog_product->getProductOptionsDL($result['product_id']) as $option) {
                 if ($option['type'] == 'select' || $option['type'] == 'radio' || $option['type'] == 'checkbox' || $option['type'] == 'image') {
                     $option_value_data = array();
                     foreach ($option['option_value'] as $option_value) {
                         if (!$option_value['subtract'] || $option_value['quantity'] > 0) {
                             if (($this->config->get('config_customer_price') && $this->customer->isLogged() || !$this->config->get('config_customer_price')) && (double) $option_value['price']) {
                                 $price = $this->currency->format($option_value['price']);
                             } else {
                                 $price = false;
                             }
                             $option_value_data[0] = array('product_option_value_id' => $option_value['product_option_value_id'], 'option_value_id' => $option_value['option_value_id'], 'name' => $option_value['name'], 'image' => $this->model_tool_image->onesize($option_value['image'], 50, 50), 'price' => $price);
                         }
                     }
                     $option_even[] = array('product_option_id' => $option['product_option_id'], 'option_id' => $option['option_id'], 'name' => $option['name'], 'type' => $option['type'], 'category' => $option['category'], 'class' => $option['class'], 'option_value' => $option_value_data, 'required' => $option['required']);
                 }
             }
             $this->data['products10'][] = array('product_id' => $result['product_id'], 'thumb' => $image, 'name' => $result['name_tour'] ? $result['name_tour'] : $result['name'], 'name_title' => cutString($result['name_tour'] ? $result['name_tour'] : $result['name'], 16), 'model' => $result['model'], 'schedule_title' => $result['schedule'], 'schedule' => cutString($result['schedule'], 18), 'price' => $price, 'special' => $result['special'], 'duration' => $result['duration'] ? $result['duration'] : 'Nữa ngày', 'special' => $special ? $special : 'Liên hệ', 'href' => $this->url->link('product/product', $custom_link . '&product_id=' . $result['product_id']), 'product_option_id' => $option_even);
             $option_even = array();
         }
     }
     /**********************products11**********************/
     $this->data['products11'] = array();
     $product = explode(',', $this->config->get('khmpq3nevendl_product'));
     if ($product) {
         foreach ($product as $product_id) {
             $result = $this->model_catalog_product->getProduct($product_id);
             if ($result['image'] && file_exists(DIR_IMAGE . $result['image'])) {
                 $image = $this->model_tool_image->cropsize($result['image'], $this->config->get('config_image_product_width'), $this->config->get('config_image_product_height'));
             } else {
                 $image = $this->model_tool_image->cropsize('no_image.jpg', $this->config->get('config_image_product_width'), $this->config->get('config_image_product_width'));
             }
             if ((double) $result['special']) {
                 $special = $this->currency->format($this->tax->calculate($result['special'], $result['tax_class_id'], $this->config->get('config_tax')));
             } else {
                 $special = false;
             }
             if ((double) $result['price']) {
                 $price = $this->currency->format($this->tax->calculate($result['price'], $result['tax_class_id'], $this->config->get('config_tax')));
             } else {
                 $price = false;
             }
             if (isset($result['custom_link'])) {
                 $custom_link = '&path=' . $result['custom_link'];
             } else {
                 $custom_link = "";
             }
             //  san pham o day
             $this->data['options'] = array();
             foreach ($this->model_catalog_product->getProductOptionsDL($result['product_id']) as $option) {
                 if ($option['type'] == 'select' || $option['type'] == 'radio' || $option['type'] == 'checkbox' || $option['type'] == 'image') {
                     $option_value_data = array();
                     foreach ($option['option_value'] as $option_value) {
                         if (!$option_value['subtract'] || $option_value['quantity'] > 0) {
                             if (($this->config->get('config_customer_price') && $this->customer->isLogged() || !$this->config->get('config_customer_price')) && (double) $option_value['price']) {
                                 $price = $this->currency->format($option_value['price']);
                             } else {
                                 $price = false;
                             }
                             $option_value_data[0] = array('product_option_value_id' => $option_value['product_option_value_id'], 'option_value_id' => $option_value['option_value_id'], 'name' => $option_value['name'], 'image' => $this->model_tool_image->onesize($option_value['image'], 50, 50), 'price' => $price);
                         }
                     }
                     $option_even[] = array('product_option_id' => $option['product_option_id'], 'option_id' => $option['option_id'], 'name' => $option['name'], 'type' => $option['type'], 'category' => $option['category'], 'class' => $option['class'], 'option_value' => $option_value_data, 'required' => $option['required']);
                 }
             }
             $this->data['products11'][] = array('product_id' => $result['product_id'], 'thumb' => $image, 'name' => $result['name_tour'] ? $result['name_tour'] : $result['name'], 'name_title' => cutString($result['name_tour'] ? $result['name_tour'] : $result['name'], 16), 'model' => $result['model'], 'schedule_title' => $result['schedule'], 'schedule' => cutString($result['schedule'], 18), 'price' => $price, 'special' => $result['special'], 'duration' => $result['duration'] ? $result['duration'] : 'Nữa ngày', 'special' => $special ? $special : 'Liên hệ', 'href' => $this->url->link('product/product', $custom_link . '&product_id=' . $result['product_id']), 'product_option_id' => $option_even);
             $option_even = array();
         }
     }
     /**********************products12**********************/
     $this->data['products12'] = array();
     $product = explode(',', $this->config->get('khmpq6nevendl_product'));
     if ($product) {
         foreach ($product as $product_id) {
             $result = $this->model_catalog_product->getProduct($product_id);
             if ($result['image'] && file_exists(DIR_IMAGE . $result['image'])) {
                 $image = $this->model_tool_image->cropsize($result['image'], $this->config->get('config_image_product_width'), $this->config->get('config_image_product_height'));
             } else {
                 $image = $this->model_tool_image->cropsize('no_image.jpg', $this->config->get('config_image_product_width'), $this->config->get('config_image_product_width'));
             }
             if ((double) $result['special']) {
                 $special = $this->currency->format($this->tax->calculate($result['special'], $result['tax_class_id'], $this->config->get('config_tax')));
             } else {
                 $special = false;
             }
             if ((double) $result['price']) {
                 $price = $this->currency->format($this->tax->calculate($result['price'], $result['tax_class_id'], $this->config->get('config_tax')));
             } else {
                 $price = false;
             }
             if (isset($result['custom_link'])) {
                 $custom_link = '&path=' . $result['custom_link'];
             } else {
                 $custom_link = "";
             }
             //  san pham o day
             $this->data['options'] = array();
             foreach ($this->model_catalog_product->getProductOptionsDL($result['product_id']) as $option) {
                 if ($option['type'] == 'select' || $option['type'] == 'radio' || $option['type'] == 'checkbox' || $option['type'] == 'image') {
                     $option_value_data = array();
                     foreach ($option['option_value'] as $option_value) {
                         if (!$option_value['subtract'] || $option_value['quantity'] > 0) {
                             if (($this->config->get('config_customer_price') && $this->customer->isLogged() || !$this->config->get('config_customer_price')) && (double) $option_value['price']) {
                                 $price = $this->currency->format($option_value['price']);
                             } else {
                                 $price = false;
                             }
                             $option_value_data[0] = array('product_option_value_id' => $option_value['product_option_value_id'], 'option_value_id' => $option_value['option_value_id'], 'name' => $option_value['name'], 'image' => $this->model_tool_image->onesize($option_value['image'], 50, 50), 'price' => $price);
                         }
                     }
                     $option_even[] = array('product_option_id' => $option['product_option_id'], 'option_id' => $option['option_id'], 'name' => $option['name'], 'type' => $option['type'], 'category' => $option['category'], 'class' => $option['class'], 'option_value' => $option_value_data, 'required' => $option['required']);
                 }
             }
             $this->data['products12'][] = array('product_id' => $result['product_id'], 'thumb' => $image, 'name' => $result['name_tour'] ? $result['name_tour'] : $result['name'], 'name_title' => cutString($result['name_tour'] ? $result['name_tour'] : $result['name'], 16), 'model' => $result['model'], 'schedule_title' => $result['schedule'], 'schedule' => cutString($result['schedule'], 18), 'price' => $price, 'special' => $result['special'], 'duration' => $result['duration'] ? $result['duration'] : 'Nữa ngày', 'special' => $special ? $special : 'Liên hệ', 'href' => $this->url->link('product/product', $custom_link . '&product_id=' . $result['product_id']), 'product_option_id' => $option_even);
             $option_even = array();
         }
     }
     /**********************products13**********************/
     $this->data['products13'] = array();
     $product = explode(',', $this->config->get('khmpt1nevendl_product'));
     if ($product) {
         foreach ($product as $product_id) {
             $result = $this->model_catalog_product->getProduct($product_id);
             if ($result['image'] && file_exists(DIR_IMAGE . $result['image'])) {
                 $image = $this->model_tool_image->cropsize($result['image'], $this->config->get('config_image_product_width'), $this->config->get('config_image_product_height'));
             } else {
                 $image = $this->model_tool_image->cropsize('no_image.jpg', $this->config->get('config_image_product_width'), $this->config->get('config_image_product_width'));
             }
             if ((double) $result['special']) {
                 $special = $this->currency->format($this->tax->calculate($result['special'], $result['tax_class_id'], $this->config->get('config_tax')));
             } else {
                 $special = false;
             }
             if ((double) $result['price']) {
                 $price = $this->currency->format($this->tax->calculate($result['price'], $result['tax_class_id'], $this->config->get('config_tax')));
             } else {
                 $price = false;
             }
             if (isset($result['custom_link'])) {
                 $custom_link = '&path=' . $result['custom_link'];
             } else {
                 $custom_link = "";
             }
             //  san pham o day
             $this->data['options'] = array();
             foreach ($this->model_catalog_product->getProductOptionsDL($result['product_id']) as $option) {
                 if ($option['type'] == 'select' || $option['type'] == 'radio' || $option['type'] == 'checkbox' || $option['type'] == 'image') {
                     $option_value_data = array();
                     foreach ($option['option_value'] as $option_value) {
                         if (!$option_value['subtract'] || $option_value['quantity'] > 0) {
                             if (($this->config->get('config_customer_price') && $this->customer->isLogged() || !$this->config->get('config_customer_price')) && (double) $option_value['price']) {
                                 $price = $this->currency->format($option_value['price']);
                             } else {
                                 $price = false;
                             }
                             $option_value_data[0] = array('product_option_value_id' => $option_value['product_option_value_id'], 'option_value_id' => $option_value['option_value_id'], 'name' => $option_value['name'], 'image' => $this->model_tool_image->onesize($option_value['image'], 50, 50), 'price' => $price);
                         }
                     }
                     $option_even[] = array('product_option_id' => $option['product_option_id'], 'option_id' => $option['option_id'], 'name' => $option['name'], 'type' => $option['type'], 'category' => $option['category'], 'class' => $option['class'], 'option_value' => $option_value_data, 'required' => $option['required']);
                 }
             }
             $this->data['products13'][] = array('product_id' => $result['product_id'], 'thumb' => $image, 'name' => $result['name_tour'] ? $result['name_tour'] : $result['name'], 'name_title' => cutString($result['name_tour'] ? $result['name_tour'] : $result['name'], 16), 'model' => $result['model'], 'schedule_title' => $result['schedule'], 'schedule' => cutString($result['schedule'], 18), 'price' => $price, 'special' => $result['special'], 'duration' => $result['duration'] ? $result['duration'] : 'Nữa ngày', 'special' => $special ? $special : 'Liên hệ', 'href' => $this->url->link('product/product', $custom_link . '&product_id=' . $result['product_id']), 'product_option_id' => $option_even);
             $option_even = array();
         }
     }
     /**********************products14**********************/
     $this->data['products14'] = array();
     $product = explode(',', $this->config->get('khmpt3nevendl_product'));
     if ($product) {
         foreach ($product as $product_id) {
             $result = $this->model_catalog_product->getProduct($product_id);
             if ($result['image'] && file_exists(DIR_IMAGE . $result['image'])) {
                 $image = $this->model_tool_image->cropsize($result['image'], $this->config->get('config_image_product_width'), $this->config->get('config_image_product_height'));
             } else {
                 $image = $this->model_tool_image->cropsize('no_image.jpg', $this->config->get('config_image_product_width'), $this->config->get('config_image_product_width'));
             }
             if ((double) $result['special']) {
                 $special = $this->currency->format($this->tax->calculate($result['special'], $result['tax_class_id'], $this->config->get('config_tax')));
             } else {
                 $special = false;
             }
             if ((double) $result['price']) {
                 $price = $this->currency->format($this->tax->calculate($result['price'], $result['tax_class_id'], $this->config->get('config_tax')));
             } else {
                 $price = false;
             }
             if (isset($result['custom_link'])) {
                 $custom_link = '&path=' . $result['custom_link'];
             } else {
                 $custom_link = "";
             }
             //  san pham o day
             $this->data['options'] = array();
             foreach ($this->model_catalog_product->getProductOptionsDL($result['product_id']) as $option) {
                 if ($option['type'] == 'select' || $option['type'] == 'radio' || $option['type'] == 'checkbox' || $option['type'] == 'image') {
                     $option_value_data = array();
                     foreach ($option['option_value'] as $option_value) {
                         if (!$option_value['subtract'] || $option_value['quantity'] > 0) {
                             if (($this->config->get('config_customer_price') && $this->customer->isLogged() || !$this->config->get('config_customer_price')) && (double) $option_value['price']) {
                                 $price = $this->currency->format($option_value['price']);
                             } else {
                                 $price = false;
                             }
                             $option_value_data[0] = array('product_option_value_id' => $option_value['product_option_value_id'], 'option_value_id' => $option_value['option_value_id'], 'name' => $option_value['name'], 'image' => $this->model_tool_image->onesize($option_value['image'], 50, 50), 'price' => $price);
                         }
                     }
                     $option_even[] = array('product_option_id' => $option['product_option_id'], 'option_id' => $option['option_id'], 'name' => $option['name'], 'type' => $option['type'], 'category' => $option['category'], 'class' => $option['class'], 'option_value' => $option_value_data, 'required' => $option['required']);
                 }
             }
             $this->data['products14'][] = array('product_id' => $result['product_id'], 'thumb' => $image, 'name' => $result['name_tour'] ? $result['name_tour'] : $result['name'], 'name_title' => cutString($result['name_tour'] ? $result['name_tour'] : $result['name'], 16), 'model' => $result['model'], 'schedule_title' => $result['schedule'], 'schedule' => cutString($result['schedule'], 18), 'price' => $price, 'special' => $result['special'], 'duration' => $result['duration'] ? $result['duration'] : 'Nữa ngày', 'special' => $special ? $special : 'Liên hệ', 'href' => $this->url->link('product/product', $custom_link . '&product_id=' . $result['product_id']), 'product_option_id' => $option_even);
             $option_even = array();
         }
     }
     /**********************products12**********************/
     $this->data['products15'] = array();
     $product = explode(',', $this->config->get('khmpt6nevendl_product'));
     if ($product) {
         foreach ($product as $product_id) {
             $result = $this->model_catalog_product->getProduct($product_id);
             if ($result['image'] && file_exists(DIR_IMAGE . $result['image'])) {
                 $image = $this->model_tool_image->cropsize($result['image'], $this->config->get('config_image_product_width'), $this->config->get('config_image_product_height'));
             } else {
                 $image = $this->model_tool_image->cropsize('no_image.jpg', $this->config->get('config_image_product_width'), $this->config->get('config_image_product_width'));
             }
             if ((double) $result['special']) {
                 $special = $this->currency->format($this->tax->calculate($result['special'], $result['tax_class_id'], $this->config->get('config_tax')));
             } else {
                 $special = false;
             }
             if ((double) $result['price']) {
                 $price = $this->currency->format($this->tax->calculate($result['price'], $result['tax_class_id'], $this->config->get('config_tax')));
             } else {
                 $price = false;
             }
             if (isset($result['custom_link'])) {
                 $custom_link = '&path=' . $result['custom_link'];
             } else {
                 $custom_link = "";
             }
             //  san pham o day
             $this->data['options'] = array();
             foreach ($this->model_catalog_product->getProductOptionsDL($result['product_id']) as $option) {
                 if ($option['type'] == 'select' || $option['type'] == 'radio' || $option['type'] == 'checkbox' || $option['type'] == 'image') {
                     $option_value_data = array();
                     foreach ($option['option_value'] as $option_value) {
                         if (!$option_value['subtract'] || $option_value['quantity'] > 0) {
                             if (($this->config->get('config_customer_price') && $this->customer->isLogged() || !$this->config->get('config_customer_price')) && (double) $option_value['price']) {
                                 $price = $this->currency->format($option_value['price']);
                             } else {
                                 $price = false;
                             }
                             $option_value_data[0] = array('product_option_value_id' => $option_value['product_option_value_id'], 'option_value_id' => $option_value['option_value_id'], 'name' => $option_value['name'], 'image' => $this->model_tool_image->onesize($option_value['image'], 50, 50), 'price' => $price);
                         }
                     }
                     $option_even[] = array('product_option_id' => $option['product_option_id'], 'option_id' => $option['option_id'], 'name' => $option['name'], 'type' => $option['type'], 'category' => $option['category'], 'class' => $option['class'], 'option_value' => $option_value_data, 'required' => $option['required']);
                 }
             }
             $this->data['products15'][] = array('product_id' => $result['product_id'], 'thumb' => $image, 'name' => $result['name_tour'] ? $result['name_tour'] : $result['name'], 'name_title' => cutString($result['name_tour'] ? $result['name_tour'] : $result['name'], 16), 'model' => $result['model'], 'schedule_title' => $result['schedule'], 'schedule' => cutString($result['schedule'], 18), 'price' => $price, 'special' => $result['special'], 'duration' => $result['duration'] ? $result['duration'] : 'Nữa ngày', 'special' => $special ? $special : 'Liên hệ', 'href' => $this->url->link('product/product', $custom_link . '&product_id=' . $result['product_id']), 'product_option_id' => $option_even);
             $option_even = array();
         }
     }
     /**********************products12**********************/
     $this->data['products16'] = array();
     $product = explode(',', $this->config->get('khmdl1nevendl_product'));
     if ($product) {
         foreach ($product as $product_id) {
             $result = $this->model_catalog_product->getProduct($product_id);
             if ($result['image'] && file_exists(DIR_IMAGE . $result['image'])) {
                 $image = $this->model_tool_image->cropsize($result['image'], $this->config->get('config_image_product_width'), $this->config->get('config_image_product_height'));
             } else {
                 $image = $this->model_tool_image->cropsize('no_image.jpg', $this->config->get('config_image_product_width'), $this->config->get('config_image_product_width'));
             }
             if ((double) $result['special']) {
                 $special = $this->currency->format($this->tax->calculate($result['special'], $result['tax_class_id'], $this->config->get('config_tax')));
             } else {
                 $special = false;
             }
             if ((double) $result['price']) {
                 $price = $this->currency->format($this->tax->calculate($result['price'], $result['tax_class_id'], $this->config->get('config_tax')));
             } else {
                 $price = false;
             }
             if (isset($result['custom_link'])) {
                 $custom_link = '&path=' . $result['custom_link'];
             } else {
                 $custom_link = "";
             }
             //  san pham o day
             $this->data['options'] = array();
             foreach ($this->model_catalog_product->getProductOptionsDL($result['product_id']) as $option) {
                 if ($option['type'] == 'select' || $option['type'] == 'radio' || $option['type'] == 'checkbox' || $option['type'] == 'image') {
                     $option_value_data = array();
                     foreach ($option['option_value'] as $option_value) {
                         if (!$option_value['subtract'] || $option_value['quantity'] > 0) {
                             if (($this->config->get('config_customer_price') && $this->customer->isLogged() || !$this->config->get('config_customer_price')) && (double) $option_value['price']) {
                                 $price = $this->currency->format($option_value['price']);
                             } else {
                                 $price = false;
                             }
                             $option_value_data[0] = array('product_option_value_id' => $option_value['product_option_value_id'], 'option_value_id' => $option_value['option_value_id'], 'name' => $option_value['name'], 'image' => $this->model_tool_image->onesize($option_value['image'], 50, 50), 'price' => $price);
                         }
                     }
                     $option_even[] = array('product_option_id' => $option['product_option_id'], 'option_id' => $option['option_id'], 'name' => $option['name'], 'type' => $option['type'], 'category' => $option['category'], 'class' => $option['class'], 'option_value' => $option_value_data, 'required' => $option['required']);
                 }
             }
             $this->data['products16'][] = array('product_id' => $result['product_id'], 'thumb' => $image, 'name' => $result['name_tour'] ? $result['name_tour'] : $result['name'], 'name_title' => cutString($result['name_tour'] ? $result['name_tour'] : $result['name'], 16), 'model' => $result['model'], 'schedule_title' => $result['schedule'], 'schedule' => cutString($result['schedule'], 18), 'price' => $price, 'special' => $result['special'], 'duration' => $result['duration'] ? $result['duration'] : 'Nữa ngày', 'special' => $special ? $special : 'Liên hệ', 'href' => $this->url->link('product/product', $custom_link . '&product_id=' . $result['product_id']), 'product_option_id' => $option_even);
             $option_even = array();
         }
     }
     /**********************products12**********************/
     $this->data['products17'] = array();
     $product = explode(',', $this->config->get('khmdl3nevendl_product'));
     if ($product) {
         foreach ($product as $product_id) {
             $result = $this->model_catalog_product->getProduct($product_id);
             if ($result['image'] && file_exists(DIR_IMAGE . $result['image'])) {
                 $image = $this->model_tool_image->cropsize($result['image'], $this->config->get('config_image_product_width'), $this->config->get('config_image_product_height'));
             } else {
                 $image = $this->model_tool_image->cropsize('no_image.jpg', $this->config->get('config_image_product_width'), $this->config->get('config_image_product_width'));
             }
             if ((double) $result['special']) {
                 $special = $this->currency->format($this->tax->calculate($result['special'], $result['tax_class_id'], $this->config->get('config_tax')));
             } else {
                 $special = false;
             }
             if ((double) $result['price']) {
                 $price = $this->currency->format($this->tax->calculate($result['price'], $result['tax_class_id'], $this->config->get('config_tax')));
             } else {
                 $price = false;
             }
             if (isset($result['custom_link'])) {
                 $custom_link = '&path=' . $result['custom_link'];
             } else {
                 $custom_link = "";
             }
             //  san pham o day
             $this->data['options'] = array();
             foreach ($this->model_catalog_product->getProductOptionsDL($result['product_id']) as $option) {
                 if ($option['type'] == 'select' || $option['type'] == 'radio' || $option['type'] == 'checkbox' || $option['type'] == 'image') {
                     $option_value_data = array();
                     foreach ($option['option_value'] as $option_value) {
                         if (!$option_value['subtract'] || $option_value['quantity'] > 0) {
                             if (($this->config->get('config_customer_price') && $this->customer->isLogged() || !$this->config->get('config_customer_price')) && (double) $option_value['price']) {
                                 $price = $this->currency->format($option_value['price']);
                             } else {
                                 $price = false;
                             }
                             $option_value_data[0] = array('product_option_value_id' => $option_value['product_option_value_id'], 'option_value_id' => $option_value['option_value_id'], 'name' => $option_value['name'], 'image' => $this->model_tool_image->onesize($option_value['image'], 50, 50), 'price' => $price);
                         }
                     }
                     $option_even[] = array('product_option_id' => $option['product_option_id'], 'option_id' => $option['option_id'], 'name' => $option['name'], 'type' => $option['type'], 'category' => $option['category'], 'class' => $option['class'], 'option_value' => $option_value_data, 'required' => $option['required']);
                 }
             }
             $this->data['products17'][] = array('product_id' => $result['product_id'], 'thumb' => $image, 'name' => $result['name_tour'] ? $result['name_tour'] : $result['name'], 'name_title' => cutString($result['name_tour'] ? $result['name_tour'] : $result['name'], 16), 'model' => $result['model'], 'schedule_title' => $result['schedule'], 'schedule' => cutString($result['schedule'], 18), 'price' => $price, 'special' => $result['special'], 'duration' => $result['duration'] ? $result['duration'] : 'Nữa ngày', 'special' => $special ? $special : 'Liên hệ', 'href' => $this->url->link('product/product', $custom_link . '&product_id=' . $result['product_id']), 'product_option_id' => $option_even);
             $option_even = array();
         }
     }
     /**********************products12**********************/
     $this->data['products18'] = array();
     $product = explode(',', $this->config->get('khmdl6nevendl_product'));
     if ($product) {
         foreach ($product as $product_id) {
             $result = $this->model_catalog_product->getProduct($product_id);
             if ($result['image'] && file_exists(DIR_IMAGE . $result['image'])) {
                 $image = $this->model_tool_image->cropsize($result['image'], $this->config->get('config_image_product_width'), $this->config->get('config_image_product_height'));
             } else {
                 $image = $this->model_tool_image->cropsize('no_image.jpg', $this->config->get('config_image_product_width'), $this->config->get('config_image_product_width'));
             }
             if ((double) $result['special']) {
                 $special = $this->currency->format($this->tax->calculate($result['special'], $result['tax_class_id'], $this->config->get('config_tax')));
             } else {
                 $special = false;
             }
             if ((double) $result['price']) {
                 $price = $this->currency->format($this->tax->calculate($result['price'], $result['tax_class_id'], $this->config->get('config_tax')));
             } else {
                 $price = false;
             }
             if (isset($result['custom_link'])) {
                 $custom_link = '&path=' . $result['custom_link'];
             } else {
                 $custom_link = "";
             }
             //  san pham o day
             $this->data['options'] = array();
             foreach ($this->model_catalog_product->getProductOptionsDL($result['product_id']) as $option) {
                 if ($option['type'] == 'select' || $option['type'] == 'radio' || $option['type'] == 'checkbox' || $option['type'] == 'image') {
                     $option_value_data = array();
                     foreach ($option['option_value'] as $option_value) {
                         if (!$option_value['subtract'] || $option_value['quantity'] > 0) {
                             if (($this->config->get('config_customer_price') && $this->customer->isLogged() || !$this->config->get('config_customer_price')) && (double) $option_value['price']) {
                                 $price = $this->currency->format($option_value['price']);
                             } else {
                                 $price = false;
                             }
                             $option_value_data[0] = array('product_option_value_id' => $option_value['product_option_value_id'], 'option_value_id' => $option_value['option_value_id'], 'name' => $option_value['name'], 'image' => $this->model_tool_image->onesize($option_value['image'], 50, 50), 'price' => $price);
                         }
                     }
                     $option_even[] = array('product_option_id' => $option['product_option_id'], 'option_id' => $option['option_id'], 'name' => $option['name'], 'type' => $option['type'], 'category' => $option['category'], 'class' => $option['class'], 'option_value' => $option_value_data, 'required' => $option['required']);
                 }
             }
             $this->data['products18'][] = array('product_id' => $result['product_id'], 'thumb' => $image, 'name' => $result['name_tour'] ? $result['name_tour'] : $result['name'], 'name_title' => cutString($result['name_tour'] ? $result['name_tour'] : $result['name'], 16), 'model' => $result['model'], 'schedule_title' => $result['schedule'], 'schedule' => cutString($result['schedule'], 18), 'price' => $price, 'special' => $result['special'], 'duration' => $result['duration'] ? $result['duration'] : 'Nữa ngày', 'special' => $special ? $special : 'Liên hệ', 'href' => $this->url->link('product/product', $custom_link . '&product_id=' . $result['product_id']), 'product_option_id' => $option_even);
             $option_even = array();
         }
     }
     /**********************products12**********************/
     $this->data['products19'] = array();
     $product = explode(',', $this->config->get('khmnt1nevendl_product'));
     if ($product) {
         foreach ($product as $product_id) {
             $result = $this->model_catalog_product->getProduct($product_id);
             if ($result['image'] && file_exists(DIR_IMAGE . $result['image'])) {
                 $image = $this->model_tool_image->cropsize($result['image'], $this->config->get('config_image_product_width'), $this->config->get('config_image_product_height'));
             } else {
                 $image = $this->model_tool_image->cropsize('no_image.jpg', $this->config->get('config_image_product_width'), $this->config->get('config_image_product_width'));
             }
             if ((double) $result['special']) {
                 $special = $this->currency->format($this->tax->calculate($result['special'], $result['tax_class_id'], $this->config->get('config_tax')));
             } else {
                 $special = false;
             }
             if ((double) $result['price']) {
                 $price = $this->currency->format($this->tax->calculate($result['price'], $result['tax_class_id'], $this->config->get('config_tax')));
             } else {
                 $price = false;
             }
             if (isset($result['custom_link'])) {
                 $custom_link = '&path=' . $result['custom_link'];
             } else {
                 $custom_link = "";
             }
             //  san pham o day
             $this->data['options'] = array();
             foreach ($this->model_catalog_product->getProductOptionsDL($result['product_id']) as $option) {
                 if ($option['type'] == 'select' || $option['type'] == 'radio' || $option['type'] == 'checkbox' || $option['type'] == 'image') {
                     $option_value_data = array();
                     foreach ($option['option_value'] as $option_value) {
                         if (!$option_value['subtract'] || $option_value['quantity'] > 0) {
                             if (($this->config->get('config_customer_price') && $this->customer->isLogged() || !$this->config->get('config_customer_price')) && (double) $option_value['price']) {
                                 $price = $this->currency->format($option_value['price']);
                             } else {
                                 $price = false;
                             }
                             $option_value_data[0] = array('product_option_value_id' => $option_value['product_option_value_id'], 'option_value_id' => $option_value['option_value_id'], 'name' => $option_value['name'], 'image' => $this->model_tool_image->onesize($option_value['image'], 50, 50), 'price' => $price);
                         }
                     }
                     $option_even[] = array('product_option_id' => $option['product_option_id'], 'option_id' => $option['option_id'], 'name' => $option['name'], 'type' => $option['type'], 'category' => $option['category'], 'class' => $option['class'], 'option_value' => $option_value_data, 'required' => $option['required']);
                 }
             }
             $this->data['products19'][] = array('product_id' => $result['product_id'], 'thumb' => $image, 'name' => $result['name_tour'] ? $result['name_tour'] : $result['name'], 'name_title' => cutString($result['name_tour'] ? $result['name_tour'] : $result['name'], 16), 'model' => $result['model'], 'schedule_title' => $result['schedule'], 'schedule' => cutString($result['schedule'], 18), 'price' => $price, 'special' => $result['special'], 'duration' => $result['duration'] ? $result['duration'] : 'Nữa ngày', 'special' => $special ? $special : 'Liên hệ', 'href' => $this->url->link('product/product', $custom_link . '&product_id=' . $result['product_id']), 'product_option_id' => $option_even);
             $option_even = array();
         }
     }
     /**********************products12**********************/
     $this->data['products20'] = array();
     $product = explode(',', $this->config->get('khmnt3nevendl_product'));
     if ($product) {
         foreach ($product as $product_id) {
             $result = $this->model_catalog_product->getProduct($product_id);
             if ($result['image'] && file_exists(DIR_IMAGE . $result['image'])) {
                 $image = $this->model_tool_image->cropsize($result['image'], $this->config->get('config_image_product_width'), $this->config->get('config_image_product_height'));
             } else {
                 $image = $this->model_tool_image->cropsize('no_image.jpg', $this->config->get('config_image_product_width'), $this->config->get('config_image_product_width'));
             }
             if ((double) $result['special']) {
                 $special = $this->currency->format($this->tax->calculate($result['special'], $result['tax_class_id'], $this->config->get('config_tax')));
             } else {
                 $special = false;
             }
             if ((double) $result['price']) {
                 $price = $this->currency->format($this->tax->calculate($result['price'], $result['tax_class_id'], $this->config->get('config_tax')));
             } else {
                 $price = false;
             }
             if (isset($result['custom_link'])) {
                 $custom_link = '&path=' . $result['custom_link'];
             } else {
                 $custom_link = "";
             }
             //  san pham o day
             $this->data['options'] = array();
             foreach ($this->model_catalog_product->getProductOptionsDL($result['product_id']) as $option) {
                 if ($option['type'] == 'select' || $option['type'] == 'radio' || $option['type'] == 'checkbox' || $option['type'] == 'image') {
                     $option_value_data = array();
                     foreach ($option['option_value'] as $option_value) {
                         if (!$option_value['subtract'] || $option_value['quantity'] > 0) {
                             if (($this->config->get('config_customer_price') && $this->customer->isLogged() || !$this->config->get('config_customer_price')) && (double) $option_value['price']) {
                                 $price = $this->currency->format($option_value['price']);
                             } else {
                                 $price = false;
                             }
                             $option_value_data[0] = array('product_option_value_id' => $option_value['product_option_value_id'], 'option_value_id' => $option_value['option_value_id'], 'name' => $option_value['name'], 'image' => $this->model_tool_image->onesize($option_value['image'], 50, 50), 'price' => $price);
                         }
                     }
                     $option_even[] = array('product_option_id' => $option['product_option_id'], 'option_id' => $option['option_id'], 'name' => $option['name'], 'type' => $option['type'], 'category' => $option['category'], 'class' => $option['class'], 'option_value' => $option_value_data, 'required' => $option['required']);
                 }
             }
             $this->data['products20'][] = array('product_id' => $result['product_id'], 'thumb' => $image, 'name' => $result['name_tour'] ? $result['name_tour'] : $result['name'], 'name_title' => cutString($result['name_tour'] ? $result['name_tour'] : $result['name'], 16), 'model' => $result['model'], 'schedule_title' => $result['schedule'], 'schedule' => cutString($result['schedule'], 18), 'price' => $price, 'special' => $result['special'], 'duration' => $result['duration'] ? $result['duration'] : 'Nữa ngày', 'special' => $special ? $special : 'Liên hệ', 'href' => $this->url->link('product/product', $custom_link . '&product_id=' . $result['product_id']), 'product_option_id' => $option_even);
             $option_even = array();
         }
     }
     /**********************products12**********************/
     $this->data['products21'] = array();
     $product = explode(',', $this->config->get('khmnt6nevendl_product'));
     if ($product) {
         foreach ($product as $product_id) {
             $result = $this->model_catalog_product->getProduct($product_id);
             if ($result['image'] && file_exists(DIR_IMAGE . $result['image'])) {
                 $image = $this->model_tool_image->cropsize($result['image'], $this->config->get('config_image_product_width'), $this->config->get('config_image_product_height'));
             } else {
                 $image = $this->model_tool_image->cropsize('no_image.jpg', $this->config->get('config_image_product_width'), $this->config->get('config_image_product_width'));
             }
             if ((double) $result['special']) {
                 $special = $this->currency->format($this->tax->calculate($result['special'], $result['tax_class_id'], $this->config->get('config_tax')));
             } else {
                 $special = false;
             }
             if ((double) $result['price']) {
                 $price = $this->currency->format($this->tax->calculate($result['price'], $result['tax_class_id'], $this->config->get('config_tax')));
             } else {
                 $price = false;
             }
             if (isset($result['custom_link'])) {
                 $custom_link = '&path=' . $result['custom_link'];
             } else {
                 $custom_link = "";
             }
             //  san pham o day
             $this->data['options'] = array();
             foreach ($this->model_catalog_product->getProductOptionsDL($result['product_id']) as $option) {
                 if ($option['type'] == 'select' || $option['type'] == 'radio' || $option['type'] == 'checkbox' || $option['type'] == 'image') {
                     $option_value_data = array();
                     foreach ($option['option_value'] as $option_value) {
                         if (!$option_value['subtract'] || $option_value['quantity'] > 0) {
                             if (($this->config->get('config_customer_price') && $this->customer->isLogged() || !$this->config->get('config_customer_price')) && (double) $option_value['price']) {
                                 $price = $this->currency->format($option_value['price']);
                             } else {
                                 $price = false;
                             }
                             $option_value_data[0] = array('product_option_value_id' => $option_value['product_option_value_id'], 'option_value_id' => $option_value['option_value_id'], 'name' => $option_value['name'], 'image' => $this->model_tool_image->onesize($option_value['image'], 50, 50), 'price' => $price);
                         }
                     }
                     $option_even[] = array('product_option_id' => $option['product_option_id'], 'option_id' => $option['option_id'], 'name' => $option['name'], 'type' => $option['type'], 'category' => $option['category'], 'class' => $option['class'], 'option_value' => $option_value_data, 'required' => $option['required']);
                 }
             }
             $this->data['products21'][] = array('product_id' => $result['product_id'], 'thumb' => $image, 'name' => $result['name_tour'] ? $result['name_tour'] : $result['name'], 'name_title' => cutString($result['name_tour'] ? $result['name_tour'] : $result['name'], 16), 'model' => $result['model'], 'schedule_title' => $result['schedule'], 'schedule' => cutString($result['schedule'], 18), 'price' => $price, 'special' => $result['special'], 'duration' => $result['duration'] ? $result['duration'] : 'Nữa ngày', 'special' => $special ? $special : 'Liên hệ', 'href' => $this->url->link('product/product', $custom_link . '&product_id=' . $result['product_id']), 'product_option_id' => $option_even);
             $option_even = array();
         }
     }
     /**********************products12**********************/
     $this->data['products22'] = array();
     $product = explode(',', $this->config->get('khmdn1nevendl_product'));
     if ($product) {
         foreach ($product as $product_id) {
             $result = $this->model_catalog_product->getProduct($product_id);
             if ($result['image'] && file_exists(DIR_IMAGE . $result['image'])) {
                 $image = $this->model_tool_image->cropsize($result['image'], $this->config->get('config_image_product_width'), $this->config->get('config_image_product_height'));
             } else {
                 $image = $this->model_tool_image->cropsize('no_image.jpg', $this->config->get('config_image_product_width'), $this->config->get('config_image_product_width'));
             }
             if ((double) $result['special']) {
                 $special = $this->currency->format($this->tax->calculate($result['special'], $result['tax_class_id'], $this->config->get('config_tax')));
             } else {
                 $special = false;
             }
             if ((double) $result['price']) {
                 $price = $this->currency->format($this->tax->calculate($result['price'], $result['tax_class_id'], $this->config->get('config_tax')));
             } else {
                 $price = false;
             }
             if (isset($result['custom_link'])) {
                 $custom_link = '&path=' . $result['custom_link'];
             } else {
                 $custom_link = "";
             }
             //  san pham o day
             $this->data['options'] = array();
             foreach ($this->model_catalog_product->getProductOptionsDL($result['product_id']) as $option) {
                 if ($option['type'] == 'select' || $option['type'] == 'radio' || $option['type'] == 'checkbox' || $option['type'] == 'image') {
                     $option_value_data = array();
                     foreach ($option['option_value'] as $option_value) {
                         if (!$option_value['subtract'] || $option_value['quantity'] > 0) {
                             if (($this->config->get('config_customer_price') && $this->customer->isLogged() || !$this->config->get('config_customer_price')) && (double) $option_value['price']) {
                                 $price = $this->currency->format($option_value['price']);
                             } else {
                                 $price = false;
                             }
                             $option_value_data[0] = array('product_option_value_id' => $option_value['product_option_value_id'], 'option_value_id' => $option_value['option_value_id'], 'name' => $option_value['name'], 'image' => $this->model_tool_image->onesize($option_value['image'], 50, 50), 'price' => $price);
                         }
                     }
                     $option_even[] = array('product_option_id' => $option['product_option_id'], 'option_id' => $option['option_id'], 'name' => $option['name'], 'type' => $option['type'], 'category' => $option['category'], 'class' => $option['class'], 'option_value' => $option_value_data, 'required' => $option['required']);
                 }
             }
             $this->data['products22'][] = array('product_id' => $result['product_id'], 'thumb' => $image, 'name' => $result['name_tour'] ? $result['name_tour'] : $result['name'], 'name_title' => cutString($result['name_tour'] ? $result['name_tour'] : $result['name'], 16), 'model' => $result['model'], 'schedule_title' => $result['schedule'], 'schedule' => cutString($result['schedule'], 18), 'price' => $price, 'special' => $result['special'], 'duration' => $result['duration'] ? $result['duration'] : 'Nữa ngày', 'special' => $special ? $special : 'Liên hệ', 'href' => $this->url->link('product/product', $custom_link . '&product_id=' . $result['product_id']), 'product_option_id' => $option_even);
             $option_even = array();
         }
     }
     /**********************products12**********************/
     $this->data['products23'] = array();
     $product = explode(',', $this->config->get('khmdn3nevendl_product'));
     if ($product) {
         foreach ($product as $product_id) {
             $result = $this->model_catalog_product->getProduct($product_id);
             if ($result['image'] && file_exists(DIR_IMAGE . $result['image'])) {
                 $image = $this->model_tool_image->cropsize($result['image'], $this->config->get('config_image_product_width'), $this->config->get('config_image_product_height'));
             } else {
                 $image = $this->model_tool_image->cropsize('no_image.jpg', $this->config->get('config_image_product_width'), $this->config->get('config_image_product_width'));
             }
             if ((double) $result['special']) {
                 $special = $this->currency->format($this->tax->calculate($result['special'], $result['tax_class_id'], $this->config->get('config_tax')));
             } else {
                 $special = false;
             }
             if ((double) $result['price']) {
                 $price = $this->currency->format($this->tax->calculate($result['price'], $result['tax_class_id'], $this->config->get('config_tax')));
             } else {
                 $price = false;
             }
             if (isset($result['custom_link'])) {
                 $custom_link = '&path=' . $result['custom_link'];
             } else {
                 $custom_link = "";
             }
             //  san pham o day
             $this->data['options'] = array();
             foreach ($this->model_catalog_product->getProductOptionsDL($result['product_id']) as $option) {
                 if ($option['type'] == 'select' || $option['type'] == 'radio' || $option['type'] == 'checkbox' || $option['type'] == 'image') {
                     $option_value_data = array();
                     foreach ($option['option_value'] as $option_value) {
                         if (!$option_value['subtract'] || $option_value['quantity'] > 0) {
                             if (($this->config->get('config_customer_price') && $this->customer->isLogged() || !$this->config->get('config_customer_price')) && (double) $option_value['price']) {
                                 $price = $this->currency->format($option_value['price']);
                             } else {
                                 $price = false;
                             }
                             $option_value_data[0] = array('product_option_value_id' => $option_value['product_option_value_id'], 'option_value_id' => $option_value['option_value_id'], 'name' => $option_value['name'], 'image' => $this->model_tool_image->onesize($option_value['image'], 50, 50), 'price' => $price);
                         }
                     }
                     $option_even[] = array('product_option_id' => $option['product_option_id'], 'option_id' => $option['option_id'], 'name' => $option['name'], 'type' => $option['type'], 'category' => $option['category'], 'class' => $option['class'], 'option_value' => $option_value_data, 'required' => $option['required']);
                 }
             }
             $this->data['products23'][] = array('product_id' => $result['product_id'], 'thumb' => $image, 'name' => $result['name_tour'] ? $result['name_tour'] : $result['name'], 'name_title' => cutString($result['name_tour'] ? $result['name_tour'] : $result['name'], 16), 'model' => $result['model'], 'schedule_title' => $result['schedule'], 'schedule' => cutString($result['schedule'], 18), 'price' => $price, 'special' => $result['special'], 'duration' => $result['duration'] ? $result['duration'] : 'Nữa ngày', 'special' => $special ? $special : 'Liên hệ', 'href' => $this->url->link('product/product', $custom_link . '&product_id=' . $result['product_id']), 'product_option_id' => $option_even);
             $option_even = array();
         }
     }
     /**********************products12**********************/
     $this->data['products24'] = array();
     $product = explode(',', $this->config->get('khmdn6nevendl_product'));
     if ($product) {
         foreach ($product as $product_id) {
             $result = $this->model_catalog_product->getProduct($product_id);
             if ($result['image'] && file_exists(DIR_IMAGE . $result['image'])) {
                 $image = $this->model_tool_image->cropsize($result['image'], $this->config->get('config_image_product_width'), $this->config->get('config_image_product_height'));
             } else {
                 $image = $this->model_tool_image->cropsize('no_image.jpg', $this->config->get('config_image_product_width'), $this->config->get('config_image_product_width'));
             }
             if ((double) $result['special']) {
                 $special = $this->currency->format($this->tax->calculate($result['special'], $result['tax_class_id'], $this->config->get('config_tax')));
             } else {
                 $special = false;
             }
             if ((double) $result['price']) {
                 $price = $this->currency->format($this->tax->calculate($result['price'], $result['tax_class_id'], $this->config->get('config_tax')));
             } else {
                 $price = false;
             }
             if (isset($result['custom_link'])) {
                 $custom_link = '&path=' . $result['custom_link'];
             } else {
                 $custom_link = "";
             }
             //  san pham o day
             $this->data['options'] = array();
             foreach ($this->model_catalog_product->getProductOptionsDL($result['product_id']) as $option) {
                 if ($option['type'] == 'select' || $option['type'] == 'radio' || $option['type'] == 'checkbox' || $option['type'] == 'image') {
                     $option_value_data = array();
                     foreach ($option['option_value'] as $option_value) {
                         if (!$option_value['subtract'] || $option_value['quantity'] > 0) {
                             if (($this->config->get('config_customer_price') && $this->customer->isLogged() || !$this->config->get('config_customer_price')) && (double) $option_value['price']) {
                                 $price = $this->currency->format($option_value['price']);
                             } else {
                                 $price = false;
                             }
                             $option_value_data[0] = array('product_option_value_id' => $option_value['product_option_value_id'], 'option_value_id' => $option_value['option_value_id'], 'name' => $option_value['name'], 'image' => $this->model_tool_image->onesize($option_value['image'], 50, 50), 'price' => $price);
                         }
                     }
                     $option_even[] = array('product_option_id' => $option['product_option_id'], 'option_id' => $option['option_id'], 'name' => $option['name'], 'type' => $option['type'], 'category' => $option['category'], 'class' => $option['class'], 'option_value' => $option_value_data, 'required' => $option['required']);
                 }
             }
             $this->data['products24'][] = array('product_id' => $result['product_id'], 'thumb' => $image, 'name' => $result['name_tour'] ? $result['name_tour'] : $result['name'], 'name_title' => cutString($result['name_tour'] ? $result['name_tour'] : $result['name'], 16), 'model' => $result['model'], 'schedule_title' => $result['schedule'], 'schedule' => cutString($result['schedule'], 18), 'price' => $price, 'special' => $result['special'], 'duration' => $result['duration'] ? $result['duration'] : 'Nữa ngày', 'special' => $special ? $special : 'Liên hệ', 'href' => $this->url->link('product/product', $custom_link . '&product_id=' . $result['product_id']), 'product_option_id' => $option_even);
             $option_even = array();
         }
     }
     /**********************products12**********************/
     $this->data['products25'] = array();
     $product = explode(',', $this->config->get('khmha1nevendl_product'));
     if ($product) {
         foreach ($product as $product_id) {
             $result = $this->model_catalog_product->getProduct($product_id);
             if ($result['image'] && file_exists(DIR_IMAGE . $result['image'])) {
                 $image = $this->model_tool_image->cropsize($result['image'], $this->config->get('config_image_product_width'), $this->config->get('config_image_product_height'));
             } else {
                 $image = $this->model_tool_image->cropsize('no_image.jpg', $this->config->get('config_image_product_width'), $this->config->get('config_image_product_width'));
             }
             if ((double) $result['special']) {
                 $special = $this->currency->format($this->tax->calculate($result['special'], $result['tax_class_id'], $this->config->get('config_tax')));
             } else {
                 $special = false;
             }
             if ((double) $result['price']) {
                 $price = $this->currency->format($this->tax->calculate($result['price'], $result['tax_class_id'], $this->config->get('config_tax')));
             } else {
                 $price = false;
             }
             if (isset($result['custom_link'])) {
                 $custom_link = '&path=' . $result['custom_link'];
             } else {
                 $custom_link = "";
             }
             //  san pham o day
             $this->data['options'] = array();
             foreach ($this->model_catalog_product->getProductOptionsDL($result['product_id']) as $option) {
                 if ($option['type'] == 'select' || $option['type'] == 'radio' || $option['type'] == 'checkbox' || $option['type'] == 'image') {
                     $option_value_data = array();
                     foreach ($option['option_value'] as $option_value) {
                         if (!$option_value['subtract'] || $option_value['quantity'] > 0) {
                             if (($this->config->get('config_customer_price') && $this->customer->isLogged() || !$this->config->get('config_customer_price')) && (double) $option_value['price']) {
                                 $price = $this->currency->format($option_value['price']);
                             } else {
                                 $price = false;
                             }
                             $option_value_data[0] = array('product_option_value_id' => $option_value['product_option_value_id'], 'option_value_id' => $option_value['option_value_id'], 'name' => $option_value['name'], 'image' => $this->model_tool_image->onesize($option_value['image'], 50, 50), 'price' => $price);
                         }
                     }
                     $option_even[] = array('product_option_id' => $option['product_option_id'], 'option_id' => $option['option_id'], 'name' => $option['name'], 'type' => $option['type'], 'category' => $option['category'], 'class' => $option['class'], 'option_value' => $option_value_data, 'required' => $option['required']);
                 }
             }
             $this->data['products25'][] = array('product_id' => $result['product_id'], 'thumb' => $image, 'name' => $result['name_tour'] ? $result['name_tour'] : $result['name'], 'name_title' => cutString($result['name_tour'] ? $result['name_tour'] : $result['name'], 16), 'model' => $result['model'], 'schedule_title' => $result['schedule'], 'schedule' => cutString($result['schedule'], 18), 'price' => $price, 'special' => $result['special'], 'duration' => $result['duration'] ? $result['duration'] : 'Nữa ngày', 'special' => $special ? $special : 'Liên hệ', 'href' => $this->url->link('product/product', $custom_link . '&product_id=' . $result['product_id']), 'product_option_id' => $option_even);
             $option_even = array();
         }
     }
     /**********************products12**********************/
     $this->data['products26'] = array();
     $product = explode(',', $this->config->get('khmha3nevendl_product'));
     if ($product) {
         foreach ($product as $product_id) {
             $result = $this->model_catalog_product->getProduct($product_id);
             if ($result['image'] && file_exists(DIR_IMAGE . $result['image'])) {
                 $image = $this->model_tool_image->cropsize($result['image'], $this->config->get('config_image_product_width'), $this->config->get('config_image_product_height'));
             } else {
                 $image = $this->model_tool_image->cropsize('no_image.jpg', $this->config->get('config_image_product_width'), $this->config->get('config_image_product_width'));
             }
             if ((double) $result['special']) {
                 $special = $this->currency->format($this->tax->calculate($result['special'], $result['tax_class_id'], $this->config->get('config_tax')));
             } else {
                 $special = false;
             }
             if ((double) $result['price']) {
                 $price = $this->currency->format($this->tax->calculate($result['price'], $result['tax_class_id'], $this->config->get('config_tax')));
             } else {
                 $price = false;
             }
             if (isset($result['custom_link'])) {
                 $custom_link = '&path=' . $result['custom_link'];
             } else {
                 $custom_link = "";
             }
             //  san pham o day
             $this->data['options'] = array();
             foreach ($this->model_catalog_product->getProductOptionsDL($result['product_id']) as $option) {
                 if ($option['type'] == 'select' || $option['type'] == 'radio' || $option['type'] == 'checkbox' || $option['type'] == 'image') {
                     $option_value_data = array();
                     foreach ($option['option_value'] as $option_value) {
                         if (!$option_value['subtract'] || $option_value['quantity'] > 0) {
                             if (($this->config->get('config_customer_price') && $this->customer->isLogged() || !$this->config->get('config_customer_price')) && (double) $option_value['price']) {
                                 $price = $this->currency->format($option_value['price']);
                             } else {
                                 $price = false;
                             }
                             $option_value_data[0] = array('product_option_value_id' => $option_value['product_option_value_id'], 'option_value_id' => $option_value['option_value_id'], 'name' => $option_value['name'], 'image' => $this->model_tool_image->onesize($option_value['image'], 50, 50), 'price' => $price);
                         }
                     }
                     $option_even[] = array('product_option_id' => $option['product_option_id'], 'option_id' => $option['option_id'], 'name' => $option['name'], 'type' => $option['type'], 'category' => $option['category'], 'class' => $option['class'], 'option_value' => $option_value_data, 'required' => $option['required']);
                 }
             }
             $this->data['products26'][] = array('product_id' => $result['product_id'], 'thumb' => $image, 'name' => $result['name_tour'] ? $result['name_tour'] : $result['name'], 'name_title' => cutString($result['name_tour'] ? $result['name_tour'] : $result['name'], 16), 'model' => $result['model'], 'schedule_title' => $result['schedule'], 'schedule' => cutString($result['schedule'], 18), 'price' => $price, 'special' => $result['special'], 'duration' => $result['duration'] ? $result['duration'] : 'Nữa ngày', 'special' => $special ? $special : 'Liên hệ', 'href' => $this->url->link('product/product', $custom_link . '&product_id=' . $result['product_id']), 'product_option_id' => $option_even);
             $option_even = array();
         }
     }
     /**********************products12**********************/
     $this->data['products27'] = array();
     $product = explode(',', $this->config->get('khmha6nevendl_product'));
     if ($product) {
         foreach ($product as $product_id) {
             $result = $this->model_catalog_product->getProduct($product_id);
             if ($result['image'] && file_exists(DIR_IMAGE . $result['image'])) {
                 $image = $this->model_tool_image->cropsize($result['image'], $this->config->get('config_image_product_width'), $this->config->get('config_image_product_height'));
             } else {
                 $image = $this->model_tool_image->cropsize('no_image.jpg', $this->config->get('config_image_product_width'), $this->config->get('config_image_product_width'));
             }
             if ((double) $result['special']) {
                 $special = $this->currency->format($this->tax->calculate($result['special'], $result['tax_class_id'], $this->config->get('config_tax')));
             } else {
                 $special = false;
             }
             if ((double) $result['price']) {
                 $price = $this->currency->format($this->tax->calculate($result['price'], $result['tax_class_id'], $this->config->get('config_tax')));
             } else {
                 $price = false;
             }
             if (isset($result['custom_link'])) {
                 $custom_link = '&path=' . $result['custom_link'];
             } else {
                 $custom_link = "";
             }
             //  san pham o day
             $this->data['options'] = array();
             foreach ($this->model_catalog_product->getProductOptionsDL($result['product_id']) as $option) {
                 if ($option['type'] == 'select' || $option['type'] == 'radio' || $option['type'] == 'checkbox' || $option['type'] == 'image') {
                     $option_value_data = array();
                     foreach ($option['option_value'] as $option_value) {
                         if (!$option_value['subtract'] || $option_value['quantity'] > 0) {
                             if (($this->config->get('config_customer_price') && $this->customer->isLogged() || !$this->config->get('config_customer_price')) && (double) $option_value['price']) {
                                 $price = $this->currency->format($option_value['price']);
                             } else {
                                 $price = false;
                             }
                             $option_value_data[0] = array('product_option_value_id' => $option_value['product_option_value_id'], 'option_value_id' => $option_value['option_value_id'], 'name' => $option_value['name'], 'image' => $this->model_tool_image->onesize($option_value['image'], 50, 50), 'price' => $price);
                         }
                     }
                     $option_even[] = array('product_option_id' => $option['product_option_id'], 'option_id' => $option['option_id'], 'name' => $option['name'], 'type' => $option['type'], 'category' => $option['category'], 'class' => $option['class'], 'option_value' => $option_value_data, 'required' => $option['required']);
                 }
             }
             $this->data['products27'][] = array('product_id' => $result['product_id'], 'thumb' => $image, 'name' => $result['name_tour'] ? $result['name_tour'] : $result['name'], 'name_title' => cutString($result['name_tour'] ? $result['name_tour'] : $result['name'], 16), 'model' => $result['model'], 'schedule_title' => $result['schedule'], 'schedule' => cutString($result['schedule'], 18), 'price' => $price, 'special' => $result['special'], 'duration' => $result['duration'] ? $result['duration'] : 'Nữa ngày', 'special' => $special ? $special : 'Liên hệ', 'href' => $this->url->link('product/product', $custom_link . '&product_id=' . $result['product_id']), 'product_option_id' => $option_even);
             $option_even = array();
         }
     }
     /**********************products12**********************/
     $this->data['products28'] = array();
     $product = explode(',', $this->config->get('khmhue1nevendl_product'));
     if ($product) {
         foreach ($product as $product_id) {
             $result = $this->model_catalog_product->getProduct($product_id);
             if ($result['image'] && file_exists(DIR_IMAGE . $result['image'])) {
                 $image = $this->model_tool_image->cropsize($result['image'], $this->config->get('config_image_product_width'), $this->config->get('config_image_product_height'));
             } else {
                 $image = $this->model_tool_image->cropsize('no_image.jpg', $this->config->get('config_image_product_width'), $this->config->get('config_image_product_width'));
             }
             if ((double) $result['special']) {
                 $special = $this->currency->format($this->tax->calculate($result['special'], $result['tax_class_id'], $this->config->get('config_tax')));
             } else {
                 $special = false;
             }
             if ((double) $result['price']) {
                 $price = $this->currency->format($this->tax->calculate($result['price'], $result['tax_class_id'], $this->config->get('config_tax')));
             } else {
                 $price = false;
             }
             if (isset($result['custom_link'])) {
                 $custom_link = '&path=' . $result['custom_link'];
             } else {
                 $custom_link = "";
             }
             //  san pham o day
             $this->data['options'] = array();
             foreach ($this->model_catalog_product->getProductOptionsDL($result['product_id']) as $option) {
                 if ($option['type'] == 'select' || $option['type'] == 'radio' || $option['type'] == 'checkbox' || $option['type'] == 'image') {
                     $option_value_data = array();
                     foreach ($option['option_value'] as $option_value) {
                         if (!$option_value['subtract'] || $option_value['quantity'] > 0) {
                             if (($this->config->get('config_customer_price') && $this->customer->isLogged() || !$this->config->get('config_customer_price')) && (double) $option_value['price']) {
                                 $price = $this->currency->format($option_value['price']);
                             } else {
                                 $price = false;
                             }
                             $option_value_data[0] = array('product_option_value_id' => $option_value['product_option_value_id'], 'option_value_id' => $option_value['option_value_id'], 'name' => $option_value['name'], 'image' => $this->model_tool_image->onesize($option_value['image'], 50, 50), 'price' => $price);
                         }
                     }
                     $option_even[] = array('product_option_id' => $option['product_option_id'], 'option_id' => $option['option_id'], 'name' => $option['name'], 'type' => $option['type'], 'category' => $option['category'], 'class' => $option['class'], 'option_value' => $option_value_data, 'required' => $option['required']);
                 }
             }
             $this->data['products28'][] = array('product_id' => $result['product_id'], 'thumb' => $image, 'name' => $result['name_tour'] ? $result['name_tour'] : $result['name'], 'name_title' => cutString($result['name_tour'] ? $result['name_tour'] : $result['name'], 16), 'model' => $result['model'], 'schedule_title' => $result['schedule'], 'schedule' => cutString($result['schedule'], 18), 'price' => $price, 'special' => $result['special'], 'duration' => $result['duration'] ? $result['duration'] : 'Nữa ngày', 'special' => $special ? $special : 'Liên hệ', 'href' => $this->url->link('product/product', $custom_link . '&product_id=' . $result['product_id']), 'product_option_id' => $option_even);
             $option_even = array();
         }
     }
     /**********************products12**********************/
     $this->data['products29'] = array();
     $product = explode(',', $this->config->get('khmhue3nevendl_product'));
     if ($product) {
         foreach ($product as $product_id) {
             $result = $this->model_catalog_product->getProduct($product_id);
             if ($result['image'] && file_exists(DIR_IMAGE . $result['image'])) {
                 $image = $this->model_tool_image->cropsize($result['image'], $this->config->get('config_image_product_width'), $this->config->get('config_image_product_height'));
             } else {
                 $image = $this->model_tool_image->cropsize('no_image.jpg', $this->config->get('config_image_product_width'), $this->config->get('config_image_product_width'));
             }
             if ((double) $result['special']) {
                 $special = $this->currency->format($this->tax->calculate($result['special'], $result['tax_class_id'], $this->config->get('config_tax')));
             } else {
                 $special = false;
             }
             if ((double) $result['price']) {
                 $price = $this->currency->format($this->tax->calculate($result['price'], $result['tax_class_id'], $this->config->get('config_tax')));
             } else {
                 $price = false;
             }
             if (isset($result['custom_link'])) {
                 $custom_link = '&path=' . $result['custom_link'];
             } else {
                 $custom_link = "";
             }
             //  san pham o day
             $this->data['options'] = array();
             foreach ($this->model_catalog_product->getProductOptionsDL($result['product_id']) as $option) {
                 if ($option['type'] == 'select' || $option['type'] == 'radio' || $option['type'] == 'checkbox' || $option['type'] == 'image') {
                     $option_value_data = array();
                     foreach ($option['option_value'] as $option_value) {
                         if (!$option_value['subtract'] || $option_value['quantity'] > 0) {
                             if (($this->config->get('config_customer_price') && $this->customer->isLogged() || !$this->config->get('config_customer_price')) && (double) $option_value['price']) {
                                 $price = $this->currency->format($option_value['price']);
                             } else {
                                 $price = false;
                             }
                             $option_value_data[0] = array('product_option_value_id' => $option_value['product_option_value_id'], 'option_value_id' => $option_value['option_value_id'], 'name' => $option_value['name'], 'image' => $this->model_tool_image->onesize($option_value['image'], 50, 50), 'price' => $price);
                         }
                     }
                     $option_even[] = array('product_option_id' => $option['product_option_id'], 'option_id' => $option['option_id'], 'name' => $option['name'], 'type' => $option['type'], 'category' => $option['category'], 'class' => $option['class'], 'option_value' => $option_value_data, 'required' => $option['required']);
                 }
             }
             $this->data['products29'][] = array('product_id' => $result['product_id'], 'thumb' => $image, 'name' => $result['name_tour'] ? $result['name_tour'] : $result['name'], 'name_title' => cutString($result['name_tour'] ? $result['name_tour'] : $result['name'], 16), 'model' => $result['model'], 'schedule_title' => $result['schedule'], 'schedule' => cutString($result['schedule'], 18), 'price' => $price, 'special' => $result['special'], 'duration' => $result['duration'] ? $result['duration'] : 'Nữa ngày', 'special' => $special ? $special : 'Liên hệ', 'href' => $this->url->link('product/product', $custom_link . '&product_id=' . $result['product_id']), 'product_option_id' => $option_even);
             $option_even = array();
         }
     }
     /**********************products12**********************/
     $this->data['products30'] = array();
     $product = explode(',', $this->config->get('khmhue6nevendl_product'));
     if ($product) {
         foreach ($product as $product_id) {
             $result = $this->model_catalog_product->getProduct($product_id);
             if ($result['image'] && file_exists(DIR_IMAGE . $result['image'])) {
                 $image = $this->model_tool_image->cropsize($result['image'], $this->config->get('config_image_product_width'), $this->config->get('config_image_product_height'));
             } else {
                 $image = $this->model_tool_image->cropsize('no_image.jpg', $this->config->get('config_image_product_width'), $this->config->get('config_image_product_width'));
             }
             if ((double) $result['special']) {
                 $special = $this->currency->format($this->tax->calculate($result['special'], $result['tax_class_id'], $this->config->get('config_tax')));
             } else {
                 $special = false;
             }
             if ((double) $result['price']) {
                 $price = $this->currency->format($this->tax->calculate($result['price'], $result['tax_class_id'], $this->config->get('config_tax')));
             } else {
                 $price = false;
             }
             if (isset($result['custom_link'])) {
                 $custom_link = '&path=' . $result['custom_link'];
             } else {
                 $custom_link = "";
             }
             //  san pham o day
             $this->data['options'] = array();
             foreach ($this->model_catalog_product->getProductOptionsDL($result['product_id']) as $option) {
                 if ($option['type'] == 'select' || $option['type'] == 'radio' || $option['type'] == 'checkbox' || $option['type'] == 'image') {
                     $option_value_data = array();
                     foreach ($option['option_value'] as $option_value) {
                         if (!$option_value['subtract'] || $option_value['quantity'] > 0) {
                             if (($this->config->get('config_customer_price') && $this->customer->isLogged() || !$this->config->get('config_customer_price')) && (double) $option_value['price']) {
                                 $price = $this->currency->format($option_value['price']);
                             } else {
                                 $price = false;
                             }
                             $option_value_data[0] = array('product_option_value_id' => $option_value['product_option_value_id'], 'option_value_id' => $option_value['option_value_id'], 'name' => $option_value['name'], 'image' => $this->model_tool_image->onesize($option_value['image'], 50, 50), 'price' => $price);
                         }
                     }
                     $option_even[] = array('product_option_id' => $option['product_option_id'], 'option_id' => $option['option_id'], 'name' => $option['name'], 'type' => $option['type'], 'category' => $option['category'], 'class' => $option['class'], 'option_value' => $option_value_data, 'required' => $option['required']);
                 }
             }
             $this->data['products30'][] = array('product_id' => $result['product_id'], 'thumb' => $image, 'name' => $result['name_tour'] ? $result['name_tour'] : $result['name'], 'name_title' => cutString($result['name_tour'] ? $result['name_tour'] : $result['name'], 16), 'model' => $result['model'], 'schedule_title' => $result['schedule'], 'schedule' => cutString($result['schedule'], 18), 'price' => $price, 'special' => $result['special'], 'duration' => $result['duration'] ? $result['duration'] : 'Nữa ngày', 'special' => $special ? $special : 'Liên hệ', 'href' => $this->url->link('product/product', $custom_link . '&product_id=' . $result['product_id']), 'product_option_id' => $option_even);
             $option_even = array();
         }
     }
     /**********************products12**********************/
     $this->data['products31'] = array();
     $product = explode(',', $this->config->get('khmhn1nevendl_product'));
     if ($product) {
         foreach ($product as $product_id) {
             $result = $this->model_catalog_product->getProduct($product_id);
             if ($result['image'] && file_exists(DIR_IMAGE . $result['image'])) {
                 $image = $this->model_tool_image->cropsize($result['image'], $this->config->get('config_image_product_width'), $this->config->get('config_image_product_height'));
             } else {
                 $image = $this->model_tool_image->cropsize('no_image.jpg', $this->config->get('config_image_product_width'), $this->config->get('config_image_product_width'));
             }
             if ((double) $result['special']) {
                 $special = $this->currency->format($this->tax->calculate($result['special'], $result['tax_class_id'], $this->config->get('config_tax')));
             } else {
                 $special = false;
             }
             if ((double) $result['price']) {
                 $price = $this->currency->format($this->tax->calculate($result['price'], $result['tax_class_id'], $this->config->get('config_tax')));
             } else {
                 $price = false;
             }
             if (isset($result['custom_link'])) {
                 $custom_link = '&path=' . $result['custom_link'];
             } else {
                 $custom_link = "";
             }
             //  san pham o day
             $this->data['options'] = array();
             foreach ($this->model_catalog_product->getProductOptionsDL($result['product_id']) as $option) {
                 if ($option['type'] == 'select' || $option['type'] == 'radio' || $option['type'] == 'checkbox' || $option['type'] == 'image') {
                     $option_value_data = array();
                     foreach ($option['option_value'] as $option_value) {
                         if (!$option_value['subtract'] || $option_value['quantity'] > 0) {
                             if (($this->config->get('config_customer_price') && $this->customer->isLogged() || !$this->config->get('config_customer_price')) && (double) $option_value['price']) {
                                 $price = $this->currency->format($option_value['price']);
                             } else {
                                 $price = false;
                             }
                             $option_value_data[0] = array('product_option_value_id' => $option_value['product_option_value_id'], 'option_value_id' => $option_value['option_value_id'], 'name' => $option_value['name'], 'image' => $this->model_tool_image->onesize($option_value['image'], 50, 50), 'price' => $price);
                         }
                     }
                     $option_even[] = array('product_option_id' => $option['product_option_id'], 'option_id' => $option['option_id'], 'name' => $option['name'], 'type' => $option['type'], 'category' => $option['category'], 'class' => $option['class'], 'option_value' => $option_value_data, 'required' => $option['required']);
                 }
             }
             $this->data['products31'][] = array('product_id' => $result['product_id'], 'thumb' => $image, 'name' => $result['name_tour'] ? $result['name_tour'] : $result['name'], 'name_title' => cutString($result['name_tour'] ? $result['name_tour'] : $result['name'], 16), 'model' => $result['model'], 'schedule_title' => $result['schedule'], 'schedule' => cutString($result['schedule'], 18), 'price' => $price, 'special' => $result['special'], 'duration' => $result['duration'] ? $result['duration'] : 'Nữa ngày', 'special' => $special ? $special : 'Liên hệ', 'href' => $this->url->link('product/product', $custom_link . '&product_id=' . $result['product_id']), 'product_option_id' => $option_even);
             $option_even = array();
         }
     }
     /**********************products12**********************/
     $this->data['products32'] = array();
     $product = explode(',', $this->config->get('khmhn3nevendl_product'));
     if ($product) {
         foreach ($product as $product_id) {
             $result = $this->model_catalog_product->getProduct($product_id);
             if ($result['image'] && file_exists(DIR_IMAGE . $result['image'])) {
                 $image = $this->model_tool_image->cropsize($result['image'], $this->config->get('config_image_product_width'), $this->config->get('config_image_product_height'));
             } else {
                 $image = $this->model_tool_image->cropsize('no_image.jpg', $this->config->get('config_image_product_width'), $this->config->get('config_image_product_width'));
             }
             if ((double) $result['special']) {
                 $special = $this->currency->format($this->tax->calculate($result['special'], $result['tax_class_id'], $this->config->get('config_tax')));
             } else {
                 $special = false;
             }
             if ((double) $result['price']) {
                 $price = $this->currency->format($this->tax->calculate($result['price'], $result['tax_class_id'], $this->config->get('config_tax')));
             } else {
                 $price = false;
             }
             if (isset($result['custom_link'])) {
                 $custom_link = '&path=' . $result['custom_link'];
             } else {
                 $custom_link = "";
             }
             //  san pham o day
             $this->data['options'] = array();
             foreach ($this->model_catalog_product->getProductOptionsDL($result['product_id']) as $option) {
                 if ($option['type'] == 'select' || $option['type'] == 'radio' || $option['type'] == 'checkbox' || $option['type'] == 'image') {
                     $option_value_data = array();
                     foreach ($option['option_value'] as $option_value) {
                         if (!$option_value['subtract'] || $option_value['quantity'] > 0) {
                             if (($this->config->get('config_customer_price') && $this->customer->isLogged() || !$this->config->get('config_customer_price')) && (double) $option_value['price']) {
                                 $price = $this->currency->format($option_value['price']);
                             } else {
                                 $price = false;
                             }
                             $option_value_data[0] = array('product_option_value_id' => $option_value['product_option_value_id'], 'option_value_id' => $option_value['option_value_id'], 'name' => $option_value['name'], 'image' => $this->model_tool_image->onesize($option_value['image'], 50, 50), 'price' => $price);
                         }
                     }
                     $option_even[] = array('product_option_id' => $option['product_option_id'], 'option_id' => $option['option_id'], 'name' => $option['name'], 'type' => $option['type'], 'category' => $option['category'], 'class' => $option['class'], 'option_value' => $option_value_data, 'required' => $option['required']);
                 }
             }
             $this->data['products32'][] = array('product_id' => $result['product_id'], 'thumb' => $image, 'name' => $result['name_tour'] ? $result['name_tour'] : $result['name'], 'name_title' => cutString($result['name_tour'] ? $result['name_tour'] : $result['name'], 16), 'model' => $result['model'], 'schedule_title' => $result['schedule'], 'schedule' => cutString($result['schedule'], 18), 'price' => $price, 'special' => $result['special'], 'duration' => $result['duration'] ? $result['duration'] : 'Nữa ngày', 'special' => $special ? $special : 'Liên hệ', 'href' => $this->url->link('product/product', $custom_link . '&product_id=' . $result['product_id']), 'product_option_id' => $option_even);
             $option_even = array();
         }
     }
     /**********************products12**********************/
     $this->data['products33'] = array();
     $product = explode(',', $this->config->get('khmhn6nevendl_product'));
     if ($product) {
         foreach ($product as $product_id) {
             $result = $this->model_catalog_product->getProduct($product_id);
             if ($result['image'] && file_exists(DIR_IMAGE . $result['image'])) {
                 $image = $this->model_tool_image->cropsize($result['image'], $this->config->get('config_image_product_width'), $this->config->get('config_image_product_height'));
             } else {
                 $image = $this->model_tool_image->cropsize('no_image.jpg', $this->config->get('config_image_product_width'), $this->config->get('config_image_product_width'));
             }
             if ((double) $result['special']) {
                 $special = $this->currency->format($this->tax->calculate($result['special'], $result['tax_class_id'], $this->config->get('config_tax')));
             } else {
                 $special = false;
             }
             if ((double) $result['price']) {
                 $price = $this->currency->format($this->tax->calculate($result['price'], $result['tax_class_id'], $this->config->get('config_tax')));
             } else {
                 $price = false;
             }
             if (isset($result['custom_link'])) {
                 $custom_link = '&path=' . $result['custom_link'];
             } else {
                 $custom_link = "";
             }
             //  san pham o day
             $this->data['options'] = array();
             foreach ($this->model_catalog_product->getProductOptionsDL($result['product_id']) as $option) {
                 if ($option['type'] == 'select' || $option['type'] == 'radio' || $option['type'] == 'checkbox' || $option['type'] == 'image') {
                     $option_value_data = array();
                     foreach ($option['option_value'] as $option_value) {
                         if (!$option_value['subtract'] || $option_value['quantity'] > 0) {
                             if (($this->config->get('config_customer_price') && $this->customer->isLogged() || !$this->config->get('config_customer_price')) && (double) $option_value['price']) {
                                 $price = $this->currency->format($option_value['price']);
                             } else {
                                 $price = false;
                             }
                             $option_value_data[0] = array('product_option_value_id' => $option_value['product_option_value_id'], 'option_value_id' => $option_value['option_value_id'], 'name' => $option_value['name'], 'image' => $this->model_tool_image->onesize($option_value['image'], 50, 50), 'price' => $price);
                         }
                     }
                     $option_even[] = array('product_option_id' => $option['product_option_id'], 'option_id' => $option['option_id'], 'name' => $option['name'], 'type' => $option['type'], 'category' => $option['category'], 'class' => $option['class'], 'option_value' => $option_value_data, 'required' => $option['required']);
                 }
             }
             $this->data['products33'][] = array('product_id' => $result['product_id'], 'thumb' => $image, 'name' => $result['name_tour'] ? $result['name_tour'] : $result['name'], 'name_title' => cutString($result['name_tour'] ? $result['name_tour'] : $result['name'], 16), 'model' => $result['model'], 'schedule_title' => $result['schedule'], 'schedule' => cutString($result['schedule'], 18), 'price' => $price, 'special' => $result['special'], 'duration' => $result['duration'] ? $result['duration'] : 'Nữa ngày', 'special' => $special ? $special : 'Liên hệ', 'href' => $this->url->link('product/product', $custom_link . '&product_id=' . $result['product_id']), 'product_option_id' => $option_even);
             $option_even = array();
         }
     }
     /**********************products12**********************/
     $this->data['products34'] = array();
     $product = explode(',', $this->config->get('khmhl1nevendl_product'));
     if ($product) {
         foreach ($product as $product_id) {
             $result = $this->model_catalog_product->getProduct($product_id);
             if ($result['image'] && file_exists(DIR_IMAGE . $result['image'])) {
                 $image = $this->model_tool_image->cropsize($result['image'], $this->config->get('config_image_product_width'), $this->config->get('config_image_product_height'));
             } else {
                 $image = $this->model_tool_image->cropsize('no_image.jpg', $this->config->get('config_image_product_width'), $this->config->get('config_image_product_width'));
             }
             if ((double) $result['special']) {
                 $special = $this->currency->format($this->tax->calculate($result['special'], $result['tax_class_id'], $this->config->get('config_tax')));
             } else {
                 $special = false;
             }
             if ((double) $result['price']) {
                 $price = $this->currency->format($this->tax->calculate($result['price'], $result['tax_class_id'], $this->config->get('config_tax')));
             } else {
                 $price = false;
             }
             if (isset($result['custom_link'])) {
                 $custom_link = '&path=' . $result['custom_link'];
             } else {
                 $custom_link = "";
             }
             //  san pham o day
             $this->data['options'] = array();
             foreach ($this->model_catalog_product->getProductOptionsDL($result['product_id']) as $option) {
                 if ($option['type'] == 'select' || $option['type'] == 'radio' || $option['type'] == 'checkbox' || $option['type'] == 'image') {
                     $option_value_data = array();
                     foreach ($option['option_value'] as $option_value) {
                         if (!$option_value['subtract'] || $option_value['quantity'] > 0) {
                             if (($this->config->get('config_customer_price') && $this->customer->isLogged() || !$this->config->get('config_customer_price')) && (double) $option_value['price']) {
                                 $price = $this->currency->format($option_value['price']);
                             } else {
                                 $price = false;
                             }
                             $option_value_data[0] = array('product_option_value_id' => $option_value['product_option_value_id'], 'option_value_id' => $option_value['option_value_id'], 'name' => $option_value['name'], 'image' => $this->model_tool_image->onesize($option_value['image'], 50, 50), 'price' => $price);
                         }
                     }
                     $option_even[] = array('product_option_id' => $option['product_option_id'], 'option_id' => $option['option_id'], 'name' => $option['name'], 'type' => $option['type'], 'category' => $option['category'], 'class' => $option['class'], 'option_value' => $option_value_data, 'required' => $option['required']);
                 }
             }
             $this->data['products34'][] = array('product_id' => $result['product_id'], 'thumb' => $image, 'name' => $result['name_tour'] ? $result['name_tour'] : $result['name'], 'name_title' => cutString($result['name_tour'] ? $result['name_tour'] : $result['name'], 16), 'model' => $result['model'], 'schedule_title' => $result['schedule'], 'schedule' => cutString($result['schedule'], 18), 'price' => $price, 'special' => $result['special'], 'duration' => $result['duration'] ? $result['duration'] : 'Nữa ngày', 'special' => $special ? $special : 'Liên hệ', 'href' => $this->url->link('product/product', $custom_link . '&product_id=' . $result['product_id']), 'product_option_id' => $option_even);
             $option_even = array();
         }
     }
     /**********************products12**********************/
     $this->data['products35'] = array();
     $product = explode(',', $this->config->get('khmhl3nevendl_product'));
     if ($product) {
         foreach ($product as $product_id) {
             $result = $this->model_catalog_product->getProduct($product_id);
             if ($result['image'] && file_exists(DIR_IMAGE . $result['image'])) {
                 $image = $this->model_tool_image->cropsize($result['image'], $this->config->get('config_image_product_width'), $this->config->get('config_image_product_height'));
             } else {
                 $image = $this->model_tool_image->cropsize('no_image.jpg', $this->config->get('config_image_product_width'), $this->config->get('config_image_product_width'));
             }
             if ((double) $result['special']) {
                 $special = $this->currency->format($this->tax->calculate($result['special'], $result['tax_class_id'], $this->config->get('config_tax')));
             } else {
                 $special = false;
             }
             if ((double) $result['price']) {
                 $price = $this->currency->format($this->tax->calculate($result['price'], $result['tax_class_id'], $this->config->get('config_tax')));
             } else {
                 $price = false;
             }
             if (isset($result['custom_link'])) {
                 $custom_link = '&path=' . $result['custom_link'];
             } else {
                 $custom_link = "";
             }
             //  san pham o day
             $this->data['options'] = array();
             foreach ($this->model_catalog_product->getProductOptionsDL($result['product_id']) as $option) {
                 if ($option['type'] == 'select' || $option['type'] == 'radio' || $option['type'] == 'checkbox' || $option['type'] == 'image') {
                     $option_value_data = array();
                     foreach ($option['option_value'] as $option_value) {
                         if (!$option_value['subtract'] || $option_value['quantity'] > 0) {
                             if (($this->config->get('config_customer_price') && $this->customer->isLogged() || !$this->config->get('config_customer_price')) && (double) $option_value['price']) {
                                 $price = $this->currency->format($option_value['price']);
                             } else {
                                 $price = false;
                             }
                             $option_value_data[0] = array('product_option_value_id' => $option_value['product_option_value_id'], 'option_value_id' => $option_value['option_value_id'], 'name' => $option_value['name'], 'image' => $this->model_tool_image->onesize($option_value['image'], 50, 50), 'price' => $price);
                         }
                     }
                     $option_even[] = array('product_option_id' => $option['product_option_id'], 'option_id' => $option['option_id'], 'name' => $option['name'], 'type' => $option['type'], 'category' => $option['category'], 'class' => $option['class'], 'option_value' => $option_value_data, 'required' => $option['required']);
                 }
             }
             $this->data['products35'][] = array('product_id' => $result['product_id'], 'thumb' => $image, 'name' => $result['name_tour'] ? $result['name_tour'] : $result['name'], 'name_title' => cutString($result['name_tour'] ? $result['name_tour'] : $result['name'], 16), 'model' => $result['model'], 'schedule_title' => $result['schedule'], 'schedule' => cutString($result['schedule'], 18), 'price' => $price, 'special' => $result['special'], 'duration' => $result['duration'] ? $result['duration'] : 'Nữa ngày', 'special' => $special ? $special : 'Liên hệ', 'href' => $this->url->link('product/product', $custom_link . '&product_id=' . $result['product_id']), 'product_option_id' => $option_even);
             $option_even = array();
         }
     }
     /**********************products12**********************/
     $this->data['products36'] = array();
     $product = explode(',', $this->config->get('khmhl6nevendl_product'));
     if ($product) {
         foreach ($product as $product_id) {
             $result = $this->model_catalog_product->getProduct($product_id);
             if ($result['image'] && file_exists(DIR_IMAGE . $result['image'])) {
                 $image = $this->model_tool_image->cropsize($result['image'], $this->config->get('config_image_product_width'), $this->config->get('config_image_product_height'));
             } else {
                 $image = $this->model_tool_image->cropsize('no_image.jpg', $this->config->get('config_image_product_width'), $this->config->get('config_image_product_width'));
             }
             if ((double) $result['special']) {
                 $special = $this->currency->format($this->tax->calculate($result['special'], $result['tax_class_id'], $this->config->get('config_tax')));
             } else {
                 $special = false;
             }
             if ((double) $result['price']) {
                 $price = $this->currency->format($this->tax->calculate($result['price'], $result['tax_class_id'], $this->config->get('config_tax')));
             } else {
                 $price = false;
             }
             if (isset($result['custom_link'])) {
                 $custom_link = '&path=' . $result['custom_link'];
             } else {
                 $custom_link = "";
             }
             //  san pham o day
             $this->data['options'] = array();
             foreach ($this->model_catalog_product->getProductOptionsDL($result['product_id']) as $option) {
                 if ($option['type'] == 'select' || $option['type'] == 'radio' || $option['type'] == 'checkbox' || $option['type'] == 'image') {
                     $option_value_data = array();
                     foreach ($option['option_value'] as $option_value) {
                         if (!$option_value['subtract'] || $option_value['quantity'] > 0) {
                             if (($this->config->get('config_customer_price') && $this->customer->isLogged() || !$this->config->get('config_customer_price')) && (double) $option_value['price']) {
                                 $price = $this->currency->format($option_value['price']);
                             } else {
                                 $price = false;
                             }
                             $option_value_data[0] = array('product_option_value_id' => $option_value['product_option_value_id'], 'option_value_id' => $option_value['option_value_id'], 'name' => $option_value['name'], 'image' => $this->model_tool_image->onesize($option_value['image'], 50, 50), 'price' => $price);
                         }
                     }
                     $option_even[] = array('product_option_id' => $option['product_option_id'], 'option_id' => $option['option_id'], 'name' => $option['name'], 'type' => $option['type'], 'category' => $option['category'], 'class' => $option['class'], 'option_value' => $option_value_data, 'required' => $option['required']);
                 }
             }
             $this->data['products36'][] = array('product_id' => $result['product_id'], 'thumb' => $image, 'name' => $result['name_tour'] ? $result['name_tour'] : $result['name'], 'name_title' => cutString($result['name_tour'] ? $result['name_tour'] : $result['name'], 16), 'model' => $result['model'], 'schedule_title' => $result['schedule'], 'schedule' => cutString($result['schedule'], 18), 'price' => $price, 'special' => $result['special'], 'duration' => $result['duration'] ? $result['duration'] : 'Nữa ngày', 'special' => $special ? $special : 'Liên hệ', 'href' => $this->url->link('product/product', $custom_link . '&product_id=' . $result['product_id']), 'product_option_id' => $option_even);
             $option_even = array();
         }
     }
     /**********************products12**********************/
     $this->data['products37'] = array();
     $product = explode(',', $this->config->get('khmsp1nevendl_product'));
     if ($product) {
         foreach ($product as $product_id) {
             $result = $this->model_catalog_product->getProduct($product_id);
             if ($result['image'] && file_exists(DIR_IMAGE . $result['image'])) {
                 $image = $this->model_tool_image->cropsize($result['image'], $this->config->get('config_image_product_width'), $this->config->get('config_image_product_height'));
             } else {
                 $image = $this->model_tool_image->cropsize('no_image.jpg', $this->config->get('config_image_product_width'), $this->config->get('config_image_product_width'));
             }
             if ((double) $result['special']) {
                 $special = $this->currency->format($this->tax->calculate($result['special'], $result['tax_class_id'], $this->config->get('config_tax')));
             } else {
                 $special = false;
             }
             if ((double) $result['price']) {
                 $price = $this->currency->format($this->tax->calculate($result['price'], $result['tax_class_id'], $this->config->get('config_tax')));
             } else {
                 $price = false;
             }
             if (isset($result['custom_link'])) {
                 $custom_link = '&path=' . $result['custom_link'];
             } else {
                 $custom_link = "";
             }
             //  san pham o day
             $this->data['options'] = array();
             foreach ($this->model_catalog_product->getProductOptionsDL($result['product_id']) as $option) {
                 if ($option['type'] == 'select' || $option['type'] == 'radio' || $option['type'] == 'checkbox' || $option['type'] == 'image') {
                     $option_value_data = array();
                     foreach ($option['option_value'] as $option_value) {
                         if (!$option_value['subtract'] || $option_value['quantity'] > 0) {
                             if (($this->config->get('config_customer_price') && $this->customer->isLogged() || !$this->config->get('config_customer_price')) && (double) $option_value['price']) {
                                 $price = $this->currency->format($option_value['price']);
                             } else {
                                 $price = false;
                             }
                             $option_value_data[0] = array('product_option_value_id' => $option_value['product_option_value_id'], 'option_value_id' => $option_value['option_value_id'], 'name' => $option_value['name'], 'image' => $this->model_tool_image->onesize($option_value['image'], 50, 50), 'price' => $price);
                         }
                     }
                     $option_even[] = array('product_option_id' => $option['product_option_id'], 'option_id' => $option['option_id'], 'name' => $option['name'], 'type' => $option['type'], 'category' => $option['category'], 'class' => $option['class'], 'option_value' => $option_value_data, 'required' => $option['required']);
                 }
             }
             $this->data['products37'][] = array('product_id' => $result['product_id'], 'thumb' => $image, 'name' => $result['name_tour'] ? $result['name_tour'] : $result['name'], 'name_title' => cutString($result['name_tour'] ? $result['name_tour'] : $result['name'], 16), 'model' => $result['model'], 'schedule_title' => $result['schedule'], 'schedule' => cutString($result['schedule'], 18), 'price' => $price, 'special' => $result['special'], 'duration' => $result['duration'] ? $result['duration'] : 'Nữa ngày', 'special' => $special ? $special : 'Liên hệ', 'href' => $this->url->link('product/product', $custom_link . '&product_id=' . $result['product_id']), 'product_option_id' => $option_even);
             $option_even = array();
         }
     }
     /**********************products12**********************/
     $this->data['products38'] = array();
     $product = explode(',', $this->config->get('khmsp3nevendl_product'));
     if ($product) {
         foreach ($product as $product_id) {
             $result = $this->model_catalog_product->getProduct($product_id);
             if ($result['image'] && file_exists(DIR_IMAGE . $result['image'])) {
                 $image = $this->model_tool_image->cropsize($result['image'], $this->config->get('config_image_product_width'), $this->config->get('config_image_product_height'));
             } else {
                 $image = $this->model_tool_image->cropsize('no_image.jpg', $this->config->get('config_image_product_width'), $this->config->get('config_image_product_width'));
             }
             if ((double) $result['special']) {
                 $special = $this->currency->format($this->tax->calculate($result['special'], $result['tax_class_id'], $this->config->get('config_tax')));
             } else {
                 $special = false;
             }
             if ((double) $result['price']) {
                 $price = $this->currency->format($this->tax->calculate($result['price'], $result['tax_class_id'], $this->config->get('config_tax')));
             } else {
                 $price = false;
             }
             if (isset($result['custom_link'])) {
                 $custom_link = '&path=' . $result['custom_link'];
             } else {
                 $custom_link = "";
             }
             //  san pham o day
             $this->data['options'] = array();
             foreach ($this->model_catalog_product->getProductOptionsDL($result['product_id']) as $option) {
                 if ($option['type'] == 'select' || $option['type'] == 'radio' || $option['type'] == 'checkbox' || $option['type'] == 'image') {
                     $option_value_data = array();
                     foreach ($option['option_value'] as $option_value) {
                         if (!$option_value['subtract'] || $option_value['quantity'] > 0) {
                             if (($this->config->get('config_customer_price') && $this->customer->isLogged() || !$this->config->get('config_customer_price')) && (double) $option_value['price']) {
                                 $price = $this->currency->format($option_value['price']);
                             } else {
                                 $price = false;
                             }
                             $option_value_data[0] = array('product_option_value_id' => $option_value['product_option_value_id'], 'option_value_id' => $option_value['option_value_id'], 'name' => $option_value['name'], 'image' => $this->model_tool_image->onesize($option_value['image'], 50, 50), 'price' => $price);
                         }
                     }
                     $option_even[] = array('product_option_id' => $option['product_option_id'], 'option_id' => $option['option_id'], 'name' => $option['name'], 'type' => $option['type'], 'category' => $option['category'], 'class' => $option['class'], 'option_value' => $option_value_data, 'required' => $option['required']);
                 }
             }
             $this->data['products38'][] = array('product_id' => $result['product_id'], 'thumb' => $image, 'name' => $result['name_tour'] ? $result['name_tour'] : $result['name'], 'name_title' => cutString($result['name_tour'] ? $result['name_tour'] : $result['name'], 16), 'model' => $result['model'], 'schedule_title' => $result['schedule'], 'schedule' => cutString($result['schedule'], 18), 'price' => $price, 'special' => $result['special'], 'duration' => $result['duration'] ? $result['duration'] : 'Nữa ngày', 'special' => $special ? $special : 'Liên hệ', 'href' => $this->url->link('product/product', $custom_link . '&product_id=' . $result['product_id']), 'product_option_id' => $option_even);
             $option_even = array();
         }
     }
     /**********************products12**********************/
     $this->data['products39'] = array();
     $product = explode(',', $this->config->get('khmsp6nevendl_product'));
     if ($product) {
         foreach ($product as $product_id) {
             $result = $this->model_catalog_product->getProduct($product_id);
             if ($result['image'] && file_exists(DIR_IMAGE . $result['image'])) {
                 $image = $this->model_tool_image->cropsize($result['image'], $this->config->get('config_image_product_width'), $this->config->get('config_image_product_height'));
             } else {
                 $image = $this->model_tool_image->cropsize('no_image.jpg', $this->config->get('config_image_product_width'), $this->config->get('config_image_product_width'));
             }
             if ((double) $result['special']) {
                 $special = $this->currency->format($this->tax->calculate($result['special'], $result['tax_class_id'], $this->config->get('config_tax')));
             } else {
                 $special = false;
             }
             if ((double) $result['price']) {
                 $price = $this->currency->format($this->tax->calculate($result['price'], $result['tax_class_id'], $this->config->get('config_tax')));
             } else {
                 $price = false;
             }
             if (isset($result['custom_link'])) {
                 $custom_link = '&path=' . $result['custom_link'];
             } else {
                 $custom_link = "";
             }
             //  san pham o day
             $this->data['options'] = array();
             foreach ($this->model_catalog_product->getProductOptionsDL($result['product_id']) as $option) {
                 if ($option['type'] == 'select' || $option['type'] == 'radio' || $option['type'] == 'checkbox' || $option['type'] == 'image') {
                     $option_value_data = array();
                     foreach ($option['option_value'] as $option_value) {
                         if (!$option_value['subtract'] || $option_value['quantity'] > 0) {
                             if (($this->config->get('config_customer_price') && $this->customer->isLogged() || !$this->config->get('config_customer_price')) && (double) $option_value['price']) {
                                 $price = $this->currency->format($option_value['price']);
                             } else {
                                 $price = false;
                             }
                             $option_value_data[0] = array('product_option_value_id' => $option_value['product_option_value_id'], 'option_value_id' => $option_value['option_value_id'], 'name' => $option_value['name'], 'image' => $this->model_tool_image->onesize($option_value['image'], 50, 50), 'price' => $price);
                         }
                     }
                     $option_even[] = array('product_option_id' => $option['product_option_id'], 'option_id' => $option['option_id'], 'name' => $option['name'], 'type' => $option['type'], 'category' => $option['category'], 'class' => $option['class'], 'option_value' => $option_value_data, 'required' => $option['required']);
                 }
             }
             $this->data['products39'][] = array('product_id' => $result['product_id'], 'thumb' => $image, 'name' => $result['name_tour'] ? $result['name_tour'] : $result['name'], 'name_title' => cutString($result['name_tour'] ? $result['name_tour'] : $result['name'], 16), 'model' => $result['model'], 'schedule_title' => $result['schedule'], 'schedule' => cutString($result['schedule'], 18), 'price' => $price, 'special' => $result['special'], 'duration' => $result['duration'] ? $result['duration'] : 'Nữa ngày', 'special' => $special ? $special : 'Liên hệ', 'href' => $this->url->link('product/product', $custom_link . '&product_id=' . $result['product_id']), 'product_option_id' => $option_even);
             $option_even = array();
         }
     }
     if (file_exists(DIR_TEMPLATE . $this->config->get('config_template') . '/template/promotion/duonglich.tpl')) {
         $this->template = $this->config->get('config_template') . '/template/promotion/duonglich.tpl';
     } else {
         $this->template = 'default/template/promotion/duonglich.tpl';
     }
     $this->children = array('common/column_left', 'common/column_right', 'common/content_top', 'common/content_bottom', 'common/footer', 'common/header', 'module/comment');
     $this->response->setOutput($this->render());
 }
コード例 #30
0
<?php

// Nama			: Ryan Yonata
// NIM			: 13513074
// Nama file 	: QuestionList.php
// Keterangan	: Berisi kode php untuk mendpatkan dan menampilkan list pertanyaan
include 'ConnectDatabase.php';
$sql = "SELECT * FROM Questions ORDER BY Date_Created DESC";
$result = mysqli_query($conn, $sql);
include 'stringProcessing.php';
while ($row = mysqli_fetch_assoc($result)) {
    echo "<div class='questioncontainer'>";
    echo "<div class='vote'>" . "<a class='vote-count'>" . $row["Vote"] . "</a>" . "\t\t\t<br>" . "<a class='vote-tag'> Vote </a>" . "</div>";
    $sql_answercount = "SELECT count(*) AS SUM FROM Answers WHERE Question_ID = '{$row['ID']}' ";
    $answercount = mysqli_query($conn, $sql_answercount);
    $row_answercount = mysqli_fetch_array($answercount);
    $stringShow = cutString($row["Content"]);
    echo "<div class='answer'>" . "<a class='answer-count'>" . $row_answercount["SUM"] . "</a>" . "\t\t\t<br>" . "<a class='answer-tag'>Answer</a>" . "</div>";
    echo "<div class='question'>" . "\t\t\t<a href='Answers.php?id={$row['ID']}' class='question-topic'> {$row['Topic']} </br>" . "\t\t\t</a>" . "\t\t\t<span class='question-content'>" . $stringShow . " </span>" . "</div>";
    echo "<div class='modif-question'>" . "asked by <a class='Name'>{$row['Name']}</a> | " . "<a href='askform.php?id={$row['ID']}' id='edit'> edit </a> | " . "<a href='delete.php?id={$row['ID']}' onclick=\"return confirm('Are you sure you want to delete this question?')\" id='delete_link'>delete</a>" . "</div>";
    echo "<br>";
    echo "<br>";
    //echo "<br>";
    echo "<div class='linequestion'>" . "\t<hr>" . "</div>";
    echo "</div>";
}
mysqli_close($conn);
?>