示例#1
0
 protected function _process()
 {
     global $lC_Language, $lC_MessageStack, $lC_Product;
     if (empty($_POST['from_name'])) {
         $lC_MessageStack->add('tell_a_friend', $lC_Language->get('error_tell_a_friend_customers_name_empty'));
     }
     if (!lc_validate_email_address($_POST['from_email_address'])) {
         $lC_MessageStack->add('tell_a_friend', $lC_Language->get('error_tell_a_friend_invalid_customers_email_address'));
     }
     if (empty($_POST['to_name'])) {
         $lC_MessageStack->add('tell_a_friend', $lC_Language->get('error_tell_a_friend_friends_name_empty'));
     }
     if (!lc_validate_email_address($_POST['to_email_address'])) {
         $lC_MessageStack->add('tell_a_friend', $lC_Language->get('error_tell_a_friend_invalid_friends_email_address'));
     }
     if ($lC_MessageStack->size('tell_a_friend') < 1) {
         $email_subject = sprintf($lC_Language->get('email_tell_a_friend_subject'), lc_sanitize_string($_POST['from_name']), STORE_NAME);
         $email_body = sprintf($lC_Language->get('email_tell_a_friend_intro'), lc_sanitize_string($_POST['to_name']), lc_sanitize_string($_POST['from_name']), $lC_Product->getTitle(), STORE_NAME) . "\n\n";
         if (!empty($_POST['message'])) {
             $email_body .= lc_sanitize_string($_POST['message']) . "\n\n";
         }
         $email_body .= sprintf($lC_Language->get('email_tell_a_friend_link'), lc_href_link(HTTP_SERVER . DIR_WS_CATALOG . FILENAME_PRODUCTS, $lC_Product->getKeyword(), 'NONSSL', false)) . "\n\n" . sprintf($lC_Language->get('email_tell_a_friend_signature'), STORE_NAME . "\n" . HTTP_SERVER . DIR_WS_CATALOG . "\n");
         lc_email(lc_sanitize_string($_POST['to_name']), lc_sanitize_string($_POST['to_email_address']), $email_subject, $email_body, lc_sanitize_string($_POST['from_name']), lc_sanitize_string($_POST['from_email_address']));
         lc_redirect(lc_href_link(FILENAME_PRODUCTS, 'tell_a_friend&' . $lC_Product->getID() . '&success=' . urlencode(sprintf($lC_Language->get('success_tell_a_friend_email_sent'), $lC_Product->getTitle(), lc_output_string_protected($_POST['to_name'])))));
     }
 }
示例#2
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>';
         }
     }
 }
示例#3
0
 /**
  * Correctly format an address to the address format rule assigned to its country
  *
  * @param array $address An array (or address_book ID) containing the address information
  * @param string $new_line The string to break new lines with
  * @access public
  * @return string
  */
 public static function format($address, $new_line = null)
 {
     global $lC_Database;
     $address_format = '';
     if (is_numeric($address)) {
         $Qaddress = $lC_Database->query('select ab.entry_firstname as firstname, ab.entry_lastname as lastname, ab.entry_company as company, ab.entry_street_address as street_address, ab.entry_suburb as suburb, ab.entry_city as city, ab.entry_postcode as postcode, ab.entry_state as state, ab.entry_zone_id as zone_id, ab.entry_country_id as country_id, z.zone_code as zone_code, c.countries_name as country_title from :table_address_book ab left join :table_zones z on (ab.entry_zone_id = z.zone_id), :table_countries c where ab.address_book_id = :address_book_id and ab.entry_country_id = c.countries_id');
         $Qaddress->bindTable(':table_address_book', TABLE_ADDRESS_BOOK);
         $Qaddress->bindTable(':table_zones', TABLE_ZONES);
         $Qaddress->bindTable(':table_countries', TABLE_COUNTRIES);
         $Qaddress->bindInt(':address_book_id', $address);
         $Qaddress->execute();
         $address = $Qaddress->toArray();
     }
     $firstname = $lastname = '';
     if (isset($address['firstname']) && !empty($address['firstname'])) {
         $firstname = $address['firstname'];
         $lastname = $address['lastname'];
     } elseif (isset($address['name']) && !empty($address['name'])) {
         $firstname = $address['name'];
     }
     $state = $address['state'];
     $state_code = $address['zone_code'];
     if (isset($address['zone_id']) && is_numeric($address['zone_id']) && $address['zone_id'] > 0) {
         $state = lC_Address::getZoneName($address['zone_id']);
         $state_code = lC_Address::getZoneCode($address['zone_id']);
     }
     $country = $address['country_title'];
     if (empty($country) && isset($address['country_id']) && is_numeric($address['country_id']) && $address['country_id'] > 0) {
         $country = lC_Address::getCountryName($address['country_id']);
     }
     if (isset($address['format']) && strlen($address['format']) > 4) {
         $address_format = $address['format'];
     } elseif (isset($address['country_id']) && is_numeric($address['country_id']) && $address['country_id'] > 0) {
         $address_format = lC_Address::getFormat($address['country_id']);
     }
     if (empty($address_format)) {
         $address_format = ":name\n:street_address\n:postcode :city\n:country";
     }
     $find_array = array('/\\:name\\b/', '/\\:street_address\\b/', '/\\:suburb\\b/', '/\\:city\\b/', '/\\:postcode\\b/', '/\\:state\\b/', '/\\:state_code\\b/', '/\\:country\\b/');
     $replace_array = array(lc_output_string_protected($firstname . ' ' . $lastname), lc_output_string_protected($address['street_address']), lc_output_string_protected($address['suburb']), lc_output_string_protected($address['city']), lc_output_string_protected($address['postcode']), lc_output_string_protected($state), lc_output_string_protected($state_code), lc_output_string_protected($country));
     $formated = preg_replace($find_array, $replace_array, $address_format);
     if (ACCOUNT_COMPANY > -1 && !empty($address['company'])) {
         $formated = lc_output_string_protected($address['company']) . "\n" . $formated;
     }
     if (!empty($new_line)) {
         $formated = str_replace("\n", $new_line, $formated);
     }
     return $formated;
 }
示例#4
0
 public function showConfirmation()
 {
     global $lC_Database, $lC_Language, $lC_Template;
     if (isset($_GET['customer']) && !empty($_GET['customer'])) {
         $Qcustomers = $lC_Database->query('select count(customers_id) as total from :table_customers c left join :table_newsletters_log nl on (c.customers_email_address = nl.email_address and nl.newsletters_id = :newsletters_id) where nl.email_address is null');
         $Qcustomers->bindTable(':table_customers', TABLE_CUSTOMERS);
         $Qcustomers->bindTable(':table_newsletters_log', TABLE_NEWSLETTERS_LOG);
         $Qcustomers->bindInt(':newsletters_id', $this->_newsletter_id);
         if (is_numeric($_GET['customer'])) {
             $Qcustomers->appendQuery('and c.customers_id = :customers_id');
             $Qcustomers->bindInt(':customers_id', $_GET['customer']);
         }
         $Qcustomers->execute();
         $this->_audience_size += $Qcustomers->valueInt('total');
     }
     $confirmation_string = '<p><font color="#ff0000"><b>' . sprintf($lC_Language->get('newsletter_email_total_recipients'), $this->_audience_size) . '</b></font></p>' . '<p><b>' . $this->_newsletter_title . '</b></p>' . '<p>' . nl2br(lc_output_string_protected($this->_newsletter_content)) . '</p>' . '<form name="confirm" action="' . lc_href_link_admin(FILENAME_DEFAULT, $lC_Template->getModule() . '&page=' . $_GET['page'] . '&nID=' . $this->_newsletter_id . '&action=send') . '" method="post">' . '<input type="hidden" name="audienceSize" id="audienceSize" value="' . $this->_audience_size . '"></form>';
     return $confirmation_string;
 }
示例#5
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 clear-both">' . '  <h2 class="relative thin">' . $this->_title . '</h2>' . '  <ul class="list spaced">';
         $counter = 0;
         foreach (lc_toObjectInfo(lC_ErrorLog_Admin::getAll())->get('entries') as $log) {
             $counter++;
             $this->_data .= '    <li>' . '      <span class="list-link icon-warning icon-red" title="' . $lC_Language->get('orders') . '">' . '        <strong>' . lc_output_string_protected($log['date']) . '</strong> ' . lc_output_string_protected(substr($log['message'], 0, 20)) . '      </span>' . '    </li>';
             if ($counter == 6) {
                 break;
             }
         }
         $this->_data .= '  </ul>' . '</div>';
     }
 }
示例#6
0
 protected function _setData()
 {
     global $lC_Database, $lC_Language, $lC_Currencies, $lC_Vqmod;
     if (!$this->enabled) {
         $this->_data = '';
     } else {
         $this->_data = '<div class="four-columns six-columns-tablet twelve-columns-mobile clear-both">' . '  <h2 class="relative thin">' . $this->_title . '</h2>' . '  <ul class="list spaced">';
         if (!isset($lC_Currencies)) {
             if (!class_exists('lC_Currencies')) {
                 include $lC_Vqmod->modCheck('../includes/classes/currencies.php');
             }
             $lC_Currencies = new lC_Currencies();
         }
         $Qproducts = $lC_Database->query('select p.products_id, greatest(p.products_date_added, p.products_last_modified) as date_last_modified, pd.products_name from :table_products p, :table_products_description pd where parent_id = 0 and p.products_id = pd.products_id and pd.language_id = :language_id order by date_last_modified desc limit 6');
         $Qproducts->bindTable(':table_products', TABLE_PRODUCTS);
         $Qproducts->bindTable(':table_products_description', TABLE_PRODUCTS_DESCRIPTION);
         $Qproducts->bindInt(':language_id', $lC_Language->getID());
         $Qproducts->execute();
         while ($Qproducts->next()) {
             $data = lC_Products_Admin::get($Qproducts->valueInt('products_id'));
             $products_icon = lc_icon_admin('products.png');
             $products_price = $data['products_price'];
             if (!empty($data['variants'])) {
                 $products_icon = lc_icon_admin('attach.png');
                 $products_price = null;
                 foreach ($data['variants'] as $variant) {
                     if ($products_price === null || $variant['data']['price'] < $products_price) {
                         $products_price = $variant['data']['price'];
                     }
                 }
                 if ($products_price === null) {
                     $products_price = 0;
                 }
             }
             $this->_data .= '    <li>' . '      <span class="list-link icon-bag icon-blue" title="' . $lC_Language->get('edit') . '">' . '        <strong>' . (!empty($data['variants']) ? $lC_Language->get('text_from') . ' ' : '') . $lC_Currencies->format($products_price) . '</strong> <span class="anthracite">' . lc_output_string_protected($data['products_name']) . '</span>' . '      </span>' . '      <div class="absolute-right compact show-on-parent-hover">' . '        <a href="' . ((int) ($_SESSION['admin']['access']['products'] < 3) ? '#' : lc_href_link_admin(FILENAME_DEFAULT, 'products=' . $Qproducts->valueInt('products_id') . '&cID=' . $category_id . '&action=save')) . '" class="button icon-pencil' . ((int) ($_SESSION['admin']['access']['products'] < 3) ? ' disabled' : NULL) . '">' . $lC_Language->get('icon_edit') . '</a>' . '        <a href="' . ((int) ($_SESSION['admin']['access']['products'] < 3) ? '#' : 'javascript://" onclick="copyProduct(\'' . $Qproducts->valueInt('products_id') . '\', \'' . urlencode($Qproducts->value('products_name')) . '\')') . '" class="button icon-pages with-tooltip' . ((int) ($_SESSION['admin']['access']['products'] < 3) ? ' disabled' : NULL) . '" title="' . $lC_Language->get('icon_copy') . '"></a>' . '        <a href="' . ((int) ($_SESSION['admin']['access']['products'] < 4) ? '#' : 'javascript://" onclick="deleteProduct(\'' . $Qproducts->valueInt('products_id') . '\', \'' . urlencode($Qproducts->value('products_name')) . '\')') . '" class="button icon-trash with-tooltip' . ((int) ($_SESSION['admin']['access']['products'] < 4) ? ' disabled' : NULL) . '" title="' . $lC_Language->get('icon_delete') . '"></a>' . '      </div>' . '    </li>';
         }
         $this->_data .= '  </ul>' . '</div>';
         $Qproducts->freeResult();
         $this->_data .= $this->loadModal();
     }
 }
示例#7
0
 public function showConfirmation()
 {
     global $lC_Database, $lC_Language, $lC_Template;
     $Qrecipients = $lC_Database->query('select count(*) as total from :table_customers c left join :table_newsletters_log nl on (c.customers_email_address = nl.email_address and nl.newsletters_id = :newsletters_id) where c.customers_newsletter = 1 and nl.email_address is null');
     $Qrecipients->bindTable(':table_customers', TABLE_CUSTOMERS);
     $Qrecipients->bindTable(':table_newsletters_log', TABLE_NEWSLETTERS_LOG);
     $Qrecipients->bindInt(':newsletters_id', $this->_newsletter_id);
     $Qrecipients->execute();
     $this->_audience_size = $Qrecipients->valueInt('total');
     $confirmation_string = '<p><font color="#ff0000"><b>' . sprintf($lC_Language->get('newsletter_newsletter_total_recipients'), $this->_audience_size) . '</b></font></p>' . '<p><b>' . $this->_newsletter_title . '</b></p>' . '<p>' . nl2br(lc_output_string_protected($this->_newsletter_content)) . '</p>' . '<form name="executeNewsletter" id="executeNewsletter" action="#" method="post"><input type="hidden" name="audienceSize" id="audienceSize" value="' . $this->_audience_size . '">';
     //                             '<p align="right">';
     /*
     if ($this->_audience_size > 0) {
       $confirmation_string .= lc_draw_hidden_field('subaction', 'execute') .
                               '<input type="submit" value="' . $lC_Language->get('button_send') . '" class="operationButton" />&nbsp;' .
                               '<input type="button" value="' . $lC_Language->get('button_cancel') . '" onclick="document.location.href=\'' . lc_href_link_admin(FILENAME_DEFAULT, $lC_Template->getModule() . '&page=' . $_GET['page']) . '\'" class="operationButton" />';
     } else {
       $confirmation_string .= '<input type="button" value="' . $lC_Language->get('button_back') . '" onclick="document.location.href=\'' . lc_href_link_admin(FILENAME_DEFAULT, $lC_Template->getModule() . '&page=' . $_GET['page']) . '\'" class="operationButton" />';
     }
     */
     $confirmation_string .= '</form>';
     return $confirmation_string;
 }
示例#8
0
 /**
  * Returns the title of the page
  *
  * @access public
  * @return string
  */
 public function getPageTitle()
 {
     return lc_output_string_protected($this->_page_title);
 }
        }
        ?>
          <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 
        echo $Qhistory->value('orders_status_name');
        ?>
</td> 
            <td><?php 
        echo lC_Order::numberOfProducts($Qhistory->valueInt('orders_id'));
        ?>
</td>
            <td><?php 
示例#10
0
 public function valueMixed($column, $type = 'string')
 {
     if (!isset($this->result)) {
         $this->next();
     }
     switch ($type) {
         case 'protected':
             return lc_output_string_protected($this->result[$column]);
             break;
         case 'int':
             return (int) $this->result[$column];
             break;
         case 'decimal':
             return (double) $this->result[$column];
             break;
         case 'string':
         default:
             return $this->result[$column];
     }
 }
示例#11
0
 function lc_draw_textarea_field($name, $value = null, $width = 60, $height = 5, $parameters = null, $override = true)
 {
     if (!is_bool($override)) {
         $override = true;
     }
     if ($override === true) {
         if (isset($_GET[$name])) {
             $value = $_GET[$name];
         } elseif (isset($_POST[$name])) {
             $value = $_POST[$name];
         }
     }
     if (!is_numeric($width)) {
         $width = 60;
     }
     if (!is_numeric($height)) {
         $width = 5;
     }
     $field = '<textarea name="' . lc_output_string($name) . '" cols="' . (int) $width . '" rows="' . (int) $height . '"';
     if (strpos($parameters, 'id=') === false) {
         $field .= ' id="' . lc_output_string($name) . '"';
     }
     if (!empty($parameters)) {
         $field .= ' ' . $parameters;
     }
     $field .= '>' . lc_output_string_protected($value) . '</textarea>';
     return $field;
 }
示例#12
0
    content: '<div id="uploadConfirm">'+
             '  <form name="fmUpload" id="fmUpload" action="<?php 
echo lc_href_link_admin(FILENAME_DEFAULT, $lC_Template->getModule() . '&action=upload');
?>
" method="post" enctype="multipart/form-data">'+
             '  <p><?php 
echo $lC_Language->get('introduction_upload_file');
?>
</p>'+
             '  <p><?php 
echo lc_draw_file_field('fmFile[]', true, 'id="fmFileUpload" class="file"');
?>
</p>'+
             '  </form>'+
             '  <p class="margin-top"><?php 
echo lc_output_string_protected($_SESSION['fm_directory']) . '/';
?>
</p>'+
             '</div>',
    title: '<?php 
echo $lC_Language->get('modal_heading_upload_file');
?>
',
    width: 350,
    actions: {
      'Close' : {
        color: 'red',
        click: function(win) { win.closeModal(); }
      }
    },
    buttons: {
示例#13
0
 public static function drawMenu()
 {
     foreach (lc_toObjectInfo(lC_Configuration_Admin::getAllGroups())->get('entries') as $group) {
         $menu .= '<li class="message-menu" id="cfgGroup' . (int) $group['configuration_group_id'] . '">' . '  <span class="message-status" style="padding-top:14px;">' . '     <a href="javascript:void(0);" onclick="showGroup(\'' . (int) $group['configuration_group_id'] . '\', \'' . lc_output_string_protected($group['configuration_group_title']) . '\');" class="new-message" title=""></a>' . '   </span>' . '   <a id="cfgLink' . (int) $group['configuration_group_id'] . '" href="javascript:void(0);" onclick="showGroup(\'' . (int) $group['configuration_group_id'] . '\', \'' . str_replace("/", "-", lc_output_string_protected($group['configuration_group_title'])) . '\');">' . '     <br><strong>' . lc_output_string_protected($group['configuration_group_title']) . '</strong>' . '   </a>' . ' </li>';
     }
     return $menu;
 }
 public function showConfirmation()
 {
     global $lC_Database, $lC_Language, $lC_Template;
     if (isset($_GET['chosen']) && !empty($_GET['chosen']) || isset($_GET['global']) && $_GET['global'] == 'true') {
         $Qcustomers = $lC_Database->query('select count(customers_id) as total from :table_customers where global_product_notifications = 1');
         $Qcustomers->bindTable(':table_customers', TABLE_CUSTOMERS);
         $Qcustomers->execute();
         $this->_audience_size = $Qcustomers->valueInt('total');
         $Qcustomers = $lC_Database->query('select count(distinct pn.customers_id) as total from :table_products_notifications pn, :table_customers c left join :table_newsletters_log nl on (c.customers_email_address = nl.email_address and nl.newsletters_id = :newsletters_id) where pn.customers_id = c.customers_id and nl.email_address is null');
         $Qcustomers->bindTable(':table_products_notifications', TABLE_PRODUCTS_NOTIFICATIONS);
         $Qcustomers->bindTable(':table_customers', TABLE_CUSTOMERS);
         $Qcustomers->bindTable(':table_newsletters_log', TABLE_NEWSLETTERS_LOG);
         $Qcustomers->bindInt(':newsletters_id', $this->_newsletter_id);
         if (isset($_GET['chosen']) && !empty($_GET['chosen'])) {
             $Qcustomers->appendQuery('and pn.products_id in (:products_id)');
             $Qcustomers->bindRaw(':products_id', implode(', ', $_GET['chosen']));
         }
         $Qcustomers->execute();
         $this->_audience_size += $Qcustomers->valueInt('total');
     }
     $confirmation_string = '<p><font color="#ff0000"><b>' . sprintf($lC_Language->get('newsletter_product_notifications_total_recipients'), $this->_audience_size) . '</b></font></p>' . '<p><b>' . $this->_newsletter_title . '</b></p>' . '<p>' . nl2br(lc_output_string_protected($this->_newsletter_content)) . '</p>' . '<form name="execute" id="name="execute"" action="#" method="post"><input type="hidden" name="audienceSize" id="audienceSize" value="' . $this->_audience_size . '">';
     if ($this->_audience_size > 0) {
         if (isset($_GET['global']) && $_GET['global'] == 'true') {
             $confirmation_string .= lc_draw_hidden_field('global', 'true');
         } elseif (isset($_GET['chosen']) && !empty($_GET['chosen'])) {
             for ($i = 0, $n = sizeof($_GET['chosen']); $i < $n; $i++) {
                 $confirmation_string .= lc_draw_hidden_field('chosen[]', $_GET['chosen'][$i]);
             }
         }
         $confirmation_string .= lc_draw_hidden_field('subaction', 'execute');
     }
     $confirmation_string .= '</form>';
     return $confirmation_string;
 }
示例#15
0
 function start()
 {
     global $lC_Customer, $lC_Database;
     if ($lC_Customer->isLoggedOn()) {
         $wo_customer_id = $lC_Customer->getID();
         $wo_full_name = $lC_Customer->getName();
     } else {
         $wo_customer_id = '';
         $wo_full_name = 'Guest';
         if (SERVICE_WHOS_ONLINE_SPIDER_DETECTION == '1') {
             $user_agent = strtolower($_SERVER['HTTP_USER_AGENT']);
             if (!empty($user_agent)) {
                 $spiders = file('includes/spiders.txt');
                 foreach ($spiders as $spider) {
                     if (!empty($spider)) {
                         if (strpos($user_agent, trim($spider)) !== false) {
                             $wo_full_name = $spider;
                             break;
                         }
                     }
                 }
             }
         }
     }
     $wo_session_id = session_id();
     $wo_ip_address = lc_get_ip_address();
     $wo_last_page_url = lc_output_string_protected(substr($_SERVER['REQUEST_URI'], 0, 255));
     $current_time = time();
     $xx_mins_ago = $current_time - 900;
     // remove entries that have expired
     $Qwhosonline = $lC_Database->query('delete from :table_whos_online where time_last_click < :time_last_click');
     $Qwhosonline->bindRaw(':table_whos_online', TABLE_WHOS_ONLINE);
     $Qwhosonline->bindValue(':time_last_click', $xx_mins_ago);
     $Qwhosonline->execute();
     $Qwhosonline = $lC_Database->query('select count(*) as count from :table_whos_online where session_id = :session_id');
     $Qwhosonline->bindRaw(':table_whos_online', TABLE_WHOS_ONLINE);
     $Qwhosonline->bindValue(':session_id', $wo_session_id);
     $Qwhosonline->execute();
     if ($Qwhosonline->valueInt('count') > 0) {
         $Qwhosonline = $lC_Database->query('update :table_whos_online set customer_id = :customer_id, full_name = :full_name, ip_address = :ip_address, time_last_click = :time_last_click, last_page_url = :last_page_url where session_id = :session_id');
         $Qwhosonline->bindRaw(':table_whos_online', TABLE_WHOS_ONLINE);
         $Qwhosonline->bindInt(':customer_id', $wo_customer_id);
         $Qwhosonline->bindValue(':full_name', $wo_full_name);
         $Qwhosonline->bindValue(':ip_address', $wo_ip_address);
         $Qwhosonline->bindValue(':time_last_click', $current_time);
         $Qwhosonline->bindValue(':last_page_url', $wo_last_page_url);
         $Qwhosonline->bindValue(':session_id', $wo_session_id);
         $Qwhosonline->execute();
     } else {
         $Qwhosonline = $lC_Database->query('insert into :table_whos_online (customer_id, full_name, session_id, ip_address, time_entry, time_last_click, last_page_url) values (:customer_id, :full_name, :session_id, :ip_address, :time_entry, :time_last_click, :last_page_url)');
         $Qwhosonline->bindRaw(':table_whos_online', TABLE_WHOS_ONLINE);
         $Qwhosonline->bindInt(':customer_id', $wo_customer_id);
         $Qwhosonline->bindValue(':full_name', $wo_full_name);
         $Qwhosonline->bindValue(':session_id', $wo_session_id);
         $Qwhosonline->bindValue(':ip_address', $wo_ip_address);
         $Qwhosonline->bindValue(':time_entry', $current_time);
         $Qwhosonline->bindValue(':time_last_click', $current_time);
         $Qwhosonline->bindValue(':last_page_url', $wo_last_page_url);
         $Qwhosonline->execute();
     }
     $Qwhosonline->freeResult();
     return true;
 }
示例#16
0
 public static function preview($id)
 {
     global $lC_Database, $lC_Language, $lC_Currencies;
     $lC_Image = new lC_Image_Admin();
     $lC_Language->loadIniFile('products.php');
     $result = array();
     $Qp = $lC_Database->query('select p.products_id, p.products_quantity, p.products_cost, p.products_price, p.products_msrp, p.products_model, p.products_sku, p.products_weight, p.products_weight_class, p.products_date_added, p.products_last_modified, p.products_status, p.products_tax_class_id, p.manufacturers_id, i.image from :table_products p left join :table_products_images i on (p.products_id = i.products_id and default_flag = :default_flag) where p.products_id = :products_id');
     $Qp->bindTable(':table_products', TABLE_PRODUCTS);
     $Qp->bindTable(':table_products_images', TABLE_PRODUCTS_IMAGES);
     $Qp->bindInt(':products_id', $id);
     $Qp->bindInt(':default_flag', 1);
     $Qp->execute();
     $Qpd = $lC_Database->query('select products_name, products_blurb, products_description, products_url, language_id from :table_products_description where products_id = :products_id');
     $Qpd->bindTable(':table_products_description', TABLE_PRODUCTS_DESCRIPTION);
     $Qpd->bindInt(':products_id', $id);
     $Qpd->execute();
     $pd_extra = array();
     while ($Qpd->next()) {
         $pd_extra['products_name'][$Qpd->valueInt('language_id')] = $Qpd->valueProtected('products_name');
         $pd_extra['products_blurb'][$Qpd->valueInt('language_id')] = $Qpd->valueProtected('products_blurb');
         $pd_extra['products_description'][$Qpd->valueInt('language_id')] = $Qpd->value('products_description');
         $pd_extra['products_url'][$Qpd->valueInt('language_id')] = $Qpd->valueProtected('products_url');
     }
     $lC_ObjectInfo = new lC_ObjectInfo(array_merge($Qp->toArray(), $pd_extra));
     $products_name = $lC_ObjectInfo->get('products_name');
     $products_blurb = $lC_ObjectInfo->get('products_blurb');
     $products_description = $lC_ObjectInfo->get('products_description');
     $products_url = $lC_ObjectInfo->get('products_url');
     $result['previewHtml'] = '<div>';
     foreach ($lC_Language->getAll() as $l) {
         $result['previewHtml'] .= '<span id="lang_' . $l['code'] . '"' . ($l['code'] == $lC_Language->getCode() ? ' class="highlight"' : '') . '><a href="javascript:toggleDivBlocks(\'pName_\', \'pName_' . $l['code'] . '\'); toggleClass(\'lang_\', \'lang_' . $l['code'] . '\', \'highlight\', \'span\');">' . $lC_Language->showImage($l['code']) . '</a></span>&nbsp;&nbsp;';
     }
     $result['previewHtml'] .= '</div>';
     foreach ($lC_Language->getAll() as $l) {
         $result['previewHtml'] .= '<div id="pName_' . $l['code'] . '" ' . ($l['code'] != $lC_Language->getCode() ? ' style="display: none;"' : '') . '>';
         $result['previewHtml'] .= '  <table border="0" width="100%" cellspacing="0" cellpadding="2">';
         $result['previewHtml'] .= '    <tr>';
         $result['previewHtml'] .= '      <td><h1>' . lc_output_string_protected($products_name[$l['id']]) . (!lc_empty($lC_ObjectInfo->get('products_model')) ? '<br /><span>' . $lC_ObjectInfo->getProtected('products_model') . '</span>' : '') . '</h1></td>';
         $result['previewHtml'] .= '      <td align="right"><h1>' . $lC_Currencies->format($lC_ObjectInfo->get('products_price')) . '</h1></td>';
         $result['previewHtml'] .= '    </tr>';
         $result['previewHtml'] .= '  </table>';
         $result['previewHtml'] .= '  <p>' . $lC_Image->show($lC_ObjectInfo->get('image'), $products_name[$l['id']], 'align="right" hspace="5" vspace="5"', 'product_info') . $products_description[$l['id']] . '</p>';
         if (!empty($products_url[$l['id']])) {
             $result['previewHtml'] .= '<p>' . sprintf($lC_Language->get('text_more_product_information'), lc_output_string_protected($products_url[$l['id']])) . '</p>';
         }
         $result['previewHtml'] .= '<p align="center">' . sprintf($lC_Language->get('text_product_date_added'), lC_DateTime::getLong($lC_ObjectInfo->get('products_date_added'))) . '</p>';
         $result['previewHtml'] .= '</div>';
     }
     return $result;
 }
示例#17
0
 public static function drawMenu()
 {
     foreach (self::getAllTypes() as $key => $type) {
         $menu .= '<li style="cursor:pointer;" class="message-menu store-menu-' . strtolower(str_replace(' ', '-', $type['text'])) . '" id="menuType' . str_replace(' ', '', ucwords($type['text'])) . '">' . '  <a href="javascript:void(0);" class="" id="menuLink' . (int) $type['id'] . '" onclick="showAddonType(\'' . lc_output_string_protected($type['text']) . '\');">' . '    <span class="message-status" style="padding-top:8px;"><img src="' . $type['icon'] . '" alt="' . $type['text'] . '"></span>' . '     <br><strong>' . lc_output_string_protected($type['text']) . '</strong>' . '   </a>' . ' </li>';
     }
     return $menu;
 }
示例#18
0
 public static function preview($id)
 {
     $result = array();
     $lC_ObjectInfo = new lC_ObjectInfo(lC_Newsletters_Admin::getData($id));
     $result['title'] = $lC_ObjectInfo->get('title');
     $result['content'] = nl2br(lc_output_string_protected($lC_ObjectInfo->get('content')));
     return $result;
 }
示例#19
0
 /**
  * Get the value of a key element in the array data set and protect the output value
  *
  * @param string $key The name of the array key
  * @access public
  */
 public function getProtected($key)
 {
     return lc_output_string_protected($this->_data[$key]);
 }
示例#20
0
      if (data.rpcStatus != 1) {
        $.modal.alert('<?php 
echo $lC_Language->get('ms_error_retrieving_data');
?>
');
        return false;
      }
      $.modal({
        content: '<div id="deleteZone">'+
                 '  <div id="deleteConfirm">'+
                 '    <p id="deleteConfirmMessage"><?php 
echo $lC_Language->get('introduction_delete_definition_group');
?>
'+
                 '      <p><?php 
echo '<b>' . lc_output_string_protected($_GET['group']) . '</b>';
?>
</p>'+
                 '      <p style="margin-left:22px;"><span id="languageEntries"></span></p>'+
                 '    </p>'+
                 '  </div>'+
                 '</div>',
        title: '<?php 
echo $lC_Language->get('modal_heading_delete_language_group');
?>
',
        width: 300,
            actions: {
          'Close' : {
            color: 'red',
            click: function(win) { win.closeModal(); }