Get log data from fingerprint device

in this section i will let you know how to get log data from fingerprint device. i used X100-c.

i got software development kit (SDK) from fingerprint device and want to develop own application. i developed my application using php. so this is the code for get log data for fingerprint device:

<html>
<head><title>Contoh Koneksi Mesin Absensi Mengunakan SOAP Web Service</title></head>
<meta http-equiv=”refresh” content=”2; URL=http://localhost/tes.php”>
<body>
<table cellspacing=”2″ cellpadding=”2″ border=”1″>
<tr align=”center”>
<td><B>UserID</B></td>
<td width=”200″><B>Tanggal & Jam</B></td>
<td><B>Verifikasi</B></td>
<td><B>Status</B></td>
</tr>
<?php

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;
}

if($IP==””) $IP=”IP ANDA”;
if($Key==””) $Key=”0″;

$Connect = fsockopen($IP, “80”, $errno, $errstr, 1);
if($Connect){
echo “Koneksi sukses”;
$soap_request=”<GetAttLog>
<ArgComKey xsi:type=\”xsd:integer\”>”.$Key.”</ArgComKey>
<Arg><PIN xsi:type=\”xsd:integer\”>All</PIN></Arg>
</GetAttLog>”;

$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,”<GetAttLogResponse>”,”</GetAttLogResponse>”);
$buffer=explode(“\r\n”,$buffer);
for($a=0;$a<count($buffer);$a++){
$data=Parse_Data($buffer[$a],”<Row>”,”</Row>”);
$PIN=Parse_Data($data,”<PIN>”,”</PIN>”);
$DateTime=Parse_Data($data,”<DateTime>”,”</DateTime>”);
$Verified=Parse_Data($data,”<Verified>”,”</Verified>”);
$Status=Parse_Data($data,”<Status>”,”</Status>”);

echo “<tr align=’center’>”;
echo “<td> $PIN </td>”;
echo “<td> $DateTime </td>”;
//if($Verified==1) $Verified=”sidik jari”;
echo “<td> $Verified </td>”;
echo “<td> $Status </td>”;

echo “</tr>”;

}
}

echo “</table>”;
?>
</body>
</html>

Thats it. tell me if you have a question..

Lets blogging with me
Dhieka Lantana

Your email address will not be published. Required fields are marked *

*