public static function ClientRegister() { $collection = Client::GetAllClients(); echo ' <div class="logo"> <h5 style="margin-bottom:-15px;margin-top:0px;font-size:14px;">Date: ' . date('d/m/Y') . '</h5> <h4>ALL CLIENTS</h4>'; echo '</div> <table class="table table-bordered table-striped" style="text-align:center;margin-left:0;margin-right:0;width:760px;font-size:12px;"> <thead class="title"> <tr> <td>NAME</td> <td>TELEPHONE</td> <td>BALANCE</td> </tr> </thead> <tbody>'; $total = 0.0; foreach ($collection as $model) { echo '<tr> <td>' . $model->name . '</td> <td>' . $model->telephone . '</td> <td style="text-align:right;padding-right:7px"><script>document.writeln((' . $model->balance->amount . ').formatMoney(2, \'.\', \',\'));</script></td> </tr>'; $total += $model->balance->amount; } echo '</tbody> </table> <div class="logo"> <p style="margin: 5px 0 0 5px">Total Debt: <b>Ksh. <script>document.writeln((' . $total . ').formatMoney(2, \'.\', \',\'));</script></b></p> </div>'; }
public function getClients() { if ($this->validateAdmin()) { echo json_encode(Client::GetAllClients()); } else { echo 0; } }