07-06-2017, 08:08 AM
Code:
$db->findAll("customers");
Code:
$exclude = ["id","lname","password"];
Code:
$halve = ["fname"];
Code:
if (!$db->error() && $db->count()>0) {
Code:
$customers = $db->results(true);
Code:
echo "<TABLE CLASS=\"table\"><TR>";
Code:
foreach ($customers[0] as $key=>$value)
Code:
if (!in_array($key,$exclude))
Code:
echo "<TH>$key</TH>";
Code:
echo "</TR>";
Code:
foreach ($customers as $customer) {
Code:
echo "<TR>";
Code:
foreach ($customer as $key=>$value)
Code:
if (!in_array($key,$exclude)) {
Code:
echo "<TD>";
Code:
if (in_array($key,$halve))
Code:
echo substr($value, 0, strlen($value)/2);
Code:
else
Code:
echo "$value";
Code:
echo "</TD>";
Code:
}
Code:
echo "</TR>";
Code:
}
Code:
echo "</TABLE>";
Code:
}