Portions created by the Initial Developer are Copyright (C) 2026 the Initial Developer. All Rights Reserved. Contributor(s): Mark J Crane */ //includes files require_once dirname(__DIR__, 2) . "/resources/require.php"; require_once "resources/check_auth.php"; //check permissions if (!(permission_exists('destination_add') || permission_exists('destination_edit'))) { echo "access denied"; exit; } //get the search string $search = $_REQUEST['search'] ?? ''; //get the destinations $destinations = new destinations(); $array = $destinations->get('dialplan'); //get the language $domain_language = $settings->get('domain', 'language'); //add multi-lingual support $language = new text; $text = $language->get(); //add multi-lingual support $language2 = new text; //count the rows $num_rows = 0; foreach($array as $key => $value) { foreach($value as $row) { //show only rows that match the search if (!empty($search) && !empty($row['uuid'])) { if (stripos($row['label'].$row['extension'], $search) !== false) { $destination_array[$key][] = $row; $num_rows++; } } //count the rows when the search is empty if (empty($search) && !empty($row['uuid'])) { $destination_array[$key][] = $row; $num_rows++; } } } //include the header require_once "resources/header.php"; //show the content echo "
\n"; echo "
".$text['title-destination_map']."
".number_format($num_rows)."
\n"; echo "
\n"; echo "\n"; echo "
\n"; echo "
".$text['description-destination_map']."
\n"; echo "
\n"; //loop through the destinations array if (!empty($destination_array)) { foreach($destination_array as $key => $value) { //add multi-lingual support if (file_exists(dirname(__DIR__, 2)."/app/".$key."/app_languages.php")) { $text2 = $language2->get($domain_language, 'app/'.$key); } //set the applications php list filename $app_name_list = $key.'.php'; if ($key == 'call_centers') { $app_name_list = 'call_center_queues.php'; } //echo "

".$text['title-'.$key]."

\n"; echo "
\n"; echo "".$text2['title-'.$key]."
\n"; echo "
\n"; echo " \n"; echo " \n"; echo " \n"; echo " \n"; echo " \n"; //echo " \n"; echo " \n"; foreach($value as $row) { if (!empty($row['uuid'])) { //set the applications php edit filename $app_name_edit = database::singular($key).'_edit.php'; if ($key == 'call_centers') { $app_name_edit = 'call_center_queue_edit.php'; } //set the row URL $list_row_url = '/app/'.$key.'/'.$app_name_edit.'?id='.$row['uuid']; //show the row echo " \n"; echo " \n"; echo " \n"; // echo " \n"; echo " \n"; echo " \n"; } } echo "
".$text['label-label']."".$text['label-extension']." description
\n"; echo " ".$row['label']."\n"; echo " \n"; echo " ".$row['extension']."\n"; echo " \n"; // echo " ".$row['description']."\n"; // echo " \n"; echo "  \n"; echo "
\n"; echo "
\n"; echo "
\n"; } } //include the footer require_once "resources/footer.php";