false, 'message' => '' ); switch($_GET['action']) { case 'start_update': if (isset($GLOBALS["ftp_host"]) && isset($GLOBALS["ftp_login"]) && isset($GLOBALS["ftp_password"])) { // Verbindung aufbauen $conn_id = ftp_connect($GLOBALS["ftp_host"]); // Login mit Benutzername und Passwort $login_result = ftp_login($conn_id, $GLOBALS["ftp_login"], $GLOBALS["ftp_password"]); ftp_pasv($conn_id, TRUE); // Versuche $server_file herunterzuladen und in $local_file zu speichern if (ftp_get($conn_id, $local_file, $server_file, FTP_BINARY)) { // Alles OK $jsonresult['message'] = $translation->get("stat_file_download_step2"); $file = new SplFileObject($local_file); $file->seek($file->getSize()); $linesTotal = $file->key(); $jsonresult['lines'] = $linesTotal; } else { $jsonresult['error'] = true; $jsonresult['message'] = $translation->get("stat_file_download_error"); } // Verbindung schließen ftp_close($conn_id); } echo json_encode($jsonresult); exit(); break; case 'update': // letztes update timestamp ermitteln $query = "SELECT MAX(timestamp) AS letztes FROM main_log"; $result = @mysqli_query($GLOBALS['mysql_con'], $query); $maxTimestamp = 0; if (@mysqli_num_rows($result) == 1) { $row = @mysqli_fetch_array($result); $maxTimestamp = $row['letztes']; } ini_set('max_execution_time', '0'); // include all the classes require_once(CMS_PATH . 'common/logparser/class.log.php'); require_once(CMS_PATH . 'common/logparser/class.log.mysql.php'); require_once(CMS_PATH . 'common/logparser/class.log.output.php'); // see class.log.mysql.php for example table setup // log::$parser = new log_mysql(array( 'table' => 'main_log', 'fields' => array( 'ip' => 'ip', 'identd' => 'identd', 'auth' => 'auth', 'day' => 'day', 'month' => 'month', 'year' => 'year', 'time' => 'time', 'request' => 'request', 'http_version' => 'http_version', 'response_code' => 'response_code', 'size' => 'size', 'referrer' => 'referrer', 'navigator' => 'navigator', 'timestamp' => 'timestamp', 'insertdate' => 'insertdate' ), 'maxTimestamp' => $maxTimestamp, 'start' => $_POST['start'], 'end' => $_POST['end'] )); log::parse($local_file); echo json_encode($jsonresult); exit(); break; default: break; } } function stat_filter( $site_id, $language_id, $from_level = 1, $to_level = 3 ) { $current_filter = (isset($_POST['filter_days']) ? $_POST['filter_days'] : 7); $translation = \DynCom\mysyde\common\classes\Registry::get("translation"); echo "
"; echo "
"; } $messages = array(); ?>

get("filter"); ?>:


" onclick="refresh_stat();" />
get("year"); break; case 'MONTH': $headline = $translation->get("month"); break; case 'WEEKOFYEAR': default: $headline = $translation->get("weekofyear"); break; } echo ""; echo format_key($headline, ""); echo format_key($translation->get("hits"), ""); echo format_key($translation->get("unique_users"), ""); echo ""; echo ""; echo format_seperator(""); echo format_seperator(""); echo format_seperator(""); echo ""; foreach ($hits as $year => $hitData) { foreach ($hitData as $date => $count) { switch ($where) { case 'YEAR': $datestring = $year; break; case 'MONTH': $monthDate = mktime(0, 0, 0, $date, 10); $datestring = utf8_encode(strftime("%B", $monthDate)) . " " . $year; break; case 'WEEKOFYEAR': default: $realKW = sprintf('%02d', $date); $timestamp_montag = strtotime("{$year}-W{$realKW}"); $timestamp_sonntag = strtotime("{$year}-W{$realKW}-7"); $datestring = $date . " (" . date('d.m.Y', $timestamp_montag) . " - " . date("d.m.Y", $timestamp_sonntag) . ") "; break; } echo " \n"; echo format_value($datestring, "input_id"); echo format_value($count, "input_id"); echo format_value($besucher[$year][$date], "input_id"); echo " \n"; } } ?>