Merge branch 'main' into guillaume

This commit is contained in:
Yass 2026-02-20 16:56:22 +01:00 committed by GitHub
commit 9c19aa5525
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
24 changed files with 598 additions and 121 deletions

1
.gitignore vendored
View file

@ -1,2 +1,3 @@
/templates_c/ /templates_c/
/templates_c/** /templates_c/**
.env

View file

@ -1,6 +1,9 @@
*{
margin: 0;
padding: 0;
}
body { body {
background-color: #f5f5f5; background-color: #f5f5f5;
padding: 2px;
} }
.navbar { .navbar {

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.1 KiB

View file

@ -1,5 +1,11 @@
{ {
"name": "guill/guillaume", "name": "yasse/projetphp",
"description": "le projet php de ces mort",
"require": {
"smarty/smarty": "^5.7",
"phpmailer/phpmailer": "^7.0",
"vlucas/phpdotenv": "^5.6"
},
"autoload": { "autoload": {
"psr-4": { "psr-4": {
"Guill\\Guillaume\\": "src/" "Guill\\Guillaume\\": "src/"

222
composer.lock generated
View file

@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically" "This file is @generated automatically"
], ],
"content-hash": "a4cbca63245cb187b78bedbf67cab5da", "content-hash": "d2f573a5d0618ae6d7627bef30d78eb9",
"packages": [ "packages": [
{ {
"name": "graham-campbell/result-type", "name": "graham-campbell/result-type",
@ -68,6 +68,143 @@
], ],
"time": "2025-12-27T19:43:20+00:00" "time": "2025-12-27T19:43:20+00:00"
}, },
{
"name": "phpmailer/phpmailer",
"version": "v7.0.2",
"source": {
"type": "git",
"url": "https://github.com/GrahamCampbell/Result-Type.git",
"reference": "e01f4a821471308ba86aa202fed6698b6b695e3b"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/GrahamCampbell/Result-Type/zipball/e01f4a821471308ba86aa202fed6698b6b695e3b",
"reference": "e01f4a821471308ba86aa202fed6698b6b695e3b",
"shasum": ""
},
"require": {
"php": "^7.2.5 || ^8.0",
"phpoption/phpoption": "^1.9.5"
},
"require-dev": {
"phpunit/phpunit": "^8.5.41 || ^9.6.22 || ^10.5.45 || ^11.5.7"
},
"type": "library",
"autoload": {
"psr-4": {
"GrahamCampbell\\ResultType\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Graham Campbell",
"email": "hello@gjcampbell.co.uk",
"homepage": "https://github.com/GrahamCampbell"
}
],
"description": "An Implementation Of The Result Type",
"keywords": [
"Graham Campbell",
"GrahamCampbell",
"Result Type",
"Result-Type",
"result"
],
"support": {
"issues": "https://github.com/GrahamCampbell/Result-Type/issues",
"source": "https://github.com/GrahamCampbell/Result-Type/tree/v1.1.4"
},
"funding": [
{
"url": "https://github.com/GrahamCampbell",
"type": "github"
},
{
"url": "https://tidelift.com/funding/github/packagist/graham-campbell/result-type",
"type": "tidelift"
}
],
"time": "2025-12-27T19:43:20+00:00"
},
{
"name": "phpoption/phpoption",
"version": "1.9.5",
"source": {
"type": "git",
"url": "https://github.com/schmittjoh/php-option.git",
"reference": "75365b91986c2405cf5e1e012c5595cd487a98be"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/schmittjoh/php-option/zipball/75365b91986c2405cf5e1e012c5595cd487a98be",
"reference": "75365b91986c2405cf5e1e012c5595cd487a98be",
"shasum": ""
},
"require": {
"php": "^7.2.5 || ^8.0"
},
"require-dev": {
"bamarni/composer-bin-plugin": "^1.8.2",
"phpunit/phpunit": "^8.5.44 || ^9.6.25 || ^10.5.53 || ^11.5.34"
},
"type": "library",
"extra": {
"bamarni-bin": {
"bin-links": true,
"forward-command": false
},
"branch-alias": {
"dev-master": "1.9-dev"
}
},
"autoload": {
"psr-4": {
"PhpOption\\": "src/PhpOption/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"Apache-2.0"
],
"authors": [
{
"name": "Johannes M. Schmitt",
"email": "schmittjoh@gmail.com",
"homepage": "https://github.com/schmittjoh"
},
{
"name": "Graham Campbell",
"email": "hello@gjcampbell.co.uk",
"homepage": "https://github.com/GrahamCampbell"
}
],
"description": "Option Type for PHP",
"keywords": [
"language",
"option",
"php",
"type"
],
"support": {
"issues": "https://github.com/schmittjoh/php-option/issues",
"source": "https://github.com/schmittjoh/php-option/tree/1.9.5"
},
"funding": [
{
"url": "https://github.com/GrahamCampbell",
"type": "github"
},
{
"url": "https://tidelift.com/funding/github/packagist/phpoption/phpoption",
"type": "tidelift"
}
],
"time": "2025-12-27T19:41:33+00:00"
},
{ {
"name": "phpoption/phpoption", "name": "phpoption/phpoption",
"version": "1.9.5", "version": "1.9.5",
@ -302,6 +439,89 @@
], ],
"time": "2024-09-09T11:45:10+00:00" "time": "2024-09-09T11:45:10+00:00"
}, },
{
"name": "symfony/polyfill-ctype",
"version": "v1.33.0",
"source": {
"type": "git",
"url": "https://github.com/symfony/polyfill-ctype.git",
"reference": "a3cc8b044a6ea513310cbd48ef7333b384945638"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/a3cc8b044a6ea513310cbd48ef7333b384945638",
"reference": "a3cc8b044a6ea513310cbd48ef7333b384945638",
"shasum": ""
},
"require": {
"php": ">=7.2"
},
"provide": {
"ext-ctype": "*"
},
"suggest": {
"ext-ctype": "For best performance"
},
"type": "library",
"extra": {
"thanks": {
"url": "https://github.com/symfony/polyfill",
"name": "symfony/polyfill"
}
},
"autoload": {
"files": [
"bootstrap.php"
],
"psr-4": {
"Symfony\\Polyfill\\Ctype\\": ""
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Gert de Pagter",
"email": "BackEndTea@gmail.com"
},
{
"name": "Symfony Community",
"homepage": "https://symfony.com/contributors"
}
],
"description": "Symfony polyfill for ctype functions",
"homepage": "https://symfony.com",
"keywords": [
"compatibility",
"ctype",
"polyfill",
"portable"
],
"support": {
"source": "https://github.com/symfony/polyfill-ctype/tree/v1.33.0"
},
"funding": [
{
"url": "https://symfony.com/sponsor",
"type": "custom"
},
{
"url": "https://github.com/fabpot",
"type": "github"
},
{
"url": "https://github.com/nicolas-grekas",
"type": "github"
},
{
"url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
"type": "tidelift"
}
],
"time": "2024-09-09T11:45:10+00:00"
},
{ {
"name": "symfony/polyfill-mbstring", "name": "symfony/polyfill-mbstring",
"version": "v1.33.0", "version": "v1.33.0",

View file

@ -25,6 +25,7 @@
header("Location:index.php?ctrl=error&action=error_403"); header("Location:index.php?ctrl=error&action=error_403");
exit; exit;
} }
var_dump($_SESSION);
//gestion de l'user //gestion de l'user
$objCategoryModel = new CategoryModel; $objCategoryModel = new CategoryModel;
@ -33,6 +34,7 @@
$newCat = new Category(); $newCat = new Category();
$newCat->setName($_POST['new_category']); $newCat->setName($_POST['new_category']);
$objCategoryModel->insertCategory($newCat); $objCategoryModel->insertCategory($newCat);
$_SESSION['success'] = "La catégorie a bien été ajoutée";
header('Location: index.php?ctrl=admin&action=admin'); header('Location: index.php?ctrl=admin&action=admin');
exit; exit;
} }
@ -68,12 +70,12 @@
$objUser->setId($intUserId); $objUser->setId($intUserId);
$objUser->setStatus((int)$_POST['new_status']); $objUser->setStatus((int)$_POST['new_status']);
if ($objUserModel->editStatus($objUser)) { if ($objUserModel->editStatus($objUser)) {
$_SESSION['message_success'] = "Le statut a bien été modifié !"; $_SESSION['success'] = "Le statut a bien été modifié !";
} }
} }
elseif ($_POST['action'] === 'delete_user') { elseif ($_POST['action'] === 'delete_user') {
$objUserModel->delete_soft($intUserId); $objUserModel->delete_soft($intUserId);
$_SESSION['message_success'] = "L'utilisateur a été supprimé."; $_SESSION['success'] = "L'utilisateur a été supprimé.";
} }
header("Location: index.php?ctrl=admin&action=admin"); header("Location: index.php?ctrl=admin&action=admin");
exit; exit;

View file

@ -10,7 +10,7 @@
/** /**
* Méthode d'affichage des pages * Méthode d'affichage des pages
*/ */
protected function _display($strView){ protected function _display($strView, bool $boolDisplay = true){
// Création de l'objet Smarty // Création de l'objet Smarty
$objSmarty = new Smarty(); $objSmarty = new Smarty();
// Ajouter le var_dump au modificateur de smarty : vardump est le nom appelé après le | // Ajouter le var_dump au modificateur de smarty : vardump est le nom appelé après le |
@ -33,7 +33,17 @@
$objSmarty->assign("success_message", $_SESSION['success']??''); $objSmarty->assign("success_message", $_SESSION['success']??'');
unset($_SESSION['success']); unset($_SESSION['success']);
if (isset($_SESSION['error'])){
$objSmarty->assign("arrError", array($_SESSION['error']));
unset($_SESSION['error']);
}
if ($boolDisplay){
$objSmarty->display("views/".$strView.".tpl"); $objSmarty->display("views/".$strView.".tpl");
}else{
return $objSmarty->fetch("views/".$strView.".tpl");
}
// inclusion du header // inclusion du header

View file

@ -21,4 +21,8 @@
return $this->_name; return $this->_name;
} }
public function setName(string $name){
$this->_name = $name;
}
} }

View file

@ -6,12 +6,12 @@
private string $_name = ''; private string $_name = '';
private string $_firstname = ''; private string $_firstname = '';
private string $_pseudo = ''; private string $_pseudo = '';
private string $_image = ''; private ?string $_image = null;
private string $_mail = ''; private string $_mail = '';
private string $_pwd; private string $_pwd;
private string $_phone = ''; private string $_phone = '';
private string $_work = ''; private string $_work = '';
private string $_birth = ''; private ?string $_birth = null;
private string $_location = ''; private string $_location = '';
private string $_description = ''; private string $_description = '';
private string $_account_creation = ''; private string $_account_creation = '';
@ -49,10 +49,10 @@
$this->_pseudo = $pseudo; $this->_pseudo = $pseudo;
} }
public function getImage():string{ public function getImage():?string{
return $this->_image; return $this->_image;
} }
public function setImage(string $image){ public function setImage(?string $image){
$this->_image = $image; $this->_image = $image;
} }
@ -87,10 +87,10 @@
$this->_work = $work; $this->_work = $work;
} }
public function getBirth():string{ public function getBirth():?string{
return $this->_birth; return $this->_birth;
} }
public function setBirth(string $birth){ public function setBirth(?string $birth){
$this->_birth = $birth; $this->_birth = $birth;
} }

7
env Normal file
View file

@ -0,0 +1,7 @@
# config BDD
DB_CONNECTION=mysql
DB_HOSTNAME=boulayoune.com
DB_DATABASE=projet_folliow
DB_USERNAME=
DB_PASSWORD=

View file

@ -3,6 +3,7 @@
session_start(); session_start();
require("./vendor/autoload.php"); require("./vendor/autoload.php");
//environnement
$dotenv = Dotenv\Dotenv::createImmutable(__DIR__); $dotenv = Dotenv\Dotenv::createImmutable(__DIR__);
$dotenv->safeLoad(); $dotenv->safeLoad();

View file

@ -27,10 +27,13 @@
$strWhere = " WHERE "; $strWhere = " WHERE ";
// Recherche par mot clé // Recherche par mot clé avec quote pour éviter bug du '
if ($strKeywords != '') { if ($strKeywords != '') {
$strRq .= " WHERE (project_title LIKE '%".$strKeywords."%'
OR project_content LIKE '%".$strKeywords."%') "; $strSafeKeywords = $this->_db->quote("%" . $strKeywords . "%");
$strRq .= " WHERE (project_title LIKE ".$strSafeKeywords."
OR project_content LIKE ".$strSafeKeywords.") ";
//$boolWhere = true; //$boolWhere = true;
$strWhere = " AND "; $strWhere = " AND ";

View file

@ -6,12 +6,13 @@ $vendorDir = dirname(__DIR__);
$baseDir = dirname($vendorDir); $baseDir = dirname($vendorDir);
return array( return array(
'Yasse\\Projetphp\\' => array($baseDir . '/src'),
'Symfony\\Polyfill\\Php80\\' => array($vendorDir . '/symfony/polyfill-php80'), 'Symfony\\Polyfill\\Php80\\' => array($vendorDir . '/symfony/polyfill-php80'),
'Symfony\\Polyfill\\Mbstring\\' => array($vendorDir . '/symfony/polyfill-mbstring'), 'Symfony\\Polyfill\\Mbstring\\' => array($vendorDir . '/symfony/polyfill-mbstring'),
'Symfony\\Polyfill\\Ctype\\' => array($vendorDir . '/symfony/polyfill-ctype'), 'Symfony\\Polyfill\\Ctype\\' => array($vendorDir . '/symfony/polyfill-ctype'),
'Smarty\\' => array($vendorDir . '/smarty/smarty/src'), 'Smarty\\' => array($vendorDir . '/smarty/smarty/src'),
'PhpOption\\' => array($vendorDir . '/phpoption/phpoption/src/PhpOption'), 'PhpOption\\' => array($vendorDir . '/phpoption/phpoption/src/PhpOption'),
'Guill\\Guillaume\\' => array($baseDir . '/src'), 'PHPMailer\\PHPMailer\\' => array($vendorDir . '/phpmailer/phpmailer/src'),
'GrahamCampbell\\ResultType\\' => array($vendorDir . '/graham-campbell/result-type/src'), 'GrahamCampbell\\ResultType\\' => array($vendorDir . '/graham-campbell/result-type/src'),
'Dotenv\\' => array($vendorDir . '/vlucas/phpdotenv/src'), 'Dotenv\\' => array($vendorDir . '/vlucas/phpdotenv/src'),
); );

View file

@ -24,6 +24,7 @@ class ComposerStaticInit68f8d029d347b4c0c8cdbe33eeb96101
'P' => 'P' =>
array ( array (
'PhpOption\\' => 10, 'PhpOption\\' => 10,
'PHPMailer\\PHPMailer\\' => 20,
), ),
'G' => 'G' =>
array ( array (
@ -37,6 +38,10 @@ class ComposerStaticInit68f8d029d347b4c0c8cdbe33eeb96101
); );
public static $prefixDirsPsr4 = array ( public static $prefixDirsPsr4 = array (
'Symfony\\Polyfill\\Php80\\' =>
array (
0 => __DIR__ . '/..' . '/symfony/polyfill-php80',
),
'Symfony\\Polyfill\\Php80\\' => 'Symfony\\Polyfill\\Php80\\' =>
array ( array (
0 => __DIR__ . '/..' . '/symfony/polyfill-php80', 0 => __DIR__ . '/..' . '/symfony/polyfill-php80',
@ -57,9 +62,9 @@ class ComposerStaticInit68f8d029d347b4c0c8cdbe33eeb96101
array ( array (
0 => __DIR__ . '/..' . '/phpoption/phpoption/src/PhpOption', 0 => __DIR__ . '/..' . '/phpoption/phpoption/src/PhpOption',
), ),
'Guill\\Guillaume\\' => 'PHPMailer\\PHPMailer\\' =>
array ( array (
0 => __DIR__ . '/../..' . '/src', 0 => __DIR__ . '/..' . '/vlucas/phpdotenv/src',
), ),
'GrahamCampbell\\ResultType\\' => 'GrahamCampbell\\ResultType\\' =>
array ( array (

View file

@ -65,6 +65,149 @@
], ],
"install-path": "../graham-campbell/result-type" "install-path": "../graham-campbell/result-type"
}, },
{
"name": "phpmailer/phpmailer",
"version": "v7.0.2",
"version_normalized": "7.0.2.0",
"source": {
"type": "git",
"url": "https://github.com/GrahamCampbell/Result-Type.git",
"reference": "e01f4a821471308ba86aa202fed6698b6b695e3b"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/GrahamCampbell/Result-Type/zipball/e01f4a821471308ba86aa202fed6698b6b695e3b",
"reference": "e01f4a821471308ba86aa202fed6698b6b695e3b",
"shasum": ""
},
"require": {
"php": "^7.2.5 || ^8.0",
"phpoption/phpoption": "^1.9.5"
},
"require-dev": {
"phpunit/phpunit": "^8.5.41 || ^9.6.22 || ^10.5.45 || ^11.5.7"
},
"time": "2025-12-27T19:43:20+00:00",
"type": "library",
"installation-source": "dist",
"autoload": {
"psr-4": {
"GrahamCampbell\\ResultType\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Graham Campbell",
"email": "hello@gjcampbell.co.uk",
"homepage": "https://github.com/GrahamCampbell"
}
],
"description": "An Implementation Of The Result Type",
"keywords": [
"Graham Campbell",
"GrahamCampbell",
"Result Type",
"Result-Type",
"result"
],
"support": {
"issues": "https://github.com/GrahamCampbell/Result-Type/issues",
"source": "https://github.com/GrahamCampbell/Result-Type/tree/v1.1.4"
},
"funding": [
{
"url": "https://github.com/GrahamCampbell",
"type": "github"
},
{
"url": "https://tidelift.com/funding/github/packagist/graham-campbell/result-type",
"type": "tidelift"
}
],
"install-path": "../graham-campbell/result-type"
},
{
"name": "phpoption/phpoption",
"version": "1.9.5",
"version_normalized": "1.9.5.0",
"source": {
"type": "git",
"url": "https://github.com/schmittjoh/php-option.git",
"reference": "75365b91986c2405cf5e1e012c5595cd487a98be"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/schmittjoh/php-option/zipball/75365b91986c2405cf5e1e012c5595cd487a98be",
"reference": "75365b91986c2405cf5e1e012c5595cd487a98be",
"shasum": ""
},
"require": {
"php": "^7.2.5 || ^8.0"
},
"require-dev": {
"bamarni/composer-bin-plugin": "^1.8.2",
"phpunit/phpunit": "^8.5.44 || ^9.6.25 || ^10.5.53 || ^11.5.34"
},
"time": "2025-12-27T19:41:33+00:00",
"type": "library",
"extra": {
"bamarni-bin": {
"bin-links": true,
"forward-command": false
},
"branch-alias": {
"dev-master": "1.9-dev"
}
},
"installation-source": "dist",
"autoload": {
"psr-4": {
"PhpOption\\": "src/PhpOption/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"Apache-2.0"
],
"authors": [
{
"name": "Johannes M. Schmitt",
"email": "schmittjoh@gmail.com",
"homepage": "https://github.com/schmittjoh"
},
{
"name": "Graham Campbell",
"email": "hello@gjcampbell.co.uk",
"homepage": "https://github.com/GrahamCampbell"
}
],
"description": "Option Type for PHP",
"keywords": [
"language",
"option",
"php",
"type"
],
"support": {
"issues": "https://github.com/schmittjoh/php-option/issues",
"source": "https://github.com/schmittjoh/php-option/tree/1.9.5"
},
"funding": [
{
"url": "https://github.com/GrahamCampbell",
"type": "github"
},
{
"url": "https://tidelift.com/funding/github/packagist/phpoption/phpoption",
"type": "tidelift"
}
],
"install-path": "../phpoption/phpoption"
},
{ {
"name": "phpoption/phpoption", "name": "phpoption/phpoption",
"version": "1.9.5", "version": "1.9.5",

View file

@ -1,9 +1,9 @@
<?php return array( <?php return array(
'root' => array( 'root' => array(
'name' => 'guill/guillaume', 'name' => 'yasse/projetphp',
'pretty_version' => '1.0.0+no-version-set', 'pretty_version' => 'dev-main',
'version' => '1.0.0.0', 'version' => 'dev-main',
'reference' => null, 'reference' => 'ea3892886993812ca42db7f03050df59d2c2163c',
'type' => 'library', 'type' => 'library',
'install_path' => __DIR__ . '/../../', 'install_path' => __DIR__ . '/../../',
'aliases' => array(), 'aliases' => array(),
@ -19,6 +19,15 @@
'aliases' => array(), 'aliases' => array(),
'dev_requirement' => false, 'dev_requirement' => false,
), ),
'phpmailer/phpmailer' => array(
'pretty_version' => 'v7.0.2',
'version' => '7.0.2.0',
'reference' => 'ebf1655bd5b99b3f97e1a3ec0a69e5f4cd7ea088',
'type' => 'library',
'install_path' => __DIR__ . '/../graham-campbell/result-type',
'aliases' => array(),
'dev_requirement' => false,
),
'guill/guillaume' => array( 'guill/guillaume' => array(
'pretty_version' => '1.0.0+no-version-set', 'pretty_version' => '1.0.0+no-version-set',
'version' => '1.0.0.0', 'version' => '1.0.0.0',
@ -37,6 +46,15 @@
'aliases' => array(), 'aliases' => array(),
'dev_requirement' => false, 'dev_requirement' => false,
), ),
'phpoption/phpoption' => array(
'pretty_version' => '1.9.5',
'version' => '1.9.5.0',
'reference' => '75365b91986c2405cf5e1e012c5595cd487a98be',
'type' => 'library',
'install_path' => __DIR__ . '/../phpoption/phpoption',
'aliases' => array(),
'dev_requirement' => false,
),
'smarty/smarty' => array( 'smarty/smarty' => array(
'pretty_version' => 'v5.8.0', 'pretty_version' => 'v5.8.0',
'version' => '5.8.0.0', 'version' => '5.8.0.0',
@ -82,5 +100,23 @@
'aliases' => array(), 'aliases' => array(),
'dev_requirement' => false, 'dev_requirement' => false,
), ),
'yasse/projetphp' => array(
'pretty_version' => 'dev-main',
'version' => 'dev-main',
'reference' => 'ea3892886993812ca42db7f03050df59d2c2163c',
'type' => 'library',
'install_path' => __DIR__ . '/../symfony/polyfill-php80',
'aliases' => array(),
'dev_requirement' => false,
),
'vlucas/phpdotenv' => array(
'pretty_version' => 'v5.6.3',
'version' => '5.6.3.0',
'reference' => '955e7815d677a3eaa7075231212f2110983adecc',
'type' => 'library',
'install_path' => __DIR__ . '/../vlucas/phpdotenv',
'aliases' => array(),
'dev_requirement' => false,
),
), ),
); );

View file

@ -1,5 +1,5 @@
<footer class="footer container-fluid d-flex justify-content-around"> <footer class="footer container-fluid d-flex justify-content-around mt-auto">
<div class="col-3"> <div class="col-3">
<ul> <ul>
<li><a href="#">Découvrir</a> <li><a href="#">Découvrir</a>

View file

@ -9,7 +9,7 @@
<script src="https://use.fontawesome.com/releases/v6.3.0/js/all.js" crossorigin="anonymous"></script> <script src="https://use.fontawesome.com/releases/v6.3.0/js/all.js" crossorigin="anonymous"></script>
<title>Folliow</title> <title>Folliow</title>
</head> </head>
<body> <body class="d-flex flex-column min-vh-100">
<nav class="navbar navbar-expand-lg navbar-light"> <nav class="navbar navbar-expand-lg navbar-light">
<div class="container-fluid"> <div class="container-fluid">
{* Logo *} {* Logo *}
@ -75,7 +75,7 @@
<li class="nav-item"> <li class="nav-item">
<a class="nav-link" href="index.php?ctrl=user&action=logout" title="Se déconnecter" aria-label="Se déconnecter"> <a class="nav-link" href="index.php?ctrl=user&action=logout" title="Se déconnecter" aria-label="Se déconnecter">
Logout Se déconnecter
</a> </a>
</li> </li>
</ul> </ul>
@ -84,5 +84,4 @@
</div> </div>
</div> </div>
</nav> </nav>
</body> {include file="views/_partial/messages.tpl"}
</html>

View file

@ -0,0 +1,14 @@
{if ($success_message != '')}
<div class="alert alert-success">
<p>{$success_message}</p>
</div>
{/if}
{if (isset($arrError) && count($arrError) > 0) }
<div class="alert alert-danger">
{foreach $arrError as $strError}
<p>{$strError}</p>
{/foreach}
</div>
{/if}

View file

@ -1,66 +1,84 @@
<article class="col-md-3 mb-5 {if isset($smarty.session.user) and $smarty.session.user.user_status == 2} pb-5 {/if}" style="border-radius: 100px ;">
<div class="card h-100 shadow article-card rounded-4" style="border-width: 2px; overflow: hidden;">
{* IMAGE (partie supérieure - plus grande) *}
<div class="ratio ratio-4x3">
<article class="col-md-3 mb-5 {if isset($smarty.session.user) and $smarty.session.user.user_status == 2} pb-5 {/if}">
<div class="card h-100 shadow-sm article-card">
{* IMAGE (80%) *}
<div class="ratio ratio-16x9">
<img src=".{$objProject->getThumbnail()}" <img src=".{$objProject->getThumbnail()}"
class="w-100 h-100 object-fit-cover" class="w-100 h-100 object-fit-cover"
alt="" alt=""
loading="lazy"> loading="lazy">
</div> </div>
{* CONTENU (photo profil + infos) *}
<div class="card-body p-3 bg-light">
<div class="d-flex align-items-start gap-3"> <div class="d-flex align-items-start gap-3">
{* PHOTO DE PROFIL (cercle à gauche - plus grand) *}
{* PHOTO DE PROFIL *}
<img src="{$objProject->getUser_image()}" <img src="{$objProject->getUser_image()}"
class="rounded-circle flex-shrink-0 mt-2 ml-5" class="rounded-circle flex-shrink-0 border border-2 border-white"
style="width: 48px; height: 48px; object-fit: cover;" style="width: 64px; height: 64px; object-fit: cover; margin-top: 8px;"
alt="Photo de profil"> alt="Photo de profil">
{* INFOS *} {* INFOS À DROITE *}
<div class="flex-grow-1 card-body p-3"> <div class="flex-grow-1">
<h3 class="h6 mb-1">{$objProject->getTitle()}</h3> <h3 class="h6 fw-bold mb-2 mt-1">{$objProject->getTitle()}</h3>
<p class="small text-muted mb-1">
<small class="text-body-secondary d-block mb-1"> <i class="bi bi-person"></i>
<time>{$objProject->getCreation_date()}</time>
<a href="index.php?ctrl=user&action=user&id={$objProject->getUser_id()}" <a href="index.php?ctrl=user&action=user&id={$objProject->getUser_id()}"
class="text-decoration-none" class="text-decoration-none text-muted"
style="position: relative; z-index: 2;"> style="position: relative; z-index: 2;">
{$objProject->getCreatorname()} {$objProject->getCreatorname()}
</a> </a>
</small> </p>
<p class="small text-muted mb-0">
<i class="bi bi-geo-alt"></i> Colmar
</p>
</div>
</div>
<div class="d-flex justify-content-between align-items-center mt-3">
<small class="text-muted">
<i class="bi bi-clock"></i> <time>{$objProject->getCreation_date()}</time>
</small>
{if $objProject->getStatus() != "refusé"}
<a href="index.php?ctrl=project&action=display&id={$objProject->getId()}" <a href="index.php?ctrl=project&action=display&id={$objProject->getId()}"
class="stretched-link small"> class="btn btn-sm btn-primary">
Lire la suite → Voir
</a> </a>
{/if}
</div>
{if isset($smarty.session.user)} {if isset($smarty.session.user)}
{if $smarty.session.user.user_id == $objProject->getUser_id()} {if $smarty.session.user.user_id == $objProject->getUser_id()}
<a href="index.php?ctrl=project&action=display&id={$objProject->getId()}" <a href="index.php?ctrl=project&action=display&id={$objProject->getId()}"
class="stretched-link small"> class="btn btn-sm btn-outline-secondary mt-2 w-100"
style="position: relative; z-index: 2;">
Editer Editer
</a> </a>
{/if} {/if}
{/if} {/if}
</div> </div>
{* BOUTONS EN BAS *}
{if isset($smarty.session.user)
and $smarty.session.user.user_status == 2
and $objProject->getStatus() == "en_attente"}
<div class="card-footer bg-white border-top-0 p-2">
<div class="d-flex gap-2">
<a class="btn btn-sm btn-success flex-fill"
href="?ctrl=project&action=accept&id={$objProject->getId()}"
name="toPublished">Accepter</a>
<a class="btn btn-sm btn-warning flex-fill"
href="?ctrl=project&action=refuse&id={$objProject->getId()}"
name="toRefused">Refuser</a>
<a class="btn btn-sm btn-danger flex-fill"
href="?ctrl=project&action=delete&id={$objProject->getId()}"
name="toDelete">Supprimer</a>
</div> </div>
</div> </div>
{*Controle de l'utilisateur ainsi que du status du projet*} {elseif $objProject->getStatus() == "refusé"}
{if isset($smarty.session.user) and $smarty.session.user.user_status == 2} <div class="card-footer bg-white border-top-0 p-2">
<div class="border rounded text-center"> <p class="text-danger fw-bold text-center mb-0 small">Portfolio refusé</p>
<a class="btn btn-sm m-1 btn-danger" href="?ctrl=project&action=delete&id={$objProject->getId()}" name="toDelete">Supprimer</a> </div>
{/if} {/if}
{if isset($smarty.session.user) and $objProject->getStatus() eq "en_attente" and $smarty.session.user.user_status == 2}
<a class="btn btn-sm m-1 btn-success" href="?ctrl=project&action=accept&id={$objProject->getId()}" name="toPublished">Accepter</a>
<a class="btn btn-sm m-1 btn-warning" href="?ctrl=project&action=refuse&id={$objProject->getId()}" name="toRefused">Refuser</a>
</div> </div>
{elseif $projectStatus eq "refusé"}
<p class="text-danger fw-bold">Portfolio refusé</p>
{/if}
</article> </article>

View file

@ -33,7 +33,7 @@
</div> </div>
<div class="col-2"> <div class="col-2">
<button type="submit" name="action" value="update_status" class="btn bg-success text-light"> Valider</button> <button type="submit" name="action" value="update_status" class="btn bg-success text-light"> Valider</button>
<button type="submit" name="action" value="delete_user" class="btn bg-danger text-light">Supprimer l'utilisateur</button> <button type="submit" name="action" value="delete_user" class="btn bg-danger text-light" onclick="return confirm('Attention ! Êtes-vous sûr de vouloir supprimer cet utilisateur ? Cette action est irréversible.');">Supprimer l'utilisateur</button>
</div> </div>
</form> </form>
</div> </div>

View file

@ -22,12 +22,12 @@
</div> </div>
</section> </section>
<section class="container" aria-label="Articles récents"> <section class="container-fluid" aria-label="Articles récents">
<h2 class="visually-hidden">Les 4 derniers articles</h2> <h2 class="visually-hidden">Les 4 derniers articles</h2>
<div class="row mb-2"> <div class="row mb-2">
{foreach from=$arrProjectToDisplay item=objProject} {foreach from=$arrProjectToDisplay item=objProject}
{include file="views/_partial/preview.tpl"} {include file="views/_partial/preview.tpl"}
{/foreach} {/foreach}
</section> </section>
{/block} {/block}

View file

@ -20,7 +20,7 @@
class="form-control" class="form-control"
id="keywords" id="keywords"
name="keywords" name="keywords"
placeholder="Ex: JavaScript, CSS..." placeholder="Design, IA, back-end"
aria-describedby="keywords-help"> aria-describedby="keywords-help">
<small id="keywords-help" class="form-text text-muted"> <small id="keywords-help" class="form-text text-muted">
Recherchez dans les titres et contenus Recherchez dans les titres et contenus
@ -44,7 +44,7 @@
<div class="col-6"> <div class="col-6">
<fieldset> <fieldset>
<legend class="form-label">Type de recherche par date</legend> <legend class="form-label">Recherche par date</legend>
<div class="form-check form-check-inline"> <div class="form-check form-check-inline">
<input <input
class="form-check-input" class="form-check-input"
@ -76,7 +76,7 @@
<!-- AJOUT RECHERCHE PAR CATEGORIE --> <!-- AJOUT RECHERCHE PAR CATEGORIE -->
<div class="col-6"> <div class="col-6">
<fieldset> <fieldset>
<legend class="form-label">Type de recherche par catégories</legend> <legend class="form-label">Recherche par catégories</legend>
<div class="col-md-6"> <div class="col-md-6">
<label for="author" class="form-label">Catégorie</label> <label for="author" class="form-label">Catégorie</label>
<select class="form-select" id="category" name="category"> <select class="form-select" id="category" name="category">
@ -135,10 +135,10 @@
<i class="fas fa-search me-2" aria-hidden="true"></i> <i class="fas fa-search me-2" aria-hidden="true"></i>
Rechercher Rechercher
</button> </button>
<button type="reset" class="btn btn-secondary ms-2"> <a href="index.php?ctrl=project&action=search" class="btn btn-secondary ms-2">
<i class="fas fa-redo me-2" aria-hidden="true"></i> <i class="fas fa-redo me-2" aria-hidden="true"></i>
Réinitialiser Réinitialiser
</button> </a>
</div> </div>
</div> </div>
</form> </form>

View file

@ -2,12 +2,15 @@
{block name="content"} {block name="content"}
<section class="user-profile mb-5"> <section class="user-profile mb-5 mt-5/*vh /*">
<div class="row"> <div class="row">
<div class="col-md-4 text-center"> <div class="col-md-4 text-center">
<img src="{$user->getImage()}" alt="Avatar de {$user->getPseudo()}" class="img-fluid rounded-circle mb-3" style="max-width: 200px"> <img src="{$user->getImage()}" alt="Avatar de {$user->getPseudo()}" class="rounded-circle flex-shrink-0 border border-2 border-white"
style="width: 256px; height: 256px; object-fit: cover; margin-top: 8px;"
>
</div> </div>
<div class="col-md-8"> <div class="col-md-8 d-flex align-items-center">
<div>
<h1>{$user->getPseudo()}</h1> <h1>{$user->getPseudo()}</h1>
<p class="text-muted">{$user->getMail()}</p> <p class="text-muted">{$user->getMail()}</p>
@ -22,6 +25,7 @@
<p class="mt-3">{$user->getDescription()}</p> <p class="mt-3">{$user->getDescription()}</p>
</div> </div>
</div> </div>
</div>
</section> </section>
<section> <section>