| @@ -0,0 +1,2 @@ | |||||
| # Default ignored files | |||||
| /workspace.xml | |||||
| @@ -0,0 +1,8 @@ | |||||
| <?xml version="1.0" encoding="UTF-8"?> | |||||
| <module type="WEB_MODULE" version="4"> | |||||
| <component name="NewModuleRootManager"> | |||||
| <content url="file://$MODULE_DIR$" /> | |||||
| <orderEntry type="inheritedJdk" /> | |||||
| <orderEntry type="sourceFolder" forTests="false" /> | |||||
| </component> | |||||
| </module> | |||||
| @@ -0,0 +1,6 @@ | |||||
| <?xml version="1.0" encoding="UTF-8"?> | |||||
| <project version="4"> | |||||
| <component name="JavaScriptSettings"> | |||||
| <option name="languageLevel" value="ES6" /> | |||||
| </component> | |||||
| </project> | |||||
| @@ -0,0 +1,8 @@ | |||||
| <?xml version="1.0" encoding="UTF-8"?> | |||||
| <project version="4"> | |||||
| <component name="ProjectModuleManager"> | |||||
| <modules> | |||||
| <module fileurl="file://$PROJECT_DIR$/.idea/clyde.iml" filepath="$PROJECT_DIR$/.idea/clyde.iml" /> | |||||
| </modules> | |||||
| </component> | |||||
| </project> | |||||
| @@ -0,0 +1,6 @@ | |||||
| <?xml version="1.0" encoding="UTF-8"?> | |||||
| <project version="4"> | |||||
| <component name="VcsDirectoryMappings"> | |||||
| <mapping directory="$PROJECT_DIR$" vcs="Git" /> | |||||
| </component> | |||||
| </project> | |||||
| @@ -1,30 +0,0 @@ | |||||
| <?php | |||||
| session_start(); | |||||
| include 'include/header.php'; | |||||
| $objetPdo = new PDO('mysql:host=localhost;dbname=lpcgamer','phpuser','php'); | |||||
| $pdoStat = $objetPdo->prepare('INSERT INTO products VALUES (NULL, :nom, :qualite, :prix, :prixlivr, :pays, :description, :iduser)'); | |||||
| $pdoStat->bindValue(':nom',$_POST['name'], PDO::PARAM_STR); | |||||
| $pdoStat->bindValue(':qualite',$_POST['quality'], PDO::PARAM_STR); | |||||
| $pdoStat->bindValue(':prix',$_POST['price'], PDO::PARAM_STR); | |||||
| $pdoStat->bindValue(':prixlivr',$_POST['deliveryprice'], PDO::PARAM_STR); | |||||
| $pdoStat->bindValue(':pays',$_POST['country'], PDO::PARAM_STR); | |||||
| $pdoStat->bindValue(':description',$_POST['content'], PDO::PARAM_STR); | |||||
| $pdoStat->bindValue(':iduser',$_SESSION['id'] , PDO::PARAM_STR); | |||||
| $insertIsOk = $pdoStat->execute(); | |||||
| if($insertIsOk){ | |||||
| $message = 'Votre annonce a été prises en compte<br \><br \><a href="homepage.php">Page d\'accueil</a>'; | |||||
| } | |||||
| else{ | |||||
| $message = 'Votre demande n\'a pu etre effectué essayés plus tard <br \><br \><a href="homepage.php">Page d\'accueil</a>'; | |||||
| } | |||||
| ?> | |||||
| <div class="message"> | |||||
| <?php echo $message ?> | |||||
| </div> | |||||
| @@ -0,0 +1,327 @@ | |||||
| /*! | |||||
| * Bootstrap Reboot v4.4.1 (https://getbootstrap.com/) | |||||
| * Copyright 2011-2019 The Bootstrap Authors | |||||
| * Copyright 2011-2019 Twitter, Inc. | |||||
| * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) | |||||
| * Forked from Normalize.css, licensed MIT (https://github.com/necolas/normalize.css/blob/master/LICENSE.md) | |||||
| */ | |||||
| *, | |||||
| *::before, | |||||
| *::after { | |||||
| box-sizing: border-box; | |||||
| } | |||||
| html { | |||||
| font-family: sans-serif; | |||||
| line-height: 1.15; | |||||
| -webkit-text-size-adjust: 100%; | |||||
| -webkit-tap-highlight-color: rgba(0, 0, 0, 0); | |||||
| } | |||||
| article, aside, figcaption, figure, footer, header, hgroup, main, nav, section { | |||||
| display: block; | |||||
| } | |||||
| body { | |||||
| margin: 0; | |||||
| font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji"; | |||||
| font-size: 1rem; | |||||
| font-weight: 400; | |||||
| line-height: 1.5; | |||||
| color: #212529; | |||||
| text-align: left; | |||||
| background-color: #fff; | |||||
| } | |||||
| [tabindex="-1"]:focus:not(:focus-visible) { | |||||
| outline: 0 !important; | |||||
| } | |||||
| hr { | |||||
| box-sizing: content-box; | |||||
| height: 0; | |||||
| overflow: visible; | |||||
| } | |||||
| h1, h2, h3, h4, h5, h6 { | |||||
| margin-top: 0; | |||||
| margin-bottom: 0.5rem; | |||||
| } | |||||
| p { | |||||
| margin-top: 0; | |||||
| margin-bottom: 1rem; | |||||
| } | |||||
| abbr[title], | |||||
| abbr[data-original-title] { | |||||
| text-decoration: underline; | |||||
| -webkit-text-decoration: underline dotted; | |||||
| text-decoration: underline dotted; | |||||
| cursor: help; | |||||
| border-bottom: 0; | |||||
| -webkit-text-decoration-skip-ink: none; | |||||
| text-decoration-skip-ink: none; | |||||
| } | |||||
| address { | |||||
| margin-bottom: 1rem; | |||||
| font-style: normal; | |||||
| line-height: inherit; | |||||
| } | |||||
| ol, | |||||
| ul, | |||||
| dl { | |||||
| margin-top: 0; | |||||
| margin-bottom: 1rem; | |||||
| } | |||||
| ol ol, | |||||
| ul ul, | |||||
| ol ul, | |||||
| ul ol { | |||||
| margin-bottom: 0; | |||||
| } | |||||
| dt { | |||||
| font-weight: 700; | |||||
| } | |||||
| dd { | |||||
| margin-bottom: .5rem; | |||||
| margin-left: 0; | |||||
| } | |||||
| blockquote { | |||||
| margin: 0 0 1rem; | |||||
| } | |||||
| b, | |||||
| strong { | |||||
| font-weight: bolder; | |||||
| } | |||||
| small { | |||||
| font-size: 80%; | |||||
| } | |||||
| sub, | |||||
| sup { | |||||
| position: relative; | |||||
| font-size: 75%; | |||||
| line-height: 0; | |||||
| vertical-align: baseline; | |||||
| } | |||||
| sub { | |||||
| bottom: -.25em; | |||||
| } | |||||
| sup { | |||||
| top: -.5em; | |||||
| } | |||||
| a { | |||||
| color: #007bff; | |||||
| text-decoration: none; | |||||
| background-color: transparent; | |||||
| } | |||||
| a:hover { | |||||
| color: #0056b3; | |||||
| text-decoration: underline; | |||||
| } | |||||
| a:not([href]) { | |||||
| color: inherit; | |||||
| text-decoration: none; | |||||
| } | |||||
| a:not([href]):hover { | |||||
| color: inherit; | |||||
| text-decoration: none; | |||||
| } | |||||
| pre, | |||||
| code, | |||||
| kbd, | |||||
| samp { | |||||
| font-family: SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace; | |||||
| font-size: 1em; | |||||
| } | |||||
| pre { | |||||
| margin-top: 0; | |||||
| margin-bottom: 1rem; | |||||
| overflow: auto; | |||||
| } | |||||
| figure { | |||||
| margin: 0 0 1rem; | |||||
| } | |||||
| img { | |||||
| vertical-align: middle; | |||||
| border-style: none; | |||||
| } | |||||
| svg { | |||||
| overflow: hidden; | |||||
| vertical-align: middle; | |||||
| } | |||||
| table { | |||||
| border-collapse: collapse; | |||||
| } | |||||
| caption { | |||||
| padding-top: 0.75rem; | |||||
| padding-bottom: 0.75rem; | |||||
| color: #6c757d; | |||||
| text-align: left; | |||||
| caption-side: bottom; | |||||
| } | |||||
| th { | |||||
| text-align: inherit; | |||||
| } | |||||
| label { | |||||
| display: inline-block; | |||||
| margin-bottom: 0.5rem; | |||||
| } | |||||
| button { | |||||
| border-radius: 0; | |||||
| } | |||||
| button:focus { | |||||
| outline: 1px dotted; | |||||
| outline: 5px auto -webkit-focus-ring-color; | |||||
| } | |||||
| input, | |||||
| button, | |||||
| select, | |||||
| optgroup, | |||||
| textarea { | |||||
| margin: 0; | |||||
| font-family: inherit; | |||||
| font-size: inherit; | |||||
| line-height: inherit; | |||||
| } | |||||
| button, | |||||
| input { | |||||
| overflow: visible; | |||||
| } | |||||
| button, | |||||
| select { | |||||
| text-transform: none; | |||||
| } | |||||
| select { | |||||
| word-wrap: normal; | |||||
| } | |||||
| button, | |||||
| [type="button"], | |||||
| [type="reset"], | |||||
| [type="submit"] { | |||||
| -webkit-appearance: button; | |||||
| } | |||||
| button:not(:disabled), | |||||
| [type="button"]:not(:disabled), | |||||
| [type="reset"]:not(:disabled), | |||||
| [type="submit"]:not(:disabled) { | |||||
| cursor: pointer; | |||||
| } | |||||
| button::-moz-focus-inner, | |||||
| [type="button"]::-moz-focus-inner, | |||||
| [type="reset"]::-moz-focus-inner, | |||||
| [type="submit"]::-moz-focus-inner { | |||||
| padding: 0; | |||||
| border-style: none; | |||||
| } | |||||
| input[type="radio"], | |||||
| input[type="checkbox"] { | |||||
| box-sizing: border-box; | |||||
| padding: 0; | |||||
| } | |||||
| input[type="date"], | |||||
| input[type="time"], | |||||
| input[type="datetime-local"], | |||||
| input[type="month"] { | |||||
| -webkit-appearance: listbox; | |||||
| } | |||||
| textarea { | |||||
| overflow: auto; | |||||
| resize: vertical; | |||||
| } | |||||
| fieldset { | |||||
| min-width: 0; | |||||
| padding: 0; | |||||
| margin: 0; | |||||
| border: 0; | |||||
| } | |||||
| legend { | |||||
| display: block; | |||||
| width: 100%; | |||||
| max-width: 100%; | |||||
| padding: 0; | |||||
| margin-bottom: .5rem; | |||||
| font-size: 1.5rem; | |||||
| line-height: inherit; | |||||
| color: inherit; | |||||
| white-space: normal; | |||||
| } | |||||
| progress { | |||||
| vertical-align: baseline; | |||||
| } | |||||
| [type="number"]::-webkit-inner-spin-button, | |||||
| [type="number"]::-webkit-outer-spin-button { | |||||
| height: auto; | |||||
| } | |||||
| [type="search"] { | |||||
| outline-offset: -2px; | |||||
| -webkit-appearance: none; | |||||
| } | |||||
| [type="search"]::-webkit-search-decoration { | |||||
| -webkit-appearance: none; | |||||
| } | |||||
| ::-webkit-file-upload-button { | |||||
| font: inherit; | |||||
| -webkit-appearance: button; | |||||
| } | |||||
| output { | |||||
| display: inline-block; | |||||
| } | |||||
| summary { | |||||
| display: list-item; | |||||
| cursor: pointer; | |||||
| } | |||||
| template { | |||||
| display: none; | |||||
| } | |||||
| [hidden] { | |||||
| display: none !important; | |||||
| } | |||||
| /*# sourceMappingURL=bootstrap-reboot.css.map */ | |||||
| @@ -0,0 +1,8 @@ | |||||
| /*! | |||||
| * Bootstrap Reboot v4.4.1 (https://getbootstrap.com/) | |||||
| * Copyright 2011-2019 The Bootstrap Authors | |||||
| * Copyright 2011-2019 Twitter, Inc. | |||||
| * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) | |||||
| * Forked from Normalize.css, licensed MIT (https://github.com/necolas/normalize.css/blob/master/LICENSE.md) | |||||
| */*,::after,::before{box-sizing:border-box}html{font-family:sans-serif;line-height:1.15;-webkit-text-size-adjust:100%;-webkit-tap-highlight-color:transparent}article,aside,figcaption,figure,footer,header,hgroup,main,nav,section{display:block}body{margin:0;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,"Noto Sans",sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji";font-size:1rem;font-weight:400;line-height:1.5;color:#212529;text-align:left;background-color:#fff}[tabindex="-1"]:focus:not(:focus-visible){outline:0!important}hr{box-sizing:content-box;height:0;overflow:visible}h1,h2,h3,h4,h5,h6{margin-top:0;margin-bottom:.5rem}p{margin-top:0;margin-bottom:1rem}abbr[data-original-title],abbr[title]{text-decoration:underline;-webkit-text-decoration:underline dotted;text-decoration:underline dotted;cursor:help;border-bottom:0;-webkit-text-decoration-skip-ink:none;text-decoration-skip-ink:none}address{margin-bottom:1rem;font-style:normal;line-height:inherit}dl,ol,ul{margin-top:0;margin-bottom:1rem}ol ol,ol ul,ul ol,ul ul{margin-bottom:0}dt{font-weight:700}dd{margin-bottom:.5rem;margin-left:0}blockquote{margin:0 0 1rem}b,strong{font-weight:bolder}small{font-size:80%}sub,sup{position:relative;font-size:75%;line-height:0;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}a{color:#007bff;text-decoration:none;background-color:transparent}a:hover{color:#0056b3;text-decoration:underline}a:not([href]){color:inherit;text-decoration:none}a:not([href]):hover{color:inherit;text-decoration:none}code,kbd,pre,samp{font-family:SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace;font-size:1em}pre{margin-top:0;margin-bottom:1rem;overflow:auto}figure{margin:0 0 1rem}img{vertical-align:middle;border-style:none}svg{overflow:hidden;vertical-align:middle}table{border-collapse:collapse}caption{padding-top:.75rem;padding-bottom:.75rem;color:#6c757d;text-align:left;caption-side:bottom}th{text-align:inherit}label{display:inline-block;margin-bottom:.5rem}button{border-radius:0}button:focus{outline:1px dotted;outline:5px auto -webkit-focus-ring-color}button,input,optgroup,select,textarea{margin:0;font-family:inherit;font-size:inherit;line-height:inherit}button,input{overflow:visible}button,select{text-transform:none}select{word-wrap:normal}[type=button],[type=reset],[type=submit],button{-webkit-appearance:button}[type=button]:not(:disabled),[type=reset]:not(:disabled),[type=submit]:not(:disabled),button:not(:disabled){cursor:pointer}[type=button]::-moz-focus-inner,[type=reset]::-moz-focus-inner,[type=submit]::-moz-focus-inner,button::-moz-focus-inner{padding:0;border-style:none}input[type=checkbox],input[type=radio]{box-sizing:border-box;padding:0}input[type=date],input[type=datetime-local],input[type=month],input[type=time]{-webkit-appearance:listbox}textarea{overflow:auto;resize:vertical}fieldset{min-width:0;padding:0;margin:0;border:0}legend{display:block;width:100%;max-width:100%;padding:0;margin-bottom:.5rem;font-size:1.5rem;line-height:inherit;color:inherit;white-space:normal}progress{vertical-align:baseline}[type=number]::-webkit-inner-spin-button,[type=number]::-webkit-outer-spin-button{height:auto}[type=search]{outline-offset:-2px;-webkit-appearance:none}[type=search]::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{font:inherit;-webkit-appearance:button}output{display:inline-block}summary{display:list-item;cursor:pointer}template{display:none}[hidden]{display:none!important} | |||||
| /*# sourceMappingURL=bootstrap-reboot.min.css.map */ | |||||
| @@ -0,0 +1,49 @@ | |||||
| html, | |||||
| body { | |||||
| height: 100%; | |||||
| } | |||||
| body { | |||||
| display: -ms-flexbox; | |||||
| display: -webkit-box; | |||||
| display: flex; | |||||
| -ms-flex-align: center; | |||||
| -ms-flex-pack: center; | |||||
| -webkit-box-align: center; | |||||
| align-items: center; | |||||
| -webkit-box-pack: center; | |||||
| justify-content: center; | |||||
| padding-top: 40px; | |||||
| padding-bottom: 40px; | |||||
| background-color: #f5f5f5; | |||||
| } | |||||
| .form-signin { | |||||
| width: 100%; | |||||
| max-width: 330px; | |||||
| padding: 15px; | |||||
| margin: 0 auto; | |||||
| } | |||||
| .form-signin .checkbox { | |||||
| font-weight: 400; | |||||
| } | |||||
| .form-signin .form-control { | |||||
| position: relative; | |||||
| box-sizing: border-box; | |||||
| height: auto; | |||||
| padding: 10px; | |||||
| font-size: 16px; | |||||
| } | |||||
| .form-signin .form-control:focus { | |||||
| z-index: 2; | |||||
| } | |||||
| .form-signin input[type="email"] { | |||||
| margin-bottom: -1px; | |||||
| border-bottom-right-radius: 0; | |||||
| border-bottom-left-radius: 0; | |||||
| } | |||||
| .form-signin input[type="password"] { | |||||
| margin-bottom: 10px; | |||||
| border-top-left-radius: 0; | |||||
| border-top-right-radius: 0; | |||||
| } | |||||
| @@ -0,0 +1,76 @@ | |||||
| html, | |||||
| body { | |||||
| overflow-x: hidden; /* Prevent scroll on narrow devices */ | |||||
| } | |||||
| body { | |||||
| padding-top: 56px; | |||||
| } | |||||
| @media (max-width: 991.98px) { | |||||
| .offcanvas-collapse { | |||||
| position: fixed; | |||||
| top: 56px; /* Height of navbar */ | |||||
| bottom: 0; | |||||
| left: 100%; | |||||
| width: 100%; | |||||
| padding-right: 1rem; | |||||
| padding-left: 1rem; | |||||
| overflow-y: auto; | |||||
| visibility: hidden; | |||||
| background-color: #343a40; | |||||
| transition: visibility .3s ease-in-out, -webkit-transform .3s ease-in-out; | |||||
| transition: transform .3s ease-in-out, visibility .3s ease-in-out; | |||||
| transition: transform .3s ease-in-out, visibility .3s ease-in-out, -webkit-transform .3s ease-in-out; | |||||
| } | |||||
| .offcanvas-collapse.open { | |||||
| visibility: visible; | |||||
| -webkit-transform: translateX(-100%); | |||||
| transform: translateX(-100%); | |||||
| } | |||||
| } | |||||
| .nav-scroller { | |||||
| position: relative; | |||||
| z-index: 2; | |||||
| height: 2.75rem; | |||||
| overflow-y: hidden; | |||||
| } | |||||
| .nav-scroller .nav { | |||||
| display: -ms-flexbox; | |||||
| display: flex; | |||||
| -ms-flex-wrap: nowrap; | |||||
| flex-wrap: nowrap; | |||||
| padding-bottom: 1rem; | |||||
| margin-top: -1px; | |||||
| overflow-x: auto; | |||||
| color: rgba(255, 255, 255, .75); | |||||
| text-align: center; | |||||
| white-space: nowrap; | |||||
| -webkit-overflow-scrolling: touch; | |||||
| } | |||||
| .nav-underline .nav-link { | |||||
| padding-top: .75rem; | |||||
| padding-bottom: .75rem; | |||||
| font-size: .875rem; | |||||
| color: #6c757d; | |||||
| } | |||||
| .nav-underline .nav-link:hover { | |||||
| color: #007bff; | |||||
| } | |||||
| .nav-underline .active { | |||||
| font-weight: 500; | |||||
| color: #343a40; | |||||
| } | |||||
| .text-white-50 { color: rgba(255, 255, 255, .5); } | |||||
| .bg-purple { background-color: #6f42c1; } | |||||
| .lh-100 { line-height: 1; } | |||||
| .lh-125 { line-height: 1.25; } | |||||
| .lh-150 { line-height: 1.5; } | |||||
| @@ -1,10 +0,0 @@ | |||||
| <?php | |||||
| $id = filter_input(INPUT_GET,'id', FILTER_SANITIZE_NUMBER_INT); | |||||
| $db = new PDO('mysql:host=localhost;dbname=lpcgamer','phpuser','php'); | |||||
| $reqNewName='Delete FROM users where idusers=?'; | |||||
| $prep=$db->prepare($reqNewName); | |||||
| $prep->bindParam(1, $id, PDO::PARAM_STR); | |||||
| $prep->execute(); | |||||
| ?> | |||||
| <a class="message" href='administrateur.php' title='Supprimer'>Utilisateur Effacé!</a> | |||||
| @@ -1,40 +0,0 @@ | |||||
| <?php | |||||
| include 'include/header.php'; | |||||
| $objetpdohomepage = new PDO('mysql:host=localhost;dbname=lpcgamer','phpuser','php'); | |||||
| $reponse = $objetpdohomepage->query('SELECT * FROM products'); | |||||
| ?> | |||||
| <header class="header"><a class="logo"><img height="150px" src=./img/Logoburned.png></a><a class="header-middle-area"></a><a class="bouton_header" href="postformulaire.php">Vendre </a><a class="bouton_header" href="inscription.php">Inscription</a><a class="bouton_header" href="connexion.php">Connexion</a></header> | |||||
| <div class="corp"> | |||||
| <aside class="aside"> | |||||
| <label id="qualitelabel"> Annonces: </label> | |||||
| </aside> | |||||
| <a class="main"> | |||||
| <?php while ($donnees = $reponse->fetch()) | |||||
| { | |||||
| ?> | |||||
| <strong><?php echo $donnees['name']; ?></strong><br> | |||||
| <strong> Qualités:</strong> <?php echo $donnees['quality']; ?> <br> | |||||
| <strong>Prix:</strong> <?php echo $donnees['price']; ?> € <br> | |||||
| <strong>Prix de livraison: </strong><?php echo $donnees['deliveryprice']; ?> € <br> | |||||
| <strong>Description du produit: </strong> <?php echo $donnees['content']; ?> <br> | |||||
| <strong>Expéditeur </strong> <?php echo $donnees['idusers']; ?> <br> | |||||
| <br> | |||||
| <?php | |||||
| } | |||||
| $reponse->closeCursor(); // Termine le traitement de la requête | |||||
| ?> | |||||
| </a> | |||||
| </div> | |||||
| </body> | |||||
| </html> | |||||
| @@ -0,0 +1,28 @@ | |||||
| <?php | |||||
| session_start(); | |||||
| try { | |||||
| $mysql = new PDO('mysql:host=localhost;dbname=clyde','root',''); | |||||
| } catch (PDOException $e) { | |||||
| die('Une erreur est survenue lors de la connexion à la base de données : ' . $e->getMessage()); | |||||
| } | |||||
| function isLogged() | |||||
| { | |||||
| global $mysql; | |||||
| if(!isset($_SESSION['login']) or !isset($_SESSION['password'])){ | |||||
| return false; | |||||
| } | |||||
| $query = $mysql->prepare('SELECT * FROM users WHERE login = :login'); | |||||
| $query->bindValue(':login', $_SESSION['login'], PDO::PARAM_STR); | |||||
| $query->execute(); | |||||
| $data = $query->fetch(PDO::FETCH_BOTH); | |||||
| if ($data['password'] == $_SESSION['password']) // Acces OK ! | |||||
| { | |||||
| $query->CloseCursor(); | |||||
| return true; | |||||
| } | |||||
| $query->CloseCursor(); | |||||
| return false; | |||||
| } | |||||
| @@ -0,0 +1,14 @@ | |||||
| <!-- Bootstrap core JavaScript | |||||
| ================================================== --> | |||||
| <!-- Placed at the end of the document so the pages load faster --> | |||||
| <script src="https://code.jquery.com/jquery-3.2.1.slim.min.js" | |||||
| integrity="sha384-KJ3o2DKtIkvYIK3UENzmM7KCkRr/rE9/Qpg6aAZGJwFDMVNA/GpGFF93hXpG5KkN" | |||||
| crossorigin="anonymous"></script> | |||||
| <script>window.jQuery || document.write('<script src="js/vendor/jquery-slim.min.js"><\/script>')</script> | |||||
| <script src="js/vendor/popper.min.js"></script> | |||||
| <script src="js/bootstrap.min.js"></script> | |||||
| <script src="js/vendor/holder.min.js"></script> | |||||
| <script src="js/offcanvas.js"></script> | |||||
| </body> | |||||
| </html> | |||||
| @@ -0,0 +1,70 @@ | |||||
| <?php | |||||
| require_once('inc/core.php'); | |||||
| ?> | |||||
| <!doctype html> | |||||
| <html lang="en"> | |||||
| <head> | |||||
| <meta charset="utf-8"> | |||||
| <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"> | |||||
| <meta name="description" content=""> | |||||
| <meta name="author" content=""> | |||||
| <link rel="icon" href="img/favicon.ico"> | |||||
| <title>Le coin des g@mer</title> | |||||
| <link rel="canonical" href="https://getbootstrap.com/docs/4.0/examples/offcanvas/"> | |||||
| <!-- Bootstrap core CSS --> | |||||
| <link href="css/bootstrap.min.css" rel="stylesheet"> | |||||
| <!-- Custom styles for this template --> | |||||
| <link href="css/offcanvas.css" rel="stylesheet"> | |||||
| </head> | |||||
| <body class="bg-light"> | |||||
| <nav class="navbar navbar-expand-md fixed-top navbar-dark bg-dark"> | |||||
| <a class="navbar-brand" href="index.php">Le coin des g@mer</a> | |||||
| <button class="navbar-toggler p-0 border-0" type="button" data-toggle="offcanvas"> | |||||
| <span class="navbar-toggler-icon"></span> | |||||
| </button> | |||||
| <div class="navbar-collapse offcanvas-collapse" id="navbarsExampleDefault"> | |||||
| <ul class="navbar-nav mr-auto"> | |||||
| <li class="nav-item"> | |||||
| <a class="nav-link" href="index.php">Accueil</a> | |||||
| </li> | |||||
| <?php if (isLogged()) { ?> | |||||
| <li class="nav-item"> | |||||
| <a class="nav-link" href="sell.php">Vendre</a> | |||||
| </li> | |||||
| <?php } else { ?> | |||||
| <li class="nav-item"> | |||||
| <a class="nav-link" href="login.php?r=sell.php">Vendre</a> | |||||
| </li> | |||||
| <?php } ?> | |||||
| </ul> | |||||
| <?php if (isLogged()) { ?> | |||||
| <a class="btn btn-outline-danger my-2 my-sm-0" href="logout.php">Deconnexion</a> | |||||
| <?php } else { ?> | |||||
| <a class="btn btn-outline-primary my-2 my-sm-0" href="login.php">Connexion</a> | |||||
| <?php } ?> | |||||
| </div> | |||||
| </nav> | |||||
| <?php if (isLogged()) { ?> | |||||
| <div class="nav-scroller bg-white box-shadow"> | |||||
| <nav class="nav nav-underline"> | |||||
| <a class="nav-link active" href="#">Jean Michel</a> | |||||
| <a class="nav-link" href="my_sell.php"> | |||||
| Produits en vente | |||||
| <span class="badge badge-pill bg-light align-text-bottom"> | |||||
| <?php | |||||
| $query = $mysql->query('SELECT * FROM products WHERE idusers = "' . $_SESSION['id'] . '"'); | |||||
| echo $query->rowCount(); | |||||
| ?> | |||||
| </span> | |||||
| </a> | |||||
| <a class="nav-link" href="#">Mon profil</a> | |||||
| </nav> | |||||
| </div> | |||||
| <?php } ?> | |||||
| @@ -1,11 +1,37 @@ | |||||
| <?php | |||||
| include 'include/header.php'; | |||||
| ?> | |||||
| <a href='connexion.php'>connexion</a><br> | |||||
| <a href='inscription.php'>inscription</a><br> | |||||
| <a href='profil.php'>profil</a><br> | |||||
| <a href='homepage.php'>Home page</a><br> | |||||
| <a href='postformulaire.php'>poster</a><br> | |||||
| <?php | |||||
| include 'include/footer.php'; | |||||
| ?> | |||||
| <?php include('inc/header.php'); ?> | |||||
| <main role="main" class="container"> | |||||
| <div class="d-flex align-items-center p-3 my-3 text-white-50 bg-purple rounded box-shadow"> | |||||
| <div class="lh-100"> | |||||
| <h6 class="mb-0 text-white lh-100">Le coin des g@mer</h6> | |||||
| <small>Avec un @ à la place du A</small> | |||||
| </div> | |||||
| </div> | |||||
| <div class="my-3 p-3 bg-white rounded box-shadow"> | |||||
| <h6 class="border-bottom border-gray pb-2 mb-0">Annonces récentes</h6> | |||||
| <?php | |||||
| $reponse = $mysql->query('SELECT * FROM products ORDER BY date DESC LIMIT 20'); | |||||
| while ($donnees = $reponse->fetch()) { ?> | |||||
| <div class="media text-muted pt-3"> | |||||
| <img data-src="holder.js/32x32?theme=thumb&bg=e83e8c&fg=e83e8c&size=1" alt="" class="mr-2 rounded"> | |||||
| <p class="media-body pb-3 mb-0 small lh-125 border-bottom border-gray"> | |||||
| <strong class="d-block text-gray-dark"><?php echo $donnees['name']; ?></strong><br> | |||||
| Qualité: <i><?php echo $donnees['quality']; ?></i><br> | |||||
| Prix: <i><?php echo $donnees['price']; ?> €</i> <br> | |||||
| Prix de livraison: <i><?php echo $donnees['deliveryprice']; ?> €</i> <br> | |||||
| Description du produit: <i><?php echo $donnees['content']; ?></i> <br> | |||||
| Expéditeur <i><?php echo $donnees['idusers']; ?></i> <br> | |||||
| </p> | |||||
| </div> | |||||
| <?php | |||||
| } | |||||
| $reponse->closeCursor(); // Termine le traitement de la requête | |||||
| ?> | |||||
| <small class="d-block text-right mt-3"> | |||||
| <a href="view.php">Voir tout</a> | |||||
| </small> | |||||
| </div> | |||||
| </main> | |||||
| <?php include('inc/footer.php'); ?> | |||||
| @@ -0,0 +1,7 @@ | |||||
| $(function () { | |||||
| 'use strict' | |||||
| $('[data-toggle="offcanvas"]').on('click', function () { | |||||
| $('.offcanvas-collapse').toggleClass('open') | |||||
| }) | |||||
| }) | |||||
| @@ -0,0 +1,112 @@ | |||||
| // NOTICE!! DO NOT USE ANY OF THIS JAVASCRIPT | |||||
| // IT'S ALL JUST JUNK FOR OUR DOCS! | |||||
| // ++++++++++++++++++++++++++++++++++++++++++ | |||||
| /*! | |||||
| * JavaScript for Bootstrap's docs (https://getbootstrap.com/) | |||||
| * Copyright 2011-2019 The Bootstrap Authors | |||||
| * Copyright 2011-2019 Twitter, Inc. | |||||
| * Licensed under the Creative Commons Attribution 3.0 Unported License. | |||||
| * For details, see https://creativecommons.org/licenses/by/3.0/. | |||||
| */ | |||||
| /* global ClipboardJS: false, anchors: false, bsCustomFileInput: false */ | |||||
| (function ($) { | |||||
| 'use strict' | |||||
| $(function () { | |||||
| // Tooltip and popover demos | |||||
| $('.tooltip-demo').tooltip({ | |||||
| selector: '[data-toggle="tooltip"]', | |||||
| container: 'body' | |||||
| }) | |||||
| $('[data-toggle="popover"]').popover() | |||||
| $('.toast') | |||||
| .toast({ | |||||
| autohide: false | |||||
| }) | |||||
| .toast('show') | |||||
| // Demos within modals | |||||
| $('.tooltip-test').tooltip() | |||||
| $('.popover-test').popover() | |||||
| // Indeterminate checkbox example | |||||
| $('.bd-example-indeterminate [type="checkbox"]').prop('indeterminate', true) | |||||
| // Disable empty links in docs examples | |||||
| $('.bd-content [href="#"]').click(function (e) { | |||||
| e.preventDefault() | |||||
| }) | |||||
| // Modal relatedTarget demo | |||||
| $('#exampleModal').on('show.bs.modal', function (event) { | |||||
| var $button = $(event.relatedTarget) // Button that triggered the modal | |||||
| var recipient = $button.data('whatever') // Extract info from data-* attributes | |||||
| // If necessary, you could initiate an AJAX request here (and then do the updating in a callback). | |||||
| // Update the modal's content. We'll use jQuery here, but you could use a data binding library or other methods instead. | |||||
| var $modal = $(this) | |||||
| $modal.find('.modal-title').text('New message to ' + recipient) | |||||
| $modal.find('.modal-body input').val(recipient) | |||||
| }) | |||||
| // Activate animated progress bar | |||||
| $('.bd-toggle-animated-progress').on('click', function () { | |||||
| $(this).siblings('.progress').find('.progress-bar-striped').toggleClass('progress-bar-animated') | |||||
| }) | |||||
| // Insert copy to clipboard button before .highlight | |||||
| $('figure.highlight, div.highlight').each(function () { | |||||
| var btnHtml = '<div class="bd-clipboard"><button type="button" class="btn-clipboard" title="Copy to clipboard">Copy</button></div>' | |||||
| $(this).before(btnHtml) | |||||
| $('.btn-clipboard') | |||||
| .tooltip() | |||||
| .on('mouseleave', function () { | |||||
| // Explicitly hide tooltip, since after clicking it remains | |||||
| // focused (as it's a button), so tooltip would otherwise | |||||
| // remain visible until focus is moved away | |||||
| $(this).tooltip('hide') | |||||
| }) | |||||
| }) | |||||
| var clipboard = new ClipboardJS('.btn-clipboard', { | |||||
| target: function (trigger) { | |||||
| return trigger.parentNode.nextElementSibling | |||||
| } | |||||
| }) | |||||
| clipboard.on('success', function (e) { | |||||
| $(e.trigger) | |||||
| .attr('title', 'Copied!') | |||||
| .tooltip('_fixTitle') | |||||
| .tooltip('show') | |||||
| .attr('title', 'Copy to clipboard') | |||||
| .tooltip('_fixTitle') | |||||
| e.clearSelection() | |||||
| }) | |||||
| clipboard.on('error', function (e) { | |||||
| var modifierKey = /Mac/i.test(navigator.userAgent) ? '\u2318' : 'Ctrl-' | |||||
| var fallbackMsg = 'Press ' + modifierKey + 'C to copy' | |||||
| $(e.trigger) | |||||
| .attr('title', fallbackMsg) | |||||
| .tooltip('_fixTitle') | |||||
| .tooltip('show') | |||||
| .attr('title', 'Copy to clipboard') | |||||
| .tooltip('_fixTitle') | |||||
| }) | |||||
| anchors.options = { | |||||
| icon: '#' | |||||
| } | |||||
| anchors.add('.bd-content > h2, .bd-content > h3, .bd-content > h4, .bd-content > h5') | |||||
| $('.bd-content').children('h2, h3, h4, h5').wrapInner('<span class="bd-content-title"></span>') | |||||
| bsCustomFileInput.init() | |||||
| }) | |||||
| }(jQuery)) | |||||
| @@ -0,0 +1,47 @@ | |||||
| // NOTICE!! DO NOT USE ANY OF THIS JAVASCRIPT | |||||
| // IT'S ALL JUST JUNK FOR OUR DOCS! | |||||
| // ++++++++++++++++++++++++++++++++++++++++++ | |||||
| // Intended to prevent false-positive bug reports about Bootstrap not working properly in old versions of IE due to folks testing using IE's unreliable emulation modes. | |||||
| (function () { | |||||
| 'use strict' | |||||
| function emulatedIEMajorVersion() { | |||||
| var groups = /MSIE ([0-9.]+)/.exec(window.navigator.userAgent) | |||||
| if (groups === null) { | |||||
| return null | |||||
| } | |||||
| var ieVersionNum = parseInt(groups[1], 10) | |||||
| var ieMajorVersion = Math.floor(ieVersionNum) | |||||
| return ieMajorVersion | |||||
| } | |||||
| function actualNonEmulatedIEMajorVersion() { | |||||
| // Detects the actual version of IE in use, even if it's in an older-IE emulation mode. | |||||
| // IE JavaScript conditional compilation docs: https://msdn.microsoft.com/library/121hztk3%28v=vs.94%29.aspx | |||||
| // @cc_on docs: https://msdn.microsoft.com/library/8ka90k2e%28v=vs.94%29.aspx | |||||
| var jscriptVersion = new Function('/*@cc_on return @_jscript_version; @*/')() // eslint-disable-line no-new-func | |||||
| if (typeof jscriptVersion === 'undefined') { | |||||
| return 11 // IE11+ not in emulation mode | |||||
| } | |||||
| if (jscriptVersion < 9) { | |||||
| return 8 // IE8 (or lower; haven't tested on IE<8) | |||||
| } | |||||
| return jscriptVersion // IE9 or IE10 in any mode, or IE11 in non-IE11 mode | |||||
| } | |||||
| var ua = window.navigator.userAgent | |||||
| if (ua.indexOf('Opera') > -1 || ua.indexOf('Presto') > -1) { | |||||
| return // Opera, which might pretend to be IE | |||||
| } | |||||
| var emulated = emulatedIEMajorVersion() | |||||
| if (emulated === null) { | |||||
| return // Not IE | |||||
| } | |||||
| var nonEmulated = actualNonEmulatedIEMajorVersion() | |||||
| if (emulated !== nonEmulated) { | |||||
| // eslint-disable-next-line no-alert | |||||
| window.alert('WARNING: You appear to be using IE' + nonEmulated + ' in IE' + emulated + ' emulation mode.\nIE emulation modes can behave significantly differently from ACTUAL older versions of IE.\nPLEASE DON\'T FILE BOOTSTRAP BUGS based on testing in IE emulation modes!') | |||||
| } | |||||
| }()) | |||||
| @@ -0,0 +1,59 @@ | |||||
| // NOTICE!! DO NOT USE ANY OF THIS JAVASCRIPT | |||||
| // IT'S ALL JUST JUNK FOR OUR DOCS! | |||||
| // ++++++++++++++++++++++++++++++++++++++++++ | |||||
| (function () { | |||||
| 'use strict' | |||||
| if (!window.docsearch) { | |||||
| return | |||||
| } | |||||
| var inputElement = document.getElementById('search-input') | |||||
| var siteDocsVersion = inputElement.getAttribute('data-docs-version') | |||||
| function getOrigin() { | |||||
| var location = window.location | |||||
| var origin = location.origin | |||||
| if (!origin) { | |||||
| var port = location.port ? ':' + location.port : '' | |||||
| origin = location.protocol + '//' + location.hostname + port | |||||
| } | |||||
| return origin | |||||
| } | |||||
| window.docsearch({ | |||||
| apiKey: '5990ad008512000bba2cf951ccf0332f', | |||||
| indexName: 'bootstrap', | |||||
| inputSelector: '#search-input', | |||||
| algoliaOptions: { | |||||
| facetFilters: ['version:' + siteDocsVersion] | |||||
| }, | |||||
| transformData: function (hits) { | |||||
| return hits.map(function (hit) { | |||||
| var currentUrl = getOrigin() | |||||
| var liveUrl = 'https://getbootstrap.com' | |||||
| // When in production, return the result as is, | |||||
| // otherwise remove our url from it. | |||||
| // eslint-disable-next-line no-negated-condition | |||||
| hit.url = currentUrl.indexOf(liveUrl) !== -1 | |||||
| ? hit.url | |||||
| : hit.url.replace(liveUrl, '') | |||||
| // Prevent jumping to first header | |||||
| if (hit.anchor === 'content') { | |||||
| hit.url = hit.url.replace(/#content$/, '') | |||||
| hit.anchor = null | |||||
| } | |||||
| return hit | |||||
| }) | |||||
| }, | |||||
| // Set debug to `true` if you want to inspect the dropdown | |||||
| debug: false | |||||
| }) | |||||
| }()) | |||||
| @@ -0,0 +1,7 @@ | |||||
| /*! | |||||
| * bsCustomFileInput v1.3.2 (https://github.com/Johann-S/bs-custom-file-input) | |||||
| * Copyright 2018 - 2019 Johann-S <johann.servoire@gmail.com> | |||||
| * Licensed under MIT (https://github.com/Johann-S/bs-custom-file-input/blob/master/LICENSE) | |||||
| */ | |||||
| !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e=e||self).bsCustomFileInput=t()}(this,function(){"use strict";var d={CUSTOMFILE:'.custom-file input[type="file"]',CUSTOMFILELABEL:".custom-file-label",FORM:"form",INPUT:"input"},r=function(e){if(0<e.childNodes.length)for(var t=[].slice.call(e.childNodes),n=0;n<t.length;n++){var r=t[n];if(3!==r.nodeType)return r}return e},u=function(e){var t=e.bsCustomFileInput.defaultText,n=e.parentNode.querySelector(d.CUSTOMFILELABEL);n&&(r(n).innerHTML=t)},n=!!window.File,l=function(e){if(e.hasAttribute("multiple")&&n)return[].slice.call(e.files).map(function(e){return e.name}).join(", ");if(-1===e.value.indexOf("fakepath"))return e.value;var t=e.value.split("\\");return t[t.length-1]};function v(){var e=this.parentNode.querySelector(d.CUSTOMFILELABEL);if(e){var t=r(e),n=l(this);n.length?t.innerHTML=n:u(this)}}function p(){for(var e=[].slice.call(this.querySelectorAll(d.INPUT)).filter(function(e){return!!e.bsCustomFileInput}),t=0,n=e.length;t<n;t++)u(e[t])}var m="bsCustomFileInput",L="reset",h="change";return{init:function(e,t){void 0===e&&(e=d.CUSTOMFILE),void 0===t&&(t=d.FORM);for(var n,r,l,i=[].slice.call(document.querySelectorAll(e)),o=[].slice.call(document.querySelectorAll(t)),u=0,c=i.length;u<c;u++){var f=i[u];Object.defineProperty(f,m,{value:{defaultText:(n=f,r=void 0,void 0,r="",l=n.parentNode.querySelector(d.CUSTOMFILELABEL),l&&(r=l.innerHTML),r)},writable:!0}),v.call(f),f.addEventListener(h,v)}for(var a=0,s=o.length;a<s;a++)o[a].addEventListener(L,p),Object.defineProperty(o[a],m,{value:!0,writable:!0})},destroy:function(){for(var e=[].slice.call(document.querySelectorAll(d.FORM)).filter(function(e){return!!e.bsCustomFileInput}),t=[].slice.call(document.querySelectorAll(d.INPUT)).filter(function(e){return!!e.bsCustomFileInput}),n=0,r=t.length;n<r;n++){var l=t[n];u(l),l[m]=void 0,l.removeEventListener(h,v)}for(var i=0,o=e.length;i<o;i++)e[i].removeEventListener(L,p),e[i][m]=void 0}}}); | |||||
| //# sourceMappingURL=bs-custom-file-input.min.js.map | |||||
| @@ -0,0 +1,77 @@ | |||||
| <?php | |||||
| include('inc/core.php'); | |||||
| if(isLogged()){ | |||||
| header('Location: index.php'); | |||||
| die('<a href="login.php">Cliquez ici si vous n\'êtes pas redirigé automatiquement'); | |||||
| } | |||||
| if (isset($_POST['inputEmail']) && isset($_POST['inputPassword'])) { | |||||
| $login = filter_input(INPUT_POST, 'inputEmail'); | |||||
| $password = hash('sha256', filter_input(INPUT_POST, 'inputPassword')); | |||||
| $query = $mysql->prepare('SELECT * FROM users WHERE login = :login'); | |||||
| $query->bindValue(':login', $login, PDO::PARAM_STR); | |||||
| $query->execute(); | |||||
| $data = $query->fetch(PDO::FETCH_BOTH); | |||||
| if ($data['password'] == $password) // Acces OK ! | |||||
| { | |||||
| $_SESSION['login'] = $data['login']; | |||||
| $_SESSION['id'] = $data['idusers']; | |||||
| $_SESSION['password'] = $password; | |||||
| if (isset($_GET['r'])) { | |||||
| header('Location: ' . $_GET['r']); | |||||
| } else { | |||||
| header('Location: index.php'); | |||||
| } | |||||
| } else // Acces pas OK ! | |||||
| { | |||||
| $message = 'Identifiants incorrects'; | |||||
| $message_type = "danger"; | |||||
| } | |||||
| $query->CloseCursor(); | |||||
| } | |||||
| ?> | |||||
| <!doctype html> | |||||
| <html lang="fr"> | |||||
| <head> | |||||
| <meta charset="utf-8"> | |||||
| <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"> | |||||
| <meta name="description" content=""> | |||||
| <meta name="author" content=""> | |||||
| <link rel="icon" href="img/favicon.ico"> | |||||
| <title>Le coin des g@mers - Identification</title> | |||||
| <link rel="canonical" href="https://getbootstrap.com/docs/4.0/examples/sign-in/"> | |||||
| <!-- Bootstrap core CSS --> | |||||
| <link href="css/bootstrap.min.css" rel="stylesheet"> | |||||
| <!-- Custom styles for this template --> | |||||
| <link href="css/login.css" rel="stylesheet"> | |||||
| </head> | |||||
| <body class="text-center"> | |||||
| <form class="form-signin" method="post"> | |||||
| <img class="mb-4" src="https://getbootstrap.com/docs/4.0/assets/brand/bootstrap-solid.svg" alt="" width="72" | |||||
| height="72"> | |||||
| <h1 class="h3 mb-3 font-weight-normal">Identification</h1> | |||||
| <?php if (isset($message)) { ?> | |||||
| <div class="alert alert-<?= $message_type ?>" role="alert"> | |||||
| <?= $message ?> | |||||
| </div> | |||||
| <?php } ?> | |||||
| <label for="inputEmail" class="sr-only">Email</label> | |||||
| <input type="email" id="inputEmail" name="inputEmail" class="form-control" placeholder="Email" required autofocus> | |||||
| <label for="inputPassword" class="sr-only">Mot de passe</label> | |||||
| <input type="password" id="inputPassword" name="inputPassword" class="form-control" placeholder="Mot de passe" | |||||
| required> | |||||
| <button class="btn btn-lg btn-primary btn-block" type="submit">Connexion</button> | |||||
| <br> | |||||
| <a class="mt-5 mb-3" href="register.php">S'inscrire</a> | |||||
| <p class="mt-5 mb-3 text-muted">© 2020</p> | |||||
| </form> | |||||
| </body> | |||||
| </html> | |||||
| @@ -0,0 +1,5 @@ | |||||
| <?php session_start(); | |||||
| session_destroy(); | |||||
| header('Location: index.php'); | |||||
| ?> | |||||
| <a href="index.php">Dans le cas où vous n'êtes pas redirigé, cliquez ici.</a> | |||||
| @@ -0,0 +1,88 @@ | |||||
| <?php | |||||
| include('inc/core.php'); | |||||
| if (!isLogged()) { | |||||
| header('Location: login.php'); | |||||
| die('<a href="login.php">Cliquez ici si vous n\'êtes pas redirigé automatiquement'); | |||||
| } | |||||
| if (isset($_GET['a'])) { | |||||
| if ($_GET['a'] == 'rm' && isset($_GET['id'])) { | |||||
| $query = $mysql->prepare('DELETE FROM products WHERE idproducts = :id'); | |||||
| $query->bindValue(':id', $_GET['id'], PDO::PARAM_STR); | |||||
| $return = $query->execute(); | |||||
| if($return) | |||||
| { | |||||
| $message = $_SESSION['message'] = 'Cette annonce a bien été supprimée.'; | |||||
| $message_type = $_SESSION['message_type'] = 'success'; | |||||
| //header('Location: my_sell.php'); | |||||
| } | |||||
| else | |||||
| { | |||||
| $message = $_SESSION['message'] = 'Une erreur s\'est produite lors de la suppression de l\'annonce'; | |||||
| $message_type = $_SESSION['message_type'] = 'danger'; | |||||
| header('Location: my_sell.php'); | |||||
| } | |||||
| } | |||||
| } | |||||
| include('inc/header.php'); | |||||
| ?> | |||||
| <main role="main" class="container"> | |||||
| <div class="d-flex align-items-center p-3 my-3 text-white-50 bg-purple rounded box-shadow"> | |||||
| <div class="lh-100"> | |||||
| <h6 class="mb-0 text-white lh-100">Le coin des g@mer</h6> | |||||
| <small>Avec un @ à la place du A</small> | |||||
| </div> | |||||
| </div> | |||||
| <?php if (isset($message) or isset($_SESSION['message'])) { ?> | |||||
| <div class="alert alert-<?php if (isset($message)) { echo $message_type; } else {echo $_SESSION['message_type'];} ?>" role="alert"> | |||||
| <?php | |||||
| if (isset($message)) { | |||||
| echo $message; | |||||
| } else { | |||||
| echo $_SESSION['message']; | |||||
| unset($_SESSION['message']); | |||||
| unset($_SESSION['message_type']); | |||||
| } | |||||
| ?> | |||||
| </div> | |||||
| <?php } ?> | |||||
| <div class="my-3 p-3 bg-white rounded box-shadow"> | |||||
| <h6 class="border-bottom border-gray pb-2 mb-0">Mes annonces</h6> | |||||
| <?php | |||||
| $reponse = $mysql->query('SELECT * FROM products WHERE idusers = "' . $_SESSION['id'] . '" ORDER BY date DESC'); | |||||
| if($reponse->fetchColumn() > 0) { | |||||
| while ($donnees = $reponse->fetch()) { ?> | |||||
| <div class="media text-muted pt-3"> | |||||
| <img data-src="holder.js/32x32?theme=thumb&bg=e83e8c&fg=e83e8c&size=1" alt="" | |||||
| class="mr-2 rounded"> | |||||
| <p class="media-body pb-3 mb-0 small lh-125 border-bottom border-gray"> | |||||
| <strong class="d-block text-gray-dark"><?php echo $donnees['name']; ?></strong><br> | |||||
| Qualité: <i><?php echo $donnees['quality']; ?></i><br> | |||||
| Prix: <i><?php echo $donnees['price']; ?> €</i> <br> | |||||
| Prix de livraison: <i><?php echo $donnees['deliveryprice']; ?> €</i> <br> | |||||
| Description du produit: <i><?php echo $donnees['content']; ?></i> <br> | |||||
| Expéditeur <i><?php echo $donnees['idusers']; ?></i> <br> | |||||
| </p> | |||||
| <small class="d-block text-right mt-3"> | |||||
| <a href="my_sell.php?a=rm&id=<?php echo $donnees['idproducts']; ?>">Supprimer</a> | |||||
| </small> | |||||
| </div> | |||||
| <?php | |||||
| } | |||||
| } | |||||
| else{ ?> | |||||
| <div class="media text-muted pt-3"> | |||||
| <p class="media-body pb-3 mb-0 small lh-125 border-bottom border-gray"> | |||||
| <strong class="d-block text-gray-dark">Vous n'avez aucune annonce en ligne.</strong> | |||||
| </p> | |||||
| </div> | |||||
| <?php } | |||||
| $reponse->closeCursor(); // Termine le traitement de la requête | |||||
| ?> | |||||
| </div> | |||||
| </main> | |||||
| <?php include('inc/footer.php'); ?> | |||||
| @@ -0,0 +1,34 @@ | |||||
| <?php | |||||
| session_start(); | |||||
| include 'include/header.php'; | |||||
| $pdoStat = $mysql->prepare('INSERT INTO products VALUES (NULL, :nom, :qualite, :prix, :prixlivr, :pays, :description, :iduser, :mail)'); | |||||
| $query = $mysql->prepare("SELECT login FROM users WHERE idusers = :userid"); | |||||
| $query->bindValue(':userid', $_SESSION['id']); | |||||
| $query->execute(); | |||||
| $useremail = $query->fetch(PDO::FETCH_ASSOC); | |||||
| $pdoStat->bindValue(':nom', $_POST['name'], PDO::PARAM_STR); | |||||
| $pdoStat->bindValue(':qualite', $_POST['quality'], PDO::PARAM_STR); | |||||
| $pdoStat->bindValue(':prix', $_POST['price'], PDO::PARAM_STR); | |||||
| $pdoStat->bindValue(':prixlivr', $_POST['deliveryprice'], PDO::PARAM_STR); | |||||
| $pdoStat->bindValue(':pays', $_POST['country'], PDO::PARAM_STR); | |||||
| $pdoStat->bindValue(':description', $_POST['content'], PDO::PARAM_STR); | |||||
| $pdoStat->bindValue(':iduser', $_SESSION['id'], PDO::PARAM_STR); | |||||
| $pdoStat->bindValue(':mail', $useremail['login'], PDO::PARAM_STR); | |||||
| $insertIsOk = $pdoStat->execute(); | |||||
| if ($insertIsOk) { | |||||
| $message = 'Votre annonce a été prises en compte<br \><br \><a href="homepage.php">Page d\'accueil</a>'; | |||||
| } else { | |||||
| $message = 'Votre demande n\'a pu etre effectué essayés plus tard <br \><br \><a href="homepage.php">Page d\'accueil</a>'; | |||||
| } | |||||
| ?> | |||||
| <div class="message"> | |||||
| <?php echo $message ?> | |||||
| </div> | |||||
| @@ -1,12 +1,11 @@ | |||||
| <?php | <?php | ||||
| include 'include/header.php'; | include 'include/header.php'; | ||||
| $objetpdoinscription = new PDO('mysql:host=localhost;dbname=lpcgamer','phpuser','php'); | |||||
| $Pdostatinscripton = $objetpdoinscription->prepare('INSERT INTO users VALUES (NULL, :mail, :motdepasse, :nom, :prenom)'); | |||||
| $Pdostatinscripton = $mysql->prepare('INSERT INTO users VALUES (NULL, :mail, :motdepasse, :nom, :prenom)'); | |||||
| $Pdostatinscripton->bindValue(':mail',$_POST['login'], PDO::PARAM_STR); | $Pdostatinscripton->bindValue(':mail',$_POST['login'], PDO::PARAM_STR); | ||||
| $Pdostatinscripton->bindValue(':motdepasse',$_POST['password'], PDO::PARAM_STR); | |||||
| $Pdostatinscripton->bindValue(':motdepasse',hash('sha256', $_POST['password']), PDO::PARAM_STR); | |||||
| $Pdostatinscripton->bindValue(':nom',$_POST['name'], PDO::PARAM_STR); | $Pdostatinscripton->bindValue(':nom',$_POST['name'], PDO::PARAM_STR); | ||||
| $Pdostatinscripton->bindValue(':prenom',$_POST['surname'], PDO::PARAM_STR); | $Pdostatinscripton->bindValue(':prenom',$_POST['surname'], PDO::PARAM_STR); | ||||
| @@ -0,0 +1,10 @@ | |||||
| <?php | |||||
| $id = filter_input(INPUT_GET, 'id', FILTER_SANITIZE_NUMBER_INT); | |||||
| include('include/core.php'); | |||||
| $reqNewName = 'Delete FROM users where idusers=?'; | |||||
| $prep = $mysql->prepare($reqNewName); | |||||
| $prep->bindParam(1, $id, PDO::PARAM_STR); | |||||
| $prep->execute(); | |||||
| ?> | |||||
| <a class="message" href='administrateur.php' title='Supprimer'>Utilisateur Effacé!</a> | |||||
| @@ -0,0 +1,34 @@ | |||||
| <?php | |||||
| include('include/header.php'); | |||||
| $reponse = $mysql->query('SELECT * FROM products'); | |||||
| ?> | |||||
| <header class="header"><a class="logo"><img height="150px" src=./img/Logoburned.png></a><a | |||||
| class="header-middle-area"></a><a class="bouton_header" href="postformulaire.php">Vendre </a><a | |||||
| class="bouton_header" href="inscription.php">Inscription</a><a class="bouton_header" href="connexion.php">Connexion</a> | |||||
| </header> | |||||
| <div class="corp"> | |||||
| <aside class="aside"> | |||||
| <label id="qualitelabel"> Annonces: </label> | |||||
| </aside> | |||||
| <a class="main"> | |||||
| <?php while ($donnees = $reponse->fetch()) { ?> | |||||
| <strong><?php echo $donnees['name']; ?></strong><br> | |||||
| <strong> Qualités:</strong> <?php echo $donnees['quality']; ?> <br> | |||||
| <strong>Prix:</strong> <?php echo $donnees['price']; ?> € <br> | |||||
| <strong>Prix de livraison: </strong><?php echo $donnees['deliveryprice']; ?> € <br> | |||||
| <strong>Description du produit: </strong> <?php echo $donnees['content']; ?> <br> | |||||
| <strong>Expéditeur </strong> <?php echo $donnees['idusers']; ?> <br> | |||||
| <br> | |||||
| <?php | |||||
| } | |||||
| $reponse->closeCursor(); // Termine le traitement de la requête | |||||
| ?> | |||||
| </a> | |||||
| </div> | |||||
| </body> | |||||
| </html> | |||||
| @@ -0,0 +1,7 @@ | |||||
| <?php | |||||
| try { | |||||
| $mysql = new PDO('mysql:host=localhost;dbname=clyde','root',''); | |||||
| } catch (PDOException $e) { | |||||
| die('Une erreur est survenue lors de la connexion à la base de données : ' . $e->getMessage()); | |||||
| } | |||||
| @@ -7,4 +7,5 @@ | |||||
| <title>projetweb</title> | <title>projetweb</title> | ||||
| <script src="https://kit.fontawesome.com/f823ffd272.js" crossorigin="anonymous"></script> | <script src="https://kit.fontawesome.com/f823ffd272.js" crossorigin="anonymous"></script> | ||||
| </head> | </head> | ||||
| <body> | |||||
| <body> | |||||
| <?php include('include/core.php'); ?> | |||||
| @@ -0,0 +1,11 @@ | |||||
| <?php | |||||
| include 'include/header.php'; | |||||
| ?> | |||||
| <a href='connexion.php'>connexion</a><br> | |||||
| <a href='inscription.php'>inscription</a><br> | |||||
| <a href='profil.php'>profil</a><br> | |||||
| <a href='homepage.php'>Home page</a><br> | |||||
| <a href='postformulaire.php'>poster</a><br> | |||||
| <?php | |||||
| include 'include/footer.php'; | |||||
| ?> | |||||
| @@ -0,0 +1,35 @@ | |||||
| <?php | |||||
| include 'include/header.php'; | |||||
| ?> | |||||
| <form method="post" action="Getformulaire.php"> | |||||
| <p class="titre">Fiche technique</p> | |||||
| <fieldset id="coordonnees"> | |||||
| <label>Nom du produit : </label> | |||||
| <input type="text" id="nom" name="name"/><br/> | |||||
| <label>Qualité : </label> | |||||
| <input type="text" id="qualite" name="quality"/><br/> | |||||
| <label>Prix produit </label> | |||||
| <input type="text" id="prix" name="price"/><br/> | |||||
| <label>Prix livraison </label> | |||||
| <input type="text" id="prixlivr" name="deliveryprice"/><br/> | |||||
| <label>Pays : </label> | |||||
| <input type="text" id="pays" name="country"/><br/> | |||||
| </fieldset> | |||||
| <p class="titre">Description</p> | |||||
| <fieldset id="Description"> | |||||
| <textarea id="description" name="content" rows="5" cols="40"></textarea> | |||||
| </fieldset> | |||||
| <p id="buttons"> | |||||
| <input type="submit" value="Enregister"/> | |||||
| </p> | |||||
| </form> | |||||
| <br> | |||||
| <a href="homepage.php"> | |||||
| <button>Page d'accueil</button> | |||||
| </a> | |||||
| @@ -0,0 +1,41 @@ | |||||
| <?php | |||||
| session_start(); | |||||
| include 'include/header.php'; | |||||
| $login = filter_input(INPUT_POST, 'login'); | |||||
| $password = hash('sha256', filter_input(INPUT_POST, 'password')); | |||||
| $message = ''; | |||||
| if (empty($login) || empty($password)) //Oublie d'un champ | |||||
| { | |||||
| $message = '<p>Vous devez remplir tous les champs</p> | |||||
| <p>Cliquez <a href="./connexion.php">ici</a> pour revenir</p>'; | |||||
| } else //On check le mot de passe | |||||
| { | |||||
| $query = $mysql->prepare('SELECT * FROM users WHERE login = :login'); | |||||
| $query->bindValue(':login', $login, PDO::PARAM_STR); | |||||
| $query->execute(); | |||||
| $data = $query->fetch(PDO::FETCH_BOTH); | |||||
| if ($data['password'] == $password) // Acces OK ! | |||||
| { | |||||
| $_SESSION['login'] = $data['login']; | |||||
| $_SESSION['id'] = $data['idusers']; | |||||
| $message = '<p>Bienvenue ' . $data['prenom'] . ' ' . $data['name'] . ', | |||||
| vous êtes maintenant connecté!</p> | |||||
| <br /><br />Cliquez <a href="profil.php">ici</a> | |||||
| pour continuer</p>'; | |||||
| } else // Acces pas OK ! | |||||
| { | |||||
| $message = '<p>Les identifiants | |||||
| renseignés ne sont pas corrects.</p><p>Cliquez <a href="./connexion.php">ici</a> | |||||
| pour revenir à la page précédente'; | |||||
| } | |||||
| $query->CloseCursor(); | |||||
| } | |||||
| ?> | |||||
| <div class="message"> | |||||
| <?php echo $message ?> | |||||
| </div> | |||||
| @@ -0,0 +1,43 @@ | |||||
| <form method="post"> | |||||
| login: <input type="text" name="login"><br> | |||||
| password: <input type="text" name="password"><br> | |||||
| nom: <input type="text" name="name"><br> | |||||
| prenom: <input type="text" name="prenom"><br> | |||||
| <input type="submit"> | |||||
| </form> | |||||
| <?php | |||||
| $id = filter_input(INPUT_GET, 'id', FILTER_SANITIZE_NUMBER_INT); | |||||
| if (isset($_POST["login"])) { | |||||
| $reqUpdtUser = 'UPDATE users SET login= ? WHERE idusers= ?'; | |||||
| $prep = $mysql->prepare($reqUpdtUser); | |||||
| $prep->bindParam(1, $_POST["login"], PDO::PARAM_STR); | |||||
| $prep->bindParam(2, $id, PDO::PARAM_STR); | |||||
| $prep->execute(); | |||||
| } | |||||
| if (isset($_POST["password"])) { | |||||
| $reqUpdtUser = 'UPDATE users SET password= ? WHERE idusers= ?'; | |||||
| $prep = $mysql->prepare($reqUpdtUser); | |||||
| $prep->bindParam(1, $_POST["password"], PDO::PARAM_STR); | |||||
| $prep->bindParam(2, $id, PDO::PARAM_STR); | |||||
| $prep->execute(); | |||||
| } | |||||
| if (isset($_POST["name"])) { | |||||
| $reqUpdtUser = 'UPDATE users SET name= ? WHERE idusers= ?'; | |||||
| $prep = $mysql->prepare($reqUpdtUser); | |||||
| $prep->bindParam(1, $_POST["name"], PDO::PARAM_STR); | |||||
| $prep->bindParam(2, $id, PDO::PARAM_STR); | |||||
| $prep->execute(); | |||||
| } | |||||
| if (isset($_POST["prenom"])) { | |||||
| $reqUpdtUser = 'UPDATE users SET prenom= ? WHERE idusers= ?'; | |||||
| $prep = $mysql->prepare($reqUpdtUser); | |||||
| $prep->bindParam(1, $_POST["prenom"], PDO::PARAM_STR); | |||||
| $prep->bindParam(2, $id, PDO::PARAM_STR); | |||||
| $prep->execute(); | |||||
| } | |||||
| include 'include/footer.php'; | |||||
| ?> | |||||
| @@ -1,33 +0,0 @@ | |||||
| <?php | |||||
| include 'include/header.php'; | |||||
| ?> | |||||
| <form method="post" action="Getformulaire.php"> | |||||
| <p class="titre">Fiche technique</p> | |||||
| <fieldset id="coordonnees"> | |||||
| <label>Nom du produit : </label> | |||||
| <input type="text" id="nom" name="name" /><br /> | |||||
| <label>Qualité : </label> | |||||
| <input type="text" id="qualite" name="quality" /><br /> | |||||
| <label>Prix produit </label> | |||||
| <input type="text" id="prix" name="price" /><br /> | |||||
| <label>Prix livraison </label> | |||||
| <input type="text" id="prixlivr" name="deliveryprice" /><br /> | |||||
| <label>Pays : </label> | |||||
| <input type="text" id="pays" name="country" /><br /> | |||||
| </fieldset> | |||||
| <p class="titre">Description</p> | |||||
| <fieldset id="Description"> | |||||
| <textarea id="description" name="content" rows="5" cols="40"></textarea> | |||||
| </fieldset> | |||||
| <p id="buttons"> | |||||
| <input type="submit" value="Enregister" /> | |||||
| </p> | |||||
| </form> | |||||
| <br> | |||||
| <a href="homepage.php"><button >Page d'accueil</button></a> | |||||
| @@ -0,0 +1,92 @@ | |||||
| <?php include('inc/core.php'); | |||||
| if (!isLogged()) { | |||||
| header('Location: login.php'); | |||||
| die('<a href="login.php">Cliquez ici si vous n\'êtes pas redirigé automatiquement'); | |||||
| } | |||||
| if (isset($_POST['title']) && isset($_POST['status']) && isset($_POST['price']) && isset($_POST['shipping']) && isset($_POST['shippingOrigin']) && isset($_POST['description'])) { | |||||
| $pdoStat = $mysql->prepare('INSERT INTO products VALUES (NULL, :nom, :qualite, :prix, :prixlivr, :pays, :description, :iduser, :mail, NOW())'); | |||||
| $pdoStat->bindValue(':nom', $_POST['title'], PDO::PARAM_STR); | |||||
| $pdoStat->bindValue(':qualite', $_POST['status'], PDO::PARAM_STR); | |||||
| $pdoStat->bindValue(':prix', $_POST['price'], PDO::PARAM_STR); | |||||
| $pdoStat->bindValue(':prixlivr', $_POST['shipping'], PDO::PARAM_STR); | |||||
| $pdoStat->bindValue(':pays', $_POST['shippingOrigin'], PDO::PARAM_STR); | |||||
| $pdoStat->bindValue(':description', $_POST['description'], PDO::PARAM_STR); | |||||
| $pdoStat->bindValue(':iduser', $_SESSION['id'], PDO::PARAM_STR); | |||||
| $pdoStat->bindValue(':mail', $_SESSION['login'], PDO::PARAM_STR); | |||||
| $insertIsOk = $pdoStat->execute(); | |||||
| if ($insertIsOk) { | |||||
| $message = $_SESSION['message'] = 'Votre annonce a bien été publiée.'; | |||||
| $message_type = $_SESSION['message_type'] = 'success'; | |||||
| header('Location: my_sell.php'); | |||||
| } else { | |||||
| $message = 'Votre demande n\'a pas pu aboutir. Veuillez réessayer plus tard.'; | |||||
| $message_type = 'danger'; | |||||
| } | |||||
| } | |||||
| include('inc/header.php'); | |||||
| ?> | |||||
| <main role="main" class="container"> | |||||
| <div class="d-flex align-items-center p-3 my-3 text-white-50 bg-purple rounded box-shadow"> | |||||
| <div class="lh-100"> | |||||
| <h6 class="mb-0 text-white lh-100">Mise en vente</h6> | |||||
| </div> | |||||
| </div> | |||||
| <?php if (isset($message)) { | |||||
| if (isset($_SESSION['message'])) { | |||||
| unset($_SESSION['message']); | |||||
| unset($_SESSION['message_type']); | |||||
| } | |||||
| ?> | |||||
| <div class="alert alert-<?= $message_type ?>" role="alert"> | |||||
| <?= $message ?> | |||||
| </div> | |||||
| <?php } ?> | |||||
| <div class="my-3 p-3 bg-white rounded box-shadow"> | |||||
| <form method="post"> | |||||
| <div class="form-group"> | |||||
| <label for="title">Titre de l'annonce</label> | |||||
| <input type="text" class="form-control" id="title" name="title" | |||||
| placeholder="Detroit: Become Human pour PS4" required> | |||||
| </div> | |||||
| <div class="form-group"> | |||||
| <label for="status">Etat</label> | |||||
| <select class="form-control" id="status" name="status" required> | |||||
| <option>Neuf</option> | |||||
| <option>Occasion</option> | |||||
| </select> | |||||
| </div> | |||||
| <div class="form-group"> | |||||
| <label for="price">Prix</label> | |||||
| <input type="number" class="form-control" id="price" name="price" | |||||
| placeholder="35" required> | |||||
| </div> | |||||
| <div class="form-group"> | |||||
| <label for="shipping">Frais de port</label> | |||||
| <input type="number" class="form-control" id="shipping" name="shipping" | |||||
| placeholder="5" required> | |||||
| </div> | |||||
| <div class="form-group"> | |||||
| <label for="shippingOrigin">Pays d'expedition</label> | |||||
| <input type="text" class="form-control" id="shippingOrigin" name="shippingOrigin" | |||||
| placeholder="France" required> | |||||
| </div> | |||||
| <div class="form-group"> | |||||
| <label for="description">Description</label> | |||||
| <textarea class="form-control" id="description" name="description" rows="3" | |||||
| placeholder="Je met en vente mon jeu Detroit: Become Human sur PS4..., remise en main propre possible" | |||||
| required></textarea> | |||||
| </div> | |||||
| <button class="btn btn-primary btn-block" type="submit">Mettre en vente</button> | |||||
| </form> | |||||
| </div> | |||||
| </main> | |||||
| <?php include('inc/footer.php'); ?> | |||||
| @@ -1,44 +0,0 @@ | |||||
| <?php | |||||
| session_start(); | |||||
| include 'include/header.php'; | |||||
| $login = filter_input(INPUT_POST,'login'); | |||||
| $password = filter_input(INPUT_POST,'password'); | |||||
| $message=''; | |||||
| if (empty($login) || empty($password) ) //Oublie d'un champ | |||||
| { | |||||
| $message = '<p>Vous devez remplir tous les champs</p> | |||||
| <p>Cliquez <a href="./connexion.php">ici</a> pour revenir</p>'; | |||||
| } | |||||
| else //On check le mot de passe | |||||
| { | |||||
| $db = new PDO('mysql:host=localhost;dbname=lpcgamer','phpuser','php'); | |||||
| $query=$db->prepare('SELECT * FROM users WHERE login = :login'); | |||||
| $query->bindValue(':login',$login, PDO::PARAM_STR); | |||||
| $query->execute(); | |||||
| $data=$query->fetch(PDO::FETCH_BOTH); | |||||
| if ($data['password'] == $password) // Acces OK ! | |||||
| { | |||||
| $_SESSION['login'] = $data['login']; | |||||
| $_SESSION['id'] = $data['idusers']; | |||||
| $message = '<p>Bienvenue '.$data['prenom'].' '.$data['name'].', | |||||
| vous êtes maintenant connecté!</p> | |||||
| <br /><br />Cliquez <a href="profil.php">ici</a> | |||||
| pour continuer</p>'; | |||||
| } | |||||
| else // Acces pas OK ! | |||||
| { | |||||
| $message = '<p>Les identifiants | |||||
| renseignés ne sont pas corrects.</p><p>Cliquez <a href="./connexion.php">ici</a> | |||||
| pour revenir à la page précédente'; | |||||
| } | |||||
| $query->CloseCursor(); | |||||
| } | |||||
| ?> | |||||
| <div class="message"> | |||||
| <?php echo $message ?> | |||||
| </div> | |||||
| @@ -1,44 +0,0 @@ | |||||
| <form method="post"> | |||||
| login: <input type="text" name="login"><br> | |||||
| password: <input type="text" name="password"><br> | |||||
| nom: <input type="text" name="name"><br> | |||||
| prenom: <input type="text" name="prenom"><br> | |||||
| <input type="submit"> | |||||
| </form> | |||||
| <?php | |||||
| $db = new PDO('mysql:host=localhost;dbname=lpcgamer','phpuser','php'); | |||||
| $id = filter_input(INPUT_GET,'id', FILTER_SANITIZE_NUMBER_INT); | |||||
| if(isset($_POST["login"])){ | |||||
| $reqUpdtUser = 'UPDATE users SET login= ? WHERE idusers= ?'; | |||||
| $prep=$db->prepare($reqUpdtUser); | |||||
| $prep->bindParam(1, $_POST["login"], PDO::PARAM_STR); | |||||
| $prep->bindParam(2, $id, PDO::PARAM_STR); | |||||
| $prep->execute(); | |||||
| } | |||||
| if(isset($_POST["password"])){ | |||||
| $reqUpdtUser = 'UPDATE users SET password= ? WHERE idusers= ?'; | |||||
| $prep=$db->prepare($reqUpdtUser); | |||||
| $prep->bindParam(1, $_POST["password"], PDO::PARAM_STR); | |||||
| $prep->bindParam(2, $id, PDO::PARAM_STR); | |||||
| $prep->execute(); | |||||
| } | |||||
| if(isset($_POST["name"])){ | |||||
| $reqUpdtUser = 'UPDATE users SET name= ? WHERE idusers= ?'; | |||||
| $prep=$db->prepare($reqUpdtUser); | |||||
| $prep->bindParam(1, $_POST["name"], PDO::PARAM_STR); | |||||
| $prep->bindParam(2, $id, PDO::PARAM_STR); | |||||
| $prep->execute(); | |||||
| } | |||||
| if(isset($_POST["prenom"])){ | |||||
| $reqUpdtUser = 'UPDATE users SET prenom= ? WHERE idusers= ?'; | |||||
| $prep=$db->prepare($reqUpdtUser); | |||||
| $prep->bindParam(1, $_POST["prenom"], PDO::PARAM_STR); | |||||
| $prep->bindParam(2, $id, PDO::PARAM_STR); | |||||
| $prep->execute(); | |||||
| } | |||||
| include 'include/footer.php'; | |||||
| ?> | |||||