|
|
|
@ -1358,16 +1358,18 @@ class Tracking |
|
|
|
|
$timeFilter = 'last_week'; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
$today = date('Y-m-d H:i:s'); |
|
|
|
|
$today = new DateTime('now', new DateTimeZone('UTC')); |
|
|
|
|
|
|
|
|
|
switch ($timeFilter) { |
|
|
|
|
case 'last_7_days': |
|
|
|
|
$new_date = date('Y-m-d H:i:s', strtotime('-7 day')); |
|
|
|
|
$condition_time = ' AND (login_date >= "'.$new_date.'" AND logout_date <= "'.$today.'") '; |
|
|
|
|
$newDate = new DateTime('-7 day', new DateTimeZone('UTC')); |
|
|
|
|
$condition_time = " AND (login_date >= '{$newDate->format('Y-m-d H:i:s')}'"; |
|
|
|
|
$condition_time .= " AND logout_date <= '{$today->format('Y-m-d H:i:s')}') "; |
|
|
|
|
break; |
|
|
|
|
case 'last_30_days': |
|
|
|
|
$new_date = date('Y-m-d H:i:s', strtotime('-30 day')); |
|
|
|
|
$condition_time = ' AND (login_date >= "'.$new_date.'" AND logout_date <= "'.$today.'") '; |
|
|
|
|
$condition_time = " AND (login_date >= '{$new_date->format('Y-m-d H:i:s')}'"; |
|
|
|
|
$condition_time .= "AND logout_date <= '{$today->format('Y-m-d H:i:s')}') "; |
|
|
|
|
break; |
|
|
|
|
case 'custom': |
|
|
|
|
if (!empty($start_date) && !empty($end_date)) { |
|
|
|
|