本文整理汇总了PHP中isc_date函数的典型用法代码示例。如果您正苦于以下问题:PHP isc_date函数的具体用法?PHP isc_date怎么用?PHP isc_date使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了isc_date函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: TrackVisitor
/**
* Actually track a visitor.
*/
function TrackVisitor()
{
$today_stamp = mktime(0, 0, 0, isc_date("m"), isc_date("d"), isc_date("Y"));
if (!isset($_COOKIE['STORE_VISITOR'])) {
// We have a new visitor, let's track that.
$query = sprintf("SELECT COUNT(uniqueid) AS num FROM [|PREFIX|]unique_visitors WHERE datestamp='%d'", $GLOBALS['ISC_CLASS_DB']->Quote($today_stamp));
$result = $GLOBALS['ISC_CLASS_DB']->Query($query);
$row = $GLOBALS['ISC_CLASS_DB']->Fetch($result);
if ($row['num'] == 0) {
// This person is the first to visit the site today, so track it
$new_visitor = array("datestamp" => $today_stamp, "numuniques" => 1);
$GLOBALS['ISC_CLASS_DB']->InsertQuery("unique_visitors", $new_visitor);
} else {
// At least one person has visited the site today, just update the record
$query = sprintf("UPDATE [|PREFIX|]unique_visitors SET numuniques=numuniques+1 WHERE datestamp='%d'", $today_stamp);
// Run the query to update the number of unique visitors
$GLOBALS['ISC_CLASS_DB']->Query($query);
}
// Set the tracking cookie for another 24 hours
ISC_SetCookie("STORE_VISITOR", true, time() + 86400);
}
header("Content-type: image/gif");
echo base64_decode('R0lGODlhAQABALMAAAAAAIAAAACAAICAAAAAgIAAgACAgMDAwICAgP8AAAD/AP//AAAA//8A/wD//wBiZCH5BAEAAA8ALAAAAAABAAEAAAQC8EUAOw==');
exit;
}
示例2: manageOptimizer
/**
* Display the store-wide GWO tests list
*
*/
private function manageOptimizer()
{
$Tests = GetAvailableModules('optimizer');
$Output = "";
$EnabledModules = array();
$GLOBALS['Message'] = GetFlashMessageBoxes();
$EnabledModules = GetConfig('OptimizerMethods');
$GLOBALS['OptimizerRow'] = '';
foreach ($Tests as $Test) {
$GLOBALS['ModuleName'] = isc_html_escape($Test['name']);
$GLOBALS['ModuleId'] = $Test['id'];
$GLOBALS['ConfiguredIcon'] = 'cross';
$GLOBALS['ConfiguredDate'] = 'N/A';
$GLOBALS['ActiveReset'] = 'inactive';
if($Test['enabled']) {
$GLOBALS['ActiveReset'] = 'active';
$GLOBALS['ConfiguredIcon'] = 'tick';
if(isset($EnabledModules[$Test['id']]) && $EnabledModules[$Test['id']] != '') {
$GLOBALS['ConfiguredDate'] = isc_date('jS M Y',$EnabledModules[$Test['id']]);
}
}
$GLOBALS['OptimizerRow'] .= $this->template->render('Snippets/OptimizerRow.html');
}
$this->template->display('optimizer.manage.tpl');
}
示例3: Save
/**
* Save an item to the data store.
*
* @param string The name of the item to save.
* @param mixed The data to be saved in the data store.
* @return boolean True if the data was saved successfully, false if not.
*/
public function Save($name, $data)
{
$contents = "<" . "?php\n\n/** Interspire Shopping Cart Data Store File **\n *\n";
$contents .= " * Generated: " . isc_date('r') . "\n *\n * DO NOT EDIT THIS FILE MANUALLY\n *\n*/\n\n";
$contents .= "\$cacheData = " . var_export($data, true) . ";\n\n?" . ">";
if (file_put_contents($this->baseDir . '/' . $name . '.php', $contents)) {
return true;
} else {
return false;
}
}
示例4: Export
/**
* Creates a file and exports the data from the file type
*
* @return string The name of the file.
*/
public function Export()
{
//zcs=>
$is_photo = $this->filetype instanceof ISC_ADMIN_EXPORTFILETYPE_PHOTOS;
$sys_tmp = sys_get_temp_dir();
//<=zcs
// create a temporary file
$output = "";
//zcs=add (judgement)
$this->file = $is_photo ? $sys_tmp . "/photos_" . isc_date("Y-m-d") . "." . $this->method_extension : tempnam($sys_tmp, "export_");
$this->handle = fopen($this->file, "wb");
// write any header data if necessary
$this->WriteHeader();
// Export the rows 3 sepperate fuctions added by blessen
$image_files = array();
//zcs=
if ($_GET['t'] == "customers" || $_GET['t'] == "orders") {
$this->filetype->ExportRows_Orders_Customer();
} else {
$image_files = $this->filetype->ExportRows();
}
// write any footer/closing data
$this->WriteFooter();
// close the file
fclose($this->handle);
//zcs=>For photos, add this result file to specify zip file(where created from ISC_ADMIN_EXPORTFILETYPE_PHOTOS-ExportRows()).
if ($is_photo) {
/*--old
$zip_handle = new ZipArchive;
if($zip_handle->open($this->filetype->zip_file) !== TRUE){
throw new Exception(sprintf(GetLang('OpenZipError'), $this->filetype->zip_file));
}
$zip_handle->addFile($this->file, 'photo_list'.'.'.$this->method_extension);
$zip_handle->close();
*/
$image_files[] = $this->file;
$zip_file = tempnam($sys_tmp, 'exportzip_');
$zip_handle = new PclZip($zip_file);
$zip_rs = $zip_handle->create($image_files, PCLZIP_OPT_REMOVE_ALL_PATH);
if ($zip_rs == 0) {
throw new Exception(sprintf(GetLang("CreateZipError"), $zip_handle->errorInfo(true)));
}
unlink($this->file);
//delete temporary file
$this->file = $zip_file;
//zcs=change file for downloading
$this->method_extension = 'zip';
//zcs= change extension for downloading
}
//<=zcs
return $this->GetFile();
}
示例5: dateFormat
/**
* Filter for formatting dates in templates that wraps around isc_date. Will use
* getConfig('DisplayDateFormat') if no format is supplied.
*
* @param DateTime|int $timestamp Instance of a DateTime object, or unix timestamp.
* @param string $format Format for time. Can either be a getConfig() value or actual date format.
* @return string Formatted date.
*/
public function dateFormat($timestamp, $format = '')
{
if($format == '') {
$format = getConfig('DisplayDateFormat');
}
else if(getConfig($format)) {
$format = getConfig($format);
}
if($timestamp instanceof DateTime) {
return $timestamp->format($format);
}
return isc_date($format, $timestamp);
}
示例6: fromSubscriptionToProvider
public function fromSubscriptionToProvider(Interspire_EmailIntegration_Field $field, $value)
{
if ($field instanceof Interspire_EmailIntegration_Field_Date) {
// for dates, the value /should/ be convertable to a timestamp, so we can date() it and send it through as mailchimp requires
// note: if I sent a date formatted using isc_date_tz to mailchimp, they would convert it to local time (so 2010-04-28 became 2010-04-27) *even if the mailchimp account was set to +10* - so, I'm sending it through without a tz indicator and it seems to make more sense -ge
return isc_date('Y-m-d H:i:s', $field->valueToNumber($value));
}
if ($field instanceof Interspire_EmailIntegration_Field_StringInterface) {
// for other string-compatible fields, try sending that through and let mailchimp sort it out
return $field->valueToString($value);
}
// other field types that won't map
return '';
}
示例7: ShowNews
function ShowNews()
{
if ($this->_newsid > 0) {
$GLOBALS['NewsTitle'] = $this->_newstitle;
$GLOBALS['NewsContent'] = $this->_newscontent;
if (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] === 'on') {
$GLOBALS['NewsContent'] = str_replace($GLOBALS['ShopPathNormal'], $GLOBALS['ShopPathSSL'], $GLOBALS['NewsContent']);
}
$GLOBALS['NewsDate'] = isc_date(GetConfig('ExtendedDisplayDateFormat'), $this->_newsdate);
$GLOBALS['ISC_CLASS_TEMPLATE']->SetPageTitle($this->_newstitle);
$GLOBALS['ISC_CLASS_TEMPLATE']->SetTemplate("news");
$GLOBALS['ISC_CLASS_TEMPLATE']->ParseTemplate();
} else {
ob_end_clean();
header("Location: " . $GLOBALS['ShopPath']);
die;
}
}
示例8: NiceDate
/**
* Calculate and return a friendly displayable date such as "less than a minute ago"
* "x minutes ago", "Today at 6:00 PM" etc.
*
* @param string The UNIX timestamp to format.
* @param boolean True to include the time details, false if not.
* @return string The formatted date.
*/
function NiceDate($timestamp, $includeTime = false)
{
$now = time();
$difference = $now - $timestamp;
$time = isc_date('h:i A', $timestamp);
$timeDate = isc_date('Ymd', $timestamp);
$todaysDate = isc_date('Ymd', $now);
$yesterdaysDate = isc_date('Ymd', $now - 86400);
if ($difference < 60) {
return GetLang('LessThanAMinuteAgo');
} else {
if ($difference < 3600) {
$minutes = ceil($difference / 60);
if ($minutes == 1) {
return GetLang('OneMinuteAgo');
} else {
return sprintf(GetLang('XMinutesAgo'), $minutes);
}
} else {
if ($difference < 43200) {
$hours = ceil($difference / 3600);
if ($hours == 1) {
return GetLang('OneHourAgo');
} else {
return sprintf(GetLang('XHoursAgo'), $hours);
}
} else {
if ($timeDate == $todaysDate) {
if ($includeTime == true) {
return sprintf(GetLang('TodayAt'), $time);
} else {
return GetLang('Today');
}
} else {
if ($timeDate == $yesterdaysDate) {
if ($includeTime == true) {
return sprintf(GetLang('YesterdayAt'), $time);
} else {
return GetLang('Yesterday');
}
} else {
$date = CDate($timestamp);
if ($includeTime == true) {
return sprintf(GetLang('OnDateAtTime'), $date, $time);
} else {
return sprintf(GetLang('OnDate'), $date);
}
}
}
}
}
}
}
示例9: BuildWhereFromVars
public function BuildWhereFromVars($array)
{
$queryWhere = "";
if (isset($array['searchQuery']) && $array['searchQuery'] != "") {
// PostgreSQL is case sensitive for likes, so all matches are done in lower case
$search_query = $GLOBALS['ISC_CLASS_DB']->Quote(trim(isc_strtolower($array['searchQuery'])));
$queryWhere .= "\n\t\t\t\t\tAND (\n\t\t\t\t\t\tcustomerid = '" . $search_query . "' OR\n\t\t\t\t\t\tLOWER(custconfirstname) LIKE '%" . $search_query . "%' OR\n\t\t\t\t\t\tLOWER(custconlastname) LIKE '%" . $search_query . "%' OR\n\t\t\t\t\t\tLOWER(custconemail) LIKE '%" . $search_query . "%' OR\n\t\t\t\t\t\tLOWER(CONCAT(custconfirstname, ' ', custconlastname)) LIKE '%" . $search_query . "%' OR\n\t\t\t\t\t\tLOWER(custconcompany) LIKE '%" . $search_query . "%'\n\t\t\t\t\t)";
}
if (isset($array['letter']) && $array['letter'] != '') {
$letter = chr(ord($array['letter']));
if ($array['letter'] == '0-9') {
$queryWhere .= " AND custconlastname NOT REGEXP('^[a-zA-Z]')";
} else {
if (isc_strlen($letter) == 1) {
$queryWhere .= " AND custconlastname LIKE '" . $GLOBALS['ISC_CLASS_DB']->Quote($letter) . "%'";
}
}
}
if (isset($array['phone']) && $array['phone'] != "") {
$phone = $GLOBALS['ISC_CLASS_DB']->Quote(trim($array['phone']));
$queryWhere .= sprintf(" AND custconphone LIKE '%%%s%%'", $phone);
}
if (isset($array['idFrom']) && $array['idFrom'] != "") {
$id_from = $GLOBALS['ISC_CLASS_DB']->Quote((int) $array['idFrom']);
$queryWhere .= sprintf(" AND customerid >= '%d'", $id_from);
}
if (isset($array['idTo']) && $array['idTo']) {
$id_to = $GLOBALS['ISC_CLASS_DB']->Quote((int) $array['idTo']);
$queryWhere .= sprintf(" AND customerid <= '%d'", $id_to);
}
if (isset($array['storeCreditFrom']) && $array['storeCreditFrom'] != "") {
$credit_from = $GLOBALS['ISC_CLASS_DB']->Quote((int) $array['storeCreditFrom']);
$queryWhere .= sprintf(" AND custstorecredit >= '%d'", $credit_from);
}
if (isset($array['storeCreditTo']) && $array['storeCreditTo'] != "") {
$credit_to = $GLOBALS['ISC_CLASS_DB']->Quote((int) $array['storeCreditTo']);
$queryWhere .= sprintf(" AND custstorecredit <= '%d'", $credit_to);
}
// Limit results to a particular join date range
if (isset($array['dateRange']) && $array['dateRange'] != "") {
$range = $array['dateRange'];
switch ($range) {
// Registrations within the last day
case "today":
$from_stamp = mktime(0, 0, 0, isc_date("m"), isc_date("d"), isc_date("Y"));
break;
// Registrations received in the last 2 days
// Registrations received in the last 2 days
case "yesterday":
$from_stamp = mktime(0, 0, 0, isc_date("m"), date("d") - 1, isc_date("Y"));
$to_stamp = mktime(0, 0, 0, isc_date("m"), isc_date("d") - 1, isc_date("Y"));
break;
// Registrations received in the last 24 hours
// Registrations received in the last 24 hours
case "day":
$from_stamp = time() - 60 * 60 * 24;
break;
// Registrations received in the last 7 days
// Registrations received in the last 7 days
case "week":
$from_stamp = time() - 60 * 60 * 24 * 7;
break;
// Registrations received in the last 30 days
// Registrations received in the last 30 days
case "month":
$from_stamp = time() - 60 * 60 * 24 * 30;
break;
// Registrations received this month
// Registrations received this month
case "this_month":
$from_stamp = mktime(0, 0, 0, isc_date("m"), 1, isc_date("Y"));
break;
// Orders received this year
// Orders received this year
case "this_year":
$from_stamp = mktime(0, 0, 0, 1, 1, isc_date("Y"));
break;
// Custom date
// Custom date
default:
if (isset($array['fromDate']) && $array['fromDate'] != "") {
$from_date = $array['fromDate'];
$from_data = explode("/", $from_date);
$from_stamp = mktime(0, 0, 0, $from_data[0], $from_data[1], $from_data[2]);
}
if (isset($array['toDate']) && $array['toDate'] != "") {
$to_date = $array['toDate'];
$to_data = explode("/", $to_date);
$to_stamp = mktime(0, 0, 0, $to_data[0], $to_data[1], $to_data[2]);
}
}
if (isset($from_stamp)) {
$queryWhere .= sprintf(" AND custdatejoined >= '%d'", $from_stamp);
}
if (isset($to_stamp)) {
$queryWhere .= sprintf(" AND custdatejoined <= '%d'", $to_stamp);
}
}
if (isset($array['custGroupId']) && is_numeric($array['custGroupId'])) {
$custGroupId = (int) $array['custGroupId'];
//.........这里部分代码省略.........
示例10: CopyProductStep1
//.........这里部分代码省略.........
/**
* We'll need to duplicate the variation combinations here if we are NOT preserving the post
*/
if (!$PreservePost) {
$this->_CopyVariationData($arrData['productid'], 0, $GLOBALS['ProductHash']);
}
$GLOBALS['VariationCombinationList'] = $this->_LoadVariationCombinationsTable($arrData['prodvariationid'], $show_inv_fields, 0, $GLOBALS['ProductHash']);
}
if (!gzte11(ISC_HUGEPRINT)) {
$GLOBALS['HideVendorOption'] = 'display: none';
} else {
$vendorData = $GLOBALS['ISC_CLASS_ADMIN_AUTH']->GetVendor();
if (isset($vendorData['vendorid'])) {
$GLOBALS['HideVendorSelect'] = 'display: none';
$GLOBALS['CurrentVendor'] = isc_html_escape($vendorData['vendorname']);
} else {
$GLOBALS['HideVendorLabel'] = 'display: none';
$GLOBALS['VendorList'] = $this->BuildVendorSelect($arrData['prodvendorid']);
}
}
// Display the discount rules
if ($PreservePost == true) {
$GLOBALS['DiscountRules'] = $this->GetDiscountRules($prodId);
} else {
$GLOBALS['DiscountRules'] = $this->GetDiscountRules(0);
}
// Hide if we are not enabled
if (!GetConfig('BulkDiscountEnabled')) {
$GLOBALS['HideDiscountRulesWarningBox'] = '';
$GLOBALS['DiscountRulesWarningText'] = GetLang('DiscountRulesNotEnabledWarning');
$GLOBALS['DiscountRulesWithWarning'] = 'none';
// Also hide it if this product has variations
} else {
if (isset($arrData['prodvariationid']) && isId($arrData['prodvariationid'])) {
$GLOBALS['HideDiscountRulesWarningBox'] = '';
$GLOBALS['DiscountRulesWarningText'] = GetLang('DiscountRulesVariationWarning');
$GLOBALS['DiscountRulesWithWarning'] = 'none';
} else {
$GLOBALS['HideDiscountRulesWarningBox'] = 'none';
$GLOBALS['DiscountRulesWithWarning'] = '';
}
}
$GLOBALS['DiscountRulesEnabled'] = (int) GetConfig('BulkDiscountEnabled');
$GLOBALS['EventDateFieldName'] = $arrData['prodeventdatefieldname'];
if ($GLOBALS['EventDateFieldName'] == null) {
$GLOBALS['EventDateFieldName'] = GetLang('EventDateDefault');
}
if ($arrData['prodeventdaterequired'] == 1) {
$GLOBALS['EventDateRequired'] = 'checked="checked"';
$from_stamp = $arrData['prodeventdatelimitedstartdate'];
$to_stamp = $arrData['prodeventdatelimitedenddate'];
} else {
$from_stamp = isc_gmmktime(0, 0, 0, isc_date("m"), isc_date("d"), isc_date("Y"));
$to_stamp = isc_gmmktime(0, 0, 0, isc_date("m") + 1, isc_date("d"), isc_date("Y"));
}
if ($arrData['prodeventdatelimited'] == 1) {
$GLOBALS['LimitDates'] = 'checked="checked"';
}
$GLOBALS['LimitDateOption1'] = '';
$GLOBALS['LimitDateOption2'] = '';
$GLOBALS['LimitDateOption3'] = '';
switch ($arrData['prodeventdatelimitedtype']) {
case 1:
$GLOBALS['LimitDateOption1'] = 'selected="selected"';
break;
case 2:
$GLOBALS['LimitDateOption2'] = 'selected="selected"';
break;
case 3:
$GLOBALS['LimitDateOption3'] = 'selected="selected"';
break;
}
// Set the global variables for the select boxes
$from_day = isc_date("d", $from_stamp);
$from_month = isc_date("m", $from_stamp);
$from_year = isc_date("Y", $from_stamp);
$to_day = isc_date("d", $to_stamp);
$to_month = isc_date("m", $to_stamp);
$to_year = isc_date("Y", $to_stamp);
$GLOBALS['OverviewFromDays'] = $this->_GetDayOptions($from_day);
$GLOBALS['OverviewFromMonths'] = $this->_GetMonthOptions($from_month);
$GLOBALS['OverviewFromYears'] = $this->_GetYearOptions($from_year);
$GLOBALS['OverviewToDays'] = $this->_GetDayOptions($to_day);
$GLOBALS['OverviewToMonths'] = $this->_GetMonthOptions($to_month);
$GLOBALS['OverviewToYears'] = $this->_GetYearOptions($to_year);
if (!$GLOBALS['ISC_CLASS_ADMIN_AUTH']->HasPermission(AUTH_Create_Category)) {
$GLOBALS['HideCategoryCreation'] = 'display: none';
}
$GLOBALS['SaveAndAddAnother'] = GetLang('SaveAndAddAnother');
$GLOBALS["ISC_CLASS_TEMPLATE"]->SetTemplate("product.form");
$GLOBALS["ISC_CLASS_TEMPLATE"]->ParseTemplate();
} else {
// The product doesn't exist
if ($GLOBALS["ISC_CLASS_ADMIN_AUTH"]->HasPermission(AUTH_Manage_Products)) {
$this->ManageProducts(GetLang('ProductDoesntExist'), MSG_ERROR);
} else {
$GLOBALS['ISC_CLASS_ADMIN_ENGINE']->DoHomePage(GetLang('Unauthorized'), MSG_ERROR);
}
}
}
示例11: ShowPaymentForm
/**
* Generate the payment form to collect payment details and pass them back
* to the payment provider.
*
* @return string The generated payment form.
*/
public function ShowPaymentForm()
{
// Authorize.net needs HTTPS, so if it's not on then stop
if (!strtolower($_SERVER['HTTPS']) == "on") {
ob_end_clean();
?>
<script type="text/javascript">
alert("<?php
echo GetLang('AuthorizeNetNoSSLError');
?>
");
document.location.href="<?php
echo $GLOBALS['ShopPath'];
?>
/checkout.php?action=confirm_order";
</script>
<?php
die;
}
$GLOBALS['AuthorizeNetMonths'] = "";
$GLOBALS['AuthorizeNetYears'] = "";
for ($i = 1; $i <= 12; $i++) {
$stamp = mktime(0, 0, 0, $i, 15, isc_date("Y"));
$i = str_pad($i, 2, "0", STR_PAD_LEFT);
if (@$_POST['AuthorizeNet_ccexpm'] == $i) {
$sel = 'selected="selected"';
} else {
$sel = "";
}
$GLOBALS['AuthorizeNetMonths'] .= sprintf("<option %s value='%s'>%s</option>", $sel, $i, isc_date("M", $stamp));
}
for ($i = isc_date("Y"); $i < isc_date("Y") + 10; $i++) {
if (@$_POST['AuthorizeNet_ccexpy'] == substr($i, 2, 2)) {
$sel = 'selected="selected"';
} else {
$sel = "";
}
$GLOBALS['AuthorizeNetYears'] .= sprintf("<option %s value='%s'>%s</option>", $sel, substr($i, 2, 2), $i);
}
$require_cvv2 = $this->GetValue("requirecvv2");
if ($require_cvv2 == "YES") {
if (isset($_POST['AuthorizeNet_cccode'])) {
$GLOBALS['AuthorizeNetCCV2'] = (int) $_POST['AuthorizeNet_cccode'];
}
$GLOBALS['AuthorizeNetHideCVV2'] = '';
} else {
$GLOBALS['AuthorizeNetHideCVV2'] = 'none';
}
// Grab the billing details for the order
$billingDetails = $this->GetBillingDetails();
$GLOBALS['AuthorizeNetName'] = isc_html_escape($billingDetails['ordbillfirstname'] . ' ' . $billingDetails['ordbilllastname']);
$GLOBALS['AuthorizeNetBillingAddress'] = isc_html_escape($billingDetails['ordbillstreet1']);
if ($billingDetails['ordbillstreet2'] != "") {
$GLOBALS['AuthorizeNetBillingAddress'] .= " " . isc_html_escape($billingDetails['ordbillstreet2']);
}
$GLOBALS['AuthorizeNetCity'] = isc_html_escape($billingDetails['ordbillsuburb']);
if ($billingDetails['ordbillstateid'] != 0 && GetStateISO2ById($billingDetails['ordbillstateid'])) {
$GLOBALS['AuthorizeNetState'] = GetStateISO2ById($billingDetails['ordbillstateid']);
} else {
$GLOBALS['AuthorizeNetState'] = isc_html_escape($billingDetails['ordbillstate']);
}
$GLOBALS['AuthorizeNetBillingZip'] = isc_html_escape($billingDetails['ordbillzip']);
// Format the amount that's going to be going through the gateway
$GLOBALS['OrderAmount'] = CurrencyConvertFormatPrice($this->GetGatewayAmount());
// Was there an error validating the payment? If so, pre-fill the form fields with the already-submitted values
if ($this->HasErrors()) {
$GLOBALS['AuthorizeNetName'] = isc_html_escape($_POST['AuthorizeNet_name']);
$GLOBALS['AuthorizeNetNum'] = isc_html_escape($_POST['AuthorizeNet_ccno']);
$GLOBALS['AuthorizeNetBillingAddress'] = isc_html_escape($_POST['AuthorizeNet_ccaddress']);
$GLOBALS['AuthorizeNetCity'] = isc_html_escape($_POST['AuthorizeNet_cccity']);
$GLOBALS['AuthorizeNetState'] = isc_html_escape($_POST['AuthorizeNet_ccstate']);
$GLOBALS['AuthorizeNetBillingZip'] = isc_html_escape($_POST['AuthorizeNet_zip']);
$GLOBALS['AuthorizeNetErrorMessage'] = implode("<br />", $this->GetErrors());
} else {
// Hide the error message box
$GLOBALS['HideAuthorizeNetError'] = "none";
}
// Collect their details to send through to Authorize.NET
$GLOBALS['ISC_CLASS_TEMPLATE']->SetTemplate("authorizenet");
return $GLOBALS['ISC_CLASS_TEMPLATE']->ParseTemplate(true);
}
示例12: ViewOrderDetails
//.........这里部分代码省略.........
$GLOBALS['OrderComments'] = '';
if($row['ordcustmessage'] != '') {
$GLOBALS['OrderComments'] = nl2br(isc_html_escape($row['ordcustmessage']));
}
else {
$GLOBALS['HideOrderComments'] = 'display: none';
}
if(OrderIsComplete($row['ordstatus'])) {
if (!gzte11(ISC_LARGEPRINT)) {
$GLOBALS['DisableReturnButton'] = "none";
}
if ($row['ordstatus'] == 4 || GetConfig('EnableReturns') == 0) {
$GLOBALS['DisableReturnButton'] = "none";
}
$GLOBALS['HideOrderStatus'] = "none";
$orderComplete = true;
}
else {
$GLOBALS['HideOrderStatus'] = '';
$GLOBALS['OrderStatus'] = $row['ordstatustext'];
$GLOBALS['DisableReturnButton'] = "none";
$orderComplete = false;
}
// Hide print order invoive if it's a incomplete order
$GLOBALS['ShowOrderActions'] = '';
if(!$row['ordstatus']) {
$GLOBALS['ShowOrderActions'] = 'display:none';
}
$GLOBALS['OrderDate'] = isc_date(GetConfig('ExtendedDisplayDateFormat'), $row['orddate']);
$GLOBALS['OrderTotal'] = CurrencyConvertFormatPrice($row['total_inc_tax'], $row['ordcurrencyid'], $row['ordcurrencyexchangerate'], true);
// Format the billing address
$GLOBALS['ShipFullName'] = isc_html_escape($row['ordbillfirstname'].' '.$row['ordbilllastname']);
$GLOBALS['ShipCompany'] = '';
if($row['ordbillcompany']) {
$GLOBALS['ShipCompany'] = '<br />'.isc_html_escape($row['ordbillcompany']);
}
$GLOBALS['ShipAddressLines'] = isc_html_escape($row['ordbillstreet1']);
if ($row['ordbillstreet2'] != "") {
$GLOBALS['ShipAddressLines'] .= '<br />' . isc_html_escape($row['ordbillstreet2']);
}
$GLOBALS['ShipSuburb'] = isc_html_escape($row['ordbillsuburb']);
$GLOBALS['ShipState'] = isc_html_escape($row['ordbillstate']);
$GLOBALS['ShipZip'] = isc_html_escape($row['ordbillzip']);
$GLOBALS['ShipCountry'] = isc_html_escape($row['ordbillcountry']);
$GLOBALS['ShipPhone'] = "";
$GLOBALS['BillingAddress'] = $GLOBALS['ISC_CLASS_TEMPLATE']->GetSnippet("AddressLabel");
// Is there a shipping address, or is it a digital download?
if ($order['ordisdigital']) {
$GLOBALS['HideSingleShippingAddress'] = 'display: none';
}
else if ($order['shipping_address_count'] > 1) {
$GLOBALS['ShippingAddress'] = GetLang('OrderWillBeShippedToMultipleAddresses');
$GLOBALS['HideItemDetailsHeader'] = 'display:none;';
}
else {
示例13: SetPanelSettings
public function SetPanelSettings()
{
$_SESSION['you_save'] = 0;
//blessen
$GLOBALS['SNIPPETS']['CartItems'] = "";
$count = 0;
$subtotal = 0;
$_SESSION['CHECKOUT'] = array();
// Get a list of all products in the cart
$GLOBALS['ISC_CLASS_CART'] = GetClass('ISC_CART');
$product_array = $GLOBALS['ISC_CLASS_CART']->api->GetProductsInCart();
/* $cprint = print_r($product_array, true);
$q = "INSERT INTO isc_orderlogs (`ordervalue`) VALUES ('$cprint')";
$r = $GLOBALS["ISC_CLASS_DB"]->Query($q); */
$GLOBALS['AdditionalCheckoutButtons'] = '';
// Go through all the checkout modules looking for one with a GetSidePanelCheckoutButton function defined
$ShowCheckoutButton = false;
if (!empty($product_array)) {
foreach (GetAvailableModules('checkout', true, true) as $module) {
if (isset($module['object']->_showBothButtons) && $module['object']->_showBothButtons) {
$ShowCheckoutButton = true;
$GLOBALS['AdditionalCheckoutButtons'] .= $module['object']->GetCheckoutButton();
} elseif (method_exists($module['object'], 'GetCheckoutButton')) {
$GLOBALS['AdditionalCheckoutButtons'] .= $module['object']->GetCheckoutButton();
} else {
$ShowCheckoutButton = true;
}
}
}
$GLOBALS['HideMultipleAddressShipping'] = 'display: none';
if (gzte11(ISC_MEDIUMPRINT) && $GLOBALS['ISC_CLASS_CART']->api->GetNumPhysicalProducts() > 1 && $ShowCheckoutButton && GetConfig("MultipleShippingAddresses")) {
$GLOBALS['HideMultipleAddressShipping'] = '';
}
$GLOBALS['HideCheckoutButton'] = '';
if (!$ShowCheckoutButton) {
$GLOBALS['HideCheckoutButton'] = 'display: none';
$GLOBALS['HideMultipleAddressShippingOr'] = 'display: none';
}
$wrappingOptions = $GLOBALS['ISC_CLASS_DATA_STORE']->Read('GiftWrapping');
if (empty($wrappingOptions)) {
$publicWrappingOptions = false;
} else {
$publicWrappingOptions = true;
}
if (!GetConfig('ShowThumbsInCart')) {
$GLOBALS['HideThumbColumn'] = 'display: none';
$GLOBALS['ProductNameSpan'] = 2;
} else {
$GLOBALS['HideThumbColumn'] = '';
$GLOBALS['ProductNameSpan'] = 1;
}
$wrappingAdjustment = 0;
$itemTotal = 0;
$comptotal = 0;
# To get all the complementary product total -- Baskaran
$compprice = 0;
foreach ($product_array as $k => $product) {
$GLOBALS['CartItemId'] = (int) $product['cartitemid'];
// If the item in the cart is a gift certificate, we need to show a special type of row
if (isset($product['type']) && $product['type'] == "giftcertificate") {
$GLOBALS['GiftCertificateName'] = isc_html_escape($product['data']['prodname']);
$GLOBALS['GiftCertificateAmount'] = CurrencyConvertFormatPrice($product['giftamount']);
$GLOBALS['GiftCertificateTo'] = isc_html_escape($product['certificate']['to_name']);
$GLOBALS["Quantity" . $product['quantity']] = 'selected="selected"';
$GLOBALS['ProductPrice'] = CurrencyConvertFormatPrice($product['giftamount']);
$GLOBALS['ProductTotal'] = CurrencyConvertFormatPrice($product['giftamount'] * $product['quantity']);
$itemTotal += $product['giftamount'] * $product['quantity'];
$GLOBALS['SNIPPETS']['CartItems'] .= $GLOBALS['ISC_CLASS_TEMPLATE']->GetSnippet("CartItemGiftCertificate");
} else {
$GLOBALS['ProductLink'] = ProdLink($product['data']['prodname']);
$GLOBALS['ProductAvailability'] = isc_html_escape($product['data']['prodavailability']);
$GLOBALS['ItemId'] = (int) $product['data']['productid'];
$GLOBALS['VariationId'] = (int) $product['variation_id'];
$GLOBALS['ProductQuantity'] = (int) $product['quantity'];
//blessen
$GLOBALS['prodretailprice'] = CurrencyConvertFormatPrice($product['data']['prodretailprice']);
if ($product['data']['prodretailprice'] > $product['data']['prodcalculatedprice']) {
$_SESSION['you_save'] += ($product['data']['prodretailprice'] - $product['data']['prodcalculatedprice']) * $product['quantity'];
}
//$GLOBALS['saveprice'] = CurrencyConvertFormatPrice($product['data']['prodretailprice'] - $product['data']['prodcalculatedprice']);
//blessen
// Should we show thumbnails in the cart?
if (GetConfig('ShowThumbsInCart')) {
$GLOBALS['ProductImage'] = ImageThumb($product['data']['imagefile'], ProdLink($product['data']['prodname']));
}
$GLOBALS['UpdateCartQtyJs'] = "Cart.UpdateQuantity(this.options[this.selectedIndex].value);";
$GLOBALS['HideCartProductFields'] = 'display:none;';
$GLOBALS['CartProductFields'] = '';
$this->GetProductFieldDetails($product['product_fields'], $k);
$GLOBALS['EventDate'] = '';
if (isset($product['event_date'])) {
$GLOBALS['EventDate'] = '<div style="font-style: italic; font-size:10px; color:gray">(' . $product['event_name'] . ': ' . isc_date('M jS Y', $product['event_date']) . ')</div>';
}
// Can this product be wrapped?
$GLOBALS['GiftWrappingName'] = '';
$GLOBALS['HideGiftWrappingAdd'] = '';
$GLOBALS['HideGiftWrappingEdit'] = 'display: none';
$GLOBALS['HideGiftWrappingPrice'] = 'display: none';
$GLOBALS['GiftWrappingPrice'] = '';
$GLOBALS['GiftMessagePreview'] = '';
//.........这里部分代码省略.........
示例14: _Validate
protected function _Validate($data = array())
{
if(empty($data)) {
//if this is a control panel manual payment
if(isset($_POST['paymentField'][$this->GetId()])) {
$data=$_POST['paymentField'][$this->GetId()];
//store front normal checkout
} else {
$data=$_POST;
}
}
$validatedVariables = array();
// Check for HTTPS if its required
if(!strtolower($_SERVER['HTTPS']) == "on") {
ob_end_clean();
?>
<script type="text/javascript">
alert("<?php echo GetLang($this->_languagePrefix.'NoSSLError'); ?>");
document.location.href="<?php echo $GLOBALS['ShopPath']; ?>/checkout.php?action=confirm_order";
</script>
<?php
die();
}
//basic required credit card fields
$requiredFields = array(
"creditcard_cctype" => GetLang('CreditCardSelectCardType'),
"creditcard_name" => GetLang('CreditCardEnterName'),
"creditcard_ccno" => GetLang('CreditCardEnterCardNumber'),
"creditcard_ccexpm" => GetLang('CreditCardEnterCreditCardMonth'),
"creditcard_ccexpy" => GetLang('CreditCardEnterCreditCardYear'),
);
foreach($requiredFields as $field => $message) {
if(!isset($data[$field]) || trim($data[$field]) == '') {
$this->SetError($message);
return false;
}
}
//if CVV2 is required
if($this->CardTypeRequiresCVV2($data['creditcard_cctype'])) {
if(!isset($data['creditcard_cccvd']) || trim($data['creditcard_cccvd']) == '') {
$this->SetError(GetLang('CreditCardEnterCardCode'));
return false;
}
}
//if issue date/number is required
if($this->CardTypeRequiresIssueNoOrDate($data['creditcard_cctype'])) {
//if issue number is invalid
if((!isset($data['creditcard_issueno']) || !is_numeric($data['creditcard_issueno']))) {
// and if issue date is invalid
if(!isset($data['creditcard_issuedatem']) || !is_numeric($data['creditcard_issuedatem']) || !isset($data['creditcard_issuedatey']) || !is_numeric($data['creditcard_issuedatey'])) {
$this->SetError(GetLang('CreditCardEnterIssueNoOrDate'));
return false;
}
}
}
//if issue date is required
if($this->CardTypeHasIssueDate($data['creditcard_cctype']) && $this->CardTypeRequiresIssueDate($_POST['creditcard_cctype'])) {
if(!isset($data['creditcard_issuedatey']) || trim($data['creditcard_issuedatey']) == '') {
$this->SetError(GetLang('CreditCardSelectCreditCardIssueYear'));
return false;
}
if(!isset($data['creditcard_issuedatem']) || trim($data['creditcard_issuedatem']) == '') {
$this->SetError(GetLang('CreditCardSelectCreditCardIssueMonth'));
return false;
}
}
//if issue No is required
if($this->CardTypeHasIssueNo($data['creditcard_issueno']) && $this->CardTypeRequiresIssueNo($data['creditcard_cctype'])) {
if(!isset($data['creditcard_issueno']) || trim($data['creditcard_issueno']) == '') {
$this->SetError(GetLang('CreditCardSelectCreditCardIssueNo'));
return false;
}
}
//check if credit card expired.
$currentMY = isc_mktime(0, 0, 0, isc_date('m')+1, 0, isc_date('y'));
$cardMY = isc_mktime(0, 0, 0, $data['creditcard_ccexpm']+1, 0, $data['creditcard_ccexpy']);
if ($currentMY > $cardMY) {
$this->SetError(GetLang('CreditCardExpired'));
return false;
}
$validatedVariables['cctype'] = $data['creditcard_cctype'];
$validatedVariables['name'] = $data['creditcard_name'];
$validatedVariables['ccno'] = $data['creditcard_ccno'];
$validatedVariables['ccissueno'] = $data['creditcard_issueno'];
$validatedVariables['ccissuedatem'] = $data['creditcard_issuedatem'];
$validatedVariables['ccissuedatey'] = $data['creditcard_issuedatey'];
$validatedVariables['cccvd'] = $data['creditcard_cccvd'];
$validatedVariables['ccexpm'] = $data['creditcard_ccexpm'];
$validatedVariables['ccexpy'] = $data['creditcard_ccexpy'];
//.........这里部分代码省略.........
示例15: loadProductComments
private function loadProductComments($productId)
{
$GLOBALS['ProductId'] = $productId;
// Are there any reviews for this product? If so, load them
if ($GLOBALS['ISC_CLASS_PRODUCT']->GetNumReviews() == 0) {
$GLOBALS['NoReviews'] = GetLang('NoReviews');
}
else {
// Setup paging data
$reviewsTotal = $GLOBALS['ISC_CLASS_PRODUCT']->GetNumReviews();
$reviewsPerPage = GetConfig('ProductReviewsPerPage');
$pages = ceil($reviewsTotal / $reviewsPerPage);
$revpage = 1;
$start = 0;
if (isset($_GET['revpage'])) {
$revpage = (int)$_GET['revpage'];
}
if ($revpage < 1) {
$revpage = 1;
}
elseif ($revpage > $pages) {
$revpage = $pages;
}
$start = ($revpage - 1) * $reviewsPerPage;
$GLOBALS['ProductNumReviews'] = $reviewsTotal;
$GLOBALS['ReviewStart'] = $start + 1;
$GLOBALS['ReviewEnd'] = $start + $reviewsPerPage;
// do we need to show paging?
if ($pages > 1) {
// Form the previous and next links
$reviewLink = ProdLink($GLOBALS['ISC_CLASS_PRODUCT']->GetProductName());
if($GLOBALS['EnableSEOUrls'] == 1) {
$reviewLink .= '?revpage=';
}
else {
$reviewLink .= '&revpage=';
}
if ($GLOBALS['ReviewEnd'] > $reviewsTotal) {
$GLOBALS['ReviewEnd'] = $reviewsTotal;
}
// show a previous link
if ($revpage > 1) {
$GLOBALS["ReviewLink"] = $reviewLink . ($revpage - 1);
$GLOBALS["PrevRevLink"] = $GLOBALS['ISC_CLASS_TEMPLATE']->GetSnippet("ProductReviewPreviousLink");
}
// show a next link
if ($revpage < $pages) {
$GLOBALS["ReviewLink"] = $reviewLink . ($revpage + 1);
$GLOBALS["NextRevLink"] = $GLOBALS['ISC_CLASS_TEMPLATE']->GetSnippet("ProductReviewNextLink");
}
$GLOBALS['ProductReviewPaging'] = $GLOBALS['ISC_CLASS_TEMPLATE']->GetSnippet("ProductReviewPaging");
}
// Load all reviews for this product
$query = "
SELECT *
FROM [|PREFIX|]reviews
WHERE revproductid='".(int)$GLOBALS['ISC_CLASS_PRODUCT']->GetProductId()."' AND revstatus='1'
ORDER BY revdate DESC
";
$query .= $GLOBALS['ISC_CLASS_DB']->AddLimit($start, $reviewsPerPage);
$result = $GLOBALS['ISC_CLASS_DB']->Query($query);
$GLOBALS['ProductReviews'] = "";
$GLOBALS['AlternateReviewClass'] = '';
$GLOBALS['ReviewNumber'] = $GLOBALS['ReviewStart'];
while ($row = $GLOBALS['ISC_CLASS_DB']->Fetch($result)) {
$GLOBALS['ReviewRating'] = (int) $row['revrating'];
$GLOBALS['ReviewTitle'] = isc_html_escape($row['revtitle']);
$GLOBALS['ReviewDate'] = isc_date(GetConfig('DisplayDateFormat'), $row['revdate']);
if ($row['revfromname'] != "") {
$GLOBALS['ReviewName'] = isc_html_escape($row['revfromname']);
} else {
$GLOBALS['ReviewName'] = GetLang('Unknown');
}
$GLOBALS['ReviewText'] = nl2br(isc_html_escape($row['revtext']));
$GLOBALS['ProductReviews'] .= $GLOBALS['ISC_CLASS_TEMPLATE']->GetSnippet("ProductReviewItem");
++$GLOBALS['ReviewNumber'];
if($GLOBALS['AlternateReviewClass']) {
$GLOBALS['AlternateReviewClass'] = '';
}
else {
$GLOBALS['AlternateReviewClass'] = 'Alt';
}
}
//.........这里部分代码省略.........