play.php: cleanup html

This commit is contained in:
frederik
2024-04-06 19:24:50 +02:00
parent bce2f60d9c
commit e5a7294381
+16 -25
View File
@@ -148,16 +148,17 @@ if(isset($_GET['bydate'])){
unset($_SESSION['date']); unset($_SESSION['date']);
$view = "choose"; $view = "choose";
} }
?>
<html> if (get_included_files()[0] === __FILE__) {
echo '<!DOCTYPE html>
<html lang="en">
<head> <head>
<meta charset="UTF-8"> <meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1"> <meta name="viewport" content="width=device-width, initial-scale=1">
<style> </head>';
</style> }
</head>
?>
<script> <script>
function deleteDetection(filename,copylink=false) { function deleteDetection(filename,copylink=false) {
if (confirm("Are you sure you want to delete this detection from the database?") == true) { if (confirm("Are you sure you want to delete this detection from the database?") == true) {
@@ -259,7 +260,7 @@ if(!isset($_GET['species']) && !isset($_GET['filename'])){
<?php if($view == "byspecies" || $view == "date") { ?> <?php if($view == "byspecies" || $view == "date") { ?>
<div style="width: auto; <div style="width: auto;
text-align: center"> text-align: center">
<form action="" method="GET"> <form action="views.php" method="GET">
<input type="hidden" name="view" value="Recordings"> <input type="hidden" name="view" value="Recordings">
<input type="hidden" name="<?php echo $view; ?>" value="<?php echo $_GET['date']; ?>"> <input type="hidden" name="<?php echo $view; ?>" value="<?php echo $_GET['date']; ?>">
<button <?php if(!isset($_GET['sort']) || $_GET['sort'] == "alphabetical"){ echo "style='background:#9fe29b !important;'"; }?> class="sortbutton" type="submit" name="sort" value="alphabetical"> <button <?php if(!isset($_GET['sort']) || $_GET['sort'] == "alphabetical"){ echo "style='background:#9fe29b !important;'"; }?> class="sortbutton" type="submit" name="sort" value="alphabetical">
@@ -270,12 +271,11 @@ if(!isset($_GET['species']) && !isset($_GET['filename'])){
</button> </button>
</form> </form>
</div> </div>
<br>
<?php } ?> <?php } ?>
<form action="views.php" method="GET">
<input type="hidden" name="view" value="Recordings">
<table> <table>
<tr>
<form action="" method="GET">
<input type="hidden" name="view" value="Recordings">
<?php <?php
#By Date #By Date
if($view == "bydate") { if($view == "bydate") {
@@ -364,16 +364,14 @@ for ($row = 0; $row < $num_rows; $row++) {
<tr><td><button action=\"submit\" name=\"bydate\" value=\"bydate\">By Date</button></td>"; <tr><td><button action=\"submit\" name=\"bydate\" value=\"bydate\">By Date</button></td>";
} }
echo "</form> echo "</table></form>";
</tr>
</table>";
} }
#Specific Species #Specific Species
if(isset($_GET['species'])){ ?> if(isset($_GET['species'])){ ?>
<div style="width: auto; <div style="width: auto;
text-align: center"> text-align: center">
<form action="" method="GET"> <form action="views.php" method="GET">
<input type="hidden" name="view" value="Recordings"> <input type="hidden" name="view" value="Recordings">
<input type="hidden" name="species" value="<?php echo $_GET['species']; ?>"> <input type="hidden" name="species" value="<?php echo $_GET['species']; ?>">
<input type="hidden" name="sort" value="<?php echo $_GET['sort']; ?>"> <input type="hidden" name="sort" value="<?php echo $_GET['sort']; ?>">
@@ -563,15 +561,8 @@ echo "<table>
</tr>"; </tr>";
} }
}echo "</table>";}?> }echo "</table>";}
</div> echo "</div>";
<style> if (get_included_files()[0] === __FILE__) {
td.spec { echo '</html>';
width: calc(100% / <?php echo $num_cols;?>);
} }
tr:first-child td.spec {
padding-top: 10px;
}
</style>
</html>