diff --git a/public/storage/records/PaRecAR628069_20200526_040726.wav b/public/storage/records/PaRecAR628069_20200526_040726.wav new file mode 100644 index 0000000..ce6715a Binary files /dev/null and b/public/storage/records/PaRecAR628069_20200526_040726.wav differ diff --git a/public/styles/style.css b/public/styles/style.css index d779de5..75af274 100644 --- a/public/styles/style.css +++ b/public/styles/style.css @@ -235,4 +235,8 @@ div.coordinates { div.coordinates input[type="text"] { width: 25em; +} + +.sci-name { + font-style: italic; } \ No newline at end of file diff --git a/public/test-file-upload.php b/public/test-file-upload.php new file mode 100644 index 0000000..e69de29 diff --git a/public/test/file.php b/public/test/file.php new file mode 100644 index 0000000..cce4cbd --- /dev/null +++ b/public/test/file.php @@ -0,0 +1,13 @@ + + + + + +
+ Select image to upload: + + +
+ + + diff --git a/public/test/upload.php b/public/test/upload.php new file mode 100644 index 0000000..a263c35 --- /dev/null +++ b/public/test/upload.php @@ -0,0 +1,33 @@ + diff --git a/public/upload/index.php b/public/upload/index.php index be3b8b1..4c25eae 100644 --- a/public/upload/index.php +++ b/public/upload/index.php @@ -3,6 +3,9 @@ ini_set('display_errors', 1); ini_set('display_startup_errors', 1); error_reporting(E_ALL); session_start(); +if (! isset($_SESSION['error_msg'])) { + $_SESSION['error_msg'] = ""; +} $root = realpath($_SERVER["DOCUMENT_ROOT"]); ?> diff --git a/public/upload/metadata.php b/public/upload/metadata.php index 3fe4d0a..6090d09 100644 --- a/public/upload/metadata.php +++ b/public/upload/metadata.php @@ -10,12 +10,12 @@

-
+ " placeholder="Enter a species..">

-
+ " placeholder="Enter a subspecies name">
-
+ " placeholder="Enter your name.." required>
diff --git a/public/upload/scripts/checkmap.js b/public/upload/scripts/checkmap.js new file mode 100644 index 0000000..6e05d7c --- /dev/null +++ b/public/upload/scripts/checkmap.js @@ -0,0 +1,18 @@ + + +if (typeof coordinates !== 'undefined') { + lat = coordinates.split(",")[0]; + lng = coordinates.split(",")[1]; + let latlng = L.LatLng(lat, lng); + let marker = L.marker(latlng, draggable=false).addTo(mycheckmap); + let mycheckmap = L.map('checkmap').setLatLng(latlng); + + L.tileLayer('https://api.mapbox.com/styles/v1/{id}/tiles/{z}/{x}/{y}?access_token={accessToken}', { + attribution: 'Map data © OpenStreetMap contributors, Imagery © Mapbox', + maxZoom: 18, + id: 'mapbox/streets-v11', + tileSize: 512, + zoomOffset: -1, + accessToken: 'pk.eyJ1IjoidW5jbGVzYW11bHVzIiwiYSI6ImNrbXQwNDl5MTBtc2gybm82b3c0M3VoNncifQ.qUqAuCuMDF38NcyrAC1RJQ' + }).addTo(mycheckmap); +} diff --git a/public/upload/scripts/map.js b/public/upload/scripts/map.js index 22a5b39..5fe74db 100644 --- a/public/upload/scripts/map.js +++ b/public/upload/scripts/map.js @@ -26,3 +26,4 @@ function onMapClick(e) { } mymap.on('click', onMapClick); + diff --git a/public/upload/submitmetadata.php b/public/upload/submitmetadata.php index 691025d..949364d 100644 --- a/public/upload/submitmetadata.php +++ b/public/upload/submitmetadata.php @@ -4,12 +4,13 @@ ini_set('display_errors', 1); ini_set('display_startup_errors', 1); error_reporting(E_ALL); $root = realpath($_SERVER["DOCUMENT_ROOT"]); -$target_dir = root."/storage/records"; +$target_dir = $root."/storage/records/"; $fileName = $_FILES['file']['name']; $target_file = $target_dir.basename($_FILES['file']['name']); $uploadOk = 1; $fileSize = $_FILES['file']['size']; -$fileExtension = strtolower(end(explode('.', $fileName))); +$temp = explode('.', $fileName); +$fileExtension = strtolower(end($temp)); $_SESSION['error_msg'] = "Form not submitted.\n"; if (isset($_POST['submit'])) @@ -20,7 +21,7 @@ if (isset($_POST['submit'])) { $_SESSION['error_msg'] .= "This file extension is not allowed; please upload a WAV file.\n"; } - if ($fileSize > 10000000) + if ($fileSize > 10*1024*1024) { $_SESSION['error_msg'] .= "The file size must be below 10MB. \n"; } @@ -37,6 +38,7 @@ if (isset($_POST['submit'])) if (isset($_POST['species'])) { $_SESSION['observation']['species'] = $_POST['species']; + setcookie('species', $_SESSION['observation']['species'], time() + 86400 * 365.2, "/"); } else { $_SESSION['error_msg'].= "Error, incorrect species name.\n"; @@ -44,6 +46,7 @@ if (isset($_POST['submit'])) if (isset($_POST['subspecies'])) { $_SESSION['observation']['subspecies'] = $_POST['subspecies']; + setcookie('subspecies', $_SESSION['observation']['subspecies'], time() + 86400 * 365.2, "/"); } else { $_SESSION['observation']['subspecies'] = ""; @@ -51,6 +54,7 @@ if (isset($_POST['submit'])) if (isset($_POST['recording-license'])) { $_SESSION['observation']['license'] = $_POST['recording-license']; + setcookie('license', $_SESSION['observation']['license'], time() + 86400 * 365.2, "/"); } else { $_SESSION['error_msg'] .= "Incorrect license\n"; @@ -58,6 +62,7 @@ if (isset($_POST['submit'])) if (isset($_POST['name'])) { $_SESSION['observation']['name'] = $_POST['name']; + setcookie('name', $_SESSION['observation']['name'], time() + 86400 * 365.2, "/"); } else { $_SESSION['error_msg'] .= "Incorrect Recordist Name.\n"; } diff --git a/public/upload/verify.php b/public/upload/verify.php index c3741ab..a0a1f56 100644 --- a/public/upload/verify.php +++ b/public/upload/verify.php @@ -47,7 +47,7 @@ Quality - + Remarks @@ -56,3 +56,20 @@

Location

+
+ + + + + + +
+ +
+ +
+