-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrecord_employee_payment_func.php
53 lines (40 loc) · 1.55 KB
/
record_employee_payment_func.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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
<?php
include "config.php";
if (isset($_POST['submit'])){
$username = $_POST['username'];
// $employeeCategory = $_POST['employeeCategory'];
$date = $_POST['date'];
$amount = $_POST['amount'];
$remarks = $_POST['remarks'];
$checkQuery = "SELECT * FROM loginuser where username = '$username'";
$run = mysqli_query($mysqli,$checkQuery);
if(mysqli_num_rows($run)){
$query1 = "SELECT * FROM loginuser where username = '$username'";
$run1 = mysqli_query($mysqli,$query1);
$result1 = mysqli_fetch_assoc($run1);
$bank = $result['bank'];
$branch = $result['branch'];
$number = $result['accountNumber'];
$category1 = $result1['characterid'];
if(($category1==2)){
$category = 'Doctor';
}
elseif(($category1==3)){
$category = 'Pharmacist';
}
elseif(($category1==4)){
$category = 'Accountant';
}
elseif(($category1==5)){
$category = 'Receptionist';
}
$employeeCategory = $category;
$insertQuery = "INSERT INTO employee_payments (username,employeeCategory,date,amount,remarks) VALUES ('$username','$employeeCategory','$date','$amount','$remarks')" ;
$run_query = mysqli_query($mysqli,$insertQuery);
header("Location: record_employee_payments.php");
}
else{
header("Location:incorrectUsername.php");
}
}
?>