Skip to content

Instantly share code, notes, and snippets.

View thinkphp's full-sized avatar
💭
If I have seen further it is only by standing on the shoulders of giants. Newton

Adrian Statescu thinkphp

💭
If I have seen further it is only by standing on the shoulders of giants. Newton
View GitHub Profile
@thinkphp
thinkphp / estDelivery.md
Last active August 26, 2025 17:08
Est Delivery

Python3/PHP Delivery Interval Generator

A simple PHP function to generate estimated delivery date ranges for e-commerce applications, with support for business days calculation.

Samples

Function Overview

@thinkphp
thinkphp / EstimateDelivery.php
Last active August 27, 2025 18:28
Est Delivery
<?php
function generateDeliveryInterval($minDays = 7, $maxDays = 7, $skipWeekends = true) {
$start = new DateTime();
// Calculate minimum delivery date (starting tomorrow)
$minDate = clone $start;
$minDate->add(new DateInterval('P1W')); // Start from tomorrow P1Y , P2M PT5H
// Calculate maximum delivery date
@thinkphp
thinkphp / todolist.txt
Last active November 19, 2025 20:41
TODO TASKs Rogerspaintings.co.uk
STAGE 2
---------
1. Searching by TITLE, PRICE or SIZE (in header se creeaza un textfield, in responsive se mareste inaltimea header-ului)
------------------------------------------
2. Sign up pentru un nou cont de admin fara drepturi de stergere (utilizator)
- recuperare parola
3. delete photo index_highlight.html (validat)
4. step 1 (Upload paintings) -->step 2 (galeria cu picturi IMG/index_highlight.html) -->step3 (add paintings / se completeaza filename automat)
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Add to Gallery</title>
<style>
* {
margin: 0;
padding: 0;
// Remove the hardcoded galleryData array and replace with an empty array
let galleryData = [];
// Cart array remains the same
let cart = [];
const notification = document.getElementById("notification");
const galleryContainer = document.getElementById("gallery-grid");
// Function to load gallery data from backend
<!DOCTYPE html>
<html lang="ro">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Admin Dashboard</title>
<style>
* {
margin: 0;
// Remove the hardcoded galleryData array and replace with an empty array
let galleryData = [];
// Cart array remains the same
let cart = [];
const notification = document.getElementById("notification");
const galleryContainer = document.getElementById("gallery-grid");
// Function to load gallery data from backend
@thinkphp
thinkphp / gist:aabb394fc1ae1268b363e8d8a1370ea7
Last active August 15, 2025 20:19
render-art-gallery.html
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Render Art Gallery</title>
</head>
<body>
<h1>Roger's Art Gallery</h1>
@thinkphp
thinkphp / get_gallery.php
Last active August 15, 2025 19:49
get_gallery.php
<?php
$host = "localhost";
$username = "adistatescu"
$password = "Adidas88statescu";
$database_name = "gallery_database";
try {
$mysqli = new mysqli($host, $username, $password);