本文整理汇总了PHP中osc_output_string_protected函数的典型用法代码示例。如果您正苦于以下问题:PHP osc_output_string_protected函数的具体用法?PHP osc_output_string_protected怎么用?PHP osc_output_string_protected使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了osc_output_string_protected函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: _process
function _process()
{
global $osC_Language, $messageStack, $osC_Product;
if (empty($_POST['from_name'])) {
$messageStack->add('tell_a_friend', $osC_Language->get('error_tell_a_friend_customers_name_empty'));
}
if (!osc_validate_email_address($_POST['from_email_address'])) {
$messageStack->add('tell_a_friend', $osC_Language->get('error_tell_a_friend_invalid_customers_email_address'));
}
if (empty($_POST['to_name'])) {
$messageStack->add('tell_a_friend', $osC_Language->get('error_tell_a_friend_friends_name_empty'));
}
if (!osc_validate_email_address($_POST['to_email_address'])) {
$messageStack->add('tell_a_friend', $osC_Language->get('error_tell_a_friend_invalid_friends_email_address'));
}
if ($messageStack->size('tell_a_friend') < 1) {
include 'includes/classes/email_template.php';
$email_template = toC_Email_Template::getEmailTemplate('tell_a_friend');
$email_template->setData($_POST['from_name'], $_POST['from_email_address'], $_POST['to_name'], $_POST['to_email_address'], $_POST['message'], $osC_Product->getTitle(), osc_href_link(FILENAME_PRODUCTS, $osC_Product->getID(), 'NONSSL', false, true, true));
$email_template->buildMessage();
$email_template->sendEmail();
$messageStack->add_session('header', sprintf($osC_Language->get('success_tell_a_friend_email_sent'), $osC_Product->getTitle(), osc_output_string_protected($_POST['to_name'])), 'success');
osc_redirect(osc_href_link(FILENAME_PRODUCTS, $osC_Product->getID()));
}
}
示例2: _process
function _process()
{
global $osC_Language, $osC_MessageStack, $osC_Product;
if (empty($_POST['from_name'])) {
$osC_MessageStack->add('tell_a_friend', $osC_Language->get('error_tell_a_friend_customers_name_empty'));
}
if (!osc_validate_email_address($_POST['from_email_address'])) {
$osC_MessageStack->add('tell_a_friend', $osC_Language->get('error_tell_a_friend_invalid_customers_email_address'));
}
if (empty($_POST['to_name'])) {
$osC_MessageStack->add('tell_a_friend', $osC_Language->get('error_tell_a_friend_friends_name_empty'));
}
if (!osc_validate_email_address($_POST['to_email_address'])) {
$osC_MessageStack->add('tell_a_friend', $osC_Language->get('error_tell_a_friend_invalid_friends_email_address'));
}
if ($osC_MessageStack->size('tell_a_friend') < 1) {
$email_subject = sprintf($osC_Language->get('email_tell_a_friend_subject'), osc_sanitize_string($_POST['from_name']), STORE_NAME);
$email_body = sprintf($osC_Language->get('email_tell_a_friend_intro'), osc_sanitize_string($_POST['to_name']), osc_sanitize_string($_POST['from_name']), $osC_Product->getTitle(), STORE_NAME) . "\n\n";
if (!empty($_POST['message'])) {
$email_body .= osc_sanitize_string($_POST['message']) . "\n\n";
}
$email_body .= sprintf($osC_Language->get('email_tell_a_friend_link'), osc_href_link(FILENAME_PRODUCTS, $osC_Product->getKeyword(), 'NONSSL', false)) . "\n\n" . sprintf($osC_Language->get('email_tell_a_friend_signature'), STORE_NAME . "\n" . HTTP_SERVER . DIR_WS_CATALOG . "\n");
osc_email(osc_sanitize_string($_POST['to_name']), osc_sanitize_string($_POST['to_email_address']), $email_subject, $email_body, osc_sanitize_string($_POST['from_name']), osc_sanitize_string($_POST['from_email_address']));
$osC_MessageStack->add('header', sprintf($osC_Language->get('success_tell_a_friend_email_sent'), $osC_Product->getTitle(), osc_output_string_protected($_POST['to_name'])), 'success');
osc_redirect(osc_href_link(FILENAME_PRODUCTS, $osC_Product->getID()));
}
}
示例3: getIcon
public function getIcon($size = 16, $icon = null, $title = null)
{
if (empty($icon)) {
$icon = $this->_application->getIcon();
}
return '<img src="' . OSCOM::getPublicSiteLink('images/applications/' . (int) $size . '/' . $icon) . '" border="0" alt="" title="' . osc_output_string_protected($title) . '" width="' . (int) $size . '" height="' . (int) $size . '" />';
}
示例4: _setData
function _setData()
{
global $osC_Database, $osC_Language, $osC_Currencies;
if (!isset($osC_Currencies)) {
if (!class_exists('osC_Currencies')) {
include '../includes/classes/currencies.php';
}
$osC_Currencies = new osC_Currencies();
}
$this->_data = '<table border="0" width="100%" cellspacing="0" cellpadding="2" class="dataTable">' . ' <thead>' . ' <tr>' . ' <th>' . $osC_Language->get('summary_products_table_heading_products') . '</th>' . ' <th>' . $osC_Language->get('summary_products_table_heading_price') . '</th>' . ' <th>' . $osC_Language->get('summary_products_table_heading_date') . '</th>' . ' <th>' . $osC_Language->get('summary_products_table_heading_status') . '</th>' . ' </tr>' . ' </thead>' . ' <tbody>';
$Qproducts = $osC_Database->query('select products_id, greatest(products_date_added, products_last_modified) as date_last_modified from :table_products where parent_id = 0 order by date_last_modified desc limit 6');
$Qproducts->bindTable(':table_products', TABLE_PRODUCTS);
$Qproducts->execute();
while ($Qproducts->next()) {
$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;
}
}
$this->_data .= ' <tr onmouseover="rowOverEffect(this);" onmouseout="rowOutEffect(this);">' . ' <td>' . osc_link_object(osc_href_link_admin(FILENAME_DEFAULT, 'products=' . (int) $data['products_id'] . '&action=save'), $products_icon . ' ' . osc_output_string_protected($data['products_name'])) . '</td>' . ' <td>' . (!empty($data['variants']) ? 'from ' : '') . $osC_Currencies->format($products_price) . '</td>' . ' <td>' . $Qproducts->value('date_last_modified') . '</td>' . ' <td align="center">' . osc_icon((int) $data['products_status'] === 1 ? 'checkbox_ticked.gif' : 'checkbox_crossed.gif', null, null) . '</td>' . ' </tr>';
}
$this->_data .= ' </tbody>' . '</table>';
$Qproducts->freeResult();
}
示例5: execute
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();
osc_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 (!osc_validate_email_address($_POST['from_email_address'])) {
$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 (!osc_validate_email_address($_POST['to_email_address'])) {
$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'), osc_sanitize_string($_POST['from_name']), STORE_NAME);
$email_body = sprintf(OSCOM::getDef('email_tell_a_friend_intro'), osc_sanitize_string($_POST['to_name']), osc_sanitize_string($_POST['from_name']), $OSCOM_Product->getTitle(), STORE_NAME) . "\n\n";
if (!empty($_POST['message'])) {
$email_body .= osc_sanitize_string($_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");
osc_email(osc_sanitize_string($_POST['to_name']), osc_sanitize_string($_POST['to_email_address']), $email_subject, $email_body, osc_sanitize_string($_POST['from_name']), osc_sanitize_string($_POST['from_email_address']));
$OSCOM_MessageStack->add('header', sprintf(OSCOM::getDef('success_tell_a_friend_email_sent'), $OSCOM_Product->getTitle(), osc_output_string_protected($_POST['to_name'])), 'success');
osc_redirect(OSCOM::getLink(null, null, $OSCOM_Product->getKeyword()));
}
$application->setPageTitle($OSCOM_Product->getTitle());
$application->setPageContent('tell_a_friend.php');
}
示例6: format
function format($address, $new_line = "\n")
{
global $osC_Database;
$address_format = '';
if (is_numeric($address)) {
$Qaddress = $osC_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, ab.entry_telephone as telephone_number, 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 = osC_Address::getZoneName($address['zone_id']);
$state_code = osC_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 = osC_Address::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 = osC_Address::getFormat($address['country_id']);
}
if (empty($address_format)) {
$address_format = ":name\n:street_address\n:postcode :city\n:country";
}
if (defined('DISPLAY_TELEPHONE_NUMBER') && (int) DISPLAY_TELEPHONE_NUMBER == 1) {
if (strpos($address_format, 'telephone_number') == false) {
$address_format .= "\n:telephone_number";
}
}
$find_array = array('/\\:name\\b/', '/\\:street_address\\b/', '/\\:suburb\\b/', '/\\:city\\b/', '/\\:postcode\\b/', '/\\:state\\b/', '/\\:state_code\\b/', '/\\:country\\b/', '/\\:telephone_number\\b/');
$replace_array = array(osc_output_string_protected($firstname . ' ' . $lastname), osc_output_string_protected($address['street_address']), osc_output_string_protected($address['suburb']), osc_output_string_protected($address['city']), osc_output_string_protected($address['postcode']), osc_output_string_protected($state), osc_output_string_protected($state_code), osc_output_string_protected($country), osc_output_string_protected($address['telephone_number']));
$formated = preg_replace($find_array, $replace_array, $address_format);
if (ACCOUNT_COMPANY > -1 && !empty($address['company'])) {
$company = osc_output_string_protected($address['company']);
$formated = $company . $new_line . $formated;
}
if ($new_line != "\n") {
$formated = str_replace("\n", $new_line, $formated);
}
return $formated;
}
示例7: _setData
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_error_log_table_heading_date') . '</th>' . ' <th>' . $osC_Language->get('summary_error_log_table_heading_message') . '</th>' . ' </tr>' . ' </thead>' . ' <tbody>';
$counter = 0;
foreach (osc_toObjectInfo(osC_ErrorLog_Admin::getAll())->get('entries') as $log) {
$this->_data .= ' <tr onmouseover="$(this).addClass(\'mouseOver\');" onmouseout="$(this).removeClass(\'mouseOver\');"' . ($counter % 2 ? ' class="alt"' : '') . '>' . ' <td style="white-space: nowrap;">' . osc_icon('error.png') . ' ' . osc_output_string_protected($log['date']) . '</td>' . ' <td>' . osc_output_string_protected(substr($log['message'], 0, 60)) . '..</td>' . ' </tr>';
$counter++;
if ($counter == 6) {
break;
}
}
$this->_data .= ' </tbody>' . '</table>';
}
示例8: initialize
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, '­') . ' ..') . '<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>';
}
}
}
示例9: initialize
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, '­') . ' ..') . '<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>';
}
}
}
示例10: format
/**
* 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_Database = Registry::get('Database');
$address_format = '';
if (is_numeric($address)) {
$Qaddress = $OSCOM_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->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 = 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(osc_output_string_protected($firstname . ' ' . $lastname), osc_output_string_protected($address['street_address']), osc_output_string_protected($address['suburb']), osc_output_string_protected($address['city']), osc_output_string_protected($address['postcode']), osc_output_string_protected($state), osc_output_string_protected($state_code), osc_output_string_protected($country));
$formated = preg_replace($find_array, $replace_array, $address_format);
if (ACCOUNT_COMPANY > -1 && !empty($address['company'])) {
$formated = osc_output_string_protected($address['company']) . "\n" . $formated;
}
if (!empty($new_line)) {
$formated = str_replace("\n", $new_line, $formated);
}
return $formated;
}
示例11: showConfirmation
function showConfirmation()
{
global $osC_Database, $osC_Language, $osC_Template;
$Qrecipients = $osC_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($osC_Language->get('newsletter_newsletter_total_recipients'), $this->_audience_size) . '</b></font></p>' . '<p><b>' . $this->_newsletter_title . '</b></p>' . '<p>' . nl2br(osc_output_string_protected($this->_newsletter_content)) . '</p>' . '<form name="execute" action="' . osc_href_link_admin(FILENAME_DEFAULT, $osC_Template->getModule() . '&page=' . $_GET['page'] . '&nID=' . $this->_newsletter_id . '&action=send') . '" method="post">' . '<p align="right">';
if ($this->_audience_size > 0) {
$confirmation_string .= osc_draw_hidden_field('subaction', 'execute') . '<input type="submit" value="' . $osC_Language->get('button_send') . '" class="operationButton" /> ' . '<input type="button" value="' . $osC_Language->get('button_cancel') . '" onclick="document.location.href=\'' . osc_href_link_admin(FILENAME_DEFAULT, $osC_Template->getModule() . '&page=' . $_GET['page']) . '\'" class="operationButton" />';
} else {
$confirmation_string .= '<input type="button" value="' . $osC_Language->get('button_back') . '" onclick="document.location.href=\'' . osc_href_link_admin(FILENAME_DEFAULT, $osC_Template->getModule() . '&page=' . $_GET['page']) . '\'" class="operationButton" />';
}
$confirmation_string .= '</p>' . '</form>';
return $confirmation_string;
}
示例12: __construct
public function __construct()
{
Registry::get('Language')->loadIniFile('modules/IndexModules/ErrorLog.php');
$this->_title = OSCOM::getDef('admin_indexmodules_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_indexmodules_errorlog_table_heading_date') . '</th>' . ' <th>' . OSCOM::getDef('admin_indexmodules_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;">' . Registry::get('Template')->getIcon(16, 'errorlog.png') . ' ' . DateTime::getShort(DateTime::fromUnixTimestamp($row['timestamp']), true) . '</td>' . ' <td>' . osc_output_string_protected(substr($row['message'], 0, 60)) . '..</td>' . ' </tr>';
$counter++;
}
} else {
$this->_data .= ' <tr onmouseover="$(this).addClass(\'mouseOver\');" onmouseout="$(this).removeClass(\'mouseOver\');">' . ' <td colspan="2">' . osc_icon('tick.png') . ' ' . OSCOM::getDef('admin_indexmodules_errorlog_no_errors_found') . '</td>' . ' </tr>';
}
$this->_data .= ' </tbody>' . '</table>';
}
}
示例13: initialize
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;">' . osc_link_object(OSCOM::getLink(null, 'Products', $product['keyword']), $OSCOM_Image->show($product['image'], $product['name'], null, 'mini')) . '</span>';
}
$this->_content .= '<div style="float: left;">' . osc_link_object(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'), osc_link_object(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>' . osc_link_object(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'), osc_link_object(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>' . osc_link_object(OSCOM::getLink(null, 'Search', 'keywords=' . $searchphrase['keywords']), osc_output_string_protected($searchphrase['keywords'])) . ' <i>(' . number_format($searchphrase['results']) . ' results)</i></li>';
}
$this->_content .= ' </ol>' . ' </td>';
}
$this->_content .= ' </tr>' . '</table>';
}
}
示例14: get
public function get($group)
{
$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="' . osc_output_string_protected($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();">' . osc_icon('minimize.png', 'Hide') . '</a></span>';
foreach ($messages as $message) {
$result .= '<p>' . osc_output_string_protected($message) . '</p>';
}
$result .= '</div>';
}
unset($this->_data[$group]);
}
return $result;
}
示例15: valueMixed
protected function valueMixed($column, $type = 'string')
{
if (!isset($this->result)) {
$this->fetch();
}
switch ($type) {
case 'protected':
return osc_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];
}
}