diff --git a/app/emergency/app_config.php b/app/emergency/app_config.php index 53f7f09e0a..3ede60ab78 100644 --- a/app/emergency/app_config.php +++ b/app/emergency/app_config.php @@ -19,78 +19,67 @@ $apps[$x]['description']['pt-pt'] = ''; $apps[$x]['description']['pt-br'] = ''; - //permission details - $y=0; - $apps[$x]['permissions'][$y]['name'] = "emergency_logs_view"; - $apps[$x]['permissions'][$y]['groups'][] = "superadmin"; - $apps[$x]['permissions'][$y]['menu']['uuid'] = "23a6fc8a-77f1-11ee-88b0-005056a27559"; + //permission details + $y=0; + $apps[$x]['permissions'][$y]['name'] = "emergency_logs_view"; + $apps[$x]['permissions'][$y]['groups'][] = "superadmin"; + $apps[$x]['permissions'][$y]['menu']['uuid'] = "23a6fc8a-77f1-11ee-88b0-005056a27559"; $y++; - $apps[$x]['permissions'][$y]['name'] = "emergency_logs_view_all"; - $apps[$x]['permissions'][$y]['groups'][] = "superadmin"; + $apps[$x]['permissions'][$y]['name'] = "emergency_logs_view_all"; + $apps[$x]['permissions'][$y]['groups'][] = "superadmin"; $y++; //schema details $z=0; $apps[$x]['db'][$y]['table']['name'] = "v_emergency_logs"; $apps[$x]['db'][$y]['table']['parent'] = ""; - $apps[$x]['db'][$y]['fields'][$z]['name'] = 'log_uuid'; + $apps[$x]['db'][$y]['fields'][$z]['name'] = 'emergency_log_uuid'; $apps[$x]['db'][$y]['fields'][$z]['type']['pgsql'] = 'uuid'; $apps[$x]['db'][$y]['fields'][$z]['key']['type'] = 'primary'; $apps[$x]['db'][$y]['fields'][$z]['description'] = ''; $z++; - $apps[$x]['db'][$y]['fields'][$z]['name'] = 'domain_uuid'; - $apps[$x]['db'][$y]['fields'][$z]['type']['pgsql'] = 'uuid'; - $apps[$x]['db'][$y]['fields'][$z]['type']['sqlite'] = 'text'; - $apps[$x]['db'][$y]['fields'][$z]['type']['mysql'] = 'char(36)'; - $apps[$x]['db'][$y]['fields'][$z]['key']['type'] = 'foreign'; - $apps[$x]['db'][$y]['fields'][$z]['key']['reference']['table'] = 'v_domains'; - $apps[$x]['db'][$y]['fields'][$z]['key']['reference']['field'] = 'domain_uuid'; - $z++; - $apps[$x]['db'][$y]['fields'][$z]['name'] = 'date'; - $apps[$x]['db'][$y]['fields'][$z]['type']['pgsql'] = 'text'; - $apps[$x]['db'][$y]['fields'][$z]['type']['sqlite'] = "text"; - $apps[$x]['db'][$y]['fields'][$z]['type']['mysql'] = "text"; - $apps[$x]['db'][$y]['fields'][$z]['description'] = ''; - $z++; - $apps[$x]['db'][$y]['fields'][$z]['name'] = 'time'; - $apps[$x]['db'][$y]['fields'][$z]['type']['pgsql'] = 'text'; - $apps[$x]['db'][$y]['fields'][$z]['type']['sqlite'] = "text"; - $apps[$x]['db'][$y]['fields'][$z]['type']['mysql'] = "text"; - $apps[$x]['db'][$y]['fields'][$z]['description'] = ''; + $apps[$x]['db'][$y]['fields'][$z]['name'] = 'domain_uuid'; + $apps[$x]['db'][$y]['fields'][$z]['type']['pgsql'] = 'uuid'; + $apps[$x]['db'][$y]['fields'][$z]['type']['sqlite'] = 'text'; + $apps[$x]['db'][$y]['fields'][$z]['type']['mysql'] = 'char(36)'; + $apps[$x]['db'][$y]['fields'][$z]['key']['type'] = 'foreign'; + $apps[$x]['db'][$y]['fields'][$z]['key']['reference']['table'] = 'v_domains'; + $apps[$x]['db'][$y]['fields'][$z]['key']['reference']['field'] = 'domain_uuid'; $z++; $apps[$x]['db'][$y]['fields'][$z]['name'] = 'extension'; $apps[$x]['db'][$y]['fields'][$z]['type']['pgsql'] = 'numeric'; $apps[$x]['db'][$y]['fields'][$z]['type']['sqlite'] = "text"; - $apps[$x]['db'][$y]['fields'][$z]['type']['mysql'] = "char(36)"; + $apps[$x]['db'][$y]['fields'][$z]['type']['mysql'] = "char(36)"; $apps[$x]['db'][$y]['fields'][$z]['description'] = ''; $z++; $apps[$x]['db'][$y]['fields'][$z]['name'] = 'event'; $apps[$x]['db'][$y]['fields'][$z]['type']['pgsql'] = "text"; - $apps[$x]['db'][$y]['fields'][$z]['type']['sqlite'] = "text"; - $apps[$x]['db'][$y]['fields'][$z]['type']['mysql'] = "text"; + $apps[$x]['db'][$y]['fields'][$z]['type']['sqlite'] = "text"; + $apps[$x]['db'][$y]['fields'][$z]['type']['mysql'] = "text"; $apps[$x]['db'][$y]['fields'][$z]['description'] = ''; $z++; - $apps[$x]['db'][$y]['fields'][$z]['name'] = "insert_date"; - $apps[$x]['db'][$y]['fields'][$z]['type']['pgsql'] = 'timestamptz'; - $apps[$x]['db'][$y]['fields'][$z]['type']['sqlite'] = 'date'; - $apps[$x]['db'][$y]['fields'][$z]['type']['mysql'] = 'date'; - $apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = ""; - $z++; - $apps[$x]['db'][$y]['fields'][$z]['name'] = "insert_user"; - $apps[$x]['db'][$y]['fields'][$z]['type']['pgsql'] = "uuid"; - $apps[$x]['db'][$y]['fields'][$z]['type']['sqlite'] = "text"; - $apps[$x]['db'][$y]['fields'][$z]['type']['mysql'] = "char(36)"; - $apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = ""; - $z++; - $apps[$x]['db'][$y]['fields'][$z]['name'] = "update_date"; - $apps[$x]['db'][$y]['fields'][$z]['type']['pgsql'] = 'timestamptz'; - $apps[$x]['db'][$y]['fields'][$z]['type']['sqlite'] = 'date'; - $apps[$x]['db'][$y]['fields'][$z]['type']['mysql'] = 'date'; - $apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = ""; - $z++; - $apps[$x]['db'][$y]['fields'][$z]['name'] = "update_user"; - $apps[$x]['db'][$y]['fields'][$z]['type']['pgsql'] = "uuid"; - $apps[$x]['db'][$y]['fields'][$z]['type']['sqlite'] = "text"; - $apps[$x]['db'][$y]['fields'][$z]['type']['mysql'] = "char(36)"; - $apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = ""; -?> + $apps[$x]['db'][$y]['fields'][$z]['name'] = "insert_date"; + $apps[$x]['db'][$y]['fields'][$z]['type']['pgsql'] = 'timestamptz'; + $apps[$x]['db'][$y]['fields'][$z]['type']['sqlite'] = 'date'; + $apps[$x]['db'][$y]['fields'][$z]['type']['mysql'] = 'date'; + $apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = ""; + $z++; + $apps[$x]['db'][$y]['fields'][$z]['name'] = "insert_user"; + $apps[$x]['db'][$y]['fields'][$z]['type']['pgsql'] = "uuid"; + $apps[$x]['db'][$y]['fields'][$z]['type']['sqlite'] = "text"; + $apps[$x]['db'][$y]['fields'][$z]['type']['mysql'] = "char(36)"; + $apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = ""; + $z++; + $apps[$x]['db'][$y]['fields'][$z]['name'] = "update_date"; + $apps[$x]['db'][$y]['fields'][$z]['type']['pgsql'] = 'timestamptz'; + $apps[$x]['db'][$y]['fields'][$z]['type']['sqlite'] = 'date'; + $apps[$x]['db'][$y]['fields'][$z]['type']['mysql'] = 'date'; + $apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = ""; + $z++; + $apps[$x]['db'][$y]['fields'][$z]['name'] = "update_user"; + $apps[$x]['db'][$y]['fields'][$z]['type']['pgsql'] = "uuid"; + $apps[$x]['db'][$y]['fields'][$z]['type']['sqlite'] = "text"; + $apps[$x]['db'][$y]['fields'][$z]['type']['mysql'] = "char(36)"; + $apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = ""; + +?> \ No newline at end of file diff --git a/app/emergency/app_languages.php b/app/emergency/app_languages.php index c909a940ce..c681e62eaa 100644 --- a/app/emergency/app_languages.php +++ b/app/emergency/app_languages.php @@ -1,133 +1,133 @@ +?> \ No newline at end of file diff --git a/app/emergency/emergency.php b/app/emergency/emergency.php index 3564d30f98..19f4da253c 100644 --- a/app/emergency/emergency.php +++ b/app/emergency/emergency.php @@ -78,9 +78,8 @@ if (!empty($_GET["show"])) { $show = $_GET["show"]; } - //get the count -$sql = "select count(log_uuid) "; +$sql = "select count(emergency_log_uuid) "; $sql .= "from v_emergency_logs "; if ($show == 'all') { $sql .= "where true "; @@ -117,7 +116,13 @@ else { } //get the list -$sql = "select * "; +$sql = "select emergency_log_uuid, "; +$sql .= "domain_uuid, "; +$sql .= "extension, "; +$sql .= "event, "; +$sql .= "to_char(timezone(:time_zone, insert_date), 'DD Mon YYYY') as date_formatted, "; +$sql .= "to_char(timezone(:time_zone, insert_date), 'HH12:MI:SS am') as time_formatted, "; +$sql .= "insert_date "; $sql .= "from v_emergency_logs "; if ($show == 'all') { $sql .= "where true "; @@ -133,7 +138,7 @@ if (!empty($search)) { $parameters['search'] = '%'.$search.'%'; } $sql .= limit_offset($rows_per_page, $offset); - +$parameters['time_zone'] = $time_zone; $database = new database; $emergency_logs = $database->select($sql, $parameters ?? null, 'all'); unset($sql, $parameters); @@ -143,12 +148,12 @@ $object = new token; $token = $object->create($_SERVER['PHP_SELF']); //additional includes -$document['title'] = $text['title-emergency-logs']; +$document['title'] = $text['title-emergency_logs']; require_once "resources/header.php"; //show the content echo "