From b1aa8d3a9100597d5c1c2b3655d2acb43df07399 Mon Sep 17 00:00:00 2001
From: johnnyq
Date: Fri, 18 Aug 2023 19:34:20 -0400
Subject: [PATCH] Feature Budget working need to add some more features down
the line
---
budget.php | 149 ++++++++++++++++++++++++++++++++++++++++
budget_create_modal.php | 108 +++++++++++++++++++++++++++++
budget_edit_modal.php | 102 +++++++++++++++++++++++++++
database_updates.php | 13 +++-
database_version.php | 2 +-
db.sql | 6 +-
post.php | 2 +-
post/budget.php | 61 ++++++++++++++++
side_nav.php | 7 +-
9 files changed, 441 insertions(+), 9 deletions(-)
create mode 100644 budget.php
create mode 100644 budget_create_modal.php
create mode 100644 budget_edit_modal.php
create mode 100644 post/budget.php
diff --git a/budget.php b/budget.php
new file mode 100644
index 00000000..dd13bc04
--- /dev/null
+++ b/budget.php
@@ -0,0 +1,149 @@
+
+
+
+
+
+
+
diff --git a/budget_edit_modal.php b/budget_edit_modal.php
new file mode 100644
index 00000000..70b2a348
--- /dev/null
+++ b/budget_edit_modal.php
@@ -0,0 +1,102 @@
+
+
+
+
+
+
+
+
diff --git a/database_updates.php b/database_updates.php
index 56c14d7c..b9ddd04e 100644
--- a/database_updates.php
+++ b/database_updates.php
@@ -1253,11 +1253,18 @@ if (LATEST_DATABASE_VERSION > CURRENT_DATABASE_VERSION) {
mysqli_query($mysqli, "UPDATE `settings` SET `config_current_database_version` = '0.7.2'");
}
- //if (CURRENT_DATABASE_VERSION == '0.7.2') {
- //Insert queries here required to update to DB version 0.7.3
+ if (CURRENT_DATABASE_VERSION == '0.7.2') {
+ mysqli_query($mysqli, "ALTER TABLE `budget` CHANGE `budget_year` `budget_year` INT NOT NULL");
+ mysqli_query($mysqli, "ALTER TABLE `budget` CHANGE `budget_amount` `budget_amount` DECIMAL(15,2) DEFAULT 0.00");
+ // Then, update the database to the next sequential version
+ mysqli_query($mysqli, "UPDATE `settings` SET `config_current_database_version` = '0.7.3'");
+ }
+
+ //if (CURRENT_DATABASE_VERSION == '0.7.3') {
+ //Insert queries here required to update to DB version 0.7.4
// Then, update the database to the next sequential version
- //mysqli_query($mysqli, "UPDATE `settings` SET `config_current_database_version` = '0.7.3'");
+ //mysqli_query($mysqli, "UPDATE `settings` SET `config_current_database_version` = '0.7.4'");
//}
} else {
diff --git a/database_version.php b/database_version.php
index 18f3e69b..073e080c 100644
--- a/database_version.php
+++ b/database_version.php
@@ -5,4 +5,4 @@
* It is used in conjunction with database_updates.php
*/
-DEFINE("LATEST_DATABASE_VERSION", "0.7.2");
+DEFINE("LATEST_DATABASE_VERSION", "0.7.3");
diff --git a/db.sql b/db.sql
index bfb6b3d8..c15a8236 100644
--- a/db.sql
+++ b/db.sql
@@ -158,8 +158,8 @@ DROP TABLE IF EXISTS `budget`;
CREATE TABLE `budget` (
`budget_id` int(11) NOT NULL AUTO_INCREMENT,
`budget_month` tinyint(4) NOT NULL,
- `budget_year` tinyint(4) NOT NULL,
- `budget_amount` decimal(15,2) NOT NULL,
+ `budget_year` int(11) NOT NULL,
+ `budget_amount` decimal(15,2) NOT NULL DEFAULT 0.00,
`budget_description` varchar(255) DEFAULT NULL,
`budget_created_at` datetime NOT NULL DEFAULT current_timestamp(),
`budget_updated_at` datetime DEFAULT NULL ON UPDATE current_timestamp(),
@@ -1691,4 +1691,4 @@ CREATE TABLE `vendors` (
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
--- Dump completed on 2023-08-18 18:20:52
+-- Dump completed on 2023-08-18 19:33:44
diff --git a/post.php b/post.php
index 1e0f709a..8b524709 100644
--- a/post.php
+++ b/post.php
@@ -40,7 +40,7 @@ require_once("post/transfer.php");
require_once("post/trip.php");
require_once("post/user.php");
require_once("post/vendor.php");
-
+require_once("post/budget.php");
require_once("post/misc.php");
?>
diff --git a/post/budget.php b/post/budget.php
new file mode 100644
index 00000000..096a54ab
--- /dev/null
+++ b/post/budget.php
@@ -0,0 +1,61 @@
+Transfers
-
+
+ ">
+
+ Budget
+
+
">