96 lines
3.5 KiB
PHP
96 lines
3.5 KiB
PHP
<!-- //>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> index.php -->
|
|
<!doctype html>
|
|
<html lang="en">
|
|
<head>
|
|
<meta charset="utf-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
<title>ESP32-CAM Captured Photo Gallery</title>
|
|
<meta charset="UTF-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
<title>Tentang - ESP Firebase App</title>
|
|
|
|
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.7.2/css/all.css" integrity="sha384-fnmOCqbTlWIlj8LyTjo7mOUStjsKC4pOpQbqyi7RrhN7udi9RwhKkMHpvLbHG9Sr" crossorigin="anonymous">
|
|
<link rel="stylesheet" type="text/css" href="style.css">
|
|
<link rel="stylesheet" href="css/bootstrap.min.css"/>
|
|
|
|
<script src="js/jquery-3.6.0.min.js"></script>
|
|
<script src="js/bootstrap.bundle.min.js"></script>
|
|
</head>
|
|
<body style="background-color:#202125;" id="myESP32CAMPhotos">
|
|
<!-- Navbar -->
|
|
<nav class="navbar navbar-expand-lg navbar-dark bg-dark">
|
|
<div class="container-fluid">
|
|
<a class="navbar-brand" href="#">ESP32-CAM App 1</a>
|
|
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarNavDropdown" aria-controls="navbarNavDropdown" aria-expanded="false" aria-label="Toggle navigation">
|
|
<span class="navbar-toggler-icon"></span>
|
|
</button>
|
|
<div class="collapse navbar-collapse" id="navbarNavDropdown">
|
|
<ul class="navbar-nav">
|
|
<li class="nav-item">
|
|
<a class="nav-link" href="admin.php">Home</a>
|
|
</li>
|
|
<li class="nav-item">
|
|
<a class="nav-link" href="about.php">About</a>
|
|
</li>
|
|
<li class="nav-item">
|
|
<a class="nav-link" href="index.html">Logout</a>
|
|
</li>
|
|
</ul>
|
|
</div>
|
|
</div>
|
|
</nav>
|
|
<script>
|
|
var totalphotos = 0;
|
|
var last_totalphotos = 0;
|
|
|
|
loadPhotos();
|
|
|
|
var timer_1 = setInterval(myTimer_1, 2000);
|
|
|
|
function myTimer_1() {
|
|
getTotalPhotos();
|
|
if(last_totalphotos != totalphotos) {
|
|
last_totalphotos = totalphotos;
|
|
|
|
loadPhotos();
|
|
}
|
|
}
|
|
|
|
function getTotalPhotos() {
|
|
if (window.XMLHttpRequest) {
|
|
// code for IE7+, Firefox, Chrome, Opera, Safari
|
|
xmlhttp = new XMLHttpRequest();
|
|
} else {
|
|
// code for IE6, IE5
|
|
xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
|
|
}
|
|
xmlhttp.onreadystatechange = function() {
|
|
if (this.readyState == 4 && this.status == 200) {
|
|
totalphotos = this.responseText;
|
|
}
|
|
};
|
|
xmlhttp.open("POST","CountImageFile.php",true);
|
|
xmlhttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
|
|
xmlhttp.send("cmd=GTP");
|
|
}
|
|
|
|
function loadPhotos() {
|
|
if (window.XMLHttpRequest) {
|
|
// code for IE7+, Firefox, Chrome, Opera, Safari
|
|
xmlhttp = new XMLHttpRequest();
|
|
} else {
|
|
// code for IE6, IE5
|
|
xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
|
|
}
|
|
xmlhttp.onreadystatechange = function() {
|
|
if (this.readyState == 4 && this.status == 200) {
|
|
document.getElementById("myESP32CAMPhotos").innerHTML = this.responseText;
|
|
}
|
|
};
|
|
xmlhttp.open("GET","loadPhotos.php",true);
|
|
xmlhttp.send();
|
|
}
|
|
</script>
|
|
</body>
|
|
</html>
|
|
<!-- //<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< -->
|