Advertisement
fruffl

Untitled

Dec 16th, 2011
116
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <?php
  2. /* -----------------------------------------------------------------------------------------
  3.    $Id: header.php 1140 2005-08-10 10:16:00Z mz $  
  4.  
  5.    XT-Commerce - community made shopping
  6.    http://www.xt-commerce.com
  7.  
  8.    Copyright (c) 2003 XT-Commerce
  9.    -----------------------------------------------------------------------------------------
  10.    based on:
  11.    (c) 2000-2001 The Exchange Project  (earlier name of osCommerce)
  12.    (c) 2002-2003 osCommerce(header.php,v 1.40 2003/03/14); www.oscommerce.com
  13.    (c) 2003  nextcommerce (header.php,v 1.13 2003/08/17); www.nextcommerce.org
  14.  
  15.    Released under the GNU General Public License
  16.    -----------------------------------------------------------------------------------------
  17.    Third Party contribution:
  18.  
  19.    Credit Class/Gift Vouchers/Discount Coupons (Version 5.10)
  20.    http://www.oscommerce.com/community/contributions,282
  21.    Copyright (c) Strider | Strider@oscworks.com
  22.    Copyright (c  Nick Stanko of UkiDev.com, nick@ukidev.com
  23.    Copyright (c) Andre ambidex@gmx.net
  24.    Copyright (c) 2001,2002 Ian C Wilson http://www.phesis.org
  25.  
  26.  
  27.    Released under the GNU General Public License
  28.    ---------------------------------------------------------------------------------------*/
  29.  
  30.  
  31. ?>
  32. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  33. <html xmlns="http://www.w3.org/1999/xhtml" <?php echo HTML_PARAMS; ?>>
  34. <head>
  35. <?php include(DIR_WS_MODULES.FILENAME_METATAGS); ?>
  36. <meta http-equiv="Content-Type" content="text/html; charset=<?php echo $_SESSION['language_charset']; ?>" />
  37. <meta http-equiv="Content-Style-Type" content="text/css" />
  38. <link rel="shortcut icon" href="<?php echo (($request_type == 'SSL') ? HTTPS_SERVER : HTTP_SERVER).DIR_WS_CATALOG.'templates/'.CURRENT_TEMPLATE.'/favicon.ico';?>" type="image/x-icon" />
  39.  
  40. <?php
  41. /*
  42.   The following copyright announcement is in compliance
  43.   to section 2c of the GNU General Public License, and
  44.   thus can not be removed, or can only be modified
  45.   appropriately.
  46.  
  47.   Please leave this comment intact together with the
  48.   following copyright announcement.
  49.  
  50. */
  51. ?>
  52. <!--
  53.     This OnlineStore is brought to you by XT-Commerce, Community made shopping
  54.     XTC is a free open source e-Commerce System
  55.     created by Mario Zanier & Guido Winger and licensed under GNU/GPL.
  56.     Information and contribution at http://www.xt-commerce.com
  57. -->
  58. <meta name="generator" content="(c) by <?php echo PROJECT_VERSION; ?> ----- http://www.xtc-modified.org-" />
  59. <base href="<?php echo (($request_type == 'SSL') ? HTTPS_SERVER : HTTP_SERVER) . DIR_WS_CATALOG; ?>" />
  60. <?php
  61. /*
  62. //BOF - DokuMan - 2010-03-16 - Enhance page loading time by putting CSS on TOP of page and JavaScript on BOTTOM of page
  63. //<link rel="stylesheet" type="text/css" href="<?php echo 'templates/'.CURRENT_TEMPLATE.'/stylesheet.css'; ?>" />
  64. */
  65. if (file_exists('templates/'.CURRENT_TEMPLATE.'/css/general.css.php')) {
  66.   require('templates/'.CURRENT_TEMPLATE.'/css/general.css.php');
  67.   }
  68.   //Maintain backwards compatibility for older templates
  69.   else {
  70.     echo '<link rel="stylesheet" type="text/css" href="templates/'.CURRENT_TEMPLATE.'/stylesheet.css" />';
  71. }
  72. //EOF - DokuMan - 2010-03-16 - Enhance page loading time by putting CSS on TOP of page and JavaScript on BOTTOM of page
  73. ?>
  74.  
  75. <script type="text/javascript"><!--
  76. var selected;
  77. var submitter = null;
  78.  
  79. function submitFunction() {
  80.     submitter = 1;
  81. }
  82. function popupWindow(url) {
  83.   window.open(url,'popupWindow','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,copyhistory=no,width=100,height=100,screenX=150,screenY=150,top=150,left=150')
  84. }  
  85.  
  86. function selectRowEffect(object, buttonSelect) {
  87.   if (!selected) {
  88.     if (document.getElementById) {
  89.       selected = document.getElementById('defaultSelected');
  90.     } else {
  91.       selected = document.all['defaultSelected'];
  92.     }
  93.   }
  94.  
  95.   if (selected) selected.className = 'moduleRow';
  96.   object.className = 'moduleRowSelected';
  97.   selected = object;
  98.  
  99. // one button is not an array
  100.   if (document.getElementById('payment'[0])) {
  101.     document.getElementById('payment'[buttonSelect]).checked=true;
  102.   } else {
  103.     //document.getElementById('payment'[selected]).checked=true;
  104.   }
  105. }
  106.  
  107. function rowOverEffect(object) {
  108.   if (object.className == 'moduleRow') object.className = 'moduleRowOver';
  109. }
  110.  
  111. function rowOutEffect(object) {
  112.   if (object.className == 'moduleRowOver') object.className = 'moduleRow';
  113. }
  114.  
  115. function popupImageWindow(url) {
  116.   window.open(url,'popupImageWindow','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=yes,copyhistory=no,width=100,height=100,screenX=150,screenY=150,top=150,left=150')
  117. }
  118. //--></script>
  119. <?php
  120. // require theme based javascript
  121. //BOF - DokuMan - 2010-02-25 - Enhance page loading time by putting CSS on TOP of page and JavaScript on BOTTOM of page
  122. //BOF - web28 - 2010-07-14 - change to TOP of page again because jquery view problems
  123. require('templates/'.CURRENT_TEMPLATE.'/javascript/general.js.php');
  124. //EOF - web28 - 2010-07-14 - change to TOP of page again because jquery view problems
  125. //EOF - DokuMan - 2010-02-25 - Enhance page loading time by putting CSS on TOP of page and JavaScript on BOTTOM of page
  126.  
  127. if (strstr($PHP_SELF, FILENAME_CHECKOUT_PAYMENT)) {
  128.  echo $payment_modules->javascript_validation();
  129. }
  130.  
  131. if (strstr($PHP_SELF, FILENAME_CREATE_ACCOUNT)) {
  132. require('includes/form_check.js.php');
  133. }
  134.  
  135.  
  136. if (strstr($PHP_SELF, FILENAME_CREATE_GUEST_ACCOUNT )) {
  137. require('includes/form_check.js.php');
  138. }
  139. if (strstr($PHP_SELF, FILENAME_ACCOUNT_PASSWORD )) {
  140. require('includes/form_check.js.php');
  141. }
  142. if (strstr($PHP_SELF, FILENAME_ACCOUNT_EDIT )) {
  143. require('includes/form_check.js.php');
  144. }
  145. if (strstr($PHP_SELF, FILENAME_ADDRESS_BOOK_PROCESS )) {
  146.   if (isset($_GET['delete']) == false) {
  147.     include('includes/form_check.js.php');
  148.   }
  149.   }
  150. if (strstr($PHP_SELF, FILENAME_CHECKOUT_SHIPPING_ADDRESS )or strstr($PHP_SELF,FILENAME_CHECKOUT_PAYMENT_ADDRESS)) {
  151. require('includes/form_check.js.php');
  152. ?>
  153. <script type="text/javascript"><!--
  154. function check_form_optional(form_name) {
  155.   var form = form_name;
  156.  
  157.   var firstname = form.elements['firstname'].value;
  158.   var lastname = form.elements['lastname'].value;
  159.   var street_address = form.elements['street_address'].value;
  160.  
  161.   if (firstname == '' && lastname == '' && street_address == '') {
  162.     return true;
  163.   } else {
  164.     return check_form(form_name);
  165.   }
  166. }
  167. //--></script>
  168. <?php
  169. }
  170.  
  171. if (strstr($PHP_SELF, FILENAME_ADVANCED_SEARCH )) {
  172. ?>
  173. <script type="text/javascript" src="includes/general.js"></script>
  174. <script type="text/javascript"><!--
  175. function check_form() {
  176.   var error_message = unescape("<?php echo xtc_js_lang(JS_ERROR); ?>");
  177.   var error_found = false;
  178.   var error_field;
  179.   var keywords = document.getElementById("advanced_search").keywords.value;
  180.   var pfrom = document.getElementById("advanced_search").pfrom.value;
  181.   var pto = document.getElementById("advanced_search").pto.value;
  182.   var pfrom_float;
  183.   var pto_float;
  184.  
  185.   if ( (keywords == '' || keywords.length < 1) && (pfrom == '' || pfrom.length < 1) && (pto == '' || pto.length < 1) ) {
  186.     error_message = error_message + unescape("<?php echo xtc_js_lang(JS_AT_LEAST_ONE_INPUT); ?>");
  187.     error_field = document.getElementById("advanced_search").keywords;
  188.     error_found = true;
  189.   }
  190.  
  191.   if (pfrom.length > 0) {
  192.     pfrom_float = parseFloat(pfrom);
  193.     if (isNaN(pfrom_float)) {
  194.       error_message = error_message + unescape("<?php echo xtc_js_lang(JS_PRICE_FROM_MUST_BE_NUM); ?>");
  195.       error_field = document.getElementById("advanced_search").pfrom;
  196.       error_found = true;
  197.     }
  198.   } else {
  199.     pfrom_float = 0;
  200.   }
  201.  
  202.   if (pto.length > 0) {
  203.     pto_float = parseFloat(pto);
  204.     if (isNaN(pto_float)) {
  205.       error_message = error_message + unescape("<?php echo xtc_js_lang(JS_PRICE_TO_MUST_BE_NUM); ?>");
  206.       error_field = document.getElementById("advanced_search").pto;
  207.       error_found = true;
  208.     }
  209.   } else {
  210.     pto_float = 0;
  211.   }
  212.  
  213.   if ( (pfrom.length > 0) && (pto.length > 0) ) {
  214.     if ( (!isNaN(pfrom_float)) && (!isNaN(pto_float)) && (pto_float < pfrom_float) ) {
  215.       error_message = error_message + unescape("<?php echo xtc_js_lang(JS_PRICE_TO_LESS_THAN_PRICE_FROM); ?>");
  216.       error_field = document.getElementById("advanced_search").pto;
  217.       error_found = true;
  218.     }
  219.   }
  220.  
  221.   if (error_found == true) {
  222.     alert(error_message);
  223.     error_field.focus();
  224.     return false;
  225.   }
  226. }
  227.  
  228. function popupWindow(url) {
  229.   window.open(url,'popupWindow','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,copyhistory=no,width=450,height=280,screenX=150,screenY=150,top=150,left=150')
  230. }
  231. //--></script>
  232. <?php
  233. }
  234.  
  235. if (strstr($PHP_SELF, FILENAME_PRODUCT_REVIEWS_WRITE )) {
  236. ?>
  237.  
  238. <script type="text/javascript"><!--
  239. function checkForm() {
  240.   var error = 0;
  241.   var error_message = unescape("<?php echo xtc_js_lang(JS_ERROR); ?>");
  242.  
  243.   var review = document.getElementById("product_reviews_write").review.value;
  244.  
  245.   if (review.length < <?php echo REVIEW_TEXT_MIN_LENGTH; ?>) {
  246.     error_message = error_message + unescape("<?php echo xtc_js_lang(JS_REVIEW_TEXT); ?>");
  247.     error = 1;
  248.   }
  249.  
  250.   if (!((document.getElementById("product_reviews_write").rating[0].checked) || (document.getElementById("product_reviews_write").rating[1].checked) || (document.getElementById("product_reviews_write").rating[2].checked) || (document.getElementById("product_reviews_write").rating[3].checked) || (document.getElementById("product_reviews_write").rating[4].checked))) {
  251.     error_message = error_message + unescape("<?php echo xtc_js_lang(JS_REVIEW_RATING); ?>");
  252.     error = 1;
  253.   }
  254.  
  255.   if (error == 1) {
  256.     alert(error_message);
  257.     return false;
  258.   } else {
  259.     return true;
  260.   }
  261. }
  262. //--></script>
  263. <?php
  264. }
  265. if (strstr($PHP_SELF, FILENAME_POPUP_IMAGE )) {
  266. ?>
  267.  
  268. <script type="text/javascript"><!--
  269. var i=0;
  270. function resize() {
  271.   if (navigator.appName == 'Netscape') i=40;
  272.   if (document.images[0]) window.resizeTo(document.images[0].width +30, document.images[0].height+60-i);
  273.   self.focus();
  274. }
  275. //--></script>
  276. <?php
  277. }
  278.  
  279. ?>
  280. </head>
  281. <?php
  282. if (strstr($PHP_SELF, FILENAME_POPUP_IMAGE )) {
  283. echo '<body onload="resize();"> ';
  284. } else {
  285. echo '<body>';
  286. }
  287.  
  288. // econda tracking
  289. if (TRACKING_ECONDA_ACTIVE=='true') {  
  290. ?>
  291. <script type="text/javascript">
  292. <!--
  293. var emos_kdnr='<?php echo TRACKING_ECONDA_ID; ?>';
  294. //-->
  295. </script>
  296. <a name="emos_sid" rel="<?php echo session_id(); ?>" rev=""></a>
  297. <a name="emos_name" title="siteid" rel="<?php echo $_SESSION['languages_id']; ?>" rev=""></a>
  298. <?php  
  299. //  require_once(DIR_WS_INCLUDES . 'econda/econda.php');
  300. }
  301.  
  302.  
  303. if (strstr($PHP_SELF, FILENAME_CHECKOUT_SUCCESS) && GOOGLE_CONVERSION == 'true') {
  304. require('includes/google_conversiontracking.js.php');
  305. }
  306.  
  307.  
  308.   // include needed functions
  309.   require_once('inc/xtc_output_warning.inc.php');
  310.   require_once('inc/xtc_image.inc.php');
  311.   require_once('inc/xtc_parse_input_field_data.inc.php');
  312.   require_once('inc/xtc_draw_separator.inc.php');
  313.  
  314. //  require_once('inc/xtc_draw_form.inc.php');
  315. //  require_once('inc/xtc_draw_pull_down_menu.inc.php');
  316.  
  317.   // check if the 'install' directory exists, and warn of its existence
  318.   if (WARN_INSTALL_EXISTENCE == 'true') {
  319.     if (file_exists(dirname($_SERVER['SCRIPT_FILENAME']) . '/xtc_installer')) {
  320.       xtc_output_warning(WARNING_INSTALL_DIRECTORY_EXISTS);
  321.     }
  322.   }
  323.  
  324.   // check if the configure.php file is writeable
  325.   if (WARN_CONFIG_WRITEABLE == 'true') {
  326.     if ( (file_exists(dirname($_SERVER['SCRIPT_FILENAME']) . '/includes/configure.php')) && (is_writeable(dirname($_SERVER['SCRIPT_FILENAME']) . '/includes/configure.php')) ) {
  327.       xtc_output_warning(WARNING_CONFIG_FILE_WRITEABLE);
  328.     }
  329.   }
  330.  
  331.   // check if the session folder is writeable
  332.   if (WARN_SESSION_DIRECTORY_NOT_WRITEABLE == 'true') {
  333.     if (STORE_SESSIONS == '') {
  334.       if (!is_dir(xtc_session_save_path())) {
  335.         xtc_output_warning(WARNING_SESSION_DIRECTORY_NON_EXISTENT);
  336.       } elseif (!is_writeable(xtc_session_save_path())) {
  337.         xtc_output_warning(WARNING_SESSION_DIRECTORY_NOT_WRITEABLE);
  338.       }
  339.     }
  340.   }
  341.  
  342.   // check session.auto_start is disabled
  343.   if ( (function_exists('ini_get')) && (WARN_SESSION_AUTO_START == 'true') ) {
  344.     if (ini_get('session.auto_start') == '1') {
  345.       xtc_output_warning(WARNING_SESSION_AUTO_START);
  346.     }
  347.   }
  348.  
  349.   if ( (WARN_DOWNLOAD_DIRECTORY_NOT_READABLE == 'true') && (DOWNLOAD_ENABLED == 'true') ) {
  350.     if (!is_dir(DIR_FS_DOWNLOAD)) {
  351.       xtc_output_warning(WARNING_DOWNLOAD_DIRECTORY_NON_EXISTENT);
  352.     }
  353.   }
  354.  
  355.  
  356. $smarty->assign('navtrail',$breadcrumb->trail(' &raquo; '));
  357. // BOF - Hetfield - 2009-12-17 - added new links index and login for index.html
  358. if (isset($_SESSION['customer_id'])) {
  359.     $smarty->assign('logoff',xtc_href_link(FILENAME_LOGOFF, '', 'SSL'));
  360. } else {
  361.     $smarty->assign('login',xtc_href_link(FILENAME_LOGIN, '', 'SSL'));
  362. }
  363. $smarty->assign('index',xtc_href_link(FILENAME_DEFAULT));
  364. // EOF - Hetfield - 2009-12-17 - added new links index and login for index.html
  365. if ( $_SESSION['account_type']=='0') {
  366. $smarty->assign('account',xtc_href_link(FILENAME_ACCOUNT, '', 'SSL'));
  367. }
  368. $smarty->assign('cart',xtc_href_link(FILENAME_SHOPPING_CART, '', 'NONSSL')); // web28 - 2010-09-20 - change SSL -> NONSSL
  369. $smarty->assign('checkout',xtc_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL'));
  370.  
  371. // BOF - Dokuman - 2009-05-27 - added htmlspecialchars
  372. //$smarty->assign('store_name',TITLE);
  373. $smarty->assign('store_name', htmlspecialchars(TITLE));
  374. // EOF - Dokuman - 2009-05-27 - added htmlspecialchars
  375.  
  376. if (isset($_GET['error_message']) && xtc_not_null($_GET['error_message'])) {
  377.     $smarty->assign('error','<p class="errormessage">'. htmlspecialchars(urldecode($_GET['error_message'])).'</p>');
  378. }
  379. if (isset($_GET['info_message']) && xtc_not_null($_GET['info_message'])) {
  380.     $smarty->assign('error','<p class="errormessage">'.htmlspecialchars($_GET['info_message']).'</p>');
  381. }
  382.  
  383. include(DIR_WS_INCLUDES.FILENAME_BANNER);
  384. //BOF - web28- 2010-07-07 SHOP OFFLINE INFO
  385. require_once(DIR_FS_INC . 'xtc_get_shop_conf.inc.php');
  386. if(xtc_get_shop_conf('SHOP_OFFLINE') != 'checked' || $_SESSION['customers_status']['customers_status_id'] == 0) {  
  387.     //Do nothing
  388. } else {    
  389.     $smarty->assign('language', $_SESSION['language']);
  390.     $smarty->assign('shop_offline_msg', xtc_get_shop_conf('SHOP_OFFLINE_MSG'));
  391.     $smarty->display(CURRENT_TEMPLATE.'/offline.html');
  392.     EXIT;
  393. }
  394. //EOF  - web28- 2010-07-07 SHOP OFFLINE INFO
  395. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement