This commit is contained in:
root 2025-01-13 21:29:57 +01:00
parent ca5290d94b
commit 029cd458ee
5 changed files with 113 additions and 20 deletions

View file

@ -7,6 +7,51 @@
<?php
function DisplayCSVNEW($csvfile) {
$row = 1;
echo "<center><table>\n\n"; //begin html table formatting
if (($handle = fopen($csvfile, "r")) !== FALSE) {
while (($data = fgetcsv($handle, 1000, ",")) !== FALSE) {
$num = count($data);
//echo "<p>" . $data[1] . "</p>";
//echo "<p> $num fields in line $row: <br /></p>\n";
$row++;
//echo $row;
if ( $row == "2") {
echo "<tr><td>Name</td> <td>Score</td> <td></td></tr>";
}else{
for ($c=0; $c < $num; $c++) {
echo "<tr>"; // 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 "<td>" . '<a href="'; // begin the table cell and a href
echo $data[3] . '">'; // display the link
echo $data[2] . "</a></td><td>"; // display the link title and close the a href and first cell, open the second cell
echo $data[7] . "</td><td>"; // display the status and close the second cell, open the third cell
echo $data[6] . "</td> \n"; // display the score and close the third cell
}
//if ($c == 2){
//}
}
}
echo "</tr>"; // end html table row
}
echo "\n</table></center>";
fclose($handle);
}
}
function DisplayCSV($csvfile) {
$row = 1;
echo "<center><table>\n\n"; //begin html table formatting