Ejemplo n.º 1
0
 function execute()
 {
     global $lC_Database, $lC_Session, $lC_NavigationHistory, $lC_Customer;
     if (!$lC_Customer->isLoggedOn()) {
         $lC_NavigationHistory->setSnapshot();
         lc_redirect(lc_href_link(FILENAME_ACCOUNT, 'login', 'SSL'));
         return false;
     }
     $id = false;
     foreach ($_GET as $key => $value) {
         if ((preg_match('/^[0-9]+(#?([0-9]+:?[0-9]+)+(;?([0-9]+:?[0-9]+)+)*)*$/', $key) || preg_match('/^[a-zA-Z0-9 -_]*$/', $key)) && $key != $lC_Session->getName()) {
             $id = $key;
         }
         break;
     }
     if ($id !== false && lC_Product::checkEntry($id)) {
         $lC_Product = new lC_Product($id);
         $Qcheck = $lC_Database->query('select products_id from :table_products_notifications where customers_id = :customers_id and products_id = :products_id limit 1');
         $Qcheck->bindTable(':table_products_notifications', TABLE_PRODUCTS_NOTIFICATIONS);
         $Qcheck->bindInt(':customers_id', $lC_Customer->getID());
         $Qcheck->bindInt(':products_id', $lC_Product->getID());
         $Qcheck->execute();
         if ($Qcheck->numberOfRows() > 0) {
             $Qn = $lC_Database->query('delete from :table_products_notifications where customers_id = :customers_id and products_id = :products_id');
             $Qn->bindTable(':table_products_notifications', TABLE_PRODUCTS_NOTIFICATIONS);
             $Qn->bindInt(':customers_id', $lC_Customer->getID());
             $Qn->bindInt(':products_id', $lC_Product->getID());
             $Qn->execute();
         }
     }
     lc_redirect(lc_href_link(basename($_SERVER['SCRIPT_FILENAME']), lc_get_all_get_params(array('action'))));
 }
 public function initialize()
 {
     global $lC_Database, $lC_Language, $lC_Product, $lC_Customer;
     $this->_title_link = lc_href_link(FILENAME_ACCOUNT, 'notifications', 'SSL');
     if (isset($lC_Product) && is_a($lC_Product, 'lC_Product')) {
         if ($lC_Customer->isLoggedOn()) {
             $Qcheck = $lC_Database->query('select global_product_notifications from :table_customers where customers_id = :customers_id');
             $Qcheck->bindTable(':table_customers', TABLE_CUSTOMERS);
             $Qcheck->bindInt(':customers_id', $lC_Customer->getID());
             $Qcheck->execute();
             if ($Qcheck->valueInt('global_product_notifications') === 0) {
                 $Qcheck = $lC_Database->query('select products_id from :table_products_notifications where products_id = :products_id and customers_id = :customers_id limit 1');
                 $Qcheck->bindTable(':table_products_notifications', TABLE_PRODUCTS_NOTIFICATIONS);
                 $Qcheck->bindInt(':products_id', $lC_Product->getID());
                 $Qcheck->bindInt(':customers_id', $lC_Customer->getID());
                 $Qcheck->execute();
                 if ($Qcheck->numberOfRows() > 0) {
                     $this->_content = '<li class="box-product-notifications-remove-image"><span class="box-product_notifications-image-container"></span>' . lc_link_object(lc_href_link(basename($_SERVER['SCRIPT_FILENAME']), lc_get_all_get_params(array('action')) . '&action=notify_remove', 'AUTO'), sprintf($lC_Language->get('box_product_notifications_remove'), $lC_Product->getTitle())) . '</li>';
                 } else {
                     $this->_content = '<li class="box-product-notifications-add-image"><span class="box-product_notifications-image-container"></span>' . lc_link_object(lc_href_link(basename($_SERVER['SCRIPT_FILENAME']), lc_get_all_get_params(array('action')) . '&action=notify_add', 'AUTO'), sprintf($lC_Language->get('box_product_notifications_add'), $lC_Product->getTitle())) . '</li>';
                 }
             }
         }
     }
 }
Ejemplo n.º 3
0
 public function initialize()
 {
     global $lC_Language, $request_type;
     $this->_content = '';
     foreach ($lC_Language->getAll() as $value) {
         $this->_content .= '<li class="box-languages-selection">' . lc_link_object(lc_href_link(basename($_SERVER['SCRIPT_FILENAME']), lc_get_all_get_params(array('language', 'currency')) . '&language=' . $value['code'], 'AUTO'), $lC_Language->showImage($value['code'])) . '</li>';
     }
 }
Ejemplo n.º 4
0
 function execute()
 {
     global $lC_Database, $lC_Session, $lC_NavigationHistory, $lC_Customer;
     if (!$lC_Customer->isLoggedOn()) {
         $lC_NavigationHistory->setSnapshot();
         lc_redirect(lc_href_link(FILENAME_ACCOUNT, 'login', 'SSL'));
         return false;
     }
     $notifications = array();
     if (isset($_GET['products']) && !empty($_GET['products'])) {
         $products_array = explode(';', $_GET['products']);
         foreach ($products_array as $product_id) {
             if (is_numeric($product_id) && !in_array($product_id, $notifications)) {
                 $notifications[] = $product_id;
             }
         }
     } else {
         $id = false;
         foreach ($_GET as $key => $value) {
             if ((preg_match('/^[0-9]+(#?([0-9]+:?[0-9]+)+(;?([0-9]+:?[0-9]+)+)*)*$/', $key) || preg_match('/^[a-zA-Z0-9 -_]*$/', $key)) && $key != $lC_Session->getName()) {
                 $id = $key;
             }
             break;
         }
         if ($id !== false && lC_Product::checkEntry($id)) {
             $lC_Product = new lC_Product($id);
             $notifications[] = $lC_Product->getID();
         }
     }
     if (!empty($notifications)) {
         foreach ($notifications as $product_id) {
             $Qcheck = $lC_Database->query('select products_id from :table_products_notifications where customers_id = :customers_id and products_id = :products_id limit 1');
             $Qcheck->bindTable(':table_products_notifications', TABLE_PRODUCTS_NOTIFICATIONS);
             $Qcheck->bindInt(':customers_id', $lC_Customer->getID());
             $Qcheck->bindInt(':products_id', $product_id);
             $Qcheck->execute();
             if ($Qcheck->numberOfRows() < 1) {
                 $Qn = $lC_Database->query('insert into :table_products_notifications (products_id, customers_id, date_added) values (:products_id, :customers_id, :date_added)');
                 $Qn->bindTable(':table_products_notifications', TABLE_PRODUCTS_NOTIFICATIONS);
                 $Qn->bindInt(':products_id', $product_id);
                 $Qn->bindInt(':customers_id', $lC_Customer->getID());
                 $Qn->bindRaw(':date_added', 'now()');
                 $Qn->execute();
             }
         }
     }
     lc_redirect(lc_href_link(basename($_SERVER['SCRIPT_FILENAME']), lc_get_all_get_params(array('action'))));
 }
Ejemplo n.º 5
0
 public function lC_Search_Search()
 {
     global $lC_Services, $lC_Language, $lC_Breadcrumb, $lC_Search, $lC_Vqmod;
     require_once $lC_Vqmod->modCheck('includes/classes/search.php');
     $this->_page_title = $lC_Language->get('search_heading');
     $lC_Search = new lC_Search();
     $this->addJavascriptPhpFilename('templates/' . $this->getCode() . '/javascript/form_check.js.php');
     if (isset($_GET['keywords'])) {
         $this->_page_title = $lC_Language->get('search_results_heading');
         $this->_page_contents = 'results.php';
         if ($lC_Services->isStarted('breadcrumb')) {
             $lC_Breadcrumb->add($lC_Language->get('breadcrumb_search_results'), lc_href_link(FILENAME_SEARCH, lc_get_all_get_params()));
         }
         $this->_process();
     } else {
         // nothing to do
     }
 }
Ejemplo n.º 6
0
 public function getListingOutput()
 {
     global $lC_Database, $lC_Language, $lC_Currencies, $lC_Image, $lC_Featured_products;
     $Qf = $lC_Database->query('select products_id 
                              from :table_featured_products 
                             where (str_to_date(expires_date, "%Y-%m-%d") >= str_to_date(now(), "%Y-%m-%d") or expires_date = "0000-00-00 00:00:00") 
                               and status = 1 
                          order by expires_date desc');
     $Qf->bindTable(':table_featured_products', TABLE_FEATURED_PRODUCTS);
     $Qf->execute();
     while ($Qf->next()) {
         $Qfresults[] = $Qf->valueInt('products_id');
     }
     $output = '';
     if ($Qf->numberOfRows() > 0) {
         foreach ($Qfresults as $featured) {
             $Qfeatured = $lC_Database->query('select p.products_id, p.products_price, p.products_tax_class_id, p.products_quantity, pd.products_name, pd.products_keyword, pd.products_description, i.image from :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 p.products_id = :products_id and p.products_status = 1 and p.products_id = pd.products_id and pd.language_id = :language_id');
             $Qfeatured->bindTable(':table_products', TABLE_PRODUCTS);
             $Qfeatured->bindTable(':table_products_images', TABLE_PRODUCTS_IMAGES);
             $Qfeatured->bindTable(':table_products_description', TABLE_PRODUCTS_DESCRIPTION);
             $Qfeatured->bindInt(':products_id', $featured);
             $Qfeatured->bindInt(':default_flag', 1);
             $Qfeatured->bindInt(':language_id', $lC_Language->getID());
             $Qfeatured->execute();
             while ($Qfeatured->next()) {
                 $output .= '<div class="content-featured-products-listing-container">';
                 $output .= '  <div class="content-featured-products-listing-name">' . lc_link_object(lc_href_link(FILENAME_PRODUCTS, $Qfeatured->value('products_keyword')), $Qfeatured->value('products_name')) . '</div>' . "\n";
                 $output .= '  <div class="content-featured-products-listing-description">' . (strlen(lc_clean_html($Qfeatured->value('products_description'))) > 65 ? substr(lc_clean_html($Qfeatured->value('products_description')), 0, 62) . '...' : lc_clean_html($Qfeatured->value('products_description'))) . '</div>' . "\n";
                 $output .= '  <div class="content-featured-products-listing-price">' . $lC_Currencies->displayPrice($Qfeatured->value('products_price'), $Qfeatured->valueInt('products_tax_class_id')) . '</div>' . "\n";
                 $output .= '  <div class="content-featured-products-listing-image">' . lc_link_object(lc_href_link(FILENAME_PRODUCTS, $Qfeatured->value('products_keyword')), $lC_Image->show($Qfeatured->value('image'), $Qfeatured->value('products_name'))) . '</div>' . "\n";
                 if (DISABLE_ADD_TO_CART == 1 && $Qfeatured->valueInt('products_quantity') < 1) {
                     $output .= '  <div class="content-featured-products-listing-buy-now"><button type="button" class="content-featured-products-listing-buy-now-button" disabled>' . $lC_Language->get('out_of_stock') . '</button></div>' . "\n";
                 } else {
                     $output .= '  <div class="content-featured-products-listing-buy-now"><button type="button" onclick="document.location.href=\'' . lc_href_link(basename($_SERVER['SCRIPT_FILENAME']), $Qfeatured->value('products_keyword') . '&' . lc_get_all_get_params(array('action', 'new')) . '&action=cart_add') . '\'" class="content-featured-products-listing-buy-now-button">' . $lC_Language->get('button_buy_now') . '</button></div>' . "\n";
                 }
                 $output .= '</div>' . "\n";
             }
         }
     } else {
         $output .= '<div class="content-specials-listing-name">' . $lC_Language->get('text_no_featured_products') . '</div>';
     }
     return $output;
 }
Ejemplo n.º 7
0
?>
    </div><div class="clear-both"></div>

    <?php 
if ($Qlisting->numberOfRows() > 0 && (PREV_NEXT_BAR_LOCATION == '2' || PREV_NEXT_BAR_LOCATION == '3')) {
    ?>
      <!-- PAGINATION-->
      <div class="product-listing-module-pagination">
        <div class="pull-left page-results"><?php 
    echo $Qlisting->getBatchTotalPages($lC_Language->get('result_set_number_of_products'));
    ?>
</div>
        <div class="pull-right no-margin-bottom no-margin-top">
          <ul class="pagination no-margin-top no-margin-bottom">
            <?php 
    echo $Qlisting->getBatchPageLinks('page', lc_get_all_get_params(array('page', 'info', 'x', 'y')), false);
    ?>
          </ul>
        </div>
      </div><div class="clear-both"></div>
      <!-- /PAGINATION--> 
      <?php 
}
?>
  </div>
</div>
<script>
$(document).ready(function() {
  var buttonContentText;
  var mediaType = _setMediaType();
  var mainContentClass = $('#main-content-container').attr('class');
Ejemplo n.º 8
0
 public function getListingOutput()
 {
     global $lC_Database, $lC_Language, $lC_Currencies, $lC_Image;
     $Qspecials = $lC_Database->query('select p.products_id, p.products_price, p.products_tax_class_id, p.products_quantity, pd.products_name, pd.products_keyword, pd.products_description, s.specials_new_products_price, i.image from :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, :table_specials s where p.products_status = 1 and s.products_id = p.products_id and p.products_id = pd.products_id and pd.language_id = :language_id and s.status = 1 order by s.specials_date_added desc');
     $Qspecials->bindTable(':table_products', TABLE_PRODUCTS);
     $Qspecials->bindTable(':table_products_images', TABLE_PRODUCTS_IMAGES);
     $Qspecials->bindTable(':table_products_description', TABLE_PRODUCTS_DESCRIPTION);
     $Qspecials->bindTable(':table_specials', TABLE_SPECIALS);
     $Qspecials->bindInt(':default_flag', 1);
     $Qspecials->bindInt(':language_id', $lC_Language->getID());
     $Qspecials->setBatchLimit(isset($_GET['page']) && is_numeric($_GET['page']) ? $_GET['page'] : 1, MAX_DISPLAY_SPECIAL_PRODUCTS);
     $Qspecials->execute();
     $output = '';
     if ($Qspecials->numberOfRows() > 0) {
         while ($Qspecials->next()) {
             $output .= '<div class="content-specials-listing-container">';
             $output .= '  <div class="content-specials-listing-name">' . lc_link_object(lc_href_link(FILENAME_PRODUCTS, $Qspecials->value('products_keyword')), $Qspecials->value('products_name')) . '</div>' . "\n";
             $output .= '  <div class="content-specials-listing-description">' . (strlen(lc_clean_html($Qspecials->value('products_description'))) > 65 ? substr(lc_clean_html($Qspecials->value('products_description')), 0, 62) . '...' : lc_clean_html($Qspecials->value('products_description'))) . '</div>' . "\n";
             $output .= '  <div class="content-specials-listing-price"><s>' . $lC_Currencies->displayPrice($Qspecials->value('products_price'), $Qspecials->valueInt('products_tax_class_id')) . '</s> <span class="product-special-price">' . $lC_Currencies->displayPrice($Qspecials->value('specials_new_products_price'), $Qspecials->valueInt('products_tax_class_id')) . '</span></div>' . "\n";
             $output .= '  <div class="content-specials-listing-image">' . lc_link_object(lc_href_link(FILENAME_PRODUCTS, $Qspecials->value('products_keyword')), $lC_Image->show($Qspecials->value('image'), $Qspecials->value('products_name'))) . '</div>' . "\n";
             if (DISABLE_ADD_TO_CART == 1 && $Qspecials->valueInt('products_quantity') < 1) {
                 $output .= '  <div class="content-specials-listing-buy-now"><button type="button" class="content-specials-listing-buy-now-button" disabled>' . $lC_Language->get('out_of_stock') . '</button></div>' . "\n";
             } else {
                 $output .= '  <div class="content-specials-listing-buy-now"><button type="button" onclick="document.location.href=\'' . lc_href_link(basename($_SERVER['SCRIPT_FILENAME']), $Qspecials->value('products_keyword') . '&' . lc_get_all_get_params(array('action', 'new')) . '&action=cart_add') . '\'" class="content-specials-listing-buy-now-button">' . $lC_Language->get('button_buy_now') . '</button></div>' . "\n";
             }
             $output .= '</div>' . "\n";
         }
     } else {
         $output .= '<div class="content-specials-listing-name">' . $lC_Language->get('text_no_specials') . '</div>';
     }
     return $output;
 }
Ejemplo n.º 9
0
                        break;
                    case 'PRODUCT_LIST_WEIGHT':
                        $output .= '<div class="product-listing-module-weight">' . $lC_Product->getWeight() . '</div>' . "\n";
                        break;
                    case 'PRODUCT_LIST_IMAGE':
                        if (isset($_GET['manufacturers'])) {
                            $output .= '<div class="product-listing-module-image">' . lc_link_object(lc_href_link(FILENAME_PRODUCTS, $lC_Product->getKeyword() . '&manufacturers=' . $_GET['manufacturers']), $lC_Image->show($lC_Product->getImage(), $lC_Product->getTitle(), 'class="product-listing-module-image-src"')) . '</div>' . "\n";
                        } else {
                            $output .= '<div class="product-listing-module-image">' . lc_link_object(lc_href_link(FILENAME_PRODUCTS, $lC_Product->getKeyword() . ($cPath ? '&cPath=' . $cPath : '')), $lC_Image->show($lC_Product->getImage(), $lC_Product->getTitle(), 'class="product-listing-module-image-src"')) . '</div>' . "\n";
                        }
                        break;
                    case 'PRODUCT_LIST_BUY_NOW':
                        if (DISABLE_ADD_TO_CART == 1 && $lC_Product->getQuantity() < 1) {
                            $output .= '<div class="product-listing-module-buy-now buy-btn-div"><button class="product-listing-module-buy-now-button" disabled>' . $lC_Language->get('out_of_stock') . '</button></div>' . "\n";
                        } else {
                            $output .= '<div class="product-listing-module-buy-now buy-btn-div">';
                            if ($show_buy_now) {
                                $output .= '<form action="' . lc_href_link(basename($_SERVER['SCRIPT_FILENAME']), $lC_Product->getKeyword() . '&' . lc_get_all_get_params(array('action', 'new')) . '&action=cart_add') . '" method="post"><button onclick="$(this).closest(\'form\').submit();" type="submit" class="product-listing-module-buy-now-button">' . $lC_Language->get('button_buy_now') . '</button></form>';
                            }
                            $output .= '</div>' . "\n";
                        }
                        break;
                }
            }
            $output .= '</div>' . "\n";
        }
    }
} else {
    $output .= '<div class="product-listing-module-no-products"><p>' . $lC_Language->get('no_products_in_category') . '</p></div>';
}
echo $output;
Ejemplo n.º 10
0
 function lc_create_sort_heading($key, $heading)
 {
     global $lC_Language;
     $current = false;
     $direction = false;
     if (!isset($_GET['sort'])) {
         $current = 'name';
     } elseif ($_GET['sort'] == $key || $_GET['sort'] == $key . '|d') {
         $current = $key;
     }
     if ($key == $current) {
         if (isset($_GET['sort'])) {
             $direction = $_GET['sort'] == $key ? '+' : '-';
         } else {
             $direction = '+';
         }
     }
     return lc_link_object(lc_href_link(basename($_SERVER['SCRIPT_FILENAME']), lc_get_all_get_params(array('page', 'sort')) . '&sort=' . $key . ($direction == '+' ? '|d' : '')), $heading . ($key == $current ? $direction : ''), 'title="' . (isset($_GET['sort']) && $_GET['sort'] == $key ? sprintf($lC_Language->get('listing_sort_ascendingly'), $heading) : sprintf($lC_Language->get('listing_sort_descendingly'), $heading)) . '" class="productListing-heading"');
 }
Ejemplo n.º 11
0
?>
            </h3>
            <p class=""><?php 
echo strlen($lC_Product->getDescription()) > 60 ? substr(lc_clean_html($lC_Product->getDescription()), 0, 57) . '...' : lc_clean_html($lC_Product->getDescription());
?>
</p>
            <div class="row pricing-row">
              <div class="col-sm-6 col-lg-6">
                <p class="lead"><?php 
echo $lC_Product->getPriceFormated();
?>
</p>
              </div>
              <div class="col-sm-6 col-lg-6 no-margin-left buy-btn-div">
                <button class="btn btn-success btn-block" onclick="window.location.href='<?php 
echo lc_href_link(basename($_SERVER['SCRIPT_FILENAME']), $lC_Product->getKeyword() . '&' . lc_get_all_get_params(array('action', 'new')) . '&action=cart_add');
?>
'" type="button"><?php 
echo $lC_Language->get('button_buy_now');
?>
</button>
              </div>
            </div>
          </div>
        </div>    
      </div>
      <div class="col-sm-8 col-lg-8">
        <?php 
if ($lC_MessageStack->size('tell_a_friend') > 0) {
    echo '<div class="message-stack-container alert alert-danger">' . $lC_MessageStack->get('tell_a_friend') . '</div>' . "\n";
}
Ejemplo n.º 12
0
 public static function getTemplateCurrenciesSelection($include_symbol = true, $include_name = false, $params = '')
 {
     global $lC_Currencies;
     $currency_data = array();
     foreach ($lC_Currencies->currencies as $key => $value) {
         $currency_data[] = array('id' => $key, 'text' => $value['title']);
     }
     foreach ($currency_data as $currency) {
         if ($include_name === true && $include_symbol === true) {
             $text = '<span class="locale-dropdown-cur-title">' . $currency['text'] . '</span> <span class="locale-dropdown-cur-symbol">(' . $currency['id'] . ')</span>';
         } else {
             if ($include_name === true && $include_symbol === false) {
                 $text = '<span class="locale-dropdown-cur-title">' . $currency['text'] . '</span>';
             } else {
                 $text = '<span class="locale-dropdown-cur-symbol">' . $currency['id'] . '</span>';
             }
         }
         echo '<li>
           <a href="' . lc_href_link(basename($_SERVER['SCRIPT_FILENAME']), lc_get_all_get_params(array('language', 'currency')) . '&currency=' . $currency['id'], 'AUTO') . '">
             ' . $text . '
           </a>
         </li>';
     }
     return $output;
 }
Ejemplo n.º 13
0
 public function getLanguageSelection($include_image = true, $include_name = false, $params = '')
 {
     global $lC_Language;
     $text = '';
     $output = '';
     foreach ($lC_Language->getAll() as $value) {
         if ($include_name === true && $include_image === true) {
             $text = $value['name'] . ' ' . $lC_Language->showImage($value['code']);
         } else {
             if ($include_name === true && $include_image === false) {
                 $text = $value['name'];
             } else {
                 $text = $lC_Language->showImage($value['code'], null, null, $params);
             }
         }
         $output .= '<li>' . lc_link_object(lc_href_link(basename($_SERVER['SCRIPT_FILENAME']), lc_get_all_get_params(array('language', 'currency')) . '&language=' . $value['code'], 'AUTO'), $text) . '</li>';
     }
     return $output;
 }