Commit c99a45bb authored by Panunzio Flavien's avatar Panunzio Flavien

suppression fichiers inutiles (plus de place sur le serveur)

parent 616923f5
<?php
namespace App\Controller\Admin;
use \App;
use Core\Auth\DBAuth;
class AppController extends \App\Controller\AppController{
protected $template = 'default_admin';
public function __construct(){
parent::__construct();
$app = App::getInstance();
$auth = new DBAuth($app->getDb());
if (!$auth->logged()) {
$this->forbidden();
}
$this->indexation='<meta name="robots" content="noindex">';
}
}
\ No newline at end of file
<?php
namespace App\Controller\Admin;
class CategoriesController extends AppController{
public function __construct(){
parent::__construct();
$this->loadModel('Category');
}
public function index(){
$items = $this->Category->all();
$this->render('admin.categories.index', compact('items'));
}
public function add(){
if (!empty($_POST)) {
$result = $this->Category->create([
'titre' => $_POST['titre']
]);
return $this->index();
}
$category = new \stdClass();
$category->titre = "";
$this->render('admin.categories.edit', compact('category'));
}
public function edit(){
if (!empty($_POST)) {
$result = $this->Category->update($_GET['id'], [
'titre' => $_POST['titre']
]);
return $this->index();
}
$category = $this->Category->find($_GET['id']);
$this->render('admin.categories.edit', compact('category'));
}
public function delete(){
if (!empty($_POST)) {
$result = $this->Category->delete($_POST['id']);
return $this->index();
}
}
}
\ No newline at end of file
<?php
namespace App\Controller\Admin;
class PostsController extends AppController{
public function __construct(){
parent::__construct();
$this->loadModel('Post');
$this->loadModel('Category');
}
public function index(){
$posts = $this->Post->last();
$this->render('admin.posts.index', compact('posts'));
}
public function add(){
if (!empty($_POST)) {
$result = $this->Post->create([
'titre' => $_POST['titre'],
'contenu' => $_POST['contenu'],
'category_id' => $_POST['category_id']
]);
if ($result) {
return $this->index();
}
}
$categories = $this->Category->extract('id', 'titre');
$this->render('admin.posts.edit', compact('categories'));
}
public function edit(){
if (!empty($_POST)) {
$result = $this->Post->update($_GET['id'], [
'titre' => $_POST['titre'],
'contenu' => $_POST['contenu'],
'category_id' => $_POST['category_id']
]);
if ($result) {
return $this->index();
}
}
$post = $this->Post->find($_GET['id']);
$categories = $this->Category->extract('id', 'titre');
$this->render('admin.posts.edit', compact('categories','post'));
}
public function delete(){
if (!empty($_POST)) {
$result = $this->Post->delete($_POST['id']);
return $this->index();
}
}
}
\ No newline at end of file
......@@ -8,19 +8,10 @@ class ErrorsController extends AppController{
public function __construct(){
parent::__construct();
$this->indexation='<meta name="robots" content="noindex">';
}
public function error_404(){
$indexation='<meta name="robots" content="noindex">';
$this->render('errors.404',compact('indexation'));
}
public function error_418(){
$this->render('errors.418',compact('indexation'));
}
public function maintenance(){
$this->render('errors.maintenance',compact('indexation'));
}
}
\ No newline at end of file
<form method="post">
<div class="form-group">
<label for="titre">Titre de la catégorie</label>
<input type="text" class="form-control" id="titre" name="titre" value="<?= $category->titre ?>">
</div>
<button class="btn btn-primary">Sauvegarder</button>
</form>
\ No newline at end of file
<h1>Administrer les categories</h1>
<p><a href="/admin-categories-add" class="btn btn-success">Ajouter</a></p>
<table class="table">
<thead>
<tr>
<td>Id</td>
<td>Titre</td>
<td>Actions</td>
</tr>
</thead>
<tbody>
<?php foreach ($items as $category) : ?>
<tr>
<td><?= $category->id;?></td>
<td><?= $category->titre;?></td>
<td>
<a class="btn btn-primary" href="/admin-categories-edit/<?= $category->id; ?>">Éditer</a>
<form method="post" action="/admin-categories-delete" style="display: inline-block;">
<input type="hidden" name="id" value="<?= $category->id ?>">
<button type="submit" class="btn btn-danger">Supprimer</button>
</form>
</td>
</tr>
<?php endforeach; ?>
</tbody>
</table>
\ No newline at end of file
<form method="post">
<div class="form-group">
<label for="titre">Titre de l'aticle</label>
<input type="text" class="form-control" id="titre" name="titre" value="<?=$post->titre?>">
</div>
<div class="form-group">
<label for="contenu">Contenu</label>
<textarea class="form-control" id="contenu" name="contenu" rows="3"><?=$post->contenu?></textarea>
</div>
<div class="form-group">
<select class="form-control" name="category_id">
<?php foreach ($categories as $key => $value) : ?>
<option value="<?=$key ?>"><?=$value?></option>
<?php endforeach; ?>
</select>
</div>
<button type="submit" class="btn btn-primary">Sauvegarder</button>
</form>
\ No newline at end of file
<h1>Administrer les articles</h1>
<p><a href="/admin-posts-add" class="btn btn-success">Ajouter</a></p>
<table class="table">
<thead>
<tr>
<td>Id</td>
<td>Titre</td>
<td>Actions</td>
</tr>
</thead>
<tbody>
<?php foreach ($posts as $post) : ?>
<tr>
<td><?= $post->id;?></td>
<td><?= $post->titre;?></td>
<td>
<a class="btn btn-primary" href="/admin-posts-edit/<?= $post->id; ?>">Éditer</a>
<form method="post" action="/admin-posts-delete" style="display: inline-block;">
<input type="hidden" name="id" value="<?= $post->id ?>">
<button type="submit" class="btn btn-danger">Supprimer</button>
</form>
</td>
</tr>
<?php endforeach; ?>
</tbody>
</table>
\ No newline at end of file
<?php header('HTTP/1.0 418 I\'m a teapot');
?>
<main class="error teapot flex-center" title="Infinitea : Sheepfilms.co.uk">
<img src="/images/general/teapot.svg">
<h2>Je suis une théière</h2>
<a class="btn btn-primary" href="/">Revenir à l'accueil</a>
</main>
\ No newline at end of file
<?php header('HTTP/1.0 302 Found');
?>
<main class="error maintenance flex-center">
<img src="/images/general/maintenance.svg" alt="Photo by Ilya Pavlov on Unsplash">
<h2>Cette page est en maintenance, veuillez nous excusez.</h2>
<a class="btn btn-primary" href="/">Revenir à l'accueil</a>
</main>
\ No newline at end of file
......@@ -15,10 +15,7 @@
<h2 class="titre" data-title="CONCEPT">CONCEPT</h2><i class="fas fa-volume-up soundi" data-sound="soundConcept"></i>
<div>
<p>La Powerball, est un gadget de musculation simple d'utilisation et ludique. L'attraction que génère la balle vous permeet de muscler vos avant-bras. Vous pouvez retrouver ci-contre une vidéo de démonstration.</p>
<video controls>
<source src="/include/video/presentation.mp4" type="video/mp4">
Your browser does not support HTML5 video.
</video>
<iframe width="560" height="315" src="https://www.youtube.com/embed/6zOcSOcX4Nw" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
</div>
</div>
</div>
......
......@@ -84,7 +84,6 @@
<!-- JAVASCRIPT -->
<script src="/include/jquery.min.js"></script>
<script src="/include/jquery.cookie.js"></script>
<script src="/js/script.js"></script>
</body>
</html>
\ No newline at end of file
<?php if($errors): ?>
<div class="alert alert-danger">
Identifiants incorrects
</div>
<?php endif;?>
<form method="post">
<div class="form-group">
<label for="username">Pseudo</label>
<input type="text" class="form-control" name="username" id="username" required>
<label for="password">MotDePasse</label>
<input type="password" class="form-control" name="password" id="password" required>
</div>
<button class="btn btn-primary">Envoyer</button>
</form>
\ No newline at end of file
{"mappings": [],"ignores": ["*.js", "*.css","include"],"options": {"outputStyle": "compressed","debugInfo": false,"sourceMap": false},"includePaths": []}
\ No newline at end of file
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- Generator: Adobe Illustrator 21.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" id="Capa_1" x="0px" y="0px" viewBox="0 0 512.043 512.043" style="enable-background:new 0 0 512.043 512.043;" xml:space="preserve" width="512px" height="512px">
<g>
<g>
<g>
<path d="M371.082,323.14l71.535-71.535l41.685-29.807c0.838-0.603,1.56-1.352,2.133-2.21l24.149-36.173 c2.262-3.387,1.815-7.9-1.067-10.778l-24.149-24.149c-2.879-2.875-7.386-3.317-10.769-1.058l-36.181,24.149 c-0.861,0.57-1.61,1.293-2.21,2.133l-29.798,41.668l-39.458,39.458V74.155c0-0.137-0.068-0.247-0.077-0.384 c0-0.418,0.077-0.853,0.077-1.237C366.952,25.421,272.428,0,183.485,0S0.018,25.421,0.018,72.533c0,0.41,0.06,0.853,0.077,1.22 c0,0.137-0.077,0.247-0.077,0.384v262.4c0,41.105,74.752,72.269,175.13,73.916l-21.632,21.623 c-4.802,4.801-7.5,11.313-7.5,18.103s2.698,13.302,7.5,18.103l36.198,36.215c10.009,9.971,26.198,9.971,36.207,0l67.413-67.413 c4.825-4.792,7.529-11.316,7.509-18.116v-12.041c0-4.713,3.82-8.533,8.533-8.533h12.066c6.797,0.025,13.319-2.677,18.108-7.501 l1.399-1.399l111.787,111.787c6.766,6.844,15.976,10.715,25.6,10.761c8.28,0.038,16.279-3.003,22.443-8.533 c6.944-6.276,11.005-15.129,11.235-24.486c0.229-9.357-3.394-18.398-10.023-25.007L371.082,323.14z M183.485,17.067 c98.057,0,166.4,29.235,166.4,55.467c0,26.232-68.343,55.467-166.4,55.467s-166.4-29.235-166.4-55.467 C17.085,46.302,85.428,17.067,183.485,17.067z M17.085,336.555V281.6c9.754,8.355,20.819,15.044,32.751,19.797 c34.065,14.532,82.782,22.869,133.649,22.869c4.713,0,8.533-3.82,8.533-8.533s-3.82-8.533-8.533-8.533 c-48.64,0-94.925-7.834-126.993-21.521c-25.037-10.522-39.407-23.859-39.407-36.591v-57.327 c9.999,7.707,21.153,13.787,33.05,18.014c24.828,8.932,50.653,14.803,76.902,17.485c0.328,0.041,0.659,0.061,0.99,0.06 c4.51-0.018,8.227-3.543,8.485-8.046c0.258-4.503-3.033-8.429-7.512-8.961c-24.839-2.519-49.279-8.053-72.781-16.478 c-24.508-9.31-39.134-21.359-39.134-32.213v-57.173c31.189,26.573,100.318,40.619,166.4,40.619s135.211-14.046,166.4-40.585 v57.173c0,9.225-10.641,19.439-29.193,28.049c-2.798,1.263-4.702,3.932-4.985,6.989c-0.284,3.057,1.097,6.031,3.615,7.787 c2.518,1.757,5.785,2.025,8.556,0.703c7.861-3.519,15.253-8.002,22.007-13.346v80.068l-15.019,15.019l-32.768-32.742 c9.698-28.659,1.665-60.341-20.515-80.918c-22.18-20.577-54.374-26.215-82.227-14.399c-2.611,1.106-4.503,3.437-5.047,6.221 s0.33,5.655,2.333,7.663l33.826,33.911c3.225,3.18,5.04,7.52,5.04,12.049s-1.816,8.869-5.04,12.049 c-6.743,6.462-17.381,6.462-24.124,0l-33.877-33.801c-2.008-2.003-4.88-2.877-7.663-2.333c-2.783,0.544-5.115,2.435-6.221,5.047 c-11.753,27.853-6.094,60.008,14.464,82.174s52.196,30.227,80.854,20.602l14.652,14.652l-1.399,1.399 c-4.817,4.789-7.518,11.306-7.501,18.099v12.066c0,4.713-3.821,8.533-8.533,8.533h-12.092 c-6.793-0.019-13.311,2.682-18.099,7.501l-28.749,28.749c-2.884,0.06-5.768,0.119-8.695,0.119 C85.428,393.557,17.085,363.52,17.085,336.555z M242.519,194.56l-23.731-23.799c21.606-3.857,43.588,4.432,57.267,21.594 c13.679,17.163,16.857,40.44,8.277,60.641c-1.364,3.21-0.638,6.927,1.835,9.387l36.634,36.634l-12.416,12.425 c-7.614-7.248-18.814-9.261-28.476-5.12l-19.857-19.857c-2.462-2.469-6.179-3.192-9.387-1.826 c-20.201,8.539-43.455,5.343-60.604-8.329c-17.149-13.672-25.446-35.628-21.623-57.224l8.678,8.627l0.307,0.299l14.839,14.805 c8.543,8.992,21.291,12.642,33.299,9.534s21.384-12.484,24.492-24.492S251.511,203.103,242.519,194.56z M334.457,371.661 l-7.074,7.074c-1.562,1.622-3.705,2.555-5.956,2.594v-0.017H309.36c-14.138,0-25.6,11.461-25.6,25.6v12.075 c0.007,2.267-0.893,4.443-2.5,6.042l-67.413,67.413c-3.387,3.197-8.679,3.197-12.066,0l-36.215-36.207 c-3.331-3.332-3.331-8.734,0-12.066l67.413-67.413c1.604-1.594,3.772-2.492,6.033-2.5h12.066c14.139,0,25.6-11.461,25.6-25.6 v-12.066c0-2.263,0.9-4.433,2.5-6.033l7.066-7.066c3.385-3.201,8.681-3.201,12.066,0l5.973,5.973l24.149,24.149h0.051 l5.973,5.973c1.602,1.601,2.503,3.772,2.503,6.037S336.059,370.06,334.457,371.661z M334.525,335.556l-12.083-12.083 l18.449-18.449l23.501-23.501l0.085-0.085l54.528-54.451c0.171-0.171,0.23-0.401,0.384-0.58c0.154-0.179,0.375-0.29,0.521-0.486 l29.278-41.011l29.065-19.362l14.251,14.242l-19.405,29.065l-40.96,29.303c-0.205,0.145-0.307,0.367-0.495,0.521 c-0.188,0.154-0.401,0.213-0.572,0.384L334.525,335.556z M489.337,490.88c-7.354,5.935-18.036,5.214-24.525-1.656 L351.771,376.201c4.369-9.677,2.312-21.046-5.171-28.578l12.416-12.416l130.927,130.927c3.316,3.274,5.129,7.775,5.009,12.433 C494.85,483.268,492.82,487.72,489.337,490.88z" fill="#FFFFFF"/>
<path d="M48.744,147.541c-0.831-0.751-1.783-1.357-2.816-1.792c-2.078-0.853-4.408-0.853-6.485,0 c-1.044,0.412-2,1.021-2.816,1.792c-0.753,0.83-1.359,1.782-1.792,2.816c-0.911,2.066-0.911,4.419,0,6.485 c0.412,1.044,1.021,2,1.792,2.816c3.365,3.3,8.752,3.3,12.117,0c1.558-1.636,2.442-3.8,2.475-6.059 c0.025-1.119-0.209-2.229-0.683-3.243C50.103,149.324,49.497,148.371,48.744,147.541z" fill="#FFFFFF"/>
<path d="M48.744,241.365c-0.831-0.751-1.783-1.357-2.816-1.792c-2.078-0.854-4.408-0.854-6.485,0 c-1.044,0.412-2,1.021-2.816,1.792c-0.753,0.83-1.359,1.782-1.792,2.816c-0.911,2.066-0.911,4.419,0,6.485 c0.412,1.044,1.021,2,1.792,2.816c3.365,3.3,8.752,3.3,12.117,0c1.548-1.625,2.431-3.772,2.475-6.016 c0.025-1.119-0.209-2.229-0.683-3.243C50.107,243.175,49.501,242.208,48.744,241.365z" fill="#FFFFFF"/>
<path d="M48.744,326.741c-0.831-0.751-1.783-1.357-2.816-1.792c-2.078-0.854-4.408-0.854-6.485,0 c-1.044,0.412-2,1.021-2.816,1.792c-0.753,0.83-1.359,1.782-1.792,2.816c-0.911,2.066-0.911,4.42,0,6.485 c0.412,1.044,1.021,2,1.792,2.816c3.365,3.3,8.752,3.3,12.117,0c1.558-1.636,2.442-3.8,2.475-6.059 c0.025-1.119-0.209-2.229-0.683-3.243C50.103,328.524,49.497,327.571,48.744,326.741z" fill="#FFFFFF"/>
<path d="M68.285,76.8c0.916,0.001,1.827-0.146,2.697-0.435l51.2-17.067c4.477-1.489,6.899-6.326,5.41-10.803 c-1.489-4.477-6.326-6.899-10.803-5.41l-51.2,17.067c-4.002,1.301-6.459,5.325-5.786,9.48 C60.476,73.786,64.077,76.829,68.285,76.8z" fill="#FFFFFF"/>
<path d="M85.855,96.734c1.211,3.395,4.425,5.663,8.03,5.666c0.977-0.001,1.946-0.169,2.867-0.495l119.467-42.667 c4.439-1.583,6.755-6.466,5.171-10.906c-1.584-4.44-6.466-6.755-10.906-5.171L91.018,85.828 C86.581,87.415,84.27,92.297,85.855,96.734z" fill="#FFFFFF"/>
</g>
</g>
</g>
</svg>
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- Generator: Adobe Illustrator 18.1.1, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" id="Capa_1" x="0px" y="0px" viewBox="0 0 18.491 18.491" style="enable-background:new 0 0 18.491 18.491;" xml:space="preserve" width="512px" height="512px">
<g>
<g>
<path d="M11.204,3.951c0.015-0.075,0.027-0.15,0.027-0.229c0-0.773-0.737-1.4-1.647-1.4 c-0.909,0-1.646,0.627-1.646,1.4c0,0.079,0.013,0.154,0.028,0.229C6.819,4.277,5.817,4.944,5.068,5.829h9.034 C13.352,4.944,12.351,4.278,11.204,3.951z" fill="#FFFFFF"/>
<path d="M17.066,6.548c-0.844-0.42-1.846-0.283-2.699,0.266H4.784c-0.617,0.857-1.011,1.885-1.095,3 C3.585,9.546,3.537,9.21,3.562,8.786c0.07-1.178-0.236-2.092-0.911-2.719C1.615,5.105,0.161,5.265,0,5.287 c0,0,0.542,0.809,0.208,1.567c0,0,0.869-0.091,1.366,0.371c0.312,0.29,0.449,0.783,0.409,1.467 C1.912,9.887,2.22,10.803,2.9,11.414c0.322,0.29,0.683,0.466,1.03,0.573c0.74,2.421,2.991,4.182,5.653,4.182 c2.245,0,4.197-1.251,5.199-3.093c1.229,0.104,2.567-0.712,3.266-2.112C18.913,9.23,18.471,7.249,17.066,6.548z M16.633,10.259 c-0.288,0.578-0.771,0.978-1.242,1.102c0.067-0.358,0.106-0.727,0.106-1.104c0-0.709-0.13-1.386-0.36-2.015 c0.391-0.256,0.821-0.339,1.167-0.167C16.919,8.382,17.071,9.382,16.633,10.259z" fill="#FFFFFF"/>
</g>
</g>
</svg>
/*!
* jQuery Cookie Plugin v1.4.1
* https://github.com/carhartl/jquery-cookie
*
* Copyright 2006, 2014 Klaus Hartl
* Released under the MIT license
*/
(function (factory) {
if (typeof define === 'function' && define.amd) {
// AMD (Register as an anonymous module)
define(['jquery'], factory);
} else if (typeof exports === 'object') {
// Node/CommonJS
module.exports = factory(require('jquery'));
} else {
// Browser globals
factory(jQuery);
}
}(function ($) {
var pluses = /\+/g;
function encode(s) {
return config.raw ? s : encodeURIComponent(s);
}
function decode(s) {
return config.raw ? s : decodeURIComponent(s);
}
function stringifyCookieValue(value) {
return encode(config.json ? JSON.stringify(value) : String(value));
}
function parseCookieValue(s) {
if (s.indexOf('"') === 0) {
// This is a quoted cookie as according to RFC2068, unescape...
s = s.slice(1, -1).replace(/\\"/g, '"').replace(/\\\\/g, '\\');
}
try {
// Replace server-side written pluses with spaces.
// If we can't decode the cookie, ignore it, it's unusable.
// If we can't parse the cookie, ignore it, it's unusable.
s = decodeURIComponent(s.replace(pluses, ' '));
return config.json ? JSON.parse(s) : s;
} catch(e) {}
}
function read(s, converter) {
var value = config.raw ? s : parseCookieValue(s);
return $.isFunction(converter) ? converter(value) : value;
}
var config = $.cookie = function (key, value, options) {
// Write
if (arguments.length > 1 && !$.isFunction(value)) {
options = $.extend({}, config.defaults, options);
if (typeof options.expires === 'number') {
var days = options.expires, t = options.expires = new Date();
t.setMilliseconds(t.getMilliseconds() + days * 864e+5);
}
return (document.cookie = [
encode(key), '=', stringifyCookieValue(value),
options.expires ? '; expires=' + options.expires.toUTCString() : '', // use expires attribute, max-age is not supported by IE
options.path ? '; path=' + options.path : '',
options.domain ? '; domain=' + options.domain : '',
options.secure ? '; secure' : ''
].join(''));
}
// Read
var result = key ? undefined : {},
// To prevent the for loop in the first place assign an empty array
// in case there are no cookies at all. Also prevents odd result when
// calling $.cookie().
cookies = document.cookie ? document.cookie.split('; ') : [],
i = 0,
l = cookies.length;
for (; i < l; i++) {
var parts = cookies[i].split('='),
name = decode(parts.shift()),
cookie = parts.join('=');
if (key === name) {
// If second argument (value) is a function it's a converter...
result = read(cookie, value);
break;
}
// Prevent storing a cookie that we couldn't decode.
if (!key && (cookie = read(cookie)) !== undefined) {
result[name] = cookie;
}
}
return result;
};
config.defaults = {};
$.removeCookie = function (key, options) {
// Must not alter options, thus extending a fresh object...
$.cookie(key, '', $.extend({}, options, { expires: -1 }));
return !$.cookie(key);
};
}));
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment