Example #1
0
function displayNewTimeRequestForm($config)
{
    echo '<form method="POST" name="employeeTimeRequest">';
    $timeRequest = new time_request_form($config);
    $timeRequest->showTimeRequestForm();
}
Example #2
0
 private function handlePOSTVariables()
 {
     if (isset($_POST['timeRequestTableRows'])) {
         $totalRows = $_POST['timeRequestTableRows'];
         $this->btnPushed = false;
         for ($i = 0; $i <= $totalRows; $i++) {
             if (isset($_POST['pendingBtn' . $i])) {
                 $this->refNo = $_POST['refNo' . $i];
                 $this->hrNotes = isset($_POST['hrReason' . $i]) ? $_POST['hrReason' . $i] : '';
                 $this->toSendToPendingIndex = $i;
                 $this->toSendToPendingTotalRows = $totalRows;
                 $this->isSendToPending = true;
                 $this->btnPushed = true;
             } elseif (isset($_POST['approve' . $i])) {
                 $this->supReason = isset($_POST['reason' . $i]) ? $_POST['reason' . $i] : '';
                 $this->refNo = $_POST['refNo' . $i];
                 $this->approveLeaveRequest("APPROVED");
                 $this->showPrintFriendlyRedirect();
                 $this->btnPushed = true;
             } elseif (isset($_POST['deny' . $i])) {
                 $this->refNo = $_POST['refNo' . $i];
                 $this->supReason = $_POST['reason' . $i];
                 $this->approveLeaveRequest("DENIED");
                 $this->btnPushed = true;
             } elseif (isset($_POST['hrApproveBtn' . $i])) {
                 $this->hrNotes = isset($_POST['hrReason' . $i]) ? $_POST['hrReason' . $i] : isset($_POST['hrOldNotes' . $i]) ? $_POST['hrOldNotes' . $i] : '';
                 $this->refNo = $_POST['refNo' . $i];
                 $this->hrApproveLeaveRequest();
                 $this->config->anchorID = "hrScrollTo" . $i;
             } elseif (isset($_POST['expungeBtn' . $i]) || isset($_POST['unExpungeBtn' . $i])) {
                 $this->toExpungeRefNo = $_POST['refNo' . $i];
                 $this->toExpungeIndex = $i;
                 $this->toExpungeTotalRows = $totalRows;
                 $this->toExpunge = true;
                 $this->toUnExpunge = false;
                 if (isset($_POST['unExpungeBtn' . $i])) {
                     $this->toUnExpunge = true;
                 }
                 $this->btnPushed = true;
             } elseif (isset($_POST['editBtn' . $i]) && !isset($_POST['cancelReqForm'])) {
                 echo '<br/><center>';
                 $echo = '<input type="hidden" name="editBtn' . $i . '" value="true" />
                     <input type="hidden" name="timeRequestTableRows" value="' . $totalRows . '" />
                     <input type="hidden" name="requestID' . $i . '" value="' . $_POST['requestID' . $i] . '" />';
                 echo $echo;
                 $this->hiddenInput .= $echo;
                 echo '<input type="submit" name="cancelReqForm" value="Cancel Editing" /></center>';
                 $requestForm = new time_request_form($this->config);
                 $requestForm->showTimeRequestForm($_POST['requestID' . $i], $this->hiddenInput);
                 $this->isShowTable = false;
             }
             if ($this->btnPushed) {
                 $this->config->anchorID = "editBtn" . $i;
                 //goToAnchor("editBtn" . $i);
                 break;
             }
         }
     }
 }