Skip to content

Commit

Permalink
Alternate colors on the search results, clean up formatting.
Browse files Browse the repository at this point in the history
  • Loading branch information
tobarja committed May 4, 2015
1 parent 21b1472 commit a8f203d
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions src/Controller/Customers.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,17 +42,19 @@ public function getCustomers() {
if ($statement){
echo "<br>";
echo "<div style='width:60%;margin-right:auto;margin-left:auto;'>";
$counter = 0;
$bgcolor = array("#D8D8D8", "#848484");
foreach($statement as $row){
$counter++;
$telephone = substr($row["Telephone"],0,3) . '-' . substr($row["Telephone"],3,3) . '-' . substr($row["Telephone"], 6);
$freebieUrl = "/freebies/" . $row['CustomerID'];
$bgcolor = "#D8D8D8";
echo "<div style='background-color:" . $bgcolor . ";border:1px solid #ffffff;width:100%;'>";
echo "<div style='background-color:" . $bgcolor[$counter % 2] . ";width:100%;'>";
echo "<a href= '" . $freebieUrl . " ' style='text-decoration:none; color:black; font-size:30px;'>
<span style='background-color:" . $bgcolor . ";padding:5px;'>
<div style='display:inline-block;background-color:" . $bgcolor[$counter % 2] . ";padding:5px;'>
" . $row["FirstName"] . " " . $row["LastName"] . " " . $telephone. "
</span>
</div >
</a>";
echo "<a href= '/customers/edit/". $row["CustomerID"] . "' style='float:right;text-decoration:none; color:black; font-size:30px;'><span style='background-color:" . $bgcolor . ";padding:5px;'>Edit</span></a>";
echo "<a href= '/customers/edit/". $row["CustomerID"] . "' style='float:right;text-decoration:none; color:black; font-size:30px;'><div style='background-color:" . $bgcolor[$counter % 2] . ";padding:5px;'>Edit</div></a>";
echo "</div>";
}
echo "</div>";
Expand Down

0 comments on commit a8f203d

Please sign in to comment.