Created
February 20, 2020 11:57
-
-
Save rajurayhan/a73fa30fd43d79b7b02186e69bd83f90 to your computer and use it in GitHub Desktop.
Attendance Integration
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// echo phpinfo(); | |
$baseURL = 'http://192.168.10.241:8080/simecschool/'; | |
$attendanceAPI = $baseURL.'frontend/apiattendance'; | |
// echo $attendanceAPI; | |
$data = array( | |
'punchID' => '123456', | |
'date' => '19-02-2020', | |
'time' => '04:50:30', | |
'node' => 5 | |
); | |
$curl = curl_init(); | |
// /Set some options - we are passing in a useragent too here | |
curl_setopt_array($curl, [ | |
CURLOPT_RETURNTRANSFER => 1, | |
CURLOPT_URL => "http://192.168.10.241:8080/simecschool/frontend/apiattendance?punchID=".$data['punchID']."&date=".$data['date']."&time=".$data['time']."&node=".$data['node'], | |
CURLOPT_USERAGENT => 'SIMEC PATHSHALA ATTENDANCE SYNCHRONISER' | |
]); | |
// Send the request & save response to $resp | |
$resp = curl_exec($curl); | |
// Close request to clear up some resources | |
curl_close($curl); | |
// var_dump($resp); | |
$response = json_decode($resp, true); | |
if($response['status'] == 'success'){ | |
// Changes Active Status from your DB. | |
} | |
else{ | |
// Don't change and try again later | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment