-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy paththelist.php
More file actions
33 lines (28 loc) · 874 Bytes
/
thelist.php
File metadata and controls
33 lines (28 loc) · 874 Bytes
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
<?php
require_once("bnapbnap.inc.php");
$db = new SQLite3($dbfile);
if ($db == NULL) {
errorprint("Unable to open database.<br>\n");
exit;
}
$records = $db->query($thelistquery);
if ($records == FALSE) {
errorprint("Unable to retrieve record information.");
exit;
}
header("Content-type: text/plain");
header("Cache-Control: no-store, no-cache");
print "prefix,partnum,manufacturer,function,ouivendor\n";
while ($record = $records->fetchArray()) {
# Must rather use PDO but need to go back and change everything
$oui_stmt = "select vendor from oui where oui=\"" . SQLite3::escapeString($record[0]) . "\";";
$oui_query = $db->querySingle($oui_stmt);
echo $record[0] . "," . $record[1] . "," . $record[2] . "," . $record[3] . ",";
if ($oui_query == FALSE || $oui_query == "") {
echo "Unknown\n";
} else {
echo $oui_query . "\n";
}
}
$db->close();
exit;