diff --git a/css/style.css b/css/style.css index 86e8ea7..4adf1b2 100644 --- a/css/style.css +++ b/css/style.css @@ -6,9 +6,15 @@ body { z-index: 1; font-family: monofonto; background-color: #e5e5e5; - margin: 20px; + margin: 143px 20px; text-align: center; } +body > a { + position: absolute; + left: 20px; + top: 20px; + margin: auto; +} body .logo { display: block; } @@ -166,6 +172,7 @@ form { .table td { background-color: #e5e5e5; border: 1px solid #84878C; + width: 1%; min-width: 20px; border-radius: 5px; text-align: center; @@ -243,10 +250,61 @@ form { 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 { border: 3px solid #ac2a8d; background-color: #e5e5e5; - color: #ac2a8d; font-weight: bold; text-decoration: none; transition: 0.5s; @@ -259,10 +317,11 @@ form { width: 3rem; border-radius: 5px; margin: 5px; + color: #84878C; } .button--large { + color: #ac2a8d; display: inline-block; - width: 6%; margin-bottom: 3%; padding: 10px 40px; border-radius: 20px; diff --git a/css/style.css.map b/css/style.css.map index c8ae797..7deff57 100644 --- a/css/style.css.map +++ b/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"} \ No newline at end of file +{"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;EACA;;AAEJ;EACI;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;AACA;EACI;EACA,cAnIF;EAoIE;;AAEJ;EACI;EACA;EACA;;;AASZ;EACI;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA,kBA/JS;EAgKT;;AACA;EACI;EACA;;AAEJ;EACI;EACA;;AAEJ;EACI;EACA;EACA;EACA;EACA;;;AAQR;EACI;EACA;EACA;EACA;EACA,kBA5LQ;EA6LR;EACA;;AACA;EACI;;AAEJ;EACI,kBAlMK;EAoML;EACA;EACA;EACA;EAEA;EACA;EACA,OA5MI;;AA6MJ;EACI;EACA;;AAEJ;EACI;EACA;EACA;EACA;EACA,OAtNA;EAuNA;;AACA;EACI;;AAEJ;EACI;EACA;;AAIZ;EACI,OA/NE;EAgOF;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;;;AAQhB;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,kBA9US;EA+UT;EACA;EACA;;AACA;EACI,OAnVK;EAoVL,kBAlVE;;AAoVN;EACI;EACA;EACA;EACA,OA3VI;;AA6VR;EACI,OA3VE;EA4VF;EACA;EACA;EACA","file":"style.css"} \ No newline at end of file diff --git a/database/ticket_panne.db b/database/ticket_panne.db index 6f59910..b4234ae 100755 Binary files a/database/ticket_panne.db and b/database/ticket_panne.db differ diff --git a/img/logo_PC.png b/img/logo_PC.png old mode 100755 new mode 100644 index f9c6783..c905e8e Binary files a/img/logo_PC.png and b/img/logo_PC.png differ diff --git a/referant/cible/delete.php b/referant/cible/delete.php new file mode 100644 index 0000000..90cc8a6 --- /dev/null +++ b/referant/cible/delete.php @@ -0,0 +1,8 @@ +prepare('DELETE FROM pannes WHERE ID=:id'); +$request->bindValue(':id', $_POST['id']); +$request->execute(); +echo "Ticket supprimé veuillez actualiser la page"; + ?> diff --git a/referant/include/line.php b/referant/include/line.php index e093643..4b09e28 100755 --- a/referant/include/line.php +++ b/referant/include/line.php @@ -24,8 +24,6 @@ if (isset($line)) { echo ''; } - - echo ' + '; } else { @@ -56,6 +55,7 @@ else { + '; } ?> diff --git a/referant/include/menu.html b/referant/include/menu.html index a0d5378..2ce9d3c 100755 --- a/referant/include/menu.html +++ b/referant/include/menu.html @@ -1,4 +1,4 @@ Admin ticket - + diff --git a/referant/include/popup.html b/referant/include/popup.html new file mode 100644 index 0000000..d7b6012 --- /dev/null +++ b/referant/include/popup.html @@ -0,0 +1,8 @@ + diff --git a/referant/index.php b/referant/index.php index 17d2ba6..559ce17 100755 --- a/referant/index.php +++ b/referant/index.php @@ -11,6 +11,7 @@ include '../sessions/session_restraintes.php';
client
+ @@ -39,17 +40,26 @@ include '../sessions/session_restraintes.php'; $bdd = new SQLite3('../database/ticket_panne.db', SQLITE3_OPEN_READWRITE); $reponse = $bdd->query("SELECT * FROM pannes ORDER BY ID DESC"); - + $non_traite = 0; for ($j=0; $j < 3; $j++) { $line = $reponse->fetchArray(); - if ($line['traitement'] == 0) { - $class = $line[0]; - include 'include/line.php'; + if (isset($line['traitement'])) { + if ($line['traitement'] == 0) { + $non_traite ++; + $class = $line[0]; + include 'include/line.php'; + } + else { + $j--; + } } else { - $j--; + break; } } + if ($non_traite == 0) { + echo "

Aucun ticket non traité

"; + } ?>
diff --git a/referant/js/edit.js b/referant/js/edit.js index 88558d3..153c425 100644 --- a/referant/js/edit.js +++ b/referant/js/edit.js @@ -38,7 +38,6 @@ function Edit(clas) { data.append('value', JSON.stringify(value)); xhr.onreadystatechange = function() { if (this.readyState == 4 && this.status == 200) { - console.log(this.response); for (let i=1; i<11; 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) { + alert(this.responseText); + } + }; + xhr.open('POST', 'cible/delete.php', true); + xhr.responseType = 'text'; + xhr.setRequestHeader("Content-type", "application/x-www-form-urlencoded"); + xhr.send("id=" + encodeURI(clas)); +} diff --git a/referant/liste.php b/referant/liste.php index cc71c64..5db6f8b 100755 --- a/referant/liste.php +++ b/referant/liste.php @@ -10,10 +10,13 @@ include '../sessions/session_restraintes.php'; + + + - + @@ -36,10 +39,19 @@ include '../sessions/session_restraintes.php'; $bdd = new SQLite3('../database/ticket_panne.db', SQLITE3_OPEN_READWRITE); $reponse = $bdd->query("SELECT * FROM pannes ORDER BY ID"); - + $non_traite = 0; while ($line = $reponse->fetchArray()) { - $class = $line[0]; - include 'include/line.php'; + if (isset($line['traitement'])) { + $non_traite ++; + $class = $line[0]; + include 'include/line.php'; + } + else { + break; + } + } + if ($non_traite == 0) { + echo "

Aucun ticket dans la base

"; } ?> diff --git a/referant/search.php b/referant/search.php index 4bb8ec4..2841bc5 100755 --- a/referant/search.php +++ b/referant/search.php @@ -12,6 +12,7 @@ include '../sessions/session_restraintes.php'; +

Recherche :

@@ -42,7 +43,7 @@ include '../sessions/session_restraintes.php';
TicketTicket
- + diff --git a/sass/main.scss b/sass/main.scss index ae676f9..13518d3 100644 --- a/sass/main.scss +++ b/sass/main.scss @@ -13,8 +13,14 @@ body { z-index: 1; font-family: monofonto; background-color: $light-grey; - margin: 20px; + margin: 143px 20px; text-align: center; + &>a { + position: absolute; + left: 20px; + top: 20px; + margin: auto; + } .logo { display: block; } @@ -190,6 +196,7 @@ form { background-color: $light-grey; border: 1px solid $dark-grey; + width: 1%; min-width: 20px; border-radius: 5px; @@ -270,10 +277,63 @@ form { } + +.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; + &: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 { border: 3px solid $bordeau; background-color: $light-grey; - color: $bordeau; font-weight: bold; text-decoration: none; transition: .5s; @@ -285,10 +345,11 @@ form { width: 3rem; border-radius: 5px; margin: 5px; + color: $dark-grey; } &--large { + color: $bordeau; display: inline-block; - width: 6%; margin-bottom: 3%; padding: 10px 40px; border-radius: 20px;