[go: up one dir, main page]

Menu

[r19]: / admin / whos_online.php  Maximize  Restore  History

Download this file

665 lines (603 with data), 27.7 kB

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
<?php
/*
$Id: whos_online.php,v 1.32 2003/06/29 22:50:52 hpdl Exp $
osCommerce, Open Source E-Commerce Solutions
http://www.oscommerce.com
Copyright (c) 2003 osCommerce
Released under the GNU General Public License
*/
require('includes/application_top.php');
require(DIR_WS_CLASSES . 'currencies.php');
$currencies = new currencies();
/*
Configuration Values
Set these to easily personalize your Whos Online
*/
// Seconds that a visitor is considered "active"
$active_time = 300;
// Seconds before visitor is removed from display
$track_time = 900;
// Automatic refresh times in seconds and display names
// Time and Display Text order must match between the arrays
// "None" is handled separately in the code
$refresh_time = array( 30, 60, 120, 180 );
$refresh_display = array( ':30', '1:00', '2:00', '3:00' );
// Images used for status lights
$status_active_cart = 'icon_status_green.gif';
$status_inactive_cart = 'icon_status_red.gif';
$status_active_nocart = 'icon_status_green_light.gif';
$status_inactive_nocart = 'icon_status_red_light.gif';
$status_active_bot = 'icon_status_green_border_light.gif';
$status_inactive_bot = 'icon_status_red_border_light.gif';
// Text color used for table entries
// Different colored text for different users
// Named colors and Hex values should work fine here
$fg_color_bot = 'maroon';
$fg_color_admin = 'darkblue';
$fg_color_guest = 'green';
$fg_color_account = '#000000'; // Black
/*
Determines status and cart of visitor and displays appropriate icon.
*/
function tep_check_cart($which, $customer_id, $session_id) {
global $cart, $status_active_cart, $status_inactive_cart, $status_active_nocart, $status_inactive_nocart, $status_inactive_bot, $status_active_bot, $active_time;
// Pull Session data from the correct source.
if (STORE_SESSIONS == 'mysql') {
$session_data = tep_db_query("select value from " . TABLE_SESSIONS . " WHERE sesskey = '" . $session_id . "'");
$session_data = tep_db_fetch_array($session_data);
$session_data = trim($session_data['value']);
} else {
if ( (file_exists(tep_session_save_path() . '/sess_' . $session_id)) && (filesize(tep_session_save_path() . '/sess_' . $session_id) > 0) ) {
$session_data = file(tep_session_save_path() . '/sess_' . $session_id);
$session_data = trim(implode('', $session_data));
}
}
if ($length = strlen($session_data)) {
if (PHP_VERSION < 4) {
$start_id = strpos($session_data, 'customer_id[==]s');
$start_cart = strpos($session_data, 'cart[==]o');
$start_currency = strpos($session_data, 'currency[==]s');
$start_country = strpos($session_data, 'customer_country_id[==]s');
$start_zone = strpos($session_data, 'customer_zone_id[==]s');
} else {
$start_id = strpos($session_data, 'customer_id|s');
$start_cart = strpos($session_data, 'cart|O');
$start_currency = strpos($session_data, 'currency|s');
$start_country = strpos($session_data, 'customer_country_id|s');
$start_zone = strpos($session_data, 'customer_zone_id|s');
}
for ($i=$start_cart; $i<$length; $i++) {
if ($session_data[$i] == '{') {
if (isset($tag)) {
$tag++;
} else {
$tag = 1;
}
} elseif ($session_data[$i] == '}') {
$tag--;
} elseif ( (isset($tag)) && ($tag < 1) ) {
break;
}
}
$session_data_id = substr($session_data, $start_id, (strpos($session_data, ';', $start_id) - $start_id + 1));
$session_data_cart = substr($session_data, $start_cart, $i);
$session_data_currency = substr($session_data, $start_currency, (strpos($session_data, ';', $start_currency) - $start_currency + 1));
$session_data_country = substr($session_data, $start_country, (strpos($session_data, ';', $start_country) - $start_country + 1));
$session_data_zone = substr($session_data, $start_zone, (strpos($session_data, ';', $start_zone) - $start_zone + 1));
session_decode($session_data_id);
session_decode($session_data_currency);
session_decode($session_data_country);
session_decode($session_data_zone);
session_decode($session_data_cart);
if (PHP_VERSION < 4) {
$broken_cart = $cart;
$cart = new shoppingCart;
$cart->unserialize($broken_cart);
}
if (is_object($cart)) {
$products = $cart->get_products();
}
}
$which_query = $session_data;
$who_data = tep_db_query("select time_entry, time_last_click
from " . TABLE_WHOS_ONLINE . "
where session_id='" . $session_id . "'");
$who_query = tep_db_fetch_array($who_data);
// Determine if visitor active/inactive
$xx_mins_ago_long = (time() - $active_time);
// Determine Bot active/inactive
if( $customer_id < 0 ) {
// inactive
if ($who_query['time_last_click'] < $xx_mins_ago_long) {
return tep_image(DIR_WS_IMAGES . $status_inactive_bot, TEXT_STATUS_INACTIVE_BOT);
// active
} else {
return tep_image(DIR_WS_IMAGES . $status_active_bot, TEXT_STATUS_ACTIVE_BOT);
}
}
// Determine active/inactive and cart/no cart status
// no cart
if ( sizeof($products) == 0 ) {
// inactive
if ($who_query['time_last_click'] < $xx_mins_ago_long) {
return tep_image(DIR_WS_IMAGES . $status_inactive_nocart, TEXT_STATUS_INACTIVE_NOCART);
// active
} else {
return tep_image(DIR_WS_IMAGES . $status_active_nocart, TEXT_STATUS_ACTIVE_NOCART);
}
// cart
} else {
// inactive
if ($who_query['time_last_click'] < $xx_mins_ago_long) {
return tep_image(DIR_WS_IMAGES . $status_inactive_cart, TEXT_STATUS_INACTIVE_CART);
// active
} else {
return tep_image(DIR_WS_IMAGES . $status_active_cart, TEXT_STATUS_ACTIVE_CART);
}
}
}
// WOL 1.5 EOF
/* Display the details about a visitor */
function display_details() {
global $whos_online, $is_bot, $is_admin, $is_guest, $is_account;
// Display Name
echo '<b>'.TEXT_NAME.'</b> ' . $whos_online['full_name'];
echo '<br clear="all">' . tep_draw_separator('pixel_trans.gif', '10', '4') . '<br clear="all">';
// Display Customer ID for non-bots
if ( !$is_bot ){
echo '<b>'.TEXT_CUSTOMER_ID.'</b> ' . $whos_online['customer_id'];
echo '<br clear="all">' . tep_draw_separator('pixel_trans.gif', '10', '4') . '<br clear="all">';
}
// Display IP Address
echo '<b>'.TEXT_IP_ADDRESS.'</b> ' . $whos_online['ip_address'];
echo '<br clear="all">' . tep_draw_separator('pixel_trans.gif', '10', '4') . '<br clear="all">';
// Display User Agent
echo '<b>' . TEXT_USER_AGENT . ':</b> ' . $whos_online['user_agent'];
echo '<br clear="all">' . tep_draw_separator('pixel_trans.gif', '10', '4') . '<br clear="all">';
// Display Session ID. Bots with no Session ID, have it set to their IP address. Don't display these.
if ( $whos_online['session_id'] != $whos_online['ip_address'] ) {
echo '<b>' . TEXT_OSCID . ':</b> ' . $whos_online['session_id'];
echo '<br clear="all">' . tep_draw_separator('pixel_trans.gif', '10', '4') . '<br clear="all">';
}
// Display Referer if available
if($whos_online['http_referer'] != "" ) {
echo '<b>'.TEXT_REFERER.'</b> ' . $whos_online['http_referer'];
echo '<br clear="all">' . tep_draw_separator('pixel_trans.gif', '10', '4') . '<br clear="all">';
}
}
// Time to remove old entries
$xx_mins_ago = (time() - $track_time);
// remove entries that have expired
tep_db_query("delete from " . TABLE_WHOS_ONLINE . " where time_last_click < '" . $xx_mins_ago . "'");
?>
<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
<html <?php echo HTML_PARAMS; ?>>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">
<!-- WOL 1.6 - Cleaned up refresh -->
<?php if( $_SERVER["QUERY_STRING"] > 0 ){ ?>
<meta http-equiv="refresh" content="<?php echo $_SERVER["QUERY_STRING"];?>;URL=whos_online.php?<?php echo $_SERVER["QUERY_STRING"];?>">
<?php } ?>
<!-- WOL 1.6 EOF -->
<title><?php echo TITLE; ?></title>
<link rel="stylesheet" type="text/css" href="includes/stylesheet.css">
<script language="javascript" src="includes/general.js"></script>
</head>
<body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0" bgcolor="#FFFFFF">
<!-- header //-->
<?php require(DIR_WS_INCLUDES . 'header.php'); ?>
<!-- header_eof //-->
<!-- body //-->
<table border="0" width="100%" cellspacing="2" cellpadding="2">
<tr>
<td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="1" cellpadding="1" class="columnLeft">
<!-- left_navigation //-->
<?php require(DIR_WS_INCLUDES . 'column_left.php'); ?>
<!-- left_navigation_eof //-->
</table></td>
<!-- body_text //-->
<td width="100%" valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2">
<tr>
<td><table border="0" width="100%" cellspacing="0" cellpadding="0">
<tr>
<td valign="bottom" class="pageHeading">
<?php echo HEADING_TITLE; ?>
<br clear="all"><span class="smallText" style="color:#909090"><?php echo TEXT_SET_REFRESH_RATE; ?>:</span>
<span class="dataTableContent" style="font-size: 10px; color:#000000">
<!-- For loop displays refresh time links -->
<?php
echo '<a href="whos_online.php"><b>Stop</b></a>';
foreach ($refresh_time as $key => $value) {
echo ' &#183; <a href="whos_online.php?' . $value . '"><b>' . $refresh_display[$key] . '</b></a>';
}
?>
<script language="JavaScript">
<!-- Begin
Stamp = new Date();
document.write('&nbsp;&nbsp;-&nbsp;&nbsp;<?php echo TEXT_LAST_REFRESH; ?> ' + (Stamp.getMonth() + 1) +"/"+Stamp.getDate()+ "/"+Stamp.getYear() + '&nbsp;&nbsp;');
var Hours;
var Mins;
var Time;
Hours = Stamp.getHours();
if (Hours >= 12) {
Time = " p.m.";
}
else {
Time = " a.m.";
}
if (Hours > 12) {
Hours -= 12;
}
if (Hours == 0) {
Hours = 12;
}
Mins = Stamp.getMinutes();
if (Mins < 10) {
Mins = "0" + Mins;
}
document.write('<strong>' + Hours + ":" + Mins + Time + '</strong>');
// End -->
</script>
<!-- Display Profile links -->
<br clear="all">
<span class="smallText" style="color:#909090"><?php echo TEXT_PROFILE_DISPLAY; ?>:</span>
<a href="whos_online.php"><b><?php echo TEXT_NONE_; ?></b></a> &#183;
<a href="whos_online.php?showAll"><b><?php echo TEXT_ALL; ?></b></a> &#183;
<a href="whos_online.php?showBots"><b><!-- Bots --><?php echo TEXT_BOTS;?></b></a> &#183;
<a href="whos_online.php?showCust"><b><!-- Customers --><?php echo TEXT_CUSTOMERS;?></b></a>
</span>
</td>
<!-- Status Legend - Uses variables for image names -->
<td rowspan="2" align="right" class="smallText">
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td class="smallText"><?php echo
tep_image(DIR_WS_IMAGES . $status_active_cart, TEXT_STATUS_ACTIVE_CART) . '&nbsp;' . TEXT_STATUS_ACTIVE_CART . '&nbsp;&nbsp;';
?></td>
<td class="smallText"><?php echo
tep_image(DIR_WS_IMAGES . $status_inactive_cart, TEXT_STATUS_INACTIVE_CART) . '&nbsp;' . TEXT_STATUS_INACTIVE_CART . '&nbsp;&nbsp;';
?></td>
</tr>
<tr>
<td class="smallText"><?php echo
tep_image(DIR_WS_IMAGES . $status_active_nocart, TEXT_STATUS_ACTIVE_NOCART) . '&nbsp;' . TEXT_STATUS_ACTIVE_NOCART .'&nbsp;&nbsp;';
?></td>
<td class="smallText"><?php echo
tep_image(DIR_WS_IMAGES . $status_inactive_nocart, TEXT_STATUS_INACTIVE_NOCART) . '&nbsp;' . TEXT_STATUS_INACTIVE_NOCART . '&nbsp;&nbsp;';
?></td>
</tr>
<tr>
<td class="smallText"><?php echo
tep_image(DIR_WS_IMAGES . $status_active_bot, TEXT_STATUS_ACTIVE_BOT) . '&nbsp;' . TEXT_STATUS_ACTIVE_BOT . '&nbsp;&nbsp;';
?></td>
<td class="smallText"><?php echo
tep_image(DIR_WS_IMAGES . $status_inactive_bot, TEXT_STATUS_INACTIVE_BOT) . '&nbsp;' . TEXT_STATUS_INACTIVE_BOT . '&nbsp;&nbsp;';
?></td>
</tr>
</table>
</td>
</tr>
<tr>
<td><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?>
</td>
</tr>
</table></td>
</tr>
<tr>
<td><table border="0" width="100%" cellspacing="0" cellpadding="0">
<tr>
<td valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2">
<tr class="dataTableHeadingRow">
<td>&nbsp;</td>
<td class="dataTableHeadingContent"><?php echo TABLE_HEADING_ONLINE; ?></td>
<td class="dataTableHeadingContent"><?php echo TABLE_HEADING_FULL_NAME; ?></td>
<td class="dataTableHeadingContent"><?php echo TABLE_HEADING_IP_ADDRESS; ?></td>
<td class="dataTableHeadingContent"><?php echo TABLE_HEADING_ENTRY_TIME; ?></td>
<td class="dataTableHeadingContent"><?php echo TABLE_HEADING_LAST_CLICK; ?></td>
<td class="dataTableHeadingContent"><?php echo TABLE_HEADING_LAST_PAGE_URL; ?>&nbsp;</td>
<td class="dataTableHeadingContent" align="center"><?php echo TABLE_HEADING_USER_SESSION; ?>&nbsp;</td>
<td class="dataTableHeadingContent" align="center"><?php echo TABLE_HEADING_HTTP_REFERER; ?>&nbsp;</td>
</tr>
<?php
// Order by is on Last Click. Also initialize total_bots and total_admin counts
$whos_online_query = tep_db_query("select customer_id, full_name, ip_address, time_entry, time_last_click, last_page_url, http_referer, user_agent, session_id from " . TABLE_WHOS_ONLINE . ' order by time_last_click DESC');
$total_bots=0;
$total_admin=0;
$total_guests=0;
$total_loggedon=0;
$i=0;
while ($whos_online = tep_db_fetch_array($whos_online_query)) {
$time_online = ($whos_online['time_last_click'] - $whos_online['time_entry']);
if ((!isset($HTTP_GET_VARS['info']) || (isset($HTTP_GET_VARS['info']) && ($HTTP_GET_VARS['info'] == $whos_online['session_id']))) && !isset($info)) {
$info = $whos_online['session_id'];
}
/* BEGIN COUNT MOD */
if ($old_array['ip_address'] == $whos_online['ip_address']) {
$i++;
}
/* END COUNT MOD */
if ($whos_online['session_id'] == $info) {
if($whos_online['http_referer'] != "")
{
$http_referer_url = $whos_online['http_referer'];
}
echo '<tr id="defaultSelected" class="dataTableRowSelected" > . "\n";
} else {
echo '<tr class="dataTableRow" > . tep_href_link(FILENAME_WHOS_ONLINE, tep_get_all_get_params(array('info', 'action')) . 'info=' . $whos_online['session_id'], 'NONSSL') . '\'">' . "\n";
}
// Display Status
// Check who it is and set values
$is_bot = $is_admin = $is_guest = $is_account = false;
// Bot detection
if ($whos_online['customer_id'] < 0) {
$total_bots++;
$fg_color = $fg_color_bot;
$is_bot = true;
// Admin detection
} elseif ($whos_online['ip_address'] == tep_get_ip_address() ) { //$_SERVER["REMOTE_ADDR"]) {
$total_admin++;
$fg_color = $fg_color_admin;
$is_admin = true;
// Guest detection (may include Bots not detected by Prevent Spider Sessions/spiders.txt)
} elseif ($whos_online['customer_id'] == 0) {
$fg_color = $fg_color_guest;
$is_guest = true;
$total_guests++;
// Everyone else (should only be account holders)
} else {
$fg_color = $fg_color_account;
$is_account = true;
$total_loggedon++;
}
?>
<!-- Status Light Column -->
<td class="dataTableContent" align="left" valign="top">
<?php echo '&nbsp;' . tep_check_cart($whos_online['session_id'], $whos_online['customer_id'], $whos_online['session_id']); ?>
</td>
<!-- Time Online Column -->
<td class="dataTableContent" valign="top"><font color="<?php echo $fg_color; ?>">
<?php echo gmdate('H:i:s', $time_online); ?>
</font>&nbsp;</td>
<!-- Name Column -->
<td class="dataTableContent" valign="top"><font color="<?php echo $fg_color; ?>">
<?php
// WOL 1.6 Restructured to Check for Guest or Admin
if ( $is_guest || $is_admin )
{
echo $whos_online['full_name'] . '&nbsp;';
// Check for Bot
} elseif ( $is_bot ) {
// Tokenize UserAgent and try to find Bots name
$tok = strtok($whos_online['full_name']," ();/");
while ($tok) {
if ( strlen($tok) > 3 )
if ( !strstr($tok, "mozilla") &&
!strstr($tok, "compatible") &&
!strstr($tok, "msie") &&
!strstr($tok, "windows")
) {
echo "$tok";
break;
}
$tok = strtok(" ();/");
}
// Check for Account
} elseif ( $is_account ) {
echo '<a HREF="customers.php?selected_box=customers&cID=' . $whos_online['customer_id'] . '&action=edit">' . $whos_online['full_name'] . '</a>';
} else {
echo TEXT_ERROR;
}
?>
</font>&nbsp;</td>
<!-- IP Address Column -->
<td class="dataTableContent" valign="top"><font color="<?php echo $fg_color; ?>">
<?php
// Show 'Admin' instead of IP for Admin
if ( $is_admin )
echo TEXT_ADMIN;
else
// Show IP with link to IP checker
echo '<a HREF="http://www.showmyip.com/?ip=' . $whos_online['ip_address'] . '" target="_blank">' . $whos_online['ip_address'] . '</a>';
?>
</font>&nbsp;</td>
<!-- Time Entry Column -->
<td class="dataTableContent" valign="top"><font color="<?php echo $fg_color; ?>">
<?php echo date('H:i:s', $whos_online['time_entry']); ?>
</font></td>
<!-- Last Click Column -->
<td class="dataTableContent" align="center" valign="top"><font color="<?php echo $fg_color; ?>">
<?php echo date('H:i:s', $whos_online['time_last_click']); ?>
</font>&nbsp;</td>
<!-- Last URL Column -->
<td class="dataTableContent" valign="top">
<?php
$temp_url_link = $whos_online['last_page_url'];
if (@eregi('^(.*)' . tep_session_name() . '=[a-f,0-9]+[&]*(.*)', $whos_online['last_page_url'], $array)) {
$temp_url_display = $array[1] . $array[2];
} else {
$temp_url_display = $whos_online['last_page_url'];
}
// WOL 1.6 - Removes osCid from the Last Click URL and the link
if ( $osCsid_position = strpos($temp_url_display, "osCsid") )
$temp_url_display = substr_replace($temp_url_display, "", $osCsid_position - 1 );
if ( $osCsid_position = strpos($temp_url_link, "osCsid") )
$temp_url_link = substr_replace($temp_url_link, "", $osCsid_position - 1 );
?>
<a HREF="<?php echo (($request_type == 'SSL') ? HTTPS_SERVER : HTTP_SERVER) . $temp_url_link; ?>" target=\"_blank\">
<font color="<?php echo $fg_color; ?>">
<?php
echo $temp_url_display;
?>
</font>
</a>
</td>
<!-- osCsid? Column -->
<td class="dataTableContent" align="center" valign="top"><font color="<?php echo $fg_color; ?>">
<?php
if($whos_online['session_id'] != $whos_online['ip_address']) {
echo 'Y';
} else {
echo "&nbsp;";
}
?>
</font></td>
<!-- Referer? Column -->
<td class="dataTableContent" align="center" valign="top"><font color="<?php echo $fg_color; ?>">
<?php
if($whos_online['http_referer'] == "") {
echo '&nbsp;';
} else {
echo TEXT_HTTP_REFERER_FOUND;
}
?>
</font></td>
</tr>
<tr class="dataTableRow">
<td class="dataTableContent" colspan="3"></td>
<td class="dataTableContent" colspan="6"><font color="<?php echo $fg_color; ?>">
<?php
// Display Details for All
if ( $_SERVER["QUERY_STRING"] == showAll ) {
display_details();
}
// Display Details for Bots
else if( $_SERVER["QUERY_STRING"] == showBots ){
if ( $is_bot ) {
display_details();
}
}
// Display Details for Customers
else if( $_SERVER["QUERY_STRING"] == showCust ){
if ( $is_guest || $is_account || $is_admin ) {
display_details();
}
}
?>
</font></td>
</tr>
<?php
$old_array = $whos_online;
}
if (!$i) {
$i=0;
}
$total_dupes = $i;
$total_sess = tep_db_num_rows($whos_online_query);
// WOL 1.4 - Subtract Bots and Me from Real Customers. Only subtract me once as Dupes will remove others
$total_cust = $total_sess - $total_dupes - $total_bots - ($total_admin > 1? 1 : $total_admin);
// WOL 1.4 eof
?>
<?php
if(isset($http_referer_url))
{
?>
<tr>
<td class="smallText" colspan="9"><?php echo '<strong>' . TEXT_HTTP_REFERER_URL . ':</strong> ' . $http_referer_url; ?></td>
</tr>
<?php
}
if ($total_cust < 0){
$total_cust = 0;
}
?>
<tr>
<!-- WOL 1.4 - Added Bot and Me counts -->
<td class="smallText" colspan="9"><br /><?php echo sprintf(TEXT_NUMBER_OF_CUSTOMERS, $total_sess); ?>
<?php echo "<br />" . TEXT_DUPLICATE_IP . ":" . $total_dupes . "<br />" . TEXT_BOTS . ": " . $total_bots . "<br />" . TEXT_ME . ": " . $total_admin . "<br />" . TEXT_REAL_CUSTOMERS . ": " . $total_cust . "<br /><br />" . TEXT_YOUR_IP_ADDRESS . ": " .tep_get_ip_address();?></td><!-- //$_SERVER["REMOTE_ADDR"];?></td> -->
<!-- WOL 1.4 eof -->
</tr>
</table></td>
<?php
$heading = array();
$contents = array();
$heading[] = array('text' => '<b>' . TABLE_HEADING_SHOPPING_CART . '</b>');
if (isset($info)) {
if (STORE_SESSIONS == 'mysql') {
$session_data = tep_db_query("select value from " . TABLE_SESSIONS . " WHERE sesskey = '" . $info . "'");
$session_data = tep_db_fetch_array($session_data);
$session_data = trim($session_data['value']);
} else {
if ( (file_exists(tep_session_save_path() . '/sess_' . $info)) && (filesize(tep_session_save_path() . '/sess_' . $info) > 0) ) {
$session_data = file(tep_session_save_path() . '/sess_' . $info);
$session_data = trim(implode('', $session_data));
}
}
if ($length = strlen($session_data)) {
if (PHP_VERSION < 4) {
$start_id = strpos($session_data, 'customer_id[==]s');
$start_cart = strpos($session_data, 'cart[==]o');
$start_currency = strpos($session_data, 'currency[==]s');
$start_country = strpos($session_data, 'customer_country_id[==]s');
$start_zone = strpos($session_data, 'customer_zone_id[==]s');
} else {
$start_id = strpos($session_data, 'customer_id|s');
$start_cart = strpos($session_data, 'cart|O');
$start_currency = strpos($session_data, 'currency|s');
$start_country = strpos($session_data, 'customer_country_id|s');
$start_zone = strpos($session_data, 'customer_zone_id|s');
}
for ($i=$start_cart; $i<$length; $i++) {
if ($session_data[$i] == '{') {
if (isset($tag)) {
$tag++;
} else {
$tag = 1;
}
} elseif ($session_data[$i] == '}') {
$tag--;
} elseif ( (isset($tag)) && ($tag < 1) ) {
break;
}
}
$session_data_id = substr($session_data, $start_id, (strpos($session_data, ';', $start_id) - $start_id + 1));
$session_data_cart = substr($session_data, $start_cart, $i);
$session_data_currency = substr($session_data, $start_currency, (strpos($session_data, ';', $start_currency) - $start_currency + 1));
$session_data_country = substr($session_data, $start_country, (strpos($session_data, ';', $start_country) - $start_country + 1));
$session_data_zone = substr($session_data, $start_zone, (strpos($session_data, ';', $start_zone) - $start_zone + 1));
session_decode($session_data_id);
session_decode($session_data_currency);
session_decode($session_data_country);
session_decode($session_data_zone);
session_decode($session_data_cart);
if (PHP_VERSION < 4) {
$broken_cart = $cart;
$cart = new shoppingCart;
$cart->unserialize($broken_cart);
}
if (is_object($cart)) {
$products = $cart->get_products();
for ($i = 0, $n = sizeof($products); $i < $n; $i++) {
$contents[] = array('text' => $products[$i]['quantity'] . ' x ' . $products[$i]['name']);
}
if (sizeof($products) > 0) {
$contents[] = array('text' => tep_draw_separator('pixel_black.gif', '100%', '1'));
$contents[] = array('align' => 'right', 'text' => TEXT_SHOPPING_CART_SUBTOTAL . ' ' . $currencies->format($cart->show_total(), true, $currency));
} else {
$contents[] = array('text' => 'Empty');
}
}
}
}
// Show shopping cart contents for selected entry
echo ' <td valign="top">' . "\n";
$box = new box;
echo $box->infoBox($heading, $contents);
echo '</td>' . "\n";
?>
</tr>
</table></td>
</tr>
</table></td>
<!-- body_text_eof //-->
</tr>
</table>
<!-- body_eof //-->
<!-- footer //-->
<?php
$_SESSION['language_id']=2;
require(DIR_WS_INCLUDES . 'footer.php'); ?>
<!-- footer_eof //-->
<br />
</body>
</html>
<?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>