[phpBB Debug] PHP Warning: in file [ROOT]/includes/crs/crs_misc_functions.php on line 37: mime_content_type(): Empty filename or path
[phpBB Debug] PHP Warning: in file [ROOT]/includes/crs/crs_misc_functions.php on line 37: mime_content_type(): Empty filename or path
Zen Cart 源代码 whos_online.php

Zen Cart 源代码 whos_online.php




下载文件

文件名: whos_online.php
文件类型: PHP文件
文件大小: 28.49 KiB
MD5: f58edc71201c32112faa4cc7e874031c

whos_online.php - 关闭高亮
  1. <?php
  2. /**
  3.  * @package admin
  4.  * @copyright Copyright 2003-2011 Zen Cart Development Team
  5.  * @copyright Portions Copyright 2003 osCommerce
  6.  * @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
  7.  * @version $Id: whos_online.php 18695 2011-05-04 05:24:19Z drbyte $
  8.  */
  9.  
  10. // Default refresh interval (0=off).  NOTE: Using automated refresh may put you in breach of PCI Compliance
  11.   $defaultRefreshInterval = 0;
  12.  
  13. // highlight bots
  14. function zen_check_bot($checking) {
  15.   if (empty($checking)) {
  16.     return true;
  17.   } else {
  18.     return false;
  19.   }
  20. }
  21.  
  22. function zen_check_quantity($which) {
  23.   global $db;
  24.   $which_query = $db->Execute("select sesskey, value
  25.                               from " . TABLE_SESSIONS . "
  26.                               where sesskey= '" . $which . "'");
  27.  
  28.   $who_query = $db->Execute("select session_id, time_entry, time_last_click, host_address, user_agent
  29.                             from " . TABLE_WHOS_ONLINE . "
  30.                             where session_id='" . $which . "'");
  31.  
  32.   // longer than 2 minutes light color
  33.   $xx_mins_ago_long = (time() - WHOIS_TIMER_INACTIVE);
  34.  
  35.   $chk_cart_status = base64_decode($which_query->fields['value']);
  36.   switch (true) {
  37.     case ($which_query->RecordCount() == 0):
  38.     if ($who_query->fields['time_last_click'] < $xx_mins_ago_long) {
  39.       return zen_image(DIR_WS_IMAGES . 'icon_status_red_light.gif');
  40.     } else {
  41.       return zen_image(DIR_WS_IMAGES . 'icon_status_red.gif');
  42.     }
  43.     break;
  44.     case (strstr($chk_cart_status,'"contents";a:0:')):
  45.     if ($who_query->fields['time_last_click'] < $xx_mins_ago_long) {
  46.       return zen_image(DIR_WS_IMAGES . 'icon_status_red_light.gif');
  47.     } else {
  48.       return zen_image(DIR_WS_IMAGES . 'icon_status_red.gif');
  49.     }
  50.     break;
  51.     case (!strstr($chk_cart_status,'"contents";a:0:')):
  52.     if ($who_query->fields['time_last_click'] < $xx_mins_ago_long) {
  53.       return zen_image(DIR_WS_IMAGES . 'icon_status_yellow.gif');
  54.     } else {
  55.       return zen_image(DIR_WS_IMAGES . 'icon_status_green.gif');
  56.     }
  57.     break;
  58.   }
  59. }
  60.  
  61. // time since last click
  62. function zen_check_minutes($the_time_last_click) {
  63.   $the_seconds = (time() - $the_time_last_click);
  64.   $the_time_since= gmdate('H:i:s', $the_seconds);
  65.   return $the_time_since;
  66. }
  67.  
  68.   require('includes/application_top.php');
  69.  
  70.   require(DIR_WS_CLASSES . 'currencies.php');
  71.   $currencies = new currencies();
  72.  
  73.   // same time_entry as time_last_click for 600 seconds = 10 minutes assumed to have left immediately
  74.   $xx_mins_ago_dead = (time() - WHOIS_TIMER_DEAD);
  75.  
  76.   // remove after how many seconds? default= 1200 = 20 minutes
  77.   $xx_mins_ago = (time() - WHOIS_TIMER_REMOVE);
  78.  
  79. // remove entries that have expired
  80.   $db->Execute("delete from " . TABLE_WHOS_ONLINE . "
  81.                where time_last_click < '" . $xx_mins_ago . "'
  82.                or (time_entry=time_last_click
  83.                and time_last_click < '" . $xx_mins_ago_dead . "')");
  84.  
  85.   if (!isset($_SESSION['wo_exclude_admins'])) {
  86.     $_SESSION['wo_exclude_admins'] = TRUE;
  87.   }
  88.   if (isset($_GET['na'])) {
  89.     $_SESSION['wo_exclude_admins'] = ($_GET['na'] == 0) ? FALSE : TRUE;
  90.   }
  91.  
  92.   if (!isset($_SESSION['wo_exclude_spiders'])) {
  93.     $_SESSION['wo_exclude_spiders'] = TRUE;
  94.   }
  95.   if (isset($_GET['ns'])) {
  96.     $_SESSION['wo_exclude_spiders'] = ($_GET['ns'] == 0) ? FALSE : TRUE;
  97.   }
  98.  
  99.   if (isset($_GET['t']) ) {
  100.     $_SESSION['wo_timeout'] = (int)$_GET['t'];
  101.   }
  102.   if (!isset($_SESSION['wo_timeout'])) {
  103.     $_SESSION['wo_timeout'] = $defaultRefreshInterval;
  104.   }
  105.   if (!isset($_SESSION['wo_timeout']) || $_SESSION['wo_timeout'] < 3) {
  106.     $_SESSION['wo_timeout'] = 0;
  107.   }
  108.  
  109.   $listing = $_GET['q'];
  110.   switch ($listing) {
  111.       case "full_name-desc":
  112.       $order = "full_name DESC, LPAD(ip_address,11,'0')";
  113.       break;
  114.       case "full_name":
  115.       $order = "full_name, LPAD(ip_address,11,'0')";
  116.       break;
  117.       case "ip_address":
  118.       $order = "ip_address, session_id";
  119.       break;
  120.       case "ip_address-desc":
  121.       $order = "ip_address DESC, session_id";
  122.       break;
  123.       case "time_last_click-desc":
  124.       $order = "time_last_click DESC, LPAD(ip_address,11,'0')";
  125.       break;
  126.       case "time_last_click":
  127.       $order = "time_last_click, LPAD(ip_address,11,'0')";
  128.       break;
  129.       case "time_entry-desc":
  130.       $order = "time_entry DESC, LPAD(ip_address,11,'0')";
  131.       break;
  132.       case "time_entry":
  133.       $order = "time_entry, LPAD(ip_address,11,'0')";
  134.       break;
  135.       case "last_page_url-desc":
  136.       $order = "last_page_url DESC, LPAD(ip_address,11,'0')";
  137.       break;
  138.       case "last_page_url":
  139.       $order = "last_page_url, LPAD(ip_address,11,'0')";
  140.       break;
  141.       case "session_id":
  142.       $order = "session_id, ip_address";
  143.       break;
  144.       case "session_id-desc":
  145.       $order = "session_id DESC, ip_address";
  146.       break;
  147.       default:
  148.       $order = "time_entry, LPAD(ip_address,11,'0')";
  149.   }
  150.   $where = '';
  151.   if ($_SESSION['wo_exclude_spiders']) {
  152.     $where = "where session_id != '' ";
  153.   }
  154.   if ($_SESSION['wo_exclude_admins']) {
  155.     $where .= ($where == '') ? " where " : " and ";
  156.     $where .= "ip_address != '' and ip_address not in ('" . implode("','", preg_split('/[\s,]/', EXCLUDE_ADMIN_IP_FOR_MAINTENANCE . ',' . $_SERVER['REMOTE_ADDR'])) . "') ";
  157.   }
  158.   $sql = "select customer_id, full_name, ip_address, time_entry, time_last_click, last_page_url, session_id, host_address, user_agent
  159.          from " . TABLE_WHOS_ONLINE . " :where: order by :orderby:";
  160.   $sql = $db->bindVars($sql, ':where:', $where, 'passthru');
  161.   $sql = $db->bindVars($sql, ':orderby:', $order, 'passthru');
  162.   $whos_online = $db->Execute($sql);
  163.   $total_sess = $whos_online->RecordCount();
  164.  
  165.   $optURL = FILENAME_WHOS_ONLINE . '.php?' . zen_get_all_get_params(array('t', 'na', 'ns'));
  166.   $listingURL = FILENAME_WHOS_ONLINE . '.php?' . zen_get_all_get_params(array('q', 't', 'na', 'ns'));
  167. ?>
  168. <!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
  169. <html <?php echo HTML_PARAMS; ?>>
  170. <head>
  171. <meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">
  172. <title><?php echo TITLE; ?></title>
  173. <link rel="stylesheet" type="text/css" href="includes/stylesheet.css">
  174. <link rel="stylesheet" type="text/css" href="includes/cssjsmenuhover.css" media="all" id="hoverJS">
  175. <script language="javascript" src="includes/menu.js"></script>
  176. <script language="javascript" src="includes/general.js"></script>
  177. <script type="text/javascript">
  178.   <!--
  179.   function init()
  180.   {
  181.     cssjsmenu('navbar');
  182.     if (document.getElementById)
  183.     {
  184.       var kill = document.getElementById('hoverJS');
  185.       kill.disabled = true;
  186.     }
  187.   }
  188.  function refreshTimer(time)
  189.   {
  190.      if(time.length>=2) {
  191.      clearTimeout(initTimer);
  192.      if(theTimer!=null) {
  193.        clearTimeout(theTimer);
  194.      }
  195.      var theTimer = setTimeout('window.location="<?php echo $optURL; ?>t='+time+'&auto=true"', (time*1000));
  196.    }
  197.   }
  198. <?php if (isset($_SESSION['wo_timeout']) && (int)$_SESSION['wo_timeout'] > 0) { ?>
  199.    var initTimer = setTimeout('location.reload(true)', <?php echo (isset($_SESSION['wo_timeout'])) ? $_SESSION['wo_timeout'] * 1000 : '60000'; ?>);
  200. <?php } ?>
  201.  
  202.   // -->
  203. </script>
  204. <style>
  205. <!-- inline CSS Styles
  206. .whos-online td {
  207.   color:#444;
  208.   font-family:Helvetica, Arial, sans-serif;
  209.   }
  210. .whos-online td.infoBoxHeading {
  211.   color:#fff;
  212.   }
  213. .last-url-link {
  214.   background:#fff;
  215.   border:1px dashed #aaa;
  216.   margin:5px 0;
  217.   padding:5px;
  218.   }
  219. .last-url-link a {
  220.   color:green;
  221.   }
  222. .dataTableRowBot .last-url-link a {color: #333;}
  223. .dataTableRowSelectedBot .last-url-link a {color: #333;}
  224. .dataTableRowBot .last-url-link {background: #f0cbfa;}
  225. .dataTableRowSelectedBot .last-url-link {background: #f0cbfa;}
  226.  
  227. #wo-legend {float: left;}
  228. #wo-filters { float: right; background-color: #599659; color: #fff}
  229. #wo-filters .optionClick { display: inline-block; color: #fff; border: 1px solid #fff; font-weight: bold; padding: 1px; margin: 2px 1px;}
  230. #wo-filters .chosen {background-color: #003D00;}
  231. -->
  232. </style>
  233. </head>
  234. <body onLoad="init()">
  235. <!-- header //-->
  236. <?php require(DIR_WS_INCLUDES . 'header.php'); ?>
  237. <!-- header_eof //-->
  238.  
  239. <!-- body //-->
  240. <table border="0" width="100%" cellspacing="2" cellpadding="2">
  241.   <tr>
  242. <!-- body_text //-->
  243.     <td width="100%" valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2">
  244.       <tr>
  245.         <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
  246.           <tr>
  247.             <td class="pageHeading"><?php echo HEADING_TITLE; ?></td>
  248.             <td class="pageHeading" align="right"><?php echo zen_draw_separator('pixel_trans.gif', HEADING_IMAGE_WIDTH, HEADING_IMAGE_HEIGHT); ?></td>
  249.           </tr>
  250.           <tr>
  251.             <td class="smallText" colspan="2"><div id="wo-legend">
  252.               <?php echo
  253.               '<a href="' . zen_href_link(FILENAME_WHOS_ONLINE . '.php', zen_get_all_get_params()) . '" class="menuBoxContentLink">' . '<strong><u>' . WHOS_ONLINE_REFRESH_LIST_TEXT . '</u></strong>' . '</a>' .
  254.               '<br />' . "\n" . WHOS_ONLINE_LEGEND_TEXT . '&nbsp;' .
  255.               zen_image(DIR_WS_IMAGES . 'icon_status_green.gif') . '&nbsp;' . WHOS_ONLINE_ACTIVE_TEXT . '&nbsp;&nbsp;' .
  256.               zen_image(DIR_WS_IMAGES . 'icon_status_yellow.gif') . '&nbsp;' . WHOS_ONLINE_INACTIVE_TEXT . '&nbsp;&nbsp;' .
  257.               zen_image(DIR_WS_IMAGES . 'icon_status_red.gif') . '&nbsp;' . WHOS_ONLINE_ACTIVE_NO_CART_TEXT . '&nbsp;&nbsp;' .
  258.               zen_image(DIR_WS_IMAGES . 'icon_status_red_light.gif') . '&nbsp;' . WHOS_ONLINE_INACTIVE_NO_CART_TEXT . '<br />' .
  259.               WHOS_ONLINE_INACTIVE_LAST_CLICK_TEXT . '&nbsp;' . WHOIS_TIMER_INACTIVE . 's' .'&nbsp;||&nbsp;' . WHOS_ONLINE_INACTIVE_ARRIVAL_TEXT . '&nbsp;' .
  260.               WHOIS_TIMER_DEAD . 's&nbsp;' . WHOS_ONLINE_REMOVED_TEXT;?>
  261.               </div>
  262.  
  263.               <div id="wo-filters">
  264.                 <?php echo TEXT_WHOS_ONLINE_TIMER_UPDATING . ($_SESSION['wo_timeout'] > 0 ? sprintf(TEXT_WHOS_ONLINE_TIMER_EVERY, $_SESSION['wo_timeout']) : TEXT_WHOS_ONLINE_TIMER_DISABLED); ?>
  265.  
  266.                 <a class="optionClick<?php echo ($_SESSION['wo_timeout']=='0') ? ' chosen' : ''; ?>" href="<?php echo $optURL;?>t=0"><?php echo TEXT_WHOS_ONLINE_TIMER_FREQ0; ?></a>&nbsp;
  267.                 <a class="optionClick<?php echo ($_SESSION['wo_timeout']=='5') ? ' chosen' : ''; ?>" href="<?php echo $optURL;?>t=5"><?php echo TEXT_WHOS_ONLINE_TIMER_FREQ1; ?></a>&nbsp;
  268.                 <a class="optionClick<?php echo ($_SESSION['wo_timeout']=='15') ? ' chosen' : ''; ?>" href="<?php echo $optURL;?>t=15"><?php echo TEXT_WHOS_ONLINE_TIMER_FREQ2; ?></a>&nbsp;
  269.                 <a class="optionClick<?php echo ($_SESSION['wo_timeout']=='30') ? ' chosen' : ''; ?>" href="<?php echo $optURL;?>t=30"><?php echo TEXT_WHOS_ONLINE_TIMER_FREQ3; ?></a>&nbsp;
  270.                 <a class="optionClick<?php echo ($_SESSION['wo_timeout']=='60') ? ' chosen' : ''; ?>" href="<?php echo $optURL;?>t=60"><?php echo TEXT_WHOS_ONLINE_TIMER_FREQ4; ?></a>&nbsp;<br />
  271.  
  272.                 <?php echo TEXT_WHOS_ONLINE_FILTER_SPIDERS; ?>
  273.                 <a class="optionClick<?php echo ($_SESSION['wo_exclude_spiders'])  ? ' chosen' : ''; ?>" href="<?php echo $optURL;?>ns=1"><?php echo TEXT_YES; ?></a>&nbsp;
  274.                 <a class="optionClick<?php echo (!$_SESSION['wo_exclude_spiders']) ? ' chosen' : ''; ?>" href="<?php echo $optURL;?>ns=0"><?php echo TEXT_NO; ?></a>&nbsp;
  275.                 &nbsp;&nbsp&nbsp;
  276.                 <?php echo TEXT_WHOS_ONLINE_FILTER_ADMINS; ?>
  277.                 <a class="optionClick<?php echo ($_SESSION['wo_exclude_admins'])  ? ' chosen' : ''; ?>" href="<?php echo $optURL;?>na=1"><?php echo TEXT_YES; ?></a>&nbsp;
  278.                 <a class="optionClick<?php echo (!$_SESSION['wo_exclude_admins']) ? ' chosen' : ''; ?>" href="<?php echo $optURL;?>na=0"><?php echo TEXT_NO; ?></a>&nbsp;
  279.               </div>
  280.             </td>
  281.           </tr>
  282.           <tr>
  283.             <td class="smallText" colspan="2" valign="top"><?php echo sprintf(TEXT_NUMBER_OF_CUSTOMERS, $total_sess);?>
  284.             </td>
  285.           </tr>
  286.           <tr>
  287.             <td colspan="2"><?php echo zen_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
  288.           </tr>
  289.         </table></td>
  290.       </tr>
  291.       <tr class="whos-online">
  292.         <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
  293.           <tr>
  294.             <td valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2">
  295.               <tr class="dataTableHeadingRowWhois">
  296.                 <td class="dataTableHeadingContentWhois"><?php echo TABLE_HEADING_ONLINE; ?></td>
  297.                 <td class="dataTableHeadingContentWhois" align="center"><?php echo TABLE_HEADING_CUSTOMER_ID; ?></td>
  298.  
  299.                 <td class="dataTableHeadingContentWhois" align="center">
  300.                   <?php echo (($listing=='full_name-desc' or $listing=='full_name') ? '<span class="dataTableHeadingContentWhois">' . TABLE_HEADING_FULL_NAME . '</span>' : TABLE_HEADING_FULL_NAME); ?>&nbsp;
  301.                   <br /><a href="<?php echo $listingURL . "q=full_name"; ?>"><?php echo ($listing=='full_name' ? '<span class="dataTableHeadingContentWhois">' . 'Asc' . '</span>' : '<b>' . 'Asc' . '</b>'); ?></a>&nbsp;
  302.                   &nbsp;<a href="<?php echo $listingURL . "q=full_name-desc"; ?>"><?php echo ($listing=='full_name-desc' ? '<span class="dataTableHeadingContentWhois">' . 'Desc' . '</span>' : '<b>' . 'Desc' . '</b>'); ?></a>&nbsp;
  303.                 </td>
  304.                 <td class="dataTableHeadingContentWhois" align="center">
  305.                   <?php echo (($listing=='ip_address-desc' or $listing=='ip_address') ? '<span class="dataTableHeadingContentWhois">' . TABLE_HEADING_IP_ADDRESS . '</span>' : TABLE_HEADING_IP_ADDRESS); ?>&nbsp;
  306.                   <br /><a href="<?php echo $listingURL . "q=ip_address"; ?>"><?php echo ($listing=='ip_address' ? '<span class="dataTableHeadingContentWhois">' . 'Asc' . '</span>' : '<b>' . 'Asc' . '</b>'); ?></a>&nbsp;
  307.                   &nbsp;<a href="<?php echo $listingURL . "q=ip_address-desc"; ?>"><?php echo ($listing=='ip_address-desc' ? '<span class="dataTableHeadingContentWhois">' . 'Desc' . '</span>' : '<b>' . 'Desc' . '</b>'); ?></a>&nbsp;
  308.                 </td>
  309.                 <td class="dataTableHeadingContentWhois" align="center">
  310.                   <?php echo (($listing=='session_id-desc' or $listing=='session_id') ? '<span class="dataTableHeadingContentWhois">' . TABLE_HEADING_SESSION_ID . '</span>' : TABLE_HEADING_SESSION_ID); ?>&nbsp;
  311.                   <br /><a href="<?php echo $listingURL . "q=session_id"; ?>"><?php echo ($listing=='session_id' ? '<span class="dataTableHeadingContentWhois">' . 'Asc' . '</span>' : '<b>' . 'Asc' . '</b>'); ?></a>&nbsp;
  312.                   &nbsp;<a href="<?php echo $listingURL . "q=session_id-desc"; ?>"><?php echo ($listing=='session_id-desc' ? '<span class="dataTableHeadingContentWhois">' . 'Desc' . '</span>' : '<b>' . 'Desc' . '</b>'); ?></a>&nbsp;
  313.                 </td>
  314.                 <td class="dataTableHeadingContentWhois" align="center">
  315.                   <?php echo (($listing=='time_entry-desc' or $listing=='time_entry') ? '<span class="dataTableHeadingContentWhois">' . TABLE_HEADING_ENTRY_TIME . '</span>' : TABLE_HEADING_ENTRY_TIME); ?>&nbsp;
  316.                   <br /><a href="<?php echo $listingURL . "q=time_entry"; ?>"><?php echo ($listing=='time_entry' ? '<span class="dataTableHeadingContentWhois">' . 'Asc' . '</span>' : '<b>' . 'Asc' . '</b>'); ?></a>&nbsp;
  317.                   &nbsp;<a href="<?php echo $listingURL . "q=time_entry-desc"; ?>"><?php echo ($listing=='time_entry-desc' ? '<span class="dataTableHeadingContentWhois">' . 'Desc' . '</span>' : '<b>' . 'Desc' . '</b>'); ?></a>&nbsp;
  318.                 </td>
  319.                 <td class="dataTableHeadingContentWhois" align="center">
  320.                   <?php echo (($listing=='time_last_click-desc' or $listing=='time_last_click') ? '<span class="dataTableHeadingContentWhois">' . TABLE_HEADING_LAST_CLICK . '</span>' : TABLE_HEADING_LAST_CLICK); ?>&nbsp;
  321.                   <br /><a href="<?php echo $listingURL . "q=time_last_click"; ?>"><?php echo ($listing=='time_last_click' ? '<span class="dataTableHeadingContentWhois">' . 'Asc' . '</span>' : '<b>' . 'Asc' . '</b>'); ?></a>&nbsp;
  322.                   &nbsp;<a href="<?php echo $listingURL . "q=time_last_click-desc"; ?>"><?php echo ($listing=='time_last_click-desc' ? '<span class="dataTableHeadingContentWhois">' . 'Desc' . '</span>' : '<b>' . 'Desc' . '</b>'); ?></a>&nbsp;
  323.                 </td>
  324.                 <td class="dataTableHeadingContentWhois" align="center">
  325.                   <?php echo (($listing=='last_page_url-desc' or $listing=='last_page_url') ? '<span class="dataTableHeadingContentWhois">' . TABLE_HEADING_LAST_PAGE_URL . '</span>' : TABLE_HEADING_LAST_PAGE_URL); ?>&nbsp;
  326.                   <br /><a href="<?php echo $listingURL . "q=last_page_url"; ?>"><?php echo ($listing=='last_page_url' ? '<span class="dataTableHeadingContentWhois">' . 'Asc' . '</span>' : '<b>' . 'Asc' . '</b>'); ?></a>&nbsp;
  327.                   &nbsp;<a href="<?php echo $listingURL . "q=last_page_url-desc"; ?>"><?php echo ($listing=='last_page_url-desc' ? '<span class="dataTableHeadingContentWhois">' . 'Desc' . '</span>' : '<b>' . 'Desc' . '</b>'); ?></a>&nbsp;
  328.                 </td>
  329.               </tr>
  330. <?php
  331.   $ip_array = array();
  332.   $d=0;
  333.   while (!$whos_online->EOF) {
  334.     $time_online = (time() - $whos_online->fields['time_entry']);
  335.     if ( ((!$_GET['info']) || (@$_GET['info'] == $whos_online->fields['session_id'])) && (!$info) ) {
  336.       $info = $whos_online->fields['session_id'];
  337.       $ip_address = $whos_online->fields['ip_address'];
  338.       $full_name = $whos_online->fields['full_name'];
  339.     }
  340.  
  341. // Check for duplicates
  342.     if (in_array($whos_online->fields['ip_address'], $ip_array)) {
  343.       $d++;
  344.     } else {
  345.       $ip_array[] = $whos_online->fields['ip_address'];
  346.     }
  347.  
  348. // Check for bots
  349.     $is_a_bot=zen_check_bot($whos_online->fields['session_id']);
  350.   if ($whos_online->fields['session_id'] == $info) {
  351.       if ($is_a_bot==true) {
  352.         echo '              <tr class="dataTableRowSelectedBot">' . "\n";
  353.       } else {
  354.         echo '              <tr class="dataTableRowSelectedWhois">' . "\n";
  355.       }
  356.   } else {
  357.     if ($is_a_bot==true) {
  358.         echo '              <tr class="dataTableRowBot" onmouseover="this.className=\'dataTableRowOverBot\';this.style.cursor=\'hand\'" onmouseout="this.className=\'dataTableRowBot\'" onclick="document.location.href=\'' . zen_href_link(FILENAME_WHOS_ONLINE, zen_get_all_get_params(array('info', 'action')) . 'info=' . $whos_online->fields['session_id'], 'NONSSL') . '\'">' . "\n";
  359.       } else {
  360.         echo '              <tr class="dataTableRowWhois" onmouseover="this.className=\'dataTableRowOverWhois\';this.style.cursor=\'hand\'" onmouseout="this.className=\'dataTableRowWhois\'" onclick="document.location.href=\'' . zen_href_link(FILENAME_WHOS_ONLINE, zen_get_all_get_params(array('info', 'action')) . 'info=' . $whos_online->fields['session_id'], 'NONSSL') . '\'">' . "\n";
  361.       }
  362.   }
  363. ?>
  364.                 <td class="dataTableContentWhois"><?php echo zen_check_quantity($whos_online->fields['session_id']) . '&nbsp;' . gmdate('H:i:s', $time_online); ?></td>
  365.                 <td class="dataTableContentWhois" align="center">
  366.                   <?php
  367.                     if ($whos_online->fields['customer_id'] != 0) {
  368.                       echo '<a href="' . zen_href_link(FILENAME_CUSTOMERS, zen_get_all_get_params(array('cID', 'action')) . 'cID=' . $whos_online->fields['customer_id'] . '&action=edit', 'NONSSL') . '"><u>' . $whos_online->fields['customer_id'] . '</u></a>';
  369.                     } else {
  370.                       echo $whos_online->fields['customer_id'];
  371.                     }
  372.                   ?>
  373.                 </td>
  374.                 <td class="dataTableContentWhois" nowrap="nowrap">
  375.                   <?php
  376.                     if ($whos_online->fields['customer_id'] != 0) {
  377.                       echo '<a href="' . zen_href_link(FILENAME_ORDERS, 'cID=' . $whos_online->fields['customer_id'], 'NONSSL') . '">' . '<u>' . $whos_online->fields['full_name'] . '</u></a>';
  378.                     } else {
  379.                       echo $whos_online->fields['full_name'];
  380.                     }
  381.                   ?>
  382.                 </td>
  383.                 <td class="dataTableContentWhois" align="left" valign="top"><a href="http://whois.domaintools.com/<?php echo $whos_online->fields['ip_address']; ?>" target="_blank"><?php echo '<u>' . $whos_online->fields['ip_address'] . '</u>'; ?></a></td>
  384.                 <td>&nbsp;</td>
  385.                 <td class="dataTableContentWhois" align="center" valign="top"><?php echo date('H:i:s', $whos_online->fields['time_entry']); ?></td>
  386.                 <td class="dataTableContentWhois" align="center" valign="top"><?php echo date('H:i:s', $whos_online->fields['time_last_click']); ?></td>
  387.                 <td class="dataTableContentWhois" colspan="2" valign="top">&nbsp;</td>
  388.               </tr>
  389. <?php
  390.   // show host name
  391.   if (WHOIS_SHOW_HOST=='1') {
  392.     if ($whos_online->fields['session_id'] == $info) {
  393.     if ($is_a_bot==true) {
  394.         echo '              <tr class="dataTableRowSelectedBot">' . "\n";
  395.       } else {
  396.         echo '              <tr class="dataTableRowSelectedWhois">' . "\n";
  397.       }
  398.     } else {
  399.       if ($is_a_bot==true) {
  400.         echo '              <tr class="dataTableRowBot" onmouseout="this.className=\'dataTableRowBot\'" onclick="document.location.href=\'' . zen_href_link(FILENAME_WHOS_ONLINE, zen_get_all_get_params(array('info', 'action')) . 'info=' . zen_output_string_protected($whos_online->fields['session_id']), 'NONSSL') . '\'">' . "\n";
  401.       } else {
  402.         echo '              <tr class="dataTableRowWhois" onmouseout="this.className=\'dataTableRowWhois\'" onclick="document.location.href=\'' . zen_href_link(FILENAME_WHOS_ONLINE, zen_get_all_get_params(array('info', 'action')) . 'info=' . zen_output_string_protected($whos_online->fields['session_id']), 'NONSSL') . '\'">' . "\n";
  403.       }
  404.   }
  405. ?>
  406.                 <td class="dataTableContentWhois" colspan=3 valign="top">&nbsp;&nbsp;<?php echo TIME_PASSED_LAST_CLICKED . '<br />&nbsp;&nbsp;&nbsp;&nbsp;' . zen_check_minutes($whos_online->fields['time_last_click']); ?> ago</td>
  407.                 <td class="dataTableContentWhois" colspan=5 valign="top">
  408.                   <?php
  409.                     echo TEXT_SESSION_ID . zen_output_string_protected($whos_online->fields['session_id']) . '<br />' .
  410.                     TEXT_HOST . zen_output_string_protected($whos_online->fields['host_address']) . '<br />' .
  411.                     TEXT_USER_AGENT . zen_output_string_protected($whos_online->fields['user_agent']) . '<br />';
  412.  
  413.                     $lastURLlink = '<a href="' . zen_output_string_protected($whos_online->fields['last_page_url']) . '" target="_blank">' . '<u>' . zen_output_string_protected($whos_online->fields['last_page_url']) . '</u>' . '</a>';
  414.                     if (preg_match('/^(.*)' . zen_session_name() . '=[a-f,0-9]+[&]*(.*)/i', $whos_online->fields['last_page_url'], $array)) {
  415.                       $lastURLlink = zen_output_string_protected($array[1] . $array[2]);
  416.                     }
  417.                     echo '<div class="last-url-link">' . $lastURLlink . '</div>';
  418.                   ?>
  419.                 </td>
  420.  
  421.               </tr>
  422. <?php
  423.   } // show host
  424. ?>
  425.               <tr>
  426.                <td colspan="8"><?php echo zen_draw_separator('pixel_trans.gif', '1', '3'); ?></td>
  427.               </tr>
  428.  
  429. <?php
  430.   $whos_online->MoveNext();
  431.   }
  432.   if (!$d) {
  433.     $d=0;
  434.   }
  435.   $total_dupes = $d;
  436.   $ip_unique = sizeof($ip_array);
  437.   $total_cust = $total_sess - $total_dupes;
  438. ?>
  439.               <tr>
  440.                 <td colspan="8"><?php echo zen_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
  441.               </tr>
  442. <?php
  443. // repeat legend when whois >=
  444.   if ($whos_online->RecordCount() >= WHOIS_REPEAT_LEGEND_BOTTOM) {
  445. ?>
  446.               <tr>
  447.                 <td class="smallText" colspan="8">Legend: <?php echo zen_image(DIR_WS_IMAGES . 'icon_status_green.gif') . " Active cart &nbsp;&nbsp;" . zen_image(DIR_WS_IMAGES . 'icon_status_yellow.gif') . " Inactive cart &nbsp;&nbsp;" . zen_image(DIR_WS_IMAGES . 'icon_status_red.gif') . " Active no cart &nbsp;&nbsp;" .  zen_image(DIR_WS_IMAGES . 'icon_status_red_light.gif') . " Inactive no cart " . "<br />Inactive is Last Click >= " . WHOIS_TIMER_INACTIVE . "s" . " &nbsp; || Inactive since arrival > " . WHOIS_TIMER_DEAD . "s will be removed";?></td>
  448.               </tr>
  449. <?php
  450.   }
  451. ?>
  452.               <tr>
  453.                 <td class="smallText" colspan="8"><?php echo sprintf(TEXT_NUMBER_OF_CUSTOMERS, $total_sess); print "<br />Duplicate IP Addresses: $total_dupes<br />Total Unique Users: $total_cust.";?></td>
  454.               </tr>
  455.             </table></td>
  456. <?php
  457.   $heading = array();
  458.   $contents = array();
  459.   if ($info) {
  460.     $heading[] = array('text' => '<b>' . TABLE_HEADING_SHOPPING_CART . '</b>');
  461.     $tag = 0;
  462.     $session_data = '';
  463.     $result = $db->Execute("select value from " . TABLE_SESSIONS . "
  464.                            WHERE sesskey = '" . $info . "'");
  465.     $session_data = trim($result->fields['value']);
  466.  
  467.     $hardenedStatus = FALSE;
  468.     $suhosinExtension = extension_loaded('suhosin');
  469.     $suhosinSetting = strtoupper(@ini_get('suhosin.session.encrypt'));
  470.  
  471. //    if (!$suhosinExtension) {
  472.       if (strpos($session_data, 'cart|O') == 0) $session_data = base64_decode($session_data);
  473.       if (strpos($session_data, 'cart|O') == 0) $session_data = '';
  474. //    }
  475.  
  476.     // uncomment the following line if you have suhosin enabled and see errors on the cart-contents sidebar
  477.     //$hardenedStatus = ($suhosinExtension == TRUE || $suhosinSetting == 'On' || $suhosinSetting == 1) ? TRUE : FALSE;
  478.     if ($session_data != '' && $hardenedStatus == TRUE) $session_data = '';
  479.  
  480.     if ($length = strlen($session_data)) {
  481.       $start_id = (int)strpos($session_data, 'customer_id|s');
  482.       $start_currency = (int)strpos($session_data, 'currency|s');
  483.       $start_country = (int)strpos($session_data, 'customer_country_id|s');
  484.       $start_zone = (int)strpos($session_data, 'customer_zone_id|s');
  485.       $start_cart = (int)strpos($session_data, 'cart|O');
  486.       $end_cart = (int)strpos($session_data, '|', $start_cart+6);
  487.       $end_cart = (int)strrpos(substr($session_data, 0, $end_cart), ';}');
  488.  
  489.       $session_data_id = substr($session_data, $start_id, (strpos($session_data, ';', $start_id) - $start_id + 1));
  490.       $session_data_cart = substr($session_data, $start_cart, ($end_cart - $start_cart+2));
  491.       $session_data_currency = substr($session_data, $start_currency, (strpos($session_data, ';', $start_currency) - $start_currency + 1));
  492.       $session_data_country = substr($session_data, $start_country, (strpos($session_data, ';', $start_country) - $start_country + 1));
  493.       $session_data_zone = substr($session_data, $start_zone, (strpos($session_data, ';', $start_zone) - $start_zone + 1));
  494.  
  495.       session_decode($session_data_id);
  496.       session_decode($session_data_currency);
  497.       session_decode($session_data_country);
  498.       session_decode($session_data_zone);
  499.       session_decode($session_data_cart);
  500.  
  501.       if (is_object($_SESSION['cart'])) {
  502.         $contents[] = array('text' => $full_name . ' - ' . $ip_address . '<br />' . $info);
  503.         $products = $_SESSION['cart']->get_products();
  504.         for ($i = 0, $n = sizeof($products); $i < $n; $i++) {
  505.           $contents[] = array('text' => $products[$i]['quantity'] . ' x ' . '<a href="' . zen_href_link(FILENAME_CATEGORIES, 'cPath=' . zen_get_product_path($products[$i]['id']) . '&pID=' . $products[$i]['id']) . '">' . $products[$i]['name'] . '</a>');
  506.         }
  507.  
  508.         if (sizeof($products) > 0) {
  509.           $contents[] = array('text' => zen_draw_separator('pixel_black.gif', '100%', '1'));
  510.           $contents[] = array('align' => 'right', 'text'  => TEXT_SHOPPING_CART_SUBTOTAL . ' ' . $currencies->format($_SESSION['cart']->show_total(), true, $_SESSION['currency']));
  511.         } else {
  512.           $contents[] = array('text' => TEXT_EMPTY_CART);
  513.         }
  514.       }
  515.     }
  516.   }
  517.  
  518.   if ( (zen_not_null($heading)) && (zen_not_null($contents)) ) {
  519.     echo '            <td width="25%" valign="top">' . "\n";
  520.  
  521.     $box = new box;
  522.     echo $box->infoBox($heading, $contents);
  523.  
  524.     echo '            </td>' . "\n";
  525.   }
  526. ?>
  527.           </tr>
  528.         </table></td>
  529.       </tr>
  530.     </table></td>
  531. <!-- body_text_eof //-->
  532.   </tr>
  533. </table>
  534. <!-- body_eof //-->
  535.  
  536. <!-- footer //-->
  537. <?php require(DIR_WS_INCLUDES . 'footer.php'); ?>
  538. <!-- footer_eof //-->
  539. <br />
  540. </body>
  541. </html>
  542. <?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>


cron