From 2f4747240425d2b7e54471f070db1b52b3794662 Mon Sep 17 00:00:00 2001 From: Christopher Zenzel Date: Sat, 17 Feb 2024 14:37:29 -0500 Subject: [PATCH] Work on the AJAX calls for Project 4 --- project1/src/Bootstrap/Theme.php | 2 +- project2/src/Bootstrap/Theme.php | 3 ++- project3/css/styles.css | 5 +++++ project3/index.php | 4 ++++ project3/js/forms.php | 3 +++ project3/src/Bootstrap/Theme.php | 2 +- project4/src/Bootstrap/Theme.php | 3 ++- 7 files changed, 18 insertions(+), 4 deletions(-) diff --git a/project1/src/Bootstrap/Theme.php b/project1/src/Bootstrap/Theme.php index 96d0870..23b9f89 100644 --- a/project1/src/Bootstrap/Theme.php +++ b/project1/src/Bootstrap/Theme.php @@ -14,7 +14,7 @@ public function header() - Project 1 + Project EOL; diff --git a/project2/src/Bootstrap/Theme.php b/project2/src/Bootstrap/Theme.php index 96d0870..6aa0280 100644 --- a/project2/src/Bootstrap/Theme.php +++ b/project2/src/Bootstrap/Theme.php @@ -14,7 +14,7 @@ public function header() - Project 1 + Project EOL; @@ -25,6 +25,7 @@ public function header() public function scripts_body() { $scripts = << EOL; diff --git a/project3/css/styles.css b/project3/css/styles.css index 042767c..310296a 100644 --- a/project3/css/styles.css +++ b/project3/css/styles.css @@ -2,3 +2,8 @@ main { margin-top: 25px; } + +.alert-api +{ + display: none; +} \ No newline at end of file diff --git a/project3/index.php b/project3/index.php index 323bd24..5d3b891 100644 --- a/project3/index.php +++ b/project3/index.php @@ -19,6 +19,10 @@
+
render(); diff --git a/project3/js/forms.php b/project3/js/forms.php index c28c268..a19dc08 100644 --- a/project3/js/forms.php +++ b/project3/js/forms.php @@ -24,7 +24,10 @@ function load_ajax_submission() { url: "/ajax.php", data: formData }).done(function (data) { + $('.alert-api').hide(); $('#vehicles').html(data); + }).fail(function (jqXHR, textStatus, errorThrown) { + $('.alert-api').show(); }); event.preventDefault(); diff --git a/project3/src/Bootstrap/Theme.php b/project3/src/Bootstrap/Theme.php index ea3a312..6aa0280 100644 --- a/project3/src/Bootstrap/Theme.php +++ b/project3/src/Bootstrap/Theme.php @@ -14,7 +14,7 @@ public function header() - Project 1 + Project EOL; diff --git a/project4/src/Bootstrap/Theme.php b/project4/src/Bootstrap/Theme.php index 96d0870..6aa0280 100644 --- a/project4/src/Bootstrap/Theme.php +++ b/project4/src/Bootstrap/Theme.php @@ -14,7 +14,7 @@ public function header() - Project 1 + Project EOL; @@ -25,6 +25,7 @@ public function header() public function scripts_body() { $scripts = << EOL;