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_PDO = Registry::get('PDO'); $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(); $sql_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'; if (isset($OSCOM_Product) && $OSCOM_Product instanceof \osCommerce\OM\Site\Shop\Product && $OSCOM_Product->isValid()) { $sql_query .= ' and p.products_id = :products_id'; } $sql_query .= ' order by r.reviews_id desc limit :max_random_select_reviews'; $Qreview = $OSCOM_PDO->prepare($sql_query); $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->bindInt(':products_id', $OSCOM_Product->getID()); } $Qreview->bindInt(':max_random_select_reviews', BOX_REVIEWS_RANDOM_SELECT); $Qreview->execute(); $result = $Qreview->fetchAll(); if (count($result) > 0) { $result = $result[rand(0, count($result) - 1)]; $Qtext = $OSCOM_PDO->prepare('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', $result['reviews_id']); $Qtext->bindInt(':languages_id', $OSCOM_Language->getID()); $Qtext->execute(); $data = array_merge($result, $Qtext->fetch()); } $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;">' . HTML::button(array('href' => OSCOM::getLink(null, 'Products', 'Reviews&Write&' . $OSCOM_Product->getKeyword()), 'icon' => 'pencil', 'title' => OSCOM::getDef('button_write_review'))) . '</div>' . HTML::link(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">' . HTML::link(OSCOM::getLink(null, 'Products', 'Reviews&View=' . $data['reviews_id'] . '&' . $data['products_keyword']), $OSCOM_Image->show($data['image'], $data['products_name'])) . '</div>'; } $this->_content .= HTML::link(OSCOM::getLink(null, 'Products', 'Reviews&View=' . $data['reviews_id'] . '&' . $data['products_keyword']), wordwrap(HTML::outputProtected($data['reviews_text']), 15, '­') . ' ..') . '<br /><div align="center">' . HTML::image(OSCOM::getPublicSiteLink('images/stars_' . $data['reviews_rating'] . '.png'), sprintf(OSCOM::getDef('box_reviews_stars_rating'), $data['reviews_rating'])) . '</div>'; } } }
/** * 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) { $OSCOM_PDO = Registry::get('PDO'); $address_format = ''; if (is_numeric($address)) { $Qaddress = $OSCOM_PDO->prepare('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->bindInt(':address_book_id', $address); $Qaddress->execute(); $address = $Qaddress->fetch(); } $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 = self::getZoneName($address['zone_id']); $state_code = self::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 = self::getCountryName($address['country_id']); } if (isset($address['format'])) { $address_format = $address['format']; } elseif (isset($address['country_id']) && is_numeric($address['country_id']) && $address['country_id'] > 0) { $address_format = self::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(HTML::outputProtected($firstname . ' ' . $lastname), HTML::outputProtected($address['street_address']), HTML::outputProtected($address['suburb']), HTML::outputProtected($address['city']), HTML::outputProtected($address['postcode']), HTML::outputProtected($state), HTML::outputProtected($state_code), HTML::outputProtected($country)); $formated = preg_replace($find_array, $replace_array, $address_format); if (ACCOUNT_COMPANY > -1 && !empty($address['company'])) { $formated = HTML::outputProtected($address['company']) . "\n" . $formated; } if (!empty($new_line)) { $formated = str_replace("\n", $new_line, $formated); } return $formated; }
function initialize() { $OSCOM_Service = Registry::get('Service'); $OSCOM_RecentlyVisited = Registry::get('RecentlyVisited'); $OSCOM_Image = Registry::get('Image'); if ($OSCOM_Service->isStarted('RecentlyVisited') && $OSCOM_RecentlyVisited->hasHistory()) { $this->_content = '<table border="0" width="100%" cellspacing="0" cellpadding="2">' . ' <tr>'; if ($OSCOM_RecentlyVisited->hasProducts()) { $this->_content .= ' <td valign="top">' . ' <h6>' . OSCOM::getDef('recently_visited_products_title') . '</h6>' . ' <ol style="list-style: none; margin: 0; padding: 0;">'; foreach ($OSCOM_RecentlyVisited->getProducts() as $product) { $this->_content .= '<li style="padding-bottom: 15px;">'; if (SERVICE_RECENTLY_VISITED_SHOW_PRODUCT_IMAGES == '1') { $this->_content .= '<span style="float: left; width: ' . ($OSCOM_Image->getWidth('mini') + 10) . 'px; text-align: center;">' . HTML::link(OSCOM::getLink(null, 'Products', $product['keyword']), $OSCOM_Image->show($product['image'], $product['name'], null, 'mini')) . '</span>'; } $this->_content .= '<div style="float: left;">' . HTML::link(OSCOM::getLink(null, 'Products', $product['keyword']), $product['name']) . '<br />'; if (SERVICE_RECENTLY_VISITED_SHOW_PRODUCT_PRICES == '1') { $this->_content .= $product['price'] . ' '; } $this->_content .= '<i>(' . sprintf(OSCOM::getDef('recently_visited_item_in_category'), HTML::link(OSCOM::getLink(null, 'Index', 'cPath=' . $product['category_path']), $product['category_name'])) . ')</i></div>' . '<div style="clear: both;"></div>' . '</li>'; } $this->_content .= ' </ol>' . ' </td>'; } if ($OSCOM_RecentlyVisited->hasCategories()) { $this->_content .= ' <td valign="top">' . ' <h6>' . OSCOM::getDef('recently_visited_categories_title') . '</h6>' . ' <ol style="list-style: none; margin: 0; padding: 0;">'; foreach ($OSCOM_RecentlyVisited->getCategories() as $category) { $this->_content .= '<li>' . HTML::link(OSCOM::getLink(null, 'Index', 'cPath=' . $category['path']), $category['name']); if (!empty($category['parent_id'])) { $this->_content .= ' <i>(' . sprintf(OSCOM::getDef('recently_visited_item_in_category'), HTML::link(OSCOM::getLink(null, 'Index', 'cPath=' . $category['parent_id']), $category['parent_name'])) . ')</i>'; } $this->_content .= '</li>'; } $this->_content .= ' </ol>' . ' </td>'; } if ($OSCOM_RecentlyVisited->hasSearches()) { $this->_content .= ' <td valign="top">' . ' <h6>' . OSCOM::getDef('recently_visited_searches_title') . '</h6>' . ' <ol style="list-style: none; margin: 0; padding: 0;">'; foreach ($OSCOM_RecentlyVisited->getSearches() as $searchphrase) { $this->_content .= '<li>' . HTML::link(OSCOM::getLink(null, 'Search', 'Q=' . $searchphrase['keywords']), HTML::outputProtected($searchphrase['keywords'])) . ' <i>(' . number_format($searchphrase['results']) . ' results)</i></li>'; } $this->_content .= ' </ol>' . ' </td>'; } $this->_content .= ' </tr>' . '</table>'; } }
public function __construct() { $OSCOM_Language = Registry::get('Language'); $OSCOM_Template = Registry::get('Template'); $OSCOM_Language->loadIniFile('modules/Dashboard/ErrorLog.php'); $this->_title = OSCOM::getDef('admin_dashboard_module_errorlog_title'); $this->_title_link = OSCOM::getLink(null, 'ErrorLog'); if (Access::hasAccess(OSCOM::getSite(), 'ErrorLog')) { $this->_data = '<table border="0" width="100%" cellspacing="0" cellpadding="2" class="dataTable">' . ' <thead>' . ' <tr>' . ' <th>' . OSCOM::getDef('admin_dashboard_module_errorlog_table_heading_date') . '</th>' . ' <th>' . OSCOM::getDef('admin_dashboard_module_errorlog_table_heading_message') . '</th>' . ' </tr>' . ' </thead>' . ' <tbody>'; if (ErrorHandler::getTotalEntries() > 0) { $counter = 0; foreach (ErrorHandler::getAll(6) as $row) { $this->_data .= ' <tr onmouseover="$(this).addClass(\'mouseOver\');" onmouseout="$(this).removeClass(\'mouseOver\');"' . ($counter % 2 ? ' class="alt"' : '') . '>' . ' <td style="white-space: nowrap;">' . $OSCOM_Template->getIcon(16, 'errorlog.png') . ' ' . DateTime::getShort(DateTime::fromUnixTimestamp($row['timestamp']), true) . '</td>' . ' <td>' . HTML::outputProtected(substr($row['message'], 0, 60)) . '..</td>' . ' </tr>'; $counter++; } } elseif (!is_writable(OSCOM::BASE_DIRECTORY . 'Work/Database/')) { $this->_data .= ' <tr onmouseover="$(this).addClass(\'mouseOver\');" onmouseout="$(this).removeClass(\'mouseOver\');">' . ' <td colspan="2">' . HTML::icon('cross.png') . ' ' . sprintf(OSCOM::getDef('admin_dashboard_module_errorlog_not_writable'), OSCOM::BASE_DIRECTORY . 'Work/Database/') . '</td>' . ' </tr>'; } else { $this->_data .= ' <tr onmouseover="$(this).addClass(\'mouseOver\');" onmouseout="$(this).removeClass(\'mouseOver\');">' . ' <td colspan="2">' . HTML::icon('tick.png') . ' ' . OSCOM::getDef('admin_dashboard_module_errorlog_no_errors_found') . '</td>' . ' </tr>'; } $this->_data .= ' </tbody>' . '</table>'; } }
public function get($group = null) { if (empty($group)) { $group = OSCOM::getSiteApplication(); } $result = false; if ($this->exists($group)) { $data = array(); foreach ($this->_data[$group] as $message) { $data['messageStack' . ucfirst($message['type'])][] = $message['text']; } $result = ''; foreach ($data as $type => $messages) { $result .= '<div class="' . HTML::outputProtected($type) . '" onmouseover="$(this).find(\'span:first\').show();" onmouseout="$(this).find(\'span:first\').hide();"><span style="float: right; display: none;"><a href="#" onclick="$(this).parent().parent().slideFadeToggle();">' . HTML::icon('minimize.png', 'Hide') . '</a></span>'; foreach ($messages as $message) { $result .= '<p>' . HTML::outputProtected($message) . '</p>'; } $result .= '</div>'; } unset($this->_data[$group]); } return $result; }
protected function valueMixed($column, $type = 'string') { if (!isset($this->result)) { $this->fetch(); } switch ($type) { case 'protected': return HTML::outputProtected($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]; } }
} } if ( Access::hasShortcut() ) { echo ' <li class="shortcuts">'; foreach ( Access::getShortcuts() as $shortcut ) { echo '<a href="' . OSCOM::getLink(null, $shortcut['module']) . '" id="shortcut-' . $shortcut['module'] . '">' . $OSCOM_Template->getIcon(16, $shortcut['icon'], $shortcut['title']) . '<div class="notBubble"></div></a>'; $total_shortcuts++; } echo ' </li>'; } echo ' <li><a href="#">' . HTML::outputProtected($_SESSION[OSCOM::getSite()]['username']) . ' ▾</a>' . ' <ul>' . ' <li><a href="' . OSCOM::getLink(null, 'Login', 'Logoff') . '">' . OSCOM::getDef('header_title_logoff') . '</a></li>' . ' </ul>' . ' </li>' . '</ul>'; } ?> </div> <script type="text/javascript"> $('#adminMenu .apps').droppy({speed: 0}); $('#adminMenu .apps li img').tipsy(); </script>
public function __construct() { $OSCOM_Language = Registry::get('Language'); $OSCOM_Language->loadIniFile('modules/Dashboard/Products.php'); $this->_title = OSCOM::getDef('admin_indexmodules_products_title'); $this->_title_link = OSCOM::getLink(null, 'Products'); if ( Access::hasAccess(OSCOM::getSite(), 'Products') ) { if ( !Registry::exists('Currencies') ) { Registry::set('Currencies', new Currencies()); } $OSCOM_Currencies = Registry::get('Currencies'); $data = array('language_id' => $OSCOM_Language->getID(), 'batch_pageset' => 1, 'batch_max_results' => 6); $result = OSCOM::callDB('Admin\Products\GetAll', $data); foreach ( $result['entries'] as &$p ) { if ( $p['has_children'] === 1 ) { $p['products_price_formatted'] = $OSCOM_Currencies->format($p['products_price_min']); if ( $p['products_price_min'] != $p['products_price_max'] ) { $p['products_price_formatted'] .= ' - ' . $OSCOM_Currencies->format($p['products_price_max']); } $p['products_quantity'] = '(' . $p['products_quantity_variants'] . ')'; } else { $p['products_price_formatted'] = $OSCOM_Currencies->format($p['products_price']); } } $this->_data = '<table border="0" width="100%" cellspacing="0" cellpadding="2" class="dataTable">' . ' <thead>' . ' <tr>' . ' <th>' . OSCOM::getDef('admin_indexmodules_products_table_heading_products') . '</th>' . ' <th>' . OSCOM::getDef('admin_indexmodules_products_table_heading_price') . '</th>' . ' <th>' . OSCOM::getDef('admin_indexmodules_products_table_heading_date') . '</th>' . ' <th>' . OSCOM::getDef('admin_indexmodules_products_table_heading_status') . '</th>' . ' </tr>' . ' </thead>' . ' <tbody>'; /* $Qproducts = Registry::get('PDO')->query('select products_id, greatest(products_date_added, products_last_modified) as date_last_modified from :table_products where parent_id is null order by date_last_modified desc limit 6'); $Qproducts->execute(); $counter = 0; while ( $Qproducts->fetch() ) { $data = osC_Products_Admin::get($Qproducts->valueInt('products_id')); $products_icon = osc_icon('products.png'); $products_price = $data['products_price']; if ( !empty($data['variants']) ) { $products_icon = osc_icon('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; } } */ $counter = 0; foreach ( $result['entries'] as $p ) { if ( $p['has_children'] === 1 ) { $products_icon = HTML::icon('products.png'); } else { $products_icon = HTML::icon('attach.png'); } $this->_data .= ' <tr onmouseover="$(this).addClass(\'mouseOver\');" onmouseout="$(this).removeClass(\'mouseOver\');"' . ($counter % 2 ? ' class="alt"' : '') . '>' . ' <td>' . HTML::link(OSCOM::getLink(null, 'Products', 'Save&id=' . (int)$p['products_id']), $products_icon . ' ' . HTML::outputProtected($p['products_name'])) . '</td>' . ' <td>' . $p['products_price_formatted'] . '</td>' . ' <td>' . $p['products_last_modified'] . '</td>' . ' <td align="center">' . HTML::icon(((int)$p['products_status'] === 1) ? 'checkbox_ticked.gif' : 'checkbox_crossed.gif', null, null) . '</td>' . ' </tr>'; $counter++; } $this->_data .= ' </tbody>' . '</table>'; } }
<?php /** * osCommerce Online Merchant * * @copyright Copyright (c) 2011 osCommerce; http://www.oscommerce.com * @license BSD License; http://www.oscommerce.com/bsdlicense.txt */ use osCommerce\OM\Core\HTML; use osCommerce\OM\Core\OSCOM; ?> <h1><?php echo $OSCOM_Template->getPageTitle(); ?> </h1> <?php if ($OSCOM_Customer->isLoggedOn()) { echo '<p>' . sprintf(OSCOM::getDef('greeting_customer'), HTML::outputProtected($OSCOM_Customer->getFirstName()), OSCOM::getLink(null, 'Products', 'New')) . '</p>'; } else { echo '<p>' . sprintf(OSCOM::getDef('greeting_guest'), OSCOM::getLink(null, 'Account', 'Login', 'SSL'), OSCOM::getLink(null, 'Products', 'New')) . '</p>'; } ?> <p><?php echo OSCOM::getDef('index_text'); ?> </p>
} else { $address_string .= HTML::iconRaw('user_female.png', '32x32'); } $address_string .= '\') no-repeat; opacity: 0.5; filter: alpha(opacity=50); width: 32px; height: 32px;"></div>'; } $address_string .= Address::format($ab, '<br />'); if (!empty($ab['telephone_number']) || !empty($ab['fax_number'])) { $address_string .= '<br /><br />'; if (!empty($ab['telephone_number'])) { $address_string .= HTML::icon('telephone.png', null, null, 'style="margin-right: 6px;"') . HTML::outputProtected($ab['telephone_number']); } if (!empty($ab['telephone_number']) && !empty($ab['fax_number'])) { $address_string .= '<br />'; } if (!empty($ab['fax_number'])) { $address_string .= HTML::icon('fax.png', null, null, 'style="margin-right: 6px;"') . HTML::outputProtected($ab['fax_number']); } } $address_string .= '</div>'; $address_string .= '<div style="clear: both;"></div>'; $address_string .= '<div class="abActions" style="float: right;"><span class="default"><a href="#" onclick="showEditAddressForm(\'' . $ab['address_book_id'] . '\'); return false;">' . HTML::icon('edit.png') . '</a> <a href="#" onclick="deleteAddress(\'' . $ab['address_book_id'] . '\'); return false;">' . HTML::icon('trash.png') . '</a></span></div>'; echo ' <li id="abEntry' . $ab['address_book_id'] . '" style="float: left; margin: 10px; padding: 10px; border: 1px solid #999; background-color: #fff; box-shadow: 4px 4px 8px #ccc;">' . $address_string . '</li>'; } } ?> <li style="float: left; margin: 10px; padding: 10px; border: 1px solid #999; background-color: #e6f1f6; box-shadow: 4px 4px 8px #ccc; text-align: center;"><a href="#" onclick="showNewAddressForm(); return false;">Add New Address</a></li> </ul> <div style="clear: both; padding: 5px;"></div> </div>
echo HTML::icon('trash.png') . ' ' . HTML::outputProtected($_GET['group']); ?> </h3> <form name="gDelete" class="dataForm" action="<?php echo OSCOM::getLink(null, null, 'DeleteGroup&Process&id=' . $_GET['id'] . '&group=' . $_GET['group']); ?> " method="post"> <p><?php echo OSCOM::getDef('introduction_delete_definition_group'); ?> </p> <p><?php echo '<b>' . HTML::outputProtected($_GET['group']) . '</b>'; ?> </p> <p> <?php foreach ($OSCOM_ObjectInfo->get('entries') as $l) { echo Languages::get($l['languages_id'], 'name') . ': ' . (int) $l['total_entries'] . '<br />'; } ?> </p> <p><?php echo HTML::button(array('priority' => 'primary', 'icon' => 'trash', 'title' => OSCOM::getDef('button_delete'))) . ' ' . HTML::button(array('href' => OSCOM::getLink(null, null, 'id=' . $_GET['id']), 'priority' => 'secondary', 'icon' => 'close', 'title' => OSCOM::getDef('button_cancel')));
/** * 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 HTML::outputProtected($this->_data[$key]); }
<?php } } if (isset($_SESSION['comments']) && !empty($_SESSION['comments'])) { ?> <div class="moduleBox"> <h6><?php echo '<b>' . OSCOM::getDef('order_comments_title') . '</b> ' . HTML::link(OSCOM::getLink(null, 'Checkout', 'Payment', 'SSL'), '<span class="orderEdit">' . OSCOM::getDef('order_text_edit_title') . '</span>'); ?> </h6> <div class="content"> <?php echo nl2br(HTML::outputProtected($_SESSION['comments'])) . HTML::hiddenField('comments', $_SESSION['comments']); ?> </div> </div> <?php } ?> <div class="submitFormButtons" style="text-align: right;"> <?php if ($OSCOM_ShoppingCart->hasBillingMethod() && $OSCOM_PaymentModule->hasGateway()) { $form_action_url = $OSCOM_PaymentModule->getGatewayURL(); } else { $form_action_url = OSCOM::getLink(null, null, 'Process', 'SSL');
if ($OSCOM_Application->canLinkTo()) { if (Access::isShortcut(OSCOM::getSiteApplication())) { echo ' <li class="shortcuts">' . HTML::link(OSCOM::getLink(null, 'Dashboard', 'RemoveShortcut&shortcut=' . OSCOM::getSiteApplication()), HTML::icon('shortcut_remove.png')) . '</li>'; } else { echo ' <li class="shortcuts">' . HTML::link(OSCOM::getLink(null, 'Dashboard', 'AddShortcut&shortcut=' . OSCOM::getSiteApplication()), HTML::icon('shortcut_add.png')) . '</li>'; } } if (Access::hasShortcut()) { echo ' <li class="shortcuts">'; foreach (Access::getShortcuts() as $shortcut) { echo '<a href="' . OSCOM::getLink(null, $shortcut['module']) . '" id="shortcut-' . $shortcut['module'] . '">' . $OSCOM_Template->getIcon(16, $shortcut['icon'], $shortcut['title']) . '<div class="notBubble"></div></a>'; $total_shortcuts++; } echo ' </li>'; } echo ' <li><a href="#">' . HTML::outputProtected($_SESSION[OSCOM::getSite()]['username']) . ' ▾</a>' . ' <ul>' . ' <li><a href="' . OSCOM::getLink(null, 'Login', 'Logoff') . '">' . OSCOM::getDef('header_title_logoff') . '</a></li>' . ' </ul>' . ' </li>' . '</ul>'; } ?> </div> <script type="text/javascript"> $('#adminMenu .apps').droppy({speed: 0}); $('#adminMenu .apps li img').tipsy(); </script> <?php if (isset($_SESSION[OSCOM::getSite()]['id'])) { ?> <script type="text/javascript">
?> <h1><?php echo $OSCOM_Template->getIcon(32) . HTML::link(OSCOM::getLink(), $OSCOM_Template->getPageTitle()); ?> </h1> <?php if ($OSCOM_MessageStack->exists()) { echo $OSCOM_MessageStack->get(); } ?> <div class="infoBox"> <h3><?php echo HTML::icon('edit.png') . ' ' . HTML::outputProtected($_GET['group']); ?> </h3> <form name="lDefineBatch" class="dataForm" action="<?php echo OSCOM::getLink(null, null, 'BatchSaveDefinitions&Process&id=' . $_GET['id'] . '&group=' . $_GET['group']); ?> " method="post"> <p><?php echo OSCOM::getDef('introduction_edit_language_definitions'); ?> </p> <fieldset>
$status = $Qstatus->fetchAll(); if (count($status) > 0) { ?> <div class="moduleBox"> <h6><?php echo OSCOM::getDef('order_history_heading'); ?> </h6> <div class="content"> <table border="0" width="100%" cellspacing="0" cellpadding="2"> <?php foreach ($status as $s) { echo ' <tr>' . "\n" . ' <td valign="top" width="70">' . DateTime::getShort($s['date_added']) . '</td>' . "\n" . ' <td valign="top" width="70">' . $s['orders_status_name'] . '</td>' . "\n" . ' <td valign="top">' . (strlen(HTML::outputProtected($s['comments'])) > 0 ? nl2br(HTML::outputProtected($s['comments'])) : ' ') . '</td>' . "\n" . ' </tr>' . "\n"; } ?> </table> </div> </div> <?php } // HPDL // if ( DOWNLOAD_ENABLED == '1' ) { // include('includes/modules/downloads.php'); // } ?>
<div class="moduleBox"> <span style="float: right;"><h6><?php echo OSCOM::getDef('order_status') . ' ' . $o['orders_status_name']; ?> </h6></span> <h6><?php echo OSCOM::getDef('order_number') . ' ' . $o['orders_id']; ?> </h6> <div class="content"> <table border="0" width="100%" cellspacing="2" cellpadding="4"> <tr> <td width="50%" valign="top"><?php echo '<b>' . OSCOM::getDef('order_date') . '</b> ' . DateTime::getLong($o['date_purchased']) . '<br /><b>' . $order_type . '</b> ' . HTML::outputProtected($order_name); ?> </td> <td width="30%" valign="top"><?php echo '<b>' . OSCOM::getDef('order_products') . '</b> ' . Order::numberOfProducts($o['orders_id']) . '<br /><b>' . OSCOM::getDef('order_cost') . '</b> ' . strip_tags($o['order_total']); ?> </td> <td width="20%"><?php echo HTML::button(array('href' => OSCOM::getLink(null, null, 'Orders=' . $o['orders_id'] . (isset($_GET['page']) ? '&page=' . $_GET['page'] : ''), 'SSL'), 'icon' => 'document', 'title' => OSCOM::getDef('button_view'))); ?> </td> </tr> </table> </div> </div>
<tr> <td valign="top" width="60"><?php echo HTML::button(array('href' => OSCOM::getLink(null, null, 'Delete=' . $products['item_id'], 'SSL'), 'icon' => 'trash', 'title' => OSCOM::getDef('button_delete'))); ?> </td> <td valign="top"> <?php echo HTML::link(OSCOM::getLink(null, 'Products', $products['keyword']), '<b>' . $products['name'] . '</b>'); if (STOCK_CHECK == '1' && $OSCOM_ShoppingCart->isInStock($products['item_id']) === false) { echo '<span class="markProductOutOfStock">' . STOCK_MARK_PRODUCT_OUT_OF_STOCK . '</span>'; } // HPDL echo ' (Top Category)'; if ($OSCOM_ShoppingCart->isVariant($products['item_id'])) { foreach ($OSCOM_ShoppingCart->getVariant($products['item_id']) as $variant) { echo '<br />- ' . $variant['group_title'] . ': ' . HTML::outputProtected($variant['value_title']); } } ?> </td> <td valign="top"><?php echo HTML::inputField('products[' . $products['item_id'] . ']', $products['quantity'], 'size="4"'); ?> <a href="#" onclick="document.shopping_cart.submit(); return false;">update</a></td> <td valign="top" align="right"><?php echo '<b>' . $OSCOM_Currencies->displayPrice($products['price'], $products['tax_class_id'], $products['quantity']) . '</b>'; ?> </td> </tr>
public function setBillingAddress($address) { $OSCOM_Customer = Registry::get('Customer'); $OSCOM_PDO = Registry::get('PDO'); $previous_address = false; if (isset($this->_billing_address['id'])) { $previous_address = $this->getBillingAddress(); } if ($OSCOM_Customer->isLoggedOn() && is_numeric($address)) { $Qaddress = $OSCOM_PDO->prepare('select ab.*, z.zone_code, z.zone_name, c.countries_name, c.countries_iso_code_2, c.countries_iso_code_3, c.address_format from :table_address_book ab left join :table_zones z on (ab.entry_zone_id = z.zone_id) left join :table_countries c on (ab.entry_country_id = c.countries_id) where ab.customers_id = :customers_id and ab.address_book_id = :address_book_id'); $Qaddress->bindInt(':customers_id', $OSCOM_Customer->getID()); $Qaddress->bindInt(':address_book_id', $address); $Qaddress->execute(); if ($Qaddress->fetch() !== false) { $this->_billing_address = array('id' => (int) $address, 'firstname' => $Qaddress->valueProtected('entry_firstname'), 'lastname' => $Qaddress->valueProtected('entry_lastname'), 'gender' => $Qaddress->valueProtected('entry_gender'), 'company' => $Qaddress->valueProtected('entry_company'), 'street_address' => $Qaddress->valueProtected('entry_street_address'), 'suburb' => $Qaddress->valueProtected('entry_suburb'), 'city' => $Qaddress->valueProtected('entry_city'), 'postcode' => $Qaddress->valueProtected('entry_postcode'), 'state' => strlen($Qaddress->valueProtected('entry_state')) > 0 ? $Qaddress->valueProtected('entry_state') : $Qaddress->valueProtected('zone_name'), 'zone_id' => $Qaddress->valueInt('entry_zone_id'), 'zone_code' => $Qaddress->value('zone_code'), 'country_id' => $Qaddress->valueInt('entry_country_id'), 'country_title' => $Qaddress->valueProtected('countries_name'), 'country_iso_code_2' => $Qaddress->valueProtected('countries_iso_code_2'), 'country_iso_code_3' => $Qaddress->valueProtected('countries_iso_code_3'), 'format' => $Qaddress->value('address_format'), 'telephone' => $Qaddress->valueProtected('entry_telephone'), 'fax' => $Qaddress->valueProtected('entry_fax')); } } else { $this->_billing_address = array('id' => 0, 'firstname' => HTML::outputProtected($address['firstname']), 'lastname' => HTML::outputProtected($address['lastname']), 'gender' => HTML::outputProtected($address['gender']), 'company' => HTML::outputProtected($address['company']), 'street_address' => HTML::outputProtected($address['street_address']), 'suburb' => HTML::outputProtected($address['suburb']), 'city' => HTML::outputProtected($address['city']), 'postcode' => HTML::outputProtected($address['postcode']), 'state' => isset($address['state']) && !empty($address['state']) ? HTML::outputProtected($address['state']) : HTML::outputProtected(Address::getZoneName($address['zone_id'])), 'zone_id' => (int) $address['zone_id'], 'zone_code' => HTML::outputProtected(Address::getZoneCode($address['zone_id'])), 'country_id' => HTML::outputProtected($address['country_id']), 'country_title' => HTML::outputProtected(Address::getCountryName($address['country_id'])), 'country_iso_code_2' => HTML::outputProtected(Address::getCountryIsoCode2($address['country_id'])), 'country_iso_code_3' => HTML::outputProtected(Address::getCountryIsoCode3($address['country_id'])), 'format' => Address::getFormat($address['country_id']), 'telephone' => HTML::outputProtected($address['telephone']), 'fax' => HTML::outputProtected($address['fax'])); } if (is_array($previous_address) && ($previous_address['id'] != $this->_billing_address['id'] || $previous_address['country_id'] != $this->_billing_address['country_id'] || $previous_address['zone_id'] != $this->_billing_address['zone_id'] || $previous_address['state'] != $this->_billing_address['state'] || $previous_address['postcode'] != $this->_billing_address['postcode'])) { $this->_calculate(); } }
public static function execute(ApplicationAbstract $application) { $OSCOM_Customer = Registry::get('Customer'); $OSCOM_NavigationHistory = Registry::get('NavigationHistory'); $OSCOM_MessageStack = Registry::get('MessageStack'); $OSCOM_Service = Registry::get('Service'); $OSCOM_Breadcrumb = Registry::get('Breadcrumb'); if (ALLOW_GUEST_TO_TELL_A_FRIEND == '-1' && $OSCOM_Customer->isLoggedOn() === false) { $OSCOM_NavigationHistory->setSnapshot(); OSCOM::redirect(OSCOM::getLink(null, 'Account', 'LogIn', 'SSL')); } $requested_product = null; $product_check = false; if (count($_GET) > 3) { $requested_product = basename(key(array_slice($_GET, 3, 1, true))); if ($requested_product == 'Write') { unset($requested_product); if (count($_GET) > 4) { $requested_product = basename(key(array_slice($_GET, 4, 1, true))); } } } if (isset($requested_product)) { if (Product::checkEntry($requested_product)) { $product_check = true; } } if ($product_check === false) { $application->setPageContent('not_found.php'); return false; } Registry::set('Product', new Product($requested_product)); $OSCOM_Product = Registry::get('Product'); if (empty($_POST['from_name'])) { $OSCOM_MessageStack->add('TellAFriend', OSCOM::getDef('error_tell_a_friend_customers_name_empty')); } if (!filter_var($_POST['from_email_address'] . FILTER_VALIDATE_EMAIL)) { $OSCOM_MessageStack->add('TellAFriend', OSCOM::getDef('error_tell_a_friend_invalid_customers_email_address')); } if (empty($_POST['to_name'])) { $OSCOM_MessageStack->add('TellAFriend', OSCOM::getDef('error_tell_a_friend_friends_name_empty')); } if (!filter_var($_POST['to_email_address'], FILTER_VALIDATE_EMAIL)) { $OSCOM_MessageStack->add('TellAFriend', OSCOM::getDef('error_tell_a_friend_invalid_friends_email_address')); } if ($OSCOM_MessageStack->size('TellAFriend') < 1) { $email_subject = sprintf(OSCOM::getDef('email_tell_a_friend_subject'), HTML::sanitize($_POST['from_name']), STORE_NAME); $email_body = sprintf(OSCOM::getDef('email_tell_a_friend_intro'), HTML::sanitize($_POST['to_name']), HTML::sanitize($_POST['from_name']), $OSCOM_Product->getTitle(), STORE_NAME) . "\n\n"; if (!empty($_POST['message'])) { $email_body .= HTML::sanitize($_POST['message']) . "\n\n"; } $email_body .= sprintf(OSCOM::getDef('email_tell_a_friend_link'), OSCOM::getLink(null, null, $OSCOM_Product->getKeyword(), 'NONSSL', false)) . "\n\n" . sprintf(OSCOM::getDef('email_tell_a_friend_signature'), STORE_NAME . "\n" . HTTP_SERVER . DIR_WS_CATALOG . "\n"); $pEmail = new Mail(HTML::sanitize($_POST['to_name']), HTML::sanitize($_POST['to_email_address']), HTML::sanitize($_POST['from_name']), HTML::sanitize($_POST['from_email_address']), $email_subject); $pEmail->setBodyPlain($email_body); $pEmail->send(); $OSCOM_MessageStack->add('header', sprintf(OSCOM::getDef('success_tell_a_friend_email_sent'), $OSCOM_Product->getTitle(), HTML::outputProtected($_POST['to_name'])), 'success'); OSCOM::redirect(OSCOM::getLink(null, null, $OSCOM_Product->getKeyword())); } $application->setPageTitle($OSCOM_Product->getTitle()); $application->setPageContent('tell_a_friend.php'); }
?> (<?php echo sprintf(OSCOM::getDef('reviewed_by'), HTML::outputProtected($r['customers_name'])); ?> )</h6> <div class="content"> <?php if (!empty($r['image'])) { echo HTML::link(OSCOM::getLink(null, 'Products', 'Reviews&View=' . $r['reviews_id'] . '&' . $r['products_keyword']), $OSCOM_Image->show($r['image'], $r['products_name'], 'style="float: left;"')); } ?> <p style="padding-left: 100px;"><?php echo wordwrap(HTML::outputProtected($r['reviews_text']), 60, '­') . (strlen(HTML::outputProtected($r['reviews_text'])) >= 100 ? '..' : '') . '<br /><br /><i>' . sprintf(OSCOM::getDef('review_rating'), HTML::image(OSCOM::getPublicSiteLink('images/stars_' . (int) $r['reviews_rating'] . '.png'), sprintf(OSCOM::getDef('rating_of_5_stars'), (int) $r['reviews_rating'])), sprintf(OSCOM::getDef('rating_of_5_stars'), (int) $r['reviews_rating'])) . '</i>'; ?> </p> <div style="clear: both;"></div> </div> </div> <?php } ?> <div class="listingPageLinks"> <span style="float: right;"><?php echo PDO::getBatchPageLinks('page', $reviews_listing['total'], OSCOM::getAllGET('page')); ?>
if ($counter > 1) { ?> <hr style="height: 1px; width: 150px; text-align: left; margin-left: 0px" /> <?php } ?> <p><?php echo HTML::image(OSCOM::getPublicSiteLink('images/stars_' . (int) $r['reviews_rating'] . '.png'), sprintf(OSCOM::getDef('rating_of_5_stars'), (int) $r['reviews_rating'])) . ' ' . sprintf(OSCOM::getDef('reviewed_by'), HTML::outputProtected($r['customers_name'])) . '; ' . DateTime::getLong($r['date_added']); ?> </p> <p><?php echo nl2br(wordwrap(HTML::outputProtected($r['reviews_text']), 60, '­')); ?> </p> <?php } ?> <div class="listingPageLinks"> <span style="float: right;"><?php echo PDO::getBatchPageLinks('page', $reviews_listing['total'], OSCOM::getAllGET('page')); ?> </span> <?php echo PDO::getBatchTotalPages(OSCOM::getDef('result_set_number_of_reviews'), isset($_GET['page']) ? $_GET['page'] : 1, $reviews_listing['total']);
public static function start() { $OSCOM_Customer = Registry::get('Customer'); $OSCOM_PDO = Registry::get('PDO'); if ($OSCOM_Customer->isLoggedOn()) { $wo_customer_id = $OSCOM_Customer->getID(); $wo_full_name = $OSCOM_Customer->getName(); } else { $wo_customer_id = null; $wo_full_name = 'Guest'; if (SERVICE_WHOS_ONLINE_SPIDER_DETECTION == '1') { $user_agent = strtolower($_SERVER['HTTP_USER_AGENT']); if (!empty($user_agent)) { $spiders = file(OSCOM::BASE_DIRECTORY . 'Core/Site/Shop/assets/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 = OSCOM::getIPAddress(); $wo_last_page_url = HTML::outputProtected(substr($_SERVER['REQUEST_URI'], 0, 255)); $current_time = time(); $xx_mins_ago = $current_time - 900; // remove entries that have expired $Qwhosonline = $OSCOM_PDO->prepare('delete from :table_whos_online where time_last_click < :time_last_click'); $Qwhosonline->bindValue(':time_last_click', $xx_mins_ago); $Qwhosonline->execute(); $Qwhosonline = $OSCOM_PDO->prepare('select count(*) as count from :table_whos_online where session_id = :session_id'); $Qwhosonline->bindValue(':session_id', $wo_session_id); $Qwhosonline->execute(); if ($Qwhosonline->valueInt('count') > 0) { $Qwhosonline = $OSCOM_PDO->prepare('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'); if ($wo_customer_id > 0) { $Qwhosonline->bindInt(':customer_id', $wo_customer_id); } else { $Qwhosonline->bindNull(':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 = $OSCOM_PDO->prepare('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)'); if ($wo_customer_id > 0) { $Qwhosonline->bindInt(':customer_id', $wo_customer_id); } else { $Qwhosonline->bindNull(':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(); } return true; }
/** * Returns the title of the page * * @access public * @return string */ function getPageTitle() { return HTML::outputProtected($this->_application->getPageTitle()); }
public function testOutputProtected() { $this->assertEquals('<a href="test">test&string</a>', HTML::outputProtected(' <a href="test">test&string</a> ')); }