From 3c828cce0362c69f7395e84e0f929cbe527ae6f2 Mon Sep 17 00:00:00 2001
From: "barraux.a"
Date: Sun, 24 Oct 2021 00:10:09 +0200
Subject: [PATCH] =?UTF-8?q?ajout=20de=20la=20partie=20r=C3=A9f=C3=A9rent?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
img/check.png | Bin
img/excla.png | Bin
img/int.png | Bin
img/int_hov.png | Bin
img/logo_PC.png | Bin
prof/cible.php | 22 ++++++
prof/include/champ.php | 13 ++++
prof/index.php | 150 ++++++++++++++++++++++++++++++++++++++
prof/script.js | 62 ++++++++++++++++
prof/stylepage.css | 145 ++++++++++++++++++++++++++++++++++++
referant/cible/script.js | 19 +++++
referant/cible/search.php | 7 ++
referant/include/menu.php | 6 ++
referant/include/nav.php | 10 +++
referant/index.php | 8 ++
referant/search.php | 16 ++++
referant/stylepage.css | 112 ++++++++++++++++++++++++++++
17 files changed, 570 insertions(+)
mode change 100644 => 100755 img/check.png
mode change 100644 => 100755 img/excla.png
mode change 100644 => 100755 img/int.png
mode change 100644 => 100755 img/int_hov.png
mode change 100644 => 100755 img/logo_PC.png
create mode 100755 prof/cible.php
create mode 100755 prof/include/champ.php
create mode 100755 prof/index.php
create mode 100755 prof/script.js
create mode 100755 prof/stylepage.css
create mode 100644 referant/cible/script.js
create mode 100644 referant/cible/search.php
create mode 100644 referant/include/menu.php
create mode 100644 referant/include/nav.php
create mode 100755 referant/index.php
create mode 100755 referant/search.php
create mode 100755 referant/stylepage.css
diff --git a/img/check.png b/img/check.png
old mode 100644
new mode 100755
diff --git a/img/excla.png b/img/excla.png
old mode 100644
new mode 100755
diff --git a/img/int.png b/img/int.png
old mode 100644
new mode 100755
diff --git a/img/int_hov.png b/img/int_hov.png
old mode 100644
new mode 100755
diff --git a/img/logo_PC.png b/img/logo_PC.png
old mode 100644
new mode 100755
diff --git a/prof/cible.php b/prof/cible.php
new file mode 100755
index 0000000..86d2c29
--- /dev/null
+++ b/prof/cible.php
@@ -0,0 +1,22 @@
+prepare('INSERT INTO pannes(dates, details, lieu, salle, pos, materiel, marque, model, nserie, demandeur, traitement) VALUES(:dates, :details, :lieu, :salle, :pos, :materiel, :marque, :model, :nserie, :demandeur, :traitement)');
+
+$req->execute(array(
+ 'dates' => $_POST['dates'],
+ 'details' => $_POST['details'],
+ 'lieu' => $_POST['lieu'],
+ 'salle' => $_POST['salle'],
+ 'pos' => $_POST['pos'],
+ 'materiel' => $_POST['materiel'],
+ 'marque' => $_POST['marque'],
+ 'model' => $_POST['model'],
+ 'nserie' => $_POST['nserie'],
+ 'demandeur' => $_POST['demandeur'],
+ 'traitement' => 0
+ ));
+
+echo 'Votre ticket à bien été pris en compte';
+?>
diff --git a/prof/include/champ.php b/prof/include/champ.php
new file mode 100755
index 0000000..0447a4d
--- /dev/null
+++ b/prof/include/champ.php
@@ -0,0 +1,13 @@
+ ',$titre,' : ';
+if ($help) {
+ echo '';
+}
+echo '
+
+
+
+
+
+ Error: ',$error,'';
+?>
diff --git a/prof/index.php b/prof/index.php
new file mode 100755
index 0000000..71fa7e2
--- /dev/null
+++ b/prof/index.php
@@ -0,0 +1,150 @@
+
+
+
+
+ Tickets de panne
+
+
+
+
+
+
+ site référant
+
+ Formulaire de panne informatique
+
+
+
+
diff --git a/prof/script.js b/prof/script.js
new file mode 100755
index 0000000..d39b5c6
--- /dev/null
+++ b/prof/script.js
@@ -0,0 +1,62 @@
+const button = document.getElementById('submit');
+const page = document.getElementById('page');
+
+const check = document.getElementsByClassName('check');
+const excla = document.getElementsByClassName('excla');
+const entry = document.getElementsByClassName('entry');
+const help = document.getElementsByClassName('help');
+
+
+document.getElementById("form").addEventListener('submit', function(e) {
+ e.preventDefault();
+ if (checkInputs() == true) {
+ console.log('check');
+ var data = new FormData(this);
+
+ var xhr = new XMLHttpRequest();
+
+ xhr.onreadystatechange = function() {
+ if (this.readyState == 4 && this.status == 200) {
+ console.log(this.response);
+ } else if (this.readyState == 4) {
+ alert('uhe erreur est survenue...');
+ }
+ };
+ xhr.open('POST', 'cible.php', true);
+ xhr.send(data);
+ }
+});
+
+function displayHelp(id) {
+ id.style.display = 'block';
+}
+
+function hideHelp(id) {
+ id.style.display = 'none';
+}
+
+function checkInputs() {
+ let success = true;
+ for (let i=0; i < (entry.length - 1) ; i++) {
+ if (entry[i].value == '') {
+ setError(i);
+ success = false;
+ }
+ else {
+ setSuccess(i);
+ }
+ }
+ return success;
+}
+
+function setError(indice) {
+ check[indice].style.display = 'none';
+ excla[indice].style.display = 'block';
+ document.getElementsByTagName('small')[indice].style.display = 'block';
+}
+
+function setSuccess(indice) {
+ check[indice].style.display = 'block';
+ excla[indice].style.display = 'none';
+ document.getElementsByTagName('small')[indice].style.display = 'none';
+}
diff --git a/prof/stylepage.css b/prof/stylepage.css
new file mode 100755
index 0000000..5421d79
--- /dev/null
+++ b/prof/stylepage.css
@@ -0,0 +1,145 @@
+head{
+ display: inline-table;
+}
+
+a{
+ color: #2ecc71;
+}
+
+body{
+ z-index: 1;
+ background-color: #e5e5e5;
+ margin: 20px;
+ text-align: center;
+}
+
+.logo{
+ display: block;
+}
+
+h1{
+ margin: 40px;
+ font-weight: bold;
+ color: #454545;
+}
+
+p{
+ font-weight: bold;
+ color: #454444;
+ font-size: 20px;
+ height: 20px;
+}
+
+form{
+ width: 400px;
+ position: relative;
+ background-color: #ffffff;
+ display: block;
+ margin: auto;
+ border-radius: 30px;
+ padding: 20px;
+}
+
+.container-champ{
+ position: relative;
+}
+
+.container-champ small{
+ display: none;
+ color: red;
+}
+
+.champ{
+ background-color: inherit;
+ display: flex;
+ position: relative;
+ text-decoration-line: none;
+ flex-direction: row-reverse;
+ text-align: center;
+ color: #454444;
+ display: block;
+ margin: 10px auto;
+ border: 4px solid #4e4d4d;
+ padding: 10px 10px;
+ width: 200px;
+ border-radius: 30px;
+ transition: 0.25s;
+}
+
+.entry{
+ border: none;
+ resize: none;
+ outline: none;
+ width: 100%;
+ text-align: inherit;
+ background-color: inherit;
+ -webkit-appearance: none;
+ -moz-appearance: none;
+ appearance: none;
+}
+
+.champ:focus, .champ:hover{
+ width: 300px;
+ border-color: #ac2a8d;
+ background-color: #dddddd;
+}
+
+.champ img{
+ display: none;
+ position: relative;
+ float: right;
+ width: 20px;
+ bottom: 20px;
+ right: 20px;
+}
+
+.submit{
+ background-color: inherit;
+ display: flex;
+ position: relative;
+ flex-direction: row-reverse;
+ text-align: center;
+ color: #454444;
+ display: block;
+ margin: 10px auto;
+ border: 4px solid #4e4d4d;
+ padding: 10px 10px;
+ width: 200px;
+ border-radius: 30px;
+ transition: 0.25s;
+}
+
+.submit:hover{
+ width: 250px;
+ background-color: #82E6AC;
+ border-color: #2ecc71;
+}
+
+.help{
+ display: none;
+ z-index: 2;
+ position: absolute;
+ width: 170px;
+ right: 0;
+ top: 30%;
+ border-radius: 30px;
+ padding: 15px;
+ margin: 0;
+ background-color: #dddddd;
+}
+
+.help * {
+ font-size: 14px;
+ width: 100%;
+}
+
+.help p{
+ position: relative;
+}
+
+code {
+ background-color: #aaa;
+ border-radius: 5px;
+ font-family: courier, monospace;
+ padding: 3px 5px;
+}
\ No newline at end of file
diff --git a/referant/cible/script.js b/referant/cible/script.js
new file mode 100644
index 0000000..420442f
--- /dev/null
+++ b/referant/cible/script.js
@@ -0,0 +1,19 @@
+document.getElementById('form').addEventListener('submit', function(e) {
+ e.preventDefault();
+
+ let data = new FormData(this);
+
+ let xhr = new XMLHttpRequest();
+ xhr.onreadystatechange = function() {
+ console.log(this.response);
+ if (this.readyState == 4 && this.status == 200) {
+ } else if (this.readyState == 4) {
+ alert('uhe erreur est survenue...');
+ }
+ };
+ xhr.open('POST', 'cible/search.php', true);
+ xhr.send(data);
+ let p = document.createElement('p');
+ p.textContent = 'hzllo';
+ document.getElementById('corps').appendChild(p);
+});
\ No newline at end of file
diff --git a/referant/cible/search.php b/referant/cible/search.php
new file mode 100644
index 0000000..7119bed
--- /dev/null
+++ b/referant/cible/search.php
@@ -0,0 +1,7 @@
+query("SELECT * FROM pannes ORDER BY ID");
+
+print_r($reponse -> fetch($_POST['id']));
+?>
diff --git a/referant/include/menu.php b/referant/include/menu.php
new file mode 100644
index 0000000..3380e2f
--- /dev/null
+++ b/referant/include/menu.php
@@ -0,0 +1,6 @@
+
+
+ Admin ticket
+
+
+
diff --git a/referant/include/nav.php b/referant/include/nav.php
new file mode 100644
index 0000000..3047a49
--- /dev/null
+++ b/referant/include/nav.php
@@ -0,0 +1,10 @@
+
diff --git a/referant/index.php b/referant/index.php
new file mode 100755
index 0000000..9ca3073
--- /dev/null
+++ b/referant/index.php
@@ -0,0 +1,8 @@
+
+
+
+
+ client
+
+
+
diff --git a/referant/search.php b/referant/search.php
new file mode 100755
index 0000000..a2896f2
--- /dev/null
+++ b/referant/search.php
@@ -0,0 +1,16 @@
+
+
+
+
+
+
+
+
+
diff --git a/referant/stylepage.css b/referant/stylepage.css
new file mode 100755
index 0000000..7b909cf
--- /dev/null
+++ b/referant/stylepage.css
@@ -0,0 +1,112 @@
+body{
+ z-index: 1;
+ background-color: #e5e5e5;
+ margin: 20px;
+ text-align: center;
+}
+
+nav{
+ width: 80%;
+ margin-left: 10%;
+ background-color: #84878C; /*couleur nav entière*/
+ border-radius: 20px;
+}
+
+nav > ul{
+ margin-left: auto;
+ margin-right: auto;
+ padding: 0px;
+ width: 60%;
+}
+
+nav > ul::after{
+ content: "";
+ display: block;
+ clear: both;
+}
+
+nav > ul > li{
+ width: 25%;
+ float: left;
+ position: relative;
+ text-align: center;
+}
+
+nav> ul > li > a{
+ font-size: 100%;
+ padding-top: 10px;
+ padding-bottom: 10px;
+ color: #eee;
+}
+
+nav li{
+ list-style-type: none;
+}
+
+nav a{
+ display: inline-block;
+ text-decoration: none;
+}
+
+.menu:hover{
+ background-color: #59184E;
+ border-radius: 10px;
+}
+
+.menu:hover > a{
+ color: #fff; /*texte quand on passe la souris un bouton du menu*/
+ font-weight: bold;
+}
+
+.logo{
+ display: block;
+}
+
+.champ{
+ background-color: inherit;
+ position: relative;
+ text-align: center;
+ color: #454444;
+ display: block;
+ margin: 10px auto;
+ border: 4px solid #4e4d4d;
+ padding: 40px 40px;
+ width: 60%;
+ border-radius: 80px;
+ transition: 0.25s;
+}
+
+.champ:focus, .champ:hover{
+ border-color: #ac2a8d;
+ background-color: #dddddd;
+}
+
+.champ input{
+ border: none;
+ outline: none;
+ font-size: 3em;
+ color: #aaa;
+ width: 100%;
+ text-align: inherit;
+ background-color: inherit;
+}
+
+.submit{
+ background-color: inherit;
+ position: relative;
+ text-align: center;
+ color: #454444;
+ display: block;
+ margin: 10px auto;
+ border: 4px solid #4e4d4d;
+ padding: 10px 10px;
+ width: 200px;
+ border-radius: 30px;
+ transition: 0.25s;
+}
+
+.submit:hover{
+ width: 250px;
+ background-color: #82E6AC;
+ border-color: #2ecc71;
+}