예제 #1
0
 /**
  * 
  * @param type $data
  * @param type $call
  * @return string
  */
 public static function ess_header($data, $call)
 {
     $auth = Zend_Auth::getInstance();
     if ($auth->hasIdentity()) {
         $loginUserId = $auth->getStorage()->read()->id;
     }
     $leaverequestmodel = new Default_Model_Leaverequest();
     $isSwipeAdminValidUser = $isLeaveAdminValidUser = "******";
     //for Swipe Admin
     $eligibleEmployeeIDs = $dateofjoining = explode(",", $leaverequestmodel->getConfigValue(SWIPEADMINCONFIGKEY));
     if (in_array($loginUserId, $eligibleEmployeeIDs)) {
         $isSwipeAdminValidUser = "******";
     }
     //for Exceptions Admin
     $LeaveAdminValidUsers = $dateofjoining = explode(",", $leaverequestmodel->getConfigValue(EMPLOYEEVACATIONEXCEPTIONSADMIN));
     if (in_array($loginUserId, $LeaveAdminValidUsers)) {
         $isLeaveAdminValidUser = "******";
     }
     $myteam_url = BASE_URL . "/commonreports/leavecardreport";
     $deltateam_url = BASE_URL . "/commonreports/swipereport";
     $leaveadmin_url = BASE_URL . "/manageremployeevacations/admin";
     $swipeadmin_url = BASE_URL . "/commonreports/swipeadmin";
     $leaveswipediscrepancyreport_url = BASE_URL . "/commonreports/leaveswipediscrepancyreport";
     $interviewcalendar_url = BASE_URL . "/commonreports/interviewcalendar";
     $html = '';
     $html .= '        <li class="acc_li"><span id="acc_li_toggle_' . MYEMPLOYEES . '" class="acc_li_toggle" onclick="togglesubmenus(' . MYEMPLOYEES . ')"><b>Reports</b></span>';
     $html .= '            <ul>';
     $html .= '                <li menu-url="' . $myteam_url . '" parent-div="div_mchilds_' . EMPLOYEESELFSERVICE . '" super-parent="main_parent_' . EMPLOYEESELFSERVICE . '"  class="clickable_menu" primary_parent="' . MYEMPLOYEES . '"><a href="' . ($call == 'menusettings' ? "javascript:void(0);" : $myteam_url) . '" ><i class="span_sermenu">Leave Card Report</i></a></li>';
     if ($isLeaveAdminValidUser == "1") {
         $html .= '<li menu-url="' . $leaveadmin_url . '" parent-div="div_mchilds_' . EMPLOYEESELFSERVICE . '" super-parent="main_parent_' . EMPLOYEESELFSERVICE . '"  class="clickable_menu" primary_parent="' . MYEMPLOYEES . '"><a href="' . ($call == 'menusettings' ? "javascript:void(0);" : $leaveadmin_url) . '" ><i class="span_sermenu">Leave Exception Administration</i> </a></li>';
     }
     //Swipe Report option will be uncommented once data is loaded
     //$html .= '                <li menu-url="' . $deltateam_url . '" parent-div="div_mchilds_' . EMPLOYEESELFSERVICE . '" super-parent="main_parent_' . EMPLOYEESELFSERVICE . '"  class="clickable_menu" primary_parent="' . MYEMPLOYEES . '"><a href="' . (($call == 'menusettings') ? "javascript:void(0);" : $deltateam_url) . '" ><i class="span_sermenu">Swipe Report</i> </a></li>';
     if ($isSwipeAdminValidUser == "1") {
         $html .= '<li menu-url="' . $swipeadmin_url . '" parent-div="div_mchilds_' . EMPLOYEESELFSERVICE . '" super-parent="main_parent_' . EMPLOYEESELFSERVICE . '"  class="clickable_menu" primary_parent="' . MYEMPLOYEES . '"><a href="' . ($call == 'menusettings' ? "javascript:void(0);" : $swipeadmin_url) . '" ><i class="span_sermenu">Swipe Administration</i> </a></li>';
     }
     //Swipe Report option will be uncommented once data is loaded
     //$html .= '                <li menu-url="' . $leaveswipediscrepancyreport_url . '" parent-div="div_mchilds_' . EMPLOYEESELFSERVICE . '" super-parent="main_parent_' . EMPLOYEESELFSERVICE . '"  class="clickable_menu" primary_parent="' . MYEMPLOYEES . '"><a href="' . (($call == 'menusettings') ? "javascript:void(0);" : $leaveswipediscrepancyreport_url) . '" ><i class="span_sermenu">Leave-Swipe Discrepancy Report</i> </a></li>';
     $html .= '                <li menu-url="' . $interviewcalendar_url . '" parent-div="div_mchilds_' . EMPLOYEESELFSERVICE . '" super-parent="main_parent_' . EMPLOYEESELFSERVICE . '"  class="clickable_menu" primary_parent="' . MYEMPLOYEES . '"><a href="' . ($call == 'menusettings' ? "javascript:void(0);" : $interviewcalendar_url) . '" ><i class="span_sermenu">Interview Calendar</i> </a></li>';
     $html .= '            </ul>';
     $html .= '        </li>';
     return $html;
 }
 public function swipeadminAction()
 {
     $dataExists = $_ABPFound = 0;
     $resourceData = array();
     //$swipestartdate = "26-04-2015";
     //$swipeenddate = "26-04-2015";
     $selectedResource = null;
     $swipestartdate = date('d-m-Y');
     $swipeenddate = date('d-m-Y');
     $auth = Zend_Auth::getInstance();
     if ($auth->hasIdentity()) {
         $loginUserId = $auth->getStorage()->read()->id;
         $loginuserRole = $auth->getStorage()->read()->emprole;
         $loginuserGroup = $auth->getStorage()->read()->group_id;
     }
     $isValidUser = "******";
     $leaverequestmodel = new Default_Model_Leaverequest();
     $eligibleEmployeeIDs = $dateofjoining = explode(",", $leaverequestmodel->getConfigValue(SWIPEADMINCONFIGKEY));
     if (in_array($loginUserId, $eligibleEmployeeIDs)) {
         $isValidUser = "******";
     }
     $repModel = new Default_Model_Servicerequests();
     if ($this->getRequest()->getPost()) {
         $swipestartdate = $this->_getParam('swipestartdate', null);
         $selectedResource = $this->_getParam('resource_id', null);
         if ($selectedResource == null) {
             $selectedResource = $loginUserId;
         }
         //Grid Edit values
         $lblID[] = $this->_getParam('lblID', null);
         $txtControllerNo[] = $this->_getParam('txtControllerNo', null);
         $txtCardNo[] = $this->_getParam('txtCardNo', null);
         $txtChannelNo[] = $this->_getParam('txtChannelNo', null);
         $txtType[] = $this->_getParam('txtType', null);
         $txtaDateTime[] = $this->_getParam('txtaDateTime', null);
         $txtTransCount[] = $this->_getParam('txtTransCount', null);
         $txtReadPointer[] = $this->_getParam('txtReadPointer', null);
         $txtsLogRead[] = $this->_getParam('txtsLogRead', null);
         $txttransactionId[] = $this->_getParam('txttransactionId', null);
         $chkRemove[] = $this->_getParam('chkRemove', null);
         $repModel->UpdateSwipeTransactionLog($selectedResource, $swipestartdate, $loginUserId, $lblID, $txtControllerNo, $txtCardNo, $txtChannelNo, $txtType, $txtaDateTime, $txtTransCount, $txtReadPointer, $txtsLogRead, $txttransactionId, $chkRemove);
         //Grid Add values
         $txtInsControllerNo[] = $this->_getParam('txtInsControllerNo', null);
         $txtInsCardNo[] = $this->_getParam('txtInsCardNo', null);
         $txtInsChannelNo[] = $this->_getParam('txtInsChannelNo', null);
         $txtInsType[] = $this->_getParam('txtInsType', null);
         $txtInsaDateTime[] = $this->_getParam('txtInsaDateTime', null);
         $txtInsTransCount[] = $this->_getParam('txtInsTransCount', null);
         $txtInsReadPointer[] = $this->_getParam('txtInsReadPointer', null);
         $txtInssLogRead[] = $this->_getParam('txtInssLogRead', null);
         $txtInstransactionId[] = $this->_getParam('txtInstransactionId', null);
         $repModel->InsertToSwipeTransactionLog($selectedResource, $loginUserId, $txtInsControllerNo, $txtInsCardNo, $txtInsChannelNo, $txtInsType, $txtInsaDateTime, $txtInsTransCount, $txtInsReadPointer, $txtInssLogRead, $txtInstransactionId);
     }
     if ($selectedResource == null) {
         $selectedResource = $loginUserId;
     }
     $swipeTransactions = $repModel->getSwipeDayTransactionsLog($swipestartdate, $selectedResource);
     $resourceData = $repModel->getValidSwipeResourceData();
     //$resourceData = $repModel->getResourceData($selectedResource, $loginuserRole, $loginuserGroup);
     $dataExists = count($swipeTransactions);
     $this->view->isEligible = $isValidUser;
     $this->view->abperror = $this->isABPFound($swipeTransactions);
     $this->view->resourceData = $resourceData;
     $this->view->dataExists = $dataExists;
     $this->view->selDate = $swipestartdate;
     $this->view->selectedResource = $selectedResource;
     $this->view->swipeTransactions = $swipeTransactions;
     //$this->view->swipeTransactionsGrid = $this->ConvertArrayToGrid(sprintf("Swipe Transaction Log on : %s", $swipestartdate), $swipeTransactions);
     $this->view->messages = $this->_helper->flashMessenger->getMessages();
 }
 public function adminAction()
 {
     $auth = Zend_Auth::getInstance();
     if ($auth->hasIdentity()) {
         $loginUserId = $auth->getStorage()->read()->id;
     }
     $isValidUser = "******";
     $leaverequestmodel = new Default_Model_Leaverequest();
     $eligibleEmployeeIDs = $dateofjoining = explode(",", $leaverequestmodel->getConfigValue(EMPLOYEEVACATIONEXCEPTIONSADMIN));
     if (in_array($loginUserId, $eligibleEmployeeIDs)) {
         $isValidUser = "******";
     }
     $call = $this->_getParam('call');
     if ($call == 'ajaxcall') {
         $this->_helper->layout->disableLayout();
     }
     if ($this->getRequest()->getPost()) {
         $temployeeIDs[] = $_POST['employeeID'];
         $tleaveGroups[] = $_POST['leaveGroup'];
         $tleavetypeIDs[] = $_POST['leavetypeID'];
         $tleaveCounts[] = $_POST['leaveCount'];
         $tleaveComments[] = $_POST['leaveComments'];
         foreach ($temployeeIDs as $temployeeIDs1) {
             $arrCnt = 0;
             foreach ($temployeeIDs1 as $temployeeID) {
                 if ($temployeeID != "-1") {
                     $user_id = $temployeeID;
                     $alloted_year = CURRENTYEARYYYY;
                     $alloted_year_half_for = $tleaveGroups[0][$arrCnt];
                     $leavetypecode = $tleavetypeIDs[0][$arrCnt];
                     $noofleavesalloted = $tleaveCounts[0][$arrCnt];
                     $comments = $tleaveComments[0][$arrCnt];
                     if ($alloted_year_half_for == "1") {
                         if (CURRENTMONTHMM > 6) {
                             $alloted_year = CURRENTYEARYYYY + 1;
                         }
                     }
                     $insString = sprintf("INSERT INTO `tbl_employeeleaves_exception` \r\n                        (`user_id`,`alloted_year`,`alloted_year_half_for`,`leavetypecode`,\r\n                        `noofleavesalloted`,`comments`,`createdby`,`createddate`) VALUES \r\n                        (%s,%s,%s,%s,%s,'%s',%s,now());", $user_id, $alloted_year, $alloted_year_half_for, $leavetypecode, $noofleavesalloted, $comments, $loginUserId);
                     $insID = $leaverequestmodel->ExecuteInsertQuery($insString);
                 }
                 $arrCnt = $arrCnt + 1;
             }
         }
     }
     $data = array();
     $this->view->dataArray = $data;
     $this->view->id = $loginUserId;
     $this->view->activeUsers = $leaverequestmodel->getAllActiveUsers();
     $this->view->activeLeaveTypes = $leaverequestmodel->getAllActiveLeaveTypes();
     $this->view->ActiveLeaveExceptions = $leaverequestmodel->getAllActiveLeaveExceptions($loginUserId);
     $this->view->isEligible = $isValidUser;
     $this->view->call = $call;
     $this->view->messages = $this->_helper->flashMessenger->getMessages();
 }