Commit 268b5631 authored by Kylian ou Nathan's avatar Kylian ou Nathan
Browse files

Up

parent 75cdc90f
......@@ -23,7 +23,7 @@ defined('BASEPATH') or exit('No direct script access allowed');
| a PHP script and you can easily do that on your own.
|
*/
$config['base_url'] = 'http://lockhome.nrocher.fr/';
$config['base_url'] = 'https://lockhome.nrocher.fr/';
/*
|--------------------------------------------------------------------------
......
......@@ -3,11 +3,20 @@ class Resume extends CI_Controller{
public function __construct(){
parent::__construct();
$this->load->model("ResumeModele");
$this->load->helper("url_helper");
}
public function show(){
$this->load->view('resume/show');
public function show($actions){
foreach($actions as $action){
array_push($data, $this->ResumeModele->getByAction($action));
}
$this->load->view('resume/show', $data);
}
}
......
......@@ -8,11 +8,10 @@ class CameraModele extends CI_Model
$this->load->database();
}
// METHODE PERMETTANT DE RECUPERER TOUTE LES CAMERAS
// METHODE PERMETTANT DE RECUPERER TOUTES LES CAMERAS
public function getAll()
{
$sql = "SELECT * from Camera";
$query = $this->db->query($sql);
if ($query->num_rows() == 0) {
......
<?php
class LogCapteurModele extends CI_Model
{
public function __construct()
{
$this->load->database();
}
// METHODE PERMETTANT DE RECUPERER TOUT LES LOGS D'UNE JOURNEE
public function getAllDay($date = "today")
{
$date == "today" ? date("Y-m-d H:i:s") : $date;
$sql = "SELECT * from LogCapteur WHERE `date` BETWEEN '" . date("Y-m-d"). " 00:00:01' AND '" . date("Y-m-d"). " 23:59:59'";
$query = $this->db->query($sql);
if ($query->num_rows() == 0) {
return false;
} else {
return $query->result();
}
}
// METHODE PERMETTANT DE RECUPERER TOUT LES LOGS D'UNE JOURNEE
public function getForDay($date = "today", $idCapteur)
{
$date == "today" ? date("Y-m-d H:i:s") : $date;
$sql = "SELECT * from LogCapteur WHERE `idCapteur` = '" . $idCapteur . "' `date` BETWEEN '" . date("Y-m-d"). " 00:00:01' AND '" . date("Y-m-d"). " 23:59:59'";
$query = $this->db->query($sql);
if ($query->num_rows() == 0) {
return false;
} else {
return $query->result();
}
}
// METHODE PERMETTANT D'EDITER UNE CAMERA
public function edit($id, $nom, $ip)
{
$data = array();
$data["nom"] = $nom;
$data["ip"] = $ip;
if ($id == "new") {
$this->db->insert('Camera', $data);
} else {
$this->db->update('Camera', $data, array("id" => $id));
}
if ($this->db->affected_rows() > 0) {
return true;
} else {
return false;
}
}
// METHODE PERMETTANT DE SUPPRIMER UNE CAMERA
public function delete($id)
{
$this->db->delete('Camera', array("id" => $id));
if ($this->db->affected_rows() > 0) {
return true;
} else {
return false;
}
}
}
<?php
class ResumeModele extends CI_Model
{
public function __construct()
{
$this->load->database();
}
// METHODE PERMETTANT DE RECUPERER TOUT LES LOGS D'UNE JOURNEE
public function getAllDay($date = "today")
{
$date == "today" ? date("Y-m-d H:i:s") : $date;
$sql = "SELECT * from LogCapteur WHERE `date` BETWEEN '" . date("Y-m-d"). " 00:00:01' AND '" . date("Y-m-d"). " 23:59:59'";
$query = $this->db->query($sql);
if ($query->num_rows() == 0) {
return false;
} else {
return $query->result();
}
}
// METHODE PERMETTANT DE RECUPERER TOUT LES LOGS D'UNE JOURNEE
public function getForDay($date = "today", $idCapteur)
{
$date == "today" ? date("Y-m-d H:i:s") : $date;
$sql = "SELECT * from LogCapteur WHERE `idCapteur` = '" . $idCapteur . "' `date` BETWEEN '" . date("Y-m-d"). " 00:00:01' AND '" . date("Y-m-d"). " 23:59:59'";
$query = $this->db->query($sql);
if ($query->num_rows() == 0) {
return false;
} else {
return $query->result();
}
}
public function getByAction($action)
{
$sql = "SELECT * FROM LogCapteur WHERE Action = ?";
$query = $this->db->query($sql, array($action));
if($query->num_rows() == 0){
return false;
} else {
return $query->result();
}
}
}
......@@ -27,29 +27,34 @@
</div>
</header>
<main>
<h6 class="big">En temps réel</h6>
<img src="<?=base_url("/static/ressources/garden.jpg")?>" />
<h6 class="big">En temps réel</h6>
<img src="<?=base_url("/static/ressources/garden.jpg")?>" />
<h6 class="big">Vidéos</h6>
<?=var_dump($ee)?>
<!-- var_dump($ee)
JE LAI ENLEVE POUR FAIRE LE DESIGN
-->
<table>
<thead>
<td>Filmé le</td>
<td>Durée</td>
<td>Action</td>
<td class="columnUn">Filmé le</td>
<td class="columnDeux">Durée</td>
<td class="columnTrois">Action</td>
</thead>
<tr>
<td>16/12/2019 à 23h00</td>
<td>15 min</td>
<td><i class='uil uil-play'></i></td>
</tr>
<tr>
<td>16/12/2019 à 19h00</td>
<td>5 min</td>
<td><i class='uil uil-play'></i></td>
</tr>
<tbody>
<tr>
<td class="columnUn">16/12/2019 à 23h00</td>
<td class="columnDeux">15 min</td>
<td class="columnTrois"><i class='uil uil-play'></i></td>
</tr>
<tr>
<td class="columnUn">16/12/2019 à 19h00</td>
<td class="columnDeux">5 min</td>
<td class="columnTrois"><i class='uil uil-play'></i></td>
</tr>
</tbody>
</table>
</main>
</body>
......
......@@ -7,6 +7,7 @@
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Liste des capteurs - LockHome</title>
<link rel="stylesheet" href="../static/resume.css">
<link rel="stylesheet" href="../static/commun.css">
<link href="https://fonts.googleapis.com/css?family=Roboto:400,500,700&display=swap" rel="stylesheet">
<link rel="stylesheet" href="https://unicons.iconscout.com/release/v2.0.1/css/unicons.css">
</head>
......@@ -22,61 +23,61 @@
</header>
<main>
<div class="filtre">
<div class="first_div">
<div class="container">
<div class="subtitle_container subcontainer">
<i class='uil uil-file'></i>
<div class="subtitle">Filtres</div>
</div>
<div class="part">
<div class="action_container subcontainer">
<div>
<h3>Action</h3>
</div>
<div class="choice">
<input type="checkbox" name="choix1" id="ac1" checked>
<label for="ac1">Activation capteur</label>
<input type="checkbox" name="choix2" id="ac2" checked>
<label for="ac2">Désactivation capteur</label>
<input type="checkbox" name="choix3" id="ac3" checked>
<label for="ac3">Probleme capteur</label>
</div>
<form method="post">
<input class="checkbox_input" type="checkbox" name="choix1" id="ac1" checked>
<label class="input_label" for="ac1">Activation capteur</label>
<input class="checkbox_input" type="checkbox" name="choix2" id="ac2" checked>
<label class="input_label" for="ac2">Désactivation capteur</label>
<input class="checkbox_input" type="checkbox" name="choix3" id="ac3" checked>
<label class="input_label" for="ac3">Probleme capteur</label>
</form>
</div>
<div class="part">
<div class="anciennte_container subcontainer">
<div>
<h3>Ancienneté</h3>
</div>
<form>
<div class="choice">
<input type="radio" name="time" id="an1">
<label for="an1">Jour</label>
<input type="radio" name="time" id="an2">
<label for="an2">Semaine</label>
<input type="radio" name="time" id="an3">
<label for="an3">Mois</label>
<input type="radio" name="time" id="an4">
<label for="an4">Tout</label>
</div>
<form method="post">
<input class="radio_input" type="radio" name="time" id="an1">
<label class="input_label" for="an1">Jour</label>
<input class="radio_input" type="radio" name="time" id="an2">
<label class="input_label" for="an2">Semaine</label>
<input class="radio_input" type="radio" name="time" id="an3">
<label class="input_label" for="an3">Mois</label>
<input class="radio_input" type="radio" name="time" id="an4">
<label class="input_label" for="an4">Tout</label>
</form>
</div>
<div class="part">
<div class="confirmer_container subcontainer">
<input type="submit" value="Confirmer" id="bouton">
</div>
</div>
<div class="log">
<div class="first_div">
<div class="container">
<div class="subtitle_container subcontainer">
<i class='uil uil-file'></i>
<div class="subtitle">Logs</div>
</div>
<div class="part">
<p>-> activation 07/11/2019 - 10h21: capteur porte</p>
</div>
<div>
<p>-> désactivation 07/11/2019 - 10h20: capteur porte</p>
<div class="log_container subcontainer">
<div>
<p>-> activation 07/11/2019 - 10h21: capteur porte</p>
</div>
<div>
<p>-> désactivation 07/11/2019 - 10h20: capteur porte</p>
</div>
<div>
<p>-> désactivation 02/11/2019 - 17h47: capteur de mouvement</p>
</div>
</div>
<div>
<p>-> désactivation 02/11/2019 - 17h47: capteur de mouvement</p>
</div>
</div>
</main>
</body>
......
......@@ -64,4 +64,44 @@ main h6.big {
label.input:hover {
box-shadow: 0px 0px 5px rgba(0, 0, 0, 0.2);
}
/*TABLEAU*/
main table {
border-collapse: collapse;
background: #fff;
border-radius: 10px;
overflow: hidden;
text-align: center;
}
table thead td {
height: 40px;
background: #4C84FF;
}
thead th {
font-size: 18px;
color: white;
}
tbody tr {
color: gray;
font-size: 15px;
height: 50px;
}
.columnUn {
width: 200px;
}
.columnDeux,
.columnTrois {
width: 100px;
}
tbody tr:nth-child(even) {
background-color: #e8e8e8;
}
\ No newline at end of file
/*
POUR L'UTILISATION DE CE FICHIER CSS
PENSER A L'INCLURE DANS L'ENTETE DU
FICHIER HTML.
ENSUITE IL SUFFIT D'UTILISER LES BONS
SELECTEURS AINSI QUE LES BONS PATTERN
ET CONTENEUR.
*/
/**************************************************************************
##### EXEMPLE CONTENT OF BUTTON #####
Permet de disposer les éléments à gauche et à droite
......@@ -24,15 +34,15 @@ Permet de disposer les éléments à gauche et à droite
align-items: center;
}
.l_r .right{
.l_r .right {
justify-content: flex-end;
}
.l_r .left > * {
.l_r .left>* {
margin-left: 15px;
}
.l_r .right > * {
.l_r .right>* {
margin-right: 15px;
}
......@@ -42,9 +52,10 @@ Permet de disposer les éléments à gauche et à droite
background: none;
border: 0;
outline: none;
cursor:pointer;
cursor: pointer;
}
/**************************************************************************
##### EXEMPLE SIMPLE LAYOUT #####
Permet de faire un bloc sans lien
......@@ -59,18 +70,20 @@ Permet de faire un bloc sans lien
</section>
*/
section.simple_layout{
width: 90%;
text-decoration: none;
font-weight: 400;
color: white;
background: #27AE60;/*La couleur du layout*/
border-radius: 5px;
box-shadow: 0px 0px 2px rgba(0, 0, 0, 0.15);
display: flex;
flex-shrink: 0;
section.simple_layout {
width: 90%;
text-decoration: none;
font-weight: 400;
color: white;
background: #27AE60;
/*La couleur du layout*/
border-radius: 5px;
box-shadow: 0px 0px 2px rgba(0, 0, 0, 0.15);
display: flex;
flex-shrink: 0;
}
/**************************************************************************
##### EXEMPLE SIMPLE LINK BUTTON #####
Permet de faire le cadre du bouton
......@@ -86,21 +99,21 @@ Permet de faire le cadre du bouton
</a>
*/
a.simple_button_link{
height: 50px;
width: 90%;
text-decoration: none;
font-weight: 400;
color: black;
background: white;
border-radius: 5px;
box-shadow: 0px 0px 2px rgba(0, 0, 0, 0.15);
margin-bottom: 15px;
transition: box-shadow .3s, background .3s, color .3s;
flex-shrink: 0;
}
a.simple_button_link:hover{
a.simple_button_link {
height: 50px;
width: 90%;
text-decoration: none;
font-weight: 400;
color: black;
background: white;
border-radius: 5px;
box-shadow: 0px 0px 2px rgba(0, 0, 0, 0.15);
margin-bottom: 15px;
transition: box-shadow .3s, background .3s, color .3s;
flex-shrink: 0;
}
a.simple_button_link:hover {
box-shadow: 0px 0px 5px rgba(0, 0, 0, 0.2);
}
......@@ -123,27 +136,27 @@ Permet de faire le cadre du bouton
</a>
*/
a.image_button_link{
margin-bottom: 15px;
height: auto;
width: 90%;
text-decoration: none;
background: #FFFFFF;
border-radius: 5px;
box-shadow: 0px 0px 2px rgba(0, 0, 0, 0.15);
color: #000;
}
a.image_button_link {
margin-bottom: 15px;
height: auto;
width: 90%;
text-decoration: none;
background: #FFFFFF;
border-radius: 5px;
box-shadow: 0px 0px 2px rgba(0, 0, 0, 0.15);
color: #000;
}
a.image_button_link:hover{
box-shadow: 0px 0px 5px rgba(0, 0, 0, 0.2);
a.image_button_link:hover {
box-shadow: 0px 0px 5px rgba(0, 0, 0, 0.2);
}
a.image_button_link img{
border-top-left-radius: 5px;
border-top-right-radius: 5px;
width: 100%;
height: 200px;
object-fit: cover;
a.image_button_link img {
border-top-left-radius: 5px;
border-top-right-radius: 5px;
width: 100%;
height: 200px;
object-fit: cover;
}
......@@ -158,6 +171,7 @@ Permet de faire le cadre des inputs
</div>
</label>
*/
main label.input {
flex-shrink: 0;
height: 50px;
......@@ -179,12 +193,13 @@ main label .left {
}
main label.input input {
flex:1;
flex: 1;
padding: 0;
border: 0;
outline: none;
}
/***************************************************************************
##### EXEMPLE POSITIONNER UN BOUTON EN BAS #####
<a href="liste_capteur.html" class="simple_button_link l_r red bottom">
......@@ -224,7 +239,7 @@ input[type="checkbox"] {
display: none;
}
input[type="checkbox"] + .switch {
input[type="checkbox"]+.switch {
width: 50px;
position: relative;
height: 24px;
......@@ -270,6 +285,46 @@ input[type="checkbox"]:checked+.switch:before {
}
/***************************************************************************
##### EXEMPLE LABEL #####
Mise en forme de label pour les inputs
<form>
<input class="checkbox_input" type="checkbox" name="choix1" id="ac1" checked>
<label class="input_label" for="ac1">Activation capteur</label>
<input class="checkbox_input" type="checkbox" name="choix2" id="ac2" checked>
<label class="input_label" for="ac2">Désactivation capteur</label>
</form>
<form>
<input class="radio_input" type="radio" name="time" id="an1">
<label class="input_label" for="an1">Jour</label>
<input class="radio_input" type="radio" name="time" id="an2">
<label class="input_label" for="an2">Semaine</label>
</form>
*/
input[type="checkbox"].checkbox_input,
input[type="radio"].radio_input {
display: none;
}
input[type="checkbox"].checkbox_input:checked+label,
input[type="radio"].radio_input:checked+label {
background: #4C84FF;
color: white;
border-color: #4C84FF;
}
.input_label {
display: inline-block;
margin: 5px 5px 5px 0px;
border: 1px solid grey;
padding: 3px 10px;
border-radius: 8px;
}
/***************************************************************************
##### EXEMPLE COULEUR #####
Ajout des couleurs (utilisé pour nimporte quel composant)
......@@ -305,6 +360,7 @@ main .green,
color: #27AE60;
}
/***************************************************************************
##### EXEMPLE INDICATEUR DE COULEUR #####
Mise en forme des petits indicateurs rond vert et rouge
......@@ -327,8 +383,7 @@ main .indicateur {
border-radius: 100%;
}
main > form {
main>form {