Esempio n. 1
0
	public function SetPanelSettings()
	{
		$count = 0;
		$GLOBALS['SNIPPETS']['HomeFeaturedProducts'] = '';

		if (GetConfig('HomeFeaturedProducts') <= 0) {
			$this->DontDisplay = true;
			return;
		}

		if(!GetConfig('ShowProductRating')) {
			$GLOBALS['HideProductRating'] = "display: none";
		}

		$GLOBALS['AlternateClass'] = '';

		$query = $this->getProductQuery('p.prodfeatured=1', 'RAND()', getConfig('HomeFeaturedProducts'));
		$result = $GLOBALS['ISC_CLASS_DB']->Query($query);
		while($row = $GLOBALS['ISC_CLASS_DB']->Fetch($result)) {
			$this->setProductGlobals($row);
			$GLOBALS['SNIPPETS']['HomeFeaturedProducts'] .= $GLOBALS['ISC_CLASS_TEMPLATE']->GetSnippet("HomeFeaturedProductsItem");
		}

		if(!$GLOBALS['SNIPPETS']['HomeFeaturedProducts']) {
			$this->DontDisplay = true;
		}

		// Showing the syndication option?
		if(GetConfig('RSSFeaturedProducts') != 0 && GetConfig('RSSSyndicationIcons') != 0) {
			$GLOBALS['SNIPPETS']['HomeFeaturedProductsFeed'] = $GLOBALS['ISC_CLASS_TEMPLATE']->GetSnippet("HomeFeaturedProductsFeed");
		}
	}
Esempio n. 2
0
 public function SetPanelSettings()
 {
     // Do we need to show paging, etc?
     if ($GLOBALS['ISC_CLASS_PRICE']->GetNumProducts() > GetConfig('CategoryProductsPerPage')) {
         // Workout the paging data
         $GLOBALS['SNIPPETS']['PagingData'] = "";
         $num_pages_either_side_of_current = 5;
         $start = max($GLOBALS['ISC_CLASS_PRICE']->GetPage() - $num_pages_either_side_of_current, 1);
         $end = min($GLOBALS['ISC_CLASS_PRICE']->GetPage() + $num_pages_either_side_of_current, $GLOBALS['ISC_CLASS_PRICE']->GetNumPages());
         for ($page = $start; $page <= $end; $page++) {
             if ($page == $GLOBALS['ISC_CLASS_PRICE']->GetPage()) {
                 $snippet = "PricePagingItemCurrent";
             } else {
                 $snippet = "PricePagingItem";
             }
             $GLOBALS['PageLink'] = PriceLink($GLOBALS['ISC_CLASS_PRICE']->GetMinPrice(), $GLOBALS['ISC_CLASS_PRICE']->GetMaxPrice(), $GLOBALS['CatId'], $GLOBALS['ISC_CLASS_PRICE']->GetCatPath(), array("page" => $page, "sort" => $GLOBALS['ISC_CLASS_PRICE']->GetSort()));
             $GLOBALS['PageNumber'] = $page;
             $GLOBALS['SNIPPETS']['PagingData'] .= $GLOBALS['ISC_CLASS_TEMPLATE']->GetSnippet($snippet);
         }
         // Parse the paging snippet
         if ($GLOBALS['ISC_CLASS_PRICE']->GetPage() > 1) {
             // Do we need to output a "Previous" link?
             $GLOBALS['PrevLink'] = PriceLink($GLOBALS['ISC_CLASS_PRICE']->GetMinPrice(), $GLOBALS['ISC_CLASS_PRICE']->GetMaxPrice(), $GLOBALS['CatId'], $GLOBALS['ISC_CLASS_PRICE']->GetCatPath(), array("page" => $GLOBALS['ISC_CLASS_PRICE']->GetPage() - 1, "sort" => $GLOBALS['ISC_CLASS_PRICE']->GetSort()));
             $GLOBALS['SNIPPETS']['PricePagingPrevious'] = $GLOBALS['ISC_CLASS_TEMPLATE']->GetSnippet("PricePagingPrevious");
         }
         if ($GLOBALS['ISC_CLASS_PRICE']->GetPage() < $GLOBALS['ISC_CLASS_PRICE']->GetNumPages()) {
             // Do we need to output a "Next" link?
             $GLOBALS['NextLink'] = PriceLink($GLOBALS['ISC_CLASS_PRICE']->GetMinPrice(), $GLOBALS['ISC_CLASS_PRICE']->GetMaxPrice(), $GLOBALS['CatId'], $GLOBALS['ISC_CLASS_PRICE']->GetCatPath(), array("page" => $GLOBALS['ISC_CLASS_PRICE']->GetPage() + 1, "sort" => $GLOBALS['ISC_CLASS_PRICE']->GetSort()));
             $GLOBALS['SNIPPETS']['PricePagingNext'] = $GLOBALS['ISC_CLASS_TEMPLATE']->GetSnippet("PricePagingNext");
         }
         $output = $GLOBALS['ISC_CLASS_TEMPLATE']->GetSnippet("PricePaging");
         $output = $GLOBALS['ISC_CLASS_TEMPLATE']->ParseSnippets($output, $GLOBALS['SNIPPETS']);
         $GLOBALS['SNIPPETS']['PricePaging'] = $output;
     }
 }
	public function SetPanelSettings()
	{
		$output = "";
		$categorySql = $GLOBALS['ISC_CLASS_CATEGORY']->GetCategoryAssociationSQL(false);

		$query = $this->getProductQuery($categorySql, 'p.productid DESC', 5);
		$result = $GLOBALS['ISC_CLASS_DB']->Query($query);

		if($GLOBALS['ISC_CLASS_DB']->CountResult($result) > 0) {
			if(!GetConfig('ShowProductRating')) {
				$GLOBALS['HideProductRating'] = "display: none";
			}

			$GLOBALS['AlternateClass'] = '';
			while($row = $GLOBALS['ISC_CLASS_DB']->Fetch($result)) {
				$this->setProductGlobals($row);
				$output .= $GLOBALS['ISC_CLASS_TEMPLATE']->GetSnippet("SideCategoryNewProducts");
			}

			// Showing the syndication option?
			if(GetConfig('RSSNewProducts') != 0 && GetConfig('RSSCategories') != 0 && GetConfig('RSSSyndicationIcons') != 0) {
				$GLOBALS['ISC_LANG']['CategoryNewProductsFeed'] = sprintf(GetLang('CategoryNewProductsFeed'), $GLOBALS['CatName']);
				$GLOBALS['SNIPPETS']['SideCategoryNewProductsFeed'] = $GLOBALS['ISC_CLASS_TEMPLATE']->GetSnippet("SideCategoryNewProductsFeed");
			}
		}
		else {
			$GLOBALS['HideSideCategoryNewProductsPanel'] = "none";
			$this->DontDisplay = true;
		}

		$GLOBALS['SNIPPETS']['SideNewProducts'] = $output;
	}
Esempio n. 4
0
 function SetPanelSettings()
 {
     $count = 0;
     $output = "";
     $GLOBALS['SNIPPETS']['WishListItems'] = "";
     $GLOBALS['HideCompareItems'] = "none";
     if (GetConfig('EnableProductReviews') == 0) {
         $GLOBALS['HideProductRating'] = "display: none";
     }
     if (!isset($GLOBALS['WishListItems'])) {
         return false;
     }
     $GLOBALS['AlternateClass'] = '';
     foreach ($GLOBALS['WishListItems'] as $row) {
         if ($GLOBALS['AlternateClass'] == 'Odd') {
             $GLOBALS['AlternateClass'] = 'Even';
         } else {
             $GLOBALS['AlternateClass'] = 'Odd';
         }
         $GLOBALS['ProductCartQuantity'] = '';
         if (isset($GLOBALS['CartQuantity' . $row['productid']])) {
             $GLOBALS['ProductCartQuantity'] = (int) $GLOBALS['CartQuantity' . $row['productid']];
         }
         $GLOBALS['ItemId'] = (int) $row['wishlistitemid'];
         $GLOBALS['ProductId'] = (int) $row['productid'];
         $GLOBALS['ProductName'] = isc_html_escape($row['prodname']);
         $GLOBALS['ProductLink'] = ProdLink($row['prodname']);
         $GLOBALS['ProductRating'] = (int) $row['prodavgrating'];
         // Determine the price of this product
         $GLOBALS['ProductPrice'] = CalculateProductPrice($row);
         $GLOBALS['ProductThumb'] = ImageThumb($row['imagefile'], ProdLink($row['prodname']));
         $GLOBALS['SNIPPETS']['WishListItems'] .= $GLOBALS['ISC_CLASS_TEMPLATE']->GetSnippet("WishListItem");
     }
 }
Esempio n. 5
0
 public function BuildForm()
 {
     if (GetConfig('CurrencyLocation') === 'left') {
         $GLOBALS['CurrencyTokenLeft'] = GetConfig('CurrencyToken');
         $GLOBALS['CurrencyTokenRight'] = '';
     } else {
         $GLOBALS['CurrencyTokenLeft'] = '';
         $GLOBALS['CurrencyTokenRight'] = GetConfig('CurrencyToken');
     }
     if (empty($this->rules['cost'])) {
         $this->LoadWeightRanges();
     }
     if (empty($this->rules['cost'])) {
         $GLOBALS['POS'] = 0;
         $GLOBALS['COST_VAL'] = '';
         $GLOBALS['LOWER_VAL'] = '';
         $GLOBALS['UPPER_VAL'] = '';
         return $this->ParseTemplate('weight_range_row', true);
     }
     $output = '';
     // Sorts the indexes so 0 01 011 0111
     ksort($this->rules['cost']);
     foreach ($this->rules['cost'] as $id => $cost) {
         $GLOBALS['POS'] = $id;
         $GLOBALS['COST_VAL'] = FormatPrice($this->rules['cost'][$id], false, false);
         $GLOBALS['LOWER_VAL'] = FormatWeight($this->rules['lower'][$id], false);
         $GLOBALS['UPPER_VAL'] = FormatWeight($this->rules['upper'][$id], false);
         $output .= $this->ParseTemplate('weight_range_row', true);
     }
     return $output;
 }
Esempio n. 6
0
 function SetPanelSettings()
 {
     if (GetConfig('RSSNewProducts') == 0) {
         $GLOBALS['ShowNewProductsFeed'] = "none";
     } else {
         $GLOBALS['ISC_LANG']['SyndicateNewProductsIntro'] = sprintf(GetLang('SyndicateNewProductsIntro'), GetConfig('RSSItemsLimit'), $GLOBALS['StoreName']);
         $GLOBALS['ISC_LANG']['SyndicateNewProductsRSS'] = sprintf(GetLang('SyndicateNewProductsRSS'), GetConfig('RSSItemsLimit'));
         $GLOBALS['ISC_LANG']['SyndicateNewProductsAtom'] = sprintf(GetLang('SyndicateNewProductsAtom'), GetConfig('RSSItemsLimit'));
     }
     if (GetConfig('RSSPopularProducts') == 0) {
         $GLOBALS['ShowPopularProductsFeed'] = "none";
     } else {
         $GLOBALS['ISC_LANG']['SyndicatePopularProductsIntro'] = sprintf(GetLang('SyndicatePopularProductsIntro'), GetConfig('RSSItemsLimit'), $GLOBALS['StoreName']);
         $GLOBALS['ISC_LANG']['SyndicatePopularProductsRSS'] = sprintf(GetLang('SyndicatePopularProductsRSS'), GetConfig('RSSItemsLimit'));
         $GLOBALS['ISC_LANG']['SyndicatePopularProductsAtom'] = sprintf(GetLang('SyndicatePopularProductsAtom'), GetConfig('RSSItemsLimit'));
     }
     if (GetConfig('RSSProductSearches') == 0) {
         $GLOBALS['ShowSearchFeed'] = "none";
     } else {
         $GLOBALS['ISC_LANG']['SyndicateSearchesIntro2'] = sprintf(GetLang('SyndicateSearchesIntro2'), $GLOBALS['StoreName']);
     }
     if (GetConfig('RSSLatestBlogEntries') == 0) {
         $GLOBALS['ShowNewsFeed'] = "none";
     } else {
         $GLOBALS['ISC_LANG']['SyndicateNewsIntro'] = sprintf(GetLang('SyndicateNewsIntro'), GetConfig('RSSItemsLimit'), $GLOBALS['StoreName']);
         $GLOBALS['ISC_LANG']['SyndicateNewsRSS'] = sprintf(GetLang('SyndicateNewsRSS'), GetConfig('RSSItemsLimit'));
         $GLOBALS['ISC_LANG']['SyndicateNewsAtom'] = sprintf(GetLang('SyndicateNewsAtom'), GetConfig('RSSItemsLimit'));
     }
 }
Esempio n. 7
0
 /**
  * Set the settings for this panel.
  */
 public function SetPanelSettings()
 {
     // How many tags do we have?
     $query = "\n\t\t\tSELECT COUNT(tagid) AS tagcount\n\t\t\tFROM [|PREFIX|]product_tags\n\t\t";
     $tagCount = $GLOBALS['ISC_CLASS_DB']->FetchOne($query);
     // How many products does the most popular tag contain?
     $query = "\n\t\t\tSELECT MAX(tagcount) AS popularcount, MIN(tagcount) AS leastcount\n\t\t\tFROM [|PREFIX|]product_tags\n\t\t";
     $result = $GLOBALS['ISC_CLASS_DB']->Query($query);
     $tagCounts = $GLOBALS['ISC_CLASS_DB']->Fetch($result);
     // Get a list of all of the tags
     $query = "\n\t\t\tSELECT *\n\t\t\tFROM [|PREFIX|]product_tags\n\t\t\tORDER BY tagname ASC\n\t\t";
     $min = GetConfig('TagCloudMinSize');
     $max = GetConfig('TagCloudMaxSize');
     $GLOBALS['SNIPPETS']['TagList'] = '';
     $result = $GLOBALS['ISC_CLASS_DB']->Query($query);
     while ($tag = $GLOBALS['ISC_CLASS_DB']->Fetch($result)) {
         $weight = ceil($tag['tagcount'] / $tagCount * 100);
         if ($max > $min) {
             $fontSize = $weight / 100 * ($max - $min) + $min;
         } else {
             $fontSize = (100 - $weight) / 100 * ($max - $min) + $max;
         }
         $fontSize = (int) $fontSize;
         $GLOBALS['FontSize'] = $fontSize . '%';
         $GLOBALS['TagName'] = isc_html_escape($tag['tagname']);
         $GLOBALS['TagLink'] = TagLink($tag['tagfriendlyname'], $tag['tagid']);
         $GLOBALS['TagProductCount'] = sprintf(GetLang('XProductsTaggedWith'), $tag['tagcount'], isc_html_escape($tag['tagname']));
         $GLOBALS['SNIPPETS']['TagList'] .= $GLOBALS['ISC_CLASS_TEMPLATE']->GetSnippet('ProductTagCloudItem');
     }
 }
Esempio n. 8
0
 function SetPanelSettings()
 {
     $output = "";
     if (GetConfig('HomeBlogPosts') > 0) {
         $query = "select newsid, newstitle from [|PREFIX|]news where newsvisible='1' order by newsid desc";
         $query .= $GLOBALS['ISC_CLASS_DB']->AddLimit(0, GetConfig('HomeBlogPosts'));
         $result = $GLOBALS['ISC_CLASS_DB']->Query($query);
         if ($GLOBALS['ISC_CLASS_DB']->CountResult($result) > 0) {
             while ($row = $GLOBALS['ISC_CLASS_DB']->Fetch($result)) {
                 $GLOBALS['BlogText'] = isc_html_escape($row['newstitle']);
                 $GLOBALS['BlogLink'] = BlogLink($row['newsid'], $row['newstitle']);
                 $output .= $GLOBALS['ISC_CLASS_TEMPLATE']->GetSnippet("RecentBlog");
             }
             $GLOBALS['SNIPPETS']['RecentBlogs'] = $output;
             // Showing the syndication option?
             if (GetConfig('RSSLatestBlogEntries') != 0 && GetConfig('RSSSyndicationIcons') != 0) {
                 $GLOBALS['SNIPPETS']['HomeRecentBlogsFeed'] = $GLOBALS['ISC_CLASS_TEMPLATE']->GetSnippet("HomeRecentBlogsFeed");
             }
         } else {
             $this->DontDisplay = true;
             $GLOBALS['HideHomeRecentBlogsPanel'] = "none";
         }
     } else {
         $this->DontDisplay = true;
         $GLOBALS['HideHomeRecentBlogsPanel'] = "none";
     }
 }
Esempio n. 9
0
	/**
	 * Set the panel settings.
	 */
	public function SetPanelSettings()
	{
		if(GetConfig('HomeFeaturedProducts') <= 0) {
			$this->DontDisplay = true;
			return false;
		}

		$GLOBALS['SNIPPETS']['VendorFeaturedItems'] = '';

		if(!getProductReviewsEnabled()) {
			$GLOBALS['HideProductRating'] = "display: none";
		}

		$cVendor = GetClass('ISC_VENDORS');
		$vendor = $cVendor->GetVendor();

		$query = $this->getProductQuery(
			'p.prodvendorid='.(int)$vendor['vendorid'],
			'p.prodvendorfeatured DESC, RAND()',
			getConfig('HomeFeaturedProducts')
		);
		$result = $GLOBALS['ISC_CLASS_DB']->Query($query);

		$GLOBALS['AlternateClass'] = '';
		while($row = $GLOBALS['ISC_CLASS_DB']->Fetch($result)) {
			$this->setProductGlobals($row);
			$GLOBALS['SNIPPETS']['VendorFeaturedItems'] .= $GLOBALS['ISC_CLASS_TEMPLATE']->GetSnippet("VendorFeaturedItemsItem");
		}

		$GLOBALS['VendorProductsLink'] = VendorProductsLink($vendor);

		if(!$GLOBALS['SNIPPETS']['VendorFeaturedItems']) {
			$this->DontDisplay = true;
		}
	}
Esempio n. 10
0
 /**
  * Send the order notification email
  */
 public function SendNotification()
 {
     $emails = array();
     $this->_message = $this->BuildEmailMessage();
     $this->_email = $this->GetValue("emailaddress");
     if (empty($this->_email)) {
         return;
     }
     $emails = preg_split('#[,\\s]+#si', $this->_email, -1, PREG_SPLIT_NO_EMPTY);
     // Create a new email object through which to send the email
     $store_name = GetConfig('StoreName');
     require_once ISC_BASE_PATH . "/lib/email.php";
     $obj_email = GetEmailClass();
     $obj_email->Set('CharSet', GetConfig('CharacterSet'));
     $obj_email->From(GetConfig('OrderEmail'), $store_name);
     $obj_email->Set("Subject", sprintf(GetLang('NEmailSubjectLine'), $this->GetOrderId(), $store_name, FormatPrice($this->GetOrderTotal(), false, true, false, GetDefaultCurrency())));
     $obj_email->AddBody("html", $this->_message);
     // Add all recipients
     foreach ($emails as $email) {
         $obj_email->AddRecipient($email, "", "h");
     }
     $email_result = $obj_email->Send();
     if ($email_result['success']) {
         $result = array("outcome" => "success", "message" => sprintf(GetLang('EmailNotificationSentUser'), implode("<br />", $emails)));
     } else {
         $result = array("outcome" => "fail", "message" => GetLang('NEmailSendingFailed'));
     }
     return $result;
 }
Esempio n. 11
0
 function configAction()
 {
     // When the form is submitted
     $form_mess = "";
     if (isset($_POST['confName'])) {
         $form_mess = $this->updateConfig($_POST, $this->db_v1, $this->view, $this->session);
         $this->config_v1 = GetConfig($this->db_v1);
         // Check whether the logo file has been transmitted
         $adapter = new Zend_File_Transfer_Adapter_Http();
         $adapter->setDestination('images/');
         $adapter->addValidator('IsImage', false);
         if ($adapter->receive()) {
             $name = $adapter->getFileName('logo_file');
             //récupérer le nom du fichier sans avoir tout le chemin
             $name = basename($name);
             $this->db_v1->execRequete("UPDATE Config SET logo_file='{$name}'");
         }
         $config = new Config();
         $this->config = $config->fetchAll()->current();
         $this->config->putInView($this->view);
         $registry = Zend_registry::getInstance();
         $registry->set("Config", $this->config);
     }
     $this->view->config_message = $form_mess;
     $this->instantiateConfigVars($this->config_v1, $this->view);
     $this->view->setFile("content", "config.xml");
     $this->view->setFile("form_config", "form_config.xml");
     $form_mess = "";
     $this->view->messages = $form_mess;
     // N.B: the config values ar eput in the views by the Myreview controller
     echo $this->view->render("layout");
 }
Esempio n. 12
0
 protected function _HandleResponse($result)
 {
     $response = explode("\n", $result);
     $approved = 'NO';
     if (isset($response[0])) {
         $approved = $response[0];
     }
     if ($approved == 'approved') {
         $updatedOrder = array('ordpaymentstatus' => 'captured');
         $this->UpdateOrders($updatedOrder);
         $GLOBALS['ISC_CLASS_LOG']->LogSystemSuccess(array('payment', $this->GetName()), GetLang($this->_languagePrefix . 'Success'));
         // The order is valid, hook back into the checkout system's validation process
         ob_end_clean();
         $token = md5(GetConfig('EncryptionToken') . $_COOKIE['SHOP_ORDER_TOKEN']);
         header(sprintf("Location:%s/finishorder.php?o=%s", $GLOBALS['ShopPathSSL'], $token));
         die;
     } else {
         $responseCode = $responseMessage = 'Undefined';
         if (isset($response[5])) {
             $responseCode = explode("=", $response[5]);
             $responseCode = $responseCode[1];
         }
         if (isset($reponse[4])) {
             $responseMessage = explode("=", $response[4]);
             $responseMessage = urldecode($responseMessage[1]);
         }
         $GLOBALS['ISC_CLASS_LOG']->LogSystemError(array('payment', $this->GetName()), sprintf(GetLang($this->_languagePrefix . 'Failure'), $responseCode, $responseMessage));
         // Something went wrong, show the error message with the credit card form
         $this->SetError(sprintf(GetLang($this->_languagePrefix . "SomethingWentWrong") . "%s : %s", $responseCode, $responseMessage));
         return false;
     }
 }
 public function SetPanelSettings()
 {
     $GLOBALS['ISC_CLASS_CUSTOMER'] = GetClass('ISC_CUSTOMER');
     $customerid = $GLOBALS['ISC_CLASS_CUSTOMER']->GetCustomerId();
     if (gzte11(ISC_LARGEPRINT)) {
         // Get the number of new messages for this customer
         $order_ids = "";
         $query = sprintf("select orderid from [|PREFIX|]orders where ordcustid='%d'", $GLOBALS['ISC_CLASS_DB']->Quote($customerid));
         $result = $GLOBALS['ISC_CLASS_DB']->Query($query);
         while ($row = $GLOBALS['ISC_CLASS_DB']->Fetch($result)) {
             $order_ids .= sprintf("%s,", $row['orderid']);
         }
         $order_ids = rtrim($order_ids, ",");
         if ($order_ids != "") {
             $query = sprintf("select count(messageid) as num from [|PREFIX|]order_messages where messageorderid in (%s) and messagefrom='admin' and messagestatus='unread'", $GLOBALS['ISC_CLASS_DB']->Quote($order_ids));
             $GLOBALS['NumNewMessages'] = $GLOBALS['ISC_CLASS_DB']->FetchOne($query);
         } else {
             $GLOBALS['NumNewMessages'] = 0;
         }
     } else {
         $GLOBALS['HideMessagesMenu'] = "none";
     }
     // Do we want to show or hide the return requests menu item?
     if (gzte11(ISC_LARGEPRINT) && GetConfig('EnableReturns') == 1) {
         $query = sprintf("SELECT returnid FROM [|PREFIX|]returns WHERE retcustomerid='%d'", $GLOBALS['ISC_CLASS_DB']->Quote($customerid));
         if (!$GLOBALS['ISC_CLASS_DB']->FetchOne($query)) {
             $GLOBALS['HideReturnRequestsMenu'] = "none";
         }
     } else {
         $GLOBALS['HideReturnRequestsMenu'] = 'none';
     }
     // How many products are in their wish list?
     $query = sprintf("select count(wishlistid) as num from [|PREFIX|]wishlists where customerid='%d'", $GLOBALS['ISC_CLASS_DB']->Quote($customerid));
     $GLOBALS['NumWishListItems'] = $GLOBALS['ISC_CLASS_DB']->FetchOne($query);
 }
Esempio n. 14
0
	protected function WriteHeader()
	{
		$data = "<?xml version=\"1.0\" encoding=\"" . GetConfig("CharacterSet") . "\"?>\n";
		$data .= "<" . $this->type_name . "s>\n";

		fwrite($this->handle, $data);
	}
Esempio n. 15
0
	public function SetPanelSettings()
	{
		$output = "";
		// If ratings are disabled, hide them
		if(!GetConfig('ShowProductRating')) {
			$GLOBALS['HideProductRating'] = "display: none";
		}

		$query = $this->getProductQuery('', 'p.proddateadded DESC',	5);
		$result = $GLOBALS['ISC_CLASS_DB']->Query($query);

		$GLOBALS['AlternateClass'] = '';
		while($row = $GLOBALS['ISC_CLASS_DB']->Fetch($result)) {
			$this->setProductGlobals($row);
			$output .= $GLOBALS['ISC_CLASS_TEMPLATE']->GetSnippet("SideNewProducts");
		}

		// Showing the syndication option?
		if(GetConfig('RSSNewProducts') != 0 && GetConfig('RSSSyndicationIcons') != 0) {
			$GLOBALS['SNIPPETS']['SideNewProductsFeed'] = $GLOBALS['ISC_CLASS_TEMPLATE']->GetSnippet("SideNewProductsFeed");
		}

		if(!$output) {
			$this->DontDisplay = true;
			return;
		}

		$GLOBALS['SNIPPETS']['SideNewProducts'] = $output;
	}
Esempio n. 16
0
function EditPlface($add, $userid, $username)
{
    global $empire, $dbtbpre;
    $facefile = $add[facefile];
    $faceword = $add[faceword];
    $count = count($faceword);
    $plface = '||';
    for ($i = 0; $i < $count; $i++) {
        $facefile[$i] = DoRepPlface($facefile[$i]);
        $faceword[$i] = DoRepPlface($faceword[$i]);
        if ($faceword[$i]) {
            $plface .= $faceword[$i] . "##" . $facefile[$i] . "||";
        }
    }
    $sql = $empire->query("update {$dbtbpre}enewspublic set plface='{$plface}' limit 1");
    if ($sql) {
        GetPlfaceJs();
        GetConfig();
        //操作日志
        insert_dolog("");
        printerror("EditPlfaceSuccess", "plface.php");
    } else {
        printerror("DbError", "history.go(-1)");
    }
}
	public function SetPanelSettings()
	{
		$output = "";

		// If product ratings aren't enabled then we don't even need to load anything here
		if(!getProductReviewsEnabled()) {
			$this->DontDisplay = true;
			return;
		}

		$categorySql = $GLOBALS['ISC_CLASS_CATEGORY']->GetCategoryAssociationSQL(false);
		$query = $this->getProductQuery('prodratingtotal > 0 AND '.$categorySql, 'p.prodratingtotal DESC', 5);
		$result = $GLOBALS['ISC_CLASS_DB']->Query($query);
		if($GLOBALS['ISC_CLASS_DB']->CountResult($result) > 0) {
			$GLOBALS['AlternateClass'] = '';
			while($row = $GLOBALS['ISC_CLASS_DB']->Fetch($result)) {
				$this->setProductGlobals($row);
				$output .= $GLOBALS['ISC_CLASS_TEMPLATE']->GetSnippet("SideCategoryPopularProducts");
			}

			// Showing the syndication option?
			if(GetConfig('RSSPopularProducts') != 0 && GetConfig('RSSCategories') != 0 && GetConfig('RSSSyndicationIcons') != 0) {
				$GLOBALS['ISC_LANG']['CategoryPopularProductsFeed'] = sprintf(GetLang('CategoryPopularProductsFeed'), isc_html_escape($GLOBALS['CatName']));
				$GLOBALS['SNIPPETS']['SideCategoryPopularProductsFeed'] = $GLOBALS['ISC_CLASS_TEMPLATE']->GetSnippet("SideCategoryPopularProductsFeed");
			}
		}
		else {
			$GLOBALS['HideSideCategoryPopularProductsPanel'] = "none";
			$this->DontDisplay = true;
		}

		$GLOBALS['SNIPPETS']['SideCategoryPopularProducts'] = $output;
	}
Esempio n. 18
0
function EditMemberConnect($add, $userid, $username)
{
    global $empire, $dbtbpre;
    $add[id] = (int) $add[id];
    if (empty($add[appname]) || !$add[id]) {
        printerror("EmptyMemberConnect", "history.go(-1)");
    }
    $add[isclose] = (int) $add[isclose];
    $add[myorder] = (int) $add[myorder];
    $add[appname] = eaddslashes(ehtmlspecialchars($add[appname]));
    $add[appid] = eaddslashes($add[appid]);
    $add[appkey] = eaddslashes($add[appkey]);
    $add[qappname] = eaddslashes($add[qappname]);
    $add[appsay] = eaddslashes($add[appsay]);
    $sql = $empire->query("update {$dbtbpre}enewsmember_connect_app set appname='{$add['appname']}',appid='{$add['appid']}',appkey='{$add['appkey']}',isclose='{$add['isclose']}',myorder='{$add['myorder']}',qappname='{$add['qappname']}',appsay='{$add['appsay']}' where id='{$add['id']}'");
    $appr = $empire->fetch1("select apptype from {$dbtbpre}enewsmember_connect_app where id='{$add['id']}'");
    if ($sql) {
        GetConfig();
        //操作日志
        insert_dolog("id=" . $add[id] . "&apptype=" . $appr[apptype] . "<br>appname=" . $add[appname]);
        printerror("EditMemberConnectSuccess", "MemberConnect.php" . hReturnEcmsHashStrHref2(1));
    } else {
        printerror("DbError", "history.go(-1)");
    }
}
Esempio n. 19
0
		public function ShowHomePage()
		{
			if(isset($GLOBALS['PathInfo'][0]) && ($GLOBALS['PathInfo'][0] == 'store' || $GLOBALS['PathInfo'][0] == 'shop')) {
				$GLOBALS['ActivePage'] = 'store';
			}
			else {
				$GLOBALS['ActivePage'] = "home";
			}

			// Is there a normal page set to be the default home page?
			$pagesCache = $GLOBALS['ISC_CLASS_DATA_STORE']->Read('Pages');
			if($GLOBALS['ActivePage'] != 'store' && !empty($pagesCache['defaultPage']['pageid']) &&
				!$GLOBALS['ISC_CLASS_TEMPLATE']->getIsMobileDevice()) {
					// Load a page created from the control panel
					$GLOBALS['ISC_CLASS_PAGE'] = new ISC_PAGE($pagesCache['defaultPage']['pageid'], true, $pagesCache['defaultPage']);
					$GLOBALS['ISC_CLASS_PAGE']->ShowPage();
			}
			else {
				// Load the dynamic home page instead
				if(GetConfig('HomePagePageTitle')) {
					$title = GetConfig('HomePagePageTitle');
				}
				else {
					$title = GetConfig('StoreName');
				}
				$GLOBALS['ISC_CLASS_TEMPLATE']->SetPageTitle($title);
				$GLOBALS['ISC_CLASS_TEMPLATE']->SetTemplate("default");
				$GLOBALS['ISC_CLASS_TEMPLATE']->ParseTemplate();
			}
		}
 /**
  * Save
  *
  * @return Void
  */
 private function SaveImageUploaderSettings()
 {
     $messages = array();
     if ($_POST['dopost']) {
         $GLOBALS['ISC_NEW_CFG']['LimitCustomerUploadImageSize'] = intval($_POST['LimitCustomerUploadImageSize']);
         $GLOBALS['ISC_NEW_CFG']['LimitCustomerUploadImageNum'] = intval($_POST['LimitCustomerUploadImageNum']);
         $GLOBALS['ISC_NEW_CFG']['LimitCustomerUploadImagePerNum'] = intval($_POST['LimitCustomerUploadImagePerNum']);
         $GLOBALS['ISC_NEW_CFG']['LimitCustomerUploadImageFileType'] = implode(',', $_POST['LimitCustomerUploadImageFileType']);
         $GLOBALS['ISC_NEW_CFG']['ImageUploaderSettingsInstructions'] = base64_encode($_POST['ImageUploaderSettingsInstructions']);
         $GLOBALS['ISC_NEW_CFG']['ImageUploaderSettingsAssignment'] = base64_encode($_POST['ImageUploaderSettingsAssignment']);
         $GLOBALS['ISC_NEW_CFG']['ImageUploaderSettingsNotifyEmail'] = trim($_POST['ImageUploaderSettingsNotifyEmail']);
         if ($GLOBALS['ISC_NEW_CFG']['ImageUploaderSettingsNotifyEmail'] == '') {
             $GLOBALS['ISC_NEW_CFG']['ImageUploaderSettingsNotifyEmail'] = GetConfig('AdminEmail');
         }
         $settings = GetClass('ISC_ADMIN_SETTINGS');
         if ($settings->CommitSettings($messages)) {
             // Log this action
             $GLOBALS['ISC_CLASS_LOG']->LogAdminAction();
             FlashMessage(GetLang('ImageUploaderSettingsSavedSuccessfully'), MSG_SUCCESS, 'index.php?ToDo=viewImageUploaderSettings');
         } else {
             FlashMessage(sprintf(GetLang('ImageUploaderSettingsNotSaved'), $messages), MSG_ERROR, 'index.php?ToDo=viewImageUploaderSettings');
         }
     } else {
         $this->ManageImageUploaderSettings();
     }
 }
Esempio n. 21
0
	/**
	 * Convert string or array of string to UTF-8
	 *
	 * Method will convert $str which is either a string or array of string from $fromEncoding to UTF-8. If $fromEncoding
	 * is empty then use the output from GetConfig("dbEncoding")
	 *
	 * @access protected
	 * @param mixed $str The string or array of strings to convert
	 * @param string $fromEncoding The optional from encoding. Default is GetConfig("dbEncoding")
	 * @return mixed The converted string or array of strings
	 */
	protected function convert2UTF8($str, $fromEncoding='')
	{
		if (trim($str) == '') {
			return $str;
		}

		if (trim($fromEncoding) == '') {
			$fromEncoding = GetConfig("dbEncoding");
		}

		if (trim($fromEncoding) == '') {
			return $str;
		}

		/**
		 * Convert the $fromEncoding as mb_convert_encoding doesn't understand MySQL char encoding names. Just look
		 * for the most common encodings
		 */
		switch (isc_strtolower($fromEncoding)) {
			case "utf8":
				$fromEncoding = "utf-8";
				break;

			case "latin1":
				$fromEncoding = "iso-8859-1";
				break;

			case "latin2":
				$fromEncoding = "iso-8859-2";
				break;
		}

		return isc_convert_charset($fromEncoding, "utf-8", $str);
	}
Esempio n. 22
0
	public function GetSearches ()
	{
		$query = "
			SELECT searchid, searchname, searchlabel
			FROM [|PREFIX|]custom_searches
			WHERE searchtype='" . $this->db->Quote($this->_searchType) . "'
			ORDER BY searchname ASC
		";

		$result = $this->db->Query($query);
		$rows = array();
		while ($row = $this->db->Fetch($result)) {
			if ($this->_searchType == 'orders' && ($row['searchname'] == 'Orders from eBay' || $row['searchlabel'] == 'ebayorders') && !($GLOBALS['ISC_CLASS_ADMIN_AUTH']->HasPermission(AUTH_Ebay_Selling) && gzte11(ISC_LARGEPRINT))) {
				continue;
			}

			if ($this->_searchType == 'orders' && $row['searchlabel'] == 'deletedorders' && GetConfig('DeletedOrdersAction') != 'delete') {
				// don't show deleted orders view if setting not enabled
				continue;
			}

			$rows[] = $row;
		}
		return $rows;
	}
 public function SetPanelSettings()
 {
     $selectedCountry = GetConfig('CompanyCountry');
     $selectedState = 0;
     if (isset($GLOBALS['SavedAddress']) && is_array($GLOBALS['SavedAddress'])) {
         $address = $GLOBALS['SavedAddress'];
         $selectedCountry = $address['shipcountry'];
         $addressVars = array('account_email' => 'AccountEmail', 'shipfirstname' => 'AddressFirstName', 'shiplastname' => 'AddressLastName', 'shipcompany' => 'AddressCompany', 'shipaddress1' => 'AddressLine1', 'shipaddress2' => 'AddressLine2', 'shipcity' => 'AddressCity', 'shipstate' => 'AddressState', 'shipzip' => 'AddressZip', 'shipphone' => 'AddressPhone');
         if (isset($address['shipstateid'])) {
             $selectedState = $address['shipstateid'];
         }
         foreach ($addressVars as $addressField => $formField) {
             if (isset($address[$addressField])) {
                 $GLOBALS[$formField] = isc_html_escape($address[$addressField]);
             }
         }
     }
     $country_id = GetCountryIdByName($selectedCountry);
     $GLOBALS['CountryList'] = GetCountryList(GetConfig('CompanyCountry'), true);
     $GLOBALS['StateList'] = GetStateListAsOptions($country_id, $selectedState);
     // If there are no states for the country then
     // hide the dropdown and show the textbox instead
     if (GetNumStatesInCountry($country_id) == 0) {
         $GLOBALS['HideStateList'] = "none";
     } else {
         $GLOBALS['HideStateBox'] = "none";
     }
 }
Esempio n. 24
0
	/**
	* 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');
	}
Esempio n. 25
0
 public function initializeAdmin()
 {
     $quantity = 1;
     $quantity_free = 1;
     if (isset($GLOBAL['var_amount'])) {
         $quantity = $GLOBAL['var_amount'];
     }
     if (isset($GLOBAL['var_amount_free'])) {
         $quantity_free = $GLOBAL['var_amount_free'];
     }
     // If we're using a cart quantity drop down, load that
     if (GetConfig('TagCartQuantityBoxes') == 'dropdown') {
         $GLOBALS['SelectId'] = "amount";
         $GLOBALS['Qty0'] = $GLOBALS['ISC_CLASS_TEMPLATE']->GetSnippet("DiscountItemQtySelect");
         // Otherwise, load the textbox
     } else {
         $GLOBALS['SelectId'] = "amount";
         $GLOBALS['Qty0'] = $GLOBALS['ISC_CLASS_TEMPLATE']->GetSnippet("DiscountItemQtyText");
     }
     if (!isset($GLOBALS['var_ps'])) {
         $GLOBALS['var_ps'] = GetLang('ChooseAProduct');
     }
     // If we're using a cart quantity drop down, load that
     if (GetConfig('TagCartQuantityBoxes') == 'dropdown') {
         $GLOBALS['SelectId'] = "amount_free";
         $GLOBALS['Qty1'] = $GLOBALS['ISC_CLASS_TEMPLATE']->GetSnippet("DiscountItemQtySelect");
         // Otherwise, load the textbox
     } else {
         $GLOBALS['SelectId'] = "amount_free";
         $GLOBALS['Qty1'] = $GLOBALS['ISC_CLASS_TEMPLATE']->GetSnippet("DiscountItemQtyText");
     }
     if (!isset($GLOBALS['var_ps_free'])) {
         $GLOBALS['var_ps_free'] = GetLang('ChooseAProduct');
     }
 }
Esempio n. 26
0
 function GetSeriesInfo()
 {
     $catgqry = "select b.brandname, displayname, seriesname, divdesc, min(prodfinalprice) as prodminprice, max(prodfinalprice) as prodmaxprice, \t\t\t\t\t\tserieshoverimagefile from [|PREFIX|]brand_series s left join [|PREFIX|]product_finalprice p on s.seriesid = \n\t\t\t\t\t\t\t\t\tp.prodseriesid LEFT JOIN [|PREFIX|]brands b ON s.brandid = b.brandid where seriesid = " . $this->catgbrand . " group by seriesid ";
     $catgres = $GLOBALS['ISC_CLASS_DB']->Query($catgqry);
     $catgarr = $GLOBALS['ISC_CLASS_DB']->Fetch($catgres);
     if ($GLOBALS['ISC_CLASS_DB']->CountResult($catgres) > 0) {
         $GLOBALS['PATH'] = GetConfig('ShopPath');
         $GLOBALS['LINKPATH'] = isset($_GET['url']) ? $_GET['url'] : '';
         if ($GLOBALS['LINKPATH'] == '' || $GLOBALS['LINKPATH'] == '#') {
             $GLOBALS['LINKPATH'] = "#' onclick='self.parent.tb_remove();return checkcategoryselection();";
         }
         $GLOBALS['Header'] = "<h3>Series Description</h3>";
         if ($catgarr['serieshoverimagefile'] != "") {
             $GLOBALS['LeftImage'] = "<a href='" . $GLOBALS['LINKPATH'] . "'><img src='" . $GLOBALS['PATH'] . "/series_images/" . $catgarr['serieshoverimagefile'] . "' alt='" . $catgarr['serieshoverimagefile'] . "' width='240'></a>";
         }
         $GLOBALS['TitleLink'] = "<h2><a href='" . $GLOBALS['LINKPATH'] . "' class='catgname'>" . ($catgarr['displayname'] == '' ? $catgarr['brandname'] . ' ' . $catgarr['seriesname'] . ' ' . $_GET['catname'] : $catgarr['displayname']) . " </a></h2>";
         $GLOBALS['Info'] = $catgarr['divdesc'];
         if (number_format($catgarr['prodminprice'], 2) < number_format($catgarr['prodmaxprice'], 2)) {
             $GLOBALS['PriceRange'] = "Price range from \$" . number_format($catgarr['prodminprice'], 2, '.', '') . " to \$" . number_format($catgarr['prodmaxprice'], 2, '.', '');
         } else {
             $GLOBALS['PriceRange'] = "Available at \$" . number_format($catgarr['prodminprice'], 2, '.', '');
         }
     } else {
         $GLOBALS['Info'] = "Sorry, There is no information available.";
         //alandy_2012-3-15 modify.
         $GLOBALS['LINKPATH'] = isset($_GET['url']) ? $_GET['url'] : '';
     }
     $this->catgbranddetails = $GLOBALS['ISC_CLASS_TEMPLATE']->GetSnippet("CatgSeriesInfo");
 }
Esempio n. 27
0
		public function SetPanelSettings()
		{
			$GLOBALS['ISC_CLASS_CUSTOMER'] = GetClass('ISC_CUSTOMER');
			$customerid = $GLOBALS['ISC_CLASS_CUSTOMER']->GetCustomerId();

			if(gzte11(ISC_LARGEPRINT)) {
				// Get the number of new messages for this customer
				$query = "
					SELECT
					COUNT(*)
					FROM [|PREFIX|]orders o, [|PREFIX|]order_messages om
					WHERE o.ordcustid = " . (int)$customerid . " AND o.deleted = 0 AND om.messageorderid = o.orderid AND om.messagefrom = 'admin' AND messagestatus = 'unread'
				";
				$GLOBALS['NumNewMessages'] = (int)$GLOBALS['ISC_CLASS_DB']->FetchOne($query);
			}
			else {
				$GLOBALS['HideMessagesMenu'] = "none";
			}

			// Do we want to show or hide the return requests menu item?
			if(gzte11(ISC_LARGEPRINT) && GetConfig('EnableReturns') == 1) {
				$query = sprintf("SELECT returnid FROM [|PREFIX|]returns WHERE retcustomerid='%d'", $GLOBALS['ISC_CLASS_DB']->Quote($customerid));
				if(!$GLOBALS['ISC_CLASS_DB']->FetchOne($query)) {
					$GLOBALS['HideReturnRequestsMenu'] = "none";
				}
			}
			else {
				$GLOBALS['HideReturnRequestsMenu'] = 'none';
			}

			// How many products are in their wish list?
			$query = sprintf("select count(wishlistid) as num from [|PREFIX|]wishlists where customerid='%d'", $GLOBALS['ISC_CLASS_DB']->Quote($customerid));
			$GLOBALS['NumWishListItems'] = $GLOBALS['ISC_CLASS_DB']->FetchOne($query);
		}
Esempio n. 28
0
	public function SetPanelSettings()
	{
		$output = "";

		// If product ratings aren't enabled then we don't even need to load anything here
		if(!getProductReviewsEnabled()) {
			$this->DontDisplay = true;
			return;
		}

		$query = $this->getProductQuery('p.prodratingtotal > 0', 'p.prodratingtotal DESC', 5);
		$result = $GLOBALS['ISC_CLASS_DB']->Query($query);

		if($GLOBALS['ISC_CLASS_DB']->CountResult($result) > 0) {
			$GLOBALS['AlternateClass'] = '';
			while($row = $GLOBALS['ISC_CLASS_DB']->Fetch($result)) {
				$this->setProductGlobals($row);
				$output .= $GLOBALS['ISC_CLASS_TEMPLATE']->GetSnippet("SidePopularProducts");
			}

			// Showing the syndication option?
			if(GetConfig('RSSPopularProducts') != 0 && GetConfig('RSSSyndicationIcons') != 0) {
				$GLOBALS['SNIPPETS']['SidePopularProductsFeed'] = $GLOBALS['ISC_CLASS_TEMPLATE']->GetSnippet("SidePopularProductsFeed");
			}
		}
		else {
			$GLOBALS['HideSidePopularProductsPanel'] = "none";
			$this->DontDisplay = true;
		}

		$GLOBALS['SNIPPETS']['SidePopularProducts'] = $output;
	}
Esempio n. 29
0
 function CreateVideoGallery()
 {
     $InsVideoGallery = '';
     for ($z = 0; $z < count($this->_prodvideos); $z++) {
         if ($this->_prodvideos[$z]['videotype'] == 1 && $this->_prodvideos[$z]['isdownloaded'] == 2) {
             $filename = $this->_prodvideos[$z]['systemvideofile'];
         } else {
             $filename = $this->_prodvideos[$z]['videofile'];
         }
         if (strpos($filename, 'http://') !== false) {
             $VideoLink = $filename;
         } else {
             $VideoLink = $GLOBALS['ShopPath'] . '/' . GetConfig('InstallVideoDirectory') . '/' . $filename;
         }
         $InsVideoGallery .= '<tr>
                                     <td>
                                         <a style="color:#CCCCCC"  href="javascript:loadInsVideo(\'' . $VideoLink . '\');" title="Video ' . ($z + 1) . '">  
                                             Video' . ($z + 1) . '
                                         </a>
                                     </td>
                                 </tr>';
         if ($z == 0) {
             //$FirstInsVideo = $GLOBALS['ShopPath'].'/'.GetConfig('InstallVideoDirectory').'/'.$filename;
             $FirstInsVideo = $VideoLink;
             $GLOBALS['FirstInsVideo'] = 'loadInsVideo(\'' . $FirstInsVideo . '\')';
         }
     }
     $GLOBALS['InsVideoGallery'] = $InsVideoGallery;
     //
 }
	public function initializeAdmin()
	{
		$quantity = 1;

		if (isset($GLOBAL['var_orders'])) {
			$quantity = $GLOBAL['var_orders'];
		}

		// If we're using a cart quantity drop down, load that
		if (GetConfig('TagCartQuantityBoxes') == 'dropdown') {
			$GLOBALS['SelectId'] = "orders";
			$GLOBALS['Qty0'] = Interspire_Template::getInstance('admin')->render('Snippets/DiscountItemQtySelect.html');
		// Otherwise, load the textbox
		} else {
			$GLOBALS['SelectId'] = "orders";
			$GLOBALS['Qty0'] = Interspire_Template::getInstance('admin')->render('Snippets/DiscountItemQtyText.html');
		}

		if (!isset($GLOBALS['var_ps'])) {
			$GLOBALS['var_ps'] = GetLang('ChooseAProduct');
		}

		$currency = GetDefaultCurrency();
		if ($currency['currencystringposition'] == "LEFT") {
			$GLOBALS['CurrencyLeft'] = $currency['currencystring'];
		}
		else {
			$GLOBALS['CurrencyRight'] =  $currency['currencystring'];
		}
	}