Example #1
0
        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>";
}
Example #2
0
$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);
    #Source info
    echo "<br>From: <a href=\"db_browse.php?ColID={$ColID}\">{$col_name}</a>\n\t\t\t\t<p><form action=\"file_edit2.php\" method=\"POST\" id=\"EditForm\">\n\t\t\t\t\t<input name=\"SoundID\" type=\"hidden\" value=\"{$SoundID}\">\n\n\t\t\t\tNew name of the sound: <br><input name=\"SoundName\" type=\"text\" maxlength=\"160\" size=\"60\" value=\"{$SoundName}\" class=\"fg-button ui-state-default ui-corner-all formedge\"><br>\n\t\t\t\tCustom ID of sound: <br><input name=\"OtherSoundID\" type=\"text\" maxlength=\"10\" value=\"{$OtherSoundID}\" class=\"fg-button ui-state-default ui-corner-all formedge\"><br>\n\t\t\t\tDate: <br><input name=\"Date\" type=\"text\" size=\"10\" value=\"{$Date}\" id=\"datepicker\" class=\"fg-button ui-state-default ui-corner-all formedge\"> (month/day/year)<br>\n\t\t\t\tTime: <br><input name=\"Time\" type=\"text\" size=\"10\" value=\"{$Time}\" class=\"fg-button ui-state-default ui-corner-all formedge\"> (hour:minute:second)<br>\n\t\t\t\tSite: <a href=\"browse_site.php?SiteID={$SiteID}\" title=\"Browse all the recordings at this site\">{$SiteName}</a> - <a href=\"viewsite_map.php?SiteID={$SiteID}\">Map</a><br>\n\t\t\t\tChange the site: <br>";
    $query_s = "SELECT SiteID AS this_SiteID, SiteName AS this_SiteName, SiteLat AS this_SiteLat, SiteLon AS this_SiteLon FROM Sites ORDER BY this_SiteName";
    $result_s = mysqli_query($connection, $query_s) or die(mysqli_error($connection));
    $nrows_s = mysqli_num_rows($result_s);
    echo "<select name=\"SiteID\" class=\"ui-state-default ui-corner-all formedge\">";
    echo "<option value=\"{$SiteID}\">{$SiteName} ({$SiteLat}/{$SiteLon})</option>\n";
    for ($j = 0; $j < $nrows_s; $j++) {
        $row_s = mysqli_fetch_array($result_s);
        extract($row_s);
        echo "<option value=\"{$this_SiteID}\">{$this_SiteName} ({$this_SiteLat}/{$this_SiteLon})</option>\n";
    }
    echo "</select>";
    echo " &nbsp;&nbsp;<a href=\"#\" onclick=\"window.open('include/addsite.php', 'addsite', 'width=650,height=350,status=yes,resizable=yes,scrollbars=auto')\">Add sites</a><br>";
    $query_e = "SELECT SensorID as SensorID_q, Recorder, Microphone from Sensors ORDER BY SensorID_q";
Example #3
0
        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>");
    } else {
        die("<div class=\"error\">The system is not set up for the use of Google Maps.</div>");
    }
}
Example #4
0
$newqf = filter_var($_GET["newqf"], FILTER_SANITIZE_NUMBER_FLOAT, FILTER_FLAG_ALLOW_FRACTION);
echo "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\">\n<html>\n<head>\n<title>{$app_custom_name}</title>";
#Get CSS
require "include/get_css.php";
require "include/get_jqueryui.php";
if ($use_googleanalytics) {
    echo $googleanalytics_code;
}
#Execute custom code for head, if set
if (is_file("{$absolute_dir}/customhead.php")) {
    include "customhead.php";
}
?>

</head>
<body>

<div style="padding: 10px;">

<?php 
$a = query_one("UPDATE Sounds SET QualityFlagID='{$newqf}' WHERE SoundID='{$SoundID}'", $connection);
echo "<div class=\"success\">Quality Flag changed for this file. {$a}</div>";
?>

<br><p><a href="#" onClick="opener.location.reload();window.close();">Close window.</a>

</div>

</body>
</html>
Example #5
0
session_start();
require "include/functions.php";
$config_file = 'config.php';
if (file_exists($config_file)) {
    require "config.php";
} else {
    header("Location: error.php?e=config");
    die;
}
require "include/apply_config.php";
$Token = filter_var($_GET["Token"], FILTER_SANITIZE_STRING);
$username = $_COOKIE["username"];
$UserID = query_one("SELECT UserID FROM Users WHERE UserName='******'", $connection);
$valid_token = query_one("SELECT COUNT(*) FROM Tokens WHERE TokenID='{$Token}' AND UserID='{$UserID}'", $connection);
if ($valid_token == 1) {
    $SoundID = query_one("SELECT soundfile_id FROM Tokens WHERE TokenID='{$Token}' LIMIT 1", $connection);
    $random_cookie = query_one("SELECT random_cookie FROM Tokens WHERE TokenID='{$Token}' LIMIT 1", $connection);
    $from_db = query_one("SELECT from_db FROM Tokens WHERE TokenID='{$Token}' LIMIT 1", $connection);
}
$del_token = query_one("DELETE FROM Tokens WHERE TokenID='{$Token}'", $connection);
#rm temp dir
delTree('tmp/' . $random_cookie . '/');
// Relocate back to the first page of the application
if ($from_db == "TRUE") {
    #echo $from_db;
    header("Location: ./db_filedetails.php?SoundID={$SoundID}");
    die;
} else {
    header("Location: ./");
    die;
}
Example #6
0
?>

</head>
<body>

	<!--Blueprint container-->
	<div class="container">
		<?php 
require "include/topbar.php";
?>
		<div class="span-24 last">
			<hr noshade>
		</div>
		<div class="span-24 last">
			<?php 
$WeatherSiteName = query_one("SELECT WeatherSiteName FROM WeatherSites WHERE WeatherSiteID='{$WeatherSiteID}' LIMIT 1", $connection);
echo "<h3>Add data to {$WeatherSiteName}</h3>";
echo "There are 10 comma-separated fields:\n\t\t\t\t<ul>\n\t\t\t\t\t<li>Date (YYYY-MM-DD)\n\t\t\t\t\t<li>Time (HH:MM:SS)\n\t\t\t\t\t<li>Temperature (degrees Celcius)\n\t\t\t\t\t<li>Precipitation (mm)\n\t\t\t\t\t<li>Relative Humidity (%)\n\t\t\t\t\t<li>Dew Point\n\t\t\t\t\t<li>Wind Speed (m/s)\n\t\t\t\t\t<li>Wind Direction\n\t\t\t\t\t<li>Light Intensity\n\t\t\t\t\t<li>Barometric Pressure\n\t\t\t\t</ul>";
echo "<form action=\"add_weatherdata2.php\" method=\"POST\" id=\"AddForm\">\n\t\t\t\t<p>Add one line for each data point (use [enter] for a new line) with each field separated by a comma (,). If the data is missing, enter \"NULL\" without the quotes or leave empty.\n\t\t\t\t<textarea name=\"commadata\" cols=\"60\" rows=\"10\"></textarea>\n\t\t\t\t<input type=\"hidden\" name=\"WeatherSiteID\" value=\"{$WeatherSiteID}\">\n\t\t\t\t<br><input type=submit value=\" Check data and insert to database \" class=\"fg-button ui-state-default ui-corner-all\">\n\t\t\t</form>";
?>

		</div>
		<div class="span-24 last">
			&nbsp;
		</div>
		<div class="span-24 last">
			<?php 
require "include/bottom.php";
?>

		</div>
Example #7
0
if ($use_googleanalytics) {
    echo $googleanalytics_code;
}
#Execute custom code for head, if set
if (is_file("{$absolute_dir}/customhead.php")) {
    include "customhead.php";
}
?>

</head>
<body>

<div style="padding: 10px;">

<?php 
$SiteName = query_one("SELECT SiteName FROM Sites WHERE SiteID='{$SiteID}'", $connection);
echo "<h3>Photographs at {$SiteName}:</h3>";
$query = "SELECT *, DATE_FORMAT(PhotoDate, '%d-%b-%Y %H:%i:%s') AS PhotoDate_f FROM Sites, SitesPhotos WHERE Sites.SiteID='{$SiteID}' AND \n\t\tSites.SiteID=SitesPhotos.SiteID ORDER BY PhotoDate, ViewDegrees";
$result = query_several($query, $connection);
$nrows = mysqli_num_rows($result);
if ($nrows > 0) {
    for ($i = 0; $i < $nrows; $i++) {
        $row = mysqli_fetch_array($result);
        extract($row);
        echo "<p><strong>{$PhotoDate_f}</strong><br>\n\t\t\t<div style=\"padding: 10px;\"><a href=\"#\" onclick=\"window.open('sitephotos/{$SiteID}/{$PhotoFilename}', 'pics1', 'width=1000,height=800,status=yes,resizable=yes,scrollbars=yes'); return false;\"><img src=\"sitephotos/{$SiteID}/{$PhotoFilename}\" width=\"200\"></a><br>";
        if (isset($ViewDegrees) && $ViewDegrees != "") {
            echo "Direction: {$ViewDegrees}<br>";
        }
        if (isset($PhotoNotes) && $PhotoNotes != "") {
            echo "Notes: {$PhotoNotes}<br>";
        }
Example #8
0
require "include/check_login.php";
$Token = filter_var($_GET["Token"], FILTER_SANITIZE_STRING);
$username = $_COOKIE["username"];
$UserID = query_one("SELECT UserID FROM Users WHERE UserName='******'", $connection);
$valid_token = query_one("SELECT COUNT(*) FROM Tokens WHERE TokenID='{$Token}' AND UserID='{$UserID}'", $connection);
if ($valid_token == 1) {
    $soundfile_format = query_one("SELECT soundfile_format FROM Tokens WHERE TokenID='{$Token}' LIMIT 1", $connection);
    $soundfile_duration = query_one("SELECT soundfile_duration FROM Tokens WHERE TokenID='{$Token}' LIMIT 1", $connection);
    $soundfile_name = query_one("SELECT soundfile_name FROM Tokens WHERE TokenID='{$Token}' LIMIT 1", $connection);
    $soundfile_wav = query_one("SELECT soundfile_wav FROM Tokens WHERE TokenID='{$Token}' LIMIT 1", $connection);
    $soundfile_id = query_one("SELECT soundfile_id FROM Tokens WHERE TokenID='{$Token}' LIMIT 1", $connection);
    $no_channels = query_one("SELECT no_channels FROM Tokens WHERE TokenID='{$Token}' LIMIT 1", $connection);
    $soundfile_samplingrate = query_one("SELECT soundfile_samplingrate FROM Tokens WHERE TokenID='{$Token}' LIMIT 1", $connection);
    $soundfile_samplingrateoriginal = query_one("SELECT soundfile_samplingrateoriginal FROM Tokens WHERE TokenID='{$Token}' LIMIT 1", $connection);
    $random_cookie = query_one("SELECT random_cookie FROM Tokens WHERE TokenID='{$Token}' LIMIT 1", $connection);
    $from_db = query_one("SELECT from_db FROM Tokens WHERE TokenID='{$Token}' LIMIT 1", $connection);
}
$SoundID = $soundfile_id;
if (isset($_COOKIE["palette"])) {
    $palette = $_COOKIE["palette"];
} else {
    $palette = "";
}
#Sanitize
if (isset($_GET["ch"])) {
    $ch = filter_var($_GET["ch"], FILTER_SANITIZE_NUMBER_INT);
} else {
    $ch = "1";
}
if (isset($_GET["filter"])) {
    $filter = filter_var($_GET["filter"], FILTER_SANITIZE_STRING);
Example #9
0
</head>
<body>

	<!--Blueprint container-->
	<div class="container">
		<?php 
require "include/topbar.php";
?>
		<div class="span-24 last">
			<hr noshade>
		</div>
		<div class="span-11">
			<?php 
//How many sounds associated with that tag
$no_sounds = query_one("SELECT COUNT(*) as no_sounds_tag FROM Tags WHERE Tag='{$Tagq}'", $connection);
if ($startid < 1) {
    $startid = 1;
}
$startid_q = $startid - 1;
if ($display_type == "summary") {
    $how_many_to_show = 10;
} elseif ($display_type == "gallery") {
    $how_many_to_show = 18;
}
$endid = $how_many_to_show;
$endid_show = $startid_q + $endid;
if ($startid_q + $how_many_to_show >= $no_sounds) {
    $endid_show = $no_sounds;
}
$sql_limit = "{$startid_q}, {$endid}";
Example #10
0
            $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> &nbsp;&nbsp; ";
            $counter++;
            if ($counter > $counter_break) {
                $counter = 0;
                echo "<br>";
            }
        }
    }
} else {
    echo "<p>There are no tags in the database.";
}
Example #11
0
         echo "<tr><td>\n\t\t\t\t\t&nbsp;</td><td><strong>File</strong></td><td>&nbsp;</td><td><strong>Status</strong></td></tr>\n";
         $query_1 = "SELECT * from FilesToAddMembers WHERE FilesToAddID='{$FilesToAddID}' ORDER BY ReturnCode DESC";
         $result_1 = mysqli_query($connection, $query_1) or die(mysqli_error($connection));
         $nrows_1 = mysqli_num_rows($result_1);
         if ($nrows_1 > 0) {
             for ($j = 0; $j < $nrows_1; $j++) {
                 $row_1 = mysqli_fetch_array($result_1);
                 extract($row_1);
                 echo "<tr><td>&nbsp;</td><td>{$FullPath}</td><td>&nbsp;</td>\n";
                 if ($ReturnCode == 1) {
                     echo "<td> <img src=\"images/database.png\"> To add</td></tr>\n";
                 } elseif ($ReturnCode == 0) {
                     echo "<td> <img src=\"images/accept.png\"> Added to archive</td></tr>\n";
                 } elseif ($ReturnCode == 2) {
                     echo "<td> <img src=\"images/ajax-loader.gif\"> Working... ";
                     $mins_working = query_one("SELECT TIMESTAMPDIFF(MINUTE, TimeStamp, NOW()) FROM FilesToAddMembers\n\t\t\t\t\t\t\t\t\t\tWHERE ToAddMemberID='{$ToAddMemberID}'", $connection);
                     if ($mins_working > 5) {
                         echo "(working for more than five minutes, <a href=\"file_manager.php?ToAddMemberID={$ToAddMemberID}&tab={$i}&action=1\" title=\"Reset\">reset</a> or\n\t\t\t\t\t\t\t\t\t\t<a href=\"file_manager.php?ToAddMemberID={$ToAddMemberID}&tab={$i}&action=2\" title=\"Reset\">delete</a>?)";
                     }
                     echo "</td></tr>\n";
                 } elseif ($ReturnCode == 9) {
                     echo "<td> <img src=\"images/error.png\"> Error: {$ErrorCode}<br>\n\t\t\t\t\t\t\t\t\t<a href=\"file_manager.php?ToAddMemberID={$ToAddMemberID}&tab={$i}&action=1\" title=\"Reset\">reset</a> |\n\t\t\t\t\t\t\t\t\t<a href=\"file_manager.php?ToAddMemberID={$ToAddMemberID}&tab={$i}&action=2\" title=\"Reset\">delete</a>\n\t\t\t\t\t\t\t\t\t</td></tr>\n";
                 }
             }
         }
         echo "</table>\n";
     } else {
         echo "<p><a href=\"file_manager.php?tab={$i}\" title=\"Show details\">Show details</a>";
     }
     echo "</div>\n";
 }
Example #12
0
function stats_in_background($absolute_dir, $connection)
{
    $cores_to_use = query_one("SELECT Value from PumilioSettings WHERE Settings='cores_to_use'", $connection);
    if ($cores_to_use == "" || $cores_to_use == "0") {
        $cores_to_use = 1;
    }
    require "config.php";
    $bg_processes = bgHowMany();
    if ($bg_processes < $cores_to_use) {
        $random_value = mt_rand();
        $tmp_dir = 'tmp/' . $random_value;
        mkdir($tmp_dir, 0777);
        #make htaccess to protect files
        $myFile = $tmp_dir . '/.htaccess';
        $fh = fopen($myFile, 'w') or die("Can't write the configuration file {$myFile}. Please check that the webserver can write the tmp directory.");
        fwrite($fh, "order allow,deny" . PHP_EOL);
        fwrite($fh, "deny from all" . PHP_EOL);
        fclose($fh);
        #write config file
        $myFile = $tmp_dir . '/configfile.php';
        $fh = fopen($myFile, 'w') or die("Can't write the configuration file {$myFile}. Please check that the webserver can write the tmp directory.");
        fwrite($fh, "<?php" . PHP_EOL);
        fwrite($fh, "{$host}" . PHP_EOL);
        fwrite($fh, "{$database}" . PHP_EOL);
        fwrite($fh, "{$user}" . PHP_EOL);
        fwrite($fh, "{$password}" . PHP_EOL);
        fwrite($fh, "{$absolute_dir}/" . PHP_EOL);
        fwrite($fh, "{$random_value}" . PHP_EOL);
        fwrite($fh, "{$R_ADI_db_value}" . PHP_EOL);
        fwrite($fh, "{$R_ADI_max_freq}" . PHP_EOL);
        fwrite($fh, "{$R_ADI_freq_step}" . PHP_EOL);
        fwrite($fh, "{$R_H_segment_length}" . PHP_EOL);
        fwrite($fh, "?>");
        fclose($fh);
        copy('include/R/stats_pumiliodb.py', $tmp_dir . '/stats_pumiliodb.py');
        copy('include/R/getstats.R', $tmp_dir . '/getstats.R');
        exec('chmod +x ' . $tmp_dir . '/*', $out, $retval);
        exec('chmod -R 777 ' . $tmp_dir . '', $out, $retval);
        exec('cd ' . $tmp_dir . '; ./stats_pumiliodb.py > /dev/null 2> /dev/null & echo $!', $out, $retval);
    }
}
Example #13
0
                if (is_file("sounds/images/{$ColID}" . "/" . $DirID . "/" . $ImageFile)) {
                    unlink("sounds/images/{$ColID}" . "/" . $DirID . "/" . $ImageFile);
                }
                $ImageFile = query_one("SELECT ImageFile FROM SoundsImages WHERE SoundID='{$SoundID}' AND ImageType='spectrogram-small'", $connection);
                if (is_file("sounds/images/{$ColID}" . "/" . $DirID . "/" . $ImageFile)) {
                    unlink("sounds/images/{$ColID}" . "/" . $DirID . "/" . $ImageFile);
                }
                $ImageFile = query_one("SELECT ImageFile FROM SoundsImages WHERE SoundID='{$SoundID}' AND ImageType='waveform-small'", $connection);
                if (is_file("sounds/images/{$ColID}" . "/" . $DirID . "/" . $ImageFile)) {
                    unlink("sounds/images/{$ColID}" . "/" . $DirID . "/" . $ImageFile);
                }
                $ImageFile = query_one("SELECT ImageFile FROM SoundsImages WHERE SoundID='{$SoundID}' AND ImageType='spectrogram-large'", $connection);
                if (is_file("sounds/images/{$ColID}" . "/" . $DirID . "/" . $ImageFile)) {
                    unlink("sounds/images/{$ColID}" . "/" . $DirID . "/" . $ImageFile);
                }
                $ImageFile = query_one("SELECT ImageFile FROM SoundsImages WHERE SoundID='{$SoundID}' AND ImageType='waveform-large'", $connection);
                if (is_file("sounds/images/{$ColID}" . "/" . $DirID . "/" . $ImageFile)) {
                    unlink("sounds/images/{$ColID}" . "/" . $DirID . "/" . $ImageFile);
                }
                $query_file = "DELETE FROM SoundsImages WHERE SoundID='{$SoundID}'";
                $result_file = mysqli_query($connection, $query_file) or die(mysqli_error($connection));
            }
            #Check if there are mp3
            if (is_file("{$absolute_dir}/sounds/previewsounds/{$ColID}/{$DirID}/{$AudioPreviewFilename}")) {
                unlink("{$absolute_dir}/sounds/previewsounds/{$ColID}/{$DirID}/{$AudioPreviewFilename}");
            }
        }
    }
}
header("Location: {$where_to}&md={$howmany}");
die;
Example #14
0
    if ($nrows > 0) {
        for ($i = 0; $i < $nrows; $i++) {
            $row = mysqli_fetch_array($result);
            extract($row);
            query_one("ALTER TABLE {$TABLE_NAME} ENGINE = MyISAM", $connection);
        }
    }
    #Change collation
    $query = "SELECT TABLE_NAME FROM information_schema.TABLES WHERE TABLE_SCHEMA = '{$database}' AND TABLE_COLLATION != 'utf8_unicode_ci'";
    $result = mysqli_query($connection, $query) or die(mysqli_error($connection));
    $nrows = mysqli_num_rows($result);
    if ($nrows > 0) {
        for ($i = 0; $i < $nrows; $i++) {
            $row = mysqli_fetch_array($result);
            extract($row);
            query_one("ALTER TABLE {$TABLE_NAME} DEFAULT CHARSET=utf8 COLLATE='utf8_unicode_ci'", $connection);
        }
    }
    #Change OtherSoundID to null
    $query = "UPDATE Sounds SET OtherSoundID = NULL WHERE OtherSoundID = '0'";
    $result = mysqli_query($connection, $query) or die(mysqli_error($connection));
    #Optimize tables
    $query_opt = "OPTIMIZE TABLE CheckAuxfiles, Collections, Cookies, Kml, ProcessLog, PumilioLog, PumilioSettings, QualityFlags, Queue, QueueJobs, SampleMembers, Samples, Scripts, Sensors, Sites, SitesPhotos, Sounds, SoundsImages, SoundsMarks, Tags, Tokens, Users, WeatherData, WeatherSites";
    $result_opt = mysqli_query($connection, $query_opt) or die(mysqli_error($connection));
    echo "<h4><div class=\"alert alert-success\"><span class=\"glyphicon glyphicon-ok\" aria-hidden=\"true\"></span> Database fields were updated</div></h4>\n\t<br><br><br>\n\t<p><a href=\"#\" onClick=\"window.close();\">Close window</a>\n";
} else {
    echo "<meta http-equiv=\"refresh\" content=\"1;url=checkdb.php?run=TRUE\">\n\n\t</head>\n\t<body>\n\n\t<div style=\"padding: 10px;\">\n\n\t\t<br><br><br>\n\t\t<h3>Working... \n\t\t<br>Please wait... <i class=\"fa fa-cog fa-spin\"></i>\n\t\t</h3>\n\n\t\t<br><br><br>\n\t<br><p><a href=\"#\" onClick=\"window.close();\">Cancel and close window</a>";
}
?>

</div>
Example #15
0
            $allowuse = TRUE;
        } else {
            $allowuse = FALSE;
        }
    } else {
        if (sessionAuthenticate($connection)) {
            $allowuse = TRUE;
        }
    }
}
if ($allowuse == FALSE) {
    echo "<p>You have to be logged in to use this tool.";
    die;
}
$username = $_COOKIE["username"];
$UserID = query_one("SELECT UserID FROM Users WHERE UserName='******' LIMIT 1", $connection);
#Sanitize inputs:
$t_min = filter_var($_POST["t_min"], FILTER_SANITIZE_NUMBER_FLOAT, FILTER_FLAG_ALLOW_FRACTION);
$t_max = filter_var($_POST["t_max"], FILTER_SANITIZE_NUMBER_FLOAT, FILTER_FLAG_ALLOW_FRACTION);
$f_min = filter_var($_POST["f_min"], FILTER_SANITIZE_NUMBER_FLOAT, FILTER_FLAG_ALLOW_FRACTION);
$f_max = filter_var($_POST["f_max"], FILTER_SANITIZE_NUMBER_FLOAT, FILTER_FLAG_ALLOW_FRACTION);
$SoundID = filter_var($_POST["SoundID"], FILTER_SANITIZE_NUMBER_INT);
$from_db = filter_var($_POST["from_db"], FILTER_SANITIZE_STRING_INT);
#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
Example #16
0
    include "customhead.php";
}
echo "</head>\n";
echo "<body>";
?>

	<!--Blueprint container-->
	<div class="container">
		<?php 
require "include/topbar.php";
?>
				
		<h2>Search</h2>
			<?php 
echo "<p>Search sounds in the archive using several options:<br><hr noshade>";
$no_sounds_s = query_one("SELECT COUNT(*) as no_sounds FROM Sounds WHERE SoundStatus!='9' {$qf_check}", $connection);
if ($no_sounds_s == 0) {
    echo "<p>This archive does not have any sounds.";
} else {
    #Search by ID
    echo "<div class=\"row\">\n\t\t\t\t\t\t<div class=\"col-lg-6\">\n\n\n\n\t\t\t\t\t\t\t<div class=\"panel panel-primary\">\n\t\t\t\t\t\t\t\t<div class=\"panel-heading\">\n\t\t\t\t\t\t\t\t\t<h3 class=\"panel-title\">Search by Sound ID</h3>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t<div class=\"panel-body\">\n\t\t\t\t\t\t\t\t\t<form action=\"db_filedetails.php\" method=\"GET\" class=\"form-inline\">\n\t\t\t\t\t\t\t\t\t \t<label for=\"SoundID\">Sound ID: </label>\n\t\t\t\t\t\t\t\t\t\t<input type=\"text\" name=\"SoundID\" id=\"SoundID\" class=\"form-control\" placeholder=\"SoundID\">\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t<button type=\"submit\" class=\"btn btn-primary\"> Search </button>\n\t\t\t\t\t\t\t\t\t</form>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t</div>";
    echo "</div><div class=\"col-lg-6\">&nbsp;</div></div>\n";
    echo "<div class=\"row\">\n\t\t\t\t<div class=\"col-lg-8\">";
    require "include/mainsearch.php";
    echo "</div>\n\n\t\t\t\t<div class=\"col-lg-4\"></div>\n\t\t\t</div>\n\t\t\t<br><br>";
}
?>

		<br>
		</div>
		
Example #17
0
     }
 }
 for ($t = 1; $t < count($this_row_exploded); $t++) {
     $this_value = trim($this_row_exploded[$t]);
     if ($this_value == "NULL") {
         $this_row_imploded = $this_row_imploded . ",NULL";
     } else {
         $this_row_imploded = $this_row_imploded . ",'{$this_value}'";
     }
 }
 #Insert to MySQL
 $DirID = rand(1, 100);
 $query_to_insert = "INSERT INTO Sounds ({$fields}, ColID, DirID, SiteID, SensorID) VALUES ({$this_row_imploded}, '{$ColID}', '{$DirID}', '{$SiteID}', '{$SensorID}');";
 $result = mysqli_query($connection, $query_to_insert) or die(mysqli_error($connection));
 $SoundID = mysqli_insert_id($connection);
 $SoundName = query_one("SELECT SoundName FROM Sounds WHERE SoundID='{$SoundID}' LIMIT 1", $connection);
 if ($SoundName == "") {
     $result1 = mysqli_query($connection, "UPDATE Sounds SET SoundName=OriginalFilename WHERE SoundID='{$SoundID}' LIMIT 1") or die(mysqli_error($connection));
 }
 exec('python include/soundcheck.py ' . $dir . $this_file, $lastline, $retval);
 if ($retval == 0) {
     $file_info = $lastline[0];
     $file_info = explode(",", $file_info);
     $sampling_rate = $file_info[0];
     $no_channels = $file_info[1];
     $file_format = $file_info[2];
     $file_duration = $file_info[3];
     $file_bits = $file_info[4];
     $query_file = "UPDATE Sounds SET \n\t\t\t\tSamplingRate='{$sampling_rate}', Channels='{$no_channels}', \n\t\t\t\tDuration='{$file_duration}',SoundFormat='{$file_format}', BitRate='{$file_bits}' \n\t\t\t\tWHERE SoundID='{$SoundID}' LIMIT 1";
     $result_file = mysqli_query($connection, $query_file) or die(mysqli_error($connection));
     unset($lastline);
Example #18
0
require "include/topbar.php";
?>
		<div class="span-24 last">
			<hr noshade>
		</div>
		<div class="span-24 last">

			<?php 
$howmany = count($SoundIDs);
if ($howmany > 0) {
    echo "<div class=\"notice\">\n\t\t\t\t\t<p>Are you sure you want to delete these files?\n\t\t\t\t\t<form action=\"del_multiple_files2.php\" method=\"POST\">\n\t\t\t\t\t<ul>";
    for ($i = 0; $i < $howmany; $i++) {
        $OriginalFilename = query_one("SELECT OriginalFilename FROM Sounds WHERE SoundID='{$SoundIDs[$i]}' LIMIT 1", $connection);
        $small_spectrogram = query_one("SELECT ImageFile FROM SoundsImages WHERE SoundID='{$SoundIDs[$i]}' and ImageType='spectrogram-small'", $connection);
        $ColID = query_one("SELECT ColID FROM Sounds WHERE SoundID='{$SoundIDs[$i]}' LIMIT 1", $connection);
        $DirID = query_one("SELECT DirID FROM Sounds WHERE SoundID='{$SoundIDs[$i]}' LIMIT 1", $connection);
        $spec_path = "sounds/images/{$ColID}/{$DirID}/{$small_spectrogram}";
        if (!is_file("{$absolute_dir}/{$spec_path}")) {
            $spec_path = "images/notready-small.png";
        }
        echo "<li><img src=\"{$app_url}/{$spec_path}\" width=\"300\" height=\"150\"><br>\n\t\t\t\t\t<input type=\"hidden\" name=SoundIDs[] value=\"{$SoundIDs[$i]}\">{$SoundIDs[$i]} {$OriginalFilename}";
    }
    echo "</ul>\n\t\t\t\t\t<input name=\"where_to\" type=\"hidden\" value=\"{$where_to}\">\n\t\t\t\t\t<input type=submit value=\" Yes, permanently delete these files \" class=\"fg-button ui-state-default ui-corner-all\"></form>\n\t\t\t\t\t</div>";
} else {
    echo "<div class=\"error\">You did not select any files to delete. Please go back and try again.</div><br>";
}
?>

		</div>
		<div class="span-24 last">
			<?php 
Example #19
0
<?php

$spectrogram_width = 920;
$spectrogram_height = 460;
$frequency_min = 10;
#$frequency_max=10000;
$frequency_max = query_one("SELECT SpecMaxFreq from SoundsImages WHERE SoundID='{$SoundID}' AND ImageType='spectrogram-large'", $connection);
$no_channels = query_one("SELECT Channels from Sounds WHERE SoundID='{$SoundID}'", $connection);
if ($frequency_max == "") {
    $frequency_max = query_one("SELECT Value from PumilioSettings WHERE Settings='max_spec_freq'", $connection);
}
$frequency_range = $frequency_max - $frequency_min;
$time_min = 0;
$time_max = query_one("SELECT Duration FROM Sounds WHERE SoundID='{$SoundID}'", $connection);
$total_time = $time_max;
$resultm = mysqli_query($connection, "SELECT marks_ID FROM SoundsMarks WHERE SoundID='{$SoundID}'") or die(mysqli_error($connection));
$nrowsm = mysqli_num_rows($resultm);
if ($nrowsm > 0) {
    for ($w = 0; $w < $nrowsm; $w++) {
        $rowm = mysqli_fetch_array($resultm);
        extract($rowm);
        //Query for the last mark edit
        $res = mysqli_query($connection, "SELECT marks_ID, SoundID AS mark_fileID, time_min AS mark_time_min, time_max AS mark_time_max, freq_min AS mark_freq_min, freq_max AS mark_freq_max, mark_tag FROM SoundsMarks WHERE marks_ID='{$marks_ID}' LIMIT 1");
        $row = mysqli_fetch_array($res);
        extract($row);
        unset($row);
        #Only show if some part of the mark is inside the current window
        if ($mark_time_min < $time_max && $mark_time_max > $time_min && $mark_freq_min < $frequency_max && $mark_freq_max > $frequency_min) {
            //Time and freq calculations to draw the boxes of marks
            if ($mark_time_max > $time_max) {
                $mark_time_max = $time_max;
Example #20
0
 }
 #IMAGE SIZES
 # small = 300x150
 # mid = 600x300
 # large = 920x460
 $image_width_small = 300;
 $image_height_small = 150;
 $image_width_med = 600;
 $image_height_med = 300;
 $image_width_large = 920;
 $image_height_large = 460;
 #MED Size images
 $random_dir = mt_rand();
 mkdir("tmp/{$random_dir}", 0777);
 if (!isset($Channels)) {
     $Channels = query_one("SELECT Channels FROM Sounds WHERE SoundID='{$SoundID}' LIMIT 1", $connection);
 }
 if ($Channels == 1) {
     if ($sox_images) {
         $image_height_med1 = $image_height_med + 1;
         exec('sox tmp/' . $random_value . '/' . $file2 . ' -n rate ' . $max_spec_freq_rate . 'k spectrogram -x ' . $image_width_med . ' -y ' . $image_height_med1 . ' -a -r -l ' . $spectrogram_palette_c . ' -o tmp/' . $random_dir . '/' . $fileName_exp[0] . '_st1.png', $lastline, $retval);
         if ($retval != 0) {
             die("<div class=\"alert alert-danger\">There was a problem with SoX1...</div>");
         }
         #Trim
         exec('convert tmp/' . $random_dir . '/' . $fileName_exp[0] . '_st1.png -crop ' . $image_width_med . 'x' . $image_height_med . '+0+0 tmp/' . $random_dir . '/' . $fileName_exp[0] . '_s1.png', $lastline, $retval);
         if ($retval != 0) {
             die('<div class=\\"alert alert-danger\\">There was a problem with Imagemagick...</div>');
         }
     } else {
         exec('include/svt.py -f ' . $fft . ' -s tmp/' . $random_dir . '/' . $fileName_exp[0] . '_s1.png -a tmp/' . $random_dir . '/' . $fileName_exp[0] . '_w1.png -w ' . $image_width_med . ' -o 1 -h ' . $image_height_med . ' -m ' . $max_spec_freq . ' -p ' . $spectrogram_palette . ' tmp/' . $random_value . '/' . $file2, $lastline, $retval);
Example #21
0
session_start();
require "include/functions.php";
$config_file = 'config.php';
if (file_exists($config_file)) {
    require "config.php";
} else {
    header("Location: error.php?e=config");
    die;
}
require "include/apply_config.php";
$Token = filter_var($_GET["Token"], FILTER_SANITIZE_STRING);
$username = $_COOKIE["username"];
$UserID = query_one("SELECT UserID FROM Users WHERE UserName='******'", $connection);
$valid_token = query_one("SELECT COUNT(*) FROM Tokens WHERE TokenID='{$Token}' AND UserID='{$UserID}'", $connection);
if ($valid_token == 1) {
    $soundfile_name = query_one("SELECT soundfile_name FROM Tokens WHERE TokenID='{$Token}' LIMIT 1", $connection);
}
echo "<!DOCTYPE html>\n<html>\n<head>\n\n<title>{$app_custom_name} - Settings Page</title>";
require "include/get_css3.php";
require "include/get_jqueryui.php";
if ($use_googleanalytics) {
    echo $googleanalytics_code;
}
#Execute custom code for head, if set
if (is_file("{$absolute_dir}/customhead.php")) {
    include "customhead.php";
}
?>

</head>
<body>
Example #22
0
<?php

require "../config.php";
require "functions.php";
$SoundID = $_GET['SoundID'];
$img_query = "SELECT ImageFile from SoundsImages WHERE SoundID={$SoundID}";
$content = query_one($img_query, $connection);
header("Content-type: image/png");
echo $content[0];
Example #23
0
    }
    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
# http://www.jplayer.org
echo "\n<link href=\"html5player/jplayer.css\" rel=\"stylesheet\" type=\"text/css\">";
echo "\n<script type=\"text/javascript\" src=\"js/jquery.jplayer.min.js\"></script>\n";
if ($DirID == 0 || $DirID == "") {
    $DirID = rand(1, 100);
    query_one("UPDATE Sounds SET DirID='{$DirID}' WHERE SoundID='{$SoundID}'", $connection);
}
#Check MP3
if ($AudioPreviewFilename == "" || is_null($AudioPreviewFilename)) {
    #File does not exists, create
    $AudioPreviewFilename = dbfile_mp3($OriginalFilename, $SoundFormat, $ColID, $DirID, $SamplingRate);
    $query_mp3 = "UPDATE Sounds SET AudioPreviewFilename='{$AudioPreviewFilename}' WHERE SoundID='{$SoundID}'";
    $result_mp3 = mysqli_query($connection, $query_mp3) or die(mysqli_error($connection));
}
if (!is_file("{$absolute_dir}/sounds/previewsounds/{$ColID}/{$DirID}/{$AudioPreviewFilename}")) {
    #File does not exists, create
    #Check if dir exists
    if (!is_dir("sounds/previewsounds/{$ColID}")) {
        mkdir("sounds/previewsounds/{$ColID}", 0777);
    }
    if (!is_dir("sounds/previewsounds/{$ColID}/{$DirID}")) {
Example #24
0
    }
    $datecoded = $yearcoded . "-" . $monthcoded . "-" . $daycoded;
    $timecoded = $hourcoded . ":" . $minutescoded . ":" . $secondscoded;
    $DirID = rand(1, 100);
    $file_path = $dir . $this_file;
    #Check that the extension is a valid sound file
    #Quick check to avoid adding non-sound files
    $ext = pathinfo($this_file, PATHINFO_EXTENSION);
    if (in_array(strtolower($ext), $sox_formats)) {
        $query_to_insert = "INSERT INTO FilesToAddMembers (FilesToAddID, FullPath, OriginalFilename, Date, Time, SiteID, ColID, DirID, SensorID)\n\t\t\t\t\tVALUES ('{$ToAddID}', '{$file_path}', '{$this_file}', '{$datecoded}', '{$timecoded}', '{$SiteID}', '{$ColID}', '{$DirID}', '{$SensorID}')";
        #echo "Query: $query_to_insert<br>";
        $result = mysqli_query($connection, $query_to_insert) or die(mysqli_error($connection));
        $kk = $kk + 1;
    }
}
$CollectionName = query_one("SELECT CollectionName from Collections WHERE ColID='{$ColID}'", $connection);
echo "<br><div class=\"success\">{$kk} sound files were scheduled to be added to the collection {$CollectionName}.</div>\n\t\t\t\t<p><a href=\"add.php\">Add more files</a> or <a href=\"file_manager.php\">check file status</a>.";
?>

		</div>
		<div class="span-24 last">
			&nbsp;
		</div>
		<div class="span-24 last">
			<?php 
require "include/bottom.php";
?>

		</div>
	</div>
Example #25
0
     $check_auxfiles = TRUE;
 }
 $query_img5 = query_one("SELECT ImageFile FROM SoundsImages WHERE SoundID='{$SoundID}' and ImageType='spectrogram-small'", $connection);
 if (!is_file("{$absolute_dir}/sounds/images/{$ColID}/{$DirID}/{$query_img5}")) {
     $check_auxfiles = TRUE;
 }
 $query_img6 = query_one("SELECT ImageFile FROM SoundsImages WHERE SoundID='{$SoundID}' and ImageType='waveform-large'", $connection);
 if (!is_file("{$absolute_dir}/sounds/images/{$ColID}/{$DirID}/{$query_img6}")) {
     $check_auxfiles = TRUE;
 }
 $query_img7 = query_one("SELECT ImageFile FROM SoundsImages WHERE SoundID='{$SoundID}' and ImageType='spectrogram-large'", $connection);
 if (!is_file("{$absolute_dir}/sounds/images/{$ColID}/{$DirID}/{$query_img7}")) {
     $check_auxfiles = TRUE;
 }
 #MP3
 $AudioPreviewFilename = query_one("SELECT AudioPreviewFilename FROM Sounds WHERE SoundID='{$SoundID}' LIMIT 1", $connection);
 if ($AudioPreviewFilename == "" || is_null($AudioPreviewFilename)) {
     $check_auxfiles = TRUE;
 }
 if (!is_file("{$absolute_dir}/sounds/previewsounds/{$ColID}/{$DirID}/{$AudioPreviewFilename}")) {
     $check_auxfiles = TRUE;
 }
 if ($check_auxfiles) {
     #check files in background
     if ($special_noprocess == FALSE) {
         check_in_background($absolute_dir, $connection);
     }
 }
 if ($row_break_counter == 3) {
     echo "</div>";
     $row_break_counter = 0;
Example #26
0
?>

</head>
<body>

<div style="padding: 10px;">

<?php 
$query = "SELECT SoundsMarks.SoundID,SoundsMarks.time_min,SoundsMarks.time_max,SoundsMarks.freq_min,\n\t\tSoundsMarks.freq_max,SoundsMarks.mark_tag,SoundsMarks.fft_size,SoundsMarks.UserID,\n\t\tSounds.OtherSoundID, Sounds.SoundName, Sounds.OriginalFilename\n\t\tfrom SoundsMarks,Collections,Sounds\n\t\tWHERE Collections.ColID='{$ColID}' AND\n\t\tSounds.SoundID=SoundsMarks.SoundID AND\n\t\tSounds.ColID=Collections.ColID AND\n\t\tSounds.SoundStatus!='9'\n\t\tORDER BY SoundID, time_min, freq_min";
$result = mysqli_query($connection, $query) or die(mysqli_error($connection));
$nrows = mysqli_num_rows($result);
if ($nrows == 0) {
    echo "<p>There are no data records.";
} else {
    echo "<p><strong>Sound_ID, Other_ID, Name, Complete_filename, time_min, time_max, freq_min, freq_max, {$mark_tag_name}, fft_size, Username</strong><br>";
    for ($i = 0; $i < $nrows; $i++) {
        $row = mysqli_fetch_array($result);
        extract($row);
        $User = query_one("SELECT UserName FROM Users WHERE UserID='{$UserID}' LIMIT 1", $connection);
        echo "{$SoundID}, {$OtherSoundID}, {$SoundName}, {$OriginalFilename}, {$time_min}, {$time_max}, {$freq_min}, {$freq_max}, {$mark_tag}, {$fft_size}, {$User}<br>";
    }
    echo "</p>";
}
echo "<br><br>========================================<br>\n\n\tNote: Time is in seconds and frequency is in Hz.";
?>

</div>

</body>
</html>
Example #27
0
        unset($nrows1);
    }
    echo "</select> \n\t\t\t\t<button type=\"submit\" class=\"btn btn-primary\"> Select </button></form>";
} else {
    echo "<p>This archive has no Collections yet.";
}
echo "</div>\n\t\t<div class=\"col-md-6\">&nbsp;</div></div>\n\n\n\t\t<hr noshade>\n\t\t\t<p><strong> Add files from a Wildlife Acoustics SongMeter:</strong>";
echo "<p><a href=\"add_from_field.php?sm=1\">Upload sound files from a Wildlife Acoustics SongMeter</a>";
echo "<p><a href=\"add_from_field.php?sm=1&local=1\">Add sound files from a Wildlife Acoustics SongMeter</a> (stored locally in server)";
echo "<hr noshade>\n\t\t\t<p><strong> Add files from other sound recorders:</strong>";
echo "<p><a href=\"add_from_field.php\">Upload sound files from the field</a>\n\t\t\t<p><a href=\"add_from_field.php?local=1\">Add sound files from the field</a> (stored locally in server)";
echo "<p><a href=\"add_from_db.php\">Import files from a database/spreadsheet</a>";
echo "<hr noshade>\n\t\t\t<p><a href=\"add_collection.php\">Add Collections</a>";
echo "<p><a href=\"#\" onclick=\"window.open('include/addsite.php', 'addsite', 'width=650,height=350,status=yes,resizable=yes,scrollbars=auto')\">Add Sites</a>";
echo "<p><a href=\"admin.php?t=4\">Add Sensors</a> (in the admin menu)";
$result_fm = query_one("SELECT COUNT(*) FROM FilesToAddMembers", $connection);
if ($result_fm > 0) {
    echo "<p><a href=\"file_manager.php\">Check uploaded file status</a>";
}
/*echo "<p>Upload photographs of the sites to serve as a reference.</p>
		<p><form action=\"photoupload.php\" method=\"GET\">
		<button type=\"submit\" class=\"btn btn-primary\"> Upload a photo from your computer </button>
		</form></p>";*/
echo "<br>\n\t\t\t<form action=\"sample_archive.php\" method=\"GET\">\n\t\t\t\t\t\t<button type=\"submit\" class=\"btn btn-primary\"> Sample the archive </button>\n\t\t\t\t\t\t</form>\n\n\t\t\t<br>\n\t\t\t<form action=\"export_marks.php\" method=\"GET\">\n\t\t\t\t\t\t\t<button type=\"submit\" class=\"btn btn-primary\"> Export marks data </button>\n\t\t\t\t\t\t</form>";
if ($useR == TRUE) {
    echo "<br><br><form action=\"qc.php\" method=\"GET\">\n\t\t\t\t\t\t\t<input type=submit value=\" Data extraction for quality control \" class=\"form-control\">\n\t\t\t\t\t\t</form>";
}
echo "<br><form action=\"qa.php\" method=\"GET\">\n\t\t\t\t\t\t<button type=\"submit\" class=\"btn btn-primary\"> Figures for quality control </button>\n\t\t\t\t\t\t</form>";
require "include/bottom.php";
?>
Example #28
0
	<p>This menu lets you delete a whole collection from the archive. 
	<br><strong>The original sound files will be deleted from the disk. This can not be undone.</strong></p>
			
	<?php 
#Delete file div
echo "<div id=\"dialog\" title=\"Delete the files?\">\n\t<p><span class=\"ui-icon ui-icon-alert\" style=\"float:left; margin:0 7px 20px 0;\"></span>The files for this collection will be permanently deleted and cannot be recovered. Are you sure?</p>\n\t</div>";
echo "<form id=\"del1\" name=\"del1\" action=\"delcol.php\" method=\"GET\">";
$query = "SELECT * from Collections ORDER BY CollectionName";
$result = mysqli_query($connection, $query) or die(mysqli_error($connection));
$nrows = mysqli_num_rows($result);
echo "<select name=\"ColID\" class=\"form-control\">";
for ($i = 0; $i < $nrows; $i++) {
    $row = mysqli_fetch_array($result);
    extract($row);
    $this_no_sounds = query_one("SELECT COUNT(*) as this_no_sounds FROM Sounds WHERE ColID='{$ColID}' AND SoundStatus!='9'", $connection);
    if ($this_no_sounds > 0) {
        echo "<option value=\"{$ColID}\">{$CollectionName} - {$this_no_sounds} sound files</option>\n";
    }
    #else {
    #	echo "<option value=\"$ColID\">$CollectionName</option>\n";
    #	}
}
echo "</select> \n\t\t<input type=\"hidden\" name=\"op\" value=\"1\">\n\t\t<button type=\"submit\" class=\"btn btn-primary\"> Delete </button>\n\t</form>\n\t<hr noshade>";
?>

	<br><br>
<br><p><a href="#" onClick="window.close();">Cancel and close window</a>

</div>
Example #29
0
 echo "<div class=\"span-8 last\">";
 if (isset($site3)) {
     $query3 = "SELECT * from Sounds WHERE SiteID={$site3} AND Time LIKE '{$this_time}' AND Date='{$date}' AND SoundStatus!='9' ORDER BY Time LIMIT 1";
     $result3 = mysqli_query($connection, $query3) or die(mysqli_error($connection));
     $nrows3 = mysqli_num_rows($result3);
     if ($nrows3 == 1) {
         $row3 = mysqli_fetch_array($result3);
         extract($row3);
         #Check if there are images
         $query_img = "SELECT COUNT(*) FROM SoundsImages WHERE SoundID='{$SoundID}'";
         $sound_images = query_one($query_img, $connection);
         if ($sound_images != 6) {
             include "include/make_figs.php";
         }
         $query_img1 = "SELECT ImageFile FROM SoundsImages WHERE SoundID='{$SoundID}' AND ImageType='spectrogram-small'";
         $sound_images1 = query_one($query_img1, $connection);
         $sound_spectrogram = $sound_images1;
         echo "<a href=\"db_filedetails.php?SoundID={$SoundID}\">\n\t\t\t\t\t\t<img src=\"sounds/images/{$ColID}/{$DirID}/{$sound_spectrogram}\" width=\"300\" height=\"150\"><br>\n\t\t\t\t\t\t{$SoundName}</a><br>";
         if ($Date != "") {
             echo "Date: {$Date}";
         }
         if ($Time != "") {
             echo " {$Time}";
         }
         echo "</div>";
         flush();
     } else {
         echo "&nbsp;</div>";
     }
 } else {
     echo "&nbsp;</div>";
Example #30
0
$use_googleanalytics = FALSE;
if (isset($googleanalytics_ID)) {
    $use_googleanalytics = TRUE;
    $googleanalytics_code = "\n\n<script>\n\t\t(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){\n\t\t(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),\n\t\tm=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)\n\t\t})(window,document,'script','//www.google-analytics.com/analytics.js','ga');\n\n\t\tga('create', '{$googleanalytics_ID}', '{$app_host}');\n\t\tga('send', 'pageview');\n\n\t</script>\n\n";
}
#Check sox version
if ($special_noprocess == FALSE) {
    #$sox_version=query_one("SELECT Value from PumilioSettings WHERE Settings='sox_version'", $connection);
    $sox_version = DB::column('SELECT Value FROM `PumilioSettings` WHERE Settings = "sox_version"');
    # using only forward of version 14.3.2 (w: 5000 h: )
    if ($sox_version == "") {
        exec('sox --version', $soxout, $soxretval);
        $sox_version = explode("v", $soxout[0]);
        $sox_version = $sox_version[1];
        $soxver = explode(".", $sox_version);
        query_one("INSERT INTO PumilioSettings (Settings, Value) VALUES ('sox_version', '{$sox_version}')", $connection);
    }
    $soxver = explode(".", $sox_version);
    if ($soxver[0] > 14) {
        $sox_images = TRUE;
    } elseif ($soxver[0] = 14) {
        if ($soxver[1] > 3) {
            $sox_images = TRUE;
        } elseif ($soxver[1] < 3) {
            $sox_images = FALSE;
        } else {
            if ($soxver[2] >= 2) {
                $sox_images = TRUE;
            } else {
                $sox_images = FALSE;
            }