public static function AllClientQuotations() { $collection = Quotation::GetAllQuotations($_GET['period'], $_GET['all']); echo ' <div class="logo"> <h5 style="margin-bottom:-15px;margin-top:0px;font-size:14px;">Date: ' . date('d/m/Y') . '</h5> <h4>ALL QUOTATIONS</h4>'; if ($_GET['period'] != '' && $_GET['period']) { echo '<h5 style="margin-top:-10px">Period: ' . $_GET['period'] . '</h5>'; } 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>DATE</td> <td>QUOTE ID</td> <td>CLIENT NAME</td> <td>PURPOSE</td> <td>INVOICED</td> <td>TOTAL</td> </tr> </thead> <tbody>'; $total = 0.0; $invoiced = 0.0; $itms = 0; foreach ($collection as $item) { echo '<tr> <td>' . $item->date . '</td> <td>' . $item->id . '</td> <td>' . $item->client->name . '</td>'; if ($item->projectId != null && $item->projectId != "" && $item->projectId != 0) { $project = Project::GetProject($item->projectId); echo '<td>' . $project->name . '</td>'; } else { echo '<td></td>'; } if ($item->status == 1) { echo '<td style="color:#232836">CREATED</td>'; } else { echo '<td style="color:#27c97b">INVOICED</td>'; $invoiced += $item->total; } echo '<td class="text-right" style="padding: 0 5px;"><script>document.writeln((' . $item->total . ').formatMoney(2, \'.\', \',\'));</script></td> </tr>'; $total += $item->total; ++$itms; } echo '</tbody> </table> <div class="logo"> <p style="margin: 5px 0 0 5px">Total Quotes: <b>' . $itms . '</b></p> <p style="margin: 5px 0 0 5px">Total Quoted: <b>Ksh. <script>document.writeln((' . $total . ').formatMoney(2, \'.\', \',\'));</script></b></p> <p style="margin: 5px 0 0 5px">Total Invoiced: <b>Ksh. <script>document.writeln((' . $invoiced . ').formatMoney(2, \'.\', \',\'));</script></b></p> </div>'; }