Compare commits

...

11 Commits
V3 ... master

  1. 21
      README.md
  2. 106
      css/style.css
  3. 2
      css/style.css.map
  4. BIN
      database/ticket_panne.db
  5. 0
      font/raleway.ttf
  6. BIN
      img/logo_PC.png
  7. 0
      img/voile.JPG
  8. 2
      login/index.php
  9. 0
      package.json
  10. 8
      prof/include/champ.php
  11. 56
      prof/index.php
  12. 4
      referant/admin.php
  13. 7
      referant/cible/delete.php
  14. 6
      referant/cible/export.php
  15. 6
      referant/export.php
  16. 8
      referant/include/line.php
  17. 2
      referant/include/menu.html
  18. 8
      referant/include/popup.html
  19. 30
      referant/index.php
  20. 22
      referant/js/edit.js
  21. 26
      referant/liste.php
  22. 11
      referant/search.php
  23. 137
      sass/main.scss

21
README.md

@ -0,0 +1,21 @@
# Site de tiquet de panne
Le mdp référant est: **3.1415926535**
Le mdp prof est: **1NSI**
C'est un site permettant de créer et gérer des tiquets de panne. Il est composé de **deux parties**:
- Une partie *formulaire*, accessible à **tous**.
- Une partie *gestion*, accessible seulement des référants.
## Partie formulaire
Il s'agit d'un simple formulaire demandant des informations précises à propos de la panne et du matériel défécteux
## Partie gestion
Cette partie est composée de 5 onglets:
- accueil
- recherche
- liste
- admin
- export

106
css/style.css

@ -6,9 +6,15 @@ body {
z-index: 1; z-index: 1;
font-family: monofonto; font-family: monofonto;
background-color: #e5e5e5; background-color: #e5e5e5;
margin: 20px; margin: 143px 20px;
text-align: center; text-align: center;
} }
body > a {
position: absolute;
left: 20px;
top: 20px;
margin: auto;
}
body .logo { body .logo {
display: block; display: block;
} }
@ -51,7 +57,7 @@ body p {
} }
.nav__link:hover { .nav__link:hover {
background-color: #59184E; background-color: #59184E;
transition: 0.25s; transition: 0.65s;
border-radius: 10px; border-radius: 10px;
} }
.nav__link a { .nav__link a {
@ -89,8 +95,7 @@ form {
position: relative; position: relative;
float: right; float: right;
width: 20px; width: 20px;
bottom: 20px; top: 12px;
right: 20px;
} }
.container-field__field { .container-field__field {
background-color: inherit; background-color: inherit;
@ -121,13 +126,21 @@ form {
background-color: #82E6AC; background-color: #82E6AC;
} }
.help { .hint {
position: absolute;
width: 100%;
top: 0;
}
.hint__int {
position: relative;
left: 25%;
}
.hint__help {
display: none; display: none;
z-index: 2; z-index: 2;
position: absolute; position: relative;
width: 170px; width: 170px;
right: 0; left: 71%;
top: 30%;
border-radius: 30px; border-radius: 30px;
box-shadow: 0 0 10px black; box-shadow: 0 0 10px black;
padding: 15px; padding: 15px;
@ -135,15 +148,18 @@ form {
background-color: #e5e5e5; background-color: #e5e5e5;
font-size: 14px; font-size: 14px;
} }
.help p { .hint__help:hover {
display: block;
}
.hint__help p {
position: relative; position: relative;
font-size: 14px; font-size: 14px;
} }
.help img { .hint__help img {
border-radius: 15px; border-radius: 15px;
width: 100%; width: 100%;
} }
.help code { .hint__help code {
background-color: #aaa; background-color: #aaa;
border-radius: 5px; border-radius: 5px;
font-family: courier, monospace; font-family: courier, monospace;
@ -166,6 +182,7 @@ form {
.table td { .table td {
background-color: #e5e5e5; background-color: #e5e5e5;
border: 1px solid #84878C; border: 1px solid #84878C;
width: 1%;
min-width: 20px; min-width: 20px;
border-radius: 5px; border-radius: 5px;
text-align: center; text-align: center;
@ -176,7 +193,7 @@ form {
width: 40%; width: 40%;
max-width: 40px; max-width: 40px;
} }
.table td input { .table td .input {
border: 2px solid #ac2a8d; border: 2px solid #ac2a8d;
border-radius: 5px; border-radius: 5px;
text-align: inherit; text-align: inherit;
@ -184,10 +201,10 @@ form {
color: #84878C; color: #84878C;
transition: 0.05s; transition: 0.05s;
} }
.table td input:hover { .table td .input:hover {
font-weight: bold; font-weight: bold;
} }
.table td input:focus { .table td .input:focus {
font-weight: bold; font-weight: bold;
border: 4px solid #ac2a8d; border: 4px solid #ac2a8d;
} }
@ -214,8 +231,6 @@ form {
box-shadow: 0 0 1px #2ecc71; box-shadow: 0 0 1px #2ecc71;
} }
.table__switch input:checked + .table__switch__slider:before { .table__switch input:checked + .table__switch__slider:before {
-webkit-transform: translateX(26px);
-ms-transform: translateX(26px);
transform: translateX(26px); transform: translateX(26px);
} }
.table__switch__slider { .table__switch__slider {
@ -227,7 +242,6 @@ form {
bottom: 0; bottom: 0;
background-color: crimson; background-color: crimson;
border-radius: 34px; border-radius: 34px;
-webkit-transition: 0.4s;
transition: 0.4s; transition: 0.4s;
} }
.table__switch__slider:before { .table__switch__slider:before {
@ -239,14 +253,64 @@ form {
left: 4px; left: 4px;
bottom: 4px; bottom: 4px;
background-color: white; background-color: white;
-webkit-transition: 0.4s;
transition: 0.4s; transition: 0.4s;
} }
.container-popup {
z-index: 1;
position: fixed;
top: 0;
bottom: 0;
left: 0;
right: 0;
background: rgba(0, 0, 0, 0.7);
transition: opacity 500ms;
visibility: hidden;
opacity: 0;
}
.container-popup:target {
visibility: visible;
opacity: 1;
}
.container-popup__popup {
margin: auto;
padding: 20px;
background: #fff;
top: 0;
bottom: 0;
left: 0;
right: 0;
border-radius: 5px;
width: 30%;
height: 150px;
position: absolute;
transition: all 5s ease-in-out;
}
.container-popup__popup h2 {
margin-top: 0;
color: #333;
}
.container-popup__popup p {
max-height: 30%;
overflow: auto;
}
.container-popup__popup__close {
position: absolute;
top: 20px;
right: 30px;
transition: all 200ms;
font-size: 30px;
font-weight: bold;
text-decoration: none;
color: #333;
}
.container-popup__popup__close:hover {
color: #06D85F;
}
.button { .button {
border: 3px solid #ac2a8d; border: 3px solid #ac2a8d;
background-color: #e5e5e5; background-color: #e5e5e5;
color: #ac2a8d;
font-weight: bold; font-weight: bold;
text-decoration: none; text-decoration: none;
transition: 0.5s; transition: 0.5s;
@ -257,12 +321,14 @@ form {
} }
.button--small { .button--small {
width: 3rem; width: 3rem;
border-width: medium;
border-radius: 5px; border-radius: 5px;
margin: 5px; margin: 5px;
color: #84878C;
} }
.button--large { .button--large {
color: #ac2a8d;
display: inline-block; display: inline-block;
width: 6%;
margin-bottom: 3%; margin-bottom: 3%;
padding: 10px 40px; padding: 10px 40px;
border-radius: 20px; border-radius: 20px;

2
css/style.css.map

@ -1 +1 @@
{"version":3,"sourceRoot":"","sources":["../sass/main.scss"],"names":[],"mappings":"AAMA;EACI;EACA;;AAGJ;EACI;EACA;EACA,kBAbS;EAcT;EACA;;AACA;EACI;;AAEJ;EACI;EACA;EACA;;AAEJ;EACI;EACA,OAxBE;EAyBF;EACA;;;AAOR;EACI;EACA;EACA;EACA,kBAxCQ;EAyCR;;AACA;EACI;EACA;EACA;;AACA;EACI;EACA;EACA;;AAGR;EACI;EACA;EACA;EACA;EACA;EACA;;AACA;EACI,kBA1DG;EA2DH;EACA;;AAEJ;EACI;EACA;EACA;EACA;EACA;EACA;;AACA;EACI;;;AAUhB;EACI;EACA;EAEA;EACA;EAEA;EACA;EACA;EACA;;;AAGJ;EACI;;AACA;EACI;EACA;;AAEJ;EACI;EACA;EACA;EACA;EACA;EACA;;AAEJ;EACI;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;AACA;EACI;EACA,cA7HF;EA8HE;;AAEJ;EACI;EACA;EACA;;;AASZ;EACI;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA,kBAzJS;EA0JT;;AACA;EACI;EACA;;AAEJ;EACI;EACA;;AAEJ;EACI;EACA;EACA;EACA;EACA;;;AAQR;EACI;EACA;EACA;EACA;EACA,kBAtLQ;EAuLR;EACA;;AACA;EACI;;AAEJ;EACI,kBA5LK;EA8LL;EACA;EACA;EAEA;EACA;EACA,OArMI;;AAsMJ;EACI;EACA;;AAEJ;EACI;EACA;EACA;EACA;EACA,OA/MA;EAgNA;;AACA;EACI;;AAEJ;EACI;EACA;;AAIZ;EACI,OAxNE;EAyNF;EACA;;AAEJ;EACI;EACA;EACA;EACA;;AACA;EACI;EACA;EACA;;AACA;EACI;;AAEJ;EACI;;AAEJ;EACI;EACA;EACA;;AAGR;EACI;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;AACA;EACI;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;;AAOhB;EACI;EACA,kBAjRS;EAkRT,OAhRM;EAiRN;EACA;EACA;;AACA;EACI,OAvRK;EAwRL,kBAtRE;;AAwRN;EACI;EACA;EACA;;AAEJ;EACI;EACA;EACA;EACA;EACA","file":"style.css"} {"version":3,"sourceRoot":"","sources":["../sass/main.scss"],"names":[],"mappings":"AAMA;EACI;EACA;;AAGJ;EACI;EACA;EACA,kBAbS;EAcT;EACA;;AACA;EACI;EACA;EACA;EACA;;AAEJ;EACI;;AAEJ;EACI;EACA;EACA;;AAEJ;EACI;EACA,OA9BE;EA+BF;EACA;;;AAOR;EACI;EACA;EACA;EACA,kBA9CQ;EA+CR;;AACA;EACI;EACA;EACA;;AACA;EACI;EACA;EACA;;AAGR;EACI;EACA;EACA;EACA;EACA;EACA;;AACA;EACI,kBAhEG;EAiEH;EACA;;AAEJ;EACI;EACA;EACA;EACA;EACA;EACA;;AACA;EACI;;;AAUhB;EACI;EACA;EAEA;EACA;EAEA;EACA;EACA;EACA;;;AAGJ;EACI;;AACA;EACI;EACA;;AAEJ;EACI;EACA;EACA;EACA;EACA;;AAEJ;EACI;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;AACA;EACI;EACA,cAlIF;EAmIE;;AAEJ;EACI;EACA;EACA;;;AASZ;EACI;EACA;EACA;;AACA;EACI;EACA;;AAEJ;EAII;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA,kBAxKK;EAyKL;;AAbA;EACI;;AAaJ;EACI;EACA;;AAEJ;EACI;EACA;;AAEJ;EACI;EACA;EACA;EACA;EACA;;;AAWZ;EACI;EACA;EACA;EACA;EACA,kBAxMQ;EAyMR;EACA;;AACA;EACI;;AAEJ;EACI,kBA9MK;EAgNL;EACA;EACA;EACA;EAEA;EACA;EACA,OAxNI;;AAyNJ;EACI;EACA;;AAEJ;EACI;EACA;EACA;EACA;EACA,OAlOA;EAmOA;;AACA;EACI;;AAEJ;EACI;EACA;;AAIZ;EACI,OA3OE;EA4OF;EACA;;AAEJ;EACI;EACA;EACA;EACA;;AACA;EACI;EACA;EACA;;AACA;EACI;;AAEJ;EACI;;AAEJ;EACI;;AAGR;EACI;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;AACA;EACI;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;;AAOhB;EACI;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;AACA;EACI;EACA;;AAEJ;EACI;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;AACA;EACI;EACA;;AAEJ;EACI;EACA;;AAEJ;EACI;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;AACA;EACI;;;AAOhB;EACI;EACA,kBArVS;EAsVT;EACA;EACA;;AACA;EACI,OA1VK;EA2VL,kBAzVE;;AA2VN;EACI;EACA;EACA;EACA;EACA,OAnWI;;AAqWR;EACI,OAnWE;EAoWF;EACA;EACA;EACA","file":"style.css"}

BIN
database/ticket_panne.db

Binary file not shown.

0
font/raleway.ttf

BIN
img/logo_PC.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 51 KiB

After

Width:  |  Height:  |  Size: 25 KiB

0
img/voile.JPG

Before

Width:  |  Height:  |  Size: 87 KiB

After

Width:  |  Height:  |  Size: 87 KiB

2
login/index.php

@ -2,8 +2,8 @@
<html> <html>
<head> <head>
<title>Login</title> <title>Login</title>
<a href="index.php"><img class="logo" src="../img/logo_PC.png" alt="logo_PC"></a>
<link rel="stylesheet" href="../css/style.css"> <link rel="stylesheet" href="../css/style.css">
<img class="logo" src="../img/logo_PC.png" alt="logo_PC" width="200px">
</head> </head>
<body> <body>
<form id='form' action="cible.php" method="post"> <form id='form' action="cible.php" method="post">

0
package.json

8
prof/include/champ.php

@ -1,11 +1,7 @@
<?php <?php
echo '<p> ',$titre,' : '; echo '<p> ',$titre,' : </p>
if ($help) {
echo '<a class="int" href="#" onmouseover=displayHelp(',$sql_name,') onmouseout=hideHelp(',$sql_name,') ><img src="../img/int.png" alt="point_int" width=20px ></a>';
}
echo '</p>
<input class="container-field__field" type=',$type,' name=',$sql_name,'><br>
<img class="container-field__img container-field__img--check" src="../img/check.png" alt="check"> <img class="container-field__img container-field__img--check" src="../img/check.png" alt="check">
<img class="container-field__img container-field__img--excla" src="../img/excla.png" alt="exclamation"> <img class="container-field__img container-field__img--excla" src="../img/excla.png" alt="exclamation">
<input class="container-field__field" type=',$type,' name=',$sql_name,'><br>
<small>',$error,'</small>'; <small>',$error,'</small>';
?> ?>

56
prof/index.php

@ -9,7 +9,7 @@ include '../sessions/session.php';
<title>Tickets de panne</title> <title>Tickets de panne</title>
<link href="../css/style.css" rel="stylesheet"> <link href="../css/style.css" rel="stylesheet">
<script type="text/javascript" src="js/script.js" defer></script> <script type="text/javascript" src="js/script.js" defer></script>
<img class="logo" src="../img/logo_PC.png" alt="logo_PC" width="200px"> <a href="index.php"><img class="logo" src="../img/logo_PC.png" alt="logo_PC"></a>
</head> </head>
<body id="page"> <body id="page">
@ -28,15 +28,14 @@ include '../sessions/session.php';
$sql_name = 'dates'; $sql_name = 'dates';
$type = 'date'; $type = 'date';
$error = 'Veuillez saisir une date'; $error = 'Veuillez saisir une date';
$help = false;
include("include/champ.php"); include("include/champ.php");
?> ?>
</div> </div>
<div class="container-field"> <div class="container-field">
<p>Détails :</p> <p>Détails :</p>
<textarea class="container-field__field" rows="10" cols="30" name='details'></textarea><br>
<img class="container-field__img container-field__img--check" src="../img/check.png" alt="check"> <img class="container-field__img container-field__img--check" src="../img/check.png" alt="check">
<img class="container-field__img container-field__img--excla" src="../img/excla.png" alt="exclamation"> <img class="container-field__img container-field__img--excla" src="../img/excla.png" alt="exclamation">
<textarea class="container-field__field" rows="10" cols="30" name='details'></textarea><br>
<small>Error: Veuillez remplir ce champ</small> <small>Error: Veuillez remplir ce champ</small>
</div> </div>
<div class="container-field"> <div class="container-field">
@ -45,13 +44,16 @@ include '../sessions/session.php';
$sql_name = 'lieu'; $sql_name = 'lieu';
$type = 'text'; $type = 'text';
$error = "Vous n'avez saisie de lieu"; $error = "Vous n'avez saisie de lieu";
$help = true;
include("include/champ.php"); include("include/champ.php");
?> ?>
<div class="help" id="lieu"> <div class="hint" onmouseleave='hideHelp(lieu)'>
<p>Entrez le nom du bâtiment dans lequel se trouve le matériel</p><br> <a class="hint__int" href="#" onmouseover=displayHelp(lieu)><img src="../img/int.png" alt="point_int" width=20px ></a>
<code>Ex: bâtiment A</code> <div class="hint__help" id="lieu">
<p>Entrez le nom du bâtiment dans lequel se trouve le matériel</p><br>
<code>Ex: bâtiment A</code>
</div>
</div> </div>
</div> </div>
<div class="container-field"> <div class="container-field">
<?php <?php
@ -59,30 +61,36 @@ include '../sessions/session.php';
$sql_name = 'salle'; $sql_name = 'salle';
$type = 'text'; $type = 'text';
$error = "Vous n'avez pas saisie de salle"; $error = "Vous n'avez pas saisie de salle";
$help = true;
include("include/champ.php"); include("include/champ.php");
?> ?>
<div class="help" id="salle"> <div class="hint" onmouseleave='hideHelp(salle)'>
<a class="hint__int" href="#" onmouseover=displayHelp(salle)><img src="../img/int.png" alt="point_int" width=20px ></a>
<div class="hint__help" id="salle">
<p>Entrez le nom de la salle dans lequel se trouve le matériel</p><br> <p>Entrez le nom de la salle dans lequel se trouve le matériel</p><br>
<code>Ex: A 11 codage</code> <code>Ex: A 11 codage</code>
</div>
</div> </div>
</div> </div>
<div class="container-field"> <div class="container-field">
<?php <?php
$titre = 'Position dans la salle'; $titre = 'Position';
$sql_name = 'pos'; $sql_name = 'pos';
$type = 'text'; $type = 'text';
$error = 'Veuillez remplir ce champ'; $error = 'Veuillez remplir ce champ';
$help = true;
include("include/champ.php"); include("include/champ.php");
?> ?>
<div class="help" id="pos"> <div class="hint" onmouseleave='hideHelp(pos)'>
<a class="hint__int" href="#" onmouseover=displayHelp(pos)><img src="../img/int.png" alt="point_int" width=20px ></a>
<div class="hint__help" id="pos">
<p>Veillez fournir des présision sur la position du matériel</p><br> <p>Veillez fournir des présision sur la position du matériel</p><br>
<code>Ex: PC-42 au fond à droite</code> <code>Ex: PC-42 au fond à droite</code>
</div>
</div> </div>
</div> </div>
<div class="container-field"> <div class="container-field">
<p>Matériel :</p> <p>Matériel :</p>
<img class="container-field__img container-field__img--check" src="../img/check.png" alt="check">
<img class="container-field__img container-field__img--excla" src="../img/excla.png" alt="exclamation">
<select class="container-field__field" name='materiel'> <select class="container-field__field" name='materiel'>
<option value="UC">Unité Centrale</option> <option value="UC">Unité Centrale</option>
<option value="IMP">Imprimante</option> <option value="IMP">Imprimante</option>
@ -90,8 +98,6 @@ include '../sessions/session.php';
<option value="VID">Vidéo Projecteur</option> <option value="VID">Vidéo Projecteur</option>
<option value="TBI">Tableau Blanc Interactif</option> <option value="TBI">Tableau Blanc Interactif</option>
</select> </select>
<img class="container-field__img container-field__img--check" src="../img/check.png" alt="check">
<img class="container-field__img container-field__img--excla" src="../img/excla.png" alt="exclamation">
<small>test</small> <small>test</small>
</div> </div>
<div class="container-field"> <div class="container-field">
@ -103,9 +109,12 @@ include '../sessions/session.php';
$help = true; $help = true;
include("include/champ.php"); include("include/champ.php");
?> ?>
<div class="help" id="marque"> <div class="hint" onmouseleave='hideHelp(marque)'>
<a class="hint__int" href="#" onmouseover=displayHelp(marque)><img src="../img/int.png" alt="point_int" width=20px ></a>
<div class="hint__help" id="marque">
<p>Veillez renseigner la marque du matériel</p><br> <p>Veillez renseigner la marque du matériel</p><br>
<code>Ex: Asus</code> <code>Ex: Asus</code>
</div>
</div> </div>
</div> </div>
<div class="container-field"> <div class="container-field">
@ -114,12 +123,14 @@ include '../sessions/session.php';
$sql_name = 'model'; $sql_name = 'model';
$type = 'text'; $type = 'text';
$error = "Veuillez saisir le model"; $error = "Veuillez saisir le model";
$help = true;
include("include/champ.php"); include("include/champ.php");
?> ?>
<div class="help" id="model"> <div class="hint" onmouseleave='hideHelp(model)'>
<a class="hint__int" href="#" onmouseover=displayHelp(model)><img src="../img/int.png" alt="point_int" width=20px ></a>
<div class="hint__help" id="model">
<p>Veillez renseigner le modèle du matériel</p><br> <p>Veillez renseigner le modèle du matériel</p><br>
<code>Ex: Lattitude E6410</code> <code>Ex: Lattitude E6410</code>
</div>
</div> </div>
</div> </div>
<div class="container-field"> <div class="container-field">
@ -128,12 +139,14 @@ include '../sessions/session.php';
$sql_name = 'nserie'; $sql_name = 'nserie';
$type = 'text'; $type = 'text';
$error = "Vous n'avez saisie le n° de série"; $error = "Vous n'avez saisie le n° de série";
$help = true;
include("include/champ.php"); include("include/champ.php");
?> ?>
<div class="help" id="nserie"> <div class="hint" onmouseleave='hideHelp(nserie)'>
<img src="../img/voile.JPG" alt="voile"> <br> <a class="hint__int" href="#" onmouseover=displayHelp(nserie)><img src="../img/int.png" alt="point_int" width=20px ></a>
<code>Ex: bâtiment A</code> <div class="hint__help" id="nserie">
<p>Voici un exemple. Pour plus d'aide: <a href="#">ici</a> </p> <br>
<code>Ex: 3A42B14</code>
</div>
</div> </div>
</div> </div>
<div class="container-field"> <div class="container-field">
@ -142,7 +155,6 @@ include '../sessions/session.php';
$sql_name = 'demandeur'; $sql_name = 'demandeur';
$type = 'text'; $type = 'text';
$error = 'Veulliez entrer votre nom'; $error = 'Veulliez entrer votre nom';
$help = false;
include("include/champ.php"); include("include/champ.php");
?> ?>
</div> </div>

4
referant/admin.php

@ -23,8 +23,8 @@
</thead> </thead>
<tbody> <tbody>
<tr class='table__title'> <tr class='table__title'>
<td>Login</td> <td>Identifiant</td>
<td>Password</td> <td>Mot de passe</td>
</tr> </tr>
<?php <?php
foreach ($arr as $key => $value) { foreach ($arr as $key => $value) {

7
referant/cible/delete.php

@ -0,0 +1,7 @@
<?php
$bdd = new SQLite3('../../database/ticket_panne.db', SQLITE3_OPEN_READWRITE);
$request = $bdd->prepare('DELETE FROM pannes WHERE ID=:id');
$request->bindValue(':id', $_POST['id']);
$request->execute();
?>

6
referant/cible/export.php

@ -1,12 +1,14 @@
<?php <?php
$bdd = new SQLite3('../../database/ticket_panne.db', SQLITE3_OPEN_READWRITE); $bdd = new SQLite3('../../database/ticket_panne.db', SQLITE3_OPEN_READWRITE);
$res = $bdd->query('SELECT * FROM ' .$_POST['bdd']); $res = $bdd->query('SELECT * FROM ' .$_POST['bdd']);
$title = array_keys($res->fetchArray(SQLITE3_ASSOC));
header('Content-Type: text/csv; charset=utf-8'); header('Content-Type: text/csv; charset=utf-8');
header('Content-Disposition: attachment; filename=' .$_POST['bdd'] .'.csv'); header('Content-Disposition: attachment; filename=' .$_POST['bdd'] .'.csv');
$output = fopen("php://output", "w"); $output = fopen("php://output", "w");
$title = $res->fetchArray(SQLITE3_ASSOC);
fputcsv($output, array_keys($title));
fputcsv($output, $title); fputcsv($output, $title);
while($row = $res->fetchArray(SQLITE3_ASSOC)) { while($row = $res->fetchArray(SQLITE3_ASSOC)) {

6
referant/export.php

@ -14,11 +14,11 @@ include '../sessions/session_restraintes.php';
<div class="container-field"> <div class="container-field">
<p>Type:</p> <p>Type:</p>
<select class="container-field__field" name="type"> <select class="container-field__field" name="type">
<option value="csv">CSV</option> <option value="csv" onclick="document.getElementById('base-choice').style.display = 'block'; document.getElementById('form').setAttribute('action','cible/export.php');">CSV</option>
<!-- <option value="sql">SQL</option> --> <option value="sqlite" onclick="document.getElementById('base-choice').style.display = 'none'; document.getElementById('form').setAttribute('action','../database/ticket_panne.db');">SQLite</option>
</select> </select>
</div> </div>
<div class="container-field"> <div id="base-choice" class="container-field">
<p>Base:</p> <p>Base:</p>
<select class="container-field__field" name="bdd"> <select class="container-field__field" name="bdd">
<option value="pannes">pannes</option> <option value="pannes">pannes</option>

8
referant/include/line.php

@ -5,7 +5,7 @@ if (isset($_POST['class'])) {
if (isset($line)) { if (isset($line)) {
echo '<tr> echo '<tr>
<td class=', $class , ' style="font-weight: bold;" >',$class,'</td> <td class=', $class , ' style="font-weight: bold; font-size: 24px;" >',$class,'</td>
<td class=', $class , '>',$line[1],'</td> <td class=', $class , '>',$line[1],'</td>
<td class=', $class , '>',$line[2],'</td> <td class=', $class , '>',$line[2],'</td>
<td class=', $class , '>',$line[3],'</td> <td class=', $class , '>',$line[3],'</td>
@ -24,8 +24,6 @@ if (isset($line)) {
echo '<td class=', $class , '><img src="../img/excla.png" ></td>'; echo '<td class=', $class , '><img src="../img/excla.png" ></td>';
} }
echo ' <td class=', $class , '> echo ' <td class=', $class , '>
<label class="table__switch"> <label class="table__switch">
<input class="checkbox" type="checkbox" onchange="Slider(\'',$class,'\')"> <input class="checkbox" type="checkbox" onchange="Slider(\'',$class,'\')">
@ -33,11 +31,12 @@ if (isset($line)) {
</label> </label>
</td> </td>
<td class=',$class,'><input class="button button--small" type="button" value="edit" onclick="Edit(\'',$class,'\')"></td> <td class=',$class,'><input class="button button--small" type="button" value="edit" onclick="Edit(\'',$class,'\')"></td>
<td class=',$class,'><a href="#popup"><input class="button button--small" type="button" value="del" onclick="ModifPop(\'',$class,'\')"></a></td>
</tr>'; </tr>';
} }
else { else {
echo '<tr> echo '<tr>
<td class=', $class , ' style="font-weight: bold;" ></td> <td class=', $class , ' style="font-weight: bold; font-size: 24px;" ></td>
<td class=', $class , '></td> <td class=', $class , '></td>
<td class=', $class , '></td> <td class=', $class , '></td>
<td class=', $class , '></td> <td class=', $class , '></td>
@ -56,6 +55,7 @@ else {
</label> </label>
</td> </td>
<td class=',$class,'><input class="button button--small" type="button" value="edit" onclick="Edit(\'',$class,'\')"></td> <td class=',$class,'><input class="button button--small" type="button" value="edit" onclick="Edit(\'',$class,'\')"></td>
<td class=',$class,'><a href="popup"><input class="button button--small" type="button" value="del" onclick="ModifPop(\'',$class,'\')"></a></td>
</tr>'; </tr>';
} }
?> ?>

2
referant/include/menu.html

@ -1,4 +1,4 @@
<meta charset="utf-8"> <meta charset="utf-8">
<title>Admin ticket</title> <title>Admin ticket</title>
<link href="../css/style.css" rel="stylesheet"> <link href="../css/style.css" rel="stylesheet">
<a href="index.php"><img class="logo" src="../img/logo_PC.png" alt="logo_PC" width="200px"></a> <a href="index.php"><img class="logo" src="../img/logo_PC.png" alt="logo_PC"></a>

8
referant/include/popup.html

@ -0,0 +1,8 @@
<div id="popup" class="container-popup">
<div class="container-popup__popup">
<h2>Attention!</h2>
<a class="container-popup__popup__close" href="#">X</a>
<p>Voulez-vous vraiment supprimer ce ticket?</p>
<a href="#"><input class="button button--large" type="button" value="supprimer"></a>
</div>
</div>

30
referant/index.php

@ -9,26 +9,27 @@ include '../sessions/session_restraintes.php';
</head> </head>
<body> <body>
<div class="contaner-field"><a class="button button--large" href="../prof/index.php">client</a></div> <div class="contaner-field"><a class="button button--large" href="../prof/index.php">formulaire</a></div>
<?php include 'include/nav.php'; ?> <?php include 'include/nav.php'; ?>
<?php include 'include/popup.html'; ?>
<script type="text/javascript" src="js/edit.js" defer></script> <script type="text/javascript" src="js/edit.js" defer></script>
<table class="table"> <table class="table">
<thead> <thead>
<tr> <tr>
<th colspan="14">Ticket récents non traités</th> <th colspan="15">Ticket récents non traités</th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
<tr class="table__title"> <tr class="table__title">
<td>ID</td> <td>ID</td>
<td>date</td> <td>date</td>
<td>details</td> <td>détails</td>
<td>lieu</td> <td>lieu</td>
<td>salle</td> <td>salle</td>
<td>pos</td> <td>pos</td>
<td>materiel</td> <td>matériel</td>
<td>marque</td> <td>marque</td>
<td>model</td> <td>modèle</td>
<td>nserie</td> <td>nserie</td>
<td>demandeur</td> <td>demandeur</td>
<td>traitement</td> <td>traitement</td>
@ -39,17 +40,26 @@ include '../sessions/session_restraintes.php';
$bdd = new SQLite3('../database/ticket_panne.db', SQLITE3_OPEN_READWRITE); $bdd = new SQLite3('../database/ticket_panne.db', SQLITE3_OPEN_READWRITE);
$reponse = $bdd->query("SELECT * FROM pannes ORDER BY ID DESC"); $reponse = $bdd->query("SELECT * FROM pannes ORDER BY ID DESC");
$non_traite = 0;
for ($j=0; $j < 3; $j++) { for ($j=0; $j < 3; $j++) {
$line = $reponse->fetchArray(); $line = $reponse->fetchArray();
if ($line['traitement'] == 0) { if (isset($line['traitement'])) {
$class = $line[0]; if ($line['traitement'] == 0) {
include 'include/line.php'; $non_traite ++;
$class = $line[0];
include 'include/line.php';
}
else {
$j--;
}
} }
else { else {
$j--; break;
} }
} }
if ($non_traite == 0) {
echo "<h2>Aucun ticket non traité</h2>";
}
?> ?>
</tbody> </tbody>
</table> </table>

22
referant/js/edit.js

@ -28,7 +28,7 @@ function Edit(clas) {
let data = new FormData(); let data = new FormData();
if (obj[13].querySelector('input').value == 'edit') { if (obj[13].querySelector('input').value == 'edit') {
for (let i=1; i< 11; i++) { for (let i=1; i< 11; i++) {
obj[i].innerHTML = '<input type="text" style="width: 80%;" value="' + obj[i].textContent + '">'; obj[i].innerHTML = '<input class="input" type="text" style="width: 80%;" value="' + obj[i].textContent + '">';
} }
obj[13].querySelector('input').value = 'ok'; obj[13].querySelector('input').value = 'ok';
} }
@ -38,7 +38,6 @@ function Edit(clas) {
data.append('value', JSON.stringify(value)); data.append('value', JSON.stringify(value));
xhr.onreadystatechange = function() { xhr.onreadystatechange = function() {
if (this.readyState == 4 && this.status == 200) { if (this.readyState == 4 && this.status == 200) {
console.log(this.response);
for (let i=1; i<11; i++) { for (let i=1; i<11; i++) {
obj[i].innerHTML = this.response[i]; obj[i].innerHTML = this.response[i];
} }
@ -71,3 +70,22 @@ function Value(list) {
} }
} }
function ModifPop(clas) {
const popup = document.getElementsByClassName('container-popup__popup')[0];
popup.querySelector('p').textContent = 'Voulez-vous vraiment supprimer le ticket ' + clas + ' ?';
popup.querySelector('a > input').setAttribute('onclick', 'DelTicket('+clas+')');
}
function DelTicket(clas) {
let xhr = new XMLHttpRequest();
xhr.onreadystatechange = function() {
if (this.readyState == 4 && this.status == 200) {
location.reload();
}
};
xhr.open('POST', 'cible/delete.php', true);
xhr.responseType = 'text';
xhr.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
xhr.send("id=" + encodeURI(clas));
}

26
referant/liste.php

@ -10,23 +10,26 @@ include '../sessions/session_restraintes.php';
</head> </head>
<body id="corps"> <body id="corps">
<?php include 'include/nav.php';?> <?php include 'include/nav.php';?>
<?php include 'include/popup.html'; ?>
</div>
<table class="table"> <table class="table">
<thead> <thead>
<tr> <tr>
<th colspan="14">Ticket</th> <th colspan="15">Ticket</th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
<tr class='table__title'> <tr class='table__title'>
<td>ID</td> <td>ID</td>
<td>date</td> <td>date</td>
<td>details</td> <td>détails</td>
<td>lieu</td> <td>lieu</td>
<td>salle</td> <td>salle</td>
<td>pos</td> <td>pos</td>
<td>materiel</td> <td>matériel</td>
<td>marque</td> <td>marque</td>
<td>model</td> <td>modèle</td>
<td>nserie</td> <td>nserie</td>
<td>demandeur</td> <td>demandeur</td>
<td>traitement</td> <td>traitement</td>
@ -36,10 +39,19 @@ include '../sessions/session_restraintes.php';
$bdd = new SQLite3('../database/ticket_panne.db', SQLITE3_OPEN_READWRITE); $bdd = new SQLite3('../database/ticket_panne.db', SQLITE3_OPEN_READWRITE);
$reponse = $bdd->query("SELECT * FROM pannes ORDER BY ID"); $reponse = $bdd->query("SELECT * FROM pannes ORDER BY ID");
$non_traite = 0;
while ($line = $reponse->fetchArray()) { while ($line = $reponse->fetchArray()) {
$class = $line[0]; if (isset($line['traitement'])) {
include 'include/line.php'; $non_traite ++;
$class = $line[0];
include 'include/line.php';
}
else {
break;
}
}
if ($non_traite == 0) {
echo "<h2>Aucun ticket dans la base</h2>";
} }
?> ?>
</tbody> </tbody>

11
referant/search.php

@ -12,6 +12,7 @@ include '../sessions/session_restraintes.php';
<body id='corps'> <body id='corps'>
<?php include 'include/nav.php'; ?> <?php include 'include/nav.php'; ?>
<?php include 'include/popup.html'; ?>
<form id="form" action="js/search.php" method="POST"> <form id="form" action="js/search.php" method="POST">
<div class="container-field"> <div class="container-field">
<p>Recherche :</p> <p>Recherche :</p>
@ -34,7 +35,7 @@ include '../sessions/session_restraintes.php';
<input class="container-field__field" type="input" name="value"> <input class="container-field__field" type="input" name="value">
</div> </div>
<div class="container-field"> <div class="container-field">
<input class="container-field__field container-field__field--submit" type="submit"> <input class="container-field__field container-field__field--submit" type="submit" value="Rechercher">
</div> </div>
@ -42,20 +43,20 @@ include '../sessions/session_restraintes.php';
<table class="table" style="display: none;"> <table class="table" style="display: none;">
<thead> <thead>
<tr> <tr>
<th colspan="14">Ticket</th> <th colspan="15">Ticket</th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
<tr class='table__title'> <tr class='table__title'>
<td>ID</td> <td>ID</td>
<td>date</td> <td>date</td>
<td>details</td> <td>détails</td>
<td>lieu</td> <td>lieu</td>
<td>salle</td> <td>salle</td>
<td>pos</td> <td>pos</td>
<td>materiel</td> <td>matériel</td>
<td>marque</td> <td>marque</td>
<td>model</td> <td>modèle</td>
<td>nserie</td> <td>nserie</td>
<td>demandeur</td> <td>demandeur</td>
<td>traitement</td> <td>traitement</td>

137
sass/main.scss

@ -13,8 +13,14 @@ body {
z-index: 1; z-index: 1;
font-family: monofonto; font-family: monofonto;
background-color: $light-grey; background-color: $light-grey;
margin: 20px; margin: 143px 20px;
text-align: center; text-align: center;
&>a {
position: absolute;
left: 20px;
top: 20px;
margin: auto;
}
.logo { .logo {
display: block; display: block;
} }
@ -59,7 +65,7 @@ body {
list-style-type: none; list-style-type: none;
&:hover { &:hover {
background-color: $dark-bordeau; background-color: $dark-bordeau;
transition: .25s; transition: .65s;
border-radius: 10px; border-radius: 10px;
} }
a { a {
@ -104,8 +110,7 @@ form {
position: relative; position: relative;
float: right; float: right;
width: 20px; width: 20px;
bottom: 20px; top: 12px;
right: 20px;
} }
&__field { &__field {
background-color: inherit; background-color: inherit;
@ -141,37 +146,50 @@ form {
// help // help
.help { .hint {
display: none;
z-index: 2;
position: absolute; position: absolute;
width: 170px; width: 100%;
right: 0; top: 0;
top: 30%; &__int {
border-radius: 30px;
box-shadow: 0 0 10px black;
padding: 15px;
margin: 0;
background-color: $light-grey;
font-size: 14px;
p {
position: relative; position: relative;
font-size: 14px; left: 25%;
}
img {
border-radius: 15px;
width: 100%;
} }
code { &__help {
background-color: #aaa; &:hover {
border-radius: 5px; display: block;
font-family: courier, monospace; }
padding: 3px 5px; display: none;
z-index: 2;
position: relative;
width: 170px;
left: 71%;
border-radius: 30px;
box-shadow: 0 0 10px black;
padding: 15px;
margin: 0;
background-color: $light-grey;
font-size: 14px; font-size: 14px;
p {
position: relative;
font-size: 14px;
}
img {
border-radius: 15px;
width: 100%;
}
code {
background-color: #aaa;
border-radius: 5px;
font-family: courier, monospace;
padding: 3px 5px;
font-size: 14px;
}
} }
} }
// table // table
@ -190,6 +208,7 @@ form {
background-color: $light-grey; background-color: $light-grey;
border: 1px solid $dark-grey; border: 1px solid $dark-grey;
width: 1%;
min-width: 20px; min-width: 20px;
border-radius: 5px; border-radius: 5px;
@ -200,7 +219,7 @@ form {
width: 40%; width: 40%;
max-width: 40px; max-width: 40px;
} }
input { .input {
border: 2px solid $bordeau; border: 2px solid $bordeau;
border-radius: 5px; border-radius: 5px;
text-align: inherit; text-align: inherit;
@ -237,8 +256,6 @@ form {
box-shadow: 0 0 1px #2ecc71; box-shadow: 0 0 1px #2ecc71;
} }
&:checked + .table__switch__slider:before { &:checked + .table__switch__slider:before {
-webkit-transform: translateX(26px);
-ms-transform: translateX(26px);
transform: translateX(26px); transform: translateX(26px);
} }
} }
@ -251,7 +268,6 @@ form {
bottom: 0; bottom: 0;
background-color: crimson; background-color: crimson;
border-radius: 34px; border-radius: 34px;
-webkit-transition: .4s;
transition: .4s; transition: .4s;
&:before { &:before {
position: absolute; position: absolute;
@ -262,7 +278,6 @@ form {
left: 4px; left: 4px;
bottom: 4px; bottom: 4px;
background-color: white; background-color: white;
-webkit-transition: .4s;
transition: .4s; transition: .4s;
} }
} }
@ -270,10 +285,62 @@ form {
} }
.container-popup {
z-index: 1;
position: fixed;
top: 0;
bottom: 0;
left: 0;
right: 0;
background: rgba(0,0,0,.7);
transition: opacity 500ms;
visibility: hidden;
opacity: 0;
&:target {
visibility: visible;
opacity: 1;
}
&__popup {
margin: auto;
padding: 20px;
background: #fff;
top: 0;
bottom: 0;
left: 0;
right: 0;
border-radius: 5px;
width: 30%;
height: 150px;
position: absolute;
transition: all 5s ease-in-out;
h2 {
margin-top: 0;
color: #333;
}
p {
max-height: 30%;
overflow: auto;
}
&__close {
position: absolute;
top: 20px;
right: 30px;
transition: all 200ms;
font-size: 30px;
font-weight: bold;
text-decoration: none;
color: #333;
&:hover {
color: #06D85F;
}
}
}
}
.button { .button {
border: 3px solid $bordeau; border: 3px solid $bordeau;
background-color: $light-grey; background-color: $light-grey;
color: $bordeau;
font-weight: bold; font-weight: bold;
text-decoration: none; text-decoration: none;
transition: .5s; transition: .5s;
@ -283,12 +350,14 @@ form {
} }
&--small { &--small {
width: 3rem; width: 3rem;
border-width: medium;
border-radius: 5px; border-radius: 5px;
margin: 5px; margin: 5px;
color: $dark-grey;
} }
&--large { &--large {
color: $bordeau;
display: inline-block; display: inline-block;
width: 6%;
margin-bottom: 3%; margin-bottom: 3%;
padding: 10px 40px; padding: 10px 40px;
border-radius: 20px; border-radius: 20px;

Loading…
Cancel
Save