public function showTimeRequestsByDate($hiddenInputs, $showCustomDates = true, $showPayPeriods = true, $showDivisions = true)
 {
     echo "<form name='timeRequests' method='post'>";
     echo '<h2>Submitted Requests By Division and By Date</h2>';
     $requests = new request_class();
     if ($showCustomDates) {
         $this->showCustomDateRange();
     }
     if ($showPayPeriods) {
         $this->getCurrentPayPeriods();
     }
     if ($showDivisions) {
         $this->showDivisionDropDown();
     }
     $this->filters .= getTimeRequestFiltersBetweenDates($this->config, $this->startDate, $this->endDate);
     //$filters .= " AND (STATUS='APPROVED' OR STATUS='DENIED')";
     $hiddenInputs .= $this->setHiddenPostInputs();
     $requests->debug = false;
     $requests->showTimeRequestTable($this->config, $this->filters, $orderBy = "ORDER BY REFER DESC", $hiddenInputs);
 }
Esempio n. 2
0
function hrPayrolReportByEmployee($config)
{
    //    Get Post Vars
    $viewBtn = false;
    $showAllStatus = isset($_POST['showAllStatus']) ? true : false;
    $hrReportTotalRows = isset($_POST['hrReportTotalRows']) ? $_POST['hrReportTotalRows'] : 0;
    if ($hrReportTotalRows > 0) {
        for ($i = 0; $i <= $hrReportTotalRows; $i++) {
            if (isset($_POST['viewDetailsBtn' . $i])) {
                $empID = $_POST['empID' . $i];
                $viewBtn = true;
                break;
            }
        }
    }
    if (isset($_POST['backBtn'])) {
        $viewBtn = false;
    }
    $requests = new request_class();
    $timeReport = new request_reports($config);
    $timeReport->showTimeRequestFilterOptions($showCustomDates = true, $showPayPeriods = true, $showDivisions = true);
    if ($viewBtn) {
        $hiddenInputs = '<input type="hidden" name="hrReportTotalRows" value="1" />
                <input type="hidden" name="viewDetailsBtn0" value="true" />
                <input type="hidden" name="empID0" value="' . $empID . '" />';
        echo $hiddenInputs;
        echo '<div align="center">';
        if ($showAllStatus) {
            echo '<input type="submit" name="showNormalStatus" value="Remove Pending Status" />';
        } else {
            $timeReport->filters .= " AND (STATUS = 'APPROVED' OR STATUS = 'DENIED')";
            echo '<input type="submit" name="showAllStatus" value="Include Pending Status" />';
        }
        //echo '<div align="center"><a href="'.$_SERVER['REQUEST_URI'].'">Back</a></div>';
        //            echo '<form method="POST">';
        echo ' <input type="submit" name="backBtn" value="Back To Employee Counts" /></div><Br/>';
        $hiddenInputs .= '<input type="hidden" name="viewDetailsBtn" value="true" />';
        $timeReport->filters .= $timeReport->db->getTimeRequestFiltersByEmpID($empID);
        $requests->showTimeRequestTable($config, $timeReport->filters, $orderBy = "ORDER BY REFER DESC", $hiddenInputs);
        //empTimeReportByPay($config, $startDate, $endDate, $empID);
    } else {
        $timeReport->filters .= " AND (STATUS = 'APPROVED' OR STATUS = 'DENIED')";
        $filters = $timeReport->filters;
        $filters .= $timeReport->db->getFilterHRStatus('0');
        $timeReport->db->filters = $filters;
        $result = $timeReport->db->getHRTimeRequestCountsByEmp();
        $theTable = array(array());
        $x = 0;
        $theTable[$x][0] = "View";
        $theTable[$x][1] = "Munis #";
        $theTable[$x][2] = "Employee";
        $theTable[$x][3] = "Number of Requests";
        $lastUser = '';
        $lastUserRow = 0;
        $rowCount = 0;
        while ($row = $result->fetch_assoc()) {
            $x++;
            $recordCounter = 1;
            $lastUser = $row['Name'];
            $theTable[$x][0] = '<input type="submit" name="viewDetailsBtn' . $rowCount . '" value="View" />
                        <input type="hidden" name="empID' . $rowCount . '" value="' . $row['EMP_ID'] . '" />
                        ';
            $theTable[$x][1] = $row['Munis'];
            $theTable[$x][2] = $lastUser;
            $theTable[$x][3] = $row['ReqNumbers'];
            $rowCount++;
        }
        //end While loop
        echo '<h3>Pending HR Approval</h3>';
        showSortableTable($theTable, 2, "hrPending");
        $filters = $timeReport->filters;
        $filters .= $timeReport->db->getFilterHRStatus('1');
        $timeReport->db->filters = $filters;
        $result = $timeReport->db->getHRTimeRequestCountsByEmp();
        $theTable = array(array());
        $x = 0;
        $theTable[$x][0] = "View";
        $theTable[$x][1] = "Munis #";
        $theTable[$x][2] = "Employee";
        $theTable[$x][3] = "Number of Requests";
        $lastUser = '';
        $lastUserRow = 0;
        $recordCounter = 0;
        while ($row = $result->fetch_assoc()) {
            $x++;
            $recordCounter = 1;
            $lastUser = $row['Name'];
            $theTable[$x][0] = '<input type="submit" name="viewDetailsBtn' . $rowCount . '" value="View" />
                        <input type="hidden" name="empID' . $rowCount . '" value="' . $row['EMP_ID'] . '" />
                        ';
            $theTable[$x][1] = $row['Munis'];
            $theTable[$x][2] = $lastUser;
            $theTable[$x][3] = $row['ReqNumbers'];
            $rowCount++;
        }
        //end While loop
        //echo 'number of rows: '.$x;
        echo '<h3>HR Approvals</h3>';
        showSortableTable($theTable, 2, "hrApprove");
        echo '<input type="hidden" name="hrReportTotalRows" value="' . $rowCount . '" />';
    }
    //show a print button. printed look defined by print.css
    //    echo '<a href="javascript:window.print()">Print</a>';
}
Esempio n. 3
0
function searchPOSTActions($config, $searchInput)
{
    $useAction = false;
    if ($config->adminLvl >= 25) {
        if (!isset($_POST['BackBtn'])) {
            if (isset($_POST['searchRows'])) {
                $totalRows = $_POST['searchRows'];
                for ($i = 0; $i <= $totalRows; $i++) {
                    if (isset($_POST['viewRequestBtn' . $i])) {
                        echo '<h3>Showing Requests for ' . $_POST['foundUserLNAME' . $i] . ', ' . $_POST['foundUserFNAME' . $i] . ' </h3>';
                        echo ' <div align="center"><input type="submit" name="BackBtn" value="Back to Search" /></div>';
                        $hiddenInputs = '<input type="hidden" name="searchInput" value="' . $searchInput . '" />
                                <input type="hidden" name="foundUserLNAME' . $i . '" value="' . $_POST['foundUserLNAME' . $i] . '" />
                                <input type="hidden" name="foundUserFNAME' . $i . '" value="' . $_POST['foundUserFNAME' . $i] . '" />';
                        $filters = "";
                        $filters .= getTimeRequestFiltersByEmpID($config, $_POST['foundUserID' . $i]);
                        $hiddenInputs .= '<input type="hidden" name="searchRows" value="2" />';
                        $hiddenInputs .= '<input type="hidden" name="viewRequestBtn1" value="true" />';
                        $hiddenInputs .= '<input type="hidden" name="foundUserID1" value="' . $config->mysqli->real_escape_string($_POST['foundUserID' . $i]) . '" />';
                        echo $hiddenInputs;
                        $requests = new request_class();
                        $requests->showTimeRequestTable($config, $filters, $orderBy = "ORDER BY REFER DESC", $hiddenInputs);
                        $useAction = true;
                        break;
                    }
                }
            }
        } else {
            //Back Button Pressed
            //clearGoToAnchor();
        }
    }
    return $useAction;
}