Commit 1f03acfd authored by Cedrick Copol's avatar Cedrick Copol

entete

parent 076c014f
Pipeline #244 failed with stage
in 1 second
......@@ -14,6 +14,7 @@
<!-- Custom styles for this template -->
<link href="dashboard.css" rel="stylesheet">
<link href="theme.css" rel="stylesheet">
<!-- Bootstrap javascript plugin-->
<script src="/assets/js/jquery-3.2.1.slim.min.js" ></script>
......@@ -32,7 +33,7 @@
if(xhr.readyState==4)
{
if(xhr.status==200)
{
{
// la connexion c'est bien passé
var racine = JSON.parse(xhr.responseText);
$('#personnerow').show();
......@@ -46,12 +47,12 @@
}
else{
for (var i =0; i < racine.resultat.length; i++){
$('#personnerow').append(
'<tr><td>'+racine.resultat[i].id+'</td><td>'+racine.resultat[i].nom+'</td><td>'+racine.resultat[i].prenom+'</td><td>'+racine.resultat[i].lieu+'</td><td>'+'</td></tr>'
); // fin append
}
}
}
$('#personnerow').append(
'<tr><td>'+racine.resultat[i].id+'</td><td>'+racine.resultat[i].nom+'</td><td>'+racine.resultat[i].prenom+'</td><td>'+racine.resultat[i].lieu+'</td><td>'+'</td></tr>'
); // fin append
} // for
} // if
} // if(xhr.status==200)
}
}
......@@ -60,6 +61,33 @@
xhr.send("action=print");
return false;
}
var myVar = setInterval(function(){getnbusers()}, 1000);
function getnbusers()
{
var xhr=new XMLHttpRequest(); // creation de l'objet
xhr.open('POST','test.php', true);
xhr.setRequestHeader('Content-Type','application/x-www-form-urlencoded');
xhr.onreadystatechange=function()
{
if(xhr.readyState==4)
{
if(xhr.status==200)
{
// la connexion c'est bien passé
var racine = JSON.parse(xhr.responseText);
document.getElementById("nbusersThisBox").innerHTML=racine.resultat;
} // if(xhr.status==200)
}
}
// envoie des donnees au serveur
//xhr.send("request="+encodeURIComponent(document.getElementById("searchid").value));
xhr.send("action=nbusersThisBox");
return false;
}
</script>
......@@ -158,6 +186,39 @@
</nav>
<main role="main" class="col-md-9 ml-sm-auto col-lg-10 pt-3 px-4">
<div class="row tile_count">
<div class="col-md-6 col-sm-4 col-xs-6 tile_stats_count">
<span class="count_top"><i class="fa fa-user"></i> Total inscrits sur cette SafetyBox</span>
<div class="count green" id="nbusersThisBox"></div>
<span class="count_bottom"><i class="green">4% </i> 2h</span>
</div>
<div class="col-md-6 col-sm-4 col-xs-6 tile_stats_count">
<span class="count_top"><i class="fa fa-clock-o"></i> Total inscrits sur toutes les SafetyBox <strong class="green">synchronisées</strong></span>
<div class="count" id="nbusersAllBox">500</div>
<span class="count_bottom"><i class="green"><i class="fa fa-sort-asc"></i>3% </i> depuis 2 min</span>
</div>
<!-- <div class="col-md-2 col-sm-4 col-xs-6 tile_stats_count">
<span class="count_top"><i class="fa fa-user"></i> Total Males</span>
<div class="count green">2,500</div>
<span class="count_bottom"><i class="green"><i class="fa fa-sort-asc"></i>34% </i> From last Week</span>
</div>
<div class="col-md-2 col-sm-4 col-xs-6 tile_stats_count">
<span class="count_top"><i class="fa fa-user"></i> Total Females</span>
<div class="count">4,567</div>
<span class="count_bottom"><i class="red"><i class="fa fa-sort-desc"></i>12% </i> From last Week</span>
</div>
<div class="col-md-2 col-sm-4 col-xs-6 tile_stats_count">
<span class="count_top"><i class="fa fa-user"></i> Total Collections</span>
<div class="count">2,315</div>
<span class="count_bottom"><i class="green"><i class="fa fa-sort-asc"></i>34% </i> From last Week</span>
</div>
<div class="col-md-2 col-sm-4 col-xs-6 tile_stats_count">
<span class="count_top"><i class="fa fa-user"></i> Total Connections</span>
<div class="count">7,325</div>
<span class="count_bottom"><i class="green"><i class="fa fa-sort-asc"></i>34% </i> From last Week</span>
</div> -->
</div>
<!-- <div class="d-flex justify-content-between flex-wrap flex-md-nowrap align-items-center pb-2 mb-3 border-bottom">
<h1 class="h2">Dashboard</h1>
<div class="btn-toolbar mb-2 mb-md-0">
......
......@@ -25,6 +25,10 @@ if ( isset($_POST['action']))
{
getEveryBodyrow($conn);
}
elseif ($_POST['action'] == "nbusersThisBox")
{
getNumPersonne($conn);
}
}
......@@ -40,7 +44,15 @@ function getEveryBodyrow($conn) {
echo $json;
}
function getNumPersonne($conn) {
$sql = 'SELECT id FROM personne';
if ($result = $conn->query($sql) ) {
$json = '{"resultat": "'.$result->num_rows.'"}'; // nombre de lignes
echo $json;
// printf("Result set has ".$result->num_rows);
}
}
// Close the database
$conn->close();
......
.tile_count {
margin-bottom: 20px;
margin-top: 20px;
color: #73879C;
font-family: "Helvetica Neue",Roboto,Arial,"Droid Sans",sans-serif;
font-size: 13px;
font-weight: 400;
line-height: 1.471;
margin-right: -10px;
margin-left: -10px;
}
.tile_count::after, .tile_count::before {
box-sizing: border-box;
}
.tile_count .tile_stats_count {
border-bottom: 1px solid #D9DEE4;
padding: 0 10px 0 20px;
position: relative;
}
.tile_count .tile_stats_count, ul.quick-list li {
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.tile_count .tile_stats_count span {
font-size: 12px;
}
.tile_count .tile_stats_count .count {
font-size: 30px;
line-height: 47px;
font-weight: 600;
}
.tile_count .tile_stats_count span {
font-size: 12px;
}
.tile_count .tile_stats_count, ul.quick-list li {
white-space: nowrap;
}
.green {
color: #1ABB9C;
}
/* --blue: #007bff;
--indigo: #6610f2;
--purple: #6f42c1;
--pink: #e83e8c;
--red: #dc3545;
--orange: #fd7e14;
--yellow: #ffc107;
--green: #28a745;
--teal: #20c997;
--cyan: #17a2b8;
--white: #fff;
--gray: #6c757d;
--gray-dark: #343a40;
--primary: #007bff;
--secondary: #6c757d;
--success: #28a745;
--info: #17a2b8;
--warning: #ffc107;
--danger: #dc3545;
--light: #f8f9fa;
--dark: #343a40; */
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment