-
Notifications
You must be signed in to change notification settings - Fork 15
/
soap.php
40 lines (27 loc) · 1.08 KB
/
soap.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
<?php
require 'vendor/autoload.php';
use TADPHP\TAD;
use TADPHP\TADFactory;
use Monolog\Logger;
use Monolog\Handler\StreamHandler;
use Monolog\Handler\FirePHPHandler;
$dotenv = Dotenv\Dotenv::create(__DIR__);
$dotenv->load();
$logger = new Logger('soap-service');
// Now add some handlers
$logger->pushHandler(new StreamHandler(__DIR__.'/logs/'.date( "Y-m-d").'.log', Logger::DEBUG));
$logger->pushHandler(new FirePHPHandler());
$tad = (new TADFactory((['ip'=> getenv('IP_MESIN_ABSEN'), 'com_key'=>0])))->get_instance();
echo 'starting read data in machine finger print ..'. getenv('IP_MESIN_ABSEN');
$logs = $tad->get_att_log();
$data = $logs->to_json();
$conv = json_decode($data,true);
foreach ($conv['Row'] as $key) {
echo $key['PIN'].'<br/>';
$badgenumber = $key['PIN'];
$checktime = urldecode(date( "Y-m-d H:i:s", strtotime( $key['DateTime'] ) ));
$cabang = getenv('KODE_CABANG');
echo 'badgenumber is ' .$badgenumber.'<br/>';
$url = getenv('BASE_URL_API').'absensi/'.$badgenumber.'/'.$checktime.'/0/'.$cabang;
$logger->info('log',array('url'=>$url));
}