Skip to content

Instantly share code, notes, and snippets.

<?php
function checkTaskDeadline($task) {
$currentDate = new DateTime();
$taskDate = DateTime::createFromFormat('Y-m-d', $task['date']);
$dateFormatted = $taskDate->format('d-m-Y');
if ($taskDate < $currentDate) {
$daysPassed = $currentDate->diff($taskDate)->format('%a');
$daysLimits = ['1' => 1, '2' => 3, '3' => 7];
@cladjidane
cladjidane / Index.php
Created November 14, 2023 10:45
Todolist - functions
<?php
ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
session_start();
include('functions.php');
$notice = controllerTask();
$tasks = $_SESSION['tasks'];
@cladjidane
cladjidane / index.php
Created November 13, 2023 10:11
Todo List PHP - chapitre 4 - fin
<?php
ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
session_start();
$notice = '';
$_SESSION['tasks'] = $_SESSION['tasks'] ?? [];
if ($_SERVER['REQUEST_METHOD'] === 'POST' && $_POST['mode'] === 'add') {
$taskName = !empty($_POST['field-task']) ? $_POST['field-task'] : ($_POST['select-task'] ?? '');
-- phpMyAdmin SQL Dump
-- version 5.1.0
-- https://www.phpmyadmin.net/
--
-- Host: localhost:8889
-- Generation Time: Jun 06, 2023 at 09:18 AM
-- Server version: 5.7.34
-- PHP Version: 8.0.8
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
<h1>Todo List</h1>
<h2>Gestionnaire de tâches</h2>
<form>
<label for="item">Ajouter une tâche</label>
<div class="fields">
<input type="text" id="item" placeholder="Intitulé de la tâche" />
</div>
<button type="submit">Ajouter</button>
body {
min-height: 100vh;
font-family: Arial, Helvetica, sans-serif;
background: radial-gradient(rgb(233, 233, 233), rgb(187, 187, 187));
}
/*
Organisation
1-Positionnement
2-Dimensions
3-Texte
4-Bordures et fonds
5-Propriétés CSS3 ou spécifiques navigateurs
*/
h1 {
<?php
/**
* \\Author: Thibault Napoléon "Imothep"
* \\Company: ISEN Yncréa Ouest
* \\Email: thibault.napoleon@isen-ouest.yncrea.fr
* \\Created Date: 05-Apr-2023 - 12:25:38
* \\Last Modified: 13-Apr-2023 - 10:36:33
*/
//----------------------------------------------------------------------------
<?php
/**
* \\Author: Thibault Napoléon "Imothep"
* \\Company: ISEN Yncréa Ouest
* \\Email: thibault.napoleon@isen-ouest.yncrea.fr
* \\Created Date: 05-Apr-2023 - 12:25:38
* \\Last Modified: 13-Apr-2023 - 10:26:05
*/
define('CHARACTERS', array('*', '#', 'o', 'x'));
@cladjidane
cladjidane / WampHTTPS.md
Created March 24, 2023 11:10 — forked from danieldogeanu/WampHTTPS.md
How to enable HTTPS for WAMP Server.

After you've downloaded and installed WAMP Server, follow these steps:

  1. Generate SSL certificate using OpenSSL:
  • Add C:\wamp64\bin\apache\apache2.4.27\bin directory to the PATH so you can access openssl command from the command prompt (WAMP comes with its own version of OpenSSL already integrated, so you don't need to install it. You'll find it in this directory.).

    IMPORTANT: Please note that the path of your installation depends on your version of Apache! DO NOT copy and paste the paths presented in this gist as they will not match with yours!

  • Navigate to your user directory (C:\Users\%YOUR_USERNAME%\), create a new folder (.openssl), navigate to it with Powershell and run these commands:

    openssl genrsa -aes256 -out private.key 2048
    

openssl rsa -in private.key -out private.key