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();
 }