This commit is contained in:
JunkJumper 2020-10-19 11:56:55 +02:00
parent 032f990057
commit 1394656120
14 changed files with 570 additions and 75 deletions

View File

@ -0,0 +1,5 @@
Renault Prix Peugeot Prix Volkswagen Prix
Twingo 8999 107 7999 Lupo 8549
Clio 11999 207 12499 Polo 11549
Megane 13999 308 14999 Golf 16549
Laguna 18999 508 19999 Passat 22549

1
2020-2021/TD4/export/.gitignore vendored Normal file
View File

@ -0,0 +1 @@
*.png

View File

@ -0,0 +1,51 @@
<!DOCTYPE html>
<html lang="fr-FR">
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<meta charset="utf-8">
<title></title>
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<!-- General Style -->
<style type="text/css">
#colorlib-notfound,
#colorlib-notfound .colorlib-notfound-bg {
background-image: url("https://stuff.junkjumper-projects.com/wp-content/uploads/2019/10/404.png") !important;
background-repeat: no-repeat;
background-size: contain;
}
.colorlib-copyright {
position: absolute;
left: 0;
right: 0;
bottom: 0;
margin: 0 auto;
text-align: center;
}
.colorlib-copyright span {
opacity: 0.8;
}
.colorlib-copyright a {
opacity: 1;
}
</style>
<!-- End General Style -->
<link rel="stylesheet" id="template_01-main-css" href="src/style.css" type="text/css" media="all">
<link rel="stylesheet" id="Montserrat-css" href="src/css_002.css" type="text/css" media="all">
<link rel="stylesheet" id="Titillium-css" href="src/css.css" type="text/css" media="all">
</head>
<body class="colorlib-body">
<div id="colorlib-notfound">
<div class="colorlib-notfound">
<a href="https://www.junkjumper-projects.com/" id="colorlib_404_customizer_button_text">Back to homepage</a>
</div>
</div>
</body>
</html>

View File

@ -1,84 +1,148 @@
<!DOCTYPE html>
<?php
/**
* @Author: JunkJumper
* @Link: https://github.com/JunkJumper
* @Copyright: Creative Common 4.0 (CC BY 4.0)
* @Create Time: 05-10-2020 10:26
* @Description: M314 - TD3
*/
$entree = "./Voitures.txt";
function openFile($input) {
$voitures = fopen($input, "r");
$lecture = file($input);
}
function closeFile($input) {
fclose($input);
}
function displayLines($input) {
openFile($input);
while(! feof($input)) {
$line = fgets($input);
echo $line. '<br />';
}
}
?>
<html>
<html lang="fr">
<head>
<title>M314 - TD4</title>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no" />
<title>M314 - TD4 - Manipulation de fichiers et de répertoire</title>
<meta name="description" content="Page avec formulaire pour Wallpaper Francoponies 2020" />
<meta name="author" content="JunkJumper" />
<!-- Bootstrap core CSS -->
<link href="https://www.junkjumper-projects.com/FP/vendor/bootstrap/css/bootstrap.min.css" rel="stylesheet" />
<!-- Additional CSS Files -->
<link href="https://fonts.googleapis.com/css?family=Lato:100,300,400,700,900" rel="stylesheet" />
<link rel="stylesheet" href="https://www.junkjumper-projects.com/FP/assets/css/tooplate-style.css" />
<link rel="stylesheet" href="https://www.junkjumper-projects.com/FP/assets/css/fontawesome.css" />
<!-- Favicon -->
<link rel="icon" type="image/png" href="https://www.junkjumper-projects.com/umming_lines_paint.png" />
<h1>M314 - TD4 Manipulation de fichiers et de répertoire</h1>
<meta charset="UTF-8" />
</head>
<?php
echo displayLines($entree);
?>
<body>
<a href="..">
<button class="button blue">Retour à la page précédente</button>
</a>
<div id="page-wraper">
<!-- Sidebar Menu -->
<div class="responsive-nav">
<i class="fa fa-bars" id="menu-toggle"></i>
<div id="menu" class="menu">
<i class="fa fa-times" id="menu-close"></i>
<div class="container">
<div class="image">
<a href="https://www.junkjumper-projects.com/" target="_blank"><img src="https://www.junkjumper-projects.com/umming_lines_paint.png" alt="Logo Francoponies" id="logo" class="zoom" /></a>
</div></a>
<div class="author-content">
</div>
<nav class="main-nav" role="navigation">
<ul class="main-menu">
<li><a href="#section3">Formulaire</a></li>
</ul>
<li><a href="./results.csv">Voir résultats</a></li>
<li>
<a href="..">
Retour à la page précédente
</a>
</li>
</nav>
<a href="https://about.junkjumper-projects.com/" target="_blank">Page par JunkJumper</a>
</div>
</div>
<section class="section my-work" data-section="section3">
<div class="container">
<div class="section-heading">
<h2>Le Formulaire</h2>
<div class="line-dec"></div>
</div>
<div id="form">
<form enctype="multipart/form-data" action="./traitement.php" method="post">
<fieldset>
Pseudo discord (Pseudo#1234) : <input id="discord" name="discord" type="text" placeholder="Pseudo#1234" class="form-control input-md" required=""><br />
Nom de votre OC :<input id="oc" name="oc" type="text" placeholder="monOC" class="form-control input-md" required=""><br />
Race de votre OC :<select id="race" name="race" class="form-control">
<option value="">Choissez une race</option>
<option value="terrestre">Terrestre</option>
<option value="licorne">Licorne</option>
<option value="pegase">Pégase</option>
<option value="alicorne">Alicorne</option>
<option value="griphon">Griphon</option>
<option value="changelin">Changelin</option>
<option value="yak">Yak</option>
<option value="dragon">Dragon</option>
<option value="seapony">Seapony</option>
<option value="seapony">Kirin</option>
</select><br />
Image de votre OC :<input name="fichier" type="file" id="fichier_a_uploader" /><br /><br />
<input type="submit" value="Envoyer" /><br />
</fieldset>
</form>
</div>
<!--
<img src="./src/end.png" id="end" />
-->
</div>
</section>
</div>
<!-- Scripts -->
<!-- Bootstrap core JavaScript -->
<script src="https://www.junkjumper-projects.com/FP/vendor/jquery/jquery.min.js"></script>
<script src="https://www.junkjumper-projects.com/FP/vendor/bootstrap/js/bootstrap.bundle.min.js"></script>
<script src="https://www.junkjumper-projects.com/FP/assets/js/isotope.min.js"></script>
<script src="https://www.junkjumper-projects.com/FP/assets/js/owl-carousel.js"></script>
<script src="https://www.junkjumper-projects.com/FP/assets/js/lightbox.js"></script>
<script src="https://www.junkjumper-projects.com/FP/assets/js/custom.js"></script>
<script>
//according to loftblog tut
$(".main-menu li:first").addClass("active");
var showSection = function showSection(section, isAnimate) {
var direction = section.replace(/#/, ""),
reqSection = $(".section").filter(
'[data-section="' + direction + '"]'
),
reqSectionPos = reqSection.offset().top - 0;
if (isAnimate) {
$("body, html").animate({
scrollTop: reqSectionPos
},
800
);
} else {
$("body, html").scrollTop(reqSectionPos);
}
};
var checkSection = function checkSection() {
$(".section").each(function() {
var $this = $(this),
topEdge = $this.offset().top - 80,
bottomEdge = topEdge + $this.height(),
wScroll = $(window).scrollTop();
if (topEdge < wScroll && bottomEdge > wScroll) {
var currentId = $this.data("section"),
reqLink = $("a").filter("[href*=\\#" + currentId + "]");
reqLink
.closest("li")
.addClass("active")
.siblings()
.removeClass("active");
}
});
};
$(".main-menu").on("click", "a", function(e) {
e.preventDefault();
showSection($(this).attr("href"), true);
});
$(window).scroll(function() {
checkSection();
});
</script>
</body>
<style>
h1, h2, h3, h4, h5, h6 {
color: #4c6e8a;
}
.button {
border: none;
color: white;
padding: 15px 32px;
text-align: center;
text-decoration: none;
display: inline-block;
font-size: 16px;
margin: 4px 2px;
cursor: pointer;
}
.blue {
background-color: #4c6e8a;
}
b {
color: red;
}
strong.mandatory {
color : red;
}
</style>
</html>

View File

@ -0,0 +1,2 @@
Discord;Nom OC;Race;Image
JunkJumper#3773;UmmingBird;pegase;https://www.junkjumper-projects.com/FP/export/UmmingBirdummin-nsfw.png
1 Discord Nom OC Race Image
2 JunkJumper#3773 UmmingBird pegase https://www.junkjumper-projects.com/FP/export/UmmingBirdummin-nsfw.png

BIN
2020-2021/TD4/src/bg.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 676 KiB

BIN
2020-2021/TD4/src/end.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 166 KiB

View File

@ -0,0 +1,150 @@
<?php
/************************************************************
* Partie debug *
*************************************************************/
//Array ([discord]-[oc]-[race]-[avatar])
$tab = $_REQUEST;
$die = false;
$message = "";
//print_r($tab);
//echo '<br />'; //ok on recup dans $tab[nomVar]
//print_r($_FILES['fichier']);
//echo '<br />';
/************************************************************
* Partie check valeurs *
*************************************************************/
$nom = strtr(
$$_REQUEST['oc'],
'ÀÁÂÃÄÅÇÈÉÊËÌÍÎÏÒÓÔÕÖÙÚÛÜÝàáâãäåçèéêëìíîïðòóôõöùúûüýÿ',
'AAAAAACEEEEIIIIOOOOOUUUUYaaaaaaceeeeiiiioooooouuuuyy'
);
$nom = preg_replace('/([^.a-z0-9]+)/i', '-', $nom );
if($_REQUEST['oc'] == "") {
$die = true;
$message = $message ."Vous n'avez pas renseigné le nom de votre OC !".'<br />';
}
if($_REQUEST['race'] == "") {
$die = true;
$message = $message ."Vous n'avez pas renseigné une race !".'<br />';
}
/************************************************************
* Partie gestion des images *
*************************************************************/
$dossier = './export/';
$fichier = basename($_FILES['fichier']['name']);
$taille_maxi = 10485760;
$taille = filesize($_FILES['fichier']['tmp_name']);
$extensions = array('.png');
$extension = strrchr($_FILES['fichier']['name'], '.');
//Début des vérifications de sécurité...
if (!in_array($extension, $extensions)) { //Si l'extension n'est pas dans le tableau
$erreur = 'Vous devez uploader un fichier de type png';
$die = true;
}
if ($taille > $taille_maxi) {
$erreur = 'Le fichier est trop gros...';
$die = true;
}
if (!isset($erreur)) { //S'il n'y a pas d'erreur, on upload
//On formate le nom du fichier ici...
$fichier = strtr(
$fichier,
'ÀÁÂÃÄÅÇÈÉÊËÌÍÎÏÒÓÔÕÖÙÚÛÜÝàáâãäåçèéêëìíîïðòóôõöùúûüýÿ',
'AAAAAACEEEEIIIIOOOOOUUUUYaaaaaaceeeeiiiioooooouuuuyy'
);
$fichier = preg_replace('/([^.a-z0-9]+)/i', '-', $fichier);
if (move_uploaded_file($_FILES['fichier']['tmp_name'], $dossier .$_REQUEST['oc'] .$fichier) && (!$die) ) { //Si la fonction renvoie TRUE, c'est que ça a fonctionné...
$path = $dossier .$_REQUEST['oc'] .$fichier;
$message = 'Upload effectué avec succès !';
$envoi = true;
} else { //Sinon (la fonction renvoie FALSE).
$message = $message .' Echec de l\'upload ! Vérifiez bien les conditions d\'envoi !';
$die = true;
}
} else {
//echo $erreur;
}
/************************************************************
* Partie export CSV *
*************************************************************/
//Discord;oc;race;avatar
if ($envoi) {
$write = fopen('results.csv', 'a');
fputs($write, "\n" .$tab['discord'] .";" .$tab['oc'] .";" .$tab['race'] .";https://www.junkjumper-projects.com/FP/" .substr($path, 2));
fclose($write);
}
?>
<!--
/************************************************************
* Partie HTML *
*************************************************************/-->
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<link href="./assets/css/display.css" rel="stylesheet">
<link href="https://fonts.googleapis.com/css?family=Lato:100,300,400,700,900" rel="stylesheet" />
<link rel="icon" type="image/png" href="assets/images/FP.png" />
<?php
if($die) {
echo '<script>setTimeout(function() {window.location.href = "index.php";}, 4975);</script>';
} else {
echo '<script>setTimeout(function() {window.location.href = "index.php";}, 4975);</script>';
}
?>
</head>
<body>
<div id="mid-mid">
<center>
<p>
<?php
$erreur = $erreur .$message;
if (!$die) {
echo '<img src="./assets/images/ok.gif" alt="ok" width="70%" /><br /><br />' ;
echo $message;
} else {
echo '<img src="./assets/images/err.png" alt="erreur" width="30%" /><br /><br />';
echo $erreur;
}
?>
<br /><br />
<div class="radial-timer s-animate">
<div class="radial-timer-half"></div>
<div class="radial-timer-half"></div>
</div><br /><br /> Vous allez être redirigé vers la page précédente dans quelques instants<br \>
</p>
</center>
</div>
</body>
</html>

BIN
2020-2021/TD5/TP5-eno.pdf Normal file

Binary file not shown.

84
2020-2021/TD5/index.php Normal file
View File

@ -0,0 +1,84 @@
<!DOCTYPE html>
<?php
/**
* @Author: JunkJumper
* @Link: https://github.com/JunkJumper
* @Copyright: Creative Common 4.0 (CC BY 4.0)
* @Create Time: 05-10-2020 10:26
* @Description: M314 - TD3
*/
$entree = "./Voitures.txt";
function openFile($input) {
$voitures = fopen($input, "r");
$lecture = file($input);
}
function closeFile($input) {
fclose($input);
}
function displayLines($input) {
openFile($input);
while(! feof($input)) {
$line = fgets($input);
echo $line. '<br />';
}
}
?>
<html>
<head>
<title>M314 - TD5</title>
<link rel="icon" type="image/png" href="https://www.junkjumper-projects.com/umming_lines_paint.png" />
<h1>M314 - TD5 Manipulation de sessions, cookies et mails</h1>
<meta charset="UTF-8" />
</head>
<?php
echo displayLines($entree);
?>
<body>
<a href="..">
<button class="button blue">Retour à la page précédente</button>
</a>
</body>
<style>
h1, h2, h3, h4, h5, h6 {
color: #4c6e8a;
}
.button {
border: none;
color: white;
padding: 15px 32px;
text-align: center;
text-decoration: none;
display: inline-block;
font-size: 16px;
margin: 4px 2px;
cursor: pointer;
}
.blue {
background-color: #4c6e8a;
}
b {
color: red;
}
strong.mandatory {
color : red;
}
</style>
</html>

BIN
2020-2021/TD6/TP6-eno.pdf Normal file

Binary file not shown.

84
2020-2021/TD6/index.php Normal file
View File

@ -0,0 +1,84 @@
<!DOCTYPE html>
<?php
/**
* @Author: JunkJumper
* @Link: https://github.com/JunkJumper
* @Copyright: Creative Common 4.0 (CC BY 4.0)
* @Create Time: 05-10-2020 10:26
* @Description: M314 - TD3
*/
$entree = "./Voitures.txt";
function openFile($input) {
$voitures = fopen($input, "r");
$lecture = file($input);
}
function closeFile($input) {
fclose($input);
}
function displayLines($input) {
openFile($input);
while(! feof($input)) {
$line = fgets($input);
echo $line. '<br />';
}
}
?>
<html>
<head>
<title>M314 - TD6</title>
<link rel="icon" type="image/png" href="https://www.junkjumper-projects.com/umming_lines_paint.png" />
<h1>M314 - TP6 PHP Orienté Objet</h1>
<meta charset="UTF-8" />
</head>
<?php
echo displayLines($entree);
?>
<body>
<a href="..">
<button class="button blue">Retour à la page précédente</button>
</a>
</body>
<style>
h1, h2, h3, h4, h5, h6 {
color: #4c6e8a;
}
.button {
border: none;
color: white;
padding: 15px 32px;
text-align: center;
text-decoration: none;
display: inline-block;
font-size: 16px;
margin: 4px 2px;
cursor: pointer;
}
.blue {
background-color: #4c6e8a;
}
b {
color: red;
}
strong.mandatory {
color : red;
}
</style>
</html>

54
2020-2021/TD6/results.csv Normal file
View File

@ -0,0 +1,54 @@
Discord;Nom OC;Race;Image
JunkJumper#7912;UmmingBird;pegase;https://www.junkjumper-projects.com/FP/export/UmmingBirdApplejunk1-00129.png
AlexTheBest#5282;WindFlyer;pegase;https://www.junkjumper-projects.com/FP/export/WindFlyerMy-OC.png
Modrý Poník#4845;Feather Blue;terrestre;https://www.junkjumper-projects.com/FP/export/Feather BlueQuentin-steampunk-1.png
Juju Darky#7517;Darky;pegase;https://www.junkjumper-projects.com/FP/export/DarkyDarky.png
Comet Wing#7640;Comet Wing;pegase;https://www.junkjumper-projects.com/FP/export/Comet WingCometWingFlying.png
Akififi#0467 ;Sea Glow;pegase;https://www.junkjumper-projects.com/FP/export/Sea Glowmedium-3-.png
Patapon Jack_Dashie#4634;Ice Warm;licorne;https://www.junkjumper-projects.com/FP/export/Ice Warmice-warm.png
Chevalier Patate#4443;Falscher;changelin;https://www.junkjumper-projects.com/FP/export/Falscherty-ly-chargement.png
Ben_Alpha#1505;Ryoku Memori;alicorne;https://www.junkjumper-projects.com/FP/export/Ryoku MemoriRyoku-Memori.png
Skyller#1804;Lupina;pegase;https://www.junkjumper-projects.com/FP/export/LupinaLupina-Arley.png
Violet Cross#9720;Candy Gold;changelin;https://www.junkjumper-projects.com/FP/export/Candy GoldCandy-Gold.png
DanTriplerUn#4652;Dan Éditon;terrestre;https://www.junkjumper-projects.com/FP/export/Dan ÉditonLets-A-Go-Dan-Only-1.png
Scissor Twilight#0447;santal;licorne;https://www.junkjumper-projects.com/FP/export/santalPony.png
Lux The Pegasus#3209;Photo After;pegase;https://www.junkjumper-projects.com/FP/export/Photo Afterlux-pour-mlp-rainbow-by-lux-the-pegasus-dcukff0-Copie000.png
Virgile "VILE"#9211;Finami;terrestre;https://www.junkjumper-projects.com/FP/export/Finamifinami-MLP.png
Déliambre#3796;Déliambre Floss;pegase;https://www.junkjumper-projects.com/FP/export/Déliambre Flossdiscord.png
VinylSkaarj#7811;VinylSkaarj;pegase;https://www.junkjumper-projects.com/FP/export/VinylSkaarjmyPony.png
Janeo#1101;Zapfaine;terrestre;https://www.junkjumper-projects.com/FP/export/Zapfainezapfaine.png
CaptainPie ❤ 👮#1030;CaptainPie;pegase;https://www.junkjumper-projects.com/FP/export/CaptainPiesfffffffw2.png
Im A Flying T90#2917;Twist Cable;licorne;https://www.junkjumper-projects.com/FP/export/Twist CableTwist-Cable-2.png
C_Chell#8337;Kimi;licorne;https://www.junkjumper-projects.com/FP/export/KimiKimi.png
C_Chell#8337;Kimi;licorne;https://www.junkjumper-projects.com/FP/export/KimiKimi2.png
C_Chell#8337;Yakstodon;yak;https://www.junkjumper-projects.com/FP/export/YakstodonYak.png
Retributer#0059;Deck Swapper;terrestre;https://www.junkjumper-projects.com/FP/export/Deck SwapperRetriBanniere.png
Gael80 (Red Fly)#2236;Red Fly;pegase;https://www.junkjumper-projects.com/FP/export/Red FlyDBLtIh2XkAAYZ0b.png
TheoTam#2545;Lightfast;pegase;https://www.junkjumper-projects.com/FP/export/LightfastLightfast.png
AppleJacky#0343;AppleJacky;terrestre;https://www.junkjumper-projects.com/FP/export/AppleJackyhiResPony.png
ShurixDashiie#0666;ShellaSwift;pegase;https://www.junkjumper-projects.com/FP/export/ShellaSwiftShella-Swift-by-Faquali.png
Yuki#2138;Yuki;licorne;https://www.junkjumper-projects.com/FP/export/Yukitumblr-nf5ohq1Tn01qexvxeo2-1280.png
Céliart#2008;Céliart;terrestre;https://www.junkjumper-projects.com/FP/export/CéliartCy-liart.png
Céliart#2008;Céliart;terrestre;https://www.junkjumper-projects.com/FP/export/CéliartCy-liart.png
Onyx Stell#2102;Onyx Stell;licorne;https://www.junkjumper-projects.com/FP/export/Onyx StellOnyxSousDroguefondtransparent.png
EmMane-iac Mayhem#0103;Nightmare Tears;alicorne;https://www.junkjumper-projects.com/FP/export/Nightmare TearsNightmare-tears2.png
Fire (étonnant non ?)#0848;Fire Aspect;pegase;https://www.junkjumper-projects.com/FP/export/Fire AspectL-ocDuFire-removebg-preview.png
Cedric ☾MӨӨП☽ - Luna Vult#0003;Moon Rise;licorne;https://www.junkjumper-projects.com/FP/export/Moon RiseMoon-Rise.png
Minty Joy (Flora.morian#4838);Minty Joy;licorne;https://www.junkjumper-projects.com/FP/export/Minty JoyMintyJoy.png
Im A Flying T90#2917;Twist Cable;licorne;https://www.junkjumper-projects.com/FP/export/Twist CableTwistCable2.png
Coati Songeur#1932;Amari;pegase;https://www.junkjumper-projects.com/FP/export/AmariAmari.png
🦌 Juniper 🦌 #1070;Amari;pegase;https://www.junkjumper-projects.com/FP/export/AmariAmari.png
Stanislas M. Foutoukrée #4102;Mount Génépi;terrestre;https://www.junkjumper-projects.com/FP/export/Mount GénépiMount.png
Blossoming Painting#2329;Blossoming Painting;terrestre;https://www.junkjumper-projects.com/FP/export/Blossoming PaintingBlossomingPaintingOC.png
Moonrise#6352;Moon Rise;licorne;https://www.junkjumper-projects.com/FP/export/Moon Risemoonrise.png
Luke Mystic#7759;Luke Lulamoon;pegase;https://www.junkjumper-projects.com/FP/export/Luke LulamoonPop-corn-Luke-HD4.png
Ragnar#9305;Crimson Blaze;pegase;https://www.junkjumper-projects.com/FP/export/Crimson BlazeCrimsonBlaze.png
le chevalier rouki#0135;rouki;terrestre;https://www.junkjumper-projects.com/FP/export/roukirouki.png
LumaCraft10#6112;Astral;pegase;https://www.junkjumper-projects.com/FP/export/AstralAstral.png
Minux86#1225;IlluminOC;terrestre;https://www.junkjumper-projects.com/FP/export/IlluminOCIllumiOC.png
Aliax#8962;Aliax Smily;pegase;https://www.junkjumper-projects.com/FP/export/Aliax Smilycm-for-aliax29-2-by-unisoleil-dbumfgh.png
The-Volcano (The-Pony)#1128;Steam Gear;licorne;https://www.junkjumper-projects.com/FP/export/Steam GearTheVolcanoOC.png
Pegasuhira (Rnbw-I)#5451;Blue ;seapony;https://www.junkjumper-projects.com/FP/export/Blue B.png
Mcrafteur62#3826;Missile Touch;licorne;https://www.junkjumper-projects.com/FP/export/Missile Touchmissile-touch.png
Titanium TechFR#8092;Titanium TechFR;pegase;https://www.junkjumper-projects.com/FP/export/Titanium TechFRtitaniumV5FP.png
Nightfeathers#4082;Pheden Gearsing;licorne;https://www.junkjumper-projects.com/FP/export/Pheden GearsingWallpaperPheden.png
Can't render this file because it contains an unexpected character in line 16 and column 9.

BIN
src/umming_lines_paint.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 570 KiB