-
Notifications
You must be signed in to change notification settings - Fork 0
/
addFund.php
24 lines (21 loc) · 1.01 KB
/
addFund.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
<?php
// In this file we wil add a new user to the database.
include 'functions.php';
// We can not put in to the table if any of the following are empty.
// FundName, activity, fund, function, balance.
if(!empty($_POST["fundName"]) && !empty($_POST["activity"]) && !empty($_POST["fund"]) && !empty($_POST["function"]) && !empty($_POST["balance"]))
{
$sql = "INSERT INTO ListOfFunds (Users, FundName, Activity, Fund, Function, Balance, BalanceAsOf, CostCenter, ProjectCode, Active) VALUES ( '";
$sql .= $_POST["users"]. "', '".$_POST["fundName"]."', '".$_POST["activity"]."', '".$_POST["fund"]."', '".$_POST["function"]."', ".$_POST["balance"].", '".date("m/d/y")."', '".$_POST["costCenter"]. "', '".$_POST["projectCode"]."', ".$_POST["active"].")";
echo $sql."<br>";
$conn = connectToDB();
if ($conn->query($sql) === TRUE) {
echo "New record created successfully";
} else {
echo "Error: " . $sql . "<br>" . $conn->error;
}
$conn->close();
}
// Redirect to users.php
//header( 'Location: ./funds.php' ) ;
?>