Ejemplo n.º 1
0
 public function initialize()
 {
     global $lC_Services, $lC_RecentlyVisited, $lC_Language, $lC_Image, $lC_Product;
     if ($lC_Services->isStarted('recently_visited') && $lC_RecentlyVisited->hasHistory()) {
         $this->_content = '';
         if ($lC_RecentlyVisited->hasProducts()) {
             foreach ($lC_RecentlyVisited->getProducts() as $product) {
                 // VQMOD-hookpoint; DO NOT MODIFY OR REMOVE THE LINE BELOW
                 $lC_Product = new lC_Product($product['id']);
                 $this->_content .= '<div class="content-recently-visited-container">' . "\n" . '  <div class="content-recently-visited-name">' . lc_link_object(lc_href_link(FILENAME_PRODUCTS, $lC_Product->getKeyword()), $lC_Product->getTitle()) . '</div>' . "\n";
                 if ($lC_Product->hasImage()) {
                     $this->_content .= '<div class="content-recently-visited-image">' . (SERVICE_RECENTLY_VISITED_SHOW_PRODUCT_IMAGES == '1' ? lc_link_object(lc_href_link(FILENAME_PRODUCTS, $lC_Product->getKeyword()), $lC_Image->show($lC_Product->getImage(), $lC_Product->getTitle(), 'class="content-recently-visited-image-src"', 'small')) : NULL) . '</div>' . "\n";
                 }
                 $this->_content .= '  <div class="content-recently-visited-price pricing-row">' . $lC_Product->getPriceFormated(true) . '</div>' . "\n" . '  <div class="content-recently-visited-from">' . sprintf($lC_Language->get('recently_visited_item_in_category'), lc_link_object(lc_href_link(FILENAME_DEFAULT, 'cPath=' . $product['category_path']), $product['category_name'])) . '</div>' . "\n" . '</div>' . "\n";
             }
         }
         if ($lC_RecentlyVisited->hasCategories()) {
             foreach ($lC_RecentlyVisited->getCategories() as $category) {
                 // VQMOD-hookpoint; DO NOT MODIFY OR REMOVE THE LINE BELOW
                 if (!empty($category['parent_id'])) {
                     $this->_content .= '<div class="content-recently-visited-container">' . "\n" . '  <div class="content-recently-visited-name">' . sprintf($lC_Language->get('recently_visited_item_in_category'), lc_link_object(lc_href_link(FILENAME_DEFAULT, 'cPath=' . $product['category_path']), $product['category_name'])) . '</div>' . "\n";
                     if (isset($category['image']) && empty($category['image']) === false) {
                         $this->_content .= '<div class="content-recently-visited-image">' . (SERVICE_RECENTLY_VISITED_SHOW_CATEGORY_IMAGES == '1' ? lc_link_object(lc_href_link(FILENAME_DEFAULT, 'cPath=' . $category['id']), lc_image('images/categories/' . $category['image'], $category['name'], null, null, 'class="content-recently-visited-image-src"')) : NULL) . '</div>' . "\n";
                     }
                     $this->_content .= '  <div class="content-recently-visited-price pricing-row"></div>' . "\n" . '  <div class="content-recently-visited-from">' . sprintf($lC_Language->get('recently_visited_item_in_category'), lc_link_object(lc_href_link(FILENAME_DEFAULT, 'cPath=' . $category['parent_id']), $category['parent_name'])) . '</div>' . "\n" . '</div>' . "\n";
                 }
             }
         }
         if ($lC_RecentlyVisited->hasSearches()) {
             foreach ($lC_RecentlyVisited->getSearches() as $searchphrase) {
                 //          $this->_content .= '<div class="content-recently-visited-searches">' . lc_link_object(lc_href_link(FILENAME_SEARCH, 'keywords=' . $searchphrase['keywords']), lc_output_string_protected($searchphrase['keywords'])) . ' <i>(' . number_format($searchphrase['results']) . ' results)</i></div>';
             }
         }
     }
 }
Ejemplo n.º 2
0
 public static function getAll()
 {
     global $lC_Database, $lC_Language;
     $media = $_GET['media'];
     $lC_Currencies = new lC_Currencies();
     $lC_Tax = new lC_Tax_Admin();
     $lC_GeoIP = lC_GeoIP_Admin::load();
     if ($lC_GeoIP->isInstalled()) {
         $lC_GeoIP->activate();
     }
     $xx_mins_ago = time() - 900;
     // remove entries that have expired
     $Qdelete = $lC_Database->query('delete from :table_whos_online where time_last_click < :time_last_click');
     $Qdelete->bindTable(':table_whos_online', TABLE_WHOS_ONLINE);
     $Qdelete->bindValue(':time_last_click', $xx_mins_ago);
     $Qdelete->execute();
     $result = array('aaData' => array());
     $Qwho = $lC_Database->query('select customer_id, full_name, ip_address, time_entry, time_last_click, session_id from :table_whos_online order by time_last_click desc');
     $Qwho->bindTable(':table_whos_online', TABLE_WHOS_ONLINE);
     $Qwho->execute();
     while ($Qwho->next()) {
         if (STORE_SESSIONS == 'database') {
             $Qsession = $lC_Database->query('select value from :table_sessions where id = :id');
             $Qsession->bindTable(':table_sessions', TABLE_SESSIONS);
             $Qsession->bindValue(':id', $Qwho->value('session_id'));
             $Qsession->execute();
             $session_data = trim($Qsession->value('value'));
         } else {
             if (file_exists($lC_Session->getSavePath() . '/sess_' . $Qwho->value('session_id')) && filesize($lC_Session->getSavePath() . '/sess_' . $Qwho->value('session_id')) > 0) {
                 $session_data = trim(file_get_contents($lC_Session->getSavePath() . '/sess_' . $Qwho->value('session_id')));
             }
         }
         $navigation = unserialize(lc_get_serialized_variable($session_data, 'lC_NavigationHistory_data', 'array'));
         $last_page = is_array($navigation) ? end($navigation) : 0;
         $currency = unserialize(lc_get_serialized_variable($session_data, 'currency', 'string'));
         $cart = unserialize(lc_get_serialized_variable($session_data, 'lC_ShoppingCart_data', 'array'));
         $check = '<td><input class="batch" type="checkbox" name="batch[]" value="' . $Qwho->value('session_id') . '" id="' . $Qwho->value('session_id') . '"></td>';
         if ($lC_GeoIP->isActive() && $lC_GeoIP->isValid($Qwho->value('ip_address'))) {
             $who = '<td>' . lc_image('../images/worldflags/' . $lC_GeoIP->getCountryISOCode2($Qwho->value('ip_address')) . '.png', $lC_GeoIP->getCountryName($Qwho->value('ip_address')) . ', ' . $Qwho->value('ip_address'), 18, 12) . ' ' . strtoupper($lC_GeoIP->getCountryISOCode2($Qwho->value('ip_address'))) . ', ' . $Qwho->value('ip_address') . '</td>';
         } else {
             $who = '<td>' . lc_image('images/pixel_trans.gif', $Qwho->value('ip_address'), 18, 12) . ' ' . $Qwho->value('ip_address') . '</td>';
         }
         $online = '<td>' . gmdate('H:i:s', time() - $Qwho->value('time_entry')) . '</td>';
         $customers = '<td>' . $Qwho->value('full_name') . ' (' . $Qwho->valueInt('customer_id') . ')</td>';
         $click = '<td>' . @date('H:i:s', $Qwho->value('time_last_click')) . '</td>';
         $url = '<td>' . $last_page['page'] . '</td>';
         $total = '<td>' . $lC_Currencies->format($cart['total_cost'], true, $currency) . '</td>';
         $action = '<td class="align-right vertical-center">
                <span class="button-group"> 
                  <a href="' . ((int) ($_SESSION['admin']['access']['whos_online'] < 2) ? '#' : 'javascript://" onclick="showInfo(\'' . $Qwho->value('session_id') . '\')') . '" class="button icon-question-round icon-blue' . ((int) ($_SESSION['admin']['access']['whos_online'] < 2) ? ' disabled' : NULL) . '">' . ($media === 'mobile-portrait' || $media === 'mobile-landscape' ? NULL : $lC_Language->get('button_info')) . '</a>
                </span>
                <span class="button-group">
                  <a href="' . ((int) ($_SESSION['admin']['access']['whos_online'] < 4) ? '#' : 'javascript://" onclick="deleteEntry(\'' . $Qwho->value('session_id') . '\',\'' . $Qwho->value('full_name') . '\')"') . '" class="button icon-trash with-tooltip' . ((int) ($_SESSION['admin']['access']['whos_online'] < 4) ? ' disabled' : NULL) . '" title="' . $lC_Language->get('icon_delete') . '"></a>
                </span>
              </td>';
         $result['aaData'][] = array("{$check}", "{$who}", "{$online}", "{$customers}", "{$click}", "{$url}", "{$total}", "{$action}");
     }
     return $result;
 }
Ejemplo n.º 3
0
 public function quote()
 {
     global $lC_Language, $lC_Currencies;
     $this->quotes = array('id' => $this->_code, 'module' => $this->_title, 'methods' => array(array('id' => $this->_code, 'title' => sprintf($lC_Language->get('shipping_free_for_amount'), $lC_Currencies->format(ADDONS_SHIPPING_FREE_SHIPPING_MINIMUM_ORDER)), 'cost' => 0)), 'tax_class_id' => 0);
     if (!empty($this->icon)) {
         $this->quotes['icon'] = lc_image($this->icon, $this->_title);
     }
     return $this->quotes;
 }
Ejemplo n.º 4
0
 public static function getAll()
 {
     global $lC_Language, $lC_Vqmod;
     $media = $_GET['media'];
     $lC_DirectoryListing = new lC_DirectoryListing('includes/templates');
     $lC_DirectoryListing->setIncludeDirectories(false);
     $files = $lC_DirectoryListing->getFiles();
     $cnt = 0;
     $result = array('aaData' => array());
     // sort the array of files so the default template is at top
     $default = array();
     $other = array();
     foreach ($files as $file) {
         if (strpos($file['name'], '.') !== (int) 0) {
             $code = substr($file['name'], 0, strrpos($file['name'], '.'));
             if ($code == DEFAULT_TEMPLATE) {
                 $default[] = $file;
             } else {
                 $other[] = $file;
             }
             $sorted = array_merge((array) $default, (array) $other);
         }
     }
     foreach ($sorted as $file) {
         if (strpos($file['name'], '.') !== (int) 0) {
             include $lC_Vqmod->modCheck('includes/templates/' . $file['name']);
             $code = substr($file['name'], 0, strrpos($file['name'], '.'));
             $class = 'lC_Template_' . $code;
             if (class_exists($class)) {
                 $module = new $class();
                 $image = '<a href="' . ((int) ($_SESSION['admin']['access']['templates'] < 3) ? '#' : 'javascript://" onclick="showInfo(\'' . str_ireplace('.php', '', $file['name']) . '\', \'' . $module->getTitle() . '\')') . '" class="' . ((int) ($_SESSION['admin']['access']['templates'] < 3) ? ' disabled' : NULL) . '">' . lc_image(DIR_WS_CATALOG . 'templates/' . $code . '/images/' . $module->getScreenshot(), null, 160, 120) . '</a>';
                 $module_title = $module->getTitle();
                 if ($module->getCode() == DEFAULT_TEMPLATE) {
                     $module_title .= '<small class="tag purple-gradient glossy margin-left">' . $lC_Language->get('default_entry') . '</small>';
                 }
                 $name = '<div class="strong">' . $module_title . '</div><div class="mid-margin-top"><a href="' . $module->getAuthorAddress() . '" target="_blank">' . $module->getAuthorName() . '</a></div><div class="mid-margin-top"><small>' . $module->getMarkup() . ' ' . $module->getMedium() . '</small></div>';
                 $action = '<span class="button-group compact">';
                 if ($module->isInstalled() && $module->isActive()) {
                     if ($module->hasKeys() || $module->getCode() != DEFAULT_TEMPLATE) {
                         $action .= '<a href="' . ((int) ($_SESSION['admin']['access']['templates'] < 3) ? '#' : 'javascript://" onclick="editTemplate(\'' . str_ireplace('.php', '', $file['name']) . '\')') . '" class="button icon-pencil' . ((int) ($_SESSION['admin']['access']['templates'] < 3) ? ' disabled' : NULL) . '">' . ($media === 'mobile-portrait' || $media === 'mobile-landscape' ? NULL : $lC_Language->get('icon_edit')) . '</a>';
                     }
                     if ($module->getCode() != DEFAULT_TEMPLATE) {
                         $action .= '<a href="' . ((int) ($_SESSION['admin']['access']['templates'] < 3) ? '#' : 'javascript://" onclick="uninstallTemplate(\'' . str_ireplace('.php', '', $file['name']) . '\', \'' . $module->getTitle() . '\')') . '" class="button icon-minus-round icon-red with-tooltip' . ((int) ($_SESSION['admin']['access']['templates'] < 3) ? ' disabled' : NULL) . '" title="' . $lC_Language->get('icon_uninstall') . '"></a>';
                     }
                 } else {
                     $action .= '<a href="' . ((int) ($_SESSION['admin']['access']['templates'] < 3) ? '#' : 'javascript://" onclick="installTemplate(\'' . str_ireplace('.php', '', $file['name']) . '\', \'' . $module->getTitle() . '\')') . '" class="button icon-plus-round icon-green with-tooltip' . ((int) ($_SESSION['admin']['access']['templates'] < 3) ? ' disabled' : NULL) . '" title="' . $lC_Language->get('icon_install') . '"></a>';
                 }
                 $action .= '<a href="' . ((int) ($_SESSION['admin']['access']['templates'] < 3) ? '#' : 'javascript://" onclick="showInfo(\'' . str_ireplace('.php', '', $file['name']) . '\', \'' . $module->getTitle() . '\')') . '" class="button icon-camera icon-blue with-tooltip' . ((int) ($_SESSION['admin']['access']['templates'] < 3) ? ' disabled' : NULL) . '" title="' . $lC_Language->get('icon_preview') . '"></a>';
                 $result['aaData'][] = array("{$image}", "{$name}", "{$action}");
                 $cnt++;
             }
         }
     }
     return $result;
 }
Ejemplo n.º 5
0
 function process()
 {
     global $lC_Coupons, $lC_Currencies;
     if (defined('MODULE_SERVICES_INSTALLED') && in_array('coupons', explode(';', MODULE_SERVICES_INSTALLED)) && isset($lC_Coupons)) {
         foreach ($lC_Coupons->getAll() as $code => $val) {
             if ($val['total'] > 0) {
                 $this->output[] = array('title' => $val['title'], 'text' => '<span onclick="removeCoupon(\'' . $code . '\');" style="padding:0; cursor:pointer;">' . lc_image(DIR_WS_CATALOG . 'templates/core/images/icons/16/cross_round.png', null, null, null, 'style="vertical-align:middle;"') . '&nbsp;-' . $lC_Currencies->format($val['total']) . '</span>', 'value' => $val['total']);
             }
         }
     }
 }
Ejemplo n.º 6
0
 public function initialize()
 {
     global $lC_Database, $lC_Services, $lC_Cache, $lC_Language, $lC_Product, $lC_Image;
     $this->_title_link = lc_href_link(FILENAME_PRODUCTS, 'reviews');
     if ($lC_Services->isStarted('reviews')) {
         if ($lC_Cache->isEnabled() && BOX_REVIEWS_CACHE > 0 && $lC_Cache->read('box-reviews' . (isset($lC_Product) && is_a($lC_Product, 'lC_Product') && $lC_Product->isValid() ? '-' . $lC_Product->getID() : '') . '-' . $lC_Language->getCode(), BOX_REVIEWS_CACHE)) {
             $data = $lC_Cache->getCache();
         } else {
             $data = array();
             $Qreview = $lC_Database->query('select r.reviews_id, r.reviews_rating, p.products_id, pd.products_name, pd.products_keyword, i.image from :table_reviews r, :table_products p left join :table_products_images i on (p.products_id = i.products_id and i.default_flag = :default_flag), :table_products_description pd where r.products_id = p.products_id and p.products_status = 1 and r.languages_id = :language_id and p.products_id = pd.products_id and pd.language_id = :language_id and r.reviews_status = 1');
             $Qreview->bindTable(':table_reviews', TABLE_REVIEWS);
             $Qreview->bindTable(':table_products_images', TABLE_PRODUCTS_IMAGES);
             $Qreview->bindTable(':table_products', TABLE_PRODUCTS);
             $Qreview->bindTable(':table_products_description', TABLE_PRODUCTS_DESCRIPTION);
             $Qreview->bindInt(':default_flag', 1);
             $Qreview->bindInt(':language_id', $lC_Language->getID());
             $Qreview->bindInt(':language_id', $lC_Language->getID());
             if (isset($lC_Product) && is_a($lC_Product, 'lC_Product') && $lC_Product->isValid()) {
                 $Qreview->appendQuery('and p.products_id = :products_id');
                 $Qreview->bindInt(':products_id', $lC_Product->getID());
             }
             $Qreview->appendQuery('order by r.reviews_id desc limit :max_random_select_reviews');
             $Qreview->bindInt(':max_random_select_reviews', BOX_REVIEWS_RANDOM_SELECT);
             $Qreview->executeRandomMulti();
             if ($Qreview->numberOfRows()) {
                 $Qtext = $lC_Database->query('select substring(reviews_text, 1, 60) as reviews_text from :table_reviews where reviews_id = :reviews_id and languages_id = :languages_id');
                 $Qtext->bindTable(':table_reviews', TABLE_REVIEWS);
                 $Qtext->bindInt(':reviews_id', $Qreview->valueInt('reviews_id'));
                 $Qtext->bindInt(':languages_id', $lC_Language->getID());
                 $Qtext->execute();
                 $data = array_merge($Qreview->toArray(), $Qtext->toArray());
                 $Qtext->freeResult();
                 $Qreview->freeResult();
             }
             if ($lC_Cache->isEnabled()) {
                 $lC_Cache->write($data);
             }
         }
         $this->_content = '';
         if (empty($data)) {
             if (isset($lC_Product) && is_a($lC_Product, 'lC_Product') && $lC_Product->isValid()) {
                 $this->_content = '<li class="box-reviews-write">' . lc_link_object(lc_href_link(FILENAME_PRODUCTS, 'reviews=new&' . $lC_Product->getKeyword()), $lC_Language->get('box_reviews_write')) . '</li>' . "\n";
             }
         } else {
             if (!empty($data['image'])) {
                 $this->_content = '<li class="box-reviews-image">' . lc_link_object(lc_href_link(FILENAME_PRODUCTS, 'reviews=' . $data['reviews_id'] . '&' . $data['products_keyword']), $lC_Image->show($data['image'], $data['products_name'], 'class="box-reviews-image-src"')) . '</li>';
             }
             $this->_content .= '<li class="box-reviews-text">' . lc_link_object(lc_href_link(FILENAME_PRODUCTS, 'reviews=' . $data['reviews_id'] . '&' . $data['products_keyword']), wordwrap(lc_output_string_protected($data['reviews_text']), 15, "\n") . '...') . "\n" . '<li class="box-reviews-rating">' . $lC_Language->get('box_reviews_average_rating') . ' ' . lc_image(DIR_WS_TEMPLATE_IMAGES . 'stars_' . $data['reviews_rating'] . '.png', sprintf($lC_Language->get('box_reviews_stars_rating'), $data['reviews_rating'])) . '</li>';
         }
     }
 }
Ejemplo n.º 7
0
 public function United_Parcel_Service()
 {
     global $lC_Language;
     /**
      * The addon type (category)
      * valid types; payment, shipping, themes, checkout, catalog, admin, reports, connectors, other 
      */
     $this->_type = 'shipping';
     /**
      * The addon class name
      */
     $this->_code = 'United_Parcel_Service';
     /**
      * The addon title used in the addons store listing
      */
     $this->_title = $lC_Language->get('addon_shipping_ups_title');
     /**
      * The addon blurb used in the addons store listing
      */
     $this->_blurb = $lC_Language->get('addon_shipping_ups_blurb');
     /**
      * The addon description used in the addons store listing
      */
     $this->_description = $lC_Language->get('addon_shipping_ups_description');
     /**
      * The developers name
      */
     $this->_author = 'Loaded Commerce, LLC';
     /**
      * The developers web address
      */
     $this->_authorWWW = 'http://www.loadedcommerce.com';
     /**
      * The addon version
      */
     $this->_version = '1.0.0';
     /**
      * The Loaded 7 core compatibility version
      */
     $this->_compatibility = '7.0.1.1';
     // the addon is compatible with this core version and later
     /**
      * The base64 encoded addon image used in the addons store listing
      */
     $this->_thumbnail = lc_image(DIR_WS_CATALOG . 'addons/' . $this->_code . '/images/ups.png', $this->_title);
     /**
      * The addon enable/disable switch
      */
     $this->_enabled = defined('ADDONS_SHIPPING_' . strtoupper($this->_code) . '_STATUS') && @constant('ADDONS_SHIPPING_' . strtoupper($this->_code) . '_STATUS') == '1' ? true : false;
 }
Ejemplo n.º 8
0
 public function Pro_Pack_598()
 {
     global $lC_Language;
     /**
      * The addon type (category)
      * valid types; payment, shipping, themes, checkout, catalog, admin, reports, connectors, other 
      */
     $this->_type = 'pro template pack';
     /**
      * The addon class name
      */
     $this->_code = 'Pro_Pack_598';
     /**
      * The addon title used in the addons store listing
      */
     $this->_title = $lC_Language->get('addon_pro_pack_598_title');
     /**
      * The addon description used in the addons store listing
      */
     $this->_description = $lC_Language->get('addon_pro_pack_598_description');
     /**
      * The developers name
      */
     $this->_author = 'Algozone, Inc.';
     /**
      * The developers web address
      */
     $this->_authorWWW = 'http://www.algozone.com';
     /**
      * The addon version
      */
     $this->_version = '1.0.0';
     /**
      * The Loaded 7 core compatibility version
      */
     $this->_compatibility = '7.0';
     // the addon is compatible with this core version and later
     /**
      * The addon image used in the addons store listing
      */
     $this->_thumbnail = '<span onclick="showInfo(\'Pro_Pack_598\',\'LCAZ00598\', \'' . $this->_title . '\');">' . lc_image(DIR_WS_CATALOG . 'addons/' . $this->_code . '/images/LCAZ00598.png', null, 160, 120) . '</span>';
     /**
      * The addon enable/disable switch
      */
     $this->_enabled = true;
     $this->_rating = '5';
 }
Ejemplo n.º 9
0
 public function show($image, $title, $parameters = '', $group = '')
 {
     if (empty($group) || !$this->exists($group)) {
         $group = $this->getCode(DEFAULT_IMAGE_GROUP_ID);
     }
     $group_id = $this->getID($group);
     $width = $height = '';
     if ($this->_groups[$group_id]['force_size'] == '1' || empty($image)) {
         $width = $this->_groups[$group_id]['size_width'];
         $height = $this->_groups[$group_id]['size_height'];
     }
     if (empty($image)) {
         $image = 'no_image.png';
     } else {
         $image = 'products/' . $this->_groups[$group_id]['code'] . '/' . $image;
     }
     return lc_image(DIR_WS_IMAGES . $image, $title, $width, $height, $parameters);
 }
Ejemplo n.º 10
0
 protected function _setData()
 {
     global $lC_Database, $lC_Language;
     if (!$this->enabled) {
         $this->_data = '';
     } else {
         $this->_data = '<div class="four-columns six-columns-tablet twelve-columns-mobile">' . '  <h2 class="relative thin">' . $this->_title . '</h2>' . '  <ul class="list spaced">';
         $Qreviews = $lC_Database->query('select r.reviews_id, r.products_id, greatest(r.date_added, greatest(r.date_added, r.last_modified)) as date_last_modified, r.reviews_rating, pd.products_name, l.name as languages_name, l.code as languages_code from :table_reviews r left join :table_products_description pd on (r.products_id = pd.products_id and r.languages_id = pd.language_id), :table_languages l where r.languages_id = l.languages_id order by date_last_modified desc limit 6');
         $Qreviews->bindTable(':table_reviews', TABLE_REVIEWS);
         $Qreviews->bindTable(':table_products_description', TABLE_PRODUCTS_DESCRIPTION);
         $Qreviews->bindTable(':table_languages', TABLE_LANGUAGES);
         $Qreviews->execute();
         while ($Qreviews->next()) {
             $this->_data .= '    <li>' . '      <span class="list-link icon-speech icon-purple" title="' . $lC_Language->get('orders') . '">' . '        <strong>' . $Qreviews->value('products_name') . '</strong> ' . lc_image('../images/stars_' . $Qreviews->valueInt('reviews_rating') . '.png', $Qreviews->valueInt('reviews_rating') . '/5') . '      </span>' . '    </li>';
         }
         $this->_data .= '  </ul>' . '</div>';
         $Qreviews->freeResult();
     }
 }
Ejemplo n.º 11
0
 public function initialize()
 {
     global $lC_Database, $lC_Language, $lC_Image, $lC_carousel, $lC_Services;
     $caption_enabled = defined('MODULE_CONTENT_MAINPAGE_CAROUSEL_CAPTION') && @constant('MODULE_CONTENT_MAINPAGE_CAROUSEL_CAPTION') == '1' ? true : false;
     $indicator_enabled = defined('MODULE_CONTENT_MAINPAGE_CAROUSEL_INDICATOR') && @constant('MODULE_CONTENT_MAINPAGE_CAROUSEL_INDICATOR') == '1' ? true : false;
     if ($lC_Services->isStarted('banner')) {
         $Qbanner = $lC_Database->query('select * from :table_banners where status = 1 and banners_group = :banners_group');
         $Qbanner->bindTable(':table_banners', TABLE_BANNERS);
         $Qbanner->bindValue(':banners_group', 'banner_slider');
         $Qbanner->execute();
         $this->_content .= '<div id="CarouselModule" class="carousel slide" data-ride="carousel">';
         $this->_content .= '<div class="carousel-inner" role="listbox">';
         $n = 0;
         while ($Qbanner->next()) {
             $this->_content .= '<div class="item ' . ($n == 0 ? 'active' : '') . '">';
             $this->_content .= lc_link_object(lc_href_link(FILENAME_REDIRECT, 'action=banner&goto=' . $Qbanner->valueInt('banners_id')), lc_image(DIR_WS_IMAGES . $Qbanner->value('banners_image'), $Qbanner->value('banners_title')), $Qbanner->valueInt('banners_target') === 1 ? ' target="_blank" ' : ' target="_self" ');
             if ($caption_enabled === true) {
                 $this->_content .= '<div class="carousel-caption">' . $Qbanner->value('banners_title') . '</div>';
             }
             $this->_content .= '</div>';
             $n++;
         }
         $this->_content .= '</div>';
         if ($Qbanner->numberOfRows() > 0) {
             $this->_content .= '<ol class="carousel-indicators">';
             for ($i = 0; $i < $n; $i++) {
                 $this->_content .= '<li data-target="#CarouselModule" data-slide-to="' . $i . '"' . ($n == 0 ? ' class="active"' : '') . '></li>';
             }
             $this->_content .= '</ol>';
             $this->_content .= '  <a class="left carousel-control" href="#CarouselModule" role="button" data-slide="prev">';
             $this->_content .= '    <span class="glyphicon glyphicon-chevron-left" aria-hidden="true"></span>';
             $this->_content .= '    <span class="sr-only">Previous</span>';
             $this->_content .= '  </a>';
             $this->_content .= '  <a class="right carousel-control" href="#CarouselModule" role="button" data-slide="next">';
             $this->_content .= '    <span class="glyphicon glyphicon-chevron-right" aria-hidden="true"></span>';
             $this->_content .= '    <span class="sr-only">Next</span>';
             $this->_content .= '  </a>';
         }
         $this->_content .= '</div>';
     }
 }
Ejemplo n.º 12
0
 public function initialize()
 {
     global $lC_Database, $lC_Language, $lC_Product;
     if (isset($lC_Product) && is_a($lC_Product, 'lC_Product')) {
         $Qmanufacturer = $lC_Database->query('select m.manufacturers_id, m.manufacturers_name, m.manufacturers_image, mi.manufacturers_url from :table_manufacturers m left join :table_manufacturers_info mi on (m.manufacturers_id = mi.manufacturers_id and mi.languages_id = :languages_id), :table_products p  where p.products_id = :products_id and p.manufacturers_id = m.manufacturers_id');
         $Qmanufacturer->bindTable(':table_manufacturers', TABLE_MANUFACTURERS);
         $Qmanufacturer->bindTable(':table_manufacturers_info', TABLE_MANUFACTURERS_INFO);
         $Qmanufacturer->bindTable(':table_products', TABLE_PRODUCTS);
         $Qmanufacturer->bindInt(':languages_id', $lC_Language->getID());
         $Qmanufacturer->bindInt(':products_id', $lC_Product->getID());
         $Qmanufacturer->execute();
         if ($Qmanufacturer->numberOfRows()) {
             $this->_content = '';
             if (!lc_empty($Qmanufacturer->value('manufacturers_image'))) {
                 $this->_content .= '<li class="box-manufacturers-info-image">' . lc_link_object(lc_href_link(FILENAME_DEFAULT, 'manufacturers=' . $Qmanufacturer->valueInt('manufacturers_id')), lc_image(DIR_WS_IMAGES . 'manufacturers/' . $Qmanufacturer->value('manufacturers_image'), $Qmanufacturer->value('manufacturers_name'))) . '</li>' . "\n";
             }
             if (!lc_empty($Qmanufacturer->value('manufacturers_url'))) {
                 $this->_content .= '<li class="box-manufacturers-info-url">' . lc_link_object(lc_href_link(FILENAME_REDIRECT, 'action=manufacturer&manufacturers_id=' . $Qmanufacturer->valueInt('manufacturers_id')), sprintf($lC_Language->get('box_manufacturer_info_website'), $Qmanufacturer->value('manufacturers_name')), 'target="_blank"') . '</li>' . "\n";
             }
             $this->_content .= '<li class="box-manufacturers-info-link">' . lc_link_object(lc_href_link(FILENAME_DEFAULT, 'manufacturers=' . $Qmanufacturer->valueInt('manufacturers_id')), $lC_Language->get('box_manufacturer_info_products')) . '</li>' . "\n";
         }
     }
 }
Ejemplo n.º 13
0
 public function initialize()
 {
     global $lC_Database, $lC_Language, $lC_CategoryTree;
     $Qcategories = $lC_Database->query('select c.categories_id, cd.categories_name, c.categories_image, c.parent_id, c.categories_mode, c.categories_link_target, c.categories_custom_url from :table_categories c, :table_categories_description cd where c.parent_id = :parent_id and c.categories_id = cd.categories_id and cd.language_id = :language_id and c.categories_status = 1 and c.categories_visibility_box = 1 order by sort_order, cd.categories_name');
     $Qcategories->bindTable(':table_categories', TABLE_CATEGORIES);
     $Qcategories->bindTable(':table_categories_description', TABLE_CATEGORIES_DESCRIPTION);
     $Qcategories->bindInt(':parent_id', 0);
     $Qcategories->bindInt(':language_id', $lC_Language->getID());
     $Qcategories->execute();
     $number_of_categories = $Qcategories->numberOfRows();
     $rows = 0;
     $output = '';
     while ($Qcategories->next()) {
         $url = $Qcategories->value('categories_custom_url') != null ? $Qcategories->value('categories_custom_url') : FILENAME_DEFAULT . '?cPath=' . $lC_CategoryTree->buildBreadcrumb($Qcategories->valueInt('categories_id'));
         $image = $Qcategories->value('categories_image') != null ? $Qcategories->value('categories_image') : 'no_image.png';
         $output .= '<div class="content-categories-container">' . "\n";
         if (file_exists(DIR_WS_IMAGES . 'categories/' . $image)) {
             $output .= '  <div class="content-categories-image">' . lc_link_object(lc_href_link($url), lc_image(DIR_WS_IMAGES . 'categories/' . $image, $Qcategories->value('categories_name'), null, null, 'class="content-categories-image-src padding-top"')) . '</div>' . "\n";
         }
         $output .= '  <div class="content-categories-name">' . lc_link_object(lc_href_link($url), $Qcategories->value('categories_name')) . '</div>' . "\n" . '</div>' . "\n";
     }
     $this->_content = $output;
 }
Ejemplo n.º 14
0
 public static function getFormData($id = null)
 {
     global $lC_Database, $lC_Language;
     $result = array();
     foreach ($lC_Language->getAll() as $l) {
         $result['mfgUrl'] .= '<span class="input" style="width:88%"><label for="name[' . $l['id'] . ']" class="button silver-gradient glossy">' . $lC_Language->showImage($l['code']) . '</label>' . lc_draw_input_field('manufacturers_url[' . $l['id'] . ']', null, 'class="input-unstyled"') . '</span><br />';
     }
     if ($id != null && is_numeric($id)) {
         $manufacturers_array = array();
         $Qmanufacturer = $lC_Database->query('select manufacturers_url, languages_id from :table_manufacturers_info where manufacturers_id = :manufacturers_id');
         $Qmanufacturer->bindTable(':table_manufacturers_info', TABLE_MANUFACTURERS_INFO);
         $Qmanufacturer->bindInt(':manufacturers_id', $id);
         $Qmanufacturer->execute();
         while ($Qmanufacturer->next()) {
             $manufacturers_array[$Qmanufacturer->valueInt('languages_id')] = $Qmanufacturer->value('manufacturers_url');
         }
         foreach ($lC_Language->getAll() as $l) {
             $result['editMfgUrl'] .= '<span class="input" style="width:88%"><label for="name[' . $l['id'] . ']" class="button silver-gradient glossy">' . $lC_Language->showImage($l['code']) . '</label>' . lc_draw_input_field('manufacturers_url[' . $l['id'] . ']', $manufacturers_array[$l['id']], 'class="input-unstyled"') . '</span><br />';
         }
         $result['mData'] = lC_Manufacturers_Admin::getData($id, $lC_Language->getID());
         $result['mImage'] = lc_image('../' . DIR_WS_IMAGES . 'manufacturers/' . $result['mData']['manufacturers_image'], $result['mData']['manufacturers_name']) . '<br />' . DIR_WS_CATALOG . DIR_WS_IMAGES . 'manufacturers/' . $result['mData']['manufacturers_image'] . '<br />';
     }
     return $result;
 }
Ejemplo n.º 15
0
 public static function formData($id = null)
 {
     global $lC_Database, $lC_Language;
     $lC_Language->loadIniFile('reviews.php');
     $result = array();
     if ($id != null) {
         $result['rData'] = lC_Reviews_Admin::getData($id);
         $result['dateShort'] = lC_DateTime::getShort($result['rData']['date_added']);
         switch ($result['rData']['reviews_status']) {
             case 1:
                 // approved
                 $result['rData']['reviews_status_text'] = $lC_Language->get('review_status_approved');
                 break;
             case 2:
                 // rejected
                 $result['rData']['reviews_status_text'] = $lC_Language->get('review_status_rejected');
                 break;
             default:
                 //new
                 $result['rData']['reviews_status_text'] = $lC_Language->get('review_status_pending');
                 break;
         }
         $result['ratingRadio'] = '';
         for ($i = 1; $i <= 5; $i++) {
             $checked = $result['rData']['reviews_rating'] == $i ? 'checked' : NULL;
             $result['ratingRadio'] .= '<label for="reviews_rating-' . $i . '" class="button blue-active"><input type="radio" name="reviews_rating" id="reviews_rating-' . $i . '" value="' . $i . '" ' . $checked . '>' . $i . '</label>';
         }
         $result['ratingStars'] = lc_image('../images/stars_' . $result['rData']['reviews_rating'] . '.png', sprintf($lC_Language->get('rating_from_5_stars'), $result['rData']['reviews_rating'])) . '&nbsp;[' . sprintf($lC_Language->get('rating_from_5_stars'), $result['rData']['reviews_rating']) . ']';
     }
     return $result;
 }
Ejemplo n.º 16
0
 public static function getAll()
 {
     global $lC_Database, $lC_Language, $_module;
     $result = array('entries' => array());
     $result = array('aaData' => array());
     $media = $_GET['media'];
     /* Total Records */
     $QresultTotal = $lC_Database->query('select count(*) as total from :table_countries');
     $QresultTotal->bindTable(':table_countries', TABLE_COUNTRIES);
     $QresultTotal->execute();
     $result['iTotalRecords'] = $QresultTotal->valueInt('total');
     $QresultTotal->freeResult();
     /* Paging */
     $sLimit = " LIMIT 0,25 ";
     if (isset($_GET['iDisplayStart'])) {
         if ($_GET['iDisplayLength'] != -1) {
             $sLimit = " LIMIT " . $_GET['iDisplayStart'] . ", " . $_GET['iDisplayLength'];
         }
     }
     /* Ordering */
     if (isset($_GET['iSortCol_0'])) {
         $sOrder = " ORDER BY ";
         for ($i = 0; $i < (int) $_GET['iSortingCols']; $i++) {
             $sOrder .= lC_Countries_Admin::fnColumnToField($_GET['iSortCol_' . $i]) . " " . $_GET['sSortDir_' . $i] . ", ";
         }
         $sOrder = substr_replace($sOrder, "", -2);
     }
     /* Filtering */
     $sWhere = "";
     if ($_GET['sSearch'] != "") {
         $sWhere = " WHERE countries_name LIKE '%" . $_GET['sSearch'] . "%' OR " . "countries_iso_code_2 LIKE '%" . $_GET['sSearch'] . "%' OR " . "countries_iso_code_3 LIKE '%" . $_GET['sSearch'] . "%' ";
     }
     /* Total Filtered Records */
     $QresultFilterTotal = $lC_Database->query('select count(*) as total from :table_countries' . $sWhere . $sOrder);
     $QresultFilterTotal->bindTable(':table_countries', TABLE_COUNTRIES);
     $QresultFilterTotal->execute();
     $result['iTotalDisplayRecords'] = $QresultFilterTotal->valueInt('total');
     $QresultFilterTotal->freeResult();
     /* Main Listing Query */
     $Qcountries = $lC_Database->query('select * from :table_countries' . $sWhere . $sOrder . $sLimit);
     $Qcountries->bindTable(':table_countries', TABLE_COUNTRIES);
     $Qcountries->execute();
     while ($Qcountries->next()) {
         $Qzones = $lC_Database->query('select count(*) as total_zones from :table_zones where zone_country_id = :zone_country_id');
         $Qzones->bindTable(':table_zones', TABLE_ZONES);
         $Qzones->bindInt(':zone_country_id', $Qcountries->valueInt('countries_id'));
         $Qzones->execute();
         $check = '<td><input class="batch" type="checkbox" name="batch[]" value="' . $Qcountries->valueInt('countries_id') . '" id="' . $Qcountries->valueInt('countries_id') . '"></td>';
         $name = '<td><a href="' . lc_href_link_admin(FILENAME_DEFAULT, 'countries=' . $Qcountries->valueInt('countries_id')) . '"><span class="icon-folder icon-orange"></span>&nbsp;' . $Qcountries->valueProtected('countries_name') . '</a></td>';
         $code = '<td>
              <table width="100%" border="0">
                <tr>
                  <td>' . lc_image('../images/worldflags/' . strtolower($Qcountries->value('countries_iso_code_2')) . '.png', $Qcountries->value('countries_iso_code_3')) . '</td>
                  <td align="center" width="50%">' . $Qcountries->value('countries_iso_code_2') . '</td>
                  <td align="center" width="50%">' . $Qcountries->value('countries_iso_code_3') . '</td>
                </tr>
              </table>
            </td>';
         $total = '<td>' . $Qzones->valueInt('total_zones') . '</td>';
         $action = '<td class="align-right vertical-center"><span class="button-group compact" style="white-space:nowrap;">
                <a href="' . ((int) ($_SESSION['admin']['access']['locale'] < 3) ? '#' : 'javascript://" onclick="editCountry(\'' . $Qcountries->valueInt('countries_id') . '\')') . '" class="button icon-pencil' . ((int) ($_SESSION['admin']['access']['locale'] < 3) ? ' disabled' : NULL) . '">' . ($media === 'mobile-portrait' || $media === 'mobile-landscape' ? NULL : $lC_Language->get('icon_edit')) . '</a>
                <a href="' . ((int) ($_SESSION['admin']['access']['locale'] < 4) ? '#' : 'javascript://" onclick="deleteCountry(\'' . $Qcountries->valueInt('countries_id') . '\', \'' . urlencode($Qcountries->valueProtected('countries_name')) . '\')') . '" class="button icon-trash with-tooltip' . ((int) ($_SESSION['admin']['access']['locale'] < 4) ? ' disabled' : NULL) . '" title="' . $lC_Language->get('icon_delete') . '"></a>
              </span></td>';
         $result['aaData'][] = array("{$check}", "{$name}", "{$code}", "{$total}", "{$action}");
         $result['entries'][] = array_merge($Qcountries->toArray(), $Qzones->toArray());
     }
     $result['sEcho'] = intval($_GET['sEcho']);
     if ($Qcountries->numberOfRows() > 0) {
         $Qzones->freeResult();
     }
     $Qcountries->freeResult();
     return $result;
 }
Ejemplo n.º 17
0
    echo lc_link_object($lC_Template->getBranding('social_facebook_page'), lc_image(DIR_WS_IMAGES . 'icons/fb-ico.png', 'Facebook', null, null, 'class="small-margin-right"'), 'target="_blank"');
}
if ($lC_Template->getBranding('social_twitter') != '') {
    echo lc_link_object($lC_Template->getBranding('social_twitter'), lc_image(DIR_WS_IMAGES . 'icons/tw-ico.png', 'Twitter', null, null, 'class="small-margin-right"'), 'target="_blank"');
}
if ($lC_Template->getBranding('social_pinterest') != '') {
    echo lc_link_object($lC_Template->getBranding('social_pinterest'), lc_image(DIR_WS_IMAGES . 'icons/pn-ico.png', 'Pinterest', null, null, 'class="small-margin-right"'), 'target="_blank"');
}
if ($lC_Template->getBranding('social_google_plus') != '') {
    echo lc_link_object($lC_Template->getBranding('social_google_plus'), lc_image(DIR_WS_IMAGES . 'icons/gp-ico.png', 'Google+', null, null, 'class="small-margin-right social-nav-gp"'), 'target="_blank"');
}
if ($lC_Template->getBranding('social_youtube') != '') {
    echo lc_link_object($lC_Template->getBranding('social_youtube'), lc_image(DIR_WS_IMAGES . 'icons/yt-ico.png', 'Youtube', null, null, 'class="small-margin-right social-nav-yt"'), 'target="_blank"');
}
if ($lC_Template->getBranding('social_linkedin') != '') {
    echo lc_link_object($lC_Template->getBranding('social_linkedin'), lc_image(DIR_WS_IMAGES . 'icons/in-ico.png', 'LinkedIn', null, null, 'class="small-margin-right social-nav-in"'), 'target="_blank"');
}
?>
                <button type="button" class="btn btn-sm cursor-pointer small-margin-right<?php 
echo $lC_ShoppingCart->numberOfItems() > 0 ? ' btn-success' : ' btn-default disabled';
?>
" onclick="window.location.href='<?php 
echo lc_href_link(FILENAME_CHECKOUT, 'shipping', 'SSL');
?>
'">Checkout</button>  
                <i class="fa fa-search navbar-search-icon"></i>
                <input type="text" class="navbar-search" name="keywords" placeholder="<?php 
echo $lC_Language->get('button_search');
?>
"><?php 
echo lc_draw_hidden_session_id_field();
Ejemplo n.º 18
0
 public function showImage($code = null, $width = '16', $height = '10', $parameters = null)
 {
     if (empty($code)) {
         $code = $this->_code;
     }
     $image_code = strtolower(substr($code, 3));
     if (!is_numeric($width)) {
         $width = 16;
     }
     if (!is_numeric($height)) {
         $height = 10;
     }
     return lc_image('images/worldflags/' . $image_code . '.png', $this->_languages[$code]['name'], $width, $height, $parameters);
 }
Ejemplo n.º 19
0
    $Qhistory = lC_Order::getListing(MAX_DISPLAY_ORDER_HISTORY);
    while ($Qhistory->next()) {
        if (!lc_empty($Qhistory->value('delivery_name'))) {
            $order_type = $lC_Language->get('order_shipped_to');
            $order_name = $Qhistory->value('delivery_name');
        } else {
            $order_type = $lC_Language->get('order_billed_to');
            $order_name = $Qhistory->value('billing_name');
        }
        ?>
          <tr>
            <td><a href="<?php 
        echo lc_href_link(FILENAME_ACCOUNT, 'receipt=' . $Qhistory->valueInt('orders_id'), 'SSL');
        ?>
"><?php 
        echo lc_image(DIR_WS_TEMPLATE_IMAGES . 'icons/16/search.png', $lC_Language->get('text_view'));
        ?>
</a></td>
            <td><?php 
        echo $Qhistory->valueInt('orders_id');
        ?>
</td>                
            <td><?php 
        echo lc_output_string_protected($order_name);
        ?>
</td> 
            <td><?php 
        echo lC_DateTime::getShort($Qhistory->value('date_purchased'));
        ?>
</td>
            <td><?php 
Ejemplo n.º 20
0
 public function getListingOutput($id = null)
 {
     global $lC_Database, $lC_Language, $lC_Image;
     if (is_numeric($id)) {
         $Qreviews = $lC_Database->query('select reviews_id, reviews_text, reviews_rating, date_added, customers_name from :table_reviews where products_id = :products_id and languages_id = :languages_id and reviews_status = 1 order by reviews_id desc');
         $Qreviews->bindInt(':products_id', $id);
         $Qreviews->bindInt(':languages_id', $lC_Language->getID());
     } else {
         $Qreviews = $lC_Database->query('select r.reviews_id, left(r.reviews_text, 100) as reviews_text, r.reviews_rating, r.date_added, r.customers_name, p.products_id, p.products_price, p.products_tax_class_id, pd.products_name, pd.products_keyword, i.image from :table_reviews r, :table_products p left join :table_products_images i on (p.products_id = i.products_id and i.default_flag = :default_flag), :table_products_description pd where r.reviews_status = 1 and r.languages_id = :languages_id and r.products_id = p.products_id and p.products_status = 1 and p.products_id = pd.products_id and pd.language_id = :language_id order by r.reviews_id desc');
         $Qreviews->bindTable(':table_products', TABLE_PRODUCTS);
         $Qreviews->bindTable(':table_products_images', TABLE_PRODUCTS_IMAGES);
         $Qreviews->bindTable(':table_products_description', TABLE_PRODUCTS_DESCRIPTION);
         $Qreviews->bindInt(':default_flag', 1);
         $Qreviews->bindInt(':languages_id', $lC_Language->getID());
         $Qreviews->bindInt(':language_id', $lC_Language->getID());
     }
     $Qreviews->bindTable(':table_reviews', TABLE_REVIEWS);
     $Qreviews->setBatchLimit(isset($_GET['page']) && is_numeric($_GET['page']) ? $_GET['page'] : 1, MAX_DISPLAY_NEW_REVIEWS);
     $Qreviews->execute();
     $counter = 0;
     $output = '';
     if ($Qreviews->numberOfRows() > 0) {
         while ($Qreviews->next()) {
             $counter++;
             if ($counter > 1) {
                 $output .= '<br />' . "\n";
             }
             $text = strlen($Qreviews->valueProtected('reviews_text')) > 60 ? substr($Qreviews->valueProtected('reviews_text'), 0, 360) . '...' : $Qreviews->valueProtected('reviews_text');
             $output .= '<div class="content-reviews-stars">' . lc_image(DIR_WS_TEMPLATE_IMAGES . 'stars_' . $Qreviews->valueInt('reviews_rating') . '.png', sprintf($lC_Language->get('rating_of_5_stars'), $Qreviews->valueInt('reviews_rating'))) . '&nbsp;' . sprintf($lC_Language->get('reviewed_by'), $Qreviews->valueProtected('customers_name')) . '; ' . lC_DateTime::getLong($Qreviews->value('date_added')) . '</div>' . "\n";
             $output .= '<div class="content-reviews-text"><em>' . nl2br($text) . '</em></div>' . "\n";
         }
     } else {
         $output = '<div>' . $lC_Language->get('no_reviews_available') . '</div>' . "\n";
     }
     return $output;
 }
 public function getData($ip_address)
 {
     return array(lc_image('../images/worldflags/' . $this->getCountryISOCode2($ip_address) . '.png', $this->getCountryName($ip_address) . ', ' . $ip_address, 18, 12) . '&nbsp;' . $this->getCountryName($ip_address));
 }
Ejemplo n.º 22
0
 /**
  * Display a banner. If no ID is passed, the value defined in $_exists_id is used.
  *
  * @param int $id The ID of the banner to show
  * @access public
  * @return string
  */
 public function display($id = null)
 {
     global $lC_Database;
     $banner_string = '';
     if (empty($id) && isset($this->_exists_id) && is_numeric($this->_exists_id)) {
         $id = $this->_exists_id;
         unset($this->_exists_id);
     }
     $Qbanner = $lC_Database->query('select * from :table_banners where banners_id = :banners_id and status = 1');
     $Qbanner->bindTable(':table_banners', TABLE_BANNERS);
     $Qbanner->bindInt(':banners_id', $id);
     $Qbanner->execute();
     if ($Qbanner->numberOfRows() > 0) {
         if (!lc_empty($Qbanner->value('banners_html_text'))) {
             $banner_string = $Qbanner->value('banners_html_text');
         } else {
             if (!lc_empty($Qbanner->value('banners_url'))) {
                 $banner_string = lc_link_object(lc_href_link(FILENAME_REDIRECT, 'action=banner&goto=' . $Qbanner->valueInt('banners_id')), lc_image(DIR_WS_IMAGES . $Qbanner->value('banners_image'), $Qbanner->value('banners_title')), $Qbanner->valueInt('banners_target') === 1 ? ' target="_blank" ' : ' target="_self" ');
             } else {
                 $banner_string = lc_image(DIR_WS_IMAGES . $Qbanner->value('banners_image'), $Qbanner->value('banners_title'));
             }
         }
         $this->_updateDisplayCount($Qbanner->valueInt('banners_id'));
         if ($this->_show_duplicates_in_group === false) {
             $this->_shown_ids[] = $Qbanner->valueInt('banners_id');
         }
     }
     return $banner_string;
 }
Ejemplo n.º 23
0
    ?>
</span>
        </div>
        <?php 
}
// check if reviews service is active
if (isset($lC_Services) && $lC_Services->isStarted('reviews')) {
    ?>
      
      <div class="content-products-info-reviews-container large-margin-bottom">
        <label class="content-products-info-reviews-rating-label with-padding-no-top-bottom"><?php 
    echo $lC_Language->get('average_rating');
    ?>
</label>
        <span class="content-products-info-reviews-rating margin-right"><?php 
    echo lc_image(DIR_WS_TEMPLATE_IMAGES . 'stars_' . $lC_Product->getData('reviews_average_rating') . '.png', sprintf($lC_Language->get('rating_of_5_stars'), $lC_Product->getData('reviews_average_rating')));
    ?>
</span>
        <?php 
    $Qreviews = lC_Reviews::getListing($lC_Product->getID());
    if ($lC_Reviews->getTotal($lC_Product->getID()) > 0) {
        echo '<span><a href="' . lc_href_link(FILENAME_PRODUCTS, 'reviews&' . $lC_Product->getKeyword()) . '">(' . $lC_Language->get('more_information') . ')</a></span>' . "\n";
    } else {
        echo '<span><a href="' . lc_href_link(FILENAME_PRODUCTS, 'reviews=new&' . $lC_Product->getKeyword()) . '">(' . $lC_Language->get('text_write_review_first') . '</a>)</span>' . "\n";
    }
    ?>
      
      </div>  
      <?php 
}
// reviews service check
Ejemplo n.º 24
0
 public static function stats($id, $type = '', $month = '', $year = '')
 {
     global $lC_Database, $lC_Language, $lC_Template, $lC_Vqmod;
     $lC_Language->loadIniFile('banner_manager.php');
     $Qyears = $lC_Database->query('select distinct year(banners_history_date) as banner_year from :table_banners_history where banners_id = :banners_id');
     $Qyears->bindTable(':table_banners_history', TABLE_BANNERS_HISTORY);
     $Qyears->bindInt(':banners_id', $id);
     $Qyears->execute();
     $years_array = array();
     while ($Qyears->next()) {
         $years_array[] = array('id' => $Qyears->valueInt('banner_year'), 'text' => $Qyears->valueInt('banner_year'));
     }
     if ($years_array[0] == null) {
         $years_array[] = array('id' => @date("Y"), 'text' => @date("Y"));
     }
     $Qyears->freeResult();
     $months_array = array();
     for ($i = 1; $i < 13; $i++) {
         $months_array[] = array('id' => $i, 'text' => @strftime('%B', @mktime(0, 0, 0, $i)));
     }
     $type_array = array(array('id' => 'daily', 'text' => $lC_Language->get('section_daily')), array('id' => 'monthly', 'text' => $lC_Language->get('section_monthly')), array('id' => 'yearly', 'text' => $lC_Language->get('section_yearly')));
     $lC_ObjectInfo = new lC_ObjectInfo(lC_Banner_manager_Admin::getData($id));
     $result['formElements'] = $lC_Language->get('operation_heading_type') . ' ' . lc_draw_pull_down_menu('type', $type_array, 'daily', 'onchange="updateStats(\'' . $id . '\');"') . ' ';
     switch ($type) {
         case 'yearly':
             break;
         case 'monthly':
             $result['formElements'] .= $lC_Language->get('operation_heading_year') . ' ' . lc_draw_pull_down_menu('year', $years_array, @date('Y'), 'onchange="updateStats(\'' . $id . '\');"');
             break;
         case 'daily':
         default:
             $result['formElements'] .= $lC_Language->get('operation_heading_month') . ' ' . lc_draw_pull_down_menu('month', $months_array, @date('n'), 'onchange="updateStats(\'' . $id . '\');"') . ' ' . $lC_Language->get('operation_heading_year') . ' ' . lc_draw_pull_down_menu('year', $years_array, @date('Y'), 'onchange="updateStats(\'' . $id . '\');"');
             break;
     }
     $result['graphInfo'] = '';
     $image_extension = lc_dynamic_image_extension();
     if ($year == null) {
         $year = @date("Y");
     }
     if ($month == null) {
         $month = @date("n");
     }
     if (is_dir('images/graphs') && is_writeable('images/graphs') && !empty($image_extension)) {
         switch ($type) {
             case 'yearly':
                 include $lC_Vqmod->modCheck('includes/graphs/banner_yearly.php');
                 $stats = lc_banner_yearly((int) $id);
                 $result['graphInfo'] = '<p align="center">' . lc_image('images/graphs/banner_yearly-' . $id . '.' . $image_extension) . '</p>';
                 break;
             case 'monthly':
                 include $lC_Vqmod->modCheck('includes/graphs/banner_monthly.php');
                 $stats = lc_banner_monthly((int) $id, (int) $year);
                 $result['graphInfo'] = '<p align="center">' . lc_image('images/graphs/banner_monthly-' . $id . '.' . $image_extension) . '</p>';
                 break;
             case 'daily':
             default:
                 include $lC_Vqmod->modCheck('includes/graphs/banner_daily.php');
                 $stats = lc_banner_daily((int) $id, (int) $month, (int) $year);
                 $result['graphInfo'] = '<p align="center">' . lc_image('images/graphs/banner_daily-' . $id . '_' . $month . '.' . $image_extension) . '</p>';
                 break;
         }
     } else {
         if (!empty($image_extension)) {
             if (is_dir('images/graphs')) {
                 if (!is_writeable('images/graphs')) {
                     $result['error'] = true;
                     $result['errmsg'] = sprintf($lC_Language->get('ms_error_graphs_directory_not_writable'), realpath('images/graphs'));
                 }
             } else {
                 $result['error'] = true;
                 $result['errmsg'] = sprintf($lC_Language->get('ms_error_graphs_directory_non_existant'), realpath('images/graphs'));
             }
         }
     }
     $result['bannerStats'] = '';
     if (isset($stats)) {
         for ($i = 0, $n = sizeof($stats); $i < $n; $i++) {
             $result['bannerStats'] .= '<tr>' . '  <td>' . $stats[$i][0] . '</td>' . '  <td>' . number_format($stats[$i][1]) . '</td>' . '  <td>' . number_format($stats[$i][2]) . '</td>' . '</tr>';
         }
     }
     return $result;
 }
Ejemplo n.º 25
0
 public static function formData($id = null, $parent = null)
 {
     global $lC_Language, $_module;
     $lC_Language->loadIniFile('categories.php');
     $lC_CategoryTree = new lC_CategoryTree_Admin();
     $result = array();
     $categories_array = array('0' => $lC_Language->get('top_category'));
     foreach ($lC_CategoryTree->getArray() as $value) {
         $cid = explode('_', $value['id']);
         $count = count($cid);
         $cid = end($cid);
         $acArr = lC_Categories_Admin::getAllChildren($id);
         if ($cid != $id && !lC_Categories_Admin::in_array_r($cid, $acArr)) {
             $categories_array[$cid] = str_repeat("&nbsp;&nbsp;&nbsp;&nbsp;", $count - 1) . ' ' . $value['title'];
         }
     }
     $result['categoriesArray'] = $categories_array;
     if (isset($id) && is_numeric($id)) {
         $result['cData'] = lC_Categories_Admin::get($id, $lC_Language->getID());
         $result['categoryImage'] = '';
         $lC_ObjectInfo = new lC_ObjectInfo(lC_Categories_Admin::get($id));
         if (!lc_empty($lC_ObjectInfo->get('categories_image'))) {
             $result['categoryImage'] = '<div><p>' . lc_image('../' . DIR_WS_IMAGES . 'categories/' . $lC_ObjectInfo->get('categories_image'), $lC_ObjectInfo->get('categories_name'), HEADING_IMAGE_WIDTH, HEADING_IMAGE_HEIGHT) . '<br />' . DIR_WS_CATALOG . 'images/categories/' . $lC_ObjectInfo->getProtected('categories_image') . '</p></div>';
         }
     }
     $category_names = '';
     foreach ($lC_Language->getAll() as $l) {
         if (isset($id) && is_numeric($id)) {
             $category_names .= '<span class="input" style="width:88%"><label for="categories_name[' . $l['id'] . ']" class="button silver-gradient glossy">' . $lC_Language->showImage($l['code']) . '</label>' . lc_draw_input_field('categories_name[' . $l['id'] . ']', $result['cData']['categories_name'], 'class="input-unstyled"') . '</span><br />';
         } else {
             $category_names .= '<span class="input" style="width:88%"><label for="categories_name[' . $l['id'] . ']" class="button silver-gradient glossy">' . $lC_Language->showImage($l['code']) . '</label>' . lc_draw_input_field('categories_name[' . $l['id'] . ']', null, 'class="input-unstyled"') . '</span><br />';
         }
     }
     $result['categoryNames'] = $category_names;
     $result['parentCategory'] = isset($parent) && $parent != null ? $parent : 0;
     return $result;
 }
Ejemplo n.º 26
0
 public function quote($method = '')
 {
     global $lC_Database, $lC_Language, $lC_ShoppingCart, $lC_Currencies, $lC_Tax;
     if (!empty($method) && isset($this->_types[$method])) {
         $prod = $method;
     } else {
         if ($lC_ShoppingCart->getShippingAddress('country_iso_code_2') == 'CA') {
             $prod = 'STD';
         } else {
             $prod = 'GNDRES';
         }
     }
     if (!empty($method)) {
         $this->_upsAction('3');
     }
     // return a single quote
     $this->_upsProduct($prod);
     $countries_array = lc_get_country_data(SHIPPING_ORIGIN_COUNTRY);
     $this->_upsOrigin(SHIPPING_ORIGIN_ZIP, $countries_array['countries_iso_code_2']);
     $this->_upsDest($lC_ShoppingCart->getShippingAddress('postcode'), $lC_ShoppingCart->getShippingAddress('country_iso_code_2'));
     $this->_upsRate(ADDONS_SHIPPING_UNITED_PARCEL_SERVICE_PICKUP);
     $this->_upsContainer(ADDONS_SHIPPING_UNITED_PARCEL_SERVICE_PACKAGE);
     $this->_upsWeight($lC_ShoppingCart->getWeight());
     $this->_upsRescom(ADDONS_SHIPPING_UNITED_PARCEL_SERVICE_RES);
     $shipping_weight = $lC_ShoppingCart->getShippingBoxesWeight() < 0.1 ? 0.1 : $lC_ShoppingCart->getShippingBoxesWeight();
     $shipping_num_boxes = ceil((double) $shipping_weight / (double) SHIPPING_MAX_WEIGHT);
     if ($shipping_num_boxes <= 0) {
         $shipping_num_boxes = 1;
     }
     $upsQuote = $this->_upsGetQuote();
     if (is_array($upsQuote) && sizeof($upsQuote) > 0) {
         $this->quotes = array('id' => $this->_code, 'module' => $this->_title . ' (' . $shipping_num_boxes . ' x ' . $shipping_weight . ' lbs)');
         $methods = array();
         $allowed_methods = $this->_getAllowedMethods();
         $std_rcd = false;
         $qsize = sizeof($upsQuote);
         for ($i = 0; $i < $qsize; $i++) {
             list($type, $cost) = each($upsQuote[$i]);
             if ($type == 'STD') {
                 if ($std_rcd) {
                     continue;
                 } else {
                     $std_rcd = true;
                 }
             }
             if (!in_array($type, $allowed_methods)) {
                 continue;
             }
             $methods[] = array('id' => $type, 'title' => $this->_types[$type], 'cost' => ($cost + (double) ADDONS_SHIPPING_UNITED_PARCEL_SERVICE_HANDLING) * $shipping_num_boxes);
         }
         // begin sort order control - low to high is set, comment out for high to low sort
         usort($methods, array($this, '_usortMethods'));
         $this->quotes['methods'] = $methods;
         if ($this->_tax_class > 0) {
             $this->quotes['tax'] = $lC_Tax->getTaxRate($this->_tax_class);
         }
     } else {
         $this->quotes = array('module' => $this->_title, 'error' => 'We are unable to obtain a rate quote for UPS shipping.<br>Please contact the store if no other alternative is shown.');
     }
     if (!empty($this->icon)) {
         $this->quotes['icon'] = lc_image($this->icon, $this->_title, null, null, 'style="vertical-align:-35%;"');
     }
     return $this->quotes;
 }
Ejemplo n.º 27
0
?>
</h1>
  </hgroup>
  <div class="with-padding-no-top">
    <table border="0" width="100%" cellspacing="0" cellpadding="2" class="table responsive-table">
      <tr>
        <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
            <tr>
              <td class="pageHeading"><?php 
echo STORE_NAME . '<br>' . nl2br(STORE_NAME_ADDRESS);
?>
</td>
              <td class="pageHeading" align="right">
              <?php 
if ($lC_Template->getBrandingImage() != '') {
    echo lc_image('../images/branding/' . $lC_Template->getBrandingImage(), STORE_NAME, null, null, 'class="small-margin-right img-logo-responsive"');
} else {
    echo STORE_NAME;
}
?>
</td>
            </tr>
          </table></td>
      </tr>
      <tr>
        <td><table width="100%" border="0" cellspacing="0" cellpadding="2">
            <tr>
              <td colspan="2">&nbsp;</td>
            </tr>
            <tr>
              <td valign="top"><table width="100%" border="0" cellspacing="0" cellpadding="2">
Ejemplo n.º 28
0
echo lc_image(DIR_WS_TEMPLATE_IMAGES . 'icons/64/orders.png', $lC_Language->get('my_orders_title'), null, null, 'class="img-responsive pull-left large-margin-right img-responsive"');
?>
      <div>
        <div><?php 
echo lc_link_object(lc_href_link(FILENAME_ACCOUNT, 'orders', 'SSL'), $lC_Language->get('my_orders_view'));
?>
</div>
      </div>
    </div>
    <h3><?php 
echo $lC_Language->get('my_notifications_title');
?>
</h3> 
    <div class="well clearfix large-margin-right">
      <?php 
echo lc_image(DIR_WS_TEMPLATE_IMAGES . 'icons/64/notifications.png', $lC_Language->get('my_notifications_title'), null, null, 'class="img-responsive pull-left large-margin-right img-responsive"');
?>
      <div>
        <div><?php 
echo lc_link_object(lc_href_link(FILENAME_ACCOUNT, 'newsletters', 'SSL'), $lC_Language->get('my_notifications_newsletters'));
?>
</div>
        <div><?php 
echo lc_link_object(lc_href_link(FILENAME_ACCOUNT, 'notifications', 'SSL'), $lC_Language->get('my_notifications_products'));
?>
</div>
      </div>
    </div>  
  </div>
</div>
<!--content/account/account.php end-->
                            '<?php 
echo $lC_Language->get('button_close');
?>
': {
                              classes:  'glossy',
                              click:    function(win) { win.closeModal(); }
                            },
                            '<?php 
echo $lC_Language->get('button_send');
?>
': {
                              classes:  'blue-gradient glossy',
                              click:    function(win) { 
                                $.modal({
                                  content:'<p align="center"><?php 
echo lc_image('images/ani_send_email.gif');
?>
</p><p align="center"><?php 
echo '<b>' . $lC_Language->get('sending_please_wait') . '</b>';
?>
</p>',
                                  buttons: {}
                                });
                                var jsonLink = '<?php 
echo lc_href_link_admin('rpc.php', $lC_Template->getModule() . '&action=getSendData&nid=NID&send=1&NVP');
?>
'  
                                $.getJSON(jsonLink.replace('NID', parseInt(id)).replace('NVP', nvp),    
                                  function (edata) {
                                    if (edata.rpcStatus == -10) { // no session
                                      var url = "<?php 
            <div class="col-sm-12 col-lg-12">
              <div class="alert alert-warning no-margin-bottom">
                <?php 
echo $lC_Language->get('secure_payment_description_text');
?>
              </div>
              <script>
                /* we use javascript here due to js scrubbing at payment endpoints - we don't want to show if javascript is disabled or scrubbed */
                var output = '<div class="security-info-container">'+
                             '  <div class="security-info-title text-right cursor-pointer" onclick="$(\'#security-info-alert\').toggle(\'slideDown\');"><?php 
echo lc_image('images/greenlock.png', null, null, null, 'class="valign-middle margin-top margin-bottom small-margin-left small-margin-right"') . $lC_Language->get('secure_payment_security_info_title');
?>
</div>'+
                             '  <div id="security-info-alert" class="alert alert-success" style="display:none;">'+
                             '  <div class="security-info-url"><?php 
echo lc_image('images/greenlock.png', null, null, null, 'class="valign-middle small-margin-right"') . $secureUrl;
?>
</div>'+
                             '    <div class="security-info-text normal large-margin-left small-padding-left"><?php 
echo $lC_Language->get('secure_payment_security_info_text');
?>
</div>'+
                             '  </div>' +
                             '</div>';
                
                document.write(output);            
              </script>   
            </div>
            <?php 
if (!$isIE) {
    ?>