예제 #1
0
<?php

/**
 * Viewing a summary of statistics by month, grouped by day and host
 * @author Daniel15 <daniel at dan.cx>
 */
require __DIR__ . '/includes/core.php';
// Querystring parameters
$year = !empty($_GET['year']) ? (int) $_GET['year'] : date('Y');
$month = !empty($_GET['month']) ? (int) $_GET['month'] : date('m');
$start_date = mktime(0, 0, 0, $month, 1, $year);
$data = Data_Summary::month_by_day($start_date);
header('Content-Type: text/json');
echo json_encode((object) array('days' => array_keys(reset($data)), 'data' => $data));
예제 #2
0
<?php

/**
 * Viewing a summary of statistics by day
 * @author Daniel15 <daniel at dan.cx>
 */
require __DIR__ . '/includes/core.php';
// Querystring parameters
$year = !empty($_GET['year']) ? (int) $_GET['year'] : date('Y');
$month = !empty($_GET['month']) ? (int) $_GET['month'] : date('m');
$day = !empty($_GET['day']) ? (int) $_GET['day'] : date('d');
$date = mktime(0, 0, 0, $month, $day, $year);
$data = Data_Summary::day($date);
View::factory('day')->set('date', $date)->set('data', $data)->render();
예제 #3
0
<?php

/**
 * Viewing a summary of statistics by month
 * @author Daniel15 <daniel at dan.cx>
 */
require __DIR__ . '/includes/core.php';
// Querystring parameters
$year = !empty($_GET['year']) ? (int) $_GET['year'] : date('Y');
$month = !empty($_GET['month']) ? (int) $_GET['month'] : date('m');
$start_date = mktime(0, 0, 0, $month, 1, $year);
$data = Data_Summary::month($start_date);
View::factory('month')->set('date', $start_date)->set('data', $data)->render();