-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathaddarears.php
56 lines (49 loc) · 1.57 KB
/
addarears.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
54
55
56
<?php
session_start();
require_once("includes/Database.php");
require_once("includes/functions.php");
$operator =$_SESSION['id'];
$response = "error";
if(
isset($_POST['location']) &&
isset($_POST['employee']) && ($_POST['employee'] > 0) &&
isset($_POST['month']) &&
isset($_POST['year']) &&
isset($_POST['amount']) ){
$location = $_POST['location'];
$employee = $_POST['employee'];
$month = $_POST['month'];
$year = $_POST['year'];
$amount = $_POST['amount'];
//$empDetails = getemployeedataWithInternalId($employee);
$response = getEmployeeArrears($employee,$month,$year);
if(sizeof($response)==0){
/*if($empDetails['employee_id'] > 0){
$response = InsertArrears($empDetails['employee_id'], 0, 0, 0, 0, 0, 0, 0, 0, 0, $amount, 0, $month, $year, $operator);
if($response)
$response = "Arrears added successfully";
else
$response = "Error occurred while adding arrears";
}else{
$response = "Arrears added successfully";
}*/
$response = "Update Payroll First";
}else{
$response = updateArrears($response[0]['id'], $amount);
if($response)
$response = "Arrears updated successfully";
else
$response = "Error occurred while updating arrears";
}
}else{
$response = "Error Occured";
}
//}
if($response == "success"){
//header('location:../AddCities.php?response=Record Save Successfully');
echo $response;
}else{
//header('location:../AddCities.php?response=Error While Saving Record ');
echo $response;
}
?>