-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathbranch_add.php
35 lines (31 loc) · 1.4 KB
/
branch_add.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
<?php
include_once 'config/config.php';
//include_once 'Branch.php';
var_dump($_POST);
$branchid = $_POST['branchid'];
$branchname = $_POST['branchname'];
$branchaddress = $_POST['branchaddress'];
$phonenumber = $_POST['phonenumber'];
$email = $_POST['email'];
$establishmentdate = $_POST['establishmentdate'];
$createdby = $_POST['createdby'];
$createddate = $_POST['createddate'];
$modifieddate = $_POST['modifieddate'];
$status = $_POST['status'];
$q = "INSERT INTO Branch (`Branch_id`, `Name`, `Branch_Address`, `Phone_number`, `Email`, `Establishment_date`, `Created_by`, `Created_date`, `Modified_date`, `Status`)
VALUES ('$branchid', '$branchname', '$branchaddress', '$phonenumber', '$email', '$establishmentdate', '$createdby', '$createddate', '$modifieddate', '$status')";
if (mysqli_affected_rows($connection_obj) > 0) {
$employee_data = mysqli_fetch_assoc($connection_obj);
header("location:./branch_count.php");
} else {
header("location:./500.php");
}
$status = mysqli_query($connection_obj, $q);
if ($status) {
echo "<script type='text/javascript'>alert('submitted successfully!')</script>";
header("location:./branch_count.php");
} else {
echo "<script type='text/javascript'>alert('failed!')</script>";
//echo "insert error".mysqli_error($connection_obj);
}
?>