} else { $select_options .= "\t\t<option value='\${uk-ring}'>" . $text['option-ukring'] . "</option>\n"; } if ($ring_group_ringback == "\${rs-ring}" || $ring_group_ringback == "rs-ring") { $select_options .= "\t\t<option value='\${rs-ring}' selected='selected'>" . $text['option-rsring'] . "</option>\n"; } else { $select_options .= "\t\t<option value='\${rs-ring}'>" . $text['option-rsring'] . "</option>\n"; } if ($ring_group_ringback == "\${it-ring}" || $ring_group_ringback == "it-ring") { $select_options .= "\t\t<option value='\${it-ring}' selected='selected'>" . $text['option-itring'] . "</option>\n"; } else { $select_options .= "\t\t<option value='\${it-ring}'>" . $text['option-itring'] . "</option>\n"; } if (is_dir($_SERVER["DOCUMENT_ROOT"] . PROJECT_PATH . '/app/music_on_hold')) { require_once "app/music_on_hold/resources/classes/switch_music_on_hold.php"; $moh = new switch_music_on_hold(); $moh->select_name = "ring_group_ringback"; $moh->select_value = $ring_group_ringback; $moh->select_options = $select_options; echo $moh->select(); } else { echo "\t<select class='formfld' name='ring_group_ringback'>\n"; //echo " <option value=''></option>\n"; echo $select_options; echo "\t</select>\n"; } echo "<br />\n"; echo $text['description-ringback'] . "\n"; echo "</td>\n"; echo "</tr>\n"; echo "\t<tr>";
//echo $sql; exit; $prep_statement = $db->prepare(check_sql($sql)); $prep_statement->execute(); unset($sql); //remove parent folder, if empty $parent_path = dirname($stream_path); $parent_path_files = glob(path_join($parent_path, '*')); if (sizeof($parent_files) === 0) { rmdir($parent_path); } } //set message $_SESSION['message'] = $text['message-delete']; } //require_once "app/music_on_hold/resources/classes/switch_music_on_hold.php"; $music = new switch_music_on_hold(); $music->reload(); //redirect header("Location: music_on_hold.php"); exit; } //include the header require_once "resources/header.php"; $document['title'] = $text['title-music_on_hold']; echo "<script language='JavaScript' type='text/javascript'>\n"; echo "\tfunction check_filetype(file_input) {\n"; echo "\t\tfile_ext = file_input.value.substr((~-file_input.value.lastIndexOf('.') >>> 0) + 2);\n"; echo "\t\tif (file_ext != 'mp3' && file_ext != 'wav' && file_ext != 'ogg' && file_ext != '') {\n"; echo "\t\t\tdisplay_message(\"" . $text['message-unsupported_file_type'] . "\", 'negative', '2750');\n"; echo "\t\t}\n"; echo "\t\tvar selected_file_path = file_input.value;\n";
echo " <option value='outbound'>" . $text['label-user_record_outbound'] . "</option>\n"; } echo " </select>\n"; echo "<br />\n"; echo $text['description-user_record'] . "\n"; echo "</td>\n"; echo "</tr>\n"; } if (is_dir($_SERVER["DOCUMENT_ROOT"] . PROJECT_PATH . '/app/music_on_hold')) { echo "<tr>\n"; echo "<td width=\"30%\" class='vncell' valign='top' align='left' nowrap='nowrap'>\n"; echo "\t" . $text['label-hold_music'] . "\n"; echo "</td>\n"; echo "<td width=\"70%\" class='vtable' align='left'>\n"; require_once "app/music_on_hold/resources/classes/switch_music_on_hold.php"; $moh = new switch_music_on_hold(); echo $moh->select('hold_music', $hold_music); echo "\t<br />\n"; echo $text['description-hold_music'] . "\n"; echo "</td>\n"; echo "</tr>\n"; } if (if_group("superadmin")) { if (strlen($user_context) == 0) { $user_context = $_SESSION['domain_name']; } echo "<tr>\n"; echo "<td class='vncellreq' valign='top' align='left' nowrap='nowrap'>\n"; echo " " . $text['label-user_context'] . "\n"; echo "</td>\n"; echo "<td class='vtable' align='left'>\n";
if (count($_SESSION['domains']) > 1) { $path_mod = $_SESSION["domain_name"] . "/"; } // remove sampling rate directory (if any) foreach ($sampling_rate_dirs as $sampling_rate_dir) { rmdir($music_on_hold_dir . "/" . $path_mod . base64_decode($category_dir) . "/" . $sampling_rate_dir); } // remove category directory if (rmdir($music_on_hold_dir . "/" . $path_mod . base64_decode($category_dir))) { sleep(5); // allow time for the OS to catch up (at least Windows, anyway) } } //build and save the XML require_once "app/music_on_hold/resources/classes/switch_music_on_hold.php"; $moh = new switch_music_on_hold(); $moh->xml(); $moh->save(); //redirect the browser header("Location: music_on_hold.php"); exit; } } //include the header require_once "resources/header.php"; $document['title'] = $text['title-moh']; echo "<script language='JavaScript' type='text/javascript'>\n"; echo "\tfunction check_filetype(file_input) {\n"; echo "\t\tfile_ext = file_input.value.substr((~-file_input.value.lastIndexOf('.') >>> 0) + 2);\n"; echo "\t\tif (file_ext != 'mp3' && file_ext != 'wav' && file_ext != '') {\n"; echo "\t\t\tdisplay_message(\"" . $text['message-unsupported_file_type'] . "\", 'negative', '2750');\n";
public function __construct() { //connect to the database if not connected if (!$this->db) { require_once "resources/classes/database.php"; $database = new database(); $database->connect(); $this->db = $database->db; } //add multi-lingual support $language = new text(); $text = $language->get(); //get the ringback types $sql = "select * from v_vars "; $sql .= "where var_cat = 'Defaults' "; $sql .= "and var_name LIKE '%-ring' "; $sql .= "order by var_name asc "; $prep_statement = $this->db->prepare(check_sql($sql)); $prep_statement->execute(); $ringbacks = $prep_statement->fetchAll(PDO::FETCH_NAMED); unset($prep_statement, $sql); foreach ($ringbacks as $ringback) { $ringback = $ringback['var_name']; $label = $text['label-' . $ringback]; if ($label == "") { $label = $ringback; } $ringback_list[$ringback] = $label; } $this->ringbacks = $ringback_list; unset($ringback_list); //get the default_ringback label /* $sql = "select * from v_vars where var_name = 'ringback' "; $prep_statement = $this->db->prepare(check_sql($sql)); $prep_statement->execute(); $result = $prep_statement->fetch(); unset ($prep_statement, $sql); $default_ringback = (string) $result['var_value']; $default_ringback = preg_replace('/\A\$\${/',"",$default_ringback); $default_ringback = preg_replace('/}\z/',"",$default_ringback); #$label = $text['label-'.$default_ringback]; #if($label == "") { $label = $default_ringback; #} $this->default_ringback_label = $label; unset($results, $default_ringback, $label); */ //get music on hold and recordings if (is_dir($_SERVER["PROJECT_ROOT"] . '/app/music_on_hold')) { require_once "app/music_on_hold/resources/classes/switch_music_on_hold.php"; $music = new switch_music_on_hold(); $this->music_list = $music->get(); } if (is_dir($_SERVER["PROJECT_ROOT"] . '/app/recordings')) { require_once "app/recordings/resources/classes/switch_recordings.php"; $recordings = new switch_recordings(); $this->recordings_list = $recordings->list_recordings(); } }