I'm having this error
Parse error: syntax error, unexpected '=' in C:\xampp\htdocs\hrm\app\myAPI\attendance\punchIn.php on line 22
phnchIn.php
<?php
// required headers
header("Access-Control-Allow-Origin: *");
header("Content-Type: application/json; charset=UTF-8");
header("Access-Control-Allow-Methods: POST");
header("Access-Control-Max-Age: 3600");
header("Access-Control-Allow-Headers: Content-Type, Access-Control-Allow-Headers, Authorization, X-Requested-With");
include_once '../../config/Database.php';
include_once '../../models/Attendance.php';
$database = new Database();
$db = $database->connect();
$attendance = new Attendance($db);
// get posted data
// $data = json_decode(file_get_contents("php://input"));
$data = (object) $_POST;
// set attendance property values
$attendance::employee = $data->employee;
$attendance::in_time = $data->in_time;
$attendance::note = $data->note;
// create the attendance
if($attendance->punchIn()){
echo '{';
echo '"message": "Attendance was created."';
echo '}';
}
// if unable to create the attendance, tell the user
else{
echo '{';
echo '"message": "Unable to create attendance."';
echo '}';
}
?>
Any help would be a great help