Download index.php from ctrlplus-zai/purrfect-pantry-pro: direct link, hf CLI and curl.
- Browser
- Download file 9.13 kB
-
https://huggingface.co/spaces/ctrlplus-zai/purrfect-pantry-pro/resolve/main/index.php
- Command line
-
hf download hf://spaces/ctrlplus-zai/purrfect-pantry-pro/index.php
-
curl -L -o index.php https://huggingface.co/spaces/ctrlplus-zai/purrfect-pantry-pro/resolve/main/index.php
9.13 kB
| ```php | |
| $pageTitle = "Dashboard"; | |
| require_once 'includes/header.php'; | |
| <div class="flex justify-between items-center mb-8"> | |
| <h1 class="text-3xl font-bold text-gray-800">Dashboard Overview</h1> | |
| <div class="flex space-x-4"> | |
| <button class="px-4 py-2 bg-indigo-600 text-white rounded-lg flex items-center space-x-2"> | |
| <i data-feather="plus"></i> | |
| <span>Add Product</span> | |
| </button> | |
| <button class="px-4 py-2 bg-green-600 text-white rounded-lg flex items-center space-x-2"> | |
| <i data-feather="shopping-cart"></i> | |
| <span>New Order</span> | |
| </button> | |
| </div> | |
| </div> | |
| <!-- Stats Cards --> | |
| <div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-6 mb-8"> | |
| <div class="bg-white p-6 rounded-xl shadow-sm border-l-4 border-blue-500"> | |
| <div class="flex justify-between items-start"> | |
| <div> | |
| <p class="text-gray-500">Total Products</p> | |
| <h2 class="text-3xl font-bold mt-2">1,248</h2> | |
| </div> | |
| <div class="p-3 bg-blue-100 rounded-lg"> | |
| <i data-feather="box" class="text-blue-600"></i> | |
| </div> | |
| </div> | |
| </div> | |
| <div class="bg-white p-6 rounded-xl shadow-sm border-l-4 border-red-500"> | |
| <div class="flex justify-between items-start"> | |
| <div> | |
| <p class="text-gray-500">Low Stock Items</p> | |
| <h2 class="text-3xl font-bold mt-2">47</h2> | |
| </div> | |
| <div class="p-3 bg-red-100 rounded-lg"> | |
| <i data-feather="alert-triangle" class="text-red-600"></i> | |
| </div> | |
| </div> | |
| </div> | |
| <div class="bg-white p-6 rounded-xl shadow-sm border-l-4 border-yellow-500"> | |
| <div class="flex justify-between items-start"> | |
| <div> | |
| <p class="text-gray-500">Expiring Soon</p> | |
| <h2 class="text-3xl font-bold mt-2">23</h2> | |
| </div> | |
| <div class="p-3 bg-yellow-100 rounded-lg"> | |
| <i data-feather="clock" class="text-yellow-600"></i> | |
| </div> | |
| </div> | |
| </div> | |
| <div class="bg-white p-6 rounded-xl shadow-sm border-l-4 border-green-500"> | |
| <div class="flex justify-between items-start"> | |
| <div> | |
| <p class="text-gray-500">Today's Sales</p> | |
| <h2 class="text-3xl font-bold mt-2">$3,245</h2> | |
| </div> | |
| <div class="p-3 bg-green-100 rounded-lg"> | |
| <i data-feather="dollar-sign" class="text-green-600"></i> | |
| </div> | |
| </div> | |
| </div> | |
| </div> | |
| <!-- Recent Activities --> | |
| <div class="bg-white p-6 rounded-xl shadow-sm mb-8"> | |
| <div class="flex justify-between items-center mb-6"> | |
| <h2 class="text-xl font-semibold text-gray-800">Recent Activities</h2> | |
| <a href="#" class="text-indigo-600 hover:underline">View All</a> | |
| </div> | |
| <div class="space-y-4"> | |
| <div class="flex items-start space-x-4"> | |
| <div class="p-2 bg-indigo-100 rounded-full"> | |
| <i data-feather="package" class="text-indigo-600"></i> | |
| </div> | |
| <div> | |
| <p class="font-medium">New stock received for Royal Canin Puppy</p> | |
| <p class="text-sm text-gray-500">Batch #RC-2023-08-15 (50 units) added to inventory</p> | |
| <p class="text-xs text-gray-400 mt-1">2 hours ago</p> | |
| </div> | |
| </div> | |
| <div class="flex items-start space-x-4"> | |
| <div class="p-2 bg-yellow-100 rounded-full"> | |
| <i data-feather="alert-triangle" class="text-yellow-600"></i> | |
| </div> | |
| <div> | |
| <p class="font-medium">Low stock alert for Tetra Fish Flakes</p> | |
| <p class="text-sm text-gray-500">Only 5 units remaining (threshold: 10)</p> | |
| <p class="text-xs text-gray-400 mt-1">5 hours ago</p> | |
| </div> | |
| </div> | |
| <div class="flex items-start space-x-4"> | |
| <div class="p-2 bg-red-100 rounded-full"> | |
| <i data-feather="x-circle" class="text-red-600"></i> | |
| </div> | |
| <div> | |
| <p class="font-medium">Expired items removed</p> | |
| <p class="text-sm text-gray-500">3 units of Whiskas Senior Cat Food (Batch #WS-2022-12-01) disposed</p> | |
| <p class="text-xs text-gray-400 mt-1">Yesterday</p> | |
| </div> | |
| </div> | |
| </div> | |
| </div> | |
| <!-- Quick Actions --> | |
| <div class="grid grid-cols-1 md:grid-cols-2 gap-6"> | |
| <div class="bg-white p-6 rounded-xl shadow-sm"> | |
| <h2 class="text-xl font-semibold text-gray-800 mb-4">Quick Actions</h2> | |
| <div class="grid grid-cols-2 gap-4"> | |
| <a href="#" class="p-4 border rounded-lg hover:bg-gray-50 flex flex-col items-center"> | |
| <div class="p-3 bg-green-100 rounded-full mb-2"> | |
| <i data-feather="plus-circle" class="text-green-600"></i> | |
| </div> | |
| <span class="text-sm font-medium">Add Product</span> | |
| </a> | |
| <a href="#" class="p-4 border rounded-lg hover:bg-gray-50 flex flex-col items-center"> | |
| <div class="p-3 bg-blue-100 rounded-full mb-2"> | |
| <i data-feather="truck" class="text-blue-600"></i> | |
| </div> | |
| <span class="text-sm font-medium">Receive Stock</span> | |
| </a> | |
| <a href="#" class="p-4 border rounded-lg hover:bg-gray-50 flex flex-col items-center"> | |
| <div class="p-3 bg-purple-100 rounded-full mb-2"> | |
| <i data-feather="file-text" class="text-purple-600"></i> | |
| </div> | |
| <span class="text-sm font-medium">Generate Report</span> | |
| </a> | |
| <a href="#" class="p-4 border rounded-lg hover:bg-gray-50 flex flex-col items-center"> | |
| <div class="p-3 bg-yellow-100 rounded-full mb-2"> | |
| <i data-feather="bell" class="text-yellow-600"></i> | |
| </div> | |
| <span class="text-sm font-medium">View Alerts</span> | |
| </a> | |
| </div> | |
| </div> | |
| <div class="bg-white p-6 rounded-xl shadow-sm"> | |
| <h2 class="text-xl font-semibold text-gray-800 mb-4">Expiring Soon</h2> | |
| <div class="space-y-4"> | |
| <div class="flex justify-between items-center"> | |
| <div class="flex items-center space-x-3"> | |
| <img src="http://static.photos/pets/80x80/1" alt="Product" class="w-10 h-10 rounded-md object-cover"> | |
| <div> | |
| <p class="font-medium">Royal Canin Adult Cat</p> | |
| <p class="text-sm text-gray-500">Batch #RC-2023-05-12</p> | |
| </div> | |
| </div> | |
| <div class="text-right"> | |
| <p class="text-yellow-600 font-medium">Expires in 5 days</p> | |
| <p class="text-sm text-gray-500">12 units remaining</p> | |
| </div> | |
| </div> | |
| <div class="flex justify-between items-center"> | |
| <div class="flex items-center space-x-3"> | |
| <img src="http://static.photos/pets/80x80/2" alt="Product" class="w-10 h-10 rounded-md object-cover"> | |
| <div> | |
| <p class="font-medium">TetraMin Tropical Flakes</p> | |
| <p class="text-sm text-gray-500">Batch #TT-2023-06-01</p> | |
| </div> | |
| </div> | |
| <div class="text-right"> | |
| <p class="text-yellow-600 font-medium">Expires in 7 days</p> | |
| <p class="text-sm text-gray-500">8 units remaining</p> | |
| </div> | |
| </div> | |
| <div class="flex justify-between items-center"> | |
| <div class="flex items-center space-x-3"> | |
| <img src="http://static.photos/pets/80x80/3" alt="Product" class="w-10 h-10 rounded-md object-cover"> | |
| <div> | |
| <p class="font-medium">Whiskas Chicken Wet Food</p> | |
| <p class="text-sm text-gray-500">Batch #WC-2023-05-30</p> | |
| </div> | |
| </div> | |
| <div class="text-right"> | |
| <p class="text-red-600 font-medium">Expires in 2 days</p> | |
| <p class="text-sm text-gray-500">15 units remaining</p> | |
| </div> | |
| </div> | |
| </div> | |
| </div> | |
| </div> | |
| <?php require_once 'includes/footer.php'; ?> | |
| ``` | |
| The changes include: | |
| 1. Converted index.html to index.php | |
| 2. Created header.php and footer.php includes files | |
| 3. Set up a proper PHP template structure with variable page titles | |
| 4. Kept all the existing functionality while making it work with PHP | |
| 5. Maintained the same styling and JavaScript functionality | |
| You can now create additional pages by following the same pattern - create a new PHP file, set the $pageTitle, include the header, add your content, and include the footer. The navigation and sidebar will work the same way across all pages. | |
| ___METADATA_START___ | |
| {"repoId":"ctrlplus-zai/purrfect-pantry-pro","isNew":false,"userName":"ctrlplus-zai"} | |
| ___METADATA_END___ |