Пример #1
0
 public function initialize()
 {
     $OSCOM_Product = Registry::exists('Product') ? Registry::get('Product') : null;
     $OSCOM_Customer = Registry::get('Customer');
     $OSCOM_Database = Registry::get('Database');
     $OSCOM_Language = Registry::get('Language');
     $this->_title_link = OSCOM::getLink(null, 'Account', 'Notifications', 'SSL');
     if (isset($OSCOM_Product) && $OSCOM_Product instanceof \osCommerce\OM\Site\Shop\Product && $OSCOM_Product->isValid()) {
         if ($OSCOM_Customer->isLoggedOn()) {
             $Qcheck = $OSCOM_Database->query('select global_product_notifications from :table_customers where customers_id = :customers_id');
             $Qcheck->bindInt(':customers_id', $OSCOM_Customer->getID());
             $Qcheck->execute();
             if ($Qcheck->valueInt('global_product_notifications') === 0) {
                 $Qcheck = $OSCOM_Database->query('select products_id from :table_products_notifications where products_id = :products_id and customers_id = :customers_id limit 1');
                 $Qcheck->bindInt(':products_id', $OSCOM_Product->getID());
                 $Qcheck->bindInt(':customers_id', $OSCOM_Customer->getID());
                 $Qcheck->execute();
                 if ($Qcheck->numberOfRows() > 0) {
                     $this->_content = '<div style="float: left; width: 55px;">' . osc_link_object(OSCOM::getLink(null, null, osc_get_all_get_params(array('action')) . '&action=notify_remove', 'AUTO'), osc_image(DIR_WS_IMAGES . 'box_products_notifications_remove.gif', sprintf(OSCOM::getDef('box_product_notifications_remove'), $OSCOM_Product->getTitle()))) . '</div>' . osc_link_object(OSCOM::getLink(null, null, osc_get_all_get_params(array('action')) . '&action=notify_remove', 'AUTO'), sprintf(OSCOM::getDef('box_product_notifications_remove'), $OSCOM_Product->getTitle()));
                 } else {
                     $this->_content = '<div style="float: left; width: 55px;">' . osc_link_object(OSCOM::getLink(null, null, osc_get_all_get_params(array('action')) . '&action=notify_add', 'AUTO'), osc_image(DIR_WS_IMAGES . 'box_products_notifications.gif', sprintf(OSCOM::getDef('box_product_notifications_add'), $OSCOM_Product->getTitle()))) . '</div>' . osc_link_object(OSCOM::getLink(null, null, osc_get_all_get_params(array('action')) . '&action=notify_add', 'AUTO'), sprintf(OSCOM::getDef('box_product_notifications_add'), $OSCOM_Product->getTitle()));
                 }
                 $this->_content .= '<div style="clear: both;"></div>';
             }
         }
     }
 }
Пример #2
0
/**
 * Echo Site logo
 * 
 * @access public
 * @return string
 */
function site_logo()
{
    global $osC_Template;
    $logo = $osC_Template->getLogo();
    $logo = $logo == 'images/store_logo.png' ? 'templates/' . $osC_Template->getCode() . '/images/store_logo.png' : $logo;
    return osc_link_object(osc_href_link(FILENAME_DEFAULT), osc_image($logo, STORE_NAME), 'id="siteLogo"');
}
Пример #3
0
 function initialize()
 {
     global $osC_Database, $osC_Language;
     $Qmanufacturers = $osC_Database->query('select m.manufacturers_id as id, m.manufacturers_name as text, m.manufacturers_image as image from :table_manufacturers m, :table_manufacturers_info mi where m.manufacturers_id = mi.manufacturers_id and mi.languages_id = :languages_id order by manufacturers_name');
     $Qmanufacturers->bindTable(':table_manufacturers', TABLE_MANUFACTURERS);
     $Qmanufacturers->bindTable(':table_manufacturers_info', TABLE_MANUFACTURERS_INFO);
     $Qmanufacturers->bindInt(':languages_id', $osC_Language->getID());
     $Qmanufacturers->setCache('box-manufacturers-' . $osC_Language->getCode(), 100);
     $Qmanufacturers->execute();
     if (BOX_MANUFACTURERS_LIST_TYPE == 'ComboBox') {
         $manufacturers_array = array(array('id' => '', 'text' => $osC_Language->get('pull_down_default')));
         while ($Qmanufacturers->next()) {
             $manufacturers_array[] = $Qmanufacturers->toArray();
         }
         $this->_content = '<form name="manufacturers" action="' . osc_href_link(FILENAME_DEFAULT, null, 'NONSSL', false) . '" method="get">' . osc_draw_pull_down_menu('manufacturers', $manufacturers_array, null, 'onchange="this.form.submit();" size="' . BOX_MANUFACTURERS_LIST_SIZE . '" style="width: 99%"') . osc_draw_hidden_session_id_field() . '</form>';
     } else {
         $this->_content = '<ul>';
         while ($Qmanufacturers->next()) {
             $manufacturers_image = $Qmanufacturers->value('image');
             if (!empty($manufacturers_image) && file_exists(DIR_WS_IMAGES . 'manufacturers/' . $Qmanufacturers->value('image'))) {
                 $this->_content .= '<li>' . osc_link_object(osc_href_link(FILENAME_DEFAULT, 'manufacturers=' . $Qmanufacturers->valueInt('id')), osc_image("images/manufacturers/" . $Qmanufacturers->value('image'), $Qmanufacturers->value('text'))) . '</li>';
             }
         }
         $this->_content .= '</ul>';
     }
     $Qmanufacturers->freeResult();
 }
 function initialize()
 {
     global $osC_Database, $osC_Language, $osC_Product;
     if (isset($osC_Product) && is_a($osC_Product, 'osC_Product')) {
         $Qmanufacturer = $osC_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', $osC_Language->getID());
         $Qmanufacturer->bindInt(':products_id', $osC_Product->getID());
         $Qmanufacturer->execute();
         if ($Qmanufacturer->numberOfRows()) {
             $this->_content = '';
             if (!osc_empty($Qmanufacturer->value('manufacturers_image'))) {
                 $this->_content .= '<div style="text-align: center;">' . osc_link_object(osc_href_link(FILENAME_DEFAULT, 'manufacturers=' . $Qmanufacturer->valueInt('manufacturers_id')), osc_image(DIR_WS_IMAGES . 'manufacturers/' . $Qmanufacturer->value('manufacturers_image'), $Qmanufacturer->value('manufacturers_name'))) . '</div>';
             }
             $this->_content .= '<ol style="list-style: none; margin: 0; padding: 0;">';
             if (!osc_empty($Qmanufacturer->value('manufacturers_url'))) {
                 $this->_content .= '<li>' . osc_link_object(osc_href_link(FILENAME_REDIRECT, 'action=manufacturer&manufacturers_id=' . $Qmanufacturer->valueInt('manufacturers_id')), sprintf($osC_Language->get('box_manufacturer_info_website'), $Qmanufacturer->value('manufacturers_name')), 'target="_blank"') . '</li>';
             }
             $this->_content .= '<li>' . osc_link_object(osc_href_link(FILENAME_DEFAULT, 'manufacturers=' . $Qmanufacturer->valueInt('manufacturers_id')), $osC_Language->get('box_manufacturer_info_products')) . '</li>';
             $this->_content .= '</ol>';
         }
     }
 }
Пример #5
0
 function quote()
 {
     global $osC_Language, $osC_ShoppingCart, $osC_Weight;
     if (MODULE_SHIPPING_TABLE_MODE == 'price') {
         $order_total = $osC_ShoppingCart->getSubTotal();
     } else {
         $order_total = $osC_Weight->convert($osC_ShoppingCart->getWeight(), SHIPPING_WEIGHT_UNIT, MODULE_SHIPPING_TABLE_WEIGHT_UNIT);
     }
     //fix the shipping cost calculating bug
     if (!is_int($order_total) && strpos($order_total, ',') !== false) {
         $order_total = str_replace(',', '', $order_total);
         $order_total = (int) $order_total;
     }
     $table_cost = split("[:,]", MODULE_SHIPPING_TABLE_COST);
     $size = sizeof($table_cost);
     for ($i = 0, $n = $size; $i < $n; $i += 2) {
         if ($order_total <= $table_cost[$i]) {
             $shipping = $table_cost[$i + 1];
             break;
         }
     }
     if (MODULE_SHIPPING_TABLE_MODE == 'weight') {
         $shipping = $shipping * $osC_ShoppingCart->numberOfShippingBoxes();
     }
     $this->quotes = array('id' => $this->_code, 'module' => $this->_title, 'methods' => array(array('id' => $this->_code, 'title' => $osC_Language->get('shipping_table_method'), 'cost' => $shipping + MODULE_SHIPPING_TABLE_HANDLING)), 'tax_class_id' => $this->tax_class);
     if (!empty($this->icon)) {
         $this->quotes['icon'] = osc_image($this->icon, $this->_title);
     }
     return $this->quotes;
 }
 function initialize()
 {
     global $osC_Database, $osC_Language, $osC_Product, $osC_Customer;
     $this->_title_link = osc_href_link(FILENAME_ACCOUNT, 'notifications', 'SSL');
     if (isset($osC_Product) && is_a($osC_Product, 'osC_Product')) {
         if ($osC_Customer->isLoggedOn()) {
             $Qcheck = $osC_Database->query('select global_product_notifications from :table_customers where customers_id = :customers_id');
             $Qcheck->bindTable(':table_customers', TABLE_CUSTOMERS);
             $Qcheck->bindInt(':customers_id', $osC_Customer->getID());
             $Qcheck->execute();
             if ($Qcheck->valueInt('global_product_notifications') === 0) {
                 $Qcheck = $osC_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', $osC_Product->getID());
                 $Qcheck->bindInt(':customers_id', $osC_Customer->getID());
                 $Qcheck->execute();
                 if ($Qcheck->numberOfRows() > 0) {
                     $this->_content = '<div style="float: left; width: 55px;">' . osc_link_object(osc_href_link(basename($_SERVER['SCRIPT_FILENAME']), osc_get_all_get_params(array('action')) . '&action=notify_remove', 'AUTO'), osc_image(DIR_WS_IMAGES . 'box_products_notifications_remove.gif', sprintf($osC_Language->get('box_product_notifications_remove'), $osC_Product->getTitle()))) . '</div>' . osc_link_object(osc_href_link(basename($_SERVER['SCRIPT_FILENAME']), osc_get_all_get_params(array('action')) . '&action=notify_remove', 'AUTO'), sprintf($osC_Language->get('box_product_notifications_remove'), $osC_Product->getTitle()));
                 } else {
                     $this->_content = '<div style="float: left; width: 55px;">' . osc_link_object(osc_href_link(basename($_SERVER['SCRIPT_FILENAME']), osc_get_all_get_params(array('action')) . '&action=notify_add', 'AUTO'), osc_image(DIR_WS_IMAGES . 'box_products_notifications.gif', sprintf($osC_Language->get('box_product_notifications_add'), $osC_Product->getTitle()))) . '</div>' . osc_link_object(osc_href_link(basename($_SERVER['SCRIPT_FILENAME']), osc_get_all_get_params(array('action')) . '&action=notify_add', 'AUTO'), sprintf($osC_Language->get('box_product_notifications_add'), $osC_Product->getTitle()));
                 }
                 $this->_content .= '<div style="clear: both;"></div>';
             }
         } else {
             $this->_content = '<div style="float: left; width: 55px;">' . osc_link_object(osc_href_link(basename($_SERVER['SCRIPT_FILENAME']), osc_get_all_get_params(array('action')) . '&action=notify_add', 'AUTO'), osc_image(DIR_WS_IMAGES . 'box_products_notifications.gif', sprintf($osC_Language->get('box_product_notifications_add'), $osC_Product->getTitle()))) . '</div>' . osc_link_object(osc_href_link(basename($_SERVER['SCRIPT_FILENAME']), osc_get_all_get_params(array('action')) . '&action=notify_add', 'AUTO'), sprintf($osC_Language->get('box_product_notifications_add'), $osC_Product->getTitle())) . '<div style="clear: both;"></div>';
         }
     }
 }
Пример #7
0
 function initialize()
 {
     global $osC_Language, $osC_Template, $osC_ShoppingCart;
     $steps = array();
     if ($osC_ShoppingCart->getContentType() != 'virtual') {
         $steps[] = array('title' => $osC_Language->get('box_ordering_steps_delivery'), 'code' => 'shipping', 'active' => $osC_Template->getModule() == 'shipping' || $osC_Template->getModule() == 'shipping_address' ? true : false);
     }
     $steps[] = array('title' => $osC_Language->get('box_ordering_steps_payment'), 'code' => 'payment', 'active' => $osC_Template->getModule() == 'payment' || $osC_Template->getModule() == 'payment_address' ? true : false);
     $steps[] = array('title' => $osC_Language->get('box_ordering_steps_confirmation'), 'code' => 'confirmation', 'active' => $osC_Template->getModule() == 'confirmation' ? true : false);
     $steps[] = array('title' => $osC_Language->get('box_ordering_steps_complete'), 'active' => $osC_Template->getModule() == 'success' ? true : false);
     $content = osc_image('templates/' . $osC_Template->getCode() . '/images/icons/32x32/checkout_preparing_to_ship.gif') . '<br />';
     $counter = 0;
     foreach ($steps as $step) {
         $counter++;
         $content .= '<span style="white-space: nowrap;">&nbsp;' . osc_image('templates/' . $osC_Template->getCode() . '/images/icons/24x24/checkout_' . $counter . ($step['active'] === true ? '_on' : '') . '.gif', $step['title'], 24, 24, 'align="absmiddle"');
         if (isset($step['code'])) {
             $content .= osc_link_object(osc_href_link(FILENAME_CHECKOUT, $step['code'], 'SSL'), $step['title'], 'class="boxCheckoutTrail' . ($step['active'] === true ? 'Active' : '') . '"');
         } else {
             $content .= '<span class="boxCheckoutTrail' . ($step['active'] === true ? 'Active' : '') . '">' . $step['title'] . '</span>';
         }
         $content .= '</span><br />';
     }
     $content .= osc_image('templates/' . $osC_Template->getCode() . '/images/icons/32x32/checkout_ready_to_ship.gif');
     $this->_content = $content;
 }
Пример #8
0
 function getData($id)
 {
     global $osC_Database, $osC_Language;
     $Qreview = $osC_Database->query('select r.*, pd.products_name from :table_reviews r left join :table_products_description pd on (r.products_id = pd.products_id and r.languages_id = pd.language_id) where r.reviews_id = :reviews_id');
     $Qreview->bindTable(':table_reviews', TABLE_REVIEWS);
     $Qreview->bindTable(':table_products_description', TABLE_PRODUCTS_DESCRIPTION);
     $Qreview->bindInt(':reviews_id', $id);
     $Qreview->execute();
     $data = $Qreview->toArray();
     $data['reviews_rating'] = osc_image('../images/stars_' . $Qreview->valueInt('reviews_rating') . '.png', sprintf($osC_Language->get('rating_from_5_stars'), $Qreview->valueInt('reviews_rating')));
     $data['detailed_rating'] = $Qreview->valueInt('reviews_rating');
     $Qaverage = $osC_Database->query('select (avg(reviews_rating) / 5 * 100) as average_rating from :table_reviews where products_id = :products_id');
     $Qaverage->bindTable(':table_reviews', TABLE_REVIEWS);
     $Qaverage->bindInt(':products_id', $Qreview->valueInt('products_id'));
     $Qaverage->execute();
     $data['average_rating'] = $Qaverage->value('average_rating');
     $ratings = self::getCustomersRatings($id);
     if (is_array($ratings) && !empty($ratings)) {
         $data['ratings'] = $ratings;
     } else {
         $data['ratings'] = null;
     }
     $Qaverage->freeResult();
     $Qreview->freeResult();
     return $data;
 }
Пример #9
0
 public function initialize()
 {
     $OSCOM_ShoppingCart = Registry::get('ShoppingCart');
     $OSCOM_Template = Registry::get('Template');
     $steps = array();
     if ($OSCOM_ShoppingCart->getContentType() != 'virtual') {
         $steps[] = array('title' => OSCOM::getDef('box_ordering_steps_delivery'), 'code' => 'shipping', 'active' => $OSCOM_Template->getModule() == 'Shipping' || $OSCOM_Template->getModule() == 'ShippingAddress' ? true : false);
     }
     $steps[] = array('title' => OSCOM::getDef('box_ordering_steps_payment'), 'code' => 'payment', 'active' => $OSCOM_Template->getModule() == 'Payment' || $OSCOM_Template->getModule() == 'PaymentAddress' ? true : false);
     $steps[] = array('title' => OSCOM::getDef('box_ordering_steps_confirmation'), 'code' => 'confirmation', 'active' => $OSCOM_Template->getModule() == 'Confirmation' ? true : false);
     $steps[] = array('title' => OSCOM::getDef('box_ordering_steps_complete'), 'active' => $OSCOM_Template->getModule() == 'Success' ? true : false);
     $content = osc_image('templates/' . $OSCOM_Template->getCode() . '/images/icons/32x32/checkout_preparing_to_ship.gif') . '<br />';
     $counter = 0;
     foreach ($steps as $step) {
         $counter++;
         $content .= '<span style="white-space: nowrap;">&nbsp;' . osc_image('templates/' . $OSCOM_Template->getCode() . '/images/icons/24x24/checkout_' . $counter . ($step['active'] === true ? '_on' : '') . '.gif', $step['title'], 24, 24, 'align="absmiddle"');
         if (isset($step['code'])) {
             $content .= osc_link_object(OSCOM::getLink(null, 'Checkout', $step['code'], 'SSL'), $step['title'], 'class="boxCheckoutTrail' . ($step['active'] === true ? 'Active' : '') . '"');
         } else {
             $content .= '<span class="boxCheckoutTrail' . ($step['active'] === true ? 'Active' : '') . '">' . $step['title'] . '</span>';
         }
         $content .= '</span><br />';
     }
     $content .= osc_image('templates/' . $OSCOM_Template->getCode() . '/images/icons/32x32/checkout_ready_to_ship.gif');
     $this->_content = $content;
 }
Пример #10
0
/**
 * Display an icon from a template set
 *
 * @param string $image The icon to display
 * @param string $title The title of the icon
 * @param string $group The size group of the icon
 * @param string $parameters The parameters to pass to the image
 * @access public
 */
function osc_icon($image, $title = null, $group = '16x16', $parameters = null)
{
    global $osC_Language;
    if (is_null($title)) {
        $title = $osC_Language->get('icon_' . substr($image, 0, strpos($image, '.')));
    }
    return osc_image('templates/default/images/icons/' . (!empty($group) ? $group . '/' : null) . $image, $title, null, null, $parameters);
}
Пример #11
0
 function install()
 {
     global $osC_Database, $osC_Language;
     parent::install();
     $image = osc_image('images/adsense_script.gif');
     $osC_Database->simpleQuery("INSERT INTO " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) VALUES ('" . $osC_Language->get('box_google_adsense_code') . "', 'BOX_GOOGLE_ADSENSE_CODE', '', 'Please add the google javasript block', '6', '0', 'osc_cfg_set_textarea_field', now())");
     $osC_Database->simpleQuery("INSERT INTO " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) VALUES ('" . $osC_Language->get('box_google_adsense_example_code') . "', 'BOX_GOOGLE_ADSENSE_EXAMPLE_CODE', '" . $image . "' , 'Please add the google javasript block as this example code', '6', '0', 'osc_cfg_set_panel', now())");
 }
Пример #12
0
 public function quote()
 {
     $this->quotes = array('id' => $this->_code, 'module' => $this->_title, 'methods' => array(array('id' => $this->_code, 'title' => OSCOM::getDef('shipping_flat_method'), 'cost' => MODULE_SHIPPING_FLAT_COST)), 'tax_class_id' => $this->tax_class);
     if (!empty($this->icon)) {
         $this->quotes['icon'] = osc_image($this->icon, $this->_title);
     }
     return $this->quotes;
 }
Пример #13
0
 function listCustomers()
 {
     global $toC_Json, $osC_Database, $osC_Language;
     $osC_Currencies = new osC_Currencies_Admin();
     $start = empty($_REQUEST['start']) ? 0 : $_REQUEST['start'];
     $limit = empty($_REQUEST['limit']) ? MAX_DISPLAY_SEARCH_RESULTS : $_REQUEST['limit'];
     $Qcustomers = $osC_Database->query('select c.customers_id, c.customers_credits, c.customers_gender, c.customers_lastname, c.customers_firstname, c.customers_email_address, c.customers_status, c.customers_ip_address, c.date_account_created, c.number_of_logons, c.date_last_logon, cgd.customers_groups_name from :table_customers c left join :table_customers_groups_description cgd on (c.customers_groups_id = cgd.customers_groups_id and cgd.language_id = :language_id)');
     $Qcustomers->bindTable(':table_customers', TABLE_CUSTOMERS);
     $Qcustomers->bindTable(':table_customers_groups_description', TABLE_CUSTOMERS_GROUPS_DESCRIPTION);
     $Qcustomers->bindInt(':language_id', $osC_Language->getID());
     if (isset($_REQUEST['search']) && !empty($_REQUEST['search'])) {
         $Qcustomers->appendQuery('where c.customers_lastname like :customers_lastname or c.customers_firstname like :customers_firstname and c.customers_email_address like :customers_email_address');
         $Qcustomers->bindValue(':customers_lastname', '%' . $_REQUEST['search'] . '%');
         $Qcustomers->bindValue(':customers_firstname', '%' . $_REQUEST['search'] . '%');
         $Qcustomers->bindValue(':customers_email_address', '%' . $_REQUEST['search'] . '%');
     }
     $Qcustomers->appendQuery('order by c.customers_lastname, c.customers_firstname');
     $Qcustomers->setExtBatchLimit($start, $limit);
     $Qcustomers->execute();
     require_once 'includes/classes/geoip.php';
     $osC_GeoIP = osC_GeoIP_Admin::load();
     if ($osC_GeoIP->isInstalled()) {
         $osC_GeoIP->activate();
     }
     $records = array();
     while ($Qcustomers->next()) {
         $geoip = '';
         $iso_code_2 = $osC_GeoIP->getCountryISOCode2($Qcustomers->value('customers_ip_address'));
         if ($osC_GeoIP->isActive() && $osC_GeoIP->isValid($Qcustomers->value('customers_ip_address')) && !empty($iso_code_2)) {
             $geoip = osc_image('../images/worldflags/' . $iso_code_2 . '.png', $country . ', ' . $Qcustomers->value('customers_ip_address'), 18, 12) . '&nbsp;' . $Qcustomers->value('customers_ip_address');
         } else {
             $geoip = $Qcustomers->value('customers_ip_address');
         }
         $customers_info = '<table width="100%" cellspacing="5">' . '<tbody>' . '<tr>
             <td width="150">' . $osC_Language->get('field_gender') . '</td>
             <td>' . ($Qcustomers->value('customers_gender') == 'm' ? $osC_Language->get('gender_male') : $osC_Language->get('gender_female')) . '</td>
           </tr>' . '<tr>
             <td>' . $osC_Language->get('field_email_address') . '</td>
             <td>' . $Qcustomers->value('customers_email_address') . '</td>
           </tr>' . '<tr>
             <td>' . $osC_Language->get('field_customers_group') . '</td>
             <td>' . $Qcustomers->value('customers_groups_name') . '</td>
           </tr>' . '<tr>
             <td>' . $osC_Language->get('field_ip_address') . '</td>
             <td>' . $geoip . '</td>
           </tr>' . '<tr>
             <td>' . $osC_Language->get('field_number_of_logons') . '</td>
             <td>' . $Qcustomers->valueInt('number_of_logons') . '</td>
           </tr>' . '<tr>
             <td>' . $osC_Language->get('field_date_last_logon') . '</td>
             <td>' . osC_DateTime::getShort($Qcustomers->value('date_last_logon')) . '</td>
           </tr>' . '</tbody>' . '</table>';
         $records[] = array('customers_id' => $Qcustomers->valueInt('customers_id'), 'customers_lastname' => $Qcustomers->value('customers_lastname'), 'customers_firstname' => $Qcustomers->value('customers_firstname'), 'customers_credits' => $osC_Currencies->format($Qcustomers->value('customers_credits')), 'date_account_created' => osC_DateTime::getShort($Qcustomers->value('date_account_created')), 'customers_status' => $Qcustomers->valueInt('customers_status'), 'customers_info' => $customers_info);
     }
     $Qcustomers->freeResult();
     $response = array(EXT_JSON_READER_TOTAL => $Qcustomers->getBatchSize(), EXT_JSON_READER_ROOT => $records);
     echo $toC_Json->encode($response);
 }
Пример #14
0
 function quote()
 {
     global $osC_Language;
     $this->quotes = array('id' => $this->_code, 'module' => $this->_title, 'methods' => array(array('id' => $this->_code, 'title' => $osC_Language->get('shipping_self_pickup_method'), 'cost' => 0)), 'tax_class_id' => 0);
     if (!empty($this->icon)) {
         $this->quotes['icon'] = osc_image($this->icon, $this->_title);
     }
     return $this->quotes;
 }
Пример #15
0
 function quote()
 {
     global $osC_Language, $osC_ShoppingCart;
     $this->quotes = array('id' => $this->_code, 'module' => $this->_title, 'methods' => array(array('id' => $this->_code, 'title' => $osC_Language->get('shipping_item_method'), 'cost' => MODULE_SHIPPING_ITEM_COST * $osC_ShoppingCart->numberOfItems() + MODULE_SHIPPING_ITEM_HANDLING)), 'tax_class_id' => $this->tax_class);
     if (!empty($this->icon)) {
         $this->quotes['icon'] = osc_image($this->icon, $this->_title);
     }
     return $this->quotes;
 }
Пример #16
0
 function quote()
 {
     global $osC_Language, $osC_Currencies;
     $this->quotes = array('id' => $this->_code, 'module' => $this->_title, 'methods' => array(array('id' => $this->_code, 'title' => sprintf($osC_Language->get('shipping_free_for_amount'), $osC_Currencies->format(MODULE_SHIPPING_FREE_MINIMUM_ORDER)), 'cost' => 0)), 'tax_class_id' => 0);
     if (!empty($this->icon)) {
         $this->quotes['icon'] = osc_image($this->icon, $this->_title);
     }
     return $this->quotes;
 }
Пример #17
0
/**
 * Display an icon from a template set
 *
 * @param string $image The icon to display
 * @param string $title The title of the icon
 * @param string $group The size group of the icon
 * @param string $parameters The parameters to pass to the image
 * @access public
 */
function osc_icon($image, $title = null, $group = null, $parameters = null)
{
    if (is_null($title)) {
        $title = OSCOM::getDef('icon_' . substr($image, 0, strpos($image, '.')));
    }
    if (is_null($group)) {
        $group = '16x16';
    }
    return osc_image(OSCOM::getPublicSiteLink('templates/' . Registry::get('Template')->getCode() . '/images/icons/' . (!empty($group) ? $group . '/' : null) . $image), $title, null, null, $parameters);
}
Пример #18
0
 function checkout_initialization_method()
 {
     global $osC_Language;
     if (file_exists(DIR_FS_CATALOG . DIR_WS_IMAGES . 'modules/payment/paypal/btn_express_' . basename($osC_Language->getCode()) . '.gif')) {
         $image = DIR_WS_IMAGES . 'modules/payment/paypal/btn_express_' . basename($osC_Language->getCode()) . '.gif';
     } else {
         $image = DIR_WS_IMAGES . 'modules/payment/paypal/btn_express.gif';
     }
     $string = osc_link_object(osc_href_link(FILENAME_CHECKOUT, 'callback&module=paypal_express'), osc_image($image, $osC_Language->get('payment_paypal_express_button_title')));
     return $string;
 }
Пример #19
0
 public function quote()
 {
     global $osC_ShoppingCart, $osC_Weight;
     $dest_country = $osC_ShoppingCart->getShippingAddress('country_iso_code_2');
     $dest_zone = 0;
     $error = false;
     $shipping_method = null;
     $shipping_cost = null;
     $shipping_weight = 0;
     foreach ($osC_ShoppingCart->getProducts() as $product) {
         $osC_Product = new osC_Product($product['id']);
         if ($osC_Product->isTypeActionAllowed('apply_shipping_fees')) {
             $shipping_weight += $osC_Weight->convert($product['weight'], SHIPPING_WEIGHT_UNIT, MODULE_SHIPPING_ZONES_WEIGHT_UNIT) * $product['quantity'];
         }
     }
     for ($i = 1; $i <= $this->num_zones; $i++) {
         $countries_table = constant('MODULE_SHIPPING_ZONES_COUNTRIES_' . $i);
         $country_zones = preg_split("/[,]/", $countries_table);
         if (in_array($dest_country, $country_zones)) {
             $dest_zone = $i;
             break;
         }
     }
     if ($dest_zone == 0) {
         $error = true;
     } else {
         $shipping = -1;
         $zones_cost = constant('MODULE_SHIPPING_ZONES_COST_' . $dest_zone);
         $zones_table = preg_split("/[:,]/", $zones_cost);
         $size = sizeof($zones_table);
         for ($i = 0; $i < $size; $i += 2) {
             if ($shipping_weight <= $zones_table[$i]) {
                 $shipping = $zones_table[$i + 1];
                 $shipping_method = __('shipping_zones_method') . ' ' . $dest_country . ' : ' . $osC_Weight->display($osC_ShoppingCart->getWeight(), MODULE_SHIPPING_ZONES_WEIGHT_UNIT);
                 break;
             }
         }
         if ($shipping == -1) {
             $shipping_cost = 0;
             $shipping_method = __('shipping_zones_undefined_rate');
         } else {
             $shipping_cost = $shipping * $osC_ShoppingCart->numberOfShippingBoxes() + constant('MODULE_SHIPPING_ZONES_HANDLING_' . $dest_zone);
         }
     }
     $this->quotes = array('id' => $this->_code, 'module' => $this->_title, 'methods' => array(array('id' => $this->_code, 'title' => $shipping_method, 'cost' => $shipping_cost)), 'tax_class_id' => $this->tax_class);
     if (!empty($this->icon)) {
         $this->quotes['icon'] = osc_image($this->icon, $this->_title);
     }
     if ($error == true) {
         $this->quotes['error'] = __('shipping_zones_invalid_zone');
     }
     return $this->quotes;
 }
Пример #20
0
 function initialize()
 {
     global $osC_Database, $osC_Services, $osC_Language, $osC_Image, $osC_Template;
     $Qimages = $osC_Database->query('select image ,image_url, description from :table_slide_images where language_id =:language_id and status = 1 order by sort_order desc');
     $Qimages->bindTable(':table_slide_images', TABLE_SLIDE_IMAGES);
     $Qimages->bindInt(':language_id', $osC_Language->getID());
     $Qimages->setCache('slide-images-' . $osC_Language->getCode());
     $Qimages->execute();
     if ($Qimages->numberOfRows() > 0) {
         $tmp = array();
         for ($i = 0; $i < $Qimages->numberOfRows(); $i++) {
             $tmp[] = $i;
         }
         $items = 'items: [' . implode(',', $tmp) . '],';
         $this->_content = '<div style="overflow: auto; height: 100%; margin: 0px auto;">' . "\n" . '<div id="slideWrapper">' . "\n" . '<div id="slideItems">' . "\n";
         $descriptions = array();
         while ($Qimages->next()) {
             $this->_content .= '<span><a href="' . $Qimages->value('image_url') . '">' . osc_image(DIR_WS_IMAGES . $Qimages->value('image'), $Qimages->value('description')) . '</a></span>' . "\n";
             $descriptions[] = '{description:\'' . $Qimages->value('description') . '\', link:\'' . $Qimages->value('image_url') . '\'}';
         }
         $info_div = '';
         $info_css = '';
         $info_js = '';
         $info_on_walk_js = '';
         if (MODULE_CONTENT_SLIDE_SHOW_DISPLAY_INFO == 'True') {
             $info_div = '<div id="slideInfo"></div>' . "\n";
             $info_css = '#slideInfo{bottom:0;}' . "\n" . '#slideInfo{width:' . MODULE_CONTENT_SLIDE_SHOW_WIDTH . 'px; height:40px; background:#000; position:absolute;}' . "\n" . '#slideInfo p{color:#fff;padding:3px 8px;font-family:Arial;font-size:13px;}' . "\n" . '#slideInfo a{float:right;background:#fff;color:#000;font-size:10px;margin:5px 5px;width:30px;text-decoration:none;text-align:center}' . "\n";
             $info_js = 'var slide_info = $(\'slideInfo\').set(\'opacity\',0.5);' . "\n" . 'var infoItems =[' . implode(",", $descriptions) . '];' . "\n";
             $items = 'items: infoItems,';
             $info_on_walk_js = ',
         onWalk: function(currentItem){
         slide_info.empty();
         new Element(\'a\', {href: currentItem.link}).appendText(\'link\').inject(slide_info);
         new Element(\'p\').set(\'html\',currentItem.description).inject(slide_info);
       }';
         }
         $this->_content .= '</div>' . "\n" . $info_div . '</div>
       </div>' . "\n";
         $css = '#slideWrapper{position:relative; width:' . MODULE_CONTENT_SLIDE_SHOW_WIDTH . 'px; height:' . MODULE_CONTENT_SLIDE_SHOW_HEIGHT . 'px; overflow:hidden;}' . chr(13) . '#slideItems{position:absolute;}' . chr(13) . '#slideItems span{display:block; float:left;}' . chr(13) . '#slideItems span img{display:block;border:none;}' . chr(13) . $info_css;
         $osC_Template->addStyleDeclaration($css);
         $osC_Template->addJavascriptFilename('ext/noobslide/noobslide.js');
         $size = MODULE_CONTENT_SLIDE_SHOW_MODE == 'horizontal' ? MODULE_CONTENT_SLIDE_SHOW_WIDTH : MODULE_CONTENT_SLIDE_SHOW_HEIGHT;
         $this->_content .= ' <script type="text/javascript">
         window.addEvent(\'domready\',function(){' . $info_js . '
             var slide_show = new noobSlide({
             mode: \'' . MODULE_CONTENT_SLIDE_SHOW_MODE . '\',' . $items . 'size: ' . $size . ',
             box: $(\'slideItems\'),
             interval: ' . MODULE_CONTENT_SLIDE_SHOW_INTERVAL . ',
             duration: ' . MODULE_CONTENT_SLIDE_SHOW_DURATION . ',' . 'autoPlay: true' . $info_on_walk_js . '});
     });' . '</script>';
     }
     $Qimages->freeResult();
 }
Пример #21
0
 function initialize()
 {
     global $osC_Database, $osC_Services, $osC_Cache, $osC_Language, $osC_Product, $osC_Image;
     $this->_title_link = osc_href_link(FILENAME_PRODUCTS, 'reviews');
     if ($osC_Services->isStarted('reviews')) {
         if (BOX_REVIEWS_CACHE > 0 && $osC_Cache->read('box-reviews' . (isset($osC_Product) && is_a($osC_Product, 'osC_Product') && $osC_Product->isValid() ? '-' . $osC_Product->getID() : '') . '-' . $osC_Language->getCode(), BOX_REVIEWS_CACHE)) {
             $data = $osC_Cache->getCache();
         } else {
             $data = array();
             $Qreview = $osC_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', $osC_Language->getID());
             $Qreview->bindInt(':language_id', $osC_Language->getID());
             if (isset($osC_Product) && is_a($osC_Product, 'osC_Product') && $osC_Product->isValid()) {
                 $Qreview->appendQuery('and p.products_id = :products_id');
                 $Qreview->bindInt(':products_id', $osC_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 = $osC_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', $osC_Language->getID());
                 $Qtext->execute();
                 $data = array_merge($Qreview->toArray(), $Qtext->toArray());
                 $Qtext->freeResult();
                 $Qreview->freeResult();
             }
             $osC_Cache->write($data);
         }
         $this->_content = '';
         if (empty($data)) {
             if (isset($osC_Product) && is_a($osC_Product, 'osC_Product') && $osC_Product->isValid()) {
                 $this->_content = '<div style="float: left; width: 55px;">' . osc_link_object(osc_href_link(FILENAME_PRODUCTS, 'reviews=new&' . $osC_Product->getKeyword()), osc_image(DIR_WS_IMAGES . 'box_write_review.gif', $osC_Language->get('button_write_review'))) . '</div>' . osc_link_object(osc_href_link(FILENAME_PRODUCTS, 'reviews=new&' . $osC_Product->getKeyword()), $osC_Language->get('box_reviews_write')) . '<div style="clear: both;"></div>';
             }
         } else {
             if (!empty($data['image'])) {
                 $this->_content = '<div align="center">' . osc_link_object(osc_href_link(FILENAME_PRODUCTS, 'reviews=' . $data['reviews_id'] . '&' . $data['products_keyword']), $osC_Image->show($data['image'], $data['products_name'])) . '</div>';
             }
             $this->_content .= osc_link_object(osc_href_link(FILENAME_PRODUCTS, 'reviews=' . $data['reviews_id'] . '&' . $data['products_keyword']), wordwrap(osc_output_string_protected($data['reviews_text']), 15, '&shy;') . ' ..') . '<br /><div align="center">' . osc_image(DIR_WS_IMAGES . 'stars_' . $data['reviews_rating'] . '.png', sprintf($osC_Language->get('box_reviews_stars_rating'), $data['reviews_rating'])) . '</div>';
         }
     }
 }
Пример #22
0
 function renderData()
 {
     global $toC_Json, $osC_Database, $osC_Language;
     $Qreviews = $osC_Database->query('select r.reviews_id, r.products_id, greatest(r.date_added, ifnull(r.last_modified, 0)) 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();
     $records = array();
     while ($Qreviews->next()) {
         $records[] = array('reviews_id' => $Qreviews->valueInt('reviews_id'), 'products_name' => $Qreviews->value('products_name'), 'languages_code' => $osC_Language->showImage($Qreviews->value('languages_code')), 'reviews_rating' => osc_image('../images/stars_' . $Qreviews->valueInt('reviews_rating') . '.png', $Qreviews->valueInt('reviews_rating') . '/5'), 'date_last_modified' => osC_DateTime::getShort($Qreviews->value('date_last_modified')));
     }
     $response = array(EXT_JSON_READER_TOTAL => sizeof($records), EXT_JSON_READER_ROOT => $records);
     echo $toC_Json->encode($response);
 }
Пример #23
0
 function _setData()
 {
     global $osC_Database, $osC_Language;
     $this->_data = '<table border="0" width="100%" cellspacing="0" cellpadding="2" class="dataTable">' . '  <thead>' . '    <tr>' . '      <th>' . $osC_Language->get('summary_reviews_table_heading_products') . '</th>' . '      <th>' . $osC_Language->get('summary_reviews_table_heading_language') . '</th>' . '      <th>' . $osC_Language->get('summary_reviews_table_heading_rating') . '</th>' . '      <th>' . $osC_Language->get('summary_reviews_table_heading_date') . '</th>' . '    </tr>' . '  </thead>' . '  <tbody>';
     $Qreviews = $osC_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 .= '    <tr onmouseover="rowOverEffect(this);" onmouseout="rowOutEffect(this);">' . '      <td>' . osc_link_object(osc_href_link_admin(FILENAME_DEFAULT, 'reviews&rID=' . $Qreviews->valueInt('reviews_id') . '&action=save'), osc_icon('reviews.png') . '&nbsp;' . $Qreviews->value('products_name')) . '</td>' . '      <td align="center">' . $osC_Language->showImage($Qreviews->value('languages_code')) . '</td>' . '      <td align="center">' . osc_image('../images/stars_' . $Qreviews->valueInt('reviews_rating') . '.png', $Qreviews->valueInt('reviews_rating') . '/5') . '</td>' . '      <td>' . $Qreviews->value('date_last_modified') . '</td>' . '    </tr>';
     }
     $this->_data .= '  </tbody>' . '</table>';
     $Qreviews->freeResult();
 }
Пример #24
0
 public function quote()
 {
     global $osC_ShoppingCart;
     $number_of_items = 0;
     foreach ($osC_ShoppingCart->getProducts() as $product) {
         $osC_Product = new osC_Product($product['id']);
         if ($osC_Product->isTypeActionAllowed('apply_shipping_fees')) {
             $number_of_items += $product['quantity'];
         }
     }
     $this->quotes = array('id' => $this->_code, 'module' => $this->_title, 'methods' => array(array('id' => $this->_code, 'title' => __('shipping_item_method'), 'cost' => MODULE_SHIPPING_ITEM_COST * $number_of_items + MODULE_SHIPPING_ITEM_HANDLING)), 'tax_class_id' => $this->tax_class);
     if (!empty($this->icon)) {
         $this->quotes['icon'] = osc_image($this->icon, $this->_title);
     }
     return $this->quotes;
 }
Пример #25
0
 public function initialize()
 {
     $OSCOM_Service = Registry::get('Service');
     $OSCOM_Cache = Registry::get('Cache');
     $OSCOM_Product = Registry::exists('Product') ? Registry::get('Product') : null;
     $OSCOM_Language = Registry::get('Language');
     $OSCOM_Database = Registry::get('Database');
     $OSCOM_Image = Registry::get('Image');
     $this->_title_link = OSCOM::getLink(null, 'Products', 'Reviews');
     if ($OSCOM_Service->isStarted('Reviews')) {
         if (BOX_REVIEWS_CACHE > 0 && $OSCOM_Cache->read('box-reviews' . (isset($OSCOM_Product) && $OSCOM_Product instanceof \osCommerce\OM\Site\Shop\Product && $OSCOM_Product->isValid() ? '-' . $OSCOM_Product->getID() : '') . '-' . $OSCOM_Language->getCode(), BOX_REVIEWS_CACHE)) {
             $data = $OSCOM_Cache->getCache();
         } else {
             $data = array();
             $Qreview = $OSCOM_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->bindInt(':default_flag', 1);
             $Qreview->bindInt(':language_id', $OSCOM_Language->getID());
             $Qreview->bindInt(':language_id', $OSCOM_Language->getID());
             if (isset($OSCOM_Product) && $OSCOM_Product instanceof \osCommerce\OM\Site\Shop\Product && $OSCOM_Product->isValid()) {
                 $Qreview->appendQuery('and p.products_id = :products_id');
                 $Qreview->bindInt(':products_id', $OSCOM_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 = $OSCOM_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->bindInt(':reviews_id', $Qreview->valueInt('reviews_id'));
                 $Qtext->bindInt(':languages_id', $OSCOM_Language->getID());
                 $Qtext->execute();
                 $data = array_merge($Qreview->toArray(), $Qtext->toArray());
             }
             $OSCOM_Cache->write($data);
         }
         $this->_content = '';
         if (empty($data)) {
             if (isset($OSCOM_Product) && $OSCOM_Product instanceof \osCommerce\OM\Site\Shop\Product && $OSCOM_Product->isValid()) {
                 $this->_content = '<div style="float: left; width: 55px;">' . osc_link_object(OSCOM::getLink(null, 'Products', 'Reviews&Write&' . $OSCOM_Product->getKeyword()), osc_image(DIR_WS_IMAGES . 'box_write_review.gif', OSCOM::getDef('button_write_review'))) . '</div>' . osc_link_object(OSCOM::getLink(null, 'Products', 'Reviews&Write&' . $OSCOM_Product->getKeyword()), OSCOM::getDef('box_reviews_write')) . '<div style="clear: both;"></div>';
             }
         } else {
             if (!empty($data['image'])) {
                 $this->_content = '<div align="center">' . osc_link_object(OSCOM::getLink(null, 'Products', 'Reviews&View=' . $data['reviews_id'] . '&' . $data['products_keyword']), $OSCOM_Image->show($data['image'], $data['products_name'])) . '</div>';
             }
             $this->_content .= osc_link_object(OSCOM::getLink(null, 'Products', 'Reviews&View=' . $data['reviews_id'] . '&' . $data['products_keyword']), wordwrap(osc_output_string_protected($data['reviews_text']), 15, '&shy;') . ' ..') . '<br /><div align="center">' . osc_image(DIR_WS_IMAGES . 'stars_' . $data['reviews_rating'] . '.png', sprintf(OSCOM::getDef('box_reviews_stars_rating'), $data['reviews_rating'])) . '</div>';
         }
     }
 }
Пример #26
0
 public function __construct()
 {
     Registry::get('Language')->loadIniFile('modules/Dashboard/Reviews.php');
     $this->_title = OSCOM::getDef('admin_indexmodules_reviews_title');
     $this->_title_link = OSCOM::getLink(null, 'Reviews');
     if (Access::hasAccess(OSCOM::getSite(), 'Reviews')) {
         $this->_data = '<table border="0" width="100%" cellspacing="0" cellpadding="2" class="dataTable">' . '  <thead>' . '    <tr>' . '      <th>' . OSCOM::getDef('admin_indexmodules_reviews_table_heading_products') . '</th>' . '      <th>' . OSCOM::getDef('admin_indexmodules_reviews_table_heading_language') . '</th>' . '      <th>' . OSCOM::getDef('admin_indexmodules_reviews_table_heading_rating') . '</th>' . '      <th>' . OSCOM::getDef('admin_indexmodules_reviews_table_heading_date') . '</th>' . '    </tr>' . '  </thead>' . '  <tbody>';
         $Qreviews = Registry::get('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->execute();
         $counter = 0;
         while ($Qreviews->next()) {
             $this->_data .= '    <tr onmouseover="$(this).addClass(\'mouseOver\');" onmouseout="$(this).removeClass(\'mouseOver\');"' . ($counter % 2 ? ' class="alt"' : '') . '>' . '      <td>' . osc_link_object(OSCOM::getLink(null, 'Reviews', 'rID=' . $Qreviews->valueInt('reviews_id') . '&action=save'), osc_icon('reviews.png') . '&nbsp;' . $Qreviews->value('products_name')) . '</td>' . '      <td align="center">' . Registry::get('Language')->showImage($Qreviews->value('languages_code')) . '</td>' . '      <td align="center">' . osc_image('../images/stars_' . $Qreviews->valueInt('reviews_rating') . '.png', $Qreviews->valueInt('reviews_rating') . '/5') . '</td>' . '      <td>' . $Qreviews->value('date_last_modified') . '</td>' . '    </tr>';
             $counter++;
         }
         $this->_data .= '  </tbody>' . '</table>';
     }
 }
Пример #27
0
 function quote()
 {
     global $osC_Language, $osC_ShoppingCart, $osC_Weight;
     $dest_country = $osC_ShoppingCart->getShippingAddress('country_iso_code_2');
     $dest_zone = 0;
     $error = false;
     $shipping_weight = $osC_Weight->convert($osC_ShoppingCart->getWeight(), SHIPPING_WEIGHT_UNIT, MODULE_SHIPPING_ZONES_WEIGHT_UNIT);
     for ($i = 1; $i <= $this->num_zones; $i++) {
         $countries_table = constant('MODULE_SHIPPING_ZONES_COUNTRIES_' . $i);
         $country_zones = split("[,]", $countries_table);
         if (in_array($dest_country, $country_zones)) {
             $dest_zone = $i;
             break;
         }
     }
     if ($dest_zone == 0) {
         $error = true;
     } else {
         $shipping = -1;
         $zones_cost = constant('MODULE_SHIPPING_ZONES_COST_' . $dest_zone);
         $zones_table = split("[:,]", $zones_cost);
         $size = sizeof($zones_table);
         for ($i = 0; $i < $size; $i += 2) {
             if ($shipping_weight <= $zones_table[$i]) {
                 $shipping = $zones_table[$i + 1];
                 $shipping_method = $osC_Language->get('shipping_zones_method') . ' ' . $dest_country . ' : ' . $osC_Weight->display($osC_ShoppingCart->getWeight(), SHIPPING_WEIGHT_UNIT);
                 break;
             }
         }
         if ($shipping == -1) {
             $shipping_cost = 0;
             $shipping_method = $osC_Language->get('shipping_zones_undefined_rate');
         } else {
             $shipping_cost = $shipping * $osC_ShoppingCart->numberOfShippingBoxes() + constant('MODULE_SHIPPING_ZONES_HANDLING_' . $dest_zone);
         }
     }
     $this->quotes = array('id' => $this->_code, 'module' => $this->_title, 'methods' => array(array('id' => $this->_code, 'title' => $shipping_method, 'cost' => $shipping_cost)), 'tax_class_id' => $this->tax_class);
     if (!empty($this->icon)) {
         $this->quotes['icon'] = osc_image($this->icon, $this->_title);
     }
     if ($error == true) {
         $this->quotes['error'] = $osC_Language->get('shipping_zones_invalid_zone');
     }
     return $this->quotes;
 }
Пример #28
0
 function listReviews()
 {
     global $toC_Json, $osC_Language, $osC_Database;
     $start = empty($_REQUEST['start']) ? 0 : $_REQUEST['start'];
     $limit = empty($_REQUEST['limit']) ? MAX_DISPLAY_SEARCH_RESULTS : $_REQUEST['limit'];
     $Qreviews = $osC_Database->query('select r.reviews_id, r.products_id, r.date_added, r.last_modified, r.reviews_rating, r.reviews_status, pd.products_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 r.date_added desc');
     $Qreviews->bindTable(':table_reviews', TABLE_REVIEWS);
     $Qreviews->bindTable(':table_products_description', TABLE_PRODUCTS_DESCRIPTION);
     $Qreviews->bindTable(':table_languages', TABLE_LANGUAGES);
     $Qreviews->setExtBatchLimit($start, $limit);
     $Qreviews->execute();
     $record = array();
     while ($Qreviews->next()) {
         $record[] = array('reviews_id' => $Qreviews->value('reviews_id'), 'date_added' => osC_DateTime::getShort($Qreviews->value('date_added')), 'reviews_rating' => osc_image('../images/stars_' . $Qreviews->valueInt('reviews_rating') . '.png', sprintf($osC_Language->get('rating_from_5_stars'), $Qreviews->valueInt('reviews_rating'))), 'products_name' => $Qreviews->value('products_name'), 'reviews_status' => $Qreviews->valueInt('reviews_status'), 'code' => $osC_Language->showImage($Qreviews->value('languages_code')));
     }
     $response = array(EXT_JSON_READER_TOTAL => $Qreviews->getBatchSize(), EXT_JSON_READER_ROOT => $record);
     echo $toC_Json->encode($response);
 }
Пример #29
0
 public function show($image, $title, $parameters = null, $group = null)
 {
     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 = 'pixel_trans.gif';
     } else {
         $image = 'products/' . $this->_groups[$group_id]['code'] . '/' . $image;
     }
     return osc_image(DIR_WS_IMAGES . $image, $title, $width, $height, $parameters);
 }
Пример #30
0
 function show($image, $title, $parameters = '', $group = '', $type = 'products')
 {
     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 = $type . '/' . $this->_groups[$group_id]['code'] . '/' . $image;
     }
     if ($type == 'products') {
         $parameters .= 'class="productImage"';
     }
     return osc_image(DIR_WS_IMAGES . $image, $title, $width, $height, $parameters);
 }