-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathincome_action.php
38 lines (31 loc) · 1003 Bytes
/
income_action.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
<?php
include_once 'config/Database.php';
include_once 'class/Income.php';
$database = new Database();
$db = $database->getConnection();
$income = new Income($db);
if(!empty($_POST['action']) && $_POST['action'] == 'listIncome') {
$income->listIncome();
}
if(!empty($_POST['action']) && $_POST['action'] == 'getIncomeDetails') {
$income->income_id = $_POST["id"];
$income->getIncomeDetails();
}
if(!empty($_POST['action']) && $_POST['action'] == 'addIncome') {
$income->income_category = $_POST["income_cat"];
$income->amount = $_POST["amount"];
$income->income_date = $_POST["income_date"];
$income->insert();
}
if(!empty($_POST['action']) && $_POST['action'] == 'updateIncome') {
$income->id = $_POST["id"];
$income->income_category = $_POST["income_cat"];
$income->amount = $_POST["amount"];
$income->income_date = $_POST["income_date"];
$income->update();
}
if(!empty($_POST['action']) && $_POST['action'] == 'deleteIncome') {
$income->id = $_POST["id"];
$income->delete();
}
?>