-
Notifications
You must be signed in to change notification settings - Fork 0
/
pictures.php
173 lines (153 loc) · 4.87 KB
/
pictures.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
<?php
//verificação se existe um usuário logado
session_start();
include("connection.php");
include("functions.php");
$user_data = check_login($con);
//acesso apenas ao privilégio user
if($user_data['privileges'] != "user"){
die("acess denied");
}
?>
<?php
//executar ficheiro python para tirar foto quando é clicado o botão
if (isset($_POST['take']))
{
/*para que funcione é preciso mudar a path do ficheiro para a path
onde está o ficheiro na maquina atual*/
exec('C:\UniServerZ\www\SmartHouse\python\capturaWebcamOpenCV.py');
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="refresh" content="58">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" integrity="sha384-B0vP5xmATw1+K9KRQjQERJvTumQW0nPEzvF6L/Z6nronJ3oUOFUFpCjEUQouq2+l" crossorigin="anonymous">
<link href="style.css" rel="stylesheet">
<link href='https://unpkg.com/[email protected]/css/boxicons.min.css' rel='stylesheet'>
<link rel="stylesheet" href="calendar.css">
<title>Smart House</title>
</head>
<body>
<!-- sidebar -->
<div class="sidebar">
<div class="logo_content">
<div class="logo">
<i class='bx bx-home-heart' ></i>
<div class="logo_name">Smart House</div>
</div>
<i class='bx bx-menu' id="btn" ></i>
</div>
<ul class="nav_list">
<li>
<a href="dashboard.php">
<i class='bx bx-grid-alt' ></i>
<span class="links_name">Dashboard</span>
</a>
<span class="tooltip">Dashboard</span>
</li>
<li>
<a href="smartobjects.php">
<i class='bx bx-coffee'></i>
<span class="links_name">Smart Objects</span>
</a>
<span class="tooltip">Smart Objects</span>
</li>
<li>
<a href="history.php">
<i class='bx bx-archive-in' ></i>
<span class="links_name">History</span>
</a>
<span class="tooltip">History</span>
</li>
<li>
<a href="analytics.php">
<i class='bx bx-pie-chart-alt-2' ></i>
<span class="links_name">Analytics</span>
</a>
<span class="tooltip">Analytics</span>
</li>
<li>
<a href="pictures.php">
<i class='bx bx-photo-album'></i>
<span class="links_name">Pictures</span>
</a>
<span class="tooltip">Pictures</span>
</li>
</ul>
<div class="logout">
<div>
<a href="logout.php">
<i class='bx bx-log-out' id="log_out" ></i>
</a>
<span class="tooltip">Logout</span>
</div>
</div>
</div>
<!-- fim da sidebar -->
<!-- ########## conteudo da pagina ######## -->
<div class="home_content">
<!-- header da pagina -->
<div class="row">
<div class="col-sm-12">
<video autoplay loop>
<source src="imgs/header.mp4" type="video/mp4">
</video>
</div>
</div>
<!-- fim do header da pagina -->
<br><br>
<!--### apresentacao da ultima foto tirada ##-->
<div class="container">
<div class="row">
<div class="col-sm-7">
<div class="card text-center cardcolor">
<div class="card-header">Last Picture</div>
<div class="card-body"><img src="imgs/webcam.jpg" alt="web image" width="350px">
<br><b>
<?php
//mostrar as informacoes da foto
$filename = 'imgs/webcam.jpg';
if (file_exists($filename)) {
echo "<a> Was last modified: </a>" . date ("F d Y H:i:s.", filemtime($filename));
}
?>
</b>
</div>
</div>
</div>
<!-- aqui é o botão que tira foto -->
<div class="col-sm-5">
<div class="card text-center" style="background-color: inherit">
<div class="card-body">
<br><br><br><br><br><br>
<form method="post">
<button type="submit" name="take" class="btn btn-outline-info btn-lg"><i class='bx bxs-camera'></i></button>
</form>
</div>
</div>
</div>
</div>
<br><br>
</div>
</div>
<!-- ####### SCRIPTS ###### -->
<script>
let btn = document.querySelector("#btn");
let sidebar = document.querySelector(".sidebar");
btn.onclick = function() {
sidebar.classList.toggle("active");
if(btn.classList.contains("bx-menu")){
btn.classList.replace("bx-menu" , "bx-menu-alt-right");
}else{
btn.classList.replace("bx-menu-alt-right", "bx-menu");
}
}
</script>
<script src="calendar.js"></script>
<script src="https://code.jquery.com/jquery-3.5.1.slim.min.js" integrity="sha384-DfXdz2htPH0lsSSs5nCTpuj/zy4C+OGpamoFVy38MVBnE+IbbVYUew+OrCXaRkfj" crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js" integrity="sha384-Piv4xVNRyMGpqkS2by6br4gNJ7DXjqk09RmUpJ8jgGtD7zP9yug3goQfGII0yAns" crossorigin="anonymous"></script>
</body>
</html>