diff --git a/.gitignore b/.gitignore index e427ff3..8d318dd 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ -node_modules/ -*/node_modules/ -*/build/ +.idea +.vscode +.DS_Store +db/migrations \ No newline at end of file diff --git a/add_entry.php b/add_entry.php new file mode 100644 index 0000000..a562605 --- /dev/null +++ b/add_entry.php @@ -0,0 +1,48 @@ + false, 'message' => 'An error occurred.']; + +if ($_SERVER['REQUEST_METHOD'] === 'POST') { + $type = $_POST['type'] ?? ''; + $title = $_POST['title'] ?? ''; + + if (empty($title)) { + $response['message'] = 'Title is required.'; + echo json_encode($response); + exit; + } + + try { + $pdo = db(); + if ($type === 'meeting') { + $stmt = $pdo->prepare("INSERT INTO meetings (title, description, purpose, date, attendees, summary) VALUES (?, ?, ?, ?, ?, ?)"); + $stmt->execute([ + $title, + $_POST['description'] ?? '', + $_POST['purpose'] ?? '', + $_POST['date'] ?? null, + $_POST['attendees'] ?? '', + $_POST['summary'] ?? '' + ]); + $response['entry'] = ['id' => $pdo->lastInsertId(), 'title' => $title, 'description' => $_POST['description'] ?? '']; + } elseif ($type === 'event') { + $stmt = $pdo->prepare("INSERT INTO events (title, description, date, purpose, notes) VALUES (?, ?, ?, ?, ?)"); + $stmt->execute([ + $title, + $_POST['description'] ?? '', + $_POST['date'] ?? null, + $_POST['purpose'] ?? '', + $_POST['notes'] ?? '' + ]); + $response['entry'] = ['id' => $pdo->lastInsertId(), 'title' => $title, 'description' => $_POST['description'] ?? '']; + } + $response['success'] = true; + $response['message'] = ucfirst($type) . ' added successfully.'; + } catch (PDOException $e) { + $response['message'] = 'Database error: ' . $e->getMessage(); + } +} + +header('Content-Type: application/json'); +echo json_encode($response); diff --git a/assets/css/custom.css b/assets/css/custom.css new file mode 100644 index 0000000..b2e52c5 --- /dev/null +++ b/assets/css/custom.css @@ -0,0 +1,12 @@ +body { + background-color: #f8f9fa; +} + +.navbar { + box-shadow: 0 2px 4px rgba(0,0,0,.1); +} + +.card { + border-radius: 0.25rem; + box-shadow: 0 2px 4px rgba(0,0,0,.1); +} diff --git a/assets/js/main.js b/assets/js/main.js new file mode 100644 index 0000000..9d4a960 --- /dev/null +++ b/assets/js/main.js @@ -0,0 +1,58 @@ +document.addEventListener('DOMContentLoaded', function () { + const addMeetingModal = new bootstrap.Modal(document.getElementById('addMeetingModal')); + const addEventModal = new bootstrap.Modal(document.getElementById('addEventModal')); + + const addMeetingForm = document.getElementById('addMeetingForm'); + addMeetingForm.addEventListener('submit', function (e) { + e.preventDefault(); + const formData = new FormData(addMeetingForm); + formData.append('type', 'meeting'); + + fetch('add_entry.php', { + method: 'POST', + body: formData + }) + .then(response => response.json()) + .then(data => { + if (data.success) { + addMeetingModal.hide(); + // Add to list dynamically + const meetingsList = document.getElementById('meetings-list'); + const newMeeting = document.createElement('div'); + newMeeting.classList.add('list-group-item'); + newMeeting.innerHTML = `
${data.entry.title}

${data.entry.description}

`; + meetingsList.appendChild(newMeeting); + addMeetingForm.reset(); + } else { + alert(data.message); + } + }); + }); + + const addEventForm = document.getElementById('addEventForm'); + addEventForm.addEventListener('submit', function (e) { + e.preventDefault(); + const formData = new FormData(addEventForm); + formData.append('type', 'event'); + + fetch('add_entry.php', { + method: 'POST', + body: formData + }) + .then(response => response.json()) + .then(data => { + if (data.success) { + addEventModal.hide(); + // Add to list dynamically + const eventsList = document.getElementById('events-list'); + const newEvent = document.createElement('div'); + newEvent.classList.add('list-group-item'); + newEvent.innerHTML = `
${data.entry.title}

${data.entry.description}

`; + eventsList.appendChild(newEvent); + addEventForm.reset(); + } else { + alert(data.message); + } + }); + }); +}); diff --git a/footer.php b/footer.php new file mode 100644 index 0000000..8ba24cc --- /dev/null +++ b/footer.php @@ -0,0 +1,8 @@ + + + + + + \ No newline at end of file diff --git a/header.php b/header.php new file mode 100644 index 0000000..3b68c3f --- /dev/null +++ b/header.php @@ -0,0 +1,37 @@ + + + + + + AEC Business Dev Management + + + + + + + + + + + + + +
\ No newline at end of file diff --git a/index.php b/index.php index 7205f3d..c953c2a 100644 --- a/index.php +++ b/index.php @@ -1,150 +1,114 @@ - -$phpVersion = PHP_VERSION; -$now = date('Y-m-d H:i:s'); -?> - - - - - - New Style - - - - - - - - - - - - - - - - - - - - - -
-
-

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

+
+
+
+
+

Meetings

+ +
+
+
+ +
+
+
-
- - - +
+
+
+

Events

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