cssssssssss

This commit is contained in:
thaaoblues 2024-04-06 11:37:53 +02:00
parent c6321133c1
commit 17115415b0
12 changed files with 362 additions and 58 deletions

View file

@ -1,4 +1,4 @@
<?php
$page = str_replace(".php","",basename($_SERVER['SCRIPT_FILENAME']));
?>
<script src="js/<?=$page?>.js"></script>
<script type="text/javascript" src="js/<?=$page?>.js"></script>

View file

@ -1,5 +1,5 @@
<?php
header("Content-Security-Policy: default-src 'self'; connect-src 'self'; script-src 'self'; img-src 'self'; font-src 'self'; media-src 'self'; frame-src 'self'; sandbox allow-forms; object-src 'none'; frame-ancestors 'none'; form-action 'self'; base-uri 'self'; worker-src 'none'; manifest-src : 'none'; prefetch-src : 'none'; navigate-to 'self';")
//header("Content-Security-Policy: default-src 'self'; connect-src 'self'; script-src 'self'; img-src 'self'; font-src 'self'; media-src 'self'; frame-src 'self'; sandbox allow-forms; object-src 'none'; frame-ancestors 'none'; form-action 'self'; base-uri 'self'; worker-src 'none'; manifest-src : 'none'; prefetch-src : 'none'; navigate-to 'self';")
?>
<head>
<meta charset="UTF-8">
@ -8,6 +8,6 @@ header("Content-Security-Policy: default-src 'self'; connect-src 'self'; script-
$page = str_replace(".php","",basename($_SERVER['SCRIPT_FILENAME']));
?>
<title><?=$titre_page?></title>
<link rel="stylesheet" src="css/<?=$page?>.css">
<link rel="stylesheet" href="css/<?=$page?>.css">
</head>

View file

@ -11,10 +11,11 @@
*/
//include("session_verif.php");
include("session_verif.php");
include("bdd.php");
include('php-csrf.php');
$csrf = new CSRF();
@ -186,7 +187,7 @@
if(!$csrf->validate($context='televersement',$_POST["jeton-csrf"])){
echo( json_encode(["status"=> "2","msg"=>"jeton csrf manquant.".$_POST["jeton-csrf"]]) );
echo( json_encode(["status"=> "2","msg"=>"jeton csrf manquant ou invalide. ( contenu du champ : ".$_POST["jeton-csrf"]." )"]) );
break;
}

View file

@ -89,7 +89,7 @@ function saveFilesFromPost($postData,$id_ensemble) {
$i = 0;
var_dump($_FILES);
//var_dump($_FILES);
foreach ($_FILES as $file) {
@ -118,7 +118,7 @@ function saveFilesFromPost($postData,$id_ensemble) {
// Save the file
$f = fopen($file['tmp_name'],"r");
echo fread($f,filesize($file['tmp_name']));
//echo fread($f,filesize($file['tmp_name']));
fclose($f);

0
css/ens.css Normal file
View file

120
css/index.css Normal file
View file

@ -0,0 +1,120 @@
@media (hover: none) {
/* For mobile phones: */
.floating-action-btn{
position: fixed;
bottom: 30vh;
margin-left:5%;
padding: 10px;
padding-top: 0px;
width: fit-content;
text-align: left;
border-radius: 5px;
border-width: 2px;
font-weight:bolder;
text-decoration: none;
color: black;
border-bottom: 3px solid rgba(224, 54, 54, 0.482);
}
}
@media only screen and (min-width: 1000px) {
/* For desktop: */
.floating-action-btn{
position: fixed;
bottom: 5%;
margin-left:1%;
padding: 10px;
padding-top: 0px;
width: fit-content;
text-align: left;
border-radius: 5px;
border-width: 2px;
font-weight:bolder;
text-decoration: none;
color: black;
border-bottom: 3px solid rgba(224, 54, 54, 0.482);
}
}
.gros-titre{
font-size: larger;
font-weight: bolder;
}
.centre-vertical{
margin-top: auto;
margin-bottom: auto;
}
.centre-horizontal{
margin: auto;
justify-content: center;
}
.centre-txt{
text-align: center;
}
.etaler{
width: 100%;
}
.bulle-rouge{
width: fit-content;
padding-top: 5px;
padding-left: 5px;
padding-right: 5px;
padding-bottom: 5px;
background-color: rgba(255, 0, 0, 0.283);
border-radius: 5px;
border-width: 2px;
border-color: rgba(255, 0, 0, 0.283);
}
.button{
margin-top: 10px;
width: fit-content;
padding-top: 1%;
padding-left: 1%;
padding-right: 1%;
padding-bottom: 1%;
border-radius: 5px;
font-weight:bolder;
text-decoration: none;
color: black;
border-bottom: 3px solid rgba(224, 54, 54, 0.482);
border-top: 0px;
border-left: 0px;
border-right: 0px;
}
.color-red-tr{
background-color: rgba(224, 54, 54, 0.482);
border-color: rgba(224, 54, 54, 0.482);
}
.barre-recherche{
margin-top: 10px;
width: 80vw;
max-width: 800px;
border-radius: 15px;
border-width: 5px;
border-bottom: 3px solid rgba(224, 54, 54, 0.482);
background-color: rgba(224, 54, 54, 0.482);
padding: 20px;
}
.champ{
border-radius: 3px;
border: 0px;
background-color: transparent;
font-size: larger;
width: fit-content;
}
.champ:focus{
outline: none;
}

138
css/televerser.css Normal file
View file

@ -0,0 +1,138 @@
@media (hover: none) {
/* For mobile phones: */
.floating-action-btn{
/*position: fixed;
bottom: 30vh;
margin-left:5%;
padding: 10px;
padding-top: 0px;
width: fit-content;
text-align: left;
border-radius: 5px;
border-width: 2px;
font-weight:bolder;
text-decoration: none;
color: black;
border-bottom: 3px solid rgba(224, 54, 54, 0.482);
border-top: 0px;
border-left: 0px;
border-right: 0px;*/
visibility: hidden;
}
}
@media only screen and (min-width: 1000px) {
/* For desktop: */
.floating-action-btn{
position: fixed;
bottom: 5%;
margin-left:1%;
padding: 10px;
padding-top: 0px;
width: fit-content;
text-align: left;
border-radius: 5px;
border-width: 2px;
font-weight:bolder;
text-decoration: none;
color: black;
border-bottom: 3px solid rgba(224, 54, 54, 0.482);
border-top: 0px;
border-left: 0px;
border-right: 0px;
}
}
.gros-titre{
font-size: larger;
font-weight: bolder;
}
.centre-vertical{
margin-top: auto;
margin-bottom: auto;
}
.centre-horizontal{
margin: auto;
justify-content: center;
}
.centre-txt{
text-align: center;
}
.etaler{
width: 100%;
}
.bulle-rouge{
width: fit-content;
padding-top: 5px;
padding-left: 5px;
padding-right: 5px;
padding-bottom: 5px;
background-color: rgba(255, 0, 0, 0.283);
border-radius: 5px;
border-width: 2px;
border-color: rgba(255, 0, 0, 0.283);
}
.button{
margin-top: 10px;
width: fit-content;
padding-top: 1%;
padding-left: 1%;
padding-right: 1%;
padding-bottom: 1%;
border-radius: 5px;
font-weight:bolder;
text-decoration: none;
color: black;
border-bottom: 3px solid rgba(224, 54, 54, 0.482);
border-top: 0px;
border-left: 0px;
border-right: 0px;
}
.color-red-tr{
background-color: rgba(224, 54, 54, 0.482);
border-color: rgba(224, 54, 54, 0.482);
}
.color-green-tr{
background-color: rgba(71, 224, 54, 0.482);
border-color: rgba(71, 224, 54, 0.482);
}
.barre-recherche{
margin-top: 10px;
width: 80vw;
max-width: 800px;
border-radius: 15px;
border-width: 5px;
border-bottom: 3px solid rgba(224, 54, 54, 0.482);
background-color: rgba(224, 54, 54, 0.482);
padding: 20px;
}
.champ{
font-size: larger;
margin-top: 1vw;
}
.formulaire{
margin-top: 5vw;
width: 50vw;
margin-left: 25vw;
margin-right: 25vw;
}
.input-details-exo{
z-index: 1000;
position: relative;
font-size: larger;
margin-top: 1vw;
}

View file

@ -11,20 +11,40 @@
session_start();
?>
<button id="btn-connection">connection</button>
<button id="lien-deconnection">déconnection</button>
<div class="centre-horizontal bulle-rouge">
<pre class="centre-txt gros-titre">
__ ____ ___ _ _ /'/ ____ _ _ ___ __
/__\ ( _ \ / __)( )_( ) (_ _)( \( )/ __) /__\
/(__)\ ) /( (__ ) _ ( _)(_ ) ( \__ \ /(__)\
(__)(__)(_)\_) \___)(_) (_) (____)(_)\_)(___/(__)(__)
</pre>
</div>
<button class="button color-red-tr" id="btn-connection">connection</button>
<button class="button color-red-tr" id="btn-deconnection">déconnection</button>
<div id="user_status">
</div>
<div class="barre-recherche centre-horizontal">
<form id="recherche_form">
<input type="text" id="recherche_input" placeholder="Rechercher une fiche, annale ...">
<input type="text" id="themes_input" placeholder="themes (appuyez sur la touche entrée entre chaque thèmes)">
<input type="number" id="duree_input" placeholder="durée en minutes">
<input class="champ" type="text" id="recherche_input" placeholder="Rechercher une fiche, annale ...">
<input hidden class="champ" type="text" id="themes_input" placeholder="themes (appuyez sur la touche entrée entre chaque thèmes)">
<input hidden class="champ" type="number" id="duree_input" placeholder="durée en minutes">
</form>
</div>
<a href="televerser.php">Téléverser des documents</a>
<a href="televerser.php" class="color-red-tr floating-action-btn">
<pre> _
_| |_
|_ _| Téléverser des documents
|_|
</pre></a>
<div id="liste_resultats">

View file

@ -26,13 +26,13 @@ async function unauthenticate_user(){
async function rechercher(){
var req = document.getElementById("recherche_input").value;
var req = document.body.getElementById("recherche_input").value;
var themes = [];
Array.from(document.getElementsByClassName("theme")).forEach(function (el) {
Array.from(document.body.getElementsByClassName("theme")).forEach(function (el) {
// on encode en url pour pouvoir le passer dans la requete GET
themes.push(encodeURIComponent(el.innerText));
});
var duree =document.getElementById("duree_input").value
var duree =document.body.getElementById("duree_input").value
var url = "api.php/rechercher?req="+req;
@ -51,7 +51,7 @@ async function rechercher(){
data = await resp.json();
// vide d'abord les éléments présents dans la liste sur la page
document.getElementById("liste_resultats").innerHTML = "";
document.body.getElementById("liste_resultats").innerHTML = "";
if(data.status == 1){
data.resultats.forEach(doc => {

View file

@ -43,6 +43,7 @@ function televerser_fichiers() {
//csrf token
formData.append("jeton-csrf",jeton_csrf);
//alert(jeton_csrf);
// Append captured images as files to the FormData
const capturedImages = document.querySelectorAll('#selectedImages img');
@ -61,10 +62,13 @@ function televerser_fichiers() {
method: 'POST',
body: formData
})
.then(response => response.text())
.then(response => response.json())
.then(data => {
console.log(data);
// Handle the response from the server
if(data.status == 1){
alert("le document a bien été envoyé ! Merci de votre participation :D")
}else{
alert("Une erreur s'est produite lors de l'envoi de votre fichier : "+data.msg);
}
})
.catch(error => {
console.error('Error:', error);
@ -215,6 +219,7 @@ function init_date(){
document.getElementById("date_conception_input").setAttribute("value",today);
}
document.addEventListener("DOMContentLoaded", (event) => {
init_date();
document.getElementById("select_type").addEventListener("change", (event) => {

View file

@ -1,6 +1,6 @@
<?php
session_start();
/*
// Load the CAS lib
require_once("phpCAS-1.6.1/CAS.php");
@ -30,11 +30,13 @@ phpCAS::forceAuthentication();
// logout if desired
if (isset($_REQUEST['logout'])) {
phpCAS::logout();
}
}*/
function verifier_session(){
return json_encode(["status"=>1,"msg"=>"Bonjour ".phpCAS::getUser()." !"]);
//return json_encode(["status"=>1,"msg"=>"Bonjour ".phpCAS::getUser()." !"]);
return json_encode(["status"=>1,"msg"=>"Bonjour !"]);
}

View file

@ -6,46 +6,64 @@
?>
<body>
<?php
//include("session_verif.php");
include("session_verif.php");
include('php-csrf.php');
$csrf = new CSRF();
?>
<div class="centre-horizontal bulle-rouge">
<pre class="centre-txt gros-titre">
__ ____ ___ _ _ /'/ ____ _ _ ___ __
/__\ ( _ \ / __)( )_( ) (_ _)( \( )/ __) /__\
/(__)\ ) /( (__ ) _ ( _)(_ ) ( \__ \ /(__)\
(__)(__)(_)\_) \___)(_) (_) (____)(_)\_)(___/(__)(__)
</pre>
<form id="uploadForm" enctype="multipart/form-data">
<input type="file" id="fileInput" multiple>
<br>
<input type="text" placeholder="titre" id="titre"></input>
<label for="titre">N'hésitez pas à bien mettre 1A, 2A, ... et la matière concernée dans le titre.</label>
<br>
<select id="select_type">
</div>
<div class="formulaire">
<form id="uploadForm" enctype="multipart/form-data">
<input type="file" class="champ" id="fileInput" multiple>
<br>
<input type="text" class="champ" placeholder="titre" id="titre"></input>
<label for="titre" class="champ" >N'hésitez pas à bien mettre 1A, 2A, ... et la matière concernée dans le titre.</label>
<br>
<select id="select_type" class="champ" >
<option value="1" >annale</option>
<option value="2" >fiche_revision</option>
<option value="3" >HTML personnalisé</option>
</select>
</select>
<input type="text" placeholder="commentaires généraux sur l'ensemble des documents" id="commentaire_auteur"></input>
<br>
<div id="selectedImages"></div>
<input type="text" class="champ" placeholder="commentaires généraux sur l'ensemble des documents" id="commentaire_auteur"></input>
<br>
<div id="selectedImages" class="champ"></div>
<div id="corrige_checkbox_wrapper">
<input type="checkbox" id="corrige_checkbox">
<label for="corrige_checkbox">Corrigé inclu</label>
</div>
<div id="corrige_checkbox_wrapper">
<input type="checkbox" class="champ" id="corrige_checkbox">
<label for="corrige_checkbox" class="champ">Corrigé inclu</label>
</div>
<input type="date" id="date_conception_input">
<label for="date_conception_input">Date de conception du/des documents (Mettez juste la bonne année si vous ne savez pas) </label>
<br>
<button type="button" id="btn-soumettre">Téléverser les fichiers</button>
</form>
<input type="date" id="date_conception_input" class="champ" >
<label for="date_conception_input" class="champ" >Date de conception du/des documents (Mettez juste la bonne année si vous ne savez pas) </label>
<br>
<button type="button" id="btn-soumettre" class="champ button color-green-tr" >Téléverser les fichiers</button>
</form>
<div id="exercices_details_wrapper">
<button id="btn-details-exo">Ajouter les détails d'un exercice</button>
<div id="exercices_details_wrapper">
<button id="btn-details-exo" class="champ" >Ajouter les détails d'un exercice</button>
</div>
</div>
<button id="btn-camera">Prendre des photos</button>
<button id="btn-camera" class="color-red-tr floating-action-btn" >
<pre> _
_| |_
|_ _| Prendre des photos
|_|
</pre></button>
</body>
<?php