Contoh script utama koneksi mesin absensi X100C merk solution pake PHP bais argcom and webservice format json :
Contoh Koneksi Mesin Absensi Mengunakan SOAP Web Service
UserID |
Tanggal & Jam |
Verifikasi |
Status |
function Parse_Data($data,$p1,$p2){
$data=" ".$data;
$hasil="";
$awal=strpos($data,$p1);
if($awal!="") {
$akhir=strpos(strstr($data,$p1),$p2);
if($akhir!="") {
$hasil=substr($data,$awal+strlen($p1),$akhir- strlen($p1));
}
}
return $hasil;
}
$IP="192.168.1.201";
$Key="0";
$Connect = fsockopen($IP,"80", $errno, $errstr, 1);
if($Connect){
echo "Koneksi sukses";
$soap_request="
".$Key."
All
";
$newLine="\r\n";
fputs($Connect, "POST /iWsService HTTP/1.0".$newLine);
fputs($Connect, "Content-Type: text/xml".$newLine);
fputs($Connect, "Content-Length: ".strlen($soap_request).$newLine.$newLine);
fputs($Connect, $soap_request.$newLine);
$buffer="";
while($Response=fgets($Connect, 1024)){
$buffer=$buffer.$Response;
}
}
$buffer=Parse_Data($buffer,"","");
$buffer=explode("\r\n",$buffer);
for($a=0;$a $data=Parse_Data($buffer[$a],"","
");
$PIN=Parse_Data($data,"","");
$DateTime=Parse_Data($data,"","");
$Verified=Parse_Data($data,"","");
$Status=Parse_Data($data,"","");
echo "
";
echo " $PIN | ";
echo " $DateTime | ";
//if($Verified==1) $Verified="sidik jari";
echo " $Verified | ";
echo " $Status | ";
echo "
";
}
echo "
";
?>