<table id="dt_basic" class=" pure-table table table-striped table-bordered" width="100%"> <thead> <tr> <th >Date</th><th >ticketID</th><th>Terminal</th><th>Location</th><th>Client </th><th>Technician</th><th>Issue(s)</th><th>Status </th><th>Date Modified </th><th></th><th></th> </tr> </thead> <tbody> <?php if ($this->pendings) { foreach ($this->pendings as $pending) { echo "<tr>\n <td>" . date_format(date_create($pending->datecreated), "M d Y") . "</td><td>{$pending->id}</td><td>{$pending->terminal_id}</td>"; $prod = Cproduct::find_by_terminal_id($pending->terminal_id); echo "<td>"; if (empty($pending->location)) { echo $prod->install_address . ", " . $prod->install_city; } else { echo $pending->location; } echo " </td>"; echo "<td>"; //$pending->client_name $myclient = Client::find_by_id($pending->client_id); if ($myclient) { echo $myclient->name; } echo "</td><td>"; $schedule = Schedule::find_by_ticket_id($pending->id);