group by category
[scannr.git] / trunklog.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
<?php
// http://www.unitrunker.com/logs.html
/*
Timestamp as YYYYMMDDHHMMSS
Site number in unformatted decimal
Action: Call, Leaves, Joins, Login, Logout, Drop, Add, Busy, Deny, Kill
Source type I or G
Source ID in unformatted decimal
Target type I or G
Target ID in unformatted decimal
Channel number in unformatted decimal
Call Type*/
$row = 0;
echo "<table>";
if (($handle = fopen("C:\Users\Madoka\AppData\Roaming\UniTrunker\S00000001\UniTrunker-20120411.LOG", "r")) !== FALSE) {
    while (($data = fgetcsv($handle, 1000, ",")) !== FALSE) {
 
        if ($row > 0 && count($data) == 9) {
 
            echo "<tr>";
            for ($c = 0; $c < count($data); $c++) {
                echo '<td>' . $data[$c] . "</td>\n";
            }
            echo "</tr>";
        }
        $row++;
    }
    fclose($handle);
}
echo "</table>";
?>