smarty ça casse les couilles zebi
This commit is contained in:
parent
b1960b2f35
commit
aec3c845e0
469 changed files with 53465 additions and 69 deletions
0
views/.gitkeep
Normal file
0
views/.gitkeep
Normal file
132
views/admin.php
Normal file
132
views/admin.php
Normal file
|
|
@ -0,0 +1,132 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="fr">
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no" />
|
||||
<title>Dashboard - Folliow Admin</title>
|
||||
<link href="https://cdn.jsdelivr.net/npm/simple-datatables@7.1.2/dist/style.min.css" rel="stylesheet" />
|
||||
<link href="assests/css/styles.css" rel="stylesheet" />
|
||||
<script src="https://use.fontawesome.com/releases/v6.3.0/js/all.js" crossorigin="anonymous"></script>
|
||||
</head>
|
||||
<body class="sb-nav-fixed">
|
||||
<nav class="sb-topnav navbar navbar-expand navbar-dark bg-dark">
|
||||
|
||||
<!-- Navbar Brand-->
|
||||
<a class="navbar-brand ps-3" href="index.html"><img src="assests/img/Logo-Wordmark.svg" alt="Logo du site" width="150px"></a>
|
||||
|
||||
<!-- Sidebar Toggle-->
|
||||
<button class="btn btn-link btn-sm order-1 order-lg-0 me-4 me-lg-0" id="sidebarToggle" href="#!"><i class="fas fa-bars"></i></button>
|
||||
|
||||
<!-- Navbar Search-->
|
||||
<form class="d-none d-md-inline-block form-inline ms-auto me-0 me-md-3 my-2 my-md-0">
|
||||
<div class="input-group">
|
||||
<input class="form-control" type="text" placeholder="Recherche par pseudo..." aria-label="Recherche pseudo" aria-describedby="btnNavbarSearch" />
|
||||
<button class="btn btn-primary" id="btnNavbarSearch" type="button"><i class="fas fa-search"></i></button>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
<!-- Navbar - User-->
|
||||
<ul class="navbar-nav ms-auto ms-md-0 me-3 me-lg-4">
|
||||
<li class="nav-item dropdown">
|
||||
<a class="nav-link dropdown-toggle" id="navbarDropdown" href="#" role="button" data-bs-toggle="dropdown" aria-expanded="false"><i class="fas fa-user fa-fw"></i></a>
|
||||
<ul class="dropdown-menu dropdown-menu-end" aria-labelledby="navbarDropdown">
|
||||
<li><a class="dropdown-item" href="/option.php">Paramètre</a></li>
|
||||
<li><hr class="dropdown-divider" /></li>
|
||||
<li><a class="dropdown-item" href="/deconnexion.php">Déconnexion</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</nav>
|
||||
|
||||
<!-- SideNav Infos -->
|
||||
<div id="layoutSidenav">
|
||||
<div id="layoutSidenav_nav">
|
||||
<nav class="sb-sidenav accordion sb-sidenav-dark" id="sidenavAccordion">
|
||||
<div class="sb-sidenav-menu">
|
||||
<div class="nav">
|
||||
<div class="sb-sidenav-menu-heading"></div>
|
||||
<a class="nav-link" href="index.html">
|
||||
<div class="sb-nav-link-icon"><i class="fas fa-tachometer-alt"></i></div>
|
||||
Rafraichir la page
|
||||
</a>
|
||||
<div class="sb-sidenav-menu-heading"></div>
|
||||
<div class="collapse" id="collapseLayouts" aria-labelledby="headingOne" data-bs-parent="#sidenavAccordion">
|
||||
</div>
|
||||
|
||||
<form action="post">
|
||||
<div class="container-fluid ps-2">
|
||||
<div class="row">
|
||||
<div class="col-6">
|
||||
<label for="checkbox1">Par date</label>
|
||||
</div>
|
||||
<div class="col-6 text-center">
|
||||
<input type="checkbox" name="search_date" id="">
|
||||
</div>
|
||||
<div class="col-6">
|
||||
<label for="checkbox2">Par date de creation de compte</label>
|
||||
</div>
|
||||
<div class="col-6 text-center">
|
||||
<input type="checkbox" name="search_creationdate" id="">
|
||||
</div>
|
||||
<div class="col-6">
|
||||
<label for="checkbox3">Recherche par date</label>
|
||||
</div>
|
||||
<div class="col-6 text-center">
|
||||
<input type="checkbox" name="search_date" id="">
|
||||
</div>
|
||||
<div class="col-12 text-center">
|
||||
<button type="submit" class="btn mt-3 bg-primary text-light">Recherche</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
<div class="sb-sidenav-footer">
|
||||
<!-- Mettre le pseudo en fonction de qui est connecté -->
|
||||
<div class="small">Connecté avec le compte :</div>
|
||||
*mettre un nom*
|
||||
</div>
|
||||
</nav>
|
||||
</div>
|
||||
|
||||
<!-- Main page -->
|
||||
<div id="layoutSidenav_content">
|
||||
<main>
|
||||
<div class="container-fluid px-4">
|
||||
<h1 class="mt-4">Dashboard</h1>
|
||||
</div>
|
||||
<!-- Gray bloc -->
|
||||
<div class="container-fluid px-4">
|
||||
<!-- Container with img/list/remove btn = A DUPLIQUER à partir d'ici-->
|
||||
<div class="p-3 mt-2 text-primary-emphasis bg-primary-subtle border border-primary-subtle rounded-3">
|
||||
<div class="container-fluid pt-2">
|
||||
<div class="row">
|
||||
<div class="col-4">
|
||||
<!-- IMG USER -->
|
||||
<img src="./assests/img/Logo-Wordmark.svg" alt="" width="100">
|
||||
</div>
|
||||
|
||||
<!-- USER MODIF -->
|
||||
<div class="col-4">
|
||||
<select class="form-select" aria-label="Default select example">
|
||||
<option value="0" selected>Modifier le statut de l'Utilisateur...</option>
|
||||
<option value="1">Utilisateur</option>
|
||||
<option value="2">Modérateur</option>
|
||||
<option value="3">Administrateur</option>
|
||||
</select>
|
||||
</div>
|
||||
<!-- Btn SUPPR -->
|
||||
<div class="col-4">
|
||||
<button class="btn bg-danger text-light rounded-circle">X</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</main>
|
||||
</div>
|
||||
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.2.3/dist/js/bootstrap.bundle.min.js" crossorigin="anonymous"></script>
|
||||
<script src="assests/js/scripts.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
191
views/connexion.php
Normal file
191
views/connexion.php
Normal file
|
|
@ -0,0 +1,191 @@
|
|||
|
||||
<!-- Contenu principal de la page -->
|
||||
<main class="container py-5">
|
||||
|
||||
<!-- Centrage horizontal du formulaire -->
|
||||
<div class="row justify-content-center">
|
||||
<!-- Contenu principal de la page -->
|
||||
<main class="container py-5">
|
||||
|
||||
<!-- Centrage horizontal du formulaire -->
|
||||
<div class="row justify-content-center">
|
||||
<div class="col-12 col-md-8 col-lg-5">
|
||||
|
||||
<!-- Carte contenant le formulaire de connexion -->
|
||||
<div class="card shadow-sm border-0 rounded-4 p-4 p-lg-5">
|
||||
|
||||
<!-- Titre principal -->
|
||||
<h1 class="h3 fw-bold mb-1">Connexion</h1>
|
||||
|
||||
<!-- Texte descriptif -->
|
||||
<p class="text-secondary mb-4">
|
||||
Connectez-vous à votre compte.
|
||||
</p>
|
||||
|
||||
<!-- Formulaire de connexion -->
|
||||
<!-- Le traitement sera effectué en PHP via la méthode POST -->
|
||||
<form method="POST">
|
||||
|
||||
<div class="row g-3">
|
||||
|
||||
<!-- Champ : adresse e-mail de l'utilisateur -->
|
||||
<div class="col-12">
|
||||
<label for="user_mail" class="form-label">
|
||||
Adresse e-mail
|
||||
</label>
|
||||
<input
|
||||
type="email"
|
||||
class="form-control"
|
||||
id="user_mail"
|
||||
name="user_mail"
|
||||
required
|
||||
|
||||
>
|
||||
</div>
|
||||
|
||||
<!-- Champ : mot de passe -->
|
||||
<div class="col-12">
|
||||
<label for="user_password" class="form-label">
|
||||
Mot de passe
|
||||
</label>
|
||||
<input
|
||||
type="password"
|
||||
class="form-control"
|
||||
id="user_password"
|
||||
name="user_password"
|
||||
required
|
||||
|
||||
>
|
||||
</div>
|
||||
|
||||
<!-- Option "Se souvenir de moi" (fonctionnalité optionnelle côté PHP) -->
|
||||
<div class="col-12">
|
||||
<div class="form-check">
|
||||
<input class="form-check-input" type="checkbox" id="remember_me" name="remember_me">
|
||||
<label class="form-check-label" for="remember_me">
|
||||
Se souvenir de moi
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Bouton de soumission du formulaire -->
|
||||
<div class="col-12 d-grid mt-2">
|
||||
<button type="submit" class="btn btn-primary btn-lg rounded-3">
|
||||
Se connecter
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<!-- Lien vers la page d'inscription -->
|
||||
<div class="col-12 text-center">
|
||||
<small class="text-secondary">
|
||||
Pas encore de compte ?
|
||||
<a href="inscription.php" class="link-primary">Créer un compte</a>
|
||||
</small>
|
||||
</div>
|
||||
|
||||
<!-- Lien pour la récupération du mot de passe -->
|
||||
<div class="col-12 text-center">
|
||||
<small>
|
||||
<a href="#" class="link-primary">
|
||||
Mot de passe oublié ?
|
||||
</a>
|
||||
</small>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</form>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</main>
|
||||
<h1 class="h3 fw-bold mb-1">Connexion</h1>
|
||||
|
||||
<p class="text-secondary mb-4">
|
||||
Connectez-vous à votre compte.
|
||||
</p>
|
||||
|
||||
<?php
|
||||
// Affichage des erreurs (validation côté serveur)
|
||||
if (!empty($arrError)) { ?>
|
||||
<div class="alert alert-danger" role="alert">
|
||||
<?php foreach ($arrError as $strError) { ?>
|
||||
<p class="mb-0"><?php echo htmlspecialchars($strError); ?></p>
|
||||
<?php } ?>
|
||||
</div>
|
||||
<?php } ?>
|
||||
|
||||
<!-- Formulaire de connexion -->
|
||||
<form method="POST" action="index.php?ctrl=user&action=login">
|
||||
|
||||
<div class="row g-3">
|
||||
|
||||
<!-- Champ : adresse e-mail -->
|
||||
<div class="col-12">
|
||||
<label for="mail" class="form-label">
|
||||
Adresse e-mail
|
||||
</label>
|
||||
<input
|
||||
type="email"
|
||||
class="form-control <?php if (isset($arrError['mail'])) { echo 'is-invalid'; } ?>"
|
||||
id="mail"
|
||||
name="mail"
|
||||
value="<?php echo htmlspecialchars($strMail ?? ''); ?>"
|
||||
>
|
||||
</div>
|
||||
|
||||
<!-- Champ : mot de passe -->
|
||||
<div class="col-12">
|
||||
<label for="pwd" class="form-label">
|
||||
Mot de passe
|
||||
</label>
|
||||
<input
|
||||
type="password"
|
||||
class="form-control <?php if (isset($arrError['pwd'])) { echo 'is-invalid'; } ?>"
|
||||
id="pwd"
|
||||
name="pwd"
|
||||
>
|
||||
</div>
|
||||
|
||||
<!-- Option "Se souvenir de moi" -->
|
||||
<div class="col-12">
|
||||
<div class="form-check">
|
||||
<input class="form-check-input" type="checkbox" id="remember_me" name="remember_me">
|
||||
<label class="form-check-label" for="remember_me">
|
||||
Se souvenir de moi
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Bouton -->
|
||||
<div class="col-12 d-grid mt-2">
|
||||
<button type="submit" class="btn btn-primary btn-lg rounded-3">
|
||||
Se connecter
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<!-- Liens -->
|
||||
<div class="col-12 text-center">
|
||||
<small class="text-secondary">
|
||||
Pas encore de compte ?
|
||||
<a href="index.php?ctrl=user&action=signin" class="link-primary">Créer un compte</a>
|
||||
</small>
|
||||
</div>
|
||||
|
||||
<div class="col-12 text-center">
|
||||
<small>
|
||||
<a href="#" class="link-primary">
|
||||
Mot de passe oublié ?
|
||||
</a>
|
||||
</small>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</form>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</main>
|
||||
19
views/home.tpl
Normal file
19
views/home.tpl
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
|
||||
{block name="content"}
|
||||
<section class="container mt-5 p-5 d-flex flex-column align-items-center text-center">
|
||||
<h1 class="logo">Folliow</h1>
|
||||
<h2>Là où les talents rencontrent leur avenir</h2>
|
||||
<p class="col-6">Une plateforme de portfolio adapté à vos besoins et aux besoins des entreprises.
|
||||
Créer un portfolio réellement pertinent aux exigences du marché et rentrez
|
||||
directement en contact avec les entreprises.</p>
|
||||
</section>
|
||||
|
||||
<section class="container" aria-label="Articles récents">
|
||||
<h2 class="visually-hidden">Les 4 derniers articles</h2>
|
||||
<div class="row mb-2">
|
||||
|
||||
{foreach from=$arrArticleToDisplay item=objArticle}
|
||||
{include file="views/partials/preview.php"}
|
||||
{/foreach}
|
||||
</section>
|
||||
{{/block}}
|
||||
175
views/inscription.php
Normal file
175
views/inscription.php
Normal file
|
|
@ -0,0 +1,175 @@
|
|||
|
||||
<!-- Page : Inscription -->
|
||||
|
||||
|
||||
<main class="container py-5">
|
||||
|
||||
<!-- Centrage horizontal du formulaire -->
|
||||
<div class="row justify-content-center">
|
||||
<div class="col-12 col-md-10 col-lg-6">
|
||||
|
||||
<!-- Carte contenant le formulaire d'inscription -->
|
||||
<div class="card shadow-sm border-0 rounded-4 p-4 p-lg-5">
|
||||
|
||||
<!-- Titre principal de la page -->
|
||||
<h1 class="h3 fw-bold mb-1">Inscription</h1>
|
||||
|
||||
<!-- Texte descriptif -->
|
||||
<p class="text-secondary mb-4">
|
||||
Créez votre compte utilisateur.
|
||||
</p>
|
||||
|
||||
<!-- Formulaire d'inscription -->
|
||||
<!-- Les données seront traitées côté serveur en PHP via la méthode POST -->
|
||||
<form method="POST">
|
||||
|
||||
<div class="row g-3">
|
||||
|
||||
<!-- Champ : prénom de l'utilisateur -->
|
||||
<div class="col-md-6">
|
||||
<label class="form-label" for="user_firstname">
|
||||
Prénom *
|
||||
</label>
|
||||
<input
|
||||
class="form-control"
|
||||
type="text"
|
||||
id="user_firstname"
|
||||
name="user_firstname"
|
||||
required >
|
||||
</div>
|
||||
|
||||
<!-- Champ : nom de l'utilisateur -->
|
||||
<div class="col-md-6">
|
||||
<label class="form-label" for="user_name">
|
||||
Nom *
|
||||
</label>
|
||||
<input
|
||||
class="form-control"
|
||||
type="text"
|
||||
id="user_name"
|
||||
name="user_name"
|
||||
required
|
||||
>
|
||||
</div>
|
||||
|
||||
<!-- Champ : pseudo -->
|
||||
<div class="col-12">
|
||||
<label class="form-label" for="user_pseudo">
|
||||
Pseudo *
|
||||
</label>
|
||||
<div class="input-group">
|
||||
<span class="input-group-text">@</span>
|
||||
<input
|
||||
class="form-control"
|
||||
type="text"
|
||||
id="user_pseudo"
|
||||
name="user_pseudo"
|
||||
required
|
||||
>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Champ : adresse e-mail -->
|
||||
<div class="col-12">
|
||||
<label class="form-label" for="user_mail">
|
||||
Adresse e-mail *
|
||||
</label>
|
||||
<input
|
||||
class="form-control"
|
||||
type="email"
|
||||
id="user_mail"
|
||||
name="user_mail"
|
||||
required
|
||||
>
|
||||
</div>
|
||||
|
||||
<!-- Champ : mot de passe -->
|
||||
<div class="col-12">
|
||||
<label class="form-label" for="user_password">
|
||||
Mot de passe *
|
||||
</label>
|
||||
<input
|
||||
class="form-control"
|
||||
type="password"
|
||||
id="user_password"
|
||||
name="user_password"
|
||||
required
|
||||
>
|
||||
</div>
|
||||
|
||||
<!-- Champ optionnel : numéro de téléphone -->
|
||||
<div class="col-12">
|
||||
<label class="form-label" for="user_phone">
|
||||
Téléphone
|
||||
</label>
|
||||
<input
|
||||
class="form-control"
|
||||
type="text"
|
||||
id="user_phone"
|
||||
name="user_phone"
|
||||
>
|
||||
</div>
|
||||
|
||||
<!-- Champ optionnel : profession de l'utilisateur -->
|
||||
<div class="col-12">
|
||||
<label class="form-label" for="user_work">
|
||||
Profession
|
||||
</label>
|
||||
<input
|
||||
class="form-control"
|
||||
type="text"
|
||||
id="user_work"
|
||||
name="user_work"
|
||||
>
|
||||
</div>
|
||||
|
||||
<!-- Champ optionnel : localisation de l'utilisateur -->
|
||||
<div class="col-12">
|
||||
<label class="form-label" for="user_location">
|
||||
Localisation
|
||||
</label>
|
||||
<input
|
||||
class="form-control"
|
||||
type="text"
|
||||
id="user_location"
|
||||
name="user_location"
|
||||
>
|
||||
</div>
|
||||
|
||||
<!-- Champ optionnel : phrase d'accroche -->
|
||||
<div class="col-12">
|
||||
<label class="form-label" for="user_description">
|
||||
Phrase d'accroche
|
||||
</label>
|
||||
<textarea
|
||||
class="form-control"
|
||||
id="user_description"
|
||||
name="user_description"
|
||||
rows="3"
|
||||
></textarea>
|
||||
</div>
|
||||
|
||||
<!-- Bouton de soumission du formulaire -->
|
||||
<div class="col-12 d-grid mt-2">
|
||||
<button type="submit" class="btn btn-primary btn-lg rounded-3">
|
||||
Créer mon compte
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<!-- Lien vers la page de connexion -->
|
||||
<div class="col-12 text-center">
|
||||
<small class="text-secondary">
|
||||
Déjà un compte ?
|
||||
<a href="index.php?ctrl=user&action=login">Se connecter</a>
|
||||
</small>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</main>
|
||||
7
views/layout.tpl
Normal file
7
views/layout.tpl
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
{include file="./views/partials/header.tpl"}
|
||||
|
||||
{block name="content"}
|
||||
|
||||
{/block}
|
||||
|
||||
{include file="./views/partials/footer.tpl"}
|
||||
23
views/login.php
Normal file
23
views/login.php
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
<section aria-label="Se connecter">
|
||||
<?php if (count($arrError) > 0) {?>
|
||||
<div class="alert alert-danger">
|
||||
<?php foreach ($arrError as $strError){ ?>
|
||||
<p><?php echo $strError; ?></p>
|
||||
<?php } ?>
|
||||
</div>
|
||||
<?php } ?>
|
||||
<form method="post">
|
||||
<p>
|
||||
<label>Mail:</label>
|
||||
<input name="mail" value="<?php echo($strMail); ?>"
|
||||
class="form-control <?php if (isset($arrError['mail'])) { echo 'is-invalid'; } ?> " type="text" >
|
||||
</p>
|
||||
<p>
|
||||
<label>Mot de passe:</label>
|
||||
<input name="pwd" class="form-control <?php if (isset($arrError['pwd'])) { echo 'is-invalid'; } ?> " type="text" >
|
||||
</p>
|
||||
<p>
|
||||
<input class="form-control btn btn-primary" type="submit" >
|
||||
</p>
|
||||
</form>
|
||||
</section>
|
||||
34
views/partials/footer.php
Normal file
34
views/partials/footer.php
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
|
||||
<footer class="footer container-fluid d-flex justify-content-around">
|
||||
<div class="col-3">
|
||||
<ul>
|
||||
<li><a href="#">Découvrir</a>
|
||||
<li><a href="#">Customisation</a>
|
||||
<li><a href="#">Emploi</a>
|
||||
<li><a href="#">A propos</a>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="col-3">
|
||||
<ul>
|
||||
<li><a href="#">Recruter</a>
|
||||
<li><a href="#">Partenariat</a>
|
||||
<li><a href="#">Blog</a>
|
||||
<li><a href="#">Aide et support</a>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="col-3">
|
||||
<ul>
|
||||
<li><a href="#">Politique de confidentialité</a>
|
||||
<li><a href="#">Politique sur les données</a>
|
||||
<li><a href="#">CGU</a>
|
||||
<li><a href="#">CGV</a>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="col-3">
|
||||
<p>Suivez-nous</p>
|
||||
</div>
|
||||
</footer>
|
||||
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.2.3/dist/js/bootstrap.bundle.min.js" crossorigin="anonymous"></script>
|
||||
<script src="js/scripts.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
86
views/partials/header.php
Normal file
86
views/partials/header.php
Normal file
|
|
@ -0,0 +1,86 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="fr">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<link rel="stylesheet" href="assests/css/style.css">
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
|
||||
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.8/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-sRIl4kxILFvY47J16cr9ZwB07vP4J8+LH7qKQnuqkuIAvNWLzeN8tE5YBujZqJLB" crossorigin="anonymous">
|
||||
<script src="https://use.fontawesome.com/releases/v6.3.0/js/all.js" crossorigin="anonymous"></script>
|
||||
<title>Folliow</title>
|
||||
</head>
|
||||
<body>
|
||||
<nav class="navbar navbar-expand-lg navbar-light">
|
||||
<div class="container-fluid">
|
||||
{* Logo *}
|
||||
<a class="navbar-brand d-flex align-items-center" href="#">
|
||||
<img src="assests/img/logo.png" alt="Logo" class="logo-image">
|
||||
</a>
|
||||
|
||||
{* Toggler pour mobile *}
|
||||
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarNav" aria-controls="navbarNav" aria-expanded="false" aria-label="Toggle navigation">
|
||||
<span class="navbar-toggler-icon"></span>
|
||||
</button>
|
||||
|
||||
{* Menu de navigation *}
|
||||
<div class="collapse navbar-collapse" id="navbarNav">
|
||||
<ul class="navbar-nav me-auto">
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" href="?ctrl=&action=">Découvrir</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" href="?ctrl=''&action=''">Customisation</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" href="?ctrl=''&action=''">Orientation</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" href="?ctrl=''&action=''">À propos</a>
|
||||
</li>
|
||||
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" href="?ctrl=project&action=search">Rechercher</a>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
{* Menu secondaire *}
|
||||
<nav class="col-4 d-flex justify-content-end align-items-center" aria-label="Connexion utilisateur">
|
||||
{if !isset($smarty.session.user)}
|
||||
{* Utilisateur non connecté *}
|
||||
<ul class="navbar-nav">
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" href="index.php?ctrl=user&action=signin" title="Créer un compte" aria-label="Créer un compte">
|
||||
S'inscrire
|
||||
</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" href="index.php?ctrl=user&action=login" title="Se connecter" aria-label="Se connecter">
|
||||
Se connecter
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
{else}
|
||||
{* Utilisateur connecté *}
|
||||
<ul class="navbar-nav">
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" href="edit_account.php" title="Modifier mon compte" aria-label="Modifier mon compte">
|
||||
<img src=".{$smarty.session.user.user_image}"
|
||||
class="rounded-circle flex-shrink-0 mt-2 ml-5"
|
||||
style="width: 36px; height: 36px; object-fit: cover;"
|
||||
alt="Photo de profil">
|
||||
</a>
|
||||
</li>
|
||||
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" href="index.php?ctrl=user&action=logout" title="Se déconnecter" aria-label="Se déconnecter">
|
||||
Logout
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
{/if}
|
||||
</nav>
|
||||
</div>
|
||||
</div>
|
||||
</nav>
|
||||
</body>
|
||||
</html>
|
||||
38
views/partials/preview.php
Normal file
38
views/partials/preview.php
Normal file
|
|
@ -0,0 +1,38 @@
|
|||
<article class="col-md-3 mb-4">
|
||||
<div class="card h-100 shadow-sm article-card">
|
||||
|
||||
{* IMAGE (80%) *}
|
||||
<div class="ratio ratio-16x9">
|
||||
<img src=".{$objProject->getThumbnail()}"
|
||||
class="w-100 h-100 object-fit-cover"
|
||||
alt=""
|
||||
loading="lazy">
|
||||
</div>
|
||||
|
||||
<div class="d-flex align-items-start gap-3">
|
||||
|
||||
{* PHOTO DE PROFIL *}
|
||||
<img src=".{$objProject->getUser_image()}"
|
||||
class="rounded-circle flex-shrink-0 mt-2 ml-5"
|
||||
style="width: 48px; height: 48px; object-fit: cover;"
|
||||
alt="Photo de profil">
|
||||
|
||||
{* INFOS *}
|
||||
<div class="flex-grow-1 card-body p-3">
|
||||
<h3 class="h6 mb-1">{$objProject->getTitle()}</h3>
|
||||
|
||||
<small class="text-body-secondary d-block mb-1">
|
||||
<time>{$objProject->getCreation_date()}</time>
|
||||
– {$objProject->getCreatorname()}
|
||||
</small>
|
||||
|
||||
<a href="?id={$objProject->getId()}"
|
||||
class="stretched-link small">
|
||||
Lire la suite →
|
||||
</a>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</article>
|
||||
115
views/project.php
Normal file
115
views/project.php
Normal file
|
|
@ -0,0 +1,115 @@
|
|||
<?php
|
||||
require_once('../app/controllers/project_controller.php');
|
||||
require_once('../app/models/project_model.php');
|
||||
require_once('../app/entities/project_entity.php');
|
||||
|
||||
//Variable data
|
||||
$_SESSION['title'] = $_POST['titleProject']??"";
|
||||
$_SESSION['description'] = $_POST['descProject']??"";
|
||||
$_SESSION['content'] = $_POST['textProject']??"";
|
||||
$_SESSION['thumbnail'] = $_FILES['imageProject']['name']??"";
|
||||
$_SESSION['status'] = 'en_attente';
|
||||
|
||||
|
||||
$objProject = new Project();
|
||||
$objProjectModel = new ProjectModel();
|
||||
|
||||
/**
|
||||
/* Créer par Besnik le GOAT et l'autre GOAT de Guillaume
|
||||
/*
|
||||
/* @return bool pour savoir si le fichier existe,
|
||||
/* puis déplace vers le fichier uploads avec les images projet des utilisateurs
|
||||
/* Communication avec la BDD
|
||||
*/
|
||||
if (($_SESSION['thumbnail'] != null)){
|
||||
$strDest = "";
|
||||
if ((count($_FILES) > 0) && ($_FILES['imageProject']['error'] != 4)){
|
||||
$strDest = '../public/uploads/projects/'.$_FILES['imageProject']['name'];
|
||||
var_dump($strDest);
|
||||
move_uploaded_file($_FILES['imageProject']['tmp_name'], $strDest);
|
||||
}
|
||||
}
|
||||
|
||||
/** En cas d'appuis sur le bouton d'envoie ou celui de remettre a plus tard
|
||||
/* 1. Changement de status
|
||||
/* 2. Hydratation avec les informations récupéré de l'utilisateur
|
||||
/* 3. Envoie des données à la BDD
|
||||
*/
|
||||
if (isset($_POST['sendMessage'])) {
|
||||
$_SESSION['status'] = 'publié';
|
||||
$objProject->hydrate($_SESSION);
|
||||
$objProject->setThumbnail($strDest);
|
||||
$objProjectModel->insert($objProject);
|
||||
|
||||
} else if (isset($_POST['toContinue'])) {
|
||||
$objProject->hydrate($_SESSION);
|
||||
$objProject->setThumbnail($strDest);
|
||||
$objProjectModel->insert($objProject);
|
||||
}
|
||||
|
||||
//Débuggage
|
||||
var_dump($_SESSION);
|
||||
var_dump($objProject);
|
||||
|
||||
|
||||
?>
|
||||
<body>
|
||||
<section class="container mt-5 p-5 d-flex flex-column align-items-center">
|
||||
<div>
|
||||
<h2>Alimenter votre projet</h2>
|
||||
<form method="post">
|
||||
<button type="submit" class="btn btn-primary btn-lg" name="showForm">+</button>
|
||||
<?php if (isset($_POST['toContinue'])) { ?>
|
||||
<button type="submit" class="btn btn-warning btn-lg" name="showFormContinue">Reprendre</button>
|
||||
<?php } ?>
|
||||
</form>
|
||||
|
||||
<?php // Affichage d'un formulaire en cas d'appuie sur le bouton "+"
|
||||
if ((isset($_POST["showForm"])) || (isset($_POST['showFormContinue']))) {?>
|
||||
<form method="post" enctype="multipart/form-data" onsubmit="return confirm('Voulez-vous vraiment envoyer le formulaire ?')">
|
||||
<div>
|
||||
<label>Titre</label>
|
||||
<input type="text" name="titleProject">
|
||||
</div>
|
||||
<div>
|
||||
<label>Description</label>
|
||||
<input type="text" name="descProject">
|
||||
</div>
|
||||
<div>
|
||||
<label>Texte Portfolio</label>
|
||||
<input type="text" name="textProject">
|
||||
</div>
|
||||
<div>
|
||||
<input name="imageProject" class="form-control" type="file">
|
||||
</div>
|
||||
<button type="submit" class="btn btn-primary btn-md" name="sendMessage">Envoyer</button>
|
||||
<button type="submit" class="btn btn-warning btn-md" name="toContinue">Remettre à plus tard</button>
|
||||
</form>
|
||||
<?php }; ?>
|
||||
|
||||
</div>
|
||||
<div>
|
||||
<h3>Description</h3>
|
||||
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
|
||||
Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.
|
||||
Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>
|
||||
</div>
|
||||
<div>
|
||||
<h3>Photos behind the scene</h3>
|
||||
<div class="row mb-2">
|
||||
<img>
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<h3>Other projects</h3>
|
||||
<div class="row mb-2">
|
||||
<?php
|
||||
foreach($arrProjectToDisplay as $objProject){
|
||||
include("../app/views/partials/preview.php");
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<section>
|
||||
</body>
|
||||
195
views/search.php
Normal file
195
views/search.php
Normal file
|
|
@ -0,0 +1,195 @@
|
|||
<section aria-label="Blog">
|
||||
<h2 class="visually-hidden">Rechercher parmi les articles</h2>
|
||||
<div class="row mb-2">
|
||||
<section class="mb-5" aria-labelledby="search-heading">
|
||||
<form name="formSearch" method="post" action="?ctrl=project&action=search" class="border rounded p-4 bg-light">
|
||||
<h3 id="search-heading" class="h4 mb-4">
|
||||
<i class="fas fa-search me-2" aria-hidden="true"></i>
|
||||
Rechercher des articles
|
||||
</h3>
|
||||
|
||||
<div class="row g-3">
|
||||
<div class="col-md-6">
|
||||
<label for="keywords" class="form-label">Mots-clés</label>
|
||||
<input
|
||||
value=""
|
||||
type="text"
|
||||
class="form-control"
|
||||
id="keywords"
|
||||
name="keywords"
|
||||
placeholder="Ex: JavaScript, CSS..."
|
||||
aria-describedby="keywords-help">
|
||||
<small id="keywords-help" class="form-text text-muted">
|
||||
Recherchez dans les titres et contenus
|
||||
</small>
|
||||
</div>
|
||||
|
||||
<div class="col-md-6">
|
||||
<label for="author" class="form-label">Auteur</label>
|
||||
<select class="form-select" id="author" name="author">
|
||||
<option value="0" <?php echo ($intAuthor == 0)?'selected':''; ?>>Tous les auteurs</option>
|
||||
<?php
|
||||
foreach($arrUser as $arrDetUser){
|
||||
?>
|
||||
<option value="<?php echo $arrDetUser['user_id']; ?>"
|
||||
<?php echo ($intAuthor == $arrDetUser['user_id'])?'selected':''; ?>
|
||||
>
|
||||
<?php echo $arrDetUser['user_firstname'].' '.$arrDetUser['user_name']; ?>
|
||||
</option>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="col-6">
|
||||
<fieldset>
|
||||
<legend class="form-label">Type de recherche par date</legend>
|
||||
<div class="form-check form-check-inline">
|
||||
<input
|
||||
class="form-check-input"
|
||||
type="radio"
|
||||
name="period"
|
||||
id="period-exact"
|
||||
value="0"
|
||||
<?php echo ($intPeriod == 0)?'checked':'' ; ?>
|
||||
aria-controls="date-exact date-range">
|
||||
<label class="form-check-label" for="period-exact">
|
||||
Date exacte
|
||||
</label>
|
||||
</div>
|
||||
<div class="form-check form-check-inline">
|
||||
<input
|
||||
class="form-check-input"
|
||||
type="radio"
|
||||
name="period"
|
||||
id="period-range"
|
||||
value="1"
|
||||
<?php echo ($intPeriod == 1)?'checked':'' ; ?>
|
||||
aria-controls="date-exact date-range">
|
||||
<label class="form-check-label" for="period-range">
|
||||
Période
|
||||
</label>
|
||||
</div>
|
||||
</fieldset>
|
||||
</div>
|
||||
<!-- AJOUT RECHERCHE PAR CATEGORIE -->
|
||||
<div class="col-6">
|
||||
<fieldset>
|
||||
<legend class="form-label">Type de recherche par catégories</legend>
|
||||
<div class="col-md-6">
|
||||
<label for="author" class="form-label">Catégorie</label>
|
||||
<select class="form-select" id="category" name="category">
|
||||
<option value="0" <?php echo ($intCategory == 0)?'selected':''; ?>>Toutes les catégories</option>
|
||||
<?php
|
||||
foreach($arrCategory as $arrDetCategory){
|
||||
?>
|
||||
<option value="<?php echo $arrDetCategory['category_id']; ?>"
|
||||
<?php echo ($intCategory == $arrDetCategory['category_id'])?'selected':''; ?>
|
||||
>
|
||||
<?php echo $arrDetCategory['category_name']; ?>
|
||||
</option>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
</div>
|
||||
</fieldset>
|
||||
</div>
|
||||
|
||||
<div class="col-md-6" id="date-exact">
|
||||
<label for="date" class="form-label">Date</label>
|
||||
<input
|
||||
type="date"
|
||||
class="form-control"
|
||||
id="date"
|
||||
name="date"
|
||||
aria-describedby="date-help"
|
||||
value="<?php echo $strDate; ?>" >
|
||||
<small id="date-help" class="form-text text-muted">
|
||||
Format: JJ/MM/AAAA
|
||||
</small>
|
||||
</div>
|
||||
|
||||
<div id="date-range" style="display: none;">
|
||||
<div class="row g-3">
|
||||
<div class="col-md-6">
|
||||
<label for="startdate" class="form-label">Date de début</label>
|
||||
<input
|
||||
type="date"
|
||||
class="form-control"
|
||||
id="startdate"
|
||||
name="startdate"
|
||||
value="<?php echo $strStartDate; ?>" >
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<label for="enddate" class="form-label">Date de fin</label>
|
||||
<input
|
||||
type="date"
|
||||
class="form-control"
|
||||
id="enddate"
|
||||
name="enddate"
|
||||
value="<?php echo $strEndDate; ?>" >
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-12">
|
||||
<button type="submit" class="btn btn-primary">
|
||||
<i class="fas fa-search me-2" aria-hidden="true"></i>
|
||||
Rechercher
|
||||
</button>
|
||||
<button type="reset" class="btn btn-secondary ms-2">
|
||||
<i class="fas fa-redo me-2" aria-hidden="true"></i>
|
||||
Réinitialiser
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</section>
|
||||
|
||||
<!-- Liste des articles -->
|
||||
<section aria-labelledby="articles-heading">
|
||||
<h3 id="articles-heading" class="visually-hidden">Liste des projets</h3>
|
||||
<div class="row mb-2">
|
||||
<?php
|
||||
if (count($arrProject) == 0){
|
||||
?>
|
||||
<div class="alert alert-warning">
|
||||
<p>Pas de résultats</p>
|
||||
</div>
|
||||
<?php
|
||||
}
|
||||
foreach($arrProjectToDisplay as $objProject){
|
||||
include("../app/views/partials/preview.php");
|
||||
} ?>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</section>
|
||||
<script>
|
||||
// Gestion de l'affichage des champs de date
|
||||
const periodRadios = document.querySelectorAll('input[name="period"]');
|
||||
const dateExact = document.getElementById('date-exact');
|
||||
const dateRange = document.getElementById('date-range');
|
||||
|
||||
function toggleDateFields() {
|
||||
const selectedPeriod = document.querySelector('input[name="period"]:checked').value;
|
||||
|
||||
if (selectedPeriod === '0') {
|
||||
dateExact.style.display = 'block';
|
||||
dateRange.style.display = 'none';
|
||||
} else {
|
||||
dateExact.style.display = 'none';
|
||||
dateRange.style.display = 'block';
|
||||
}
|
||||
}
|
||||
|
||||
periodRadios.forEach(radio => {
|
||||
radio.addEventListener('change', toggleDateFields);
|
||||
});
|
||||
|
||||
// Initialisation au chargement
|
||||
toggleDateFields();
|
||||
</script>
|
||||
Loading…
Add table
Add a link
Reference in a new issue