'" . $trace_days . "')"); // set the top level domain function visitor_get_top_level_domain($url) { if (strpos($url, '://')) { $url = parse_url($url); $url = $url['host']; } $domain_array = explode('.', $url); $domain_size = sizeof($domain_array); if ($domain_size > 1) { if (is_numeric($domain_array[$domain_size-2]) && is_numeric($domain_array[$domain_size-1])) { return false; } else { return $domain_array[$domain_size-2] . '.' . $domain_array[$domain_size-1]; } } else { return false; } } $current_domain = visitor_get_top_level_domain(HTTP_SERVER); $cookie_path = '/'; // Could change if not using a top level path if ( ($HTTP_GET_VARS['display_robot'] && $HTTP_GET_VARS['display_robot'] == 'yes' ) || (!$HTTP_GET_VARS['display_robot'] && isset($HTTP_COOKIE_VARS["display_robot"]) && $HTTP_COOKIE_VARS["display_robot"] == 'yes') ) { $robot = ""; $display_robot = 'yes'; if ($use_cookie == '1') { setcookie('display_robot', 'yes', time()+ (365 * 5 * 24 * 3600), $cookie_path, $current_domain, ((getenv('HTTPS') == 'on') ? 1 : 0)); // set robot cookie } } else { $robot = "AND SUBSTRING(browser_language,1,1) != '['"; $display_robot = 'no'; if ($use_cookie == '1') { setcookie('display_robot', 'no', time()+ (365 * 5 * 24 * 3600), $cookie_path, $current_domain, ((getenv('HTTPS') == 'on') ? 1 : 0)); // set robot cookie } } function visitor_get_country_language($country_code) { if (substr($country_code, 0, 1) == '[') { $country_name = 'Network'; } else { $code1 = substr($country_code,0,2); $code2 = substr($country_code,3,2); $country_name = 'Unknown/LAN'; if ($code1 == "af") {$country_name = 'Afrikaans';} if ($code1 == "ar") { $country_name = 'Arabic'; if ($code2 == "ae") {$country_name = 'UAE';} if ($code2 == "bh") {$country_name = 'Bahrain';} if ($code2 == "eg") {$country_name = 'Egypt';} if ($code2 == "dz") {$country_name = 'Algeria';} if ($code2 == "iq") {$country_name = 'Iraq';} if ($code2 == "jo") {$country_name = 'Jordan';} if ($code2 == "kw") {$country_name = 'Kuwait';} if ($code2 == "lb") {$country_name = 'Lebanon';} if ($code2 == "ly") {$country_name = 'Libya';} if ($code2 == "ma") {$country_name = 'Morocco';} if ($code2 == "om") {$country_name = 'Oman';} if ($code2 == "qa") {$country_name = 'Qatar';} if ($code2 == "sa") {$country_name = 'Saudi';} if ($code2 == "sy") {$country_name = 'Syria';} if ($code2 == "tn") {$country_name = 'Tunisia';} if ($code2 == "ye") {$country_name = 'Yemen';}} if ($code1 == "be") {$country_name = 'Belarusian';} if ($code1 == "bg") {$country_name = 'Bulgarian';} if ($code1 == "ca") {$country_name = 'Catalan';} if ($code1 == "cs") {$country_name = 'Czech';} if ($code1 == "da") {$country_name = 'Danish';} if ($code1 == "de") { $country_name = 'Germany'; if ($code2 == "at") {$country_name = 'Austria';} if ($code2 == "ch") {$country_name = 'Switzerland';} if ($code2 == "li") {$country_name = 'Liechtenstein';} if ($code2 == "lu") {$country_name = 'Luxembourg';}} if ($code1 == "el") {$country_name = 'Greece';} if ($code1 == "en") { $country_name = 'Other English'; if ($code2 == "us") {$country_name = 'USA';} if ($code2 == "au") {$country_name = 'Australia';} if ($code2 == "bz") {$country_name = 'Belize';} if ($code2 == "ca") {$country_name = 'Canada';} if ($code2 == "gb") {$country_name = 'UK';} if ($code2 == "ie") {$country_name = 'Ireland';} if ($code2 == "jm") {$country_name = 'Jamaica';} if ($code2 == "nz") {$country_name = 'New Zealand';} if ($code2 == "tt") {$country_name = 'Trinidad';} if ($code2 == "za") {$country_name = 'South Africa';}} if ($code1 == "es") { $country_name = 'Spain'; if ($code2 == "ar") {$country_name = 'Argentina';} if ($code2 == "bo") {$country_name = 'Bolivia';} if ($code2 == "cl") {$country_name = 'Chile';} if ($code2 == "co") {$country_name = 'Colombia';} if ($code2 == "cr") {$country_name = 'Costa Rica';} if ($code2 == "do") {$country_name = 'Dominican';} if ($code2 == "ec") {$country_name = 'Ecuador';} if ($code2 == "gt") {$country_name = 'Guatemala';} if ($code2 == "hn") {$country_name = 'Honduras';} if ($code2 == "mx") {$country_name = 'Mexico';} if ($code2 == "ni") {$country_name = 'Nicaragua';} if ($code2 == "pa") {$country_name = 'Panama';} if ($code2 == "pe") {$country_name = 'Peru';} if ($code2 == "pr") {$country_name = 'Puerto Rico';} if ($code2 == "py") {$country_name = 'Paraguay';} if ($code2 == "sv") {$country_name = 'El Salvador';} if ($code2 == "uy") {$country_name = 'Uruguay';} if ($code2 == "ve") {$country_name = 'Venezuela';}} if ($code1 == "et") {$country_name = 'Estonian';} if ($code1 == "eu") {$country_name = 'Basque';} if ($code1 == "fa") {$country_name = 'Farsi';} if ($code1 == "fi") {$country_name = 'Finland';} if ($code1 == "fo") {$country_name = 'Faeroes';} if ($code1 == "fr") { $country_name = 'France'; if ($code2 == "be") {$country_name = 'Belgium';} if ($code2 == "ca") {$country_name = 'Canada';} if ($code2 == "ch") {$country_name = 'Switzerland';} if ($code2 == "ca") {$country_name = 'Luxembourg';}} if ($code1 == "gd") { $country_name = 'Scotland'; if ($code2 == "ie") {$country_name = 'Ireland';}} if ($code1 == "he") {$country_name = 'Hebrew';} if ($code1 == "hi") {$country_name = 'Hindi';} if ($code1 == "hr") {$country_name = 'Croatian';} if ($code1 == "hu") {$country_name = 'Hungarian';} if ($code1 == "in") {$country_name = 'Indonesian';} if ($code1 == "is") {$country_name = 'Icelandic';} if ($code1 == "he") {$country_name = 'Hebrew';} if ($code1 == "it") { $country_name = 'Italy'; if ($code2 == "ch") {$country_name = 'Switzerland';}} if ($code1 == "ja") {$country_name = 'Japan';} if ($code1 == "ji") {$country_name = 'Yiddish';} if ($code1 == "ko") {$country_name = 'Korea';} if ($code1 == "lt") {$country_name = 'Lithuania';} if ($code1 == "lv") {$country_name = 'Latvian';} if ($code1 == "mk") {$country_name = 'Macedonia';} if ($code1 == "ms") {$country_name = 'Malaysia';} if ($code1 == "mt") {$country_name = 'Malta';} if ($code1 == "nl") { $country_name = 'Netherlands'; if ($code2 == "be") {$country_name = 'Belgium';}} if ($code1 == "no") {$country_name = 'Norway';} if ($code1 == "pl") {$country_name = 'Poland';} if ($code1 == "pt") { $country_name = 'Portugual'; if ($code2 == "br") {$country_name = 'Brazil';}} if ($code1 == "rm") {$country_name = 'Romania';} if ($code1 == "ro") {$country_name = 'Romania';} if ($code1 == "ru") {$country_name = 'Russia';} if ($code1 == "sb") {$country_name = 'Sorbian';} if ($code1 == "sk") {$country_name = 'Slovak';} if ($code1 == "sl") {$country_name = 'Slovenian';} if ($code1 == "sq") {$country_name = 'Albania';} if ($code1 == "sr") {$country_name = 'Serbia';} if ($code1 == "sv") { $country_name = 'Sweden'; if ($code2 == "fi") {$country_name = 'Finland';}} if ($code1 == "sx") {$country_name = 'Sutu';} if ($code1 == "sz") {$country_name = 'Sami';} if ($code1 == "tn") {$country_name = 'Tswana';} if ($code1 == "tr") {$country_name = 'Turkey';} if ($code1 == "ts") {$country_name = 'Tsonga';} if ($code1 == "uk") {$country_name = 'Ukrainian';} if ($code1 == "th") {$country_name = 'Thailand';} if ($code1 == "ur") {$country_name = 'Urdu';} if ($code1 == "ve") {$country_name = 'Venda';} if ($code1 == "vi") {$country_name = 'Vietnam';} if ($code1 == "xh") {$country_name = 'Xhosa';} if ($code1 == "zh") { $country_name = 'China'; if ($code2 == "cn") {$country_name = 'China';} if ($code2 == "hk") {$country_name = 'Hong Kong';} if ($code2 == "sg") {$country_name = 'Singapore';} if ($code2 == "tw") {$country_name = 'Taiwan';}} if ($code1 == "zu") {$country_name = 'Zulu';} } return $country_name; } // check if the graphs directory exists $show_charts = false; if ( function_exists('imagecreate') ) { if (is_dir(DIR_WS_IMAGES . 'graphs')) { if (is_writeable(DIR_WS_IMAGES . 'graphs')) { $show_charts = true; } else { $messageStack->add(ERROR_GRAPHS_DIRECTORY_NOT_WRITEABLE, 'error'); } } else { $messageStack->add(ERROR_GRAPHS_DIRECTORY_DOES_NOT_EXIST, 'error'); $show_charts = false; } } if ( ($gd_support != '1') || (!function_exists('imagecreate')) ) { $show_charts = false; } if ($show_charts == false) { $report = '10'; } else { $report = $default_report; } if ( ($HTTP_GET_VARS['report']) && (tep_not_null($HTTP_GET_VARS['report'])) ) { $report = $HTTP_GET_VARS['report']; } $chart1 = 'menuBoxContentLink'; $chart2 = 'menuBoxContentLink'; $chart3 = 'menuBoxContentLink'; $chart4 = 'menuBoxContentLink'; $chart5 = 'menuBoxContentLink'; $chart6 = 'menuBoxContentLink'; $chart7 = 'menuBoxContentLink'; $chart8 = 'menuBoxContentLink'; $chart9 = 'menuBoxContentLink'; $chart10 = 'menuBoxContentLink'; $chart11 = 'menuBoxContentLink'; $chart12 = 'menuBoxContentLink'; $chart13 = 'menuBoxContentLink'; $chart20 = 'menuBoxContentLink'; $chart21 = 'menuBoxContentLink'; $chart22 = 'menuBoxContentLink'; $chart23 = 'menuBoxContentLink'; $chart24 = 'menuBoxContentLink'; $chart25 = 'menuBoxContentLink'; $chart26 = 'menuBoxContentLink'; $chart27 = 'menuBoxContentLink'; $chart28 = 'menuBoxContentLink'; $chart29 = 'menuBoxContentLink'; $chart30 = 'menuBoxContentLink'; $chart31 = 'menuBoxContentLink'; $chart32 = 'menuBoxContentLink'; $chart33 = 'menuBoxContentLink'; $chart34 = 'menuBoxContentLink'; $chart35 = 'menuBoxContentLink'; $chart36 = 'menuBoxContentLink'; $chart37 = 'menuBoxContentLink'; $chart38 = 'menuBoxContentLink'; $chart39 = 'menuBoxContentLink'; $chart40 = 'menuBoxContentLink'; $chart41 = 'menuBoxContentLink'; $chart42 = 'menuBoxContentLink'; $chart43 = 'menuBoxContentLink'; $chart44 = 'menuBoxContentLink'; $chart45 = 'menuBoxContentLink'; switch ($report) { case '1': $title = STATISTICS_TYPE_REPORT_A . ': ' . STATISTICS_TYPE_REPORT_1; $chart1 = 'messageStackSuccess'; break; case '3': $title = STATISTICS_TYPE_REPORT_A . ': ' . STATISTICS_TYPE_REPORT_3; $chart3 = 'messageStackSuccess'; break; case '4': $title = STATISTICS_TYPE_REPORT_A . ': ' . STATISTICS_TYPE_REPORT_4; $chart4 = 'messageStackSuccess'; break; case '5': $title = STATISTICS_TYPE_REPORT_A . ': ' . STATISTICS_TYPE_REPORT_5; $chart5 = 'messageStackSuccess'; break; case '6': $title = STATISTICS_TYPE_REPORT_A . ': ' . STATISTICS_TYPE_REPORT_6; $chart6 = 'messageStackSuccess'; break; case '7': $title = STATISTICS_TYPE_REPORT_B . ': ' . STATISTICS_TYPE_REPORT_7; $chart7 = 'messageStackSuccess'; break; case '8': $title = STATISTICS_TYPE_REPORT_B . ': ' . STATISTICS_TYPE_REPORT_8; $chart8 = 'messageStackSuccess'; break; case '9': $title = STATISTICS_TYPE_REPORT_B . ': ' . STATISTICS_TYPE_REPORT_9; $chart9 = 'messageStackSuccess'; break; case '10': $title = STATISTICS_TYPE_REPORT_10; $chart10 = 'messageStackSuccess'; break; case '11': $title = STATISTICS_TYPE_REPORT_B . ': ' . STATISTICS_TYPE_REPORT_11; $chart11 = 'messageStackSuccess'; break; case '12': $title = STATISTICS_TYPE_REPORT_A . ': ' . STATISTICS_TYPE_REPORT_12; $chart12 = 'messageStackSuccess'; break; case '13': $title = STATISTICS_TYPE_REPORT_A . ': ' . STATISTICS_TYPE_REPORT_13; $chart13 = 'messageStackSuccess'; break; case '20': $title = STATISTICS_TYPE_REPORT_A . ': ' . STATISTICS_TYPE_REPORT_20; $chart20 = 'messageStackSuccess'; break; case '21': $title = STATISTICS_TYPE_REPORT_A . ': ' . STATISTICS_TYPE_REPORT_21; $chart21 = 'messageStackSuccess'; break; case '22': $title = STATISTICS_TYPE_REPORT_A . ': ' . STATISTICS_TYPE_REPORT_22; $chart22 = 'messageStackSuccess'; break; case '23': $title = STATISTICS_TYPE_REPORT_B . ': ' . STATISTICS_TYPE_REPORT_23; $chart23 = 'messageStackSuccess'; break; case '24': $title = STATISTICS_TYPE_REPORT_B . ': ' . STATISTICS_TYPE_REPORT_24; $chart24 = 'messageStackSuccess'; break; case '25': $title = STATISTICS_TYPE_REPORT_B . ': ' . STATISTICS_TYPE_REPORT_25; $chart25 = 'messageStackSuccess'; break; case '26': $title = STATISTICS_TYPE_REPORT_B . ': ' . STATISTICS_TYPE_REPORT_26; $chart26 = 'messageStackSuccess'; break; case '27': $title = STATISTICS_TYPE_REPORT_B . ': ' . STATISTICS_TYPE_REPORT_27; $chart27 = 'messageStackSuccess'; break; case '28': $title = STATISTICS_TYPE_REPORT_B . ': ' . STATISTICS_TYPE_REPORT_28; $chart28 = 'messageStackSuccess'; break; case '29': $title = STATISTICS_TYPE_REPORT_B . ': ' . STATISTICS_TYPE_REPORT_29; $chart29 = 'messageStackSuccess'; break; case '30': $title = STATISTICS_TYPE_REPORT_B . ': ' . STATISTICS_TYPE_REPORT_30; $chart30 = 'messageStackSuccess'; break; case '31': $title = STATISTICS_TYPE_REPORT_B . ': ' . STATISTICS_TYPE_REPORT_31; $chart31 = 'messageStackSuccess'; break; case '32': $title = STATISTICS_TYPE_REPORT_A . ': ' . STATISTICS_TYPE_REPORT_32; $chart32 = 'messageStackSuccess'; break; case '33': $title = STATISTICS_TYPE_REPORT_B . ': ' . STATISTICS_TYPE_REPORT_33; $chart33 = 'messageStackSuccess'; break; case '34': $title = STATISTICS_TYPE_REPORT_A . ': ' . STATISTICS_TYPE_REPORT_34; $chart34 = 'messageStackSuccess'; break; case '35': $title = STATISTICS_TYPE_REPORT_A . ': ' . STATISTICS_TYPE_REPORT_35; $chart35 = 'messageStackSuccess'; break; case '36': $title = STATISTICS_TYPE_REPORT_B . ': ' . STATISTICS_TYPE_REPORT_36; $chart36 = 'messageStackSuccess'; break; case '37': $title = STATISTICS_TYPE_REPORT_A . ': ' . STATISTICS_TYPE_REPORT_37; $chart37 = 'messageStackSuccess'; break; case '38': $title = STATISTICS_TYPE_REPORT_B . ': ' . STATISTICS_TYPE_REPORT_38; $chart38 = 'messageStackSuccess'; break; case '39': $title = STATISTICS_TYPE_REPORT_A . ': ' . STATISTICS_TYPE_REPORT_39; $chart39 = 'messageStackSuccess'; break; case '40': $title = STATISTICS_TYPE_REPORT_B . ': ' . STATISTICS_TYPE_REPORT_40; $chart40 = 'messageStackSuccess'; break; case '41': $title = STATISTICS_TYPE_REPORT_B . ': ' . STATISTICS_TYPE_REPORT_41; $chart41 = 'messageStackSuccess'; break; case '42': $title = STATISTICS_TYPE_REPORT_A . ': ' . STATISTICS_TYPE_REPORT_42; $chart42 = 'messageStackSuccess'; break; case '43': $title = STATISTICS_TYPE_REPORT_A . ': ' . STATISTICS_TYPE_REPORT_43; $chart43 = 'messageStackSuccess'; break; case '44': $title = STATISTICS_TYPE_REPORT_B . ': ' . STATISTICS_TYPE_REPORT_44; $chart44 = 'messageStackSuccess'; break; case '45': $title = STATISTICS_TYPE_REPORT_B . ': ' . STATISTICS_TYPE_REPORT_45; $chart45 = 'messageStackSuccess'; break; case '50': $title = STATISTICS_TYPE_REPORT_50; $chart50 = 'messageStackSuccess'; break; default: $title = STATISTICS_TYPE_REPORT_A . ': ' . STATISTICS_TYPE_REPORT_2; $chart2 = 'messageStackSuccess'; } $years_array = array(); $years_query = tep_db_query("select distinct year(date) as visitor_year from " . TABLE_VISITORS . ""); while ($years = tep_db_fetch_array($years_query)) { $years_array[] = array('id' => $years['visitor_year'], 'text' => $years['visitor_year']); } // Something for an empty array if (sizeof($years_array) < 1) { $years_array = array(array('id' => date('Y'), 'text' => date('Y'))); } $months_array = array(); for ($i=1; $i<13; $i++) { $months_array[] = array('id' => $i, 'text' => strftime('%B', mktime(0,0,0,$i,15))); } $type_array = array(array('id' => 'daily', 'text' => HEADING_TYPE_DAILY), array('id' => 'monthly', 'text' => HEADING_TYPE_MONTHLY), array('id' => 'yearly', 'text' => HEADING_TYPE_YEARLY)); if ($HTTP_GET_VARS['action']) { switch ($HTTP_GET_VARS['action']) { case 'emptyconfirm': tep_db_query("TRUNCATE " . TABLE_VISITORS); tep_redirect(tep_href_link(FILENAME_VISITORS, tep_get_all_get_params(array('trace_pop_up', 'trace_date', 'trace_ip', 'page', 'action')).'page=' . $HTTP_GET_VARS['page'])); break; case 'robotsconfirm': tep_db_query("DELETE FROM " . TABLE_VISITORS . " where SUBSTRING(browser_language,1,1) = '['"); tep_redirect(tep_href_link(FILENAME_VISITORS, tep_get_all_get_params(array('trace_pop_up', 'trace_date', 'trace_ip', 'page', 'action')).'page=' . $HTTP_GET_VARS['page'])); break; case 'guestsconfirm': tep_db_query("DELETE FROM " . TABLE_VISITORS . " where customers_id='0'"); tep_redirect(tep_href_link(FILENAME_VISITORS, tep_get_all_get_params(array('trace_pop_up', 'trace_date', 'trace_ip', 'page', 'action')).'page=' . $HTTP_GET_VARS['page'])); break; case 'datesconfirm': $delete_year = tep_db_prepare_input($HTTP_POST_VARS['delete_year']); $delete_month = tep_db_prepare_input($HTTP_POST_VARS['delete_month']); $delete_day = tep_db_prepare_input($HTTP_POST_VARS['delete_day']); tep_db_query("DELETE FROM " . TABLE_VISITORS . " where TO_DAYS(date) <= TO_DAYS('" . tep_db_input($delete_year) . "-" . tep_db_input($delete_month) . "-" . tep_db_input($delete_day) . "') - 1"); tep_redirect(tep_href_link(FILENAME_VISITORS)); break; case 'idconfirm': $delete_id = (int) tep_db_prepare_input($HTTP_POST_VARS['delete_id']); tep_db_query("delete from " . TABLE_VISITORS . " where browser_id = '$delete_id'"); tep_redirect(tep_href_link(FILENAME_VISITORS, tep_get_all_get_params(array('trace_pop_up', 'trace_date', 'trace_ip', 'page', 'action')).'page=' . $HTTP_GET_VARS['page'])); break; } } ?> > <?php echo TITLE .' ' . NAVBAR_TITLE; ?> '; $trace_string .= ''; $trace_query = tep_db_query("select date, uri from " . TABLE_VISITORS_TRACE . " where browser_ip = '" . $trace_ip . "' AND (TO_DAYS(date) = TO_DAYS('" . $trace_date . "')) order by date DESC"); while ($trace = tep_db_fetch_array($trace_query)) { $trace_string .= ''; if($trace["uri"] == '/') { $trace_string .= ''; } else { $trace_string .= ''; } } echo ''; tep_session_register( 'bFlag' ); tep_session_register( 'tFlag' ); $bFlag = $trace_ip; $tFlag = $HTTP_GET_VARS['trace_date']; } else { tep_session_unregister( 'bFlag' ); tep_session_unregister( 'tFlag' ); $bFlag = ''; $tFlag = ''; } ?> '9')){ $heading = array(); $contents = array(); include(DIR_WS_INCLUDES . 'graphs/visitor_infobox.php'); if ($report != '10') { $contents[] = array('align' => 'center', 'text' => '
' . tep_image(DIR_WS_IMAGES . 'graphs/visitor_infobox-' . $report . '.png')); } echo ' ' . "\n"; } if ($show_charts == false){ echo ' ' . "\n"; } ?>
' . HEADING_TITLE . ''; } else { echo HEADING_TITLE; } ?>
' . TABLE_HEADING_TRACE_TIME . '' . TABLE_HEADING_URI . '
' . strrchr(tep_datetime_short($trace['date']), " ") . '' . TABLE_ROOT . '
' . chunk_split($trace["uri"],80,"
") . '
' . TITLE_YEAR . ' ' . tep_draw_pull_down_menu('year', $years_array, (($HTTP_GET_VARS['year']) ? $HTTP_GET_VARS['year'] : date('Y')), 'onChange="this.form.submit();"') . ''; break; default: echo ''; echo ''; break; } ?>
' . TITLE_MONTH . ' ' . tep_draw_pull_down_menu('month', $months_array, (($HTTP_GET_VARS['month']) ? $HTTP_GET_VARS['month'] : date('n')), 'onChange="this.form.submit();"') . '' . TITLE_YEAR . ' ' . tep_draw_pull_down_menu('year', $years_array, (($HTTP_GET_VARS['year']) ? $HTTP_GET_VARS['year'] : date('Y')), 'onChange="this.form.submit();"') . '
= TO_DAYS('" . $start_year . "-" . $start_month . "-01') AND TO_DAYS(date) <= TO_DAYS('" . $end_year . "-" . $end_month . "-01') - 1 $robot order by "; $order1 = " WHERE TO_DAYS(date) >= TO_DAYS('" . $start_year . "-" . $start_month . "-01') AND TO_DAYS(date) <= TO_DAYS('" . $end_year . "-" . $end_month . "-01') - 1 $robot"; switch ($HTTP_GET_VARS['type']) { case 'daily': $start_year = $HTTP_GET_VARS['year']; $start_month = $HTTP_GET_VARS['month']; $end_year = $HTTP_GET_VARS['year']; $end_month = $HTTP_GET_VARS['month']+1; if ($end_month == '13') {$end_month = '1'; $end_year = $end_year +1;} $order = " WHERE TO_DAYS(date) >= TO_DAYS('" . $start_year . "-" . $start_month . "-01') AND TO_DAYS(date) <= TO_DAYS('" . $end_year . "-" . $end_month . "-01') - 1 $robot order by "; $order1 = " WHERE TO_DAYS(date) >= TO_DAYS('" . $start_year . "-" . $start_month . "-01') AND TO_DAYS(date) <= TO_DAYS('" . $end_year . "-" . $end_month . "-01') - 1 $robot"; break; case 'monthly': $start_year = $HTTP_GET_VARS['year']; $start_month = '01'; $end_year = $HTTP_GET_VARS['year'] + 1; $end_month = '01'; $order = " WHERE TO_DAYS(date) >= TO_DAYS('" . $start_year . "-" . $start_month . "-01') AND TO_DAYS(date) <= TO_DAYS('" . $end_year . "-" . $end_month . "-01') - 1 $robot order by "; $order1 = " WHERE TO_DAYS(date) >= TO_DAYS('" . $start_year . "-" . $start_month . "-01') AND TO_DAYS(date) <= TO_DAYS('" . $end_year . "-" . $end_month . "-01') - 1 $robot"; break; default: $order = str_replace('AND', 'WHERE', $robot) . " order by "; break; } switch ($listing) { case "id-asc": $order .= "browser_id ASC"; break; case "id-desc": $order .= "browser_id DESC"; break; case "counter-asc": $order .= "counter ASC"; break; case "counter-desc": $order .= "counter DESC"; break; case "date-asc": $order .= "date ASC"; break; case "date-desc": $order .= "date DESC"; break; case "last-asc": $order .= "online ASC"; break; case "last-desc": $order .= "online DESC"; break; case "online-asc": $order .= "(UNIX_TIMESTAMP(online) - UNIX_TIMESTAMP(date)) ASC"; break; case "online-desc": $order .= "(UNIX_TIMESTAMP(online) - UNIX_TIMESTAMP(date)) DESC"; break; case "customer-asc": $order .= "customers_id ASC"; break; case "customer-desc": $order .= "customers_id DESC"; break; case "b-language-asc": $order .= "browser_language ASC"; break; case "b-language-desc": $order .= "browser_language DESC"; break; case "language-asc": $order .= "language ASC"; break; case "language-desc": $order .= "language DESC"; break; case "ip-asc": $order .= "browser_ip ASC"; break; case "ip-desc": $order .= "browser_ip DESC"; break; case "referer-asc": $order .= "referer ASC"; break; case "referer-desc": $order .= "referer DESC"; break; case "uri-asc": $order .= "uri ASC"; break; case "uri-desc": $order .= "uri DESC"; break; default: $listing = "date-desc"; $order .= "online DESC"; } ?> '' . TEXT_HEADING_EMPTY . ''); $contents = array('form' => tep_draw_form('status', FILENAME_VISITORS, tep_get_all_get_params(array('trace_pop_up', 'trace_date', 'trace_ip', 'page', 'action')).'action=emptyconfirm', 'post', 'enctype="multipart/form-data"')); $contents[] = array('text' => TEXT_EDIT_EMPTY); $contents[] = array('align' => 'center', 'text' => '
' . tep_image_submit('button_confirm.gif', IMAGE_CONFIRM) . ' ' . tep_image_button('button_cancel.gif', IMAGE_CANCEL) . ''); break; case 'robots': $heading[] = array('text' => '' . TEXT_HEADING_ROBOTS . ''); $contents = array('form' => tep_draw_form('status', FILENAME_VISITORS, tep_get_all_get_params(array('trace_pop_up', 'trace_date', 'trace_ip', 'page', 'action')).'action=robotsconfirm', 'post', 'enctype="multipart/form-data"')); $contents[] = array('text' => TEXT_EDIT_ROBOTS); $contents[] = array('align' => 'center', 'text' => '
' . tep_image_submit('button_confirm.gif', IMAGE_CONFIRM) . ' ' . tep_image_button('button_cancel.gif', IMAGE_CANCEL) . ''); break; case 'guests': $heading[] = array('text' => '' . TEXT_HEADING_GUESTS . ''); $contents = array('form' => tep_draw_form('status', FILENAME_VISITORS, tep_get_all_get_params(array('trace_pop_up', 'trace_date', 'trace_ip', 'page', 'action')).'action=guestsconfirm', 'post', 'enctype="multipart/form-data"')); $contents[] = array('text' => TEXT_EDIT_GUESTS); $contents[] = array('align' => 'center', 'text' => '
' . tep_image_submit('button_confirm.gif', IMAGE_CONFIRM) . ' ' . tep_image_button('button_cancel.gif', IMAGE_CANCEL) . ''); break; case 'id': $heading[] = array('text' => '' . TEXT_HEADING_BY_ID . ''); $contents = array('form' => tep_draw_form('status', FILENAME_VISITORS, tep_get_all_get_params(array('trace_pop_up', 'trace_date', 'trace_ip', 'page', 'action')).'action=idconfirm', 'post', 'enctype="multipart/form-data"')); $contents[] = array('text' => '
' . TEXT_EDIT_BY_ID . '
' . tep_draw_input_field('delete_id', '0', 'size=11')); $contents[] = array('align' => 'center', 'text' => '
' . tep_image_submit('button_confirm.gif', IMAGE_CONFIRM) . ' ' . tep_image_button('button_cancel.gif', IMAGE_CANCEL) . ''); break; case 'date': $days_array = array(); for ($i=1; $i<32; $i++) { $days_array[] = array('id' => $i, 'text' => ($i) ); } $heading[] = array('text' => '' . TEXT_HEADING_DATE . ''); $contents = array('form' => tep_draw_form('status', FILENAME_VISITORS, tep_get_all_get_params(array('trace_pop_up', 'trace_date', 'trace_ip', 'page', 'action')).'action=datesconfirm', 'post', 'enctype="multipart/form-data"')); $contents[] = array('text' => TEXT_EDIT_DATE); $contents[] = array('text' => '
' . TITLE_DAY . ' ' . tep_draw_pull_down_menu('delete_day', $days_array) . '   ' . TITLE_MONTH . ' ' . tep_draw_pull_down_menu('delete_month', $months_array) . '   ' . TITLE_YEAR . ' ' . tep_draw_pull_down_menu('delete_year', $years_array)); $contents[] = array('align' => 'center', 'text' => '
' . tep_image_submit('button_confirm.gif', IMAGE_CONFIRM) . ' ' . tep_image_button('button_cancel.gif', IMAGE_CANCEL) . ''); break; default: $heading[] = array('text' => '' . TEXT_HEADING_DELETE . ''); if( tep_db_num_rows($counter_data_query) ) { $contents[] = array('align' => 'center', 'text' => '' . tep_image_button('button_guests.gif', IMAGE_DELETE_GUESTS) . '   ' . tep_image_button('button_robots.gif', IMAGE_DELETE_ROBOTS) . '   ' . tep_image_button('button_dates.gif', IMAGE_DELETE_DATE) . '   ' . tep_image_button('button_delete_id.gif', IMAGE_DELETE_BY_ID) . '   ' . tep_image_button('button_empty.gif', IMAGE_EMPTY) . ''); $contents[] = array('align' => 'center', 'text' => '' . TEXT_FOOTER_DELETE . ''); } else { $contents[] = array('align' => 'center', 'text' => '
' . ERROR_NO_DATA . '
'); } break; } if ( (tep_not_null($heading)) && (tep_not_null($contents)) ) { echo ' ' . "\n"; } ?>
   ' . ROBOT_SWITCH_LIMITED . '  ' . tep_image(DIR_WS_IMAGES . 'icon_status_green.gif', VISITOR_ICON_FULL_ACTIVE, 10, 10) . '  ' . tep_image(DIR_WS_IMAGES . 'icon_status_red_light.gif', VISITOR_ICON_LIMITED, 10, 10) . ''; } else { echo '' . ROBOT_SWITCH_FULL . '  ' . tep_image(DIR_WS_IMAGES . 'icon_status_green_light.gif', VISITOR_ICON_FULL, 10, 10) . '  ' . tep_image(DIR_WS_IMAGES . 'icon_status_red.gif', VISITOR_ICON_LIMITED_ACTIVE, 10, 10); } ?>
' . "\n"; $box = new box; echo $box->infoBox($heading, $contents); echo '
' . $cName["customers_firstname"] . '
' . $cName["customers_lastname"] . '

' . tep_image_button('button_orders.gif', IMAGE_ORDERS) . ''; } else { $customer_info_string = '' . $cName["customers_firstname"] . '
' . $cName["customers_lastname"] . '
'; } } else { $customer_info_string = '' . GUEST . ''; } ?> '; } else { echo number_format($visitors["counter"]) . ''; } ?>
<?php echo SORT_UP; ?><?php echo SORT_DOWN; ?>
<?php echo SORT_UP; ?><?php echo SORT_DOWN; ?>
<?php echo SORT_UP; ?><?php echo SORT_DOWN; ?>
<?php echo SORT_UP; ?><?php echo SORT_DOWN; ?>
<?php echo SORT_UP; ?><?php echo SORT_DOWN; ?>
<?php echo SORT_UP; ?><?php echo SORT_DOWN; ?>
<?php echo SORT_UP; ?><?php echo SORT_DOWN; ?>
<?php echo SORT_UP; ?><?php echo SORT_DOWN; ?>
<?php echo SORT_UP; ?><?php echo SORT_DOWN; ?>
<?php echo SORT_UP; ?><?php echo SORT_DOWN; ?>
<?php echo SORT_UP; ?><?php echo SORT_DOWN; ?>
' . $visitors["browser_ip"] . ''; } ?> ' . tep_datetime_short($visitors["date"]) . '';} else {echo tep_date_short($visitors["date"]);} ?> ' . tep_datetime_short($visitors["online"]) . '';} else {echo tep_date_short($visitors["online"]);} ?> ' . number_format($visitors["counter"]) . '' . BOX_TITLE_TRACE . ''; ?>>>>'; } else { echo '>>>'; } ' strtotime($visitors["date"])) { echo date("H:i:s", mktime(0,0,(strtotime($visitors["online"]) - strtotime($visitors["date"])))); } else { echo '00:00:00'; }?> '; return true" onMouseOut="window.status=' '">"); ?> " target="_blank">"); ?> " target="_blank"> "); } ?>
display_count($visitors_query_numrows, MAX_VISITOR_RESULTS, $HTTP_GET_VARS['page'], TEXT_DISPLAY_NUMBER_OF_ENTRIES); ?> display_links($visitors_query_numrows, MAX_VISITOR_RESULTS, MAX_DISPLAY_PAGE_LINKS, $HTTP_GET_VARS['page'], tep_get_all_get_params(array('trace_pop_up', 'trace_date', 'trace_ip', 'page'))); ?>
'; if ($show_charts == true) { echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo '
 
' . STATISTICS_HEADING_X . '
' . STATISTICS_HEADING_Y . '' . STATISTICS_HEADING_HOURS . '' . STATISTICS_HEADING_DAYS . '' . STATISTICS_HEADING_OTHER_DATE . '' . STATISTICS_HEADING_OTHER_VALUE . '
' . STATISTICS_TYPE_REPORT_A . '' . STATISTICS_TYPE_REPORT_1 .'' . STATISTICS_TYPE_REPORT_2 .'' . STATISTICS_TYPE_REPORT_3 . '' . STATISTICS_TYPE_REPORT_12 . '
' . STATISTICS_TYPE_REPORT_B . '' . STATISTICS_TYPE_REPORT_23 .'' . STATISTICS_TYPE_REPORT_24 .'' . STATISTICS_TYPE_REPORT_25 . '' . STATISTICS_TYPE_REPORT_8 . '
' . STATISTICS_TYPE_REPORT_A . '' . STATISTICS_TYPE_REPORT_20 .'' . STATISTICS_TYPE_REPORT_43 .'' . STATISTICS_TYPE_REPORT_42 . '' . STATISTICS_TYPE_REPORT_13 . '
' . STATISTICS_TYPE_REPORT_B . '' . STATISTICS_TYPE_REPORT_29 .'' . STATISTICS_TYPE_REPORT_44 .'' . STATISTICS_TYPE_REPORT_45 . '' . STATISTICS_TYPE_REPORT_11 . '
' . STATISTICS_TYPE_REPORT_A . '' . STATISTICS_TYPE_REPORT_21 . '' . STATISTICS_TYPE_REPORT_22 .'' . STATISTICS_TYPE_REPORT_37 . '' . STATISTICS_TYPE_REPORT_34 . '
' . STATISTICS_TYPE_REPORT_B . '' . STATISTICS_TYPE_REPORT_30 . '' . STATISTICS_TYPE_REPORT_31 .'' . STATISTICS_TYPE_REPORT_38 .'' . STATISTICS_TYPE_REPORT_9 . '
' . STATISTICS_TYPE_REPORT_A . '' . STATISTICS_TYPE_REPORT_5 . '' . STATISTICS_TYPE_REPORT_35 . '' . STATISTICS_TYPE_REPORT_39 . '' . STATISTICS_TYPE_REPORT_32 . '
' . STATISTICS_TYPE_REPORT_B . '' . STATISTICS_TYPE_REPORT_27 . '' . STATISTICS_TYPE_REPORT_36 .'' . STATISTICS_TYPE_REPORT_40 . '' . STATISTICS_TYPE_REPORT_33 . '
' . STATISTICS_TYPE_REPORT_A . ' ' . STATISTICS_TYPE_REPORT_6 .'' . STATISTICS_TYPE_REPORT_4 . '' . STATISTICS_TYPE_REPORT_10 . '
' . STATISTICS_TYPE_REPORT_B . '' . STATISTICS_TYPE_REPORT_41 .'' . STATISTICS_TYPE_REPORT_28 .'' . STATISTICS_TYPE_REPORT_26 . '' . STATISTICS_TYPE_REPORT_7 .'
'; } else { echo ''; echo '
' . STATISTICS_TYPE_REPORT_10 . '
'; } ?>
' . "\n"; $box = new box; $heading[] = array('align' => 'left', 'text' => CHART_BOX_TITLE); echo $box->infoBox($heading, $contents); if ($report == '10') { $bgcolor = '99CCFF'; ?>
'; echo ''; echo ''; echo ''; if ($bgcolor == 'FFFFFF'){$bgcolor = '99CCFF';} else {$bgcolor = 'FFFFFF';} } echo '
' . $terms_grouped[$row][0] . ' ' . $terms_grouped[$row][1] . ' 
'; } echo '

Sorry, I am unable to draw the other Charts as imagecreate() is not available in your version of php (check to see if you have gd support) or you switched off chart display