added total species count to sidebar overview

This commit is contained in:
mcguirepr89
2022-03-18 09:15:57 -04:00
parent 8cbad43545
commit 4d57b211e5
+14
View File
@@ -55,6 +55,14 @@ if($statement5 == False) {
} }
$result5 = $statement5->execute(); $result5 = $statement5->execute();
$speciestally = $result5->fetchArray(SQLITE3_ASSOC); $speciestally = $result5->fetchArray(SQLITE3_ASSOC);
$statement6 = $db->prepare('SELECT COUNT(DISTINCT(Com_Name)) FROM detections');
if($statement6 == False) {
echo "Database is busy";
header("refresh: 0;");
}
$result6 = $statement6->execute();
$totalspeciestally = $result6->fetchArray(SQLITE3_ASSOC);
?> ?>
<head> <head>
<meta charset="UTF-8"> <meta charset="UTF-8">
@@ -85,6 +93,12 @@ $speciestally = $result5->fetchArray(SQLITE3_ASSOC);
<td><button type="submit" name="view" value="Species Stats"><?php echo $speciestally['COUNT(DISTINCT(Com_Name))'];?></button></td> <td><button type="submit" name="view" value="Species Stats"><?php echo $speciestally['COUNT(DISTINCT(Com_Name))'];?></button></td>
</form> </form>
</tr> </tr>
<tr>
<th>Total Number of Species</th>
<form action="" method="POST">
<td><button type="submit" name="view" value="Species Stats"><?php echo $totalspeciestally['COUNT(DISTINCT(Com_Name))'];?></button></td>
</form>
</tr>
</table> </table>
</td></tr></table> </td></tr></table>
</div> </div>