$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"; echo "\t\t}\n";