示例#1
0
function CheckExternalIPForm()
{
    global $db, $exip_id;
    if (!isset($_GET["external_ip_ip"])) {
        return false;
    }
    if ($_GET["external_ip_ip"] == '') {
        MessageBox("Неуказан IP!");
        return false;
    }
    if ($row = $db->Query_Fetch_Array("SELECT id FROM external_ip WHERE ip=inet_aton('" . $_GET["external_ip_ip"] . "')" . (isset($exip_id) ? " AND id!=" . $exip_id : ''))) {
        MessageBox("IP " . urldecode($_GET["external_ip_ip"]) . " уже присвоен в другом месте!");
        return false;
    }
    if ($_GET["external_ip_location"] == 0) {
        MessageBox("Не выбрана локация!");
        return false;
    }
    if (!isset($exip_id)) {
        MessageBox("Внешний IP присвоен");
    } else {
        MessageBox("Информация о внешнем IP успешно изменена");
    }
    return true;
}
示例#2
0
		/**
		 * Checkout class constructor. Does the setup of some member variables.
		 *
		 * @return void
		 */
		public function __construct()
		{
			// Setup the required variables for the PayPal checkout module
			parent::__construct();

			$this->xmlUrl = $GLOBALS['ShopPathSSL'].'/modules/checkout/googlecheckout/xml.php';

			$this->_name = GetLang('GoogleCheckoutName');
			$this->_image = "google_checkout.gif";
			$this->_description = GetLang('GoogleCheckoutDesc');
			$this->_help = sprintf(GetLang('GoogleCheckoutHelp'), $this->xmlUrl);
			$this->_height = 0;

			if ($this->GetValue('testmode') === 'YES') {
				$this->_server_type = 'sandbox';
			} else {
				$this->_server_type = 'production';
			}

			if (GetConfig('TaxTypeSelected') == 1 && GetConfig('PricesIncludeTax') == 1) {
				$this->_help .= MessageBox(GetLang('GoogleCheckoutTaxWarning'), MSG_ERROR);
			}

			require_once(dirname(__FILE__).'/library/googlerequest.php');
			$this->request = new GoogleRequest($this->GetValue('merchantid'), $this->GetValue('merchanttoken'), $this->_server_type, $this->GetDefaultCurrencyCode());

			include_once(dirname(__FILE__).'/library/googleshipping.php');
			$this->defaultZoneGFilter = new GoogleShippingFilters();
			$this->defaultZoneGFilter->SetAllowedWorldArea(true);
		}
示例#3
0
	/**
	 * Custom step 2 code specific to product importing. Calls the parent ImportStep2 funciton.
	 */
	protected function _ImportStep2($MsgDesc="", $MsgStatus="")
	{
		// Set up generic import options
		if ($MsgDesc != "") {
			$GLOBALS['Message'] = MessageBox($MsgDesc, $MsgStatus);
		}
		$this->ImportSession['updateOrderStatus'] = $_POST['updateOrderStatus'];
		parent::_ImportStep2();
	}
示例#4
0
function CheckAction()
{
    global $db;
    if (isset($_GET["id"]) && $_GET["id"] > 0 && isset($_GET["action"]) && $_GET["action"] == "full_delete") {
        $db->Query("DELETE FROM groups WHERE id='" . $_GET["id"] . "'");
        MessageBox("Группа удалёна");
        return false;
    }
    return true;
}
示例#5
0
 public function ClearanceList($MsgDesc = "", $MsgStatus = "")
 {
     $GLOBALS['Message'] = GetFlashMessageBoxes();
     $GLOBALS['HideErrorMessage'] = 'none';
     if ($MsgDesc != "") {
         $GLOBALS['Message'] = MessageBox($MsgDesc, $MsgStatus);
     }
     $GLOBALS['ISC_CLASS_TEMPLATE']->SetTemplate("clearance");
     $GLOBALS['ISC_CLASS_TEMPLATE']->ParseTemplate();
 }
示例#6
0
function CheckAction()
{
    global $db;
    if (isset($_GET["id"]) && $_GET["id"] > 0 && isset($_GET["action"]) && $_GET["action"] == "full_delete") {
        $db->Query("DELETE FROM external_ip WHERE id='" . $_GET["id"] . "'");
        MessageBox("Внешний IP больше ничему не соответсвует");
        return false;
    }
    return true;
}
示例#7
0
function CheckAction()
{
    global $db;
    if (isset($_GET["id"]) && $_GET["id"] > 0 && isset($_GET["action"]) && $_GET["action"] == "full_delete") {
        $db->Query("DELETE FROM users WHERE id='" . $_GET["id"] . "'");
        MessageBox("Пользователь удалён");
        return false;
    }
    return true;
}
示例#8
0
		public function ManageFormFields($msgDesc='', $msgStatus='')
		{
			if ($msgDesc !== '') {
				$GLOBALS['Message'] = MessageBox($msgDesc, $msgStatus);
			}

			$flashMessages = GetFlashMessages();

			if (is_array($flashMessages) && !empty($flashMessages)) {
				$GLOBALS['Message'] = '';
				foreach ($flashMessages as $flashMessage) {
					$GLOBALS['Message'] .= MessageBox($flashMessage['message'], $flashMessage['type']);
				}
			}

			$GLOBALS['FormFieldsGrid'] = $this->ManageFormFieldsGrid();
			$GLOBALS['FormFieldsAddField'] = sprintf(GetLang('FormFieldsAddField'), GetLang('FormFieldsSectionAccount'));
			$GLOBALS['FormFieldsOptions'] = '';
			$availableFields = $GLOBALS['ISC_CLASS_FORM']->getAvailableFields();

			if (is_array($availableFields)) {
				foreach ($availableFields as $name => $desc) {
					$GLOBALS['FormFieldsOptions'] .= '<li><a href="#" onclick="AddFormField(\'' . isc_html_escape($name) . '\'); return false;" style="background-image:url(\'images/fields/' . $desc['img'] . '\'); background-repeat:no-repeat; background-position:5px 5px; padding-left:28px; width:auto;">' . isc_html_escape($desc['name']) . '</a></li>';
				}
			}

			$GLOBALS['FormFieldsSectionAccount'] = sprintf(GetLang('FormFieldsSectionTab'), GetLang('FormFieldsSectionAccount'));
			$GLOBALS['FormFieldsSectionAddress'] = sprintf(GetLang('FormFieldsSectionTab'), GetLang('FormFieldsSectionAddress'));

			$GLOBALS['FormFieldsAccountFormId'] = FORMFIELDS_FORM_ACCOUNT;
			$GLOBALS['FormFieldsAddressFormId'] = FORMFIELDS_FORM_ADDRESS;

			if(!gzte11(ISC_MEDIUMPRINT)) {
				$GLOBALS['HideFormFieldsButtons'] = 'display: none';
			}

			$GLOBALS['FormFieldsHideAddButton'] = '';
			if (!$GLOBALS["ISC_CLASS_ADMIN_AUTH"]->HasPermission(AUTH_Add_FormFields) || !gzte11(ISC_MEDIUMPRINT)) {
				$GLOBALS['FormFieldsHideAddButton'] = 'none';
			}

			$GLOBALS['FormFieldsHideDeleteButton'] = '';
			if (!$GLOBALS["ISC_CLASS_ADMIN_AUTH"]->HasPermission(AUTH_Delete_FormFields) || !gzte11(ISC_MEDIUMPRINT)) {
				$GLOBALS['FormFieldsHideDeleteButton'] = 'none';
			}

			$GLOBALS['FormFieldsIsSortable'] = '';
			if ($GLOBALS["ISC_CLASS_ADMIN_AUTH"]->HasPermission(AUTH_Manage_FormFields)) {
				$GLOBALS['FormFieldsIsSortable'] = '1';
			}

			$this->template->display('formfields.manage.tpl');
		}
 /**
  * Allows management of templates in the store by listing existing templates and providing add/edit/delete functions
  *
  */
 private function ManageTemplates()
 {
     $GLOBALS['TemplatesGrid'] = $this->BuildTemplatesGrid();
     $GLOBALS['Message'] = GetFlashMessageBoxes();
     if (empty($GLOBALS['TemplatesGrid'])) {
         // There aren't any templates, show a message so they can create one
         $GLOBALS['Message'] = MessageBox(GetLang('NoExportTemplates'), MSG_SUCCESS);
         $GLOBALS['DisableDelete'] = "DISABLED";
         $GLOBALS['Title'] = GetLang('ManageExportTemplates');
         $GLOBALS['ManageExportTemplatesIntro'] = GetLang('ManageExportTemplatesIntro');
     }
     $GLOBALS["ISC_CLASS_TEMPLATE"]->SetTemplate("exporttemplates.manage");
     $GLOBALS["ISC_CLASS_TEMPLATE"]->ParseTemplate();
 }
示例#10
0
文件: login.php 项目: newmen/vedro
function Login($msg = '')
{
    $challenge = rand();
    session_register(S_ID . "_challenge");
    $_SESSION[S_ID . "_challenge"]["random"] = $challenge;
    echo "<html>\n" . "<head>\n" . "<meta HTTP-EQUIV=\"Content-Type\" CONTENT=\"text/html; charset=utf-8\" />\n" . "<title>" . TITLE . " :: Кто здесь??</title>\n" . "<link rel=\"stylesheet\" type=\"text/css\" href=\"/templates/design.css\" />\n" . "<script src=\"js/md5.js\" type=\"text/javascript\"></script>\n" . "<script type=\"text/javascript\">\n" . "function Change()\n" . "{\n" . "    document.login.challenge.value = hex_md5(document.login.challenge.value + hex_md5(document.login.pswd.value));\n" . "    document.login.pswd.value = '';\n" . "    return true;\n" . "}\n" . "function SetFocus()\n" . "{\n";
    if (isset($_GET["name"])) {
        echo "\tdocument.login.name.select();\n";
    }
    echo "\tdocument.login.name.focus();\n" . "}\n" . "</script>\n" . "</head>\n" . "<body onLoad=\"SetFocus()\">\n" . "<table style='background-color: #ffffff;' cellspacing=0 cellpadding=0 border=0 width=100% height=100%>\n" . "    <tr height=30% valign=\"center\">\n" . "\t<td width=23% align=\"center\">" . GetImage("./templates/pngs/", 97, 150) . "</td>\n" . "\t<td width=54% rowspan=3 align=\"center\">\n";
    if ($msg != '') {
        MessageBox($msg);
    }
    echo "\t    <form name=\"login\" action=\"\" method=\"GET\" onSubmit=\"Change()\">\n" . "\t    <input type=\"hidden\" name=\"challenge\" value=\"" . $challenge . "\">" . "\t    <table class=\"clogin\" cellspacing=0 cellpadding=0 border=0 width=500 height=200>\n" . "\t    \t<tr valign=\"center\">" . "    \t\t    <td colspan=4 width=100% align=\"left\"><h4>&nbsp;&nbsp;Кто здесь?!</h4></td>\n" . "    \t\t</tr>\n" . "\t    \t<tr class=\"clogin\" valign=\"center\">\n" . "\t    \t    <td> </td>\n" . "    \t\t    <td width=40% class=\"cloginint\" align=\"right\">Логин:&nbsp;</td>\n" . "\t\t    <td width=50% align=\"left\"><input class=\"clogininttable\" type=\"text\" name=\"name\" size=15 maxlength=20";
    if (isset($_GET["name"])) {
        echo " value=\"" . $_GET["name"] . "\"";
    }
    echo "></td>\n" . "\t\t    <td width=10%> </td>\n" . "\t    \t</tr>\n" . "\t\t<tr class=\"clogin\"><td colspan=2> </td></tr>\n" . "\t    \t<tr class=\"clogin\" valign=\"center\">\n" . "\t    \t    <td> </td>\n" . "\t    \t    <td class=\"cloginint\" align=\"right\">Пароль:&nbsp;</td>\n" . " \t   \t    <td align=\"left\"><input class=\"clogininttable\" type=\"password\" name=\"pswd\" size=15 maxlength=20></td>\n" . "\t\t    <td> </td>\n" . "\t    \t</tr>\n" . "\t    \t<tr valign=\"center\">\n" . "\t    \t    <td colspan=4 align=\"center\"><input class=\"clogininttable\" style=\"font-size: 20px; width: 240;\" type=\"submit\" value=\"Войти!\"></td>\n" . "\t    \t</tr>\n" . "\t    </table>\n" . "\t    </form>\n" . "\t<td width=23% align=\"center\" align='center'> </td>\n" . "    </tr>\n" . "    <tr height=50% valign=\"bottom\">\n" . "\t<td width=23% rowspan=2 align=\"center\"> </td>\n" . "\t\t<td align='center'>" . "<a href='http://vedro.skynet/'>" . GetImage("./templates/logos/", 1) . "</a>" . "\t\t</td>" . "    </tr>\n" . "<tr height=10% valign='center'>" . "\t<td align=\"center\" valign='bottom'><div style='font-size: 18px;'><a href='http://vedro.skynet/'>vedro.skynet</a></div><br /></td>\n" . "     </tr>" . "</table>\n" . "</body>\n" . "</html>";
}
示例#11
0
 private function DisplayReport($MsgDesc = "", $MsgStatus = "")
 {
     $GLOBALS['HideErrorMessage'] = 'none';
     if ($MsgDesc != "") {
         $GLOBALS['Message'] = MessageBox($MsgDesc, $MsgStatus);
     }
     $GLOBALS['ISC_CLASS_CUSTOMER'] = GetClass('ISC_CUSTOMER');
     $GLOBALS['customerid'] = $GLOBALS['ISC_CLASS_CUSTOMER']->GetCustomerId();
     if ($GLOBALS['customerid'] != '') {
         $GLOBALS['DisplayList'] = '';
         $GLOBALS['DisplayLogin'] = '******';
     } else {
         $GLOBALS['DisplayList'] = 'none';
         $GLOBALS['DisplayLogin'] = '';
     }
     $GLOBALS['DefectReportTitle'] = GetLang('ReportaDefect');
     $GLOBALS['ISC_CLASS_TEMPLATE']->SetPageTitle(sprintf("%s - %s", GetConfig('StoreName'), GetLang('DefectReport')));
     $GLOBALS['ISC_CLASS_TEMPLATE']->SetTemplate("displayreport");
     $GLOBALS['ISC_CLASS_TEMPLATE']->ParseTemplate();
 }
示例#12
0
function CheckLocateForm()
{
    global $db, $locate_id;
    if (!isset($_GET["locations_name"])) {
        return false;
    }
    if ($_GET["locations_name"] == '') {
        MessageBox("Неуказано название!");
        return false;
    }
    if ($row = $db->Query_Fetch_Array("SELECT id FROM locations WHERE name='" . urldecode($_GET["locations_name"]) . "'" . (isset($locate_id) ? " AND id!=" . $locate_id : ''))) {
        MessageBox("Локация " . urldecode($_GET["locations_name"]) . " уже существует!");
        return false;
    }
    if (!isset($locate_id)) {
        MessageBox("Локация добавлена");
    } else {
        MessageBox("Локация успешно изменёна");
    }
    return true;
}
示例#13
0
 public function manageWishList($MsgDesc = "", $MsgStatus = "")
 {
     // Fetch any results, place them in the data grid
     $numMake = 0;
     $GLOBALS['WishListDataGrid'] = $this->ManageWishListGrid($numMake);
     // Was this an ajax based sort? Return the table now
     if (isset($_REQUEST['ajax']) && $_REQUEST['ajax'] == 1) {
         echo $GLOBALS['WishListDataGrid'];
         return;
     }
     if ($MsgDesc != "") {
         $GLOBALS['Message'] = MessageBox($MsgDesc, $MsgStatus);
     }
     $GLOBALS['WishListIntro'] = GetLang('ManageWishListIntro');
     // No results
     if ($numMake == 0) {
         $GLOBALS['DisplayGrid'] = "none";
         $GLOBALS['Message'] = MessageBox(GetLang('NoWishList'), MSG_SUCCESS);
     }
     $GLOBALS["ISC_CLASS_TEMPLATE"]->SetTemplate("wishlist.manage");
     $GLOBALS["ISC_CLASS_TEMPLATE"]->ParseTemplate();
 }
示例#14
0
	/**
	 * Show the "Edit Vendor" form.
	 */
	private function EditVendor()
	{
		$GLOBALS['Message'] = GetFlashMessageBoxes();
		$vendor = $this->GetVendorData($_REQUEST['vendorId']);

		// If the vendor doesn't exist, show an error message
		if(!isset($vendor['vendorid'])) {
			FlashMessage(GetLang('InvalidVendor'), MSG_ERROR, 'index.php?ToDo=viewVendors');
		}

		// Set up the form title and action
		$GLOBALS['FormAction']	= 'SaveUpdatedVendor';
		if ($GLOBALS['ISC_CLASS_ADMIN_AUTH']->HasPermission(AUTH_Manage_Vendors)) {
			$GLOBALS['Title']		= GetLang('EditVendor');
		}
		else {
			$GLOBALS['Title']		= GetLang('VendorProfile');
		}
		$GLOBALS['Intro']		= GetLang('EditVendorIntro');

		// Set the form values
		$GLOBALS['VendorId']		= (int)$vendor['vendorid'];
		$GLOBALS['VendorName']		= isc_html_escape($vendor['vendorname']);
		$GLOBALS['VendorPhone']		= isc_html_escape($vendor['vendorphone']);
		$GLOBALS['VendorAddress']	= isc_html_escape($vendor['vendoraddress']);
		$GLOBALS['VendorCity']		= isc_html_escape($vendor['vendorcity']);
		$GLOBALS['VendorZip']		= isc_html_escape($vendor['vendorzip']);
		$GLOBALS['CountryList']		= GetCountryList($vendor['vendorcountry']);
		$GLOBALS['VendorEmail']		= isc_html_escape($vendor['vendoremail']);
		$GLOBALS['VendorState']		= isc_html_escape($vendor['vendorstate']);

		$vendorLogoSize = GetConfig('VendorLogoSize');
		if(!$vendorLogoSize) {
			$GLOBALS['HideLogoUpload'] = 'display: none';
		}
		else {
			$GLOBALS['HideCurrentVendorLogo'] = 'display: none';
			if($vendor['vendorlogo']) {
				$GLOBALS['HideCurrentVendorLogo'] = '';
				$GLOBALS['CurrentVendorLogoLink'] = GetConfig('ShopPath').'/'.GetConfig('ImageDirectory').'/'.isc_html_escape($vendor['vendorlogo']);
				$GLOBALS['CurrentVendorLogo'] = isc_html_escape($vendor['vendorlogo']);
			}
		}

		$vendorPhotoSize = GetConfig('VendorPhotoSize');
		if(!$vendorPhotoSize) {
			$GLOBALS['HidePhotoUpload'] = 'display: none';
		}
		else {
			$GLOBALS['HideCurrentVendorPhoto'] = 'display: none';
			if($vendor['vendorphoto']) {
				$GLOBALS['HideCurrentVendorPhoto'] = '';
				$GLOBALS['CurrentVendorPhotoLink'] = GetConfig('ShopPath').'/'.GetConfig('ImageDirectory').'/'.isc_html_escape($vendor['vendorphoto']);
				$GLOBALS['CurrentVendorPhoto'] = isc_html_escape($vendor['vendorphoto']);
			}
		}

		if($vendor['vendororderemail'] != '') {
			$GLOBALS['VendorForwardInvoices'] = 'checked="checked"';
			$GLOBALS['VendorOrderEmail'] = isc_html_escape($vendor['vendororderemail']);
		}
		else {
			$GLOBALS['HideForwardInvoiceEmails'] = 'display: none';
		}

		$GLOBALS['VendorProfitMargin'] = number_format($vendor['vendorprofitmargin'], GetConfig('DecimalPlaces'), GetConfig('DecimalToken'), '');

		// Vendor has configured shipping
		if($vendor['vendorshipping'] == 1) {
			$GLOBALS['VendorShippingCustom'] = 'checked="checked"';
			$GLOBALS['HideStoreMethodsList'] = 'display: none';

			// Fetch any shipping methods set up
			$GLOBALS['HideShippingNotConfigured'] = 'display: none';

			// Fetch any shipping zones, place them in the data grid
			$GLOBALS['ISC_CLASS_ADMIN_SETTINGS_SHIPPING'] = GetClass('ISC_ADMIN_SETTINGS_SHIPPING');
			$GLOBALS['ShippingZonesGrid'] = $GLOBALS['ISC_CLASS_ADMIN_SETTINGS_SHIPPING']->ManageShippingZonesGrid($numZones);

			// No shipping zones have been configured yet
			if($numZones == 0) {
				$GLOBALS['DisableDeleteZones'] = 'disabled="disabled"';
				$GLOBALS['DisplayZoneGrid'] = "none";
				$GLOBALS['NoZonesMessage'] = MessageBox(GetLang('NoShippingZones'), MSG_SUCCESS);
			}

		}
		// Using store shipping
		else {
			$GLOBALS['VendorShippingDefault'] = 'checked="checked"';
			$GLOBALS['HideShippingZonesGrid'] = 'display: none';
		}

		// Fetch a list of the shipping methods available for the entire store
		$GLOBALS['StoreShippingMethods'] = $this->GetStoreShippingMethods();

		if($GLOBALS['ISC_CLASS_ADMIN_AUTH']->GetVendorId() > 0) {
			$GLOBALS['HidePermissions'] = 'display: none';
		}
		// Showing the permissions table, so generate the list for that
		else {
			$GLOBALS['HidePermissions'] = '';

			$accessibleCategories = '';
			if($vendor['vendoraccesscats']) {
				$accessibleCategories = explode(',', $vendor['vendoraccesscats']);
				$accessibleCategories = array_map('intval', $accessibleCategories);
			}

			if(empty($accessibleCategories)) {
				$GLOBALS['AccessAllCategories'] = 'checked="checked"';
				$GLOBALS['HideAccessCategories'] = 'display: none';
			}

			$categoryClass = GetClass('ISC_ADMIN_CATEGORY');
			$GLOBALS['AccessCategoryOptions'] = $categoryClass->GetCategoryOptions($accessibleCategories,  "<option %s value='%d'>%s</option>", 'selected="selected"', "", false);
		}

		$stateOptions = GetStatesByCountryNameAsOptions($vendor['vendorcountry'], $numStates, $vendor['vendorstate']);

		if ($numStates > 0) {
			// Show the states dropdown list
			$GLOBALS['StateList'] = $stateOptions;
			$GLOBALS['HideStateBox'] = 'display: none';
		}
		else {
			// Show the states text box
			$GLOBALS['HideStateList'] = 'display: none';
		}
		// Initialize the WYSIWYG editor
		$wysiwygOptions = array(
			'id'		=> 'wysiwyg',
			'width'		=> '100%',
			'height'	=> '500px',
			'value'		=> $vendor['vendorbio']
		);
		$GLOBALS['WYSIWYG'] = GetClass('ISC_ADMIN_EDITOR')->GetWysiwygEditor($wysiwygOptions);

		$GLOBALS['SaveAndAddAnother'] = GetLang('SaveAndContinueEditing');
		$this->template->display('vendor.form.tpl');
	}
 public function CopyProductStep1($MsgDesc = "", $MsgStatus = "", $PreservePost = false, $OriginalProductID = 0)
 {
     if ($MsgDesc != "") {
         $GLOBALS['Message'] = MessageBox($MsgDesc, $MsgStatus);
     }
     // Show the form to edit a product
     if (isset($_REQUEST['productId']) && isId($_REQUEST['productId'])) {
         $OriginalProductID = $_REQUEST['productId'];
     }
     $prodId = $OriginalProductID;
     $z = 0;
     $arrData = array();
     $arrImages = array();
     $arrCustomFields = array();
     if (GetConfig('CurrencyLocation') == 'right') {
         $GLOBALS['CurrencyTokenLeft'] = '';
         $GLOBALS['CurrencyTokenRight'] = GetConfig('CurrencyToken');
     } else {
         $GLOBALS['CurrencyTokenLeft'] = GetConfig('CurrencyToken');
         $GLOBALS['CurrencyTokenRight'] = '';
     }
     $GLOBALS['ServerFiles'] = $this->_GetImportFilesOptions();
     $GLOBALS['ISC_CLASS_ADMIN_CATEGORY'] = GetClass('ISC_ADMIN_CATEGORY');
     // Make sure the product exists
     if (ProductExists($prodId)) {
         if ($PreservePost == true) {
             $this->_GetProductData(0, $arrData);
             $this->_GetCustomFieldData(0, $arrCustomFields);
             $GLOBALS['ProductFields'] = $this->_GetProductFieldsLayout(0, true);
             // Restore the hash
             $GLOBALS['ProductHash'] = $arrData['prodhash'];
         } else {
             $this->_GetProductData($prodId, $arrData);
             $this->_GetCustomFieldData($prodId, $arrCustomFields);
             $GLOBALS['ProductFields'] = $this->_GetProductFieldsLayout($prodId, true);
             // Generate the hash
             $GLOBALS['ProductHash'] = md5(time() . uniqid(rand(), true));
             // We'll need to duplicate (copy) the thumbnail, images and download files here
             $this->_CopyProductImages($prodId, 0, $GLOBALS['ProductHash']);
             $this->_CopyDownloads($prodId, 0, $GLOBALS['ProductHash']);
             $arrData['prodname'] = GetLang('CopyOf') . $arrData['prodname'];
         }
         // Does this user have permission to edit this product?
         if ($GLOBALS['ISC_CLASS_ADMIN_AUTH']->GetVendorId() && $arrData['prodvendorid'] != $GLOBALS['ISC_CLASS_ADMIN_AUTH']->GetVendorId()) {
             FlashMessage(GetLang('Unauthorized'), MSG_ERROR, 'index.php?ToDo=viewProducts');
         }
         $arrImages = $this->_GetImageData(0, $GLOBALS['ProductHash']);
         if (isset($_POST['currentTab'])) {
             $GLOBALS['CurrentTab'] = (int) $_POST['currentTab'];
         } else {
             $GLOBALS['CurrentTab'] = 0;
         }
         $GLOBALS['FormAction'] = 'copyProduct2';
         $GLOBALS['Title'] = GetLang('CopyProductTitle');
         $GLOBALS['Intro'] = GetLang('CopyProductIntro');
         $GLOBALS["ProdType_" . $arrData['prodtype']] = 'checked="checked"';
         $GLOBALS['ProdType'] = $arrData['prodtype'] - 1;
         $GLOBALS['ProdCode'] = isc_html_escape($arrData['prodcode']);
         $GLOBALS['ProdName'] = isc_html_escape($arrData['prodname']);
         $GLOBALS['OriginalProductId'] = $OriginalProductID;
         $visibleCategories = array();
         if ($GLOBALS['ISC_CLASS_ADMIN_AUTH']->GetVendorId()) {
             $vendorData = $GLOBALS['ISC_CLASS_ADMIN_AUTH']->GetVendor();
             if ($vendorData['vendoraccesscats']) {
                 $visibleCategories = explode(',', $vendorData['vendoraccesscats']);
             }
         }
         //				$GLOBALS['CategoryOptions'] = $GLOBALS['ISC_CLASS_ADMIN_CATEGORY']->GetCategoryOptions($arrData['prodcats'], "<option %s value='%d'>%s</option>", "selected='selected'", "", false, '', $visibleCategories);
         $GLOBALS['CategoryOptions'] = $GLOBALS['ISC_CLASS_ADMIN_CATEGORY']->GetCategoryOptionsProduct($arrData['prodcats'], "<option %s value='%d' id='category_old%d'>%s</option>", "selected='selected'", "", false, '', $visibleCategories);
         $GLOBALS['RelatedCategoryOptions'] = $GLOBALS['ISC_CLASS_ADMIN_CATEGORY']->GetCategoryOptions(0, "<option %s value='%d'>%s</option>", "selected='selected'", "- ", false);
         //blessen
         $wysiwygOptions = array('id' => 'wysiwyg', 'width' => '60%', 'height' => '350px', 'value' => $arrData['proddesc']);
         $wysiwygOptions1 = array('id' => 'wysiwyg1', 'width' => '60%', 'height' => '350px', 'value' => $arrData['prodmfg']);
         $wysiwygOptions2 = array('id' => 'wysiwyg2', 'width' => '60%', 'height' => '350px', 'value' => $arrData['prodwarranty']);
         $GLOBALS['WYSIWYG'] = GetClass('ISC_ADMIN_EDITOR')->GetWysiwygEditor($wysiwygOptions);
         $GLOBALS['WYSIWYG1'] = GetClass('ISC_ADMIN_EDITOR')->GetWysiwygEditor1($wysiwygOptions1);
         $GLOBALS['WYSIWYG2'] = GetClass('ISC_ADMIN_EDITOR')->GetWysiwygEditor1($wysiwygOptions2);
         $GLOBALS['ProdSearchKeywords'] = isc_html_escape($arrData['prodsearchkeywords']);
         $GLOBALS['ProdAvailability'] = isc_html_escape($arrData['prodavailability']);
         $GLOBALS['ProdPrice'] = number_format($arrData['prodprice'], GetConfig('DecimalPlaces'), GetConfig('DecimalToken'), "");
         if (CFloat($arrData['prodcostprice']) > 0) {
             $GLOBALS['ProdCostPrice'] = number_format($arrData['prodcostprice'], GetConfig('DecimalPlaces'), GetConfig('DecimalToken'), "");
         }
         if (CFloat($arrData['prodretailprice']) > 0) {
             $GLOBALS['ProdRetailPrice'] = number_format($arrData['prodretailprice'], GetConfig('DecimalPlaces'), GetConfig('DecimalToken'), "");
         }
         if (CFloat($arrData['prodsaleprice']) > 0) {
             $GLOBALS['ProdSalePrice'] = number_format($arrData['prodsaleprice'], GetConfig('DecimalPlaces'), GetConfig('DecimalToken'), "");
         }
         $GLOBALS['ProdSortOrder'] = $arrData['prodsortorder'];
         if ($arrData['prodvisible'] == 1) {
             $GLOBALS['ProdVisible'] = "checked";
         }
         if ($arrData['prodfeatured'] == 1) {
             $GLOBALS['ProdFeatured'] = "checked";
         }
         if ($GLOBALS['ISC_CLASS_ADMIN_AUTH']->GetVendorId()) {
             $GLOBALS['HideStoreFeatured'] = 'display: none';
         } else {
             if (!gzte11(ISC_HUGEPRINT) || !$arrData['prodvendorid']) {
                 $GLOBALS['HideVendorFeatured'] = 'display: none';
             }
         }
         if ($arrData['prodvendorfeatured'] == 1) {
             $GLOBALS['ProdVendorFeatured'] = 'checked="checked"';
         }
         if ($arrData['prodistaxable'] == 1) {
             $GLOBALS['ProdIsTaxable'] = 'checked';
         }
         if ($arrData['prodallowpurchases'] == 1) {
             $GLOBALS['ProdAllowPurchases'] = 'checked="checked"';
         } else {
             if ($arrData['prodhideprice'] == 1) {
                 $GLOBALS['ProdHidePrice'] = 'checked="checked"';
             }
             $GLOBALS['ProdCallForPricingLabel'] = isc_html_escape($arrData['prodcallforpricinglabel']);
         }
         $GLOBALS['MoreImages'] = "MoreImages();";
         for ($i = 1; $i <= $arrImages['numImages']; $i++) {
             $image = sprintf("../%s/%s", GetConfig('ImageDirectory'), $arrImages["image" . $i]);
             if ($i == 1) {
                 $GLOBALS["ImageMessage" . $i] = sprintf(GetLang('EditImageDesc'), $image, $arrImages["image" . $i]);
             } else {
                 $GLOBALS["ImageMessage" . $i] = sprintf(GetLang('EditImageDesc2'), $arrImages["id" . $i], $arrImages["id" . $i], $arrImages["id" . $i], $image, $arrImages["image" . $i], $arrImages["id" . $i]);
             }
         }
         if (isset($arrImages['thumb'])) {
             $thumb = sprintf("../%s/%s", GetConfig('ImageDirectory'), $arrImages['thumb']);
             $GLOBALS['ThumbMessage'] = sprintf(GetLang('EditImageDesc'), $thumb, $arrImages['thumb']);
         }
         //blessen
         //$GLOBALS['ProdWarranty'] = $arrData['prodwarranty'];
         //$GLOBALS['prod_instruction'] = $arrData['prod_instruction'];
         //$GLOBALS['prod_article'] = $arrData['prod_article'];
         $GLOBALS['ProdWeight'] = number_format($arrData['prodweight'], GetConfig('DecimalPlaces'), GetConfig('DecimalToken'), "");
         if (CFloat($arrData['prodwidth']) > 0) {
             $GLOBALS['ProdWidth'] = number_format($arrData['prodwidth'], GetConfig('DecimalPlaces'), GetConfig('DecimalToken'), "");
         }
         if (CFloat($arrData['prodheight']) > 0) {
             $GLOBALS['ProdHeight'] = number_format($arrData['prodheight'], GetConfig('DecimalPlaces'), GetConfig('DecimalToken'), "");
         }
         if (CFloat($arrData['proddepth']) > 0) {
             $GLOBALS['ProdDepth'] = number_format($arrData['proddepth'], GetConfig('DecimalPlaces'), GetConfig('DecimalToken'), "");
         }
         if (CFloat($arrData['prodfixedshippingcost']) > 0) {
             $GLOBALS['ProdFixedShippingCost'] = number_format($arrData['prodfixedshippingcost'], GetConfig('DecimalPlaces'), GetConfig('DecimalToken'), "");
         }
         if ($arrData['prodfreeshipping'] == 1) {
             $GLOBALS['FreeShipping'] = 'checked="checked"';
         }
         if ($arrData['prodrelatedproducts'] == -1) {
             $GLOBALS['IsProdRelatedAuto'] = 'checked="checked"';
         } else {
             if (isset($arrData['prodrelated'])) {
                 $GLOBALS['RelatedProductOptions'] = "";
                 foreach ($arrData['prodrelated'] as $r) {
                     $GLOBALS['RelatedProductOptions'] .= sprintf("<option value='%d'>%s</option>", (int) $r[0], isc_html_escape($r[1]));
                 }
             }
         }
         $GLOBALS['ProdTags'] = $arrData['prodtags'];
         $GLOBALS['CurrentStockLevel'] = $arrData['prodcurrentinv'];
         $GLOBALS['LowStockLevel'] = $arrData['prodlowinv'];
         $GLOBALS["InvTrack_" . $arrData['prodinvtrack']] = 'checked="checked"';
         $GLOBALS['WrappingOptions'] = $this->BuildGiftWrappingSelect(explode(',', $arrData['prodwrapoptions']));
         $GLOBALS['HideGiftWrappingOptions'] = 'display: none';
         if ($arrData['prodwrapoptions'] == 0) {
             $GLOBALS['WrappingOptionsDefaultChecked'] = 'checked="checked"';
         } else {
             if ($arrData['prodwrapoptions'] == -1) {
                 $GLOBALS['WrappingOptionsNoneChecked'] = 'checked="checked"';
             } else {
                 $GLOBALS['HideGiftWrappingOptions'] = '';
                 $GLOBALS['WrappingOptionsCustomChecked'] = 'checked="checked"';
             }
         }
         if ($arrData['prodinvtrack'] == 1) {
             $GLOBALS['OptionButtons'] = "ToggleProductInventoryOptions(true);";
         } else {
             $GLOBALS['OptionButtons'] = "ToggleProductInventoryOptions(false);";
         }
         if ($arrData['prodoptionsrequired'] == 1) {
             $GLOBALS['OptionsRequired'] = 'checked="checked"';
         }
         if ($arrData['prodtype'] == 1) {
             $GLOBALS['HideProductInventoryOptions'] = "none";
         }
         $GLOBALS['EnterOptionPrice'] = sprintf(GetLang('EnterOptionPrice'), GetConfig('CurrencyToken'), GetConfig('CurrencyToken'));
         $GLOBALS['EnterOptionWeight'] = sprintf(GetLang('EnterOptionWeight'), GetConfig('WeightMeasurement'));
         $GLOBALS['HideCustomFieldLink'] = "none";
         if (GetConfig('PricesIncludeTax')) {
             $GLOBALS['PriceMsg'] = GetLang('IncTax');
         } else {
             $GLOBALS['PriceMsg'] = GetLang('ExTax');
         }
         $GLOBALS['CustomFields'] = '';
         $GLOBALS['CustomFieldKey'] = 0;
         if (!empty($arrCustomFields)) {
             foreach ($arrCustomFields as $f) {
                 $GLOBALS['CustomFieldName'] = isc_html_escape($f['name']);
                 $GLOBALS['CustomFieldValue'] = isc_html_escape($f['value']);
                 $GLOBALS['CustomFieldLabel'] = $this->GetFieldLabel($GLOBALS['CustomFieldKey'] + 1, GetLang('CustomField'));
                 if (!$GLOBALS['CustomFieldKey']) {
                     $GLOBALS['HideCustomFieldDelete'] = 'none';
                 } else {
                     $GLOBALS['HideCustomFieldDelete'] = '';
                 }
                 $GLOBALS['CustomFields'] .= $GLOBALS['ISC_CLASS_TEMPLATE']->GetSnippet('CustomFields');
                 $GLOBALS['CustomFieldKey']++;
             }
         }
         // Add one more custom field
         $GLOBALS['CustomFieldName'] = '';
         $GLOBALS['CustomFieldValue'] = '';
         $GLOBALS['CustomFieldLabel'] = $this->GetFieldLabel($GLOBALS['CustomFieldKey'] + 1, GetLang('CustomField'));
         if (!$GLOBALS['CustomFieldKey']) {
             $GLOBALS['HideCustomFieldDelete'] = 'none';
         } else {
             $GLOBALS['HideCustomFieldDelete'] = '';
         }
         $GLOBALS['CustomFields'] .= $GLOBALS['ISC_CLASS_TEMPLATE']->GetSnippet('CustomFields');
         if ($this->HasGD()) {
             $GLOBALS['ShowGDThumb'] = "";
             $GLOBALS['ShowNoGDThumb'] = "none";
         } else {
             $GLOBALS['ShowGDThumb'] = "none";
             $GLOBALS['ShowNoGDThumb'] = "";
         }
         // Get a list of any downloads associated with this product
         $GLOBALS['DownloadsGrid'] = $this->GetDownloadsGrid(0, $GLOBALS['ProductHash']);
         $GLOBALS['ISC_LANG']['MaxUploadSize'] = sprintf(GetLang('MaxUploadSize'), GetMaxUploadSize());
         if ($GLOBALS['DownloadsGrid'] == '') {
             $GLOBALS['DisplayDownloaadGrid'] = "none";
         }
         // Get the brands as select options
         $GLOBALS['ISC_CLASS_ADMIN_BRANDS'] = GetClass('ISC_ADMIN_BRANDS');
         $GLOBALS['BrandNameOptions'] = $GLOBALS['ISC_CLASS_ADMIN_BRANDS']->GetBrandsAsOptions($arrData['prodbrandid']);
         $GLOBALS['SaveAndAddAnother'] = GetLang('SaveAndAddAnother');
         // Get a list of all layout files
         $layoutFile = 'product.html';
         if ($arrData['prodlayoutfile'] != '') {
             $layoutFile = $arrData['prodlayoutfile'];
         }
         $GLOBALS['LayoutFiles'] = GetCustomLayoutFilesAsOptions("product.html", $layoutFile);
         $GLOBALS['ProdPageTitle'] = isc_html_escape($arrData['prodpagetitle']);
         $GLOBALS['ProdMetaKeywords'] = isc_html_escape($arrData['prodmetakeywords']);
         $GLOBALS['ProdMetaDesc'] = isc_html_escape($arrData['prodmetadesc']);
         $GLOBALS['SaveAndAddAnother'] = GetLang('SaveAndAddAnother');
         if (!gzte11(ISC_MEDIUMPRINT)) {
             $GLOBALS['HideInventoryOptions'] = "none";
         } else {
             $GLOBALS['HideInventoryOptions'] = '';
         }
         // Does this product have a variation assigned to it?
         $GLOBALS['ProductVariationExisting'] = $arrData['prodvariationid'];
         if ($arrData['prodvariationid'] > 0) {
             $GLOBALS['IsYesVariation'] = 'checked="checked"';
         } else {
             $GLOBALS['IsNoVariation'] = 'checked="checked"';
             $GLOBALS['HideVariationList'] = "none";
             $GLOBALS['HideVariationCombinationList'] = "none";
         }
         // If there are no variations then disable the option to choose one
         $numVariations = 0;
         $GLOBALS['VariationOptions'] = $this->GetVariationsAsOptions($numVariations, $arrData['prodvariationid']);
         if ($numVariations == 0) {
             $GLOBALS['VariationDisabled'] = "DISABLED";
             $GLOBALS['VariationColor'] = "#CACACA";
             $GLOBALS['IsNoVariation'] = 'checked="checked"';
             $GLOBALS['IsYesVariation'] = "";
             $GLOBALS['HideVariationCombinationList'] = "none";
         } else {
             // Load the variation combinations
             if ($arrData['prodinvtrack'] == 2) {
                 $show_inv_fields = true;
             } else {
                 $show_inv_fields = false;
             }
             /**
              * 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);
         }
     }
 }
 private function editcabsize($MsgDesc = "", $MsgStatus = "")
 {
     if (isset($_GET['cabId'])) {
         if ($MsgDesc != "") {
             $GLOBALS['Message'] = MessageBox($MsgDesc, $MsgStatus);
         }
         $cabId = (int) $_GET['cabId'];
         $query = sprintf("select * from [|PREFIX|]cabsize_translation where id='%d'", $GLOBALS['ISC_CLASS_DB']->Quote($cabId));
         $result = $GLOBALS["ISC_CLASS_DB"]->Query($query);
         if ($row = $GLOBALS["ISC_CLASS_DB"]->Fetch($result)) {
             $GLOBALS['cabId'] = $row['id'];
             $GLOBALS['ProdstartyearEdit'] = isc_html_escape($row['prodstartyear']);
             $GLOBALS['ProdendyearEdit'] = isc_html_escape($row['prodendyear']);
             $GLOBALS['ProdmakeEdit'] = isc_html_escape($row['prodmake']);
             $GLOBALS['ProdmodelEdit'] = isc_html_escape($row['prodmodel']);
             $GLOBALS['IrregularEdit'] = isc_html_escape($row['irregular_value']);
             $GLOBALS['GeneralizeEdit'] = isc_html_escape($row['generalize_value']);
             $GLOBALS['FormAction'] = "SaveEditedCabsizesettings";
             $GLOBALS["ISC_CLASS_TEMPLATE"]->SetTemplate("cabsize.edit.form");
             $GLOBALS["ISC_CLASS_TEMPLATE"]->ParseTemplate();
         } else {
             ob_end_clean();
             header("Location: index.php?ToDo=viewCabsizeSettings");
             die;
         }
     } else {
         ob_end_clean();
         header("Location: index.php?ToDo=viewCabsizeSettings");
         die;
     }
 }
示例#17
0
		/**
		*	Add a new shipping address to the customer's account
		*/
		private function AddShippingAddress($MsgDesc = "", $MsgStatus = "")
		{
			$GLOBALS['HideAddShippingAddressMessage'] = 'none';
			if ($MsgDesc !== '') {
				$GLOBALS['HideAddShippingAddressMessage'] = '';
				$GLOBALS['Message'] = MessageBox($MsgDesc, $MsgStatus);
			}

			$GLOBALS['ShipCustomFields'] = buildFieldData();
			$GLOBALS['AddressFormFieldID'] = FORMFIELDS_FORM_ADDRESS;
			$GLOBALS['ShippingAddressFormAction'] = "save_new_shipping_address";
			$GLOBALS['ShippingAddressFormTitle'] = GetLang('AddShippingAddress');
			$GLOBALS['ShippingAddressFormIntro'] = GetLang('AddShippingAddressIntro');

			/**
			 * Load up any form field JS event data and any validation lang variables
			 */
			$GLOBALS['FormFieldRequiredJS'] = $GLOBALS['ISC_CLASS_FORM']->buildRequiredJS();

			$GLOBALS['ISC_CLASS_TEMPLATE']->SetPageTitle(GetConfig('StoreName') . " - " . GetLang('AddShippingAddress'));
			$GLOBALS['ISC_CLASS_TEMPLATE']->SetTemplate("shippingaddressform");
			$GLOBALS['ISC_CLASS_TEMPLATE']->ParseTemplate();
		}
 private function ShowCategoryRows($MsgDesc = "", $MsgStatus = "")
 {
     if ($MsgDesc != "") {
         $GLOBALS['Message'] = MessageBox($MsgDesc, $MsgStatus);
     }
     //For Department Options Added by Simha
     $GLOBALS['DeptFilterOptions'] = $this->getDepartmentList();
     if (!isset($_REQUEST['deptid'])) {
         $_REQUEST['deptid'] = $this->firstdept;
     }
     //For Department Options  Ends Added by Simha
     $GLOBALS['ShopPath'] = GetConfig('ShopPath');
     $GLOBALS['CategoryGrid'] = $this->_BuildCategoryRows(0);
     if (!empty($GLOBALS['CategoryGrid'])) {
         /*$GLOBALS["ISC_CLASS_TEMPLATE"]->SetTemplate("qvaluecat.manage");
           $GLOBALS["ISC_CLASS_TEMPLATE"]->ParseTemplate(); */
         $GLOBALS["ISC_CLASS_TEMPLATE"]->SetTemplate("qvaluecat.manage.grid");
         $GLOBALS['FullCategoryGrid'] = $GLOBALS["ISC_CLASS_TEMPLATE"]->ParseTemplate(true);
         // Was this an ajax based sort? Return the table now
         if (isset($_REQUEST['ajax']) && $_REQUEST['ajax'] == 1) {
             echo $GLOBALS['FullCategoryGrid'];
             return;
         }
         $GLOBALS["ISC_CLASS_TEMPLATE"]->SetTemplate("qvaluecat.manage");
         $GLOBALS["ISC_CLASS_TEMPLATE"]->ParseTemplate();
     }
 }
 private function CreateCategory($Exists = false)
 {
     $GLOBALS['Message'] = GetFlashMessageBoxes();
     //wirror_20100804: remove the cookie CustomContentId, and fetch current CustomContentId from table category
     if (isset($_COOKIE['AddCustomContentId']) && is_numeric($_COOKIE['AddCustomContentId'])) {
         $contentId = $_COOKIE['CustomContentId'];
     } else {
         $customItem = array('contenttype' => 1, 'description' => "custom products content for category#{$catId}");
         $contentId = GetClass('ISC_ADMIN_CUSTOMCONTENTS')->createCustomContens($customItem);
     }
     setcookie("AddCustomContentId", $contentId, time() + 3600);
     //wirror_20100806: show the custom content options
     $GLOBALS['ContentOptions'] = $this->_GetContentTypeOptions();
     $GLOBALS['CustomPageAction'] = 'listCateCustomcontents&customContentId=' . $contentId;
     #wirror_20100805: hide the custom content id
     $GLOBALS['hiddenFields'] = sprintf("<input type='hidden' name='customContentId' value='%d'>", $contentId);
     // Create a new category
     $name = "";
     $cat = array();
     $cid = "";
     if (isset($_GET['parentId'])) {
         $cat[] = $_GET['parentId'];
         $cid = $_GET['parentId'];
         $GLOBALS['disabledept'] = 'disabled="disabled"';
     }
     if ($Exists) {
         // The user has tried to create a category that already exists
         $GLOBALS['Message'] = MessageBox(sprintf(GetLang('CatAlreadyExists'), $_POST['catname']), MSG_ERROR);
         $name = $_POST['catname'];
         $cat[] = $_POST['category'];
     }
     //wirror_20100806: show the custom content options
     $GLOBALS['ContentOptions'] = $this->_GetContentTypeOptions();
     $GLOBALS['CategoryName'] = $name;
     $GLOBALS['CategoryOptions'] = $this->GetCategoryOptions($cat);
     $GLOBALS['CategorySort'] = "0";
     $GLOBALS['CategorySelect'] = '<select size="5" name="catparentid" id="catparentid" class="Field750" style="height:115" onchange="HandleRootCategory();SelectDept();">';
     # Added for to display the category in the Add page -- Baskaran
     $GLOBALS['CategoryPageTitle'] = '';
     $GLOBALS['CategoryMetaKeywords'] = '';
     $GLOBALS['CategoryMetaDesc'] = '';
     /* Baskaran added starts */
     $deptquery = $GLOBALS['ISC_CLASS_DB']->Query("SELECT catdeptid FROM [|PREFIX|]categories where categoryid = '{$cid}'");
     $deptrow = $GLOBALS['ISC_CLASS_DB']->Fetch($deptquery);
     $deptid = $deptrow['catdeptid'];
     $GLOBALS['CatDeptid'] = $deptid;
     $GLOBALS['CatDepartment'] = $this->getDepartment($deptid);
     $GLOBALS['AltKeyword'] = '';
     $GLOBALS['catuserid'] = $GLOBALS['ISC_CLASS_ADMIN_AUTH']->GetUserId();
     $user = $GLOBALS['ISC_CLASS_ADMIN_AUTH']->GetUser();
     $userrole = $user['userrole'];
     $catvisible = '';
     if ($userrole == 'admin') {
         $catvisible = 1;
     } else {
         $catvisible = 2;
     }
     $GLOBALS['catvisible'] = $catvisible;
     /* Baskaran added ends */
     $wysiwygOptions = array('id' => 'wysiwyg', 'width' => '750px', 'height' => '500px');
     $wysiwygOptions1 = array('id' => 'wysiwyg1', 'width' => '60%', 'height' => '300px');
     $wysiwygOptions2 = array('id' => 'wysiwyg2', 'width' => '60%', 'height' => '300px');
     $wysiwygOptions3 = array('id' => 'wysiwyg3', 'width' => '60%', 'height' => '300px');
     $GLOBALS['WYSIWYG'] = GetClass('ISC_ADMIN_EDITOR')->GetWysiwygEditor($wysiwygOptions);
     $GLOBALS['WYSIWYG1'] = GetClass('ISC_ADMIN_EDITOR')->GetWysiwygEditor1($wysiwygOptions1);
     $GLOBALS['WYSIWYG2'] = GetClass('ISC_ADMIN_EDITOR')->GetWysiwygEditor1($wysiwygOptions2);
     $GLOBALS['WYSIWYG3'] = GetClass('ISC_ADMIN_EDITOR')->GetWysiwygEditor1($wysiwygOptions3);
     //$SelectedQualifiers = $this->GetSelectedQualifiers($catId);
     $SelectedQualifiers = 0;
     $GLOBALS['QualifierOptions'] = $this->GetQualifierOptions($SelectedQualifiers, "<option %s value='%d'>%s</option>", "selected=\"selected\"", "", false);
     $GLOBALS['FormAction'] = "saveCategory";
     $GLOBALS['CatTitle'] = GetLang('AddCatTitle');
     $GLOBALS['CatIntro'] = GetLang('AddCatIntro');
     $GLOBALS['CancelMessage'] = GetLang('CancelCreateCategory');
     if (empty($cat) || in_array("0", $cat)) {
         //$GLOBALS['DisableFileUpload'] = 'disabled="disabled"';
         $GLOBALS['ShowFileUploadMessage'] = '';
         $GLOBALS['ShowHidecatCombine'] = 'none';
     } else {
         //$GLOBALS['DisableFileUpload'] = '';
         $GLOBALS['ShowFileUploadMessage'] = 'none';
         $GLOBALS['ShowHidecatCombine'] = '';
     }
     $temp = '';
     $pnamearray = array('Category Name', 'Sub Category Name', 'Brand Name', 'Series Name', 'Part Number', 'Product Code', 'Product color', 'Product Material', 'Product Style');
     //$savedarray  = explode(",",$category->Productname);
     foreach ($pnamearray as $key => $value) {
         $temp .= "<option  value='" . $key . "' selected='selected' >" . $value . "</option>";
     }
     $GLOBALS['Productname'] = $temp;
     // Get a list of all layout files
     $GLOBALS['LayoutFiles'] = GetCustomLayoutFilesAsOptions("category.html");
     $GLOBALS['SaveAndAddAnother'] = GetLang('SaveAndAddAnother');
     $GLOBALS["ISC_CLASS_TEMPLATE"]->SetTemplate("category.form");
     $GLOBALS["ISC_CLASS_TEMPLATE"]->ParseTemplate();
 }
 /**
  * Generate and display the gift wrapping page.
  */
 public function ManageGiftWrapping()
 {
     $GLOBALS['Message'] = GetFlashMessageBoxes();
     // Fetch any wrapping types and place them in a data grid
     $GLOBALS['GiftWrapDataGrid'] = $this->ManageGiftWrappingGrid($numGiftWrap);
     // Was this an ajax based sort? Return the table now
     if (isset($_REQUEST['ajax']) && $_REQUEST['ajax'] == 1) {
         echo $GLOBALS['GiftWrapDataGrid'];
         return;
     }
     // No gift wrapping types have been configured yet
     if ($numGiftWrap == 0) {
         $GLOBALS['DisableDelete'] = 'disabled="disabled"';
         $GLOBALS['DisplayGrid'] = "none";
         $GLOBALS['Message'] = MessageBox(GetLang('NoGiftWrappingTypes'), MSG_SUCCESS);
     }
     $GLOBALS["ISC_CLASS_TEMPLATE"]->SetTemplate('giftwrapping.manage');
     $GLOBALS["ISC_CLASS_TEMPLATE"]->ParseTemplate();
 }
示例#21
0
		/**
		 * Edit a customer page
		 *
		 * Method will construct the edit customer page
		 *
		 * @access public
		 * @param string $MsgDesc The optional message to display
		 * @param string $MsgStatus The optional status of the message
		 * @param bool $PreservePost TRUE to use the REQUEST variable, FALSE to read from the database. Default is FALSE
		 * @return Void
		 */
		public function EditCustomerStep1($MsgDesc = "", $MsgStatus = "", $PreservePost=false)
		{
			if ($MsgDesc != "") {
				$GLOBALS['Message'] = MessageBox($MsgDesc, $MsgStatus);
			}

			$flashMessages = GetFlashMessages();
			if(is_array($flashMessages) && !empty($flashMessages)) {
				$GLOBALS['Message'] = '';
				foreach($flashMessages as $flashMessage) {
					$GLOBALS['Message'] .= MessageBox($flashMessage['message'], $flashMessage['type']);
				}
			}

			// Show the form to edit a customer
			$customerId = isc_html_escape((int)$_GET['customerId']);

			// Make sure the customer exists
			if (!CustomerExists($customerId)) {
				// The customer doesn't exist
				if ($GLOBALS["ISC_CLASS_ADMIN_AUTH"]->HasPermission(AUTH_Edit_Customers)) {
					$this->ManageCustomers(GetLang('CustomerDoesntExist'), MSG_ERROR);
				} else {
					$GLOBALS['ISC_CLASS_ADMIN_ENGINE']->DoHomePage(GetLang('Unauthorized'), MSG_ERROR);
				}
				return;
			}

			if (!$GLOBALS["ISC_CLASS_ADMIN_AUTH"]->HasPermission(AUTH_Add_Customer)) {
				$GLOBALS['CustomerAddressAddDisabled'] = 'DISABLED';
			}

			if (!$GLOBALS["ISC_CLASS_ADMIN_AUTH"]->HasPermission(AUTH_Delete_Customers)) {
				$GLOBALS['CustomerAddressDeleteDisabled'] = 'DISABLED';
			}

			if (GetConfig('CurrencyLocation') == 'right') {
				$GLOBALS['CurrencyTokenLeft'] = '';
				$GLOBALS['CurrencyTokenRight'] = GetConfig('CurrencyToken');
			} else {
				$GLOBALS['CurrencyTokenLeft'] = GetConfig('CurrencyToken');
				$GLOBALS['CurrencyTokenRight'] = '';
			}

			if ($PreservePost == true) {
				$customer = $this->_GetCustomerData(0);
			} else {
				$customer = $this->_GetCustomerData($customerId);
			}

			if (isset($_REQUEST['currentTab'])) {
				$GLOBALS['CurrentTab'] = (int)$_REQUEST['currentTab'];
			} else {
				$GLOBALS['CurrentTab'] = 0;
			}

			$query = "SELECT *
						FROM [|PREFIX|]shipping_addresses
						WHERE shipcustomerid='" . $GLOBALS['ISC_CLASS_DB']->Quote((int)$customerId) . "'";

			if ($GLOBALS['ISC_CLASS_DB']->CountResult($GLOBALS['ISC_CLASS_DB']->Query($query))) {
				$GLOBALS['CustomerAddressEmptyShow'] = 'none';
			} else {
				$GLOBALS['CustomerAddressEmptyHide'] = 'none';
			}

			$GLOBALS['FormAction'] = "editCustomer2";
			$GLOBALS['CustomerId'] = $customerId;
			$GLOBALS['Title'] = GetLang('EditCustomerTitle');
			$GLOBALS['Intro'] = GetLang('EditCustomerIntro');
			$GLOBALS['CustomerAddressListWarning'] = GetLang('CustomerAddressNoAddresses');
			$GLOBALS['CustomerFirstName'] = $customer['custconfirstname'];
			$GLOBALS['CustomerLastName'] = $customer['custconlastname'];
			$GLOBALS['CustomerCompany'] = $customer['custconcompany'];
			$GLOBALS['CustomerEmail'] = $customer['custconemail'];
			$GLOBALS['CustomerPhone'] = $customer['custconphone'];
			$GLOBALS['CustomerStoreCredit'] = FormatPrice($customer['custstorecredit'], false, false);
			$GLOBALS['CustomerGroupId'] = $customer['custgroupid'];
			$GLOBALS['CustomerGroupOptions'] = $this->GetCustomerGroupsAsOptions($customer['custgroupid']);
			$GLOBALS['CustomerShippingAddressGrid'] = $this->ManageCustomerAddressGrid();
			$GLOBALS['PasswordRequired'] = '&nbsp;&nbsp;';
			$GLOBALS['PasswordLabel'] = GetLang('CustomerNewPassword');
			$GLOBALS['PasswordHelp'] = GetLang('CustomerNewPasswordHelp');
			$GLOBALS['PasswordConfirmHelp'] = GetLang('CustomerNewPasswordConfirmHelp');
			$GLOBALS['PasswordConfirmError'] = GetLang('CustomerNewPasswordConfirmError');
			$GLOBALS['PasswordConfirmRequired'] = '&nbsp;&nbsp;';
			$GLOBALS['CustomFieldsAccountFormId'] = FORMFIELDS_FORM_ACCOUNT;
			$GLOBALS['CustomFields'] = '';

			/**
			 * Custom fields
			 */
			if (gzte11(ISC_MEDIUMPRINT)) {
				if ($PreservePost) {
					$fields = $GLOBALS['ISC_CLASS_FORM']->getFormFields(FORMFIELDS_FORM_ACCOUNT, true);
				} else if (isset($customer['custformsessionid']) && isId($customer['custformsessionid'])) {
					$fields = $GLOBALS['ISC_CLASS_FORM']->getFormFields(FORMFIELDS_FORM_ACCOUNT, false, $customer['custformsessionid']);
				} else {
					$fields = $GLOBALS['ISC_CLASS_FORM']->getFormFields(FORMFIELDS_FORM_ACCOUNT);
				}

				foreach (array_keys($fields) as $fieldId) {
					if ($fields[$fieldId]->record['formfieldprivateid'] !== '') {
						continue;
					}

					$GLOBALS['CustomFields'] .= $fields[$fieldId]->loadForFrontend() . "\n";
				}
			}

			/**
			 * Add this to generate our JS event script
			 */
			$GLOBALS['FormFieldEventData'] = $GLOBALS['ISC_CLASS_FORM']->buildRequiredJS();

			$GLOBALS['SaveAndAddAnother'] = GetLang('SaveAndContinueEditing');
			$GLOBALS['CancelMessage'] = GetLang('ConfirmCancelCustomer');
			$this->template->display('customer.form.tpl');
		}
示例#22
0
 public function DoError($MsgTitle = "", $MsgDesc = "", $MsgStatus = "")
 {
     if ($MsgTitle == "") {
         $GLOBALS['ErrorTitle'] = GetLang('Error');
     } else {
         $GLOBALS['ErrorTitle'] = $MsgTitle;
     }
     $GLOBALS['Message'] = MessageBox($MsgDesc, $MsgStatus);
     $this->PrintHeader();
     $GLOBALS["ISC_CLASS_TEMPLATE"]->SetTemplate("error");
     $GLOBALS["ISC_CLASS_TEMPLATE"]->ParseTemplate();
     $this->PrintFooter();
 }
示例#23
0
		private function updateMultiOrderStatusRequestAction()
		{
			$success = (int)@$_REQUEST['success'];
			$failed = (int)@$_REQUEST['failed'];
			$result = $GLOBALS['ISC_CLASS_DB']->Query("SELECT * FROM [|PREFIX|]order_status WHERE statusid='" . $GLOBALS['ISC_CLASS_DB']->Quote(@$_REQUEST['statusId']) . "'");

			if (isId(@$_REQUEST['orderId']) && isId(@$_REQUEST['statusId']) && ($row = $GLOBALS['ISC_CLASS_DB']->Fetch($result)) && UpdateOrderStatus($_REQUEST['orderId'], $_REQUEST['statusId'])) {
				echo '1';
				$success++;
			} else {
				echo '0';
				$failed++;
			}

			$message = sprintf(GetLang('OrderUpdateStatusReport'), $success, $row['statusdesc']);
			if ($failed) {
				$message .= sprintf(GetLang('OrderUpdateStatusReportFail'), $failed);
			}

			MessageBox($message, MSG_SUCCESS);
			exit;
		}
示例#24
0
				unset($friends[$k]);
				break;
			}
		}
		$udata['friends']=implode('|',$friends);
	}	
	
	if(!empty($udata['blacklist']))$udata['blacklist'].='|';
	$udata['blacklist'].=$tname;
	$sql="UPDATE $cfg[tb_members] SET friends='$udata[friends]',blacklist='$udata[blacklist]' WHERE u_id='$udata[u_id]' LIMIT 1";
	RenDB_Query($sql,true);
	header("Location: m_fb.php?action=view");
	exit();
	break;
case 'b_del':
	if(!In_Names($tname,$udata['blacklist'])) MessageBox('该用户不在黑名单中');
	$blacklist=explode('|',$udata['blacklist']);
	foreach($blacklist as $k=>$n)
		if( IsSameName($n,$tname))
		{
			unset($blacklist[$k]);
			break;
		}
	$udata['blacklist']=implode('|',$blacklist);
	$sql="UPDATE $cfg[tb_members] SET blacklist='$udata[blacklist]' WHERE u_id='$udata[u_id]' LIMIT 1";
	RenDB_Query($sql,true);
	header("Location: m_fb.php?action=view");
	exit();
	break;

}
 private function ShowCategoryRows($MsgDesc = "", $MsgStatus = "")
 {
     if ($MsgDesc != "") {
         $GLOBALS['Message'] = MessageBox($MsgDesc, $MsgStatus);
     }
     $GLOBALS['ShopPath'] = GetConfig('ShopPath');
     $GLOBALS['CategoryGrid'] = $this->_BuildCategoryRows(0);
     if (!empty($GLOBALS['CategoryGrid'])) {
         $GLOBALS["ISC_CLASS_TEMPLATE"]->SetTemplate("qvaluecat.manage");
         $GLOBALS["ISC_CLASS_TEMPLATE"]->ParseTemplate();
     }
 }
示例#26
0
 private function ManageDiscounts($MsgDesc = "", $MsgStatus = "")
 {
     $numDiscounts = 0;
     // Fetch any results, place them in the data grid
     $GLOBALS['DiscountsDataGrid'] = $this->ManageDiscountsGrid($numDiscounts);
     // Was this an ajax based sort? Return the table now
     if (isset($_REQUEST['ajax']) && $_REQUEST['ajax'] == 1) {
         echo $GLOBALS['DiscountsDataGrid'];
         return;
     }
     if ($MsgDesc != "") {
         $GLOBALS['Message'] = MessageBox($MsgDesc, $MsgStatus);
     }
     // Do we need to disable the delete button?
     if (!$GLOBALS["ISC_CLASS_ADMIN_AUTH"]->HasPermission(AUTH_Delete_Discounts) || $numDiscounts == 0) {
         $GLOBALS['DisableDelete'] = "DISABLED";
     }
     if ($numDiscounts == 0) {
         // There are no discounts in the database
         $GLOBALS['DisplayGrid'] = "none";
         $GLOBALS['DisplaySearch'] = "none";
         $GLOBALS['Message'] = MessageBox(GetLang('NoDiscounts'), MSG_SUCCESS);
     }
     $GLOBALS['DiscountIntro'] = GetLang('ManageDiscountIntro');
     $GLOBALS["ISC_CLASS_TEMPLATE"]->SetTemplate("discounts.manage");
     $GLOBALS["ISC_CLASS_TEMPLATE"]->ParseTemplate();
 }
示例#27
0
/**
 * Retrieve pre-built message boxes for all of the current flash messages.
 *
 * @return string The built message boxes.
 */
function GetFlashMessageBoxes()
{
    $flashMessages = GetFlashMessages();
    $messageBoxes = '';
    if (is_array($flashMessages)) {
        foreach ($flashMessages as $flashMessage) {
            $messageBoxes .= MessageBox($flashMessage['message'], $flashMessage['type']);
        }
    }
    return $messageBoxes;
}
示例#28
0
 private function ShowPaymentForm($response = '', $orderId, $amount)
 {
     # Baskaran
     $GLOBALS['OrderTitle'] = GetLang('PayOrder');
     $GLOBALS['OrderIntro'] = GetLang('PayOrderIntro');
     $GLOBALS['FormAction'] = "paymentOrder";
     $GLOBALS['OrderNo'] = $orderId;
     $GLOBALS['amount'] = CurrencyConvertFormatPrice($amount);
     $GLOBALS['OrderMonths'] = "";
     $GLOBALS['OrderYears'] = "";
     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['ccexpm'] == $i) {
             $sel = 'selected="selected"';
         } else {
             $sel = "";
         }
         $GLOBALS['OrderMonths'] .= 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['ccexpy'] == substr($i, 2, 2)) {
             $sel = 'selected="selected"';
         } else {
             $sel = "";
         }
         $GLOBALS['OrderYears'] .= 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['cc_cvv2'])) {
         $GLOBALS['CCV2'] = (int) $_POST['cc_cvv2'];
     }
     //                $GLOBALS['HideCVV2'] = '';
     /*}
       else {
           $GLOBALS['HideCVV2'] = 'none';
       } */
     if ($response != '') {
         # Baskaran
         $GLOBALS['Name'] = isc_html_escape($_POST['name']);
         $GLOBALS['Num'] = isc_html_escape($_POST['ccno']);
         //                Something went wrong when trying to process your payment. Please review the error message and try again:
         $GLOBALS['Message'] = "<div class='MessageBox MessageBoxError'>{$response}</div>";
         $GLOBALS['Message'] = MessageBox($response, MSG_ERROR);
     } else {
         // Hide the error message box
         $GLOBALS['HideAuthorizeNetError'] = "none";
     }
     $GLOBALS['Amount'] = CurrencyConvertFormatPrice($_POST['orderamount']);
     $GLOBALS['ISC_CLASS_TEMPLATE']->SetTemplate("order.repayform");
     //$GLOBALS['ISC_CLASS_TEMPLATE']->SetTemplate("authorizenet");
     $GLOBALS['ISC_CLASS_TEMPLATE']->ParseTemplate();
 }
示例#29
0
 /**
  * ManageSitemaps
  * 
  * @return Void
  */
 public function ManageSitemaps($MsgDesc = "", $MsgStatus = "")
 {
     if ($MsgDesc != "") {
         $GLOBALS["Message"] = MessageBox($MsgDesc, $MsgStatus);
     }
     if (!isset($GLOBALS["GenerateLabel"])) {
         $GLOBALS["GenerateLabel"] = GetLang('Generate');
     }
     if (isset($_POST['currentTab'])) {
         $GLOBALS["CurrentTab"] = $_POST['currentTab'];
     } else {
         $GLOBALS["CurrentTab"] = 0;
     }
     $indexArr = file_list(self::$sitemap_folder, "/\\.xml\$/i");
     $cbArr = $this->FilterArray(self::$sitemap_folder . '/category-brand', $indexArr);
     $mcbArr = $this->FilterArray(self::$sitemap_folder . '/mix-category-brand', $indexArr);
     $pbArr = $this->FilterArray(self::$sitemap_folder . '/products', $indexArr);
     $dpArr = $this->FilterArray(self::$sitemap_folder . '/dynamic-pages', $indexArr);
     $spArr = $this->FilterArray(self::$sitemap_folder . '/static-pages', $indexArr);
     if (count($cbArr) > 0) {
         $GLOBALS["CatBrandResult"] = "";
         foreach ($cbArr as $val) {
             $val = str_replace(ISC_BASE_PATH, GetConfig('ShopPath'), $val);
             $GLOBALS["CatBrandResult"] .= "<a href='{$val}'>{$val}</a><br/>";
         }
     } else {
         $GLOBALS["CatBrandResult"] = "<span style='color: red;'>You haven't generated the category-brand sitemap yet!</span>";
     }
     if (count($mcbArr) > 0) {
         $GLOBALS["MixCatBrandResult"] = "";
         foreach ($mcbArr as $val) {
             $val = str_replace(ISC_BASE_PATH, GetConfig('ShopPath'), $val);
             $GLOBALS["MixCatBrandResult"] .= "<a href='{$val}'>{$val}</a><br/>";
         }
     } else {
         $GLOBALS["MixCatBrandResult"] = "<span style='color: red;'>You haven't generated the mix-category-brand sitemap yet!</span>";
     }
     if (count($pbArr) > 0) {
         $GLOBALS["ProdBrandResult"] = "";
         foreach ($pbArr as $val) {
             $val = str_replace(ISC_BASE_PATH, GetConfig('ShopPath'), $val);
             $GLOBALS["ProdBrandResult"] .= "<a href='{$val}'>{$val}</a><br/>";
         }
     } else {
         $GLOBALS["ProdBrandResult"] = "<span style='color: red;'>You haven't generated the product-brand sitemap yet!</span>";
     }
     if (count($dpArr) > 0) {
         $GLOBALS["DynmicPageResult"] = "";
         foreach ($dpArr as $val) {
             $val = str_replace(ISC_BASE_PATH, GetConfig('ShopPath'), $val);
             $GLOBALS["DynmicPageResult"] .= "<a href='{$val}'>{$val}</a><br/>";
         }
     } else {
         $GLOBALS["DynmicPageResult"] = "<span style='color: red;'>You haven't generated the dynamic-page sitemap yet!</span>";
     }
     if (count($spArr) > 0) {
         $GLOBALS["StaticPageResult"] = "";
         if (class_exists('DOMDocument')) {
             $xml = new DOMDocument();
             $xml->load(self::$sitemap_folder . '/static-pages.xml');
             $locDom = $xml->getElementsByTagName('loc');
             foreach ($locDom as $loc) {
                 //$GLOBALS["StaticPageResult"] .= $loc->nodeValue.'&#13;&#10;';
                 $GLOBALS["StaticPageResult"] .= '<option>' . $loc->nodeValue . '</option>';
             }
         } else {
             //ini_set("display_errors","1");
             $xml = new OpXML();
             $xml->load(self::$sitemap_folder . '/static-pages.xml');
             $locDom = $xml->getElementsByTagName('loc');
             foreach ($locDom as $loc) {
                 $GLOBALS["StaticPageResult"] .= '<option>' . $loc . '</option>';
             }
         }
     } else {
         $GLOBALS["StaticPageResult"] = "<span style='color: red;'>You haven't generated the static-pages sitemap yet!</span>";
     }
     $indexSitemap = ISC_BASE_PATH . '/sitemap.xml';
     if (file_exists($indexSitemap)) {
         $indexSitemap = str_replace(ISC_BASE_PATH, GetConfig('ShopPath'), $indexSitemap);
         $GLOBALS["IndexMapResult"] = "<a href='{$indexSitemap}'>{$indexSitemap}</a>";
     } else {
         $GLOBALS["IndexMapResult"] = "<span style='color: red;'>You haven't generated the index sitemap yet!</span>";
     }
     $uQuery = "SELECT * FROM [|PREFIX|]sitemap_setting limit 0,1";
     $uResult = $GLOBALS['ISC_CLASS_DB']->Query($uQuery);
     if ($row = $GLOBALS['ISC_CLASS_DB']->Fetch($uResult)) {
         $GLOBALS["SitemapId"] = $row['id'];
         $GLOBALS["MaxmumRecords"] = $row['maxrecord'];
         $GLOBALS["IndexRootName"] = $row['indexroot'];
         $GLOBALS["NormalRootName"] = $row['normalroot'];
         $GLOBALS["IndexUrlName"] = $row['indexurl'];
         $GLOBALS["NormalUrlName"] = $row['normalurl'];
         $GLOBALS["PopularCatList"] = $row['popularcatlist'];
         //leo 2011-11-17 new setting for popular categories list
         $GLOBALS["UrlChildOption"] = $this->_GetUrlChildOption(explode(',', $row['childnodes']));
         $this->xmlConfig['IndexRoot'] = $row['indexroot'];
         $this->xmlConfig['IndexUrl'] = $row['indexurl'];
         $this->xmlConfig['NormalRoot'] = $row['normalroot'];
         $this->xmlConfig['NormalUrl'] = $row['normalurl'];
         $this->xmlConfig['childNodes'] = explode(',', $row['childnodes']);
     } else {
         $GLOBALS["SitemapId"] = $hasSetting;
         $GLOBALS["MaxmumRecords"] = "50,000";
         $GLOBALS["IndexRootName"] = "sitemapindex";
         $GLOBALS["NormalRootName"] = "urlset";
         $GLOBALS["IndexUrlName"] = "sitemap";
         $GLOBALS["NormalUrlName"] = "url";
         $GLOBALS["UrlChildOption"] = $this->_GetUrlChildOption(array('loc'));
     }
     $GLOBALS["PopularYearsStart"] = "1995";
     $GLOBALS["PopularYearsEnd"] = "2010";
     $GLOBALS["PopularCategories"] = $GLOBALS["PopularCatList"];
     //"Nerf Bars, Fender Flares - Fender Trim, Tonneau Covers, Bed Mats, Air Intakes, Bull Bars & Grille Guards, Floor Protection, Exhaust Systems, Bug Shields - Bug Deflectors, Performance Chips";
     $GLOBALS["PopularMakes"] = "Chevrolet, GMC, Ford, Dodge, Toyota, Nissan, Honda, Jeep, Hyundai, Chrysler, Infiniti, Lexus";
     $GLOBALS["ISC_CLASS_TEMPLATE"]->SetTemplate("sitemaps.manage");
     $GLOBALS["ISC_CLASS_TEMPLATE"]->ParseTemplate();
 }
示例#30
0
		private function ManageDiscounts($MsgDesc = "", $MsgStatus = "")
		{
			$numDiscounts = 0;
			// Fetch any results, place them in the data grid
			$GLOBALS['DiscountsDataGrid'] = $this->ManageDiscountsGrid($numDiscounts);

			// Was this an ajax based sort? Return the table now
			if(isset($_REQUEST['ajax']) && $_REQUEST['ajax'] == 1) {
				echo $GLOBALS['DiscountsDataGrid'];
				return;
			}

			if ($MsgDesc != "") {
				$GLOBALS['Message'] = MessageBox($MsgDesc, $MsgStatus);
			}

			// Do we need to disable the delete button?
			if (!$GLOBALS["ISC_CLASS_ADMIN_AUTH"]->HasPermission(AUTH_Delete_Discounts) || $numDiscounts == 0) {
				$GLOBALS['DisableDelete'] = "DISABLED";
			}

			if($numDiscounts == 0) {
				// There are no discounts in the database
				$GLOBALS['DisplayGrid'] = "none";
				$GLOBALS['DisplaySearch'] = "none";
				$GLOBALS['Message'] = MessageBox(GetLang('NoDiscounts'), MSG_SUCCESS);
			}

			$GLOBALS["DiscountShowNextBatchItems"] = sprintf(GetLang("DiscountShowNextBatchItems"), ISC_DISCOUNTS_PER_SHOW);
			if ($numDiscounts <= ISC_DISCOUNTS_PER_PAGE) {
				$GLOBALS["HideSeeMoreDiscountBox"] = "none";
			}

			$GLOBALS['DiscountIntro'] = GetLang('ManageDiscountIntro');

			$this->template->display('discounts.manage.tpl');
		}