From f7f3d93abe5a00a8dec68554afa4b222cf6a7ed8 Mon Sep 17 00:00:00 2001 From: Baptiste Date: Wed, 3 Aug 2022 14:19:19 +0200 Subject: [PATCH] affichage avancement ville --- admin/com_ville.css | 88 ++++++++++ admin/prototype_com_ville.php | 1 + admin/ville.php | 312 +++++++++++++++++++++++++++++----- 3 files changed, 360 insertions(+), 41 deletions(-) create mode 100644 admin/com_ville.css diff --git a/admin/com_ville.css b/admin/com_ville.css new file mode 100644 index 0000000..96791f6 --- /dev/null +++ b/admin/com_ville.css @@ -0,0 +1,88 @@ +.cmv-progress { + color: white; + background-color: #333; + border-bottom: 2px solid #ccc; +} + +h5.cmv-title { + font-size: 1.1em; + padding: 1em 1em 5px; +} + +.cmv-container { + display:flex; + position:relative; + width:90%; + margin:auto; + height:100px; +} + +.cmv-step { + position: relative; + width: 36px; + height: 36px; + background-color: #ccc; + color: black; + z-index: 5; + border-radius: 50%; + line-height: 36px; + text-align: center; +} + +.cmv-step.fait, .cmv-step.active { + background-color: #06a6b7; +} + +.cmv-step.active:before { + content: ""; + position: absolute; + display: block; + background-color: white; + margin: 15%; + width: 70%; + height: 70%; + border-radius: 50%; + z-index: -15; +} + +.cmv-way { + position: relative; + flex: 1; +} + +.cmv-way.fait:before { + background-color: #06a6b7; +} + +.cmv-way:before { + content: ""; + display: block; + width: 120%; height: 1px; + margin-left: -10%; + margin-top: 17px; + background-color: #eee; +} + +.cmv-fixed:before { + content: ""; + width:1px; height: 7px; + background-color: white; + position: absolute; + top:42px; + left: 18px; +} + +.cmv-fixed { + color: white; + width: 100%; + margin-top: 2px; +} + +.cmv-relative { + content: "52m"; + position: absolute; + color: white; + text-align: center; + width: 100%; + top: -10px; +} \ No newline at end of file diff --git a/admin/prototype_com_ville.php b/admin/prototype_com_ville.php index 8944896..64d3212 100644 --- a/admin/prototype_com_ville.php +++ b/admin/prototype_com_ville.php @@ -170,5 +170,6 @@ + diff --git a/admin/ville.php b/admin/ville.php index f86ace2..d602cc9 100644 --- a/admin/ville.php +++ b/admin/ville.php @@ -1,6 +1,8 @@ Admin / Com'ville +
@@ -67,39 +70,150 @@ if(isset($_POST['reset2'])) { ?> Session non demarré,
-
+ = 1) { + if($r[0]['state'] == 1) { + ?> + Session en cours, +
+
+ + + + + + Session terminé, +
+ +
+ +

"; + + $reqsession = $db->query("SELECT state, time_begin FROM ville WHERE session = 1"); + $rs = $reqsession -> fetchAll(PDO::FETCH_ASSOC); + + $reqe = $db->query('SELECT * FROM ville_equipe WHERE id < 17'); + while($e = $reqe->fetch()) { + $temps_init = $e["temps"]; + $tab_time = NULL; + $tab_time = explode(";", $temps_init); + $temps_begin = date("H:i:s",$rs[0]['time_begin']); + + if($temps_init == NULL) { + $avancement = (int) 0; + $delta_time_0 = gmdate("H:i:s",time()-$rs[0]['time_begin']); + } else { + $avancement = count($tab_time); + $def_time = $tab_time[$avancement-1] - $rs[0]['time_begin']; + $delta_time_0 = gmdate("H:i:s",$tab_time['0']-$rs[0]['time_begin']); + } + + //node 0 ?> - Session en cours, -
-
- - - Session terminé, -
- -
- +
+
Equipe
+
+
0 +
+
+ +
+
+
+ + '; + echo $node; + + if ($i <= $current) { + // --:-- doit être remplacé par l'heure à laquelle le point $node a été atteint + if($i == $current) { + echo '
'.date("H:i:s",time()).'
'; + } else { + echo '
'.date("H:i:s",$tab_time[$i-1]).'
'; + } + } + echo '
'; + + if ($i < 17) { + echo '
'; + if ($i < $current) { + if($i < $current-1) { + echo '
'.gmdate("H:i:s",$tab_time[$i]-$tab_time[$i-1]).'
'; // --mn doit être remplacé par le deltaT entre les points $node et $node+1 + } else { + echo '
'.gmdate("H:i:s",time()-$tab_time[$i-1]).'
'; + } + + } + echo '
'; + } + } + + ?> + +
+ + - query('SELECT id, nom FROM ville_equipe WHERE id < 17'); - while($equipe = $reqint->fetch()) { - ?> - - Session matin Session aprem @@ -112,26 +226,143 @@ if(isset($_POST['reset2'])) { ?> Session non demarré,
-
+ = 1) { + if($r[0]['state'] == 1) { + ?> + Session en cours, +
+
+ + + + + + Session terminé, +
+ +
+ +

"; + + $reqsession = $db->query("SELECT state, time_begin FROM ville WHERE session = 2"); + $rs = $reqsession -> fetchAll(PDO::FETCH_ASSOC); + + $reqe = $db->query('SELECT * FROM ville_equipe WHERE id > 16'); + while($e = $reqe->fetch()) { + $temps_init = $e["temps"]; + $tab_time = NULL; + $tab_time = explode(";", $temps_init); + $temps_begin = date("H:i:s",$rs[0]['time_begin']); + + if($temps_init == NULL) { + $avancement = (int) 0; + $delta_time_0 = gmdate("H:i:s",time()-$rs[0]['time_begin']); + } else { + $avancement = count($tab_time); + $def_time = $tab_time[$avancement-1] - $rs[0]['time_begin']; + $delta_time_0 = gmdate("H:i:s",$tab_time['0']-$rs[0]['time_begin']); + } + + //node 0 ?> - Session en cours, -
-
- +
+
Equipe
+
+
0 +
+
+ +
+
+
+ + '; + echo $node; + + if ($i <= $current) { + // --:-- doit être remplacé par l'heure à laquelle le point $node a été atteint + if($i == $current) { + echo '
'.date("H:i:s",time()).'
'; + } else { + echo '
'.date("H:i:s",$tab_time[$i-1]).'
'; + } + } + echo '
'; + + if ($i < 17) { + echo '
'; + if ($i < $current) { + if($i < $current-1) { + echo '
'.gmdate("H:i:s",$tab_time[$i]-$tab_time[$i-1]).'
'; // --mn doit être remplacé par le deltaT entre les points $node et $node+1 + } else { + echo '
'.gmdate("H:i:s",time()-$tab_time[$i-1]).'
'; + } + + } + echo '
'; + } + } + + ?> + +
+ + - Session terminé, -
- -
- - + } //fin du while e + } + + + + + @@ -146,9 +377,8 @@ if(isset($_POST['reset2'])) { -