diff --git a/app/xml_cdr/resources/dashboard/missed_calls.php b/app/xml_cdr/resources/dashboard/missed_calls.php index 0c469f298e..c56e37f2db 100644 --- a/app/xml_cdr/resources/dashboard/missed_calls.php +++ b/app/xml_cdr/resources/dashboard/missed_calls.php @@ -31,8 +31,7 @@ //get the missed calls from call detail records $sql = "select \n"; $sql .= " direction, \n"; - $sql .= " start_stamp, \n"; - $sql .= " start_epoch, \n"; + $sql .= " to_char(timezone(:time_zone, start_stamp), '".(!empty($_SESSION['domain']['time_format']) && $_SESSION['domain']['time_format']['text'] == '12h' ? "MM/DD HH12:MI am" : "MM/DD HH24:MI")."') as start_date_time, \n"; $sql .= " caller_id_name, \n"; $sql .= " caller_id_number, \n"; $sql .= " answer_stamp \n"; @@ -63,6 +62,7 @@ $sql .= "and start_epoch > ".(time() - 86400)." \n"; $sql .= "order by \n"; $sql .= "start_epoch desc \n"; + $parameters['time_zone'] = isset($_SESSION['domain']['time_zone']['name']) ? $_SESSION['domain']['time_zone']['name'] : date_default_timezone_get(); $parameters['domain_uuid'] = $_SESSION['domain_uuid']; if (!isset($database)) { $database = new database; } $result = $database->select($sql, $parameters, 'all'); @@ -141,10 +141,10 @@ foreach ($result as $index => $row) { if ($index + 1 > $missed_limit) { break; } //only show limit - $tmp_year = date("Y", strtotime($row['start_stamp'])); - $tmp_month = date("M", strtotime($row['start_stamp'])); - $tmp_day = date("d", strtotime($row['start_stamp'])); - $tmp_start_epoch = !empty($_SESSION['domain']['time_format']) && $_SESSION['domain']['time_format']['text'] == '12h' ? date("n/j g:ia", $row['start_epoch']) : date("n/j H:i", $row['start_epoch']); + $start_date_time = str_replace('/0','/', ltrim($row['start_date_time'], '0')); + if (!empty($_SESSION['domain']['time_format']) && $_SESSION['domain']['time_format']['text'] == '12h') { + $start_date_time = str_replace(' 0',' ', $start_date_time); + } //set click-to-call variables if (permission_exists('click_to_call_call')) { $tr_link = "onclick=\"send_cmd('".PROJECT_PATH."/app/click_to_call/click_to_call.php". @@ -170,7 +170,7 @@ } echo "\n"; echo "