diff --git a/assets/css/custom.css b/assets/css/custom.css new file mode 100644 index 0000000..fadbc57 --- /dev/null +++ b/assets/css/custom.css @@ -0,0 +1,109 @@ +/* assets/css/custom.css */ +:root { + --primary-color: #4F46E5; + --secondary-color: #10B981; + --danger-color: #EF4444; + --warning-color: #F59E0B; + --background-color: #F3F4F6; + --surface-color: #FFFFFF; + --text-color: #111827; + --light-text-color: #6B7280; + --border-radius: 0.5rem; +} + +body { + background-color: var(--background-color); + font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; + color: var(--text-color); +} + +h1, h2, h3, h4, h5, h6 { + font-family: 'Georgia', serif; + font-weight: 700; +} + +.navbar { + background-color: var(--surface-color); + box-shadow: 0 2px 4px rgba(0,0,0,0.05); +} + +.navbar-brand { + font-family: 'Georgia', serif; + font-weight: bold; + color: var(--primary-color) !important; +} + +.card { + border: none; + border-radius: var(--border-radius); + box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1); +} + +.btn-primary { + background-color: var(--primary-color); + border-color: var(--primary-color); + border-radius: var(--border-radius); + padding: 0.75rem 1.5rem; + font-weight: 600; + transition: background-color 0.2s ease-in-out; +} + +.btn-primary:hover { + background-color: #4338CA; + border-color: #4338CA; +} + +.badge-status { + padding: 0.4em 0.8em; + font-size: 0.8rem; + font-weight: 600; + border-radius: 20px; +} + +.badge-approved { + color: #065F46; + background-color: #D1FAE5; +} + +.badge-rejected { + color: #991B1B; + background-color: #FEE2E2; +} + +.badge-pending { + color: #92400E; + background-color: #FEF3C7; +} + +.table { + background-color: var(--surface-color); +} + +.table thead th { + border-bottom: 2px solid #E5E7EB; + font-family: 'Inter', sans-serif; + font-weight: 600; + color: var(--light-text-color); +} + +.table tbody tr:hover { + background-color: #F9FAFB; +} + +.hero { + background: linear-gradient(45deg, #4F46E5, #818CF8); + color: white; + padding: 6rem 0; + text-align: center; +} + +.hero h1 { + font-size: 3.5rem; + font-family: 'Georgia', serif; +} + +.hero p { + font-size: 1.25rem; + max-width: 600px; + margin: 1rem auto; +} \ No newline at end of file diff --git a/dashboard.php b/dashboard.php new file mode 100644 index 0000000..73424cd --- /dev/null +++ b/dashboard.php @@ -0,0 +1,141 @@ +exec($migrationSql); + } + + // 2. Seed data if table is empty + $stmt = $pdo->query("SELECT COUNT(*) FROM expense_reports"); + $count = $stmt->fetchColumn(); + + if ($count == 0) { + $seedData = [ + ['agent_name' => 'John Doe', 'amount' => 150.75, 'description' => 'Client Dinner', 'status' => 'Approved'], + ['agent_name' => 'Jane Smith', 'amount' => 89.99, 'description' => 'Office Supplies', 'status' => 'Pending'], + ['agent_name' => 'Peter Jones', 'amount' => 1200.00, 'description' => 'Flight to Conference', 'status' => 'Pending'], + ['agent_name' => 'John Doe', 'amount' => 45.50, 'description' => 'Taxi Fare', 'status' => 'Rejected'], + ['agent_name' => 'Susan Williams', 'amount' => 320.00, 'description' => 'Hotel Stay', 'status' => 'Approved'], + ]; + + $insertSql = "INSERT INTO expense_reports (agent_name, amount, description, status) VALUES (?, ?, ?, ?)"; + $stmt = $pdo->prepare($insertSql); + + foreach ($seedData as $row) { + $stmt->execute([$row['agent_name'], $row['amount'], $row['description'], $row['status']]); + } + } + + // 3. Fetch all reports + $reports = $pdo->query("SELECT * FROM expense_reports ORDER BY created_at DESC")->fetchAll(PDO::FETCH_ASSOC); + +} catch (PDOException $e) { + // In a real app, log this error. For now, we'll just show a message. + die("Database error: " . $e->getMessage()); +} + +function getStatusBadgeClass($status) { + switch ($status) { + case 'Approved': return 'badge-approved'; + case 'Rejected': return 'badge-rejected'; + case 'Pending': + default: + return 'badge-pending'; + } +} +?> + + + + + + Manager Dashboard - ExpenseTracker + + + + + + + + + + + + + + +
+
+

Expense Reports

+ Submit New Expense +
+ +
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Agent NameAmountDateStatusDescriptionActions
No expense reports submitted yet.
$ + + + + + View +
+
+
+
+
+ + + + + + \ No newline at end of file diff --git a/db/migrations/001_create_expense_reports_table.sql b/db/migrations/001_create_expense_reports_table.sql new file mode 100644 index 0000000..ac21d9f --- /dev/null +++ b/db/migrations/001_create_expense_reports_table.sql @@ -0,0 +1,8 @@ +CREATE TABLE IF NOT EXISTS expense_reports ( + id INT AUTO_INCREMENT PRIMARY KEY, + agent_name VARCHAR(255) NOT NULL, + amount DECIMAL(10, 2) NOT NULL, + description TEXT, + status ENUM('Pending', 'Approved', 'Rejected') NOT NULL DEFAULT 'Pending', + created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP +); \ No newline at end of file diff --git a/index.php b/index.php index 7205f3d..bcdc039 100644 --- a/index.php +++ b/index.php @@ -1,150 +1,65 @@ - - + - - - New Style - - - - - - - - - - - - - - - - - - - + + + ExpenseTracker - Welcome + + + + + + + + + + + + + -
-
-

Analyzing your requirements and generating your website…

-
- Loading… -
-

AI is collecting your requirements and applying the first changes.

-

This page will update automatically as the plan is implemented.

-

Runtime: PHP — UTC

-
-
- + + + +
+
+
+

Effortless Expense Reporting

+

Simplify how your team tracks and manages expenses. Get a clear overview, approve reports on the fly, and keep your budget in check.

+ View Manager Dashboard +
+
+ +
+
+
+ An agent submitting an expense report on a mobile device. +

Submit with Ease

+

Agents can quickly submit expenses from anywhere, on any device.

+
+
+ A manager reviewing an expense dashboard on a tablet. +

Manage with Clarity

+

Managers get a real-time dashboard to review and approve reports.

+
+
+ Charts and graphs showing expense analytics. +

Gain Instant Insights

+

Track spending patterns and make informed budget decisions.

+
+
+
+
+ + + + - + \ No newline at end of file