if (isset($site2)) { $no_sounds2 = query_one("SELECT COUNT(*) from Sounds WHERE Date='{$date}' AND SiteID='{$site2}' AND SoundStatus!='9'", $connection); $site2q = "OR SiteID='{$site2}'"; } if (isset($site3)) { $no_sounds3 = query_one("SELECT COUNT(*) from Sounds WHERE Date='{$date}' AND SiteID='{$site3}' AND SoundStatus!='9'", $connection); $site3q = "OR SiteID='{$site3}'"; } $no_sounds = $no_sounds1 + $no_sounds2 + $no_sounds3; if ($no_sounds == 0) { echo "<div class=\"notice\"> <img src=\"images/error.png\"> There are no results for the sites and date selected. \n\t\tPlease go back and try again.</div>\n\t\t</body>\n\t\t</html>"; die; } #Get times $query_times = "SELECT DATE_FORMAT(Time, '%H:%i') AS Time FROM Sounds WHERE Date='{$date}' AND (SiteID={$site1} {$site2q} {$site3q}) GROUP BY Time"; $result_times = query_several($query_times, $connection); $nrows_times = mysqli_num_rows($result_times); ?> <!--Blueprint container--> <div class="container"> <?php require "include/topbar.php"; ?> <div class="span-24 last"> <hr noshade> </div> <?php flush(); echo "<div class=\"span-12\"><h4>Date: {$Date_h} - total of {$no_sounds} sounds in the sites selected</h4>\n\t\t\t</div>\n";
<?php $query_tags = "SELECT TagID,Tag FROM Tags WHERE SoundID='{$SoundID}' ORDER BY Tag"; $result_tags = query_several($query_tags, $connection); $nrows_tags = mysqli_num_rows($result_tags); if ($nrows_tags > 0) { $self = $_SERVER['PHP_SELF']; $q = $_SERVER['QUERY_STRING']; echo "<p><strong>Tags</strong>: "; for ($t = 0; $t < $nrows_tags; $t++) { $row_tags = mysqli_fetch_array($result_tags); extract($row_tags); echo "{$Tag} "; } echo "<br>"; }
<!--Blueprint container--> <div class="container"> <?php require "include/topbar.php"; ?> <div class="span-24 last"> <hr noshade> </div> <div class="span-24 last"> </div> <?php $query = "SELECT *, DATE_FORMAT(Date,'%m/%d/%Y') AS Date, TIME_FORMAT(Time,'%H:%i:%s') AS Time FROM Sounds WHERE SoundID='{$SoundID}' AND Sounds.SoundStatus!='9'"; $result = query_several($query, $connection); $nrows = mysqli_num_rows($result); if ($nrows == 0) { echo "<div class=\"error\"><img src=\"images/exclamation.png\"> There was an error. That file ID could not be found. Please go back and try again or contact the administrator.</div>"; } else { $row = mysqli_fetch_array($result); extract($row); $SiteName = query_one("SELECT SiteName FROM Sites WHERE SiteID='{$SiteID}'", $connection); $SiteLat = query_one("SELECT SiteLat FROM Sites WHERE SiteID='{$SiteID}'", $connection); $SiteLon = query_one("SELECT SiteLon FROM Sites WHERE SiteID='{$SiteID}'", $connection); echo "<div class=\"span-24 last\">\t\t\t\n\t\t\t\t\t<h3>Edit sound file information</h3>"; if ($d == 1) { echo "<p><div class=\"success\"><img src=\"images/accept.png\"> File was updated successfully. Return to <a href=\"db_filedetails.php?SoundID={$SoundID}\">the sound file</a></div>"; } echo "<p><a href=\"db_filedetails.php?SoundID={$SoundID}\">{$SoundName}</a>\n\t\t\t\t<br>Filename: {$OriginalFilename}"; $col_name = query_one("SELECT Collections.CollectionName from Collections,Sounds WHERE Collections.ColID=Sounds.ColID AND Sounds.SoundID='{$SoundID}'", $connection);
} } else { $result_kml = query_several("SELECT * FROM Kml WHERE KmlDefault='1'", $connection); $nrows_kml = mysqli_num_rows($result_kml); if ($nrows_kml > 0) { $kml_default = 1; for ($k = 0; $k < $nrows_kml; $k++) { $row_kml = mysqli_fetch_array($result_kml); extract($row_kml); echo "\nvar ctaLayer{$k} = new google.maps.KmlLayer('{$this_kmlurl}',{preserveViewport:true});\n\t\t\t\t\t\t ctaLayer{$k}.setMap(map);\n"; } } } #KML layers forced on $querykml = "SELECT * FROM Kml WHERE KmlDefault='2'"; $result_kml = query_several($querykml, $connection); $nrows_kml = mysqli_num_rows($result_kml); for ($kk = 0; $kk < $nrows_kml; $kk++) { $row_kml = mysqli_fetch_array($result_kml); extract($row_kml); echo "\nvar ctaLayer{$k} = new google.maps.KmlLayer('{$KmlURL}',{preserveViewport:true});\n\t\t\t\t ctaLayer{$k}.setMap(map);\n"; } echo "var myBounds = new google.maps.LatLngBounds(); \n\t\t\t \n\t\t\t\tsetMarkers(map, sites);\n\t\t\t\t infowindow = new google.maps.InfoWindow({\n\t\t\t\t\tcontent: \"loading...\"\n\t\t\t\t \t});\n"; for ($p = 0; $p < count($sites_bounds); $p++) { echo $sites_bounds[$p]; } echo "\nmap.fitBounds(myBounds);\n\t\t\t\t }\n\t\t\t\t</script>\n"; } else { $use_googlemaps = query_one("SELECT Value from PumilioSettings WHERE Settings='use_googlemaps'", $connection); if ($use_googlemaps == "1") { die("<div class=\"error\">The system is set up to use Google Maps v2. This version has been deprecated. Please update your settings in the administration menu or contact your administrator.</div>");
if ($no_sounds > 0) { array_push($sites_rows, "<option value=\"{$SiteID}\">{$SiteName} - {$no_sounds} sounds between {$first_date} and {$last_date}</option>\n"); } } } echo "];\n\n\t\t\tfunction setMarkers(map, markers) {\n\t\t\t\tfor (var i = 0; i < markers.length; i++) {\n\t\t\t\t var sites = markers[i];\n\t\t\t\t var siteLatLng = new google.maps.LatLng(sites[1], sites[2]);\n\t\t\t\t var marker = new google.maps.Marker({\n\t\t\t\t\tposition: siteLatLng,\n\t\t\t\t\tmap: map,\n\t\t\t\t\ttitle: sites[0],\n\t\t\t\t\thtml: '<div style=\"width:220px\"><div class=\"highlight4 ui-corner-all\"><a href=\"' + sites[5] + '\" style=\"color: white;\">' + sites[0] + '</a></div>' + sites[4] + '</div>'\n\t\t\t\t });\n\t\t\t\t var contentString = \"Some content\";\n\n\t\t\t\t google.maps.event.addListener(marker, \"click\", function () {\n\t\t\t\t\tinfowindow.setContent(this.html);\n\t\t\t\t\tinfowindow.open(map, this);\n\t\t\t\t });\n\t\t\t\t}\n\t\t\t }\n\n\t\t\tfunction initialize() {\n\n\t\t\t\tvar centerMap = new google.maps.LatLng(0, 0);\n\n\t\t\t\tvar myOptions = {\n\t\t\t\t zoom: 4,\n\t\t\t\t center: centerMap,\n\t\t\t\t mapTypeId: google.maps.MapTypeId.ROADMAP\n\t\t\t\t}\n\n\t\t\t\tvar map = new google.maps.Map(document.getElementById(\"map_canvas\"), myOptions);\n"; #Check if any KML to use if ($usekml == "1") { for ($k = 0; $k < $nokml; $k++) { $this_kmlID = filter_var($_GET["kml{$k}"], FILTER_SANITIZE_NUMBER_INT); $this_kmlurl = query_one("SELECT KmlURL FROM Kml WHERE KmlID='{$this_kmlID}'", $connection); #add selected kml layers echo "\nvar ctaLayer{$k} = new google.maps.KmlLayer('{$this_kmlurl}',{preserveViewport:true});\n\t\t\t\t\t ctaLayer{$k}.setMap(map);\n"; } } else { $result_kml = query_several("SELECT * FROM Kml WHERE KmlDefault='1'", $connection); $nrows_kml = mysqli_num_rows($result_kml); if ($nrows_kml > 0) { $kml_default = 1; for ($k = 0; $k < $nrows_kml; $k++) { $row_kml = mysqli_fetch_array($result_kml); extract($row_kml); echo "\nvar ctaLayer{$k} = new google.maps.KmlLayer('{$this_kmlurl}',{preserveViewport:true});\n\t\t\t\t\t\t ctaLayer{$k}.setMap(map);\n"; } } } echo "var myBounds = new google.maps.LatLngBounds(); \n\t\t\t \n\t\t\t\tsetMarkers(map, sites);\n\t\t\t\t infowindow = new google.maps.InfoWindow({\n\t\t\t\t\tcontent: \"loading...\"\n\t\t\t\t \t});\n"; for ($p = 0; $p < count($sites_bounds); $p++) { echo $sites_bounds[$p]; } echo "\nmap.fitBounds(myBounds);\n\t\t\t\t }\n\t\t\t\t</script>\n";
} echo "];\n\t\t\t\$( \"#newtag\" ).autocomplete({\n\t\t\t source: mytags\n\t\t });\n\t\t });\n\t</script>\n\t"; } #flush(); #require("include/update_sites.php"); ####################################################3 $use_googlemaps = FALSE; $use_leaflet = TRUE; ####################################################3 if ($use_leaflet == TRUE) { #Leafet echo "\n<link rel=\"stylesheet\" href=\"libs/leaflet/leaflet.css\" />\n\n\n\t\t<style>\n\t\t\t#map { height: 220px; \n\t\t\t\t\twidth: 320px;\n\t\t\t\t}\n\t\t</style>"; } elseif ($use_googlemaps == "3") { #Get points from the database $query_site = "SELECT * FROM Sites,Sounds WHERE SiteLat IS NOT NULL AND SiteLon IS NOT NULL\n\t\t\t\tAND Sites.SiteID=Sounds.SiteID AND Sounds.SoundID='{$SoundID}' \n\t\t\t\tAND Sites.SiteLat IS NOT NULL AND Sites.SiteLon IS NOT NULL LIMIT 1"; $result_site = query_several($query_site, $connection); $nrows_site = mysqli_num_rows($result_site); if ($nrows_site > 0) { $map_div_message = "Your browser does not have JavaScript enabled, which is required to proceed. \n\t\t\t\t\tPlease enable JavaScript or contact your system administrator for help."; } else { $map_div_message = "This sound has no location data."; } if ($nrows_site > 0) { $SiteID = DB::column('SELECT SiteID FROM `Sounds` WHERE SoundID = ' . $SoundID); $SiteLat = DB::column('SELECT SiteLat FROM `Sites` WHERE SiteID = ' . $SiteID); $SiteLon = DB::column('SELECT SiteLon FROM `Sites` WHERE SiteID = ' . $SiteID); $SiteName = DB::column('SELECT SiteName FROM `Sites` WHERE SiteID = ' . $SiteID); require "include/db_filedetails_map_head.php"; } } #HTML5 player
#Escape to prevent SQL injection $mark_tag = mysqli_real_escape_string($connection, $_POST["mark_tag"]); if (isset($_COOKIE["fft"])) { $fft_size = $_COOKIE["fft"]; } else { $fft_size = 2048; } #Build query $query = "INSERT INTO SoundsMarks (SoundID, time_min, time_max, freq_min, freq_max, mark_tag, fft_size, UserID)\n\t\tVALUES ('{$SoundID}', '{$t_min}', '{$t_max}', '{$f_min}', '{$f_max}', '{$mark_tag}', '{$fft_size}', '{$UserID}')"; #Execute query or die and display error message $result = mysqli_query($connection, $query) or die(mysqli_error($connection)); #Make the new mark into a tag #remove spaces $mark_tag = str_replace(" ", "", $mark_tag); #Check that it does not exist already for this sound $result = query_several("SELECT Tag FROM Tags WHERE SoundID='{$SoundID}' AND Tag='{$mark_tag}'", $connection); $nrows = mysqli_num_rows($result); if ($nrows == 0) { $query_tags = "INSERT INTO Tags (SoundID, Tag) VALUES ('{$SoundID}', '{$mark_tag}')"; $result_tags = mysqli_query($connection, $query_tags) or die(mysqli_error($connection)); } echo "<div class=\"alert alert-success\">Record inserted in database</div>"; ?> <p><a href="#" onClick="opener.location.reload();window.close();">Close window</a> </div> </body> </html>
<?php session_start(); require "functions.php"; require "../config.php"; require "apply_config_include.php"; $force_loggedin = TRUE; require "check_login.php"; $SoundID = filter_var($_GET["SoundID"], FILTER_SANITIZE_NUMBER_INT); $newtag = explode(" ", $_GET["newtag"]); $where_to = filter_var($_GET["where_to"], FILTER_SANITIZE_URL); foreach ($newtag as $newitem) { $newitem1 = filter_var($newitem, FILTER_SANITIZE_STRING); #Check that it does not exist already for this sound $result = query_several("SELECT Tag FROM Tags WHERE SoundID='{$SoundID}' AND Tag='{$newitem1}'", $connection); $nrows = mysqli_num_rows($result); if ($nrows == 0) { $query_tags = "INSERT INTO Tags (SoundID, Tag) VALUES ('{$SoundID}', '{$newitem1}')"; $result_tags = mysqli_query($connection, $query_tags) or die(mysqli_error($connection)); } } // Relocate back to the first page of the application if ($_GET["goto"] == "p") { header("Location: ../pumilio.php"); die; } elseif ($_GET["goto"] == "o") { header("Location: {$where_to}"); die; } else { header("Location: ../db_filedetails.php?SoundID={$SoundID}"); die;
if ($no_times == 0) { query_one("DELETE From Tags WHERE TagID='{$TagID}'", $connection); } } $result_tagcloud = query_several("SELECT DISTINCT Tag FROM Tags ORDER BY RAND()", $connection); $nrows_tagcloud = mysqli_num_rows($result_tagcloud); if ($nrows_tagcloud > 0) { $tags_count = array(); for ($tc = 0; $tc < $nrows_tagcloud; $tc++) { $row_tagcloud = mysqli_fetch_array($result_tagcloud); extract($row_tagcloud); $no_times = query_one("SELECT COUNT(*) FROM Tags WHERE Tag='{$Tag}'", $connection); array_push($tags_count, $no_times); } $max_tag_count = max($tags_count); $result_tagcloud = query_several("SELECT DISTINCT Tag FROM Tags ORDER BY RAND()", $connection); $nrows_tagcloud = mysqli_num_rows($result_tagcloud); echo "<p>"; $counter = 0; if ($nrows_tagcloud > 10) { $counter_break = 5; } else { $counter_break = 10; } for ($tc = 0; $tc < $nrows_tagcloud; $tc++) { $row_tagcloud = mysqli_fetch_array($result_tagcloud); extract($row_tagcloud); $no_times = query_one("SELECT COUNT(*) FROM Tags WHERE Tag='{$Tag}'", $connection); $this_tag_size = 10 + round(round($no_times / $max_tag_count) * 10); echo "<a href=\"browse_by_tag.php?Tag={$Tag}\" style=\"font-size: {$this_tag_size};\">{$Tag}</a> "; $counter++;
#First empty the db $query_delete = "SELECT ImageFile FROM SoundsImages WHERE SoundID='{$SoundID}'"; $result_delete = query_several($query_delete, $connection); $nrows_delete = mysqli_num_rows($result_delete); if ($nrows_delete > 0) { for ($del = 0; $del < $nrows_delete; $del++) { $row_delete = mysqli_fetch_array($result_delete); extract($row_delete); $img_to_delete = "sounds/images/" . $ColID . "/" . $DirID . "/" . $ImageFile; if (file_exists($img_to_delete)) { unlink($img_to_delete); } } } $query_delete_all = "DELETE FROM SoundsImages WHERE SoundID='{$SoundID}'"; $result_delete_all = query_several($query_delete_all, $connection); if (!isset($OriginalFilename)) { $OriginalFilename = query_one("SELECT OriginalFilename FROM Sounds WHERE SoundID='{$SoundID}' LIMIT 1", $connection); } $file = $OriginalFilename; $fileName_exp = explode(".", $file); $file2 = $fileName_exp[0] . ".wav"; $file_format_pos = count($fileName_exp) - 1; $file_format = $fileName_exp[$file_format_pos]; $random_value = mt_rand(); if (mkdir("tmp/{$random_value}", 0777)) { #First, check if file exists if (!is_file("sounds/sounds/{$ColID}/{$DirID}/{$OriginalFilename}")) { $err_code = "1"; } else { if ($sox_images) {
$obtain_method = filter_var($_GET["method"], FILTER_SANITIZE_NUMBER_INT); if (isset($_GET["file"])) { $obtain_soundfile = filter_var($_GET["file"], FILTER_SANITIZE_SPECIAL_CHARS); #Remove the http:// $obtain_soundfile = str_ireplace("http://", "", $obtain_soundfile); } else { $obtain_soundfile = ""; } $obtain_fileid = filter_var($_GET["fileid"], FILTER_SANITIZE_NUMBER_INT); #Check if internal transfer if ($obtain_method == 3) { if ($guests_can_open == FALSE && $pumilio_loggedin == FALSE) { header("Location: error.php?e=login"); die; } $result = query_several("SELECT * FROM Sounds WHERE SoundID='{$obtain_fileid}'", $connection); $row = mysqli_fetch_array($result); extract($row); $obtain_soundfile = "sounds/sounds/" . $ColID . "/" . $DirID . "/" . $OriginalFilename; if (!copy($obtain_soundfile, $target_path . $OriginalFilename)) { die("<div class=\"error\">Failed to copy {$obtain_soundfile}...</div>\n"); } header("Location: ./openfile.php?filename={$OriginalFilename}&format={$SoundFormat}&duration={$Duration}&samprate={$SamplingRate}&fileID={$SoundID}&no_channels={$Channels}&from_db=TRUE"); die; } if (!$allow_upload) { header("Location: error.php?e=upload"); die; } echo "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\">\n<html>\n<head>\n<title>{$app_custom_name} - Obtain a file from the web</title>"; require "include/get_css.php";
echo "\n<option value=\"{$SiteID}\">{$SiteName} ({$from_date} - {$to_date})</option>"; } echo "</select> (Required)"; $sites = query_several("SELECT Sites.SiteID,Sites.SiteName FROM Sites,Sounds WHERE Sites.SiteID=Sounds.SiteID \n\t\tAND Sounds.SoundStatus!='9' {$qf_check} GROUP BY SiteName", $connection); $nrows_sites = mysqli_num_rows($sites); echo "<p style=\"margin-left:10px;\">Site 2:</p>\n\t\t<select name=\"site2\" class=\"ui-state-default ui-corner-all\">\n\t\t<option></option>"; for ($sc = 0; $sc < $nrows_sites; $sc++) { $row_site = mysqli_fetch_array($sites); extract($row_site); $SiteName = truncate2($SiteName, 60); $from_date = query_one("SELECT DATE_FORMAT(Date,'%d-%b-%Y') AS Date_f from Sounds WHERE SiteID='{$SiteID}' \n\t\t\tAND Sounds.SoundStatus!='9' {$qf_check} ORDER BY Date ASC LIMIT 1", $connection); $to_date = query_one("SELECT DATE_FORMAT(Date,'%d-%b-%Y') AS Date_f from Sounds WHERE SiteID='{$SiteID}' \n\t\t\tAND Sounds.SoundStatus!='9' {$qf_check} ORDER BY Date DESC LIMIT 1", $connection); echo "\n<option value=\"{$SiteID}\">{$SiteName} ({$from_date} - {$to_date})</option>"; } echo "</select>"; $sites = query_several("SELECT Sites.SiteID,Sites.SiteName FROM Sites,Sounds WHERE Sites.SiteID=Sounds.SiteID \n\t\tAND Sounds.SoundStatus!='9' {$qf_check} GROUP BY SiteName", $connection); $nrows_sites = mysqli_num_rows($sites); echo "<p style=\"margin-left:10px;\">Site 3:</p>\n\t\t<select name=\"site3\" class=\"ui-state-default ui-corner-all\">\n\t\t<option></option>"; for ($sc = 0; $sc < $nrows_sites; $sc++) { $row_site = mysqli_fetch_array($sites); extract($row_site); $SiteName = truncate2($SiteName, 60); $from_date = query_one("SELECT DATE_FORMAT(Date,'%d-%b-%Y') AS Date_f from Sounds WHERE SiteID='{$SiteID}' \n\t\t\tAND Sounds.SoundStatus!='9' {$qf_check} ORDER BY Date ASC LIMIT 1", $connection); $to_date = query_one("SELECT DATE_FORMAT(Date,'%d-%b-%Y') AS Date_f from Sounds WHERE SiteID='{$SiteID}' \n\t\t\tAND Sounds.SoundStatus!='9' {$qf_check} ORDER BY Date DESC LIMIT 1", $connection); echo "\n<option value=\"{$SiteID}\">{$SiteName} ({$from_date} - {$to_date})</option>"; } echo "</select>"; echo "<input type=submit value=\" Show comparison \" class=\"fg-button ui-state-default ui-corner-all\">\n\t\t</form>"; } else { echo "<p>There are no sounds with dates in the database.</p>"; }
echo "\n<option value=\"{$SiteID}\">{$SiteName}</option>"; } } } echo "</select><br>\n\t\t\t\t\n\t\t\t\t<label for=\"Tag_comparison\">Tags:</label>\n\t\t\t\t<select name=\"Tag_comparison\" class=\"form-control\">\n\t\t\t\t\t<option value=\"1\" SELECTED> include </option>\n\t\t\t\t</select> \n\n\t\t\t\t<select name=\"Tags\" class=\"form-control\">\n\t\t\t\t\t<option value=\"0\"></option>"; #Get all dates $query_tags = "SELECT Tag FROM Tags GROUP BY Tag ORDER BY Tag"; $result_tags = query_several($query_tags, $connection); $nrows_tags = mysqli_num_rows($result_tags); if ($nrows_tags > 0) { for ($t = 0; $t < $nrows_tags; $t++) { $row_tags = mysqli_fetch_array($result_tags); extract($row_tags); echo "\n<option value=\"{$Tag}\">{$Tag}</option>"; } } echo "</select><br><br>\n\t\t\t\t\n\t\t\t\t<label for=\"startDuration\">Duration (secs):</label>\n\t\t\t\t<div style=\"margin: 10 10 10 10;\"><div id=\"durationslider\"></div></div><br>\n\t\t\t\t\t\t\t\n\n\t\t\t\t\t<input type=\"text\" id=\"startDuration\" name=\"startDuration\" value=\"{$DurationLow}\" class=\"form-control\" readonly style=\"margin-left:70px;\"> to \n\t\t\t\t\t<input type=\"text\" id=\"endDuration\" name=\"endDuration\" value=\"{$DurationHigh}\" class=\"form-control\" readonly><br>\n\n\t\t\t\t\n\t\t\t\t<label for=\"Channels_comparison\">Channels:</label>\n\t\t\t\t<select name=\"Channels_comparison\" class=\"form-control\">\n\t\t\t\t\t<option value=\"1\" SELECTED> is </option>\n\t\t\t\t\t<option value=\"2\"> is not </option>\n\t\t\t\t</select> \n\t\t\t\t\n\t\t\t\t<select name=\"Channels\" class=\"form-control\">\n\t\t\t\t\t<option value=\"0\" SELECTED></option>\n\t\t\t\t\t<option value=\"1\">1</option>\n\t\t\t\t\t<option value=\"2\">2</option>\n\t\t\t\t</select><br>\n\t\t\t\t\n\n\t\t\t\t<label for=\"SamplingRate_comparison\">Sampling Rate:</label>\n\t\t\t\t\n\t\t\t\t<select name=\"SamplingRate_comparison\" class=\"form-control\">\n\t\t\t\t\t<option value=\"1\" SELECTED> is </option>\n\t\t\t\t\t<option value=\"2\"> is not </option>\n\t\t\t\t</select> \n\n\t\t\t\t<select name=\"SamplingRate\" class=\"form-control\">\n\t\t\t\t\t<option value=\"0\"></option>"; #Get all dates $query_SamplingRate = "SELECT DISTINCT SamplingRate FROM Sounds WHERE SamplingRate IS NOT NULL ORDER BY SamplingRate"; $result_SamplingRate = query_several($query_SamplingRate, $connection); $nrows_SamplingRate = mysqli_num_rows($result_SamplingRate); if ($nrows_SamplingRate > 0) { for ($d = 0; $d < $nrows_SamplingRate; $d++) { $row_SamplingRate = mysqli_fetch_array($result_SamplingRate); extract($row_SamplingRate); echo "\n<option value=\"{$SamplingRate}\">{$SamplingRate}</option>"; } } echo "</select> Hz<br>\n\n\t\t\t\t<label for=\"Orderby\">Order by:</label>\n\n\t\t\t\t\t<select name=\"Orderby\" class=\"form-control\">"; /*<option value=\"Sounds.SoundID\" SELECTED>original order</option>*/ echo "<option value=\"Time\">date and time</option>\n\t\t\t\t\t\t<option value=\"Duration\">duration</option>\n\t\t\t\t\t</select>\n\n\t\t\t \t\t<select name=\"Orderby_dir\" class=\"form-control\">\n\t\t\t\t\t\t<option value=\"ASC\" SELECTED>in ascending order</option>\n\t\t\t\t\t\t<option value=\"DESC\">in descending order</option>\n\t\t\t\t\t</select>\n\n\t\t\t\t<br><br><button type=\"submit\" class=\"btn btn-lg btn-primary btn-block\"> Search </button>\n\t\t\t\t</form>\n\n\t\t\t\t</div>\n\t\t\t</div>";
echo "<select name=\"guests_can_dl\" id=\"guests_can_dl\" class=\"form-control\">"; if ($guests_can_dl) { echo "<option SELECTED value=\"1\">Yes</option>\n\t\t\t\t<option value=\"0\">No</option>"; } else { echo "<option value=\"1\">Yes</option>\n\t\t\t\t<option SELECTED value=\"0\">No</option>"; } echo " </select></div>"; #level data to share #$public_leveldata=query_one("SELECT Value from PumilioSettings WHERE Settings='public_leveldata'", $connection); if ($default_qf == "") { $default_qf = "0"; } echo "<div class=\"form-group\">\n\t<label for=\"default_qf\">Level of data to display to guests</label>"; echo "<select name=\"default_qf\" id=\"default_qf\" class=\"form-control\">"; $query_level = "SELECT * FROM QualityFlags ORDER BY QualityFlagID"; $result_level = query_several($query_level, $connection); $nrows_level = mysqli_num_rows($result_level); for ($i = 0; $i < $nrows_level; $i++) { $row_level = mysqli_fetch_array($result_level); extract($row_level); if ($QualityFlagID == $default_qf) { echo "\n<option value=\"{$QualityFlagID}\" SELECTED>{$QualityFlagID} - {$QualityFlag}</option>"; } else { echo "\n<option value=\"{$QualityFlagID}\">{$QualityFlagID} - {$QualityFlag}</option>"; } } echo "</select></div>"; #allow access using XML #$use_xml=query_one("SELECT Value from PumilioSettings WHERE Settings='use_xml'", $connection); if ($use_xml == "1") { $use_xml_d = "Yes";
require "apply_config_include.php"; $force_loggedin = TRUE; require "check_login.php"; echo "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\">\n<html>\n<head>"; require "get_css_include.php"; require "get_jqueryui_include.php"; echo "\n</head>\n<body>\n"; $scriptname = filter_var($_POST["scriptname"], FILTER_SANITIZE_STRING); $scriptver = filter_var($_POST["scriptver"], FILTER_SANITIZE_STRING); $Lang = filter_var($_POST["Lang"], FILTER_SANITIZE_STRING); #$script=$_POST["script"]; $script = str_replace("'", "\\'", $_POST["script"]); $script = str_replace("\\n", "\\\\n", $script); $script = str_replace("\\t", "\\\\t", $script); $script = str_replace("\\%", "\\\\%", $script); #Check that it does not exist already for this sound $result = query_several("SELECT ScriptName FROM Scripts WHERE ScriptName='{$scriptname}'", $connection); $nrows = mysqli_num_rows($result); if ($nrows == 0) { $query_script = "INSERT INTO Scripts (ScriptName, Language, Script, ScriptVersion) \n\t\t\t\tVALUES ('{$scriptname}', '{$Lang}', '{$script}', '{$scriptver}')"; $result_script = mysqli_query($connection, $query_script) or die(mysqli_error($connection)); echo "<div class=\"success\">The script was added to the database.</div>"; } else { echo "<div class=\"error\">There is a script with that name already. Please try again.</div>"; } ?> <br><br><p><a href="#" onClick="opener.location.reload();window.close();">Close window.</a> </body> </html>