\n\n"; //begin html table formatting
if (($handle = fopen($csvfile, "r")) !== FALSE) {
$oldcatname="";
while (($data = fgetcsv($handle, 1000, ",")) !== FALSE) {
$num = count($data);
//echo "" . $data[1] . "
";
//echo " $num fields in line $row:
\n";
$row++;
//echo $row;
if ( $row == "2") {
echo "Category | Name | Score | |
";
}else{
if (str_contains(strtolower($data[3]), strtolower($query)) or str_contains(strtolower($data[2]), strtolower($query)) or str_contains(strtolower($data[1]), strtolower($query))) {
$resultcount++;
for ($c=0; $c < $num; $c++) { // iterate over each row
echo ""; // begin html table row for that Category
// if the row is the first one (name url status score) only display (Name Status Score):
// display the contents of a csv row
if ( $c == "1" ){
//add http if its not already done in the URL
if (!preg_match("~^(?:f|ht)tps?://~i", $data[3])) {
$urllink = "http://" . $data[3];
}else{
$urllink = $data[3];
}
if ($oldcatname != $data[1]){
echo " |
|
|
"; // skip a row if new category
echo " | |
|
"; // skip a row if new category
echo "" . $data[1] . ' | '; // display the category as its the first row with this new category
$oldcatname=$data[1];
}else{
echo "" . ' | '; // category is already displayed so skip it (empty cell in category column)
}
echo "" ; // begin the table cell
echo ' '; // display the link
echo $urllink . '"> '; // display the link
echo $data[2] . " | "; // display the link title and close the a href and first cell, open the second cell
echo $data[7] . " | "; // display the status and close the second cell, open the third cell
echo $data[6] . " | \n"; // display the score and close the third cell
}
//if ($c == 2){
//}
}
}
}
echo ""; // end html table row
}
echo "\n
";
fclose($handle);
}
echo "" . $resultcount . " Result(s) found.
";
}
function DisplayCategories($instancename, $path) {
$resultcount=0;
$row = 1;
//echo $instancename;
//$csvfilenames = "verified.csv unverified.csv";
$csvfilenames = "verified.csv";
$csvfilenames = explode(' ', $csvfilenames);
foreach ($csvfilenames as $csvfilename){
//echo $csvfilename;
$csvfile = $path . $csvfilename;
//echo $csvfile;
//echo "test";
echo "\n\n"; //begin html table formatting
if (($handle = fopen($csvfile, "r")) !== FALSE) {
$oldcatname="";
while (($data = fgetcsv($handle, 1000, ",")) !== FALSE) {
$num = count($data);
$row++;
if ( $row == "2") {
echo " | ";
}else{
if (str_contains(strtolower($data[3]), strtolower($query)) or str_contains(strtolower($data[2]), strtolower($query)) or str_contains(strtolower($data[1]), strtolower($query))) {
$resultcount++;
for ($c=0; $c < $num; $c++) { // iterate over each row
// if the row is the first one (name url status score) only display (Name Status Score):
// display the contents of a csv row
if ( $c == "1" ){
if ($oldcatname != $data[1]){
echo '' . $data[1] . ' | '; // display the category as its the first row with this new category
$oldcatname=$data[1];
}
}
}
}
}
}
echo "
";
fclose($handle);
}
//echo "" . $resultcount . " Result(s) found.
";
}
}
function DisplayCSV($csvfile) {
$row = 1;
echo "\n\n"; //begin html table formatting
if (($handle = fopen($csvfile, "r")) !== FALSE) {
while (($data = fgetcsv($handle, 1000, ",")) !== FALSE) {
$num = count($data);
//echo "" . $data[1] . "
";
//echo " $num fields in line $row:
\n";
$row++;
//echo $row;
if ( $row == "2") {
echo "Name | Score | |
";
}else{
for ($c=0; $c < $num; $c++) {
echo ""; // beging html table row
// if the row is the first one (name url status score) only display (Name Status Score):
// display the contents of a csv row
if ( $c == "1" ){
echo "" . ''; // display the link
echo $data[0] . " | "; // display the link title and close the a href and first cell, open the second cell
echo $data[3] . " | "; // display the status and close the second cell, open the third cell
echo $data[2] . " | \n"; // display the score and close the third cell
}
//if ($c == 2){
//}
}
}
echo "
"; // end html table row
}
echo "\n
";
fclose($handle);
}
}
function DisplayCSVold($csvfile) {
echo "\n\n";
// Open a file
$file = fopen($csvfile, "r");
// Fetching data from csv file row by row
while (($data = fgetcsv($file)) !== false) {
// HTML tag for placing in row format
echo "";
foreach ($data as $i) {
echo "" . htmlspecialchars($i)
. " | ";
}
echo "
\n";
}
// Closing the file
fclose($file);
echo "\n
";
}
?>

Update Frequency: every 3 hours