Everything previously under www/src now are under www/ Moved style.CSS under www/ressources, to allow blocking http requests to www/lib completly Moved <head> and <header> generation under lib/PHP/output/sections.php to reduce redundancy within files. Also implemented a system to allow them to generate relatif paht for href to ressources depending on their deepness within www/ hierarchy.
33 lines
688 B
PHP
33 lines
688 B
PHP
<?php
|
|
|
|
function print_db_query_table( $qresult ): void
|
|
{
|
|
echo "<table><tr>";
|
|
$col_num = $qresult->columnCount();
|
|
|
|
for($i = 0; $i < $col_num; $i++)
|
|
{
|
|
// Not present on all driver. Present on MySQL driver.
|
|
$col_info = $qresult->getColumnMeta($i);
|
|
$col_table = $col_info['table'];
|
|
$col_name = $col_info['name'];
|
|
echo "<th scope='col'>$col_table.$col_name</th>\n";
|
|
}
|
|
echo "</tr>\n";
|
|
|
|
$num_rows = $qresult->rowCount();
|
|
$qresult->setFetchMode(PDO::FETCH_ASSOC);
|
|
|
|
for($i = 0; $i < $num_rows; $i++)
|
|
{
|
|
$row = $qresult->fetch();
|
|
|
|
echo "<tr>";
|
|
foreach($row as $field)
|
|
{
|
|
echo "<td>$field</td>";
|
|
}
|
|
echo "</tr>";
|
|
}
|
|
echo "</table> <br>";
|
|
}
|