diff --git a/app/xml_cdr/resources/dashboard/missed_calls.php b/app/xml_cdr/resources/dashboard/missed_calls.php index 8f289151ec..1d05ebcec2 100644 --- a/app/xml_cdr/resources/dashboard/missed_calls.php +++ b/app/xml_cdr/resources/dashboard/missed_calls.php @@ -28,11 +28,17 @@ //if also viewing system status, show more recent calls (more room avaialble) $missed_limit = !empty($selected_blocks) && (is_array($selected_blocks) && in_array('counts', $selected_blocks)) ? 10 : 5; +//set the sql time format + $sql_time_format = 'DD Mon HH12:MI am'; + if (!empty($_SESSION['domain']['time_format']['text'])) { + $sql_time_format = $_SESSION['domain']['time_format']['text'] == '12h' ? "DD Mon HH12:MI am" : "DD Mon HH24:MI"; + } + //get the missed calls from call detail records $sql = "select \n"; $sql .= " status, \n"; $sql .= " direction, \n"; - $sql .= " to_char(timezone(:time_zone, start_stamp), '".(!empty($_SESSION['domain']['time_format']) && $_SESSION['domain']['time_format']['text'] == '12h' ? "DD Mon HH12:MI am" : "DD Mon HH24:MI")."') as start_date_time, \n"; + $sql .= " to_char(timezone(:time_zone, start_stamp), '".$sql_time_format."') as start_date_time, \n"; $sql .= " caller_id_name, \n"; $sql .= " caller_id_number, \n"; $sql .= " answer_stamp \n";