$total += $obj->remaining; } ?> </tbody> </table> <script> $('#termfees tfoot td').html('<?php echo $ATC_Finance->currency_format(ATC_SETTING_FINANCE_MONEYFORMAT, $total); ?> '); </script> <?php } } catch (ATCExceptionInsufficientPermissions $e) { // We just don't show the error if it was a permission issue, that's fine, we don't know who's logged in, after all } try { $activitiesoutstanding = $ATC_Finance->get_activity_money_outstanding(); if (count($activitiesoutstanding)) { ?> <h2> Cadets needing to pay for activities </h2> <table class="tablesorter" id="activityfees"> <thead> <tr> <th> Rank </th> <th> Name </th> <th> Activity </th> <th> Activity date </th> <th> Cost </th> <th> Outstanding </th> </tr> </thead> <tfoot>
foreach ($users as $obj) { echo '<tr>'; echo ' <td>' . $obj->rank . '</td>'; echo ' <td>' . $obj->display_name . '</td>'; echo '<td class="attendance user' . $obj->personnel_id . '">'; echo ' <input type="hidden" id="activity_id" name="activity_id" value="' . $activity->activity_id . '" />'; echo ' <select name="attendance_' . $obj->personnel_id . '" id="attendance_' . $obj->personnel_id . '">'; echo ' <option value=""' . (is_null($obj->personnel_id) ? ' selected="selected"' : '') . '></option>'; echo ' <option value="' . ATC_ATTENDANCE_PRESENT . '"' . ($obj->presence === ATC_ATTENDANCE_PRESENT ? ' selected="selected"' : '') . '>' . ATC_ATTENDANCE_PRESENT_SYMBOL . '</option>'; echo ' <option value="' . ATC_ATTENDANCE_ON_LEAVE . '"' . ($obj->presence === ATC_ATTENDANCE_ON_LEAVE ? ' selected="selected"' : '') . '>' . ATC_ATTENDANCE_ON_LEAVE_SYMBOL . '</option>'; echo ' <option value="' . ATC_ATTENDANCE_ABSENT_WITHOUT_LEAVE . '"' . ($obj->presence === ATC_ATTENDANCE_ABSENT_WITHOUT_LEAVE ? ' selected="selected"' : '') . '>' . ATC_ATTENDANCE_ABSENT_WITHOUT_LEAVE_SYMBOL . '</option>'; echo ' </select>'; echo '</td>'; echo '<td><input type="text" name="note_' . $obj->personnel_id . '" id="note_' . $obj->personnel_id . '" value="' . htmlentities($obj->note) . '" maxlength="255" /></td>'; // echo '<td><input type="number" step="0.1" name="amtpaid_'.$obj->personnel_id.'" id="amtpaid_'.$obj->personnel_id.'" value="'.htmlentities($obj->amount_paid).'" min="0" style="width:3em;" '.($ATC->user_has_permission(ATC_PERMISSION_FINANCE_EDIT)?'':'readonly="readonly"').'/></td>'; $payments = $ATC->get_activity_money_outstanding($obj->personnel_id, $activity->activity_id); if (count($payments)) { echo '<td nowrap="nowrap" style="text-align:right">' . ($ATC->user_has_permission(ATC_PERMISSION_FINANCE_VIEW, $obj->personnel_id) ? $ATC->currency_format(ATC_SETTING_FINANCE_MONEYFORMAT, $payments[0]->remaining) : '<em>Hidden</em>') . '</td>'; } echo '</tr>'; } ?> </tbody> </table> </form> <script> $("thead th").button().removeClass("ui-corner-all").css({ display: "table-cell" }); </script> <?php exit; } elseif (isset($_GET['id']) && isset($_GET['action']) && $_GET['action'] == 'contactsheet') {
<th> Name </th> <th> Activity </th> <th> Activity date </th> <th> Cost </th> <th> Outstanding </th> </tr> </thead> <tfoot> <tr> <th colspan="5"> Total </th> <td style="font-weight:bold; text-align:right"> </td> </tr> </tfoot> <tbody> <?php $activitiesoutstanding = $ATC->get_activity_money_outstanding(); $total = 0; foreach ($activitiesoutstanding as $obj) { echo '<tr>'; echo ' <td>' . $obj->rank . '</td>'; echo ' <td><a href="personnel.php?id=' . $obj->personnel_id . '">' . $obj->display_name . '</a></td>'; echo ' <td><a href="activities.php?id=' . $obj->activity_id . '" class="activity edit">' . $obj->title . '</a></td>'; echo ' <td>' . date(ATC_SETTING_DATE_OUTPUT, strtotime($obj->startdate)) . '</td>'; echo ' <td style="text-align:right">' . $ATC->currency_format(ATC_SETTING_FINANCE_MONEYFORMAT, $obj->due) . '</td>'; echo ' <td style="text-align:right">' . $ATC->currency_format(ATC_SETTING_FINANCE_MONEYFORMAT, $obj->remaining) . '</td>'; if ($ATC->user_has_permission(ATC_PERMISSION_FINANCE_EDIT)) { echo ' <td><a href="?id=0" personnel_id="' . $obj->personnel_id . '" activity_id="' . $obj->activity_id . '" class="invoice button pay">Pay</a></td>'; } echo '</tr>'; $total += $obj->remaining; }