diff --git a/admin/assets/css/style.css b/admin/assets/css/style.css new file mode 100644 index 0000000..c3fc692 --- /dev/null +++ b/admin/assets/css/style.css @@ -0,0 +1,70 @@ + +:root { + --primary-color: #4F46E5; + --secondary-color: #6B7280; + --bg-light: #F9FAFB; + --surface-color: #FFFFFF; + --border-color: #E5E7EB; +} + +body { + font-family: 'Inter', sans-serif; + background-color: var(--bg-light); +} + +#wrapper { + display: flex; + min-height: 100vh; +} + +#sidebar-wrapper { + min-width: 250px; + max-width: 250px; + background-color: var(--surface-color) !important; + border-right: 1px solid var(--border-color) !important; + transition: margin .25s ease-out; +} + +#wrapper.toggled #sidebar-wrapper { + margin-left: -250px; +} + +#page-content-wrapper { + flex: 1; + min-width: 0; + padding: 1.5rem; +} + +.sidebar-heading { + padding: 1rem 1.25rem; + font-size: 1.2rem; + font-weight: 600; + color: var(--primary-color); +} + +.list-group-item { + border: 0 !important; + color: var(--secondary-color); + font-weight: 500; +} + +.list-group-item.active { + background-color: #EEF2FF !important; + color: var(--primary-color) !important; + border-right: 3px solid var(--primary-color) !important; +} + +.list-group-item-action:hover, .list-group-item-action:focus { + color: var(--primary-color); + background-color: #EEF2FF !important; +} + +.card { + border-radius: 0.75rem; + border: 1px solid var(--border-color); + box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.05), 0 1px 2px 0 rgba(0, 0, 0, 0.06); +} + +.card-title { + font-weight: 600; +} diff --git a/admin/assets/js/main.js b/admin/assets/js/main.js new file mode 100644 index 0000000..2d05005 --- /dev/null +++ b/admin/assets/js/main.js @@ -0,0 +1,11 @@ +document.addEventListener("DOMContentLoaded", function() { + const menuToggle = document.getElementById('menu-toggle'); + const wrapper = document.getElementById('wrapper'); + + if (menuToggle) { + menuToggle.addEventListener('click', function (e) { + e.preventDefault(); + wrapper.classList.toggle('toggled'); + }); + } +}); diff --git a/admin/companies.php b/admin/companies.php new file mode 100644 index 0000000..88b3438 --- /dev/null +++ b/admin/companies.php @@ -0,0 +1,88 @@ +prepare("DELETE FROM companies WHERE id = :id"); + $stmt->execute(['id' => $id]); + $_SESSION['success_message'] = 'Company deleted successfully!'; + } catch (PDOException $e) { + $_SESSION['error_message'] = 'Error deleting company: ' . $e->getMessage(); + } + header('Location: companies.php'); + exit(); +} + +// Fetch all companies +$companies = []; +try { + $stmt = $pdo->query("SELECT * FROM companies ORDER BY name"); + $companies = $stmt->fetchAll(); +} catch (PDOException $e) { + $_SESSION['error_message'] = 'Error fetching companies: ' . $e->getMessage(); +} + +$title = 'Companies'; +include __DIR__ . '/../templates/_header.php'; +?> + +
| ID | +Name | +Phone | +Address | +Actions | +|
|---|---|---|---|---|---|
| + | + | + | + | + | + Edit + Delete + | +
| No companies found. | +|||||
Log data will be displayed here.
+[Log Entry Placeholder]
+A calendar widget will be here.
+| ID | +Name | +Company | +Status | +Start Date | +End Date | +Actions | +
|---|---|---|---|---|---|---|
| + | + | + | + | + | + | + Edit + Delete + | +
| No projects found. | +||||||