if ($awaitingapproval > 0) { echo ", {$awaitingapproval} {$strAwaitingApproval} "; } if ($totalholidaystaken > $holidaystaken) { $moreholstaken = $totalholidaystaken - $holidaystaken; echo "<br />+ {$moreholstaken} {$strtakennextperiod}"; } } echo "</td></tr>\n"; echo "<tr class='shade1'><td ><strong>{$strOtherLeave}</strong>:</td></tr>\n"; echo "<tr class='shade2'><td>"; echo user_count_holidays($user, HOL_SICKNESS) . " {$strdayssick}, "; echo user_count_holidays($user, HOL_WORKING_AWAY) . " {$strdaysworkingaway}, "; echo user_count_holidays($user, HOL_TRAINING) . " {$strdaystraining}"; echo "<br />"; echo user_count_holidays($user, HOL_FREE) . " {$strdaysother}"; echo "</td></tr>\n"; echo "</table>\n"; } // Holiday List echo "<table align='center' width='450'>\n"; echo "<tr><th colspan='4' class='subhead'>{$strHolidayList}</th></tr>\n"; $sql = "SELECT * FROM `{$dbHolidays}` WHERE userid='{$user}' "; $sql .= "AND approved = " . HOL_APPROVAL_NONE . " AND type < 10 ORDER BY date ASC"; $result = mysql_query($sql); if (mysql_error()) { trigger_error("MySQL Query Error " . mysql_error(), E_USER_WARNING); } $numwaiting = mysql_num_rows($result); if ($numwaiting > 0) { if ($user == $sit[2] or $approver == TRUE) {
echo colheader('holidaysremaining', sprintf($strRemaining, ''), FALSE); //echo colheader('resetdate', "Reset Date", FALSE); // FIXME i18n //echo colheader('newentitlement', $strNewEntitlement, FALSE); echo "</tr>"; while ($users = mysql_fetch_object($result)) { // define class for table row shading if ($shade == 'shade1') { $shade = "shade2"; } else { $shade = "shade1"; } echo "<tr class='{$shade}'>"; echo "<td><input type='checkbox' name='user{$users->id}' value='yes' /></td>"; echo "<td><a href='holidays.php?user={$users->id}'>{$users->realname}</a> ({$users->username})</td>"; $entitlement = $users->holiday_entitlement; $used_holidays = user_count_holidays($users->id, HOL_HOLIDAY, $users->holiday_resetdate); $remaining_holidays = $entitlement - $used_holidays; echo "<td style='text-align: right;'>{$entitlement}</td>"; echo "<td style='text-align: right;'>{$used_holidays}</td>"; echo "<td style='text-align: right;'>{$remaining_holidays}</td>"; //echo "<td style='text-align: right;'>{$users->holiday_resetdate}</td>"; //echo "<td style='text-align: right;'><input type='text' size='4' maxlength='5' value='{$newentitlement}' /></td>"; echo "</tr>"; } echo "</table>"; echo "<p>"; echo "<input type='hidden' name='action' value='save' />"; echo "<input type='submit' name='submit' value='{$strSave}' /></p>"; echo "</form>"; include APPLICATION_INCPATH . 'htmlfooter.inc.php'; break;
// // Included by ../calendar.php // Prevent script from being run directly (ie. it must always be included if (realpath(__FILE__) == realpath($_SERVER['SCRIPT_FILENAME'])) { exit; } // Display year calendar if ($type < HOL_PUBLIC) { echo "<h2>{$strCalendar}: "; if ($user == 'all' && $approver == TRUE) { echo $strAll; } else { echo user_realname($user, TRUE); } if ($type == HOL_HOLIDAY) { echo "<p align='center'>" . sprintf($strUsedNofNDaysEntitlement, user_count_holidays($user, $type), user_holiday_entitlement($user)) . "<br />"; } echo appointment_type_dropdown($type, 'year'); $sql = "SELECT * FROM {$dbHolidays} WHERE userid='{$user}' AND approved=0 AND type='{$type}'"; $result = mysql_query($sql); if (mysql_error()) { trigger_error("MySQL Query Error " . mysql_error(), E_USER_WARNING); } if (mysql_num_rows($result)) { echo "<table align='center'>"; echo "<tr class='shade2'><td><strong>{$strAwaitingApproval}</strong>:</td></tr>"; echo "<tr class='shade1'><td>"; while ($dates = mysql_fetch_array($result)) { echo date('l ', $dates['startdate']); if ($dates['length'] == 'am') { echo "{$strMorning} ";
echo date_picker('edituser.startdate'); echo "</td></tr>\n"; } elseif ($entitlement > 0) { $holiday_resetdate = user_holiday_resetdate($edituserid); $holidaystaken = user_count_holidays($edituserid, HOL_HOLIDAY, $holiday_resetdate); echo "<tr><th>{$strHolidayEntitlement}</th><td>"; echo "{$entitlement} {$strDays}, "; echo "{$holidaystaken} {$strtaken}, "; echo sprintf($strRemaining, $entitlement - $holidaystaken); echo "</td></tr>\n"; echo "<tr><th>{$strOtherLeave}</th><td>"; echo user_count_holidays($edituserid, HOL_SICKNESS) . " {$strdayssick}, "; echo user_count_holidays($edituserid, HOL_WORKING_AWAY) . " {$strdaysworkingaway}, "; echo user_count_holidays($edituserid, HOL_TRAINING) . " {$strdaystraining}"; echo "<br />"; echo user_count_holidays($edituserid, HOL_FREE) . " {$strdaysother}"; echo "</td></tr>"; } echo "<tr><th>{$strGroupMembership}</th><td valign='top'>"; echo $user->group->name; echo "</td></tr>"; echo "<tr><th colspan='2'>{$strWorkStatus}</th></tr>"; if ($edituserpermission and $edituserid != $sit[2] and $user->user_source == 'sit') { $userdisable = TRUE; } else { $userdisable = FALSE; } echo "<tr><th>{$strStatus}</th><td>"; echo userstatus_drop_down("status", $user->status, $userdisable); echo "</td></tr>\n"; echo "<tr><th>{$strAccepting} {$strIncidents}</th><td>";
$start = $today; $end = $today; } elseif ($end == 0 and $start > 0) { $end = $start; } elseif ($start == 0 and $end > 0) { $start = $end; } if ($user == $sit[2]) { echo "<h2>{$strBook} " . holiday_type($type) . "</h2>"; } else { echo "<h2>{$strBook} " . holiday_type($type) . " for " . user_realname($user) . "</h2>"; } if ($type == HOL_HOLIDAY) { $entitlement = user_holiday_entitlement($user); $holiday_resetdate = user_holiday_resetdate($user); $holidaystaken = user_count_holidays($user, HOL_HOLIDAY, $holiday_resetdate); if ($entitlement - $holidaystaken <= 0) { echo user_alert($strNoHolidayEntitlement, E_USER_WARNING); } } // swap dates around if end is before start if ($start > $end) { $newend = $start; $start = $end; $end = $newend; unset($newend); } if ($type == HOL_SICKNESS and $start > $now) { echo user_alert($strSicknessOnlyBookedNowOrPast, E_USER_ERROR); } echo "<p align='center'><strong>{$strSelectDays}</strong></p>";