A simple PHP function to generate estimated delivery date ranges for e-commerce applications, with support for business days calculation.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <!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; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <!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; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <!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> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| ini_set('display_errors', 1); | |
| ini_set('display_startup_errors', 1); | |
| error_reporting(E_ALL); | |
| $host = 'localhost'; | |
| $username = 'lizard'; | |
| $password = "adidas88"; | |
| $dbname = 'gallery_database'; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| $host = "localhost"; | |
| $username = "adistatescu" | |
| $password = "Adidas88statescu"; | |
| $database_name = "gallery_database"; | |
| try { | |
| $mysqli = new mysqli($host, $username, $password); | |