Merge branch 'master' of https://codefirst.iut.uca.fr/git/nathan.boileau/Scripted
continuous-integration/drone/push Build is passing Details

ServeurDeTest
johan 2 years ago
commit f04f19a0be

Binary file not shown.

Binary file not shown.

@ -1,24 +0,0 @@
{
"version": "0.2.0",
"configurations": [
{
"name": "C/C++ Runner: Debug Session",
"type": "cppdbg",
"request": "launch",
"args": [],
"stopAtEntry": false,
"externalConsole": true,
"cwd": "c:/wamp64/www/Scripted",
"program": "c:/wamp64/www/Scripted/build/Debug/outDebug",
"MIMode": "gdb",
"miDebuggerPath": "gdb",
"setupCommands": [
{
"description": "Enable pretty-printing for gdb",
"text": "-enable-pretty-printing",
"ignoreFailures": true
}
]
}
]
}

@ -1,36 +0,0 @@
{
"C_Cpp_Runner.cCompilerPath": "gcc",
"C_Cpp_Runner.cppCompilerPath": "g++",
"C_Cpp_Runner.debuggerPath": "gdb",
"C_Cpp_Runner.cStandard": "",
"C_Cpp_Runner.cppStandard": "",
"C_Cpp_Runner.msvcBatchPath": "",
"C_Cpp_Runner.useMsvc": false,
"C_Cpp_Runner.warnings": [
"-Wall",
"-Wextra",
"-Wpedantic",
"-Wshadow",
"-Wformat=2",
"-Wconversion",
"-Wnull-dereference",
"-Wsign-conversion"
],
"C_Cpp_Runner.enableWarnings": true,
"C_Cpp_Runner.warningsAsError": false,
"C_Cpp_Runner.compilerArgs": [],
"C_Cpp_Runner.linkerArgs": [],
"C_Cpp_Runner.includePaths": [],
"C_Cpp_Runner.includeSearch": [
"*",
"**/*"
],
"C_Cpp_Runner.excludeSearch": [
"**/build",
"**/build/**",
"**/.*",
"**/.*/**",
"**/.vscode",
"**/.vscode/**"
]
}

@ -1,2 +0,0 @@
php_flag display_errors on
php_value error_reporting E_ALL

@ -1,3 +0,0 @@
display_errors = On
log_errors = Off
error_reporting = E_ALL & E_NOTICE & E_DEPRECATED & E_STRICT & E_WARNING

@ -90,6 +90,9 @@ class AdminController extends UserController
case "deleteEnigme": case "deleteEnigme":
$this->deleteEnigme(); $this->deleteEnigme();
break; break;
case "modifOrdre":
$this->modifOrdre();
break;
default: default:
$error = "Action non valide"; $error = "Action non valide";
require($rep . $vues['erreur']); require($rep . $vues['erreur']);
@ -242,6 +245,24 @@ class AdminController extends UserController
require($rep . $vues['erreur']); require($rep . $vues['erreur']);
} }
} }
public function modifOrdre(){
try{
global $rep, $vues;
$model = new AdminModel();
$lesOrdres = [];
$lesEnigmes=$model->getEnigmesSolo();
foreach ($lesEnigmes as $enigme) {
$lesOrdres[] = array($enigme->getIdEnigme(),$_POST['ordre'.$enigme->getIdEnigme()]);
}
$model->modifOrdre($lesOrdres);
echo '<script>alert("L\'ordre a bien été modifier.");</script>';
$this->goToSeeOrdre();
}
catch (Exception $e) {
$error = $e->getMessage();
require($rep . $vues['erreur']);
}
}
public function addNewEnigmeSolo() public function addNewEnigmeSolo()
{ {

@ -86,4 +86,13 @@ async function submit(){
} }
return $enigme; return $enigme;
} }
public function modifOrdre(array $lesOrdres){
$i = 1;
foreach ($lesOrdres as $ordre){
$enigme = $this->enigme_gateway->findById($ordre)[0];
$enigme->setOrdre($i);
$this->enigme_gateway->update($enigme);
$i++;
}
}
} }

@ -1,232 +1,194 @@
@font-face { /*Fonts CSS */
font-family: Centra;
src: url('../../assets/fonts/CentraNo2-Bold.ttf');
font-weight: 700;
}
@font-face { @font-face {
font-family: Centra; font-family: Fauna;
src: url('../../assets/fonts/CentraNo2-Regular.ttf'); src: url("../../assets/fonts/Fauna.ttf");
font-weight: 500;
} }
@font-face { @font-face {
font-family: Centra; font-family: Equinox;
src: url('../../assets/fonts/CentraNo2-Light.ttf'); src: url("../../assets/fonts/Equinox.otf");
font-weight: 400;
} }
/* End Fonts CSS */
p, a, li, button, ul { body {
margin: 0; min-height: 100vh;
padding: 0; font-family: "Equinox", sans-serif;
line-height: normal; color: white;
text-decoration: none !important; scroll-behavior: smooth;
height: 100vh;
background-image: url("../../assets/img/ImgMain2.png");
background-position: center center;
background-attachment: fixed;
background-repeat: no-repeat;
background-size: cover;
background-color: #000;
} }
a:hover { .login-box {
text-decoration: none !important; position: absolute;
top: 50%;
left: 50%;
width: 400px;
padding: 40px;
background: rgba(0, 0, 0, 0.6);
box-sizing: border-box;
box-shadow: 0 15px 25px rgba(0, 0, 0, 0.6);
border-radius: 10px;
transform: translate(-50%, -50%);
-webkit-transform: translate(-50%, -50%);
-moz-transform: translate(-50%, -50%);
-ms-transform: translate(-50%, -50%);
-o-transform: translate(-50%, -50%);
} }
input:focus, textarea:focus, select:focus { .login-box .user-box input {
width: 100%;
padding: 10px 0;
font-size: 16px;
color: #fff;
border: none;
border-bottom: 1px solid #fff;
outline: none; outline: none;
background: transparent;
} }
body { .login-box .user-box label {
margin:0; position: absolute;
padding:0; top: 0;
font-family: 'Raleway', sans-serif !important; left: 0;
font-size: 16px;
color: #fff;
pointer-events: none;
transition: 0.5s;
-webkit-transition: 0.5s;
-moz-transition: 0.5s;
-ms-transition: 0.5s;
-o-transition: 0.5s;
} }
.login-box .user-box input:focus ~ label,
.login-box .user-box input:valid ~ label {
top: -20px;
left: 0;
color: #6090d1;
font-size: 12px;
}
.main{ .login-box form a,
background-image: url(../../assets/img/BackgroundLogIn.png); .login-box form button {
scroll-behavior: smooth; position: relative;
height: 100vh; display: inline-flex;
background-position: center center; justify-content: center;
background-color: #464646; padding: 10px 0px;
background-attachment: fixed; color: #6090d1;
background-repeat: no-repeat; background: transparent;
background-size: cover; border: none;
font-size: 16px;
text-decoration: none;
text-transform: uppercase;
overflow: hidden;
letter-spacing: 3px;
transition: all 0.5s;
-webkit-transition: all 0.5s;
-moz-transition: all 0.5s;
-ms-transition: all 0.5s;
-o-transition: all 0.5s;
} }
.login-box {
position: absolute;
top: 50%;
left: 50%;
width: 400px;
padding: 40px;
transform: translate(-50%, -50%);
background: rgba(0,0,0,0.6);
box-sizing: border-box;
box-shadow: 0 15px 25px rgba(0,0,0,.6);
border-radius: 10px;
}
.login-box h2 {
margin: 0 0 30px;
padding: 0;
color: #fff;
text-transform: uppercase;
text-align: center;
}
.login-box .user-box {
position: relative;
}
.login-box .user-box input {
width: 100%;
padding: 10px 0;
font-size: 16px;
color: #fff;
margin-bottom: 30px;
border: none;
border-bottom: 1px solid #fff;
outline: none;
background: transparent;
}
.login-box .user-box label {
position: absolute;
top:0;
left: 0;
padding: 10px 0;
font-size: 16px;
color: #fff;
pointer-events: none;
transition: .5s;
}
.login-box .user-box input:focus ~ label,
.login-box .user-box input:valid ~ label {
top: -20px;
left: 0;
color: #6090d1 ;
font-size: 12px;
}
.login-box form a, .login-box form button {
margin-left: 10px;
position: relative;
width: 120px;
display: inline-flex;
justify-content: center;
padding: 10px 0px;
color: #6090d1;
background: transparent;
border: none;
font-size: 16px;
text-decoration: none;
text-transform: uppercase;
overflow: hidden;
transition: .5s;
margin-top: 40px;
letter-spacing: 3px
}
.login-box form .right{ .login-box a:hover,
float: right; .login-box button:hover {
margin-right: 10px; background: #6090d1;
color: #fff;
border-radius: 5px;
box-shadow: 0 0 5px #6090d1, 0 0 25px #6090d1, 0 0 50px #6090d1,
0 0 100px #6090d1;
} }
.login-box a span,
.login-box a:hover, .login-box button:hover { .login-box button span {
background: #6090d1; position: absolute;
color: #fff; display: block;
border-radius: 5px; }
box-shadow: 0 0 5px #6090d1,
0 0 25px #6090d1, .login-box a span:nth-child(1),
0 0 50px #6090d1, .login-box button span:nth-child(1) {
0 0 100px #6090d1; top: 0;
} left: -100%;
width: 100%;
.login-box a span, .login-box button span { height: 2px;
position: absolute; background: linear-gradient(90deg, transparent, #6090d1);
display: block; animation: btn-anim1 1s linear infinite;
} }
.login-box a span:nth-child(1), .login-box button span:nth-child(1) { @keyframes btn-anim1 {
top: 0; 0% {
left: -100%; left: -100%;
width: 100%;
height: 2px;
background: linear-gradient(90deg, transparent, #6090d1);
animation: btn-anim1 1s linear infinite;
} }
50%,
@keyframes btn-anim1 { 100% {
0% { left: 100%;
left: -100%;
}
50%,100% {
left: 100%;
}
} }
}
.login-box a span:nth-child(2), .login-box button span:nth-child(2) {
.login-box a span:nth-child(2),
.login-box button span:nth-child(2) {
top: -100%;
right: 0;
width: 2px;
height: 100%;
background: linear-gradient(180deg, transparent, #6090d1);
animation: btn-anim2 1s linear infinite;
animation-delay: 0.25s;
}
@keyframes btn-anim2 {
0% {
top: -100%; top: -100%;
right: 0;
width: 2px;
height: 100%;
background: linear-gradient(180deg, transparent, #6090d1);
animation: btn-anim2 1s linear infinite;
animation-delay: .25s
} }
50%,
@keyframes btn-anim2 { 100% {
0% { top: 100%;
top: -100%;
}
50%,100% {
top: 100%;
}
} }
}
.login-box a span:nth-child(3), .login-box button span:nth-child(3) {
bottom: 0; .login-box a span:nth-child(3),
.login-box button span:nth-child(3) {
bottom: 0;
right: -100%;
width: 100%;
height: 2px;
background: linear-gradient(270deg, transparent, #6090d1);
animation: btn-anim3 1s linear infinite;
animation-delay: 0.5s;
}
@keyframes btn-anim3 {
0% {
right: -100%; right: -100%;
width: 100%;
height: 2px;
background: linear-gradient(270deg, transparent, #6090d1);
animation: btn-anim3 1s linear infinite;
animation-delay: .5s
}
@keyframes btn-anim3 {
0% {
right: -100%;
}
50%,100% {
right: 100%;
}
} }
50%,
.login-box a span:nth-child(4), .login-box button span:nth-child(4) { 100% {
bottom: -100%; right: 100%;
left: 0;
width: 2px;
height: 100%;
background: linear-gradient(360deg, transparent, #6090d1);
animation: btn-anim4 1s linear infinite;
animation-delay: .75s
} }
@keyframes btn-anim4 {
0% {
bottom: -100%;
}
50%,100% {
bottom: 100%;
}
}
.top{
display: flex;
} }
.material-icons{ .login-box a span:nth-child(4),
margin-bottom: 10%; .login-box button span:nth-child(4) {
bottom: -100%;
left: 0;
width: 2px;
height: 100%;
background: linear-gradient(360deg, transparent, #6090d1);
animation: btn-anim4 1s linear infinite;
animation-delay: 0.75s;
} }
.top h2{ @keyframes btn-anim4 {
margin-left: 25%; 0% {
margin-top: 2% ; bottom: -100%;
} }
50%,
100% {
bottom: 100%;
}
}

@ -1,61 +0,0 @@
const form = document.getElementById('form');
const username = document.getElementById('username');
const password = document.getElementById('password');
form.addEventListener('submit', e => {
e.preventDefault();
checkInputs();
printForm();
});
const setErrorFor = (element, message) => {
const inputControl = element.parentElement;
inputControl.classList.add('error');
inputControl.classList.remove('success');
}
const setSuccessFor = (element) => {
const inputControl = element.parentElement;
inputControl.classList.add('success');
inputControl.classList.remove('error');
};
function checkInputs() {
// trim to remove the whitespaces
const usernameValue = username.value.trim();
const passwordValue = password.value.trim();
if (usernameValue === '') {
setErrorFor(username, 'Username cannot be blank');
}
else {
setSuccessFor(username);
}
if (passwordValue === '') {
setErrorFor(password, 'Password cannot be blank');
}
else if(passwordValue.length < 8) {
setErrorFor(password, 'Password must be at least 8 characters');
}
else {
setSuccessFor(password);
}
if (usernameValue === 'admin' && passwordValue === 'admin') {
window.location.href = 'http://localhost:8080/WEB/Welcome.html';
}
}
//Open a new blank page and print the usename and password
function printForm() {
var myWindow = window.open("", "MsgWindow", "width=200,height=100");
myWindow.document.write("Username: " + username.value + "<br>Password: " + password.value);
}

@ -21,7 +21,7 @@
<div class="container"> <div class="container">
<div class="row"> <div class="row">
<div class="col"> <div class="col">
<a class="btn btn-primary m-3" href="index.php?action=goToSeeOrdre" role="button">Retour</a> <a class="btn btn-primary m-3" href="index.php?action=modifOrdre" role="button">Retour</a>
<h1>Ordre des énigmes</h1> <h1>Ordre des énigmes</h1>
</div> </div>
</div> </div>
@ -40,7 +40,7 @@
foreach ($lesEnigmes as $enigme) { foreach ($lesEnigmes as $enigme) {
echo "<tr>"; echo "<tr>";
echo "<td>".$enigme->getNom()."</td>"; echo "<td>".$enigme->getNom()."</td>";
echo '<td><input type="number" name="ordre'. $enigme->getNom() .'" value="'. $enigme->getOrdre() .'"></td>'; echo '<td><input type="number" name="ordre'. $enigme->getIdEnigme() .'" value="'. $enigme->getOrdre() .'"></td>';
echo "</tr>"; echo "</tr>";
} }
?> ?>

@ -1,47 +1,73 @@
<!DOCTYPE html> <!DOCTYPE html>
<html lang="fr"> <html lang="fr">
<head> <head>
<meta charset="UTF-8"> <meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta name="viewport" content="width=device-width, initial-scale=1.0" />
<link rel="stylesheet" href="./View/src/CSS/LogSign.css"> <link
<link rel="stylesheet" href="https://fonts.googleapis.com/icon?family=Material+Icons"> rel="stylesheet"
<script defer src="../../JS/Login.js"></script> href="https://stackpath.bootstrapcdn.com/bootstrap/5.0.0-alpha1/css/bootstrap.min.css"
integrity="sha384-r4NyP46KrjDleawBgD5tp8Y7UzmLA05oM1iAEQ17CSuDqnUK2+k9luXQOfXJCJ4I"
crossorigin="anonymous"
/>
<script
src="https://cdn.jsdelivr.net/npm/popper.js@1.16.0/dist/umd/popper.min.js"
integrity="sha384-Q6E9RHvbIyZFJoft+2mJbHaEWldlvI9IOYy5n3zV9zzTtmI3UksdQRVvoxMfooAo"
crossorigin="anonymous"
></script>
<script
src="https://stackpath.bootstrapcdn.com/bootstrap/5.0.0-alpha1/js/bootstrap.min.js"
integrity="sha384-oesi62hOLfzrys4LxRF63OJCXdXDipiYWBnvTl9Y9/TRlw5xlKIEHpNyvvDShgf/"
crossorigin="anonymous"
></script>
<link
rel="stylesheet"
href="https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL,GRAD@48,400,0,0"
/>
<link
rel="stylesheet"
href="https://cdnjs.cloudflare.com/ajax/libs/animate.css/4.1.1/animate.min.css"
/>
<link rel="stylesheet" href="./View/src/CSS/LogSign.css" />
<link
rel="stylesheet"
href="https://fonts.googleapis.com/icon?family=Material+Icons"
/>
<title>Login</title> <title>Login</title>
</head> </head>
<body> <body>
<div class="main"> <div class="container user-select-none">
<div class="login-box" id="form"> <div class="login-box col-12" id="form">
<div class="top"> <div class="row mb-4">
<h2>Sign up</h2> <h2 class="text-uppercase font-weight-bold text-center">Login</h2>
</div> </div>
<form action="index.php?action=login" method="POST"> <form action="index.php?action=login" method="POST">
<div class="user-box"> <div class="user-box mb-5 position-relative">
<input type="text" id="email" name="email" required=""> <input type="text" id="email" name="email" required="" />
<label>Email</label> <label class="py-1">Email</label>
</div> </div>
<div class="user-box"> <div class="user-box mb-3 position-relative">
<input type="password" id="password" name="password" required=""> <input type="password" id="password" name="password" required="" />
<label>Password</label> <label>Password</label>
</div> </div>
<div> <div class="d-flex justify-content-around mt-5">
<button class="left" type="submit"> <button class="py-2 px-3" type="submit">
<span></span> <span></span>
<span></span> <span></span>
<span></span> <span></span>
<span></span> <span></span>
Submit Submit
</button> </button>
<a href="index.php?action=goToSignUp" class="right"> <a href="index.php?action=goToSignUp" class="right py-2 px-3">
<span></span> <span></span>
<span></span> <span></span>
<span></span> <span></span>
<span></span> <span></span>
Sign up Sign up
</a> </a>
</div> </div>
</form> </form>
</div>
</div> </div>
</div> </body>
</body> </html>
</html>

@ -47,7 +47,7 @@
<button <button
class="d-flex p-0 user-select-none" class="d-flex p-0 user-select-none"
id="btnProfil" id="btnProfil"
style="background: transparent; border: none; z-index: 10" style="background: transparent; border: none; z-index: 10; height: fit-content;"
onclick="displayProfil()" onclick="displayProfil()"
> >
<span class="material-symbols-outlined p-1 neonBg" id="profilIcon"> <span class="material-symbols-outlined p-1 neonBg" id="profilIcon">
@ -150,7 +150,7 @@
<span id="text">ADMIN</span> <span id="text">ADMIN</span>
</a> </a>
<a class="logButton"> <a class="logButton" href="index.php?action=logout">
<span class="circle" aria-hidden="true"> <span class="circle" aria-hidden="true">
<span class="icon arrow"></span> <span class="icon arrow"></span>
</span> </span>
@ -160,7 +160,7 @@
} }
else { else {
echo '<div class="d-flex justify-content-center align-self-center p-0 m-0" id="container">'; echo '<div class="d-flex justify-content-center align-self-center p-0 m-0" id="container">';
echo '<a class="logButton" href="index?action=goToLogin">'; echo '<a class="logButton" href="index.php?action=goToLogin">';
echo ' <span class="circle" aria-hidden="true">'; echo ' <span class="circle" aria-hidden="true">';
echo ' <span class="icon arrow"></span>'; echo ' <span class="icon arrow"></span>';
echo ' </span>'; echo ' </span>';

Loading…
Cancel
Save