back +début de fond sur planning coté client

This commit is contained in:
Baptiste 2022-06-16 20:18:06 +02:00
parent d002bbae93
commit b17011e74b
2 changed files with 114 additions and 2 deletions

View file

@ -0,0 +1,48 @@
main {
text-align: center;
border: 0;
margin: 0;
width: 100%;
}
table {
margin: 50px;
border-collapse: collapse;
height: 80vh;
margin-left: auto;
margin-right: auto;
}
table th, td {
border: 0;
margin: 0;
padding: 0;
}
.tr-th {
background-color: rgba(255, 255, 255, 0.5);
}
.tr-th th {
padding: 20px;
color: black;
font-size: 30px;
}
.tr-td {
height: 100%;
}
div.hours {
background-color: rgba(255, 255, 255, 0.7);
border-top: 2px solid black;
color: black;
border-right:2px solid black;
}
div.content {
display : flex;
align-items : center;
justify-content : center;
border: 2px solid black;
}

View file

@ -1,8 +1,72 @@
<?php
ob_start(); // Start reading html
header('Location: construction.php');
?>
include "script/db.php";
if(isset($_GET['planning']) AND !empty(['planning']))
{
$planning = (int) htmlspecialchars($_GET['planning']);
}
?>
<main>
<div class="box-jaune">
<span class="corners corners-top"></span>
<span class="corners corners-bottom"></span>
<div class="title">Planning</div>
<span class="circles circles-top"></span>
<span class="circles circles-bottom"></span>
</div>
<?php
if(isset($planning)) {
?>
<table>
<tr class="tr-th">
<th width="12.5%">Heures</th>
<th width="12.5%">Lundi</th>
<th width="12.5%">Mardi</th>
<th width="12.5%">Mercredi</th>
<th width="12.5%">Jeudi</th>
<th width="12.5%">Vendredi</th>
<th width="12.5%">Samedi</th>
<th width="12.5%">Dimanche</th>
</tr>
<tr class="tr-td">
<td>
<?php
for($i=8;$i<=22;$i++) {
?>
<div style="height: <?= 100/15 ?>%;" class="hours">
<?= $i ?>
</div>
<?php
}
?>
</td>
<?php
for($day=1;$day<=7;$day++) {
echo "<td>";
$req1 = $db->prepare('SELECT title, description, color, length FROM planning_insa WHERE day = ? AND num_planning = ? ORDER BY order_start ASC');
$req1->execute(array($day, $planning));
while($r1 = $req1->fetch()) {
?>
<div style="background-color: <?= $r1['color'] ?>; height: <?= $r1['length'] ?>%; <?php if($day == 7) { echo "border-right: 4px solid black;"; } ?>" class="content">
<span><?= $r1['title'] ?></span>
</div>
<?php
}
echo "</td>";
}
?>
</tr>
</table>
<?php
}
?>
</main>
<?php
$infopage = ["", "Planning", ob_get_clean(), "", "planning"]; //relativepath, pagetitle, pagecontent, pagescript, pagename | cf structure/template.php ligne 2 à 6
include("structure/template.php");