Browse Source

factorisation de fichiers et de code

master
BARRAUX Arthur 3 years ago
parent
commit
6be4289013
  1. 3
      login/index.php
  2. 0
      prof/cible/index.php
  3. 6
      prof/index.php
  4. 5
      prof/js/script.js
  5. 0
      referant/cible/ticket.sql
  6. 6
      referant/include/line.php
  7. 2
      referant/js/search.js
  8. 2
      referant/search.php
  9. 4
      session.php
  10. 4
      session_restraintes.php
  11. 7
      stylepage.css
  12. 0
      ticket.sql

3
login/index.php

@ -3,6 +3,7 @@
<head> <head>
<title>Login</title> <title>Login</title>
<link rel="stylesheet" href="../stylepage.css"> <link rel="stylesheet" href="../stylepage.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">
@ -28,4 +29,4 @@
</div> </div>
</form> </form>
</body> </body>
</html> </html>

0
prof/cible.php → prof/cible/index.php

6
prof/index.php

@ -8,9 +8,9 @@ include '../session.php';
<meta charset="utf-8"> <meta charset="utf-8">
<title>Tickets de panne</title> <title>Tickets de panne</title>
<link href="../stylepage.css" rel="stylesheet"> <link href="../stylepage.css" rel="stylesheet">
<script type="text/javascript" src="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"> <img class="logo" src="../img/logo_PC.png" alt="logo_PC" width="200px">
</head> </head>
<body id="page"> <body id="page">
<?php <?php
@ -21,7 +21,7 @@ include '../session.php';
<h1 id="titre"> <h1 id="titre">
Formulaire de panne informatique Formulaire de panne informatique
</h1> </h1>
<form id='form' method="POST" action="cible.php"> <form id='form' method="POST" action="cible/index.php">
<div class="container-champ"> <div class="container-champ">
<?php <?php
$titre = 'Date'; $titre = 'Date';

5
prof/script.js → prof/js/script.js

@ -1,9 +1,6 @@
const page = document.getElementById('page');
const check = document.getElementsByClassName('check'); const check = document.getElementsByClassName('check');
const excla = document.getElementsByClassName('excla'); const excla = document.getElementsByClassName('excla');
const entry = document.getElementsByClassName('entry'); const entry = document.getElementsByClassName('entry');
const help = document.getElementsByClassName('help');
document.getElementById("form").addEventListener('submit', function(e) { document.getElementById("form").addEventListener('submit', function(e) {
@ -20,7 +17,7 @@ document.getElementById("form").addEventListener('submit', function(e) {
alert('une erreur est survenue...'); alert('une erreur est survenue...');
} }
}; };
xhr.open('POST', 'cible.php', true); xhr.open('POST', 'cible/index.php', true);
xhr.send(data); xhr.send(data);
} }
}); });

0
referant/cible/ticket.sql

6
referant/include/line.php

@ -14,10 +14,10 @@ if (isset($line)) {
<td class=', $class , '>',$line[10],'</td>'; <td class=', $class , '>',$line[10],'</td>';
if ($line[11] == 1) { if ($line[11] == 1) {
echo '<td class=', $class , '><img src="../img/check.png" width="50%"></td>'; echo '<td class=', $class , '><img src="../img/check.png" width="40%"></td>';
} }
else { else {
echo '<td class=', $class , '><img src="../img/excla.png" width="50%"></td>'; echo '<td class=', $class , '><img src="../img/excla.png" width="40%"></td>';
} }
@ -44,7 +44,7 @@ else {
<td class=', $class , '></td> <td class=', $class , '></td>
<td class=', $class , '></td> <td class=', $class , '></td>
<td class=', $class , '></td> <td class=', $class , '></td>
<td class=', $class , '><img src="../img/check.png" width="50%"></td> <td class=', $class , '><img src="../img/check.png" width="40%"></td>
<td class=', $class , '> <td class=', $class , '>
<label class="switch"> <label class="switch">
<input class="checkbox" type="checkbox" onchange="Slider(\'',$class,'\')"> <input class="checkbox" type="checkbox" onchange="Slider(\'',$class,'\')">

2
referant/js/search.js

@ -19,7 +19,7 @@ document.getElementById('form').addEventListener('submit', function(e) {
else { else {
ticket[11].querySelector('img').src = "../img/excla.png"; ticket[11].querySelector('img').src = "../img/excla.png";
} }
document.getElementById('table-search').style.display = 'block'; document.getElementsByTagName('table')[0].style.display = 'block';
} }
else { else {
alert("Ce ticket n'existe pas"); alert("Ce ticket n'existe pas");

2
referant/search.php

@ -20,7 +20,7 @@ include '../session_restraintes.php';
<input id="submit" class="entry" type="submit"> <input id="submit" class="entry" type="submit">
</div> </div>
</form> </form>
<table id='table-search'> <table style="display: none;">
<thead> <thead>
<tr> <tr>
<th colspan="14">Ticket</th> <th colspan="14">Ticket</th>

4
session.php

@ -1,6 +1,6 @@
<?php <?php
session_start(); session_start();
if (!isset($_SESSION['login']) || !isset($_SESSION['pwd'])) { if (!isset($_SESSION['login']) || !isset($_SESSION['pwd'])) {
header('location: ../index.php'); header('location: ../login/index.php');
} }
?> ?>

4
session_restraintes.php

@ -1,6 +1,6 @@
<?php <?php
session_start(); session_start();
if ( !(isset($_SESSION['login']) && isset($_SESSION['pwd'])) && !($_SESSION['login'] == 'referant')) { if ( !(isset($_SESSION['login']) && isset($_SESSION['pwd'])) && !($_SESSION['login'] == 'referant')) {
header('location: ../index.php'); header('location: ../login/index.php');
} }
?> ?>

7
stylepage.css

@ -205,10 +205,6 @@ nav> ul > li > a{
/* Table */ /* Table */
#table-search{
display: none;
}
.table-title td{ .table-title td{
color: #ac2a8d; color: #ac2a8d;
font-weight: bold; font-weight: bold;
@ -231,9 +227,8 @@ td {
border-radius: 5px; border-radius: 5px;
text-align: center; text-align: center;
word-break: break-all;
color: #84878C; color: #84878C;
width: 7%;
} }
th{ th{

0
ticket.sql

Loading…
Cancel
Save