function CreateAbsenceTypeSelect() { $absenceTypes = RetrieveAbsenceTypes(); if ($absenceTypes != NULL) { echo '<select class="form-control" name="absenceType">'; foreach ($absenceTypes as $absenceType) { echo '<option value="' . $absenceType[ABS_TYPE_ID] . '">' . $absenceType[ABS_TYPE_NAME] . '</option>'; } } echo '</select>'; }
function DisplayAbsenceTypeBody() { $absenceTypes = RetrieveAbsenceTypes(); if ($absenceTypes != NULL) { foreach ($absenceTypes as $absenceType) { echo "<tr>"; echo "<td>" . $absenceType[ABS_TYPE_NAME] . "</td>"; echo "<td>" . $absenceType[ABS_TYPE_USES_LEAVE] . "</td>"; echo "<td>" . $absenceType[ABS_TYPE_CAN_BE_DENIED] . "</td>"; echo '<td> <button class="btn btn-success" type="submit" ' . 'name="amend" value="' . $absenceType[ABS_TYPE_ID] . '">Amend</button></td>'; echo '<td> <button class="btn btn-danger" type="submit" ' . 'name="delete" value="' . $absenceType[ABS_TYPE_ID] . '">Delete</button></td>'; echo '</tr>'; } } }
function GenerateAbsenceTypeSelect() { $absenceTypes = RetrieveAbsenceTypes(); if ($absenceTypes != NULL) { echo '<select class="form-control" name="absenceType">'; foreach ($absenceTypes as $absenceType) { if ($absenceType[ABS_TYPE_ID] == $request[APPR_ABS_ABS_TYPE_ID]) { echo '<option selected="selected" value="' . $absenceType[ABS_TYPE_ID] . '">' . $absenceType[ABS_TYPE_NAME] . '</option>'; } else { echo '<option value="' . $absenceType[ABS_TYPE_ID] . '">' . $absenceType[ABS_TYPE_NAME] . '</option>'; } } } echo '</select>'; }
function GetAnnualLeaveAbsenceTypeID() { $filter[ABS_TYPE_NAME] = ANNUAL_LEAVE; $absenceTypes = RetrieveAbsenceTypes($filter); $absenceTypeID = NULL; if (count($absenceTypes) == 1) { $absenceTypeID = $absenceTypes[0][ABS_TYPE_ID]; } return $absenceTypeID; }