/**
  * Generic method to display a list
  * @param int $pageNumber Page Number
  * @param int $count Total number of results
  * @param Array $list results (in current page)
  */
 private function _viewList($pageNumber, $count, $list)
 {
     $formCreator = new FormCreator($_GET, $_POST);
     $formCreator->formPath = '/recruitmentview.php';
     $formCreator->popArr['currentPage'] = $pageNumber;
     $formCreator->popArr['list'] = $list;
     $formCreator->popArr['count'] = $count;
     $formCreator->display();
 }
 function reDirect($getArr, $object = null)
 {
     $form_creator = new FormCreator($getArr);
     switch ($getArr['uniqcode']) {
         case 'BNK':
             $form_creator->formPath = '/templates/eimadmin/bankinformation.php';
             $bankinfo = new BankInfo();
             if ($getArr['capturemode'] == 'addmode') {
                 $form_creator->popArr['newID'] = $bankinfo->getLastRecord();
             } elseif ($getArr['capturemode'] == 'updatemode') {
                 $form_creator->popArr['editArr'] = $bankinfo->filterBankInfo($getArr['id']);
             }
             break;
         case 'BCH':
             $form_creator->formPath = '/templates/eimadmin/branches.php';
             $brch = new Branches();
             $bank = new BankInfo();
             if ($getArr['capturemode'] == 'addmode') {
                 $form_creator->popArr['newID'] = $brch->getLastRecord();
                 $form_creator->popArr['bankcode'] = $bank->getBankCodes();
             } elseif ($getArr['captuIMPremode'] == 'updatemode') {
                 $form_creator->popArr['editArr'] = $brch->filterBranches($getArr['id']);
                 $form_creator->popArr['bankcode'] = $bank->getBankCodes();
             }
             break;
         case 'TAX':
             $form_creator->formPath = '/templates/eimadmin/taxinformation.php';
             $taxinfo = new TaxInfo();
             if ($getArr['capturemode'] == 'addmode') {
                 $form_creator->popArr['newID'] = $taxinfo->getLastRecord();
             } elseif ($getArr['capturemode'] == 'updatemode') {
                 $form_creator->popArr['editArr'] = $taxinfo->filterTaxInfo($getArr['id']);
             }
             break;
         case 'CCB':
             $form_creator->formPath = '/templates/eimadmin/cashben.php';
             $cashben = new CashBen();
             if ($getArr['capturemode'] == 'addmode') {
                 $form_creator->popArr['newID'] = $cashben->getLastRecord();
             } elseif ($getArr['capturemode'] == 'updatemode') {
                 $form_creator->popArr['editArr'] = $cashben->filterCashBenefits($getArr['id']);
             }
             break;
         case 'BBS':
             $form_creator->formPath = '/templates/eimadmin/cashbensal.php';
             $salgrd = new SalaryGrades();
             $cashbensal = new CashBenSalary();
             $cashben = new CashBen();
             $form_creator->popArr['salDet'] = $salgrd->filterSalaryGrades($getArr['id']);
             $form_creator->popArr['benListAll'] = $cashben->getAllCashBenefits();
             if (isset($getArr['editID'])) {
                 $arr[0] = $getArr['editID'];
                 $arr[1] = $getArr['id'];
                 $form_creator->popArr['editArr'] = $cashbensal->filterCashBenefits($arr);
             } else {
                 $form_creator->popArr['benListUnAss'] = $cashben->getCashBenCodes($getArr['id']);
             }
             $form_creator->popArr['benListAss'] = $cashbensal->getAssCashBenefits($getArr['id']);
             break;
         case 'COS':
             $form_creator->formPath = '/templates/eimadmin/costcenters.php';
             $cost = new CostCenter();
             if ($getArr['capturemode'] == 'addmode') {
                 $form_creator->popArr['newID'] = $cost->getLastRecord();
             } elseif ($getArr['capturemode'] == 'updatemode') {
                 $form_creator->popArr['editArr'] = $cost->filterCostCenter($getArr['id']);
             }
             break;
         case 'COU':
             $form_creator->formPath = '/templates/eimadmin/countryinformation.php';
             $country = new CountryInfo();
             if ($getArr['capturemode'] == 'updatemode') {
                 $form_creator->popArr['editArr'] = $country->filterCountryInfo($getArr['id']);
             }
             break;
         case 'CUR':
             $form_creator->formPath = '/templates/eimadmin/currencytypes.php';
             $currency = new CurrencyTypes();
             if ($getArr['capturemode'] == 'updatemode') {
                 $form_creator->popArr['editArr'] = $currency->filterCurrencyTypes($getArr['id']);
             }
             break;
         case 'DWT':
             $form_creator->formPath = '/templates/eimadmin/dwellinginformation.php';
             $dwinfo = new DwellingType();
             if ($getArr['capturemode'] == 'addmode') {
                 $form_creator->popArr['newID'] = $dwinfo->getLastRecord();
             } elseif ($getArr['capturemode'] == 'updatemode') {
                 $form_creator->popArr['editArr'] = $dwinfo->filterDwellingType($getArr['id']);
             }
             break;
         case 'ELE':
             $form_creator->formPath = '/templates/eimadmin/electorateinformation.php';
             $eleinfo = new ElectorateInfo();
             if ($getArr['capturemode'] == 'addmode') {
                 $form_creator->popArr['newID'] = $eleinfo->getLastRecord();
             } elseif ($getArr['capturemode'] == 'updatemode') {
                 $form_creator->popArr['editArr'] = $eleinfo->filterElectorateInfo($getArr['id']);
             }
             break;
         case 'EMC':
             $form_creator->formPath = '/templates/eimadmin/empcatinfo.php';
             $empcatinfo = new EmployeeCat();
             if ($getArr['capturemode'] == 'addmode') {
                 $form_creator->popArr['newID'] = $empcatinfo->getLastRecord();
             } elseif ($getArr['capturemode'] == 'updatemode') {
                 $form_creator->popArr['editArr'] = $empcatinfo->filterEmployeeCat($getArr['id']);
             }
             break;
         case 'EMG':
             $form_creator->formPath = '/templates/eimadmin/employeegroups.php';
             $empgrpinfo = new EmployeeGroup();
             if ($getArr['capturemode'] == 'addmode') {
                 $form_creator->popArr['newID'] = $empgrpinfo->getLastRecord();
             } elseif ($getArr['capturemode'] == 'updatemode') {
                 $form_creator->popArr['editArr'] = $empgrpinfo->filterEmployeeGroup($getArr['id']);
             }
             break;
         case 'ETY':
             $form_creator->formPath = '/templates/eimadmin/emptypes.php';
             $emptype = new EmployeeType();
             if ($getArr['capturemode'] == 'addmode') {
                 $form_creator->popArr['newID'] = $emptype->getLastRecord();
             } elseif ($getArr['capturemIMPode'] == 'updatemode') {
                 $form_creator->popArr['editArr'] = $emptype->filterEmployeeType($getArr['id']);
             }
             break;
         case 'EXC':
             $form_creator->formPath = '/templates/eimadmin/extracurractcat.php';
             $exccat = new ExtraCurrActCat();
             if ($getArr['capturemode'] == 'addmode') {
                 $form_creator->popArr['newID'] = $exccat->getLastRecord();
             } elseif ($getArr['capturemode'] == 'updatemode') {
                 $form_creator->popArr['editArr'] = $exccat->filterExtraCurrActCat($getArr['id']);
             }
             break;
         case 'DEF':
             $form_creator->formPath = '/templates/eimadmin/hierarchydef.php';
             $hidef = new HierarchyDefInfo();
             if ($getArr['capturemode'] == 'addmode') {
                 $form_creator->popArr['newID'] = $hidef->getLastRecord();
             } elseif ($getArr['capturemode'] == 'updatemode') {
                 $form_creator->popArr['editArr'] = $hidef->filterHierarchyDefInfo($getArr['id']);
             }
             break;
         case 'CHI':
             $form_creator->formPath = '/templates/eimadmin/comphier.php';
             $cmphier = new CompHierachy();
             $hidef = new HierarchyDefInfo();
             $loc = new models_eimadmin_Location();
             $empinfo = new EmpInfo();
             if ($getArr['capturemode'] == 'addmode') {
                 $form_creator->popArr['newID'] = $cmphier->getLastRecord();
                 $form_creator->popArr['hiercodes'] = $hidef->getHierachyCodes();
                 $form_creator->popArr['empcodes'] = $empinfo->getEmpCodes();
                 $form_creator->popArr['deflev'] = $cmphier->getHierachyDef();
                 $form_creator->popArr['loccodes'] = $loc->getLocCodes();
             } elseif ($getArr['capturemode'] == 'updatemode') {
                 $form_creator->popArr['editArr'] = $cmphier->filterCompHierachy($getArr['id']);
                 $form_creator->popArr['hiercodes'] = $cmphier->getHierachyCodes();
                 $form_creator->popArr['empcodes'] = $empinfo->getEmpCodes();
                 $form_creator->popArr['deflev'] = $cmphier->getHierachyDef();
                 $form_creator->popArr['loccodes'] = $loc->getLocCodes();
             }
             break;
         case 'LOC':
             $form_creator->formPath = '/templates/eimadmin/locations.php';
             $loc = new models_eimadmin_Location();
             $country = new CountryInfo();
             $form_creator->popArr['cntlist'] = $country->getCountryCodes();
             if ($getArr['capturemode'] == 'updatemode') {
                 $province = new ProvinceInfo();
                 $district = new DistrictInfo();
                 $form_creator->popArr['editArr'] = $edit = $loc->filterLocation($getArr['id']);
                 $form_creator->popArr['provlist'] = $province->getProvinceCodes($edit[0][2]);
                 $form_creator->popArr['districtlist'] = $district->getDistrictCodes($edit[0][3]);
             }
             break;
         case 'JDC':
             $form_creator->formPath = '/templates/eimadmin/jdcategory.php';
             $jdcat = new JDCategory();
             if ($getArr['capturemode'] == 'addmode') {
                 $form_creator->popArr['newID'] = $jdcat->getLastRecord();
             } elseif ($getArr['capturemode'] == 'updatemode') {
                 $form_creator->popArr['editArr'] = $jdcat->filterJDCategory($getArr['id']);
             }
             break;
         case 'MEM':
             $form_creator->formPath = '/templates/eimadmin/membershiptypes.php';
             $memtype = new MembershipType();
             if ($getArr['capturemode'] == 'updatemode') {
                 $form_creator->popArr['editArr'] = $memtype->filterMembershipType($getArr['id']);
             }
             break;
         case 'EMX':
             $form_creator->formPath = '/templates/eimadmin/emailConfiguration.php';
             $emailConfigObj = new EmailConfiguration();
             $form_creator->popArr['editArr'] = $emailConfigObj;
             break;
         case 'CSE':
             $form_creator->formPath = '/templates/eimadmin/dataExport.php';
             $csvExport = new CSVExport();
             $form_creator->popArr['exportTypes'] = $csvExport->getDefinedExportTypes();
             break;
         case 'IMP':
             if (isset($getArr['upload']) && $getArr['upload'] == 1) {
                 $form_creator->formPath = '/templates/eimadmin/dataUploadStatus.php';
                 $form_creator->popArr['uploadStatus'] = $object;
                 $form_creator->popArr['recordLimit'] = CSVSplitter::getRecordLimit();
                 $form_creator->popArr['delimiterLevels'] = AjaxCalls::getDelimiterLevelsArray(3);
             } else {
                 $form_creator->formPath = '/templates/eimadmin/dataImport.php';
                 $csvImport = new CSVImport();
                 $form_creator->popArr['importTypes'] = $csvImport->getDefinedImportTypes();
             }
             break;
         case 'ENS':
             $form_creator->formPath = '/templates/eimadmin/emailNotificationConfiguration.php';
             $emailNotificationConfObj = new EmailNotificationConfiguration($_SESSION['user']);
             $form_creator->popArr['editArr'] = $emailNotificationConfObj->fetchNotifcationStatus();
             break;
         case 'NAT':
             $form_creator->formPath = '/templates/eimadmin/nationalityinformation.php';
             $natinfo = new NationalityInfo();
             if ($getArr['capturemode'] == 'updatemode') {
                 $form_creator->popArr['editArr'] = $natinfo->filterNationalityInfo($getArr['id']);
             }
             break;
         case 'NCB':
             $form_creator->formPath = '/templates/eimadmin/noncashben.php';
             $noncashben = new NonCashBen();
             if ($getArr['capturemode'] == 'addmode') {
                 $form_creator->popArr['newID'] = $noncashben->getLastRecord();
             } elseif ($getArr['capturemode'] == 'updatemode') {
                 $form_creator->popArr['editArr'] = $noncashben->filterNonCashBenefits($getArr['id']);
             }
             break;
         case 'QLF':
             $form_creator->formPath = '/templates/eimadmin/qualificationtypes.php';
             $qualtype = new QualificationType();
             if ($getArr['capturemode'] == 'addmode') {
                 $form_creator->popArr['newID'] = $qualtype->getLastRecord();
             } elseif ($getArr['capturemode'] == 'updatemode') {
                 $form_creator->popArr['editArr'] = $qualtype->filterQualificationType($getArr['id']);
             }
             break;
         case 'RTM':
             $form_creator->formPath = '/templates/eimadmin/ratingmethods.php';
             $rattype = new RatingTypes();
             if ($getArr['capturemode'] == 'addmode') {
                 $form_creator->popArr['newID'] = $rattype->getLastRecord();
             } elseif ($getArr['capturemode'] == 'updatemode') {
                 $form_creator->popArr['editArr'] = $rattype->filterRatingTypes($getArr['id']);
             }
             break;
         case 'RTE':
             $form_creator->formPath = '/templates/eimadmin/routeinformation.php';
             $rouinfo = new RouteInfo();
             if ($getArr['capturemode'] == 'addmode') {
                 $form_creator->popArr['newID'] = $rouinfo->getLastRecord();
             } elseif ($getArr['capturemode'] == 'updatemode') {
                 $form_creator->popArr['editArr'] = $rouinfo->filterRouteInfo($getArr['id']);
             }
             break;
         case 'SGR':
             $form_creator->formPath = '/templates/eimadmin/salarygrades.php';
             $salgrade = new SalaryGrades();
             $salcurdet = new SalCurDet();
             if ($getArr['capturemode'] == 'updatemode') {
                 $form_creator->popArr['editArr'] = $salgrade->filterSalaryGrades($getArr['id']);
                 $form_creator->popArr['assCurrency'] = $salcurdet->getAssSalCurDet($getArr['id']);
                 if (!isset($getArr['editID'])) {
                     $form_creator->popArr['unAssCurrency'] = $salcurdet->getUnAssSalCurDet($getArr['id']);
                 } else {
                     $arr[0] = $getArr['id'];
                     $arr[1] = $getArr['editID'];
                     $form_creator->popArr['editAssCurrency'] = $salcurdet->filterSalCurDet($arr);
                 }
             }
             break;
         case 'SKI':
             $form_creator->formPath = '/templates/eimadmin/skills.php';
             $skill = new Skills();
             if ($getArr['capturemode'] == 'updatemode') {
                 $form_creator->popArr['editArr'] = $skill->filterSkills($getArr['id']);
             }
             break;
         case 'ETH':
             $form_creator->formPath = '/templates/eimadmin/ethnicrace.php';
             $ethnicrace = new EthnicRace();
             if ($getArr['capturemode'] == 'updatemode') {
                 $form_creator->popArr['editArr'] = $ethnicrace->filterEthnicRace($getArr['id']);
             }
             break;
         case 'EXA':
             $form_creator->formPath = '/templates/eimadmin/extracurractinfo.php';
             $extcainfo = new ExtraCurActInfo();
             $excurac = new ExtraCurrActCat();
             if ($getArr['capturemode'] == 'addmode') {
                 $form_creator->popArr['newID'] = $extcainfo->getLastRecord();
                 $form_creator->popArr['getResultSet'] = $extcainfo->getExtraCatCodes();
             } elseif ($getArr['capturemode'] == 'updatemode') {
                 $form_creator->popArr['editArr'] = $extcainfo->filterExtraCurActInfo($getArr['id']);
                 $form_creator->popArr['getResultSet'] = $excurac->getExtraCatCodes();
             }
             break;
         case 'MME':
             $form_creator->formPath = '/templates/eimadmin/membershipinformation.php';
             $meminfo = new MembershipInfo();
             $memtype = new MembershipType();
             if ($getArr['capturemode'] == 'addmode') {
                 $form_creator->popArr['getResultSet'] = $memtype->getMembershipTypeCodes();
             } elseif ($getArr['capturemode'] == 'updatemode') {
                 $form_creator->popArr['editArr'] = $meminfo->filterMembershipInfo($getArr['id']);
                 $form_creator->popArr['getResultSet'] = $memtype->getMembershipTypeCodes();
             }
             break;
         case 'JDK':
             $form_creator->formPath = '/templates/eimadmin/jdkra.php';
             $jdkr = new JDKra();
             $skill = new Skills();
             $jdtyp = new JDType();
             if ($getArr['capturemode'] == 'addmode') {
                 $form_creator->popArr['newID'] = $jdkr->getLastRecord();
                 $form_creator->popArr['jdktyplist'] = $jdtyp->getJDTypeCodes();
                 $form_creator->popArr['sktyplist'] = $skill->getSkillCodes();
             } elseif ($getArr['capturemode'] == 'updatemode') {
                 $form_creator->popArr['editArr'] = $jdkr->filterJDKra($getArr['id']);
                 $form_creator->popArr['jdktyplist'] = $jdtyp->getJDTypeCodes();
                 $form_creator->popArr['sktyplist'] = $skill->getSkillCodes();
             }
             break;
         case 'LAN':
             $form_creator->formPath = '/templates/eimadmin/languageinformation.php';
             $laninfo = new LanguageInfo();
             if ($getArr['capturemode'] == 'updatemode') {
                 $form_creator->popArr['editArr'] = $laninfo->filterLanguageInfo($getArr['id']);
             }
             break;
         case 'RLG':
             $form_creator->formPath = '/templates/eimadmin/religioninformation.php';
             $relinfo = new ReligionInfo();
             if ($getArr['capturemode'] == 'addmode') {
                 $form_creator->popArr['newID'] = $relinfo->getLastRecord();
             } elseif ($getArr['capturemode'] == 'updatemode') {
                 $form_creator->popArr['editArr'] = $relinfo->filterReligionInfo($getArr['id']);
             }
             break;
         case 'SAT':
             $form_creator->formPath = '/templates/eimadmin/satutoryinfo.php';
             $satinfo = new SatutoryInfo();
             if ($getArr['capturemode'] == 'addmode') {
                 $form_creator->popArr['newID'] = $satinfo->getLastRecord();
             } elseif ($getArr['capturemode'] == 'updatemode') {
                 $form_creator->popArr['editArr'] = $satinfo->filterSatutoryInfo($getArr['id']);
             }
             break;
         case 'UNI':
             $form_creator->formPath = '/templates/eimadmin/uniformtypes.php';
             $unitype = new UniformType();
             if ($getArr['capturemode'] == 'addmode') {
                 $form_creator->popArr['newID'] = $unitype->getLastRecord();
             } elseif ($getArr['capturemode'] == 'updatemode') {
                 $form_creator->popArr['editArr'] = $unitype->filterUniformType($getArr['id']);
             }
             break;
         case 'EXA':
             $form_creator->formPath = '/templates/eimadmin/extracurractinfo.php';
             $excurac = new ExtraCurActInfo();
             if ($getArr['capturemode'] == 'addmode') {
                 $form_creator->popArr['newID'] = $excurac->getLastRecord();
                 $form_creator->popArr['getResultSet'] = $excurac->getExtraCatCodes();
             } elseif ($getArr['capturemode'] == 'updatemode') {
                 $form_creator->popArr['editArr'] = $excurac->filterExtraCurActInfo($getArr['id']);
                 $form_creator->popArr['getResultSet'] = $excurac->getExtraCatCodes();
             }
             break;
         case 'EDU':
             $form_creator->formPath = '/templates/eimadmin/qualifications.php';
             $edu = new Education();
             if ($getArr['capturemode'] == 'updatemode') {
                 $form_creator->popArr['editArr'] = $edu->filterEducation($getArr['id']);
             }
             break;
         case 'JDT':
             $form_creator->formPath = '/templates/eimadmin/jdtypes.php';
             $jdtyp = new JDType();
             if ($getArr['capturemode'] == 'addmode') {
                 $form_creator->popArr['newID'] = $jdtyp->getLastRecord();
                 $form_creator->popArr['jdcatcodes'] = $jdtyp->getJDTypeCodes();
             } elseif ($getArr['capturemode'] == 'updatemode') {
                 $form_creator->popArr['editArr'] = $jdtyp->filterJDType($getArr['id']);
                 $form_creator->popArr['jdcatcodes'] = $jdtyp->getJDTypeCodes();
             }
             break;
         case 'SBJ':
             $form_creator->formPath = '/templates/eimadmin/subjectinformation.php';
             $subin = new SubjectInfo();
             $qualifi = new Qualifications();
             if ($getArr['capturemode'] == 'addmode') {
                 $form_creator->popArr['newID'] = $subin->getLastRecord();
                 $form_creator->popArr['getResultSet'] = $qualifi->getQualifiCodes();
             } elseif ($getArr['capturemode'] == 'updatemode') {
                 $form_creator->popArr['editArr'] = $subin->filterSubjectInfo($getArr['id']);
                 $form_creator->popArr['getResultSet'] = $qualifi->getQualifiCodes();
             }
             break;
         case 'SSK':
             $form_creator->formPath = '/templates/eimadmin/subskillinformation.php';
             $subsk = new SubSkillInfo();
             $skill = new Skills();
             if ($getArr['capturemode'] == 'addmode') {
                 $form_creator->popArr['newID'] = $subsk->getLastRecord();
                 $form_creator->popArr['getResultSet'] = $skill->getSkillCodes();
             } elseif ($getArr['capturemode'] == 'updatemode') {
                 $form_creator->popArr['editArr'] = $subsk->filterSubSkillInfo($getArr['id']);
                 $form_creator->popArr['getResultSet'] = $skill->getSkillCodes();
             }
             break;
         case 'CTT':
             $form_creator->formPath = '/templates/eimadmin/corptit.php';
             $corptit = new CorpTitle();
             $salgrd = new SalaryGrades();
             if ($getArr['capturemode'] == 'addmode') {
                 $form_creator->popArr['newID'] = $corptit->getLastRecord();
                 $form_creator->popArr['corptitles'] = $corptit->getCorpTitles();
                 $form_creator->popArr['salgrds'] = $corptit->getSalGrades();
             } elseif ($getArr['capturemode'] == 'updatemode') {
                 $form_creator->popArr['editArr'] = $corptit->filterCorpTitles($getArr['id']);
                 $form_creator->popArr['corptitles'] = $corptit->getCorpTitles();
                 $form_creator->popArr['salgrds'] = $salgrd->getSalGrades();
             }
             break;
         case 'DSG':
             $form_creator->formPath = '/templates/eimadmin/designations.php';
             $desig = new Designations();
             $corptit = new CorpTitle();
             if ($getArr['capturemode'] == 'addmode') {
                 $form_creator->popArr['newID'] = $desig->getLastRecord();
                 $form_creator->popArr['corptitles'] = $corptit->getCorpTitles();
                 $form_creator->popArr['des'] = $desig->getDes();
             } elseif ($getArr['capturemode'] == 'updatemode') {
                 $form_creator->popArr['editArr'] = $desig->filterDesignations($getArr['id']);
                 $form_creator->popArr['corptitles'] = $corptit->getCorpTitles();
                 $form_creator->popArr['des'] = $desig->getDes();
             }
             break;
         case 'DIS':
             $form_creator->formPath = '/templates/eimadmin/districtinformation.php';
             $disinfo = new DistrictInfo();
             $prov = new ProvinceInfo();
             $country = new CountryInfo();
             $form_creator->popArr['countrylist'] = $country->getCountryCodes();
             if ($getArr['capturemode'] == 'addmode') {
                 if ($object != null) {
                     $form_creator->popArr['txtDistrictDesc'] = $object->txtDistrictDesc;
                     $form_creator->popArr['cmbCountry'] = $object->cmbCountry;
                     $form_creator->popArr['selProvince'] = $object->selProvince;
                     $form_creator->popArr['provlist'] = $prov->getProvinceCodes($object->cmbCountry);
                 }
             } elseif ($getArr['capturemode'] == 'updatemode') {
                 $form_creator->popArr['editArr'] = $editArr = $disinfo->filterDistrictInfo($getArr['id']);
                 if ($object != null) {
                     $form_creator->popArr['txtDistrictDesc'] = $object->txtDistrictDesc;
                     $form_creator->popArr['cmbCountry'] = $object->cmbCountry;
                     $form_creator->popArr['selProvince'] = $object->selProvince;
                     $form_creator->popArr['provlist'] = $prov->getProvinceCodes($object->cmbCountry);
                 } else {
                     $temp = $prov->filterGetProvinceCodeInfo($editArr[0][2]);
                     $form_creator->popArr['selcountry'] = $temp[0][2];
                     $form_creator->popArr['provlist'] = $prov->getProvinceCodes($temp[0][2]);
                 }
             }
             break;
         case 'NBS':
             $form_creator->formPath = '/templates/eimadmin/noncashbensal.php';
             $salgrd = new SalaryGrades();
             $noncashbensal = new NonCashBenSalary();
             $noncashben = new NonCashBen();
             $form_creator->popArr['salDet'] = $salgrd->filterSalaryGrades($getArr['id']);
             $form_creator->popArr['benListAll'] = $noncashben->getAllNonCashBenefits();
             if (isset($getArr['editID'])) {
                 $arr[0] = $getArr['editID'];
                 $arr[1] = $getArr['id'];
                 $form_creator->popArr['editArr'] = $noncashben->filterNonCashBenefits($arr);
             } else {
                 $form_creator->popArr['benListUnAss'] = $noncashben->getNonCashBenCodes($getArr['id']);
             }
             $form_creator->popArr['benListAss'] = $noncashbensal->getAssCashBenefits($getArr['id']);
             break;
         case 'DDI':
             $form_creator->formPath = '/templates/eimadmin/desdis.php';
             $desig = new Designations();
             $desdis = new DesDescription();
             $form_creator->popArr['desDet'] = $desig->getDes();
             $form_creator->popArr['desDisAss'] = $desdis->getAssigned($getArr['id']);
             if (isset($getArr['editID'])) {
                 $arr[1] = $getArr['id'];
                 $arr[0] = $getArr['editID'];
                 $form_creator->popArr['editArr'] = $desdis->filterJDKPI($arr);
             }
             if (isset($getArr['addForm']) && $getArr['addForm'] == 'ADD') {
                 $form_creator->popArr['desDisUnAss'] = $desdis->getGrouping($getArr['id']);
             }
             break;
         case 'DQA':
             $form_creator->formPath = '/templates/eimadmin/desqua.php';
             $desig = new Designations();
             $desqual = new DesQualification();
             $form_creator->popArr['desDet'] = $desig->getDes();
             $form_creator->popArr['qualListAll'] = $desqual->getAllQualifications();
             if (isset($getArr['editID'])) {
                 $arr[0] = $getArr['id'];
                 $arr[1] = $getArr['editID'];
                 $form_creator->popArr['editArr'] = $desqual->filterJDQual($arr);
             } else {
                 $form_creator->popArr['qualListUnAss'] = $desqual->getQual($getArr['id']);
             }
             $form_creator->popArr['qualListAss'] = $desqual->getAssJDQual($getArr['id']);
             break;
         case 'DQS':
             $form_creator->formPath = '/templates/eimadmin/desquasub.php';
             $desig = new Designations();
             $desqualsub = new DesQualSubject();
             $qualifi = new Qualifications();
             $form_creator->popArr['desDet'] = $desig->filterDesignations($getArr['id']);
             $form_creator->popArr['qualDet'] = $qualifi->getQualCodes();
             $form_creator->popArr['gradlist'] = $desqualsub->getRatGrds($getArr['QUA']);
             $form_creator->popArr['subDet'] = $desqualsub->getSubjectCodes();
             if (isset($getArr['editID'])) {
                 $arr[0] = $getArr['id'];
                 $arr[1] = $getArr['editID'];
                 $arr[2] = $getArr['QUA'];
                 $form_creator->popArr['editArr'] = $desqualsub->filterQuaSub($arr);
             } else {
                 $form_creator->popArr['sublist'] = $desqualsub->getSubjects($getArr['id'], $getArr['QUA']);
             }
             $form_creator->popArr['rset'] = $desqualsub->getAssQuaSub($getArr['id']);
             break;
         case 'RTG':
             $form_creator->formPath = '/templates/eimadmin/ratinggrade.php';
             $rattyp = new RatingTypes();
             $form_creator->popArr['ratDet'] = $rattyp->filterRatingTypes($getArr['id']);
             $ratgrd = new RatingGrade();
             if (isset($getArr['editID'])) {
                 $arr[0] = $getArr['editID'];
                 $arr[1] = $getArr['id'];
                 $form_creator->popArr['editArr'] = $ratgrd->filterRatGrd($arr);
             } else {
                 $form_creator->popArr['newID'] = $ratgrd->getLastRecord();
             }
             $form_creator->popArr['ratGrdAss'] = $ratgrd->getAssRatGrd($getArr['id']);
             break;
         case 'EEC':
             $form_creator->formPath = '/templates/eimadmin/eeojobcat.php';
             $eeojobcat = new EEOJobCat();
             if ($getArr['capturemode'] == 'updatemode') {
                 $form_creator->popArr['editArr'] = $eeojobcat->filterEEOJobCat($getArr['id']);
             }
             break;
         case 'LIC':
             $form_creator->formPath = '/templates/eimadmin/licenses.php';
             $licenses = new Licenses();
             if ($getArr['capturemode'] == 'updatemode') {
                 $form_creator->popArr['editArr'] = $licenses->filterLicenses($getArr['id']);
             }
             break;
         case 'CST':
             $form_creator->formPath = '/templates/eimadmin/compstruct.php';
             /*
             $hierachinfo = new HierarchyDefInfo();
             $comphier = new CompHierachy();
             $compstruct = new CompStruct();
             
             $form_creator->popArr['hierlist'] = $hierachinfo -> getHierarchyDef();
             $form_creator->popArr['compstruct'] = $comphier ->getAssCompHier(1,'');
             $form_creator->popArr['unAssCompStruct'] = $compstruct->getUnAssCompStruct('',1);
             */
             $locations = new models_eimadmin_Location();
             $countries = new CountryInfo();
             $form_creator->popArr['locations'] = $locations->getLocCodes();
             $form_creator->popArr['countries'] = $countries->getCountryCodes();
             break;
         case 'TCP':
             $form_creator->formPath = '/templates/eimadmin/companyProperty.php';
             $authorizeObj = new authorize($_SESSION['empID'], $_SESSION['isAdmin']);
             if (!isset($_GET['action'])) {
                 $empInfo = new EmpInfo();
                 if ($authorizeObj->isAdmin()) {
                     $form_creator->popArr['emplist'] = $empInfo->getListofEmployee();
                 } else {
                     $empReportTo = new EmpRepTo();
                     $form_creator->popArr['emplist'] = $empReportTo->getEmpSubDetails($_SESSION['empID']);
                     /* An element of the value from $empInfo->getListofEmployee() will contain
                      * an array with 6 elements. Values from $empReportTo->getEmpSubDetails() will
                      * only contain 3 elements. But there won't be a problem because only first 3 values
                      * will be used in the template
                      */
                 }
             }
             $compProp = new CompProperty();
             $propertyCount = count($compProp->getPropertyList());
             $pageNo = 1;
             if (isset($_REQUEST['pageNo'])) {
                 $pageNo = $_REQUEST['pageNo'];
             } else {
                 $pageNo = ceil($propertyCount / 10);
             }
             if ($authorizeObj->isAdmin()) {
                 $form_creator->popArr['properties'] = $compProp->getPropertyList($pageNo);
             } else {
                 $subordinateList = array();
                 foreach ($form_creator->popArr['emplist'] as $subordinate) {
                     $subordinateList[] = $subordinate[0];
                 }
                 $form_creator->popArr['properties'] = $compProp->getPropertyList($pageNo, $subordinateList, true);
             }
             $form_creator->popArr['allProperties'] = $compProp->getPropertyList();
             $form_creator->popArr['pageNo'] = $pageNo;
             $form_creator->popArr['recordCount'] = $propertyCount;
             $form_creator->popArr['authObj'] = $authorizeObj;
             break;
         case 'JOB':
             $form_creator->formPath = '/templates/eimadmin/jobtitle.php';
             $jobtitle = new JobTitle();
             $paygrade = new SalaryGrades();
             $jobtit_empstat = new JobTitEmpStat();
             $form_creator->popArr['paygrade'] = $paygrade->getSalGrades(true);
             $form_creator->popArr['jobSpecList'] = JobSpec::getAll();
             if ($getArr['capturemode'] == 'updatemode') {
                 $form_creator->popArr['editArr'] = $jobtitle->filterJobTitles($getArr['id']);
                 $form_creator->popArr['assEmploymentStat'] = $jobtit_empstat->getAssEmpStat($getArr['id']);
                 $form_creator->popArr['unAssEmploymentStat'] = $jobtit_empstat->getUnAssEmpStat($getArr['id']);
             }
             break;
         case 'SPC':
             $form_creator->formPath = '/templates/eimadmin/jobSpec.php';
             // Here we fetch all job specs for easier validation of duplicate names
             // Assuming it's unlikely that very large number of job specs will be defined.
             $form_creator->popArr['jobSpecList'] = JobSpec::getAll();
             if ($getArr['capturemode'] == 'updatemode') {
                 $form_creator->popArr['jobSpec'] = JobSpec::getJobSpec($getArr['id']);
             } else {
                 $form_creator->popArr['jobSpec'] = new JobSpec();
             }
             break;
         case 'EST':
             $form_creator->formPath = '/templates/eimadmin/empstat.php';
             $empstat = new EmploymentStatus();
             if ($getArr['capturemode'] == 'updatemode') {
                 $form_creator->popArr['editArr'] = $empstat->filterEmpStat($getArr['id']);
             }
             break;
         case 'GEN':
             $form_creator->formPath = '/templates/eimadmin/geninfo.php';
             $geninfo = new GenInfo();
             $country = new CountryInfo();
             $province = new ProvinceInfo();
             $district = new DistrictInfo();
             $tabArr = $geninfo->filterGenInfo();
             $genInfoKeys = explode('|', $tabArr[0][0]);
             $genInfoValues = explode('|', $tabArr[0][1]);
             for ($c = 0; $genInfoKeys && count($genInfoKeys) > $c; $c++) {
                 $editArr[$genInfoKeys[$c]] = $genInfoValues[$c];
             }
             $form_creator->popArr['editArr'] = $editArr;
             $form_creator->popArr['cntlist'] = $country->getCountryCodes();
             if (isset($editArr['COUNTRY'])) {
                 $form_creator->popArr['provlist'] = $province->getProvinceCodes($editArr['COUNTRY']);
             }
             if (isset($editArr['STATE'])) {
                 $form_creator->popArr['districtlist'] = $district->getDistrictCodes($editArr['STATE']);
             }
             //Finding the numer of  employees
             $empInfo = new EmpInfo();
             $form_creator->popArr['empcount'] = $empInfo->countEmployee();
             break;
         case 'CUS':
             $form_creator->formPath = '/templates/eimadmin/customer.php';
             $customer = new Customer();
             if ($getArr['capturemode'] == 'updatemode') {
                 $form_creator->popArr['editArr'] = $customer->fetchCustomer($getArr['id']);
             } else {
                 $form_creator->popArr['editArr'] = new Customer();
             }
             break;
         case 'CTM':
             $form_creator->formPath = '/templates/eimadmin/customFields.php';
             $form_creator->popArr['available'] = CustomFields::getAvailableFieldNumbers();
             if ($getArr['capturemode'] == 'updatemode') {
                 $form_creator->popArr['editArr'] = CustomFields::getCustomField($getArr['id']);
             } else {
                 $form_creator->popArr['editArr'] = new CustomFields();
             }
             break;
         case 'CEX':
             $form_creator->formPath = '/templates/eimadmin/customExportDefine.php';
             $form_creator->popArr['customExportList'] = CustomExport::getCustomExportList();
             if ($getArr['capturemode'] == 'updatemode') {
                 $customExport = CustomExport::getCustomExport($getArr['id']);
                 $form_creator->popArr['headings'] = $customExport->getHeadings();
                 $form_creator->popArr['available'] = $customExport->getAvailableFields();
                 $form_creator->popArr['assigned'] = $customExport->getAssignedFields();
                 $form_creator->popArr['exportName'] = $customExport->getName();
                 $form_creator->popArr['id'] = $customExport->getId();
             } else {
                 $form_creator->popArr['headings'] = array();
                 $form_creator->popArr['available'] = CustomExport::getAllFields();
                 $form_creator->popArr['assigned'] = array();
                 $form_creator->popArr['exportName'] = null;
                 $form_creator->popArr['id'] = null;
             }
             break;
         case 'CIM':
             $form_creator->formPath = '/templates/eimadmin/customImportDefine.php';
             $form_creator->popArr['customImportList'] = CustomImport::getCustomImportList();
             if ($getArr['capturemode'] == 'updatemode') {
                 $customImport = CustomImport::getCustomImport($getArr['id']);
                 $form_creator->popArr['has_heading'] = $customImport->getContainsHeader();
                 $form_creator->popArr['available'] = $customImport->getAvailableFields();
                 $form_creator->popArr['assigned'] = $customImport->getAssignedFields();
                 $form_creator->popArr['importName'] = $customImport->getName();
                 $form_creator->popArr['id'] = $customImport->getId();
                 $form_creator->popArr['compulsary_fields'] = CustomImport::getCompulsaryFields();
             } else {
                 $customImport = new CustomImport();
                 // Assign compulsary fields
                 $compulsary = CustomImport::getCompulsaryFields();
                 $customImport->setAssignedFields($compulsary);
                 $form_creator->popArr['has_heading'] = true;
                 $form_creator->popArr['available'] = $customImport->getAvailableFields();
                 $form_creator->popArr['assigned'] = $compulsary;
                 $form_creator->popArr['importName'] = null;
                 $form_creator->popArr['id'] = null;
                 $form_creator->popArr['compulsary_fields'] = $compulsary;
             }
             break;
         case 'CHD':
             $form_creator->formPath = '/templates/eimadmin/customExportHeadingDefine.php';
             $customExport = CustomExport::getCustomExport($getArr['id']);
             $headings = $customExport->getHeadings();
             $form_creator->popArr['headings'] = empty($headings) ? $customExport->getAssignedFields() : $headings;
             $form_creator->popArr['assigned'] = $customExport->getAssignedFields();
             $form_creator->popArr['exportName'] = $customExport->getName();
             $form_creator->popArr['id'] = $customExport->getId();
             break;
         case 'PAD':
             // Project Admin. Fall through to PRJ case below.
             $form_creator->getArr['uniqcode'] = "PRJ";
         case 'PRJ':
             $form_creator->formPath = '/templates/eimadmin/project.php';
             $project = new Projects();
             $customer = new Customer();
             $form_creator->popArr['cusid'] = $customer->fetchCustomers();
             $form_creator->popArr['employeeList'] = EmpInfo::getEmployeeMainDetails();
             if ($getArr['capturemode'] == 'updatemode') {
                 $form_creator->popArr['editArr'] = $project->fetchProject($getArr['id']);
                 $gw = new ProjectAdminGateway();
                 $form_creator->popArr['admins'] = $gw->getAdmins($getArr['id']);
             }
             break;
         case 'PAC':
             $form_creator->formPath = '/templates/eimadmin/projectActivity.php';
             /* If a HR admin, show all projects. Otherwise only show projects for which
              * user is an admin
              */
             $authorizeObj = new authorize($_SESSION['empID'], $_SESSION['isAdmin']);
             if ($authorizeObj->isAdmin()) {
                 $projects = new Projects();
                 /* Filter only not deleted projects */
                 $projects->setDeleted(Projects::PROJECT_NOT_DELETED);
                 $projectList = $projects->fetchProjects();
             } else {
                 if ($authorizeObj->isProjectAdmin()) {
                     $gw = new ProjectAdminGateway();
                     $projectList = $gw->getProjectsForAdmin($_SESSION['empID']);
                 }
             }
             /* If projectId given, get activities for that project else load first
              * project in list
              */
             $projectId = null;
             $activities = array();
             if (!empty($projectList)) {
                 if (isset($getArr['projectId']) && ($authorizeObj->isAdmin() || $authorizeObj->isProjectAdminOf($getArr['projectId']))) {
                     $projectId = $getArr['projectId'];
                 } else {
                     $projectId = $projectList[0]->getProjectId();
                 }
                 $activities = ProjectActivity::getActivityList($projectId);
             }
             $form_creator->popArr['projects'] = $projectList;
             $form_creator->popArr['projectId'] = $projectId;
             $form_creator->popArr['activities'] = $activities;
             break;
         case 'USR':
             $form_creator->formPath = '/templates/maintenance/users.php';
             $user = new Users();
             if ($getArr['capturemode'] == 'addmode') {
                 $form_creator->popArr['emplist'] = $user->getEmployeeCodes();
                 $form_creator->popArr['uglist'] = $user->getUserGroupCodes();
             } elseif ($getArr['capturemode'] == 'updatemode') {
                 $form_creator->popArr['editArr'] = $user->filterUsers($getArr['id']);
                 $form_creator->popArr['emplist'] = $user->getEmployeeCodes();
                 $form_creator->popArr['uglist'] = $user->getUserGroupCodes();
                 //$form_creator ->popArr['editArr'] = $user->filterChangeUsers($getArr['id']);
             }
             $form_creator->popArr['employeeSearchList'] = EmpInfo::getEmployeeSearchList();
             break;
         case 'USG':
             $form_creator->formPath = '/templates/maintenance/usergroups.php';
             $usrgrp = new UserGroups();
             if ($getArr['capturemode'] == 'updatemode') {
                 $form_creator->popArr['editArr'] = $usrgrp->filterUserGroups($getArr['id']);
             }
             break;
         case 'UGR':
             $form_creator->formPath = '/templates/maintenance/AdminMenu.php';
             $urights = new Rights();
             $usergroup = new UserGroups();
             $form_creator->popArr['ugDet'] = $usergroup->filterUserGroups($getArr['id']);
             $form_creator->popArr['modlist'] = $urights->getAllModules();
             if (isset($getArr['editID'])) {
                 $arr[0] = $getArr['id'];
                 $arr[1] = $getArr['editID'];
                 $form_creator->popArr['editArr'] = $urights->filterRights($arr);
             } else {
                 $form_creator->popArr['modlistUnAss'] = $urights->getModuleCodes($getArr['id']);
             }
             $form_creator->popArr['modlistAss'] = $urights->getAssRights($getArr['id']);
             break;
         case 'LDAP':
             if ($_SESSION['ldap'] == "enabled") {
                 $form_creator->formPath = '/templates/eimadmin/ldapConfiguration.php';
                 $ldapConfigObj = new LdapDetails();
                 $form_creator->popArr['editArr'] = $ldapConfigObj->retrieveLdapDetails();
             }
             break;
     }
     $form_creator->display();
 }
Example #3
0
 function reDirect($getArr, $postArr, $object = null)
 {
     $form_creator = new FormCreator($getArr, $postArr);
     switch ($getArr['reqcode']) {
         case 'JSP':
             $form_creator->formPath = '/templates/hrfunct/hrempjobspec.php';
             $ejobsp = new EmpJobSpec();
             $empinfo = new EmpInfo();
             $jdcat = new JDCategory();
             $form_creator->popArr['empdet'] = $empinfo->filterEmpMain($getArr['id']);
             $form_creator->popArr['catlist'] = $jdcat->getJDCatCodes();
             if (isset($getArr['editID'])) {
                 $arr[0] = $getArr['id'];
                 $arr[1] = $getArr['editID'];
                 $form_creator->popArr['editArr'] = $ejobsp->filterEmpJobSpec($arr);
             } else {
                 $form_creator->popArr['unasscatlist'] = $jdcat->getUnAssJDCatCodes($getArr['id']);
             }
             $form_creator->popArr['rset'] = $ejobsp->getAssEmpJobSpec($getArr['id']);
             //$form_creator ->popArr['catlist']=$ejobsp->getJDCatCodes();
             break;
         case 'CXT':
             $form_creator->formPath = '/templates/hrfunct/hrempconext.php';
             $empconext = new EmpConExt();
             $empinfo = new EmpInfo();
             $form_creator->popArr['empdet'] = $empinfo->filterEmpMain($getArr['id']);
             $form_creator->popArr['empstat'] = $empinfo->filterEmpJobStat($getArr['id']);
             if (isset($getArr['editID'])) {
                 $arr[0] = $getArr['id'];
                 $arr[1] = $getArr['editID'];
                 $form_creator->popArr['editArr'] = $empconext->filterConExt($arr);
                 $form_creator->popArr['lastrec'] = $empconext->getLastRecord($getArr['id']);
             } else {
                 $form_creator->popArr['lastrec'] = $empconext->getLastRecord($getArr['id']);
             }
             $form_creator->popArr['rset'] = $empconext->getAssConExt($getArr['id']);
             break;
         case 'SAL':
             $form_creator->formPath = '/templates/hrfunct/hrempbassal.php';
             $empinfo = new EmpInfo();
             $empbassal = new EmpBasSalary();
             $currTyp = new CurrencyTypes();
             $form_creator->popArr['einfo'] = $empinfo->filterEmpMain($getArr['id']);
             $form_creator->popArr['empdet'] = $empdet = $empinfo->filterEmpJobInfo($getArr['id']);
             $salGrd = $empdet[0][5];
             if (isset($getArr['editID1'])) {
                 $arr[0] = $getArr['id'];
                 $arr[1] = $getArr['editID1'];
                 $arr[2] = $getArr['editID2'];
                 $form_creator->popArr['editArr'] = $edit = $empbassal->filterEmpBasSal($arr);
                 $form_creator->popArr['currlist'] = $empbassal->getCurrCodes($edit[0][1]);
             } else {
                 $form_creator->popArr['curlist'] = $empbassal->getUnAssCurrCodes($salGrd, $getArr['id']);
                 if ($object != null) {
                     $form_creator->popArr['cmbCurrCode'] = $object->cmbCurrCode;
                 }
             }
             $form_creator->popArr['rset'] = $empbassal->getAssEmpBasSal($getArr['id']);
             $form_creator->popArr['currAlllist'] = $currTyp->getAllCurrencyCodes();
             break;
         case 'LAN':
             $form_creator->formPath = '/templates/hrfunct/hremplan.php';
             $empinf = new EmpInfo();
             $emplan = new EmpLanguage();
             $laninfo = new LanguageInfo();
             $form_creator->popArr['empDet'] = $empinf->filterEmpMain($getArr['id']);
             $form_creator->popArr['lanlist'] = $lanlist = $laninfo->getLang();
             if (isset($getArr['editID1'])) {
                 $arr[0] = $getArr['id'];
                 $arr[1] = $getArr['editID1'];
                 $arr[2] = $getArr['editID2'];
                 $form_creator->popArr['editArr'] = $emplan->filterEmpLang($arr);
                 for ($c = 0; count($lanlist) > $c; $c++) {
                     if ($getArr['editID1'] == $lanlist[$c][0]) {
                         $ratSel = $lanlist[$c][2];
                     }
                 }
             } else {
                 if ($object != null) {
                     $form_creator->popArr['cmbLanCode'] = $object->cmbLanCode;
                     for ($c = 0; $lanlist && count($lanlist) > $c; $c++) {
                         if ($lanlist[$c][0] == $object->cmbLanCode) {
                             $ratSel = $lanlist[$c][2];
                         }
                     }
                     $form_creator->popArr['ratSel'] = $ratSel;
                 }
                 $form_creator->popArr['lanlist'] = $laninfo->getLang();
             }
             $form_creator->popArr['rsets'] = $emplan->getAssEmpLang($getArr['id']);
             break;
         case 'MEM':
             $form_creator->formPath = '/templates/hrfunct/hrempmemship.php';
             $empinf = new EmpInfo();
             $empmem = new EmpMembership();
             $memtype = new MembershipType();
             $memshipinfo = new MembershipInfo();
             $form_creator->popArr['empDet'] = $empinf->filterEmpMain($getArr['id']);
             $form_creator->popArr['typlist'] = $typlist = $memtype->getMembershipTypeCodes();
             if (isset($getArr['editID1'])) {
                 $arr[0] = $getArr['id'];
                 $arr[1] = $getArr['editID1'];
                 $arr[2] = $getArr['editID2'];
                 $form_creator->popArr['editArr'] = $edit = $empmem->filterEmpMembership($arr);
                 $form_creator->popArr['mship'] = $memshipinfo->getMembershipCodes($edit[0][2]);
             } else {
                 if ($object != null) {
                     $form_creator->popArr['cmbMemTypeCode'] = $object->cmbMemTypeCode;
                     $form_creator->popArr['mship'] = $memshipinfo->getUnAssMembershipCodes($getArr['id'], $object->cmbMemTypeCode);
                 }
                 $form_creator->popArr['typlist'] = $typlist = $memtype->getMembershipTypeCodes();
             }
             $form_creator->popArr['rset'] = $empmem->getAssEmpMembership($getArr['id']);
             $form_creator->popArr['mshipAll'] = $memshipinfo->getAllMembershipCodes();
             break;
         case 'EXC':
             $form_creator->formPath = '/templates/hrfunct/hrempextcur.php';
             $empinfo = new EmpInfo();
             $empextcur = new EmpExCur();
             $extracurr = new ExtraCurrActCat();
             $extrainfo = new ExtraCurActInfo();
             $form_creator->popArr['empdet'] = $empinfo->filterEmpMain($getArr['id']);
             $form_creator->popArr['catlist'] = $extracurr->getExCurCatCodes();
             if (isset($getArr['editID'])) {
                 $arr[0] = $getArr['id'];
                 $arr[1] = $getArr['editID'];
                 $form_creator->popArr['editArr'] = $edit = $empextcur->filterEmpExCur($arr);
                 $form_creator->popArr['typelist'] = $extrainfo->getExCurTypeCodes($edit[0][2]);
             } else {
                 $form_creator->popArr['lastrec'] = $empextcur->getLastRecord($getArr['id']);
                 if ($object != null) {
                     $form_creator->popArr['cmbExtCurCat'] = $catcode = $object->cmbExtCurCat;
                     $form_creator->popArr['typeunasslist'] = $extrainfo->getUnAssExCurTypeCodes($getArr['id'], $catcode);
                 }
             }
             $form_creator->popArr['rset'] = $empextcur->getAssExCur($getArr['id']);
             $form_creator->popArr['allcatlist'] = $extracurr->getExCurCatCodes();
             $form_creator->popArr['alltypelist'] = $extrainfo->getAllExtraCurActInfo();
             break;
         case 'EXP':
             $form_creator->formPath = '/templates/hrfunct/hrempwrkexp.php';
             $empinfo = new EmpInfo();
             $empworkex = new EmpWorkExp();
             $countryinfo = new CountryInfo();
             $proinfo = new ProvinceInfo();
             $form_creator->popArr['empDet'] = $empinfo->filterEmpMain($getArr['id']);
             if ($object != null) {
                 $form_creator->popArr['txtEmpExpCompany'] = $object->txtEmpExpCompany;
                 $form_creator->popArr['txtEmpExpToDat'] = $object->txtEmpExpToDat;
                 $form_creator->popArr['txtEmpExpDesOnLev'] = $object->txtEmpExpDesOnLev;
                 $form_creator->popArr['txtEmpExpYears'] = $object->txtEmpExpYears;
                 $form_creator->popArr['chkEmpExpWorkRelFlag'] = $object->chkEmpExpWorkRelFlag;
                 $form_creator->popArr['txtEmpExpMonths'] = $object->txtEmpExpMonths;
                 $form_creator->popArr['txtEmpExpAdd1'] = $object->txtEmpExpAdd1;
                 $form_creator->popArr['txtEmpExpAcc'] = $object->txtEmpExpAcc;
                 $form_creator->popArr['txtEmpExpAdd2'] = $object->txtEmpExpAdd2;
             }
             if (isset($getArr['editID'])) {
                 $arr[0] = $getArr['id'];
                 $arr[1] = $getArr['editID'];
                 $form_creator->popArr['editArr'] = $edit = $empworkex->filterEmpWorkExp($arr);
                 $form_creator->popArr['list'] = $countryinfo->getCountryCodes();
                 if ($object != null) {
                     $form_creator->popArr['txtEmpExpAdd2'] = $pli = $object->txtEmpExpAdd2;
                     $form_creator->popArr['txtEmpExpConPers'] = $object->txtEmpExpConPers;
                     $form_creator->popArr['txtEmpExpAdd3'] = $object->txtEmpExpAdd3;
                     $form_creator->popArr['txtEmpExpTelep'] = $object->txtEmpExpTelep;
                     $form_creator->popArr['txtEmpResLev'] = $object->txtEmpResLev;
                     $form_creator->popArr['txtEmpExpAchmnt'] = $object->txtEmpExpAchmnt;
                     $form_creator->popArr['txtEmpExpFromDat'] = $object->txtEmpExpFromDat;
                     $form_creator->popArr['txtEmpExpEmail'] = $object->txtEmpExpEmail;
                     $form_creator->popArr['plist'] = $empinfo->getProvinceCodes($pli);
                 } else {
                     $form_creator->popArr['plist1'] = $proinfo->getProvinceCodes($edit[0][4]);
                 }
             } else {
                 $form_creator->popArr['newID'] = $empworkex->getLastRecord($getArr['id']);
                 $form_creator->popArr['list'] = $countryinfo->getCountryCodes();
                 if ($object != null) {
                     $form_creator->popArr['txtEmpExpCompany'] = $object->txtEmpExpCompany;
                     $form_creator->popArr['txtEmpExpToDat'] = $object->txtEmpExpToDat;
                     $form_creator->popArr['txtEmpExpDesOnLev'] = $object->txtEmpExpDesOnLev;
                     $form_creator->popArr['txtEmpExpYears'] = $object->txtEmpExpYears;
                     $form_creator->popArr['chkEmpExpWorkRelFlag'] = $object->chkEmpExpWorkRelFlag;
                     $form_creator->popArr['txtEmpExpMonths'] = $object->txtEmpExpMonths;
                     $form_creator->popArr['txtEmpExpAdd1'] = $object->txtEmpExpAdd1;
                     $form_creator->popArr['txtEmpExpAcc'] = $object->txtEmpExpAcc;
                     $form_creator->popArr['txtEmpExpTelep'] = $object->txtEmpExpTelep;
                     $form_creator->popArr['txtEmpResLev'] = $object->txtEmpResLev;
                     $form_creator->popArr['txtEmpExpAchmnt'] = $object->txtEmpExpAchmnt;
                     $form_creator->popArr['txtEmpExpFromDat'] = $object->txtEmpExpFromDat;
                     $form_creator->popArr['txtEmpExpEmail'] = $object->txtEmpExpEmail;
                     $form_creator->popArr['txtEmpExpAdd2'] = $plis = $object->txtEmpExpAdd2;
                     $form_creator->popArr['txtEmpExpAdd3'] = $object->txtEmpExpAdd3;
                     $form_creator->popArr['txtEmpExpConPers'] = $object->txtEmpExpConPers;
                     $form_creator->popArr['plist2'] = $empinfo->getProvinceCodes($plis);
                 }
             }
             $form_creator->popArr['rset'] = $empworkex->getAssEmpWorkExp($getArr['id']);
             break;
         case 'QUA':
             $form_creator->formPath = '/templates/hrfunct/hrempqual.php';
             $empinfo = new EmpInfo();
             $empqual = new EmpQualification();
             $qualtyp = new QualificationType();
             $qual = new Qualifications();
             $form_creator->popArr['statlist'] = array('First Class', 'Second Class Upr.', 'Second Class Lwr.');
             $form_creator->popArr['empdet'] = $empinfo->filterEmpMain($getArr['id']);
             $form_creator->popArr['typlist'] = $qualtyp->getQualificationTypeCodes();
             if (isset($getArr['editID'])) {
                 $arr[0] = $getArr['editID'];
                 $arr[1] = $getArr['id'];
                 $form_creator->popArr['editArr'] = $empqual->filterEmpQual($arr);
                 $form_creator->popArr['quallist'] = $qual->getAllQualifications();
             } else {
                 if ($object != null) {
                     $form_creator->popArr['TypeCode'] = $object->TypeCode;
                     $form_creator->popArr['mship'] = $qual->getUnAssQualifications($getArr['id'], $object->TypeCode);
                 }
             }
             $form_creator->popArr['rset'] = $empqual->getAssEmpQual($getArr['id']);
             $form_creator->popArr['allquallist'] = $qual->getAllQualifications();
             break;
         case 'QAS':
             $form_creator->formPath = '/templates/hrfunct/hrempqualsub.php';
             $empinfo = new EmpInfo();
             $qual = new Qualifications();
             $empqualsub = new EmpQualSubject();
             $subinfo = new SubjectInfo();
             $form_creator->popArr['empdet'] = $empinfo->filterEmpMain($getArr['id']);
             $form_creator->popArr['qualDet'] = $qual->filterQualifications($getArr['QUA']);
             $form_creator->popArr['sublistAll'] = $subinfo->getSubjectCodes($getArr['QUA']);
             $form_creator->popArr['ratlist'] = $empqualsub->getRatGrds($getArr['QUA']);
             if (isset($getArr['editID'])) {
                 $arr[0] = $getArr['id'];
                 $arr[1] = $getArr['QUA'];
                 $arr[2] = $getArr['editID'];
                 $form_creator->popArr['editArr'] = $empqualsub->filterEmpQualSub($arr);
             } else {
                 $form_creator->popArr['sublistUnAss'] = $subinfo->getUnAssSubjects($getArr['id'], $getArr['QUA']);
             }
             $arr[0] = $getArr['id'];
             $arr[1] = $getArr['QUA'];
             $form_creator->popArr['sublistAss'] = $empqualsub->getAssEmpQualSub($arr);
             break;
         case 'CBN':
             $form_creator->formPath = '/templates/hrfunct/hrempcashben.php';
             $empinfo = new EmpInfo();
             $empcashben = new EmpCashBen();
             $cashben = new CashBen();
             $form_creator->popArr['empdet'] = $empinfo->filterEmpMain($getArr['id']);
             $form_creator->popArr['bfilter'] = array('Salary Point' => 1, 'Designation' => 2, 'Employee' => 3);
             $form_creator->popArr['benlist'] = $cashben->getBenCodes();
             if (isset($getArr['editID'])) {
                 $arr[0] = $getArr['id'];
                 $arr[1] = $getArr['editID'];
                 $form_creator->popArr['editArr'] = $empcashben->filterEmpCashBen($arr);
             }
             $form_creator->popArr['cashbenAss'] = $empcashben->getAssEmpCashBen($getArr['id']);
             $form_creator->popArr['cashbenUnAss'] = $empcashben->getUnAssEmpCashBen($getArr['id']);
             if (isset($getArr['OBEN'])) {
                 $form_creator->popArr['cashbenOther'] = $cashben->getOthEmpCashBen($getArr['id']);
             }
             break;
         case 'NBN':
             $form_creator->formPath = '/templates/hrfunct/hrempnoncashben.php';
             $empinfo = new EmpInfo();
             $empnoncashben = new EmpNonCashBen();
             $noncashben = new NonCashBen();
             $form_creator->popArr['empdet'] = $empinfo->filterEmpMain($getArr['id']);
             $form_creator->popArr['bfilter'] = array('Salary Point' => 1, 'Designation' => 2, 'Employee' => 3);
             $form_creator->popArr['benlist'] = $noncashben->getBenCodes();
             if (isset($getArr['editID'])) {
                 $arr[0] = $getArr['id'];
                 $arr[1] = $getArr['editID'];
                 $form_creator->popArr['editArr'] = $empnoncashben->filterEmpNonCashBen($arr);
             }
             $form_creator->popArr['cashbenAss'] = $empnoncashben->getAssEmpNonCashBen($getArr['id']);
             $form_creator->popArr['cashbenUnAss'] = $empnoncashben->getUnAssEmpNonCashBen($getArr['id']);
             if (isset($getArr['OBEN'])) {
                 $form_creator->popArr['cashbenOther'] = $noncashben->getOthEmpNonCashBen($getArr['id']);
             }
             break;
         case 'ESS':
         case 'EMP':
             $form_creator->formPath = '/templates/hrfunct/hrEmpMain.php';
             //hremp.php';
             $form_creator->popArr['arrMStat'] = array('Unmarried', 'Married', 'Divorced', 'Others');
             $empinfo = new EmpInfo();
             $pport = new EmpPassPort();
             $ddebit = new EmpDirectDebit();
             $dep = new EmpDependents();
             $econ = new EmpEmergencyCon();
             $chi = new EmpChildren();
             $attachment = new EmpAttach();
             $countryinfo = new CountryInfo();
             $porinfo = new ProvinceInfo();
             $nationinfo = new NationalityInfo();
             $location = new models_eimadmin_Location();
             $distric = new DistrictInfo();
             $jobtit = new JobTitle();
             $depen = new EmpDependents();
             $ethnicrace = new EthnicRace();
             $eeojobcat = new EEOJobCat();
             $emplan = new EmpLanguage();
             $laninfo = new LanguageInfo();
             $emplicen = new EmpLicenses();
             $licen = new Licenses();
             $empmem = new EmpMembership();
             $memtype = new MembershipType();
             $memshipinfo = new MembershipInfo();
             $emprepto = new EmpRepTo();
             $empskill = new EmpSkill();
             $skill = new Skills();
             $empworkex = new EmpWorkExp();
             $empeducation = new EmpEducation();
             $education = new Education();
             $empTax = new EmpTax();
             $form_creator->popArr['nation'] = $nationinfo->getNationCodes();
             $form_creator->popArr['loc'] = $location->getLocCodes();
             $form_creator->popArr['cntlist'] = $countryinfo->getCountryCodes();
             $form_creator->popArr['ethRace'] = $ethnicrace->getEthnicRaceCodes();
             $form_creator->popArr['eeojobcat'] = $eeojobcat->getEEOJobCatCodes();
             $form_creator->popArr['jobtit'] = $jobtit->getJobTit();
             $form_creator->popArr['hier'] = isset($res) ? $res : false;
             $form_creator->popArr['cntlist'] = $countrylist = $countryinfo->getCountryCodes();
             $form_creator->popArr['ppcntlist'] = $countrylist;
             $form_creator->popArr['customFieldList'] = CustomFields::getCustomFieldList();
             if ($getArr['capturemode'] == 'addmode') {
                 $form_creator->popArr['newID'] = $empinfo->getLastId();
                 if ($object != null) {
                     $form_creator->popArr['ctlist'] = $corptit->getCorpTitlesEmpInfo($object->cmbSalGrd);
                     $form_creator->popArr['deslist'] = $des->getDesEmpInfo($object->cmbCorpTit);
                     $form_creator->popArr['plist'] = $porinfo->getProvinceCodes($object->cmbTaxCountry);
                     $form_creator->popArr['resplist'] = $porinfo->getProvinceCodes($object->cmbPermCountry);
                     $form_creator->popArr['resdlist'] = $distric->getDistrictCodes($object->cmbPermProvince);
                     if (isset($postArr['cmbJobTitle'])) {
                         $form_creator->popArr['empstatlist'] = $view_controller->xajaxObjCall($postArr['cmbJobTitle'], 'JOB', 'allEmpStat');
                     }
                     $form_creator->popArr['ethRace'] = $ethnicrace->getEthnicRaceCodes($object->cmbEthnicRace);
                 }
             } elseif ($getArr['capturemode'] == 'updatemode') {
                 $form_creator->popArr['editTaxInfo'] = $empTax->getEmployeeTaxInfo($getArr['id']);
                 $form_creator->popArr['usStateList'] = $porinfo->getProvinceCodes('US');
                 $form_creator->popArr['empDDAss'] = $ddebit->getEmployeeDirectDebit($getArr['id']);
                 if (isset($getArr['DDSEQ'])) {
                     $form_creator->popArr['editDDForm'] = $ddebit->getDirectDebit($getArr['id'], $getArr['DDSEQ']);
                 }
                 $form_creator->popArr['editMainArr'] = $empinfo->filterEmpMain($getArr['id']);
                 $form_creator->popArr['editPersArr'] = $empinfo->filterEmpPers($getArr['id']);
                 $form_creator->popArr['editJobInfoArr'] = $empJobInfo = $empinfo->filterEmpJobInfo($getArr['id']);
                 $form_creator->popArr['editCustomInfoArr'] = $empCustomInfo = $empinfo->filterEmpCustomInfo($getArr['id']);
                 $view_controller = new ViewController();
                 $form_creator->popArr['empstatlist'] = $view_controller->xajaxObjCall($empJobInfo[0][2], 'JOB', 'allEmpStat');
                 $empJobTitle = $empJobInfo[0][2];
                 if (isset($postArr['cmbJobTitle'])) {
                     $form_creator->popArr['empstatlist'] = $view_controller->xajaxObjCall($postArr['cmbJobTitle'], 'JOB', 'allEmpStat');
                     $empJobTitle = $postArr['cmbJobTitle'];
                 }
                 if (CommonFunctions::isValidId($empJobTitle, 'JOB')) {
                     $empJobSpec = $view_controller->getJobSpecForJob($empJobTitle);
                 } else {
                     $empJobSpec = null;
                 }
                 $form_creator->popArr['jobSpec'] = $empJobSpec;
                 $jobTitleHistory = new JobTitleHistory();
                 $form_creator->popArr['jobTitleHistory'] = $jobTitleHistory->getHistory($getArr['id']);
                 $empDivisionHistory = new SubDivisionHistory();
                 $form_creator->popArr['subDivisionHistory'] = $empDivisionHistory->getHistory($getArr['id']);
                 $locationHistory = new LocationHistory();
                 $form_creator->popArr['locationHistory'] = $locationHistory->getHistory($getArr['id']);
                 $form_creator->popArr['assignedlocationList'] = EmpLocation::getEmpLocations($getArr['id']);
                 $form_creator->popArr['availablelocationList'] = EmpLocation::getUnassignedLocations($getArr['id']);
                 $form_creator->popArr['editPermResArr'] = $edit = $editPermRes = $empinfo->filterEmpContact($getArr['id']);
                 $form_creator->popArr['provlist'] = $porinfo->getProvinceCodes($edit[0][4]);
                 $form_creator->popArr['citylist'] = $distric->getDistrictCodes($edit[0][5]);
                 $form_creator->popArr['empPPAss'] = $pport->getAssEmpPP($getArr['id']);
                 $form_creator->popArr['empDepAss'] = $dep->getAssEmpDep($getArr['id']);
                 $form_creator->popArr['empECAss'] = $econ->getAssEmpEC($getArr['id']);
                 $form_creator->popArr['empChiAss'] = $chi->getAssEmpChi($getArr['id']);
                 $form_creator->popArr['empAttAss'] = $attachment->getAssEmpAtt($getArr['id']);
                 $form_creator->popArr['empDpAss'] = $depen->getAssEmpDep($getArr['id']);
                 $form_creator->popArr['newPPID'] = $pport->getLastRecord($getArr['id']);
                 if (isset($getArr['PPSEQ'])) {
                     $arr[0] = $getArr['id'];
                     $arr[1] = $getArr['PPSEQ'];
                     $form_creator->popArr['editPPForm'] = $pport->filterEmpPP($arr);
                 }
                 $form_creator->popArr['newECID'] = $econ->getLastRecord($getArr['id']);
                 if (isset($getArr['ECSEQ'])) {
                     $arr[0] = $getArr['id'];
                     $arr[1] = $getArr['ECSEQ'];
                     $form_creator->popArr['editECForm'] = $econ->filterEmpEC($arr);
                 }
                 $form_creator->popArr['newDepID'] = $dep->getLastRecord($getArr['id']);
                 if (isset($getArr['depSEQ'])) {
                     $arr[0] = $getArr['id'];
                     $arr[1] = $getArr['depSEQ'];
                     $form_creator->popArr['editDepForm'] = $dep->filterEmpDep($arr);
                 }
                 $form_creator->popArr['newCID'] = $chi->getLastRecord($getArr['id']);
                 if (isset($getArr['CHSEQ'])) {
                     $arr[0] = $getArr['id'];
                     $arr[1] = $getArr['CHSEQ'];
                     $form_creator->popArr['editChiForm'] = $chi->filterEmpChi($arr);
                 }
                 if (isset($getArr['ATTACH'])) {
                     $arr[0] = $getArr['id'];
                     $arr[1] = $getArr['ATTACH'];
                     $form_creator->popArr['editAttForm'] = $attachment->filterEmpAtt($arr);
                 }
                 $form_creator->popArr['lantype'] = array('Writing' => 1, 'Speaking' => 2, 'Reading' => 3);
                 $form_creator->popArr['grdcodes'] = array('Poor' => 1, 'Basic' => 2, 'Good' => 3, 'Mother Tongue' => 4);
                 $form_creator->popArr['lanlist'] = $lanlist = $laninfo->getLang();
                 if (isset($getArr['lanSEQ'])) {
                     $arr[0] = $getArr['id'];
                     $arr[1] = $getArr['lanSEQ'];
                     $arr[2] = $getArr['lanFLU'];
                     $form_creator->popArr['editLanArr'] = $emplan->filterEmpLang($arr);
                 }
                 $form_creator->popArr['rsetLang'] = $emplan->getAssEmpLang($getArr['id']);
                 $form_creator->popArr['allLicenlist'] = $licenlist = $licen->getLicensesCodes();
                 $form_creator->popArr['unassLicenlist'] = $licen->getUnAssLicensesCodes($getArr['id']);
                 if (isset($getArr['LIC'])) {
                     $arr[0] = $getArr['id'];
                     $arr[1] = $getArr['LIC'];
                     $form_creator->popArr['editLicenseArr'] = $emplicen->filterEmpLicenses($arr);
                 }
                 $form_creator->popArr['rsetLicense'] = $emplicen->getAssEmpLicenses($getArr['id']);
                 $form_creator->popArr['typlist'] = $typlist = $memtype->getMembershipTypeCodes();
                 if (isset($getArr['MEM'])) {
                     $arr[0] = $getArr['id'];
                     $arr[1] = $getArr['MEM'];
                     $arr[2] = $getArr['MTP'];
                     $form_creator->popArr['editMembershipArr'] = $edit = $empmem->filterEmpMembership($arr);
                     $form_creator->popArr['mship'] = $memshipinfo->getMembershipCodes($edit[0][2]);
                 }
                 $form_creator->popArr['rsetMembership'] = $empmem->getAssEmpMembership($getArr['id']);
                 $form_creator->popArr['mshipAll'] = $memshipinfo->getAllMembershipCodes();
                 $empbassal = new EmpBasSalary();
                 $currTyp = new CurrencyTypes();
                 $jobtit = new JobTitle();
                 $salgradelist = new SalaryGrades();
                 $form_creator->popArr['salgradelist'] = $salgradelist->getSalGrades(true);
                 $empdet = $empinfo->filterEmpJobInfo($getArr['id']);
                 $jt = $jobtit->filterJobTitles($empdet[0][2]);
                 $form_creator->popArr['payPeriodList'] = PayPeriod::getPayPeriodList();
                 $form_creator->popArr['salGrd'] = $salGrd = $empbassal->getEmpSalGrade($getArr['id']);
                 if (isset($getArr['PAY'])) {
                     $arr[0] = $getArr['id'];
                     $arr[1] = $getArr['PAY'];
                     $arr[2] = $getArr['CUR'];
                     $form_creator->popArr['editPaymentArr'] = $edit = $empbassal->filterEmpBasSal($arr);
                     $form_creator->popArr['salGrd'] = $salGrd = $edit[0][1];
                     $form_creator->popArr['currlist'] = $empbassal->getCurrCodes($edit[0][1]);
                 }
                 $form_creator->popArr['unAssCurrList'] = $empbassal->getUnAssCurrCodes($salGrd, $getArr['id']);
                 $form_creator->popArr['rsetPayment'] = $empbassal->getAssEmpBasSal($getArr['id']);
                 $form_creator->popArr['currAlllist'] = $currTyp->getAllCurrencyCodes();
                 $form_creator->popArr['suprset'] = $emprepto->getEmpSup($getArr['id']);
                 $form_creator->popArr['empname'] = $empinfo->getEmpInfo();
                 $form_creator->popArr['subrset'] = $emprepto->getEmpSub($getArr['id']);
                 if (isset($getArr['editIDSup'])) {
                     $arr[0] = $getArr['editIDSup'];
                     $arr[1] = $getArr['id'];
                     $arr[2] = $getArr['RepMethod'];
                     $form_creator->popArr['editIDSupInfo'] = $emprepto->filterEmpRepTo($arr);
                 }
                 if (isset($getArr['editIDSub'])) {
                     $arr[0] = $getArr['id'];
                     $arr[1] = $getArr['editIDSub'];
                     $arr[2] = $getArr['RepMethod'];
                     $form_creator->popArr['editIDSubInfo'] = $emprepto->filterEmpRepTo($arr);
                 }
                 $form_creator->popArr['allSkilllist'] = $skill->getSkillCodes();
                 $form_creator->popArr['uskilllist'] = $skill->getUnAssSkillCodes($getArr['id']);
                 if (isset($getArr['SKILL'])) {
                     $arr[0] = $getArr['id'];
                     $arr[1] = $getArr['SKILL'];
                     $form_creator->popArr['editSkillArr'] = $empskill->filterEmpSkill($arr);
                 }
                 $form_creator->popArr['rsetSkill'] = $empskill->getAssEmpSkill($getArr['id']);
                 $form_creator->popArr['newWrkExpID'] = $empworkex->getLastRecord($getArr['id']);
                 if (isset($getArr['WRKEXP'])) {
                     $arr[0] = $getArr['id'];
                     $arr[1] = $getArr['WRKEXP'];
                     $form_creator->popArr['editWrkExpArr'] = $edit = $empworkex->filterEmpWorkExp($arr);
                 }
                 $form_creator->popArr['rsetWrkExp'] = $empworkex->getAssEmpWorkExp($getArr['id']);
                 $form_creator->popArr['allEduCodes'] = $education->getListofEducation(0, '', 0);
                 $form_creator->popArr['unAssEduCodes'] = $empeducation->getUnAssEduCodes($getArr['id']);
                 if (isset($getArr['EDU'])) {
                     $arr[0] = $getArr['id'];
                     $arr[1] = $getArr['EDU'];
                     $form_creator->popArr['editEducationArr'] = $empeducation->filterEmpEducation($arr);
                 }
                 $form_creator->popArr['rsetEducation'] = $empeducation->getAssEmpEducation($getArr['id']);
                 if ($object != null) {
                     $form_creator->popArr['ctlist'] = $corptit->getCorpTitlesEmpInfo($object->cmbSalGrd);
                     $form_creator->popArr['deslist'] = $des->getDesEmpInfo($object->cmbCorpTit);
                     $form_creator->popArr['resplist'] = $porinfo->getProvinceCodes($object->cmbPermCountry);
                     $form_creator->popArr['resdlist'] = $distric->getDistrictCodes($object->cmbPermProvince);
                     $form_creator->popArr['brchlist'] = $brch->getUnAssBranchCodes($getArr['id'], $object->cmbBank);
                     $form_creator->popArr['ctlist'] = $empinfo->getCorpTitles($object->cmbSalGrd);
                     $form_creator->popArr['deslist'] = $empinfo->getDes($object->cmbCorpTit);
                     $form_creator->popArr['resplist'] = $empinfo->getProvinceCodes($object->cmbPermCountry);
                     $form_creator->popArr['resdlist'] = $empinfo->getDistrictCodes($object->cmbPermProvince);
                     $form_creator->popArr['brchlist'] = $brch->getUnAssBranchCodes($getArr['id'], $object->cmbBank);
                 } else {
                     $form_creator->popArr['resplist'] = $porinfo->getProvinceCodes($editPermRes[0][10]);
                     $form_creator->popArr['resdlist'] = $distric->getDistrictCodes($editPermRes[0][11]);
                 }
                 $empconext = new EmpConExt();
                 $form_creator->popArr['newConExtID'] = $empconext->getLastRecord($getArr['id']);
                 if (isset($getArr['CONEXT'])) {
                     $arr[0] = $getArr['id'];
                     $arr[1] = $getArr['CONEXT'];
                     $form_creator->popArr['editConExtArr'] = $empconext->filterConExt($arr);
                 }
                 $form_creator->popArr['rsetConExt'] = $empconext->getAssConExt($getArr['id']);
             }
             break;
         case 'REP':
             $form_creator->formPath = '/templates/hrfunct/hremprepto.php';
             $empinfo = new EmpInfo();
             $emprepto = new EmpRepTo();
             $form_creator->popArr['empdet'] = $empinfo->filterEmpMain($getArr['id']);
             $form_creator->popArr['suprset'] = $emprepto->getEmpSup($getArr['id']);
             $form_creator->popArr['empname'] = $empinfo->getEmpInfo();
             $form_creator->popArr['subrset'] = $emprepto->getEmpSub($getArr['id']);
             if (isset($getArr['editIDSup'])) {
                 $arr[0] = $getArr['editIDSup'];
                 $arr[1] = $getArr['id'];
                 $arr[2] = $getArr['repmethod'];
                 $form_creator->popArr['editIDSupInfo'] = $emprepto->filterEmpRepTo($arr);
             }
             if (isset($getArr['editIDSub'])) {
                 $arr[0] = $getArr['id'];
                 $arr[1] = $getArr['editIDSub'];
                 $arr[2] = $getArr['repmethod'];
                 $form_creator->popArr['editIDSubInfo'] = $emprepto->filterEmpRepTo($arr);
             }
             break;
         case 'SKI':
             $form_creator->formPath = '/templates/hrfunct/hrempskill.php';
             $empinf = new EmpInfo();
             $empskill = new EmpSkill();
             $skill = new Skills();
             $form_creator->popArr['empDet'] = $empinf->filterEmpMain($getArr['id']);
             $form_creator->popArr['allSkilllist'] = $skill->getSkillCodes();
             if (isset($getArr['editID1'])) {
                 $arr[0] = $getArr['id'];
                 $arr[1] = $getArr['editID1'];
                 $arr[2] = $getArr['editID2'];
                 $form_creator->popArr['editArr'] = $empskill->filterEmpSkill($arr);
             } else {
                 $form_creator->popArr['uskilllist'] = $skill->getUnAssSkillCodes($getArr['id']);
             }
             $form_creator->popArr['rsets'] = $empskill->getAssEmpSkill($getArr['id']);
             break;
         case 'LIC':
             $form_creator->formPath = '/templates/hrfunct/hremplicenses.php';
             $empinf = new EmpInfo();
             $emplicen = new EmpLicenses();
             $licen = new Licenses();
             $form_creator->popArr['empDet'] = $empinf->filterEmpMain($getArr['id']);
             $form_creator->popArr['allLicenlist'] = $licenlist = $licen->getLicensesCodes();
             $form_creator->popArr['unassLicenlist'] = $licen->getUnAssLicensesCodes($getArr['id']);
             if (isset($getArr['editID1'])) {
                 $arr[0] = $getArr['id'];
                 $arr[1] = $getArr['editID1'];
                 $arr[2] = $getArr['editID2'];
                 $form_creator->popArr['editArr'] = $emplicen->filterEmpLicenses($arr);
             }
             $form_creator->popArr['rsets'] = $emplicen->getAssEmpLicenses($getArr['id']);
             break;
     }
     $form_creator->display();
 }
 function reDirect($getArr, $object = null)
 {
     $form_creator = new FormCreator($getArr);
     switch ($getArr['mtcode']) {
         case 'BUG':
             $form_creator->formPath = '/templates/maintenance/bugs.php';
             $bug = new Bugs();
             $form_creator->popArr['module'] = $bug->getAlias('module');
             break;
         case 'DVR':
             $form_creator->formPath = '/templates/maintenance/dbversions.php';
             $dbvers = new DbVersions();
             if ($getArr['capturemode'] == 'addmode') {
                 $form_creator->popArr['newID'] = $dbvers->getLastRecord();
             } elseif ($getArr['capturemode'] == 'updatemode') {
                 $form_creator->popArr['editArr'] = $dbvers->filterdbVersions($getArr['id']);
             }
             break;
         case 'MOD':
             $form_creator->formPath = '/templates/maintenance/modules.php';
             $modls = new Modules();
             if ($getArr['capturemode'] == 'addmode') {
                 $form_creator->popArr['version'] = $modls->getVersionList();
             } elseif ($getArr['capturemode'] == 'updatemode') {
                 $form_creator->popArr['editArr'] = $modls->filterModules($getArr['id']);
                 $form_creator->popArr['version'] = $modls->getVersionList();
             }
             break;
         case 'USG':
             $form_creator->formPath = '/templates/maintenance/usergroups.php';
             $usrgrp = new UserGroups();
             if ($getArr['capturemode'] == 'updatemode') {
                 $form_creator->popArr['editArr'] = $usrgrp->filterUserGroups($getArr['id']);
             }
             break;
         case 'VER':
             $form_creator->formPath = '/templates/maintenance/versions.php';
             $vers = new Versions();
             //$form_creator ->popArr['date'] = $vers->getDate();
             if ($getArr['capturemode'] == 'addmode') {
                 $form_creator->popArr['newID'] = $vers->getLastRecord();
                 $form_creator->popArr['db'] = $vers->getdbVersionList();
                 $form_creator->popArr['file'] = $vers->getFileVersionList();
             } elseif ($getArr['capturemode'] == 'updatemode') {
                 $form_creator->popArr['editArr'] = $vers->filterVersions($getArr['id']);
                 $form_creator->popArr['db'] = $vers->getdbVersionList();
                 $form_creator->popArr['file'] = $vers->getFileVersionList();
             }
             break;
         case 'FVR':
             $form_creator->formPath = '/templates/maintenance/fileversions.php';
             $filever = new fileVersions();
             if ($getArr['capturemode'] == 'addmode') {
                 $form_creator->popArr['newID'] = $filever->getLastRecord();
                 $form_creator->popArr['modlist'] = $filever->getModuleList();
             } elseif ($getArr['capturemode'] == 'updatemode') {
                 $form_creator->popArr['editArr'] = $filever->filterfileVersions($getArr['id']);
                 $form_creator->popArr['modlist'] = $filever->getModuleList();
             }
             break;
         case 'USR':
             $form_creator->formPath = '/templates/maintenance/users.php';
             $user = new Users();
             if ($getArr['capturemode'] == 'addmode') {
                 $form_creator->popArr['emplist'] = $user->getEmployeeCodes();
                 $form_creator->popArr['uglist'] = $user->getUserGroupCodes();
             } elseif ($getArr['capturemode'] == 'updatemode') {
                 $form_creator->popArr['editArr'] = $user->filterUsers($getArr['id']);
                 $form_creator->popArr['emplist'] = $user->getEmployeeCodes();
                 $form_creator->popArr['uglist'] = $user->getUserGroupCodes();
                 //$form_creator ->popArr['editArr'] = $user->filterChangeUsers($getArr['id']);
             }
             break;
         case 'CPW':
             $form_creator->formPath = '/templates/maintenance/changeusers.php';
             $chuser = new Users();
             if ($getArr['capturemode'] == 'updatemode') {
                 $form_creator->popArr['emplist'] = $chuser->getEmployeeCodes();
                 //$form_creator ->popArr['uglist'] = $chuser->getUserGroupCodes();
                 $form_creator->popArr['editArr'] = $chuser->filterChangeUsers($getArr['id']);
             }
             break;
         case 'UGR':
             $form_creator->formPath = '/templates/maintenance/AdminMenu.php';
             $urights = new Rights();
             $usergroup = new UserGroups();
             $form_creator->popArr['ugDet'] = $usergroup->filterUserGroups($getArr['id']);
             $form_creator->popArr['modlist'] = $urights->getAllModules();
             if (isset($getArr['editID'])) {
                 $arr[0] = $getArr['id'];
                 $arr[1] = $getArr['editID'];
                 $form_creator->popArr['editArr'] = $urights->filterRights($arr);
             } else {
                 $form_creator->popArr['modlistUnAss'] = $urights->getModuleCodes($getArr['id']);
             }
             $form_creator->popArr['modlistAss'] = $urights->getAssRights($getArr['id']);
             break;
     }
     $form_creator->display();
 }
 function reDirect($getArr, $postArr, $object = null)
 {
     $form_creator = new FormCreator($getArr, $postArr);
     if ($_SESSION['isAdmin'] !== 'Yes') {
         trigger_error("Unauthorized access", E_USER_NOTICE);
     }
     switch ($getArr['repcode']) {
         case 'EMPDEF':
             //if ()
             $form_creator->formPath = '/templates/report/emprepinfo.php';
             $form_creator->popArr['arrAgeSim'] = array('Less Than' => '>', 'Greater Than' => '<', 'Range' => 'range');
             //$form_creator->popArr['arrEmpType']= array( 'Permanent', 'Expatriate', 'Contract', 'Temporary' , 'Others');
             $form_creator->popArr['arrSerPer'] = array('Less Than' => '>', 'Greater Than' => '<', 'Range' => 'range');
             $form_creator->popArr['arrJoiDat'] = array('Joined After' => '>', 'Joined Before' => '<', 'Joined In Between' => 'range');
             $report = new EmpReport();
             $empinfo = new EmpInfo();
             $edu = new Education();
             $jobtit = new JobTitle();
             $salgrd = new SalaryGrades();
             $empstat = new EmploymentStatus();
             $langObj = new LanguageInfo();
             $skillObj = new Skills();
             $form_creator->popArr['grdlist'] = $salgrd->getSalGrdCodes();
             $form_creator->popArr['edulist'] = $edu->getAllEducation();
             $form_creator->popArr['deslist'] = $jobtit->getJobTit();
             $form_creator->popArr['arrEmpType'] = $empstat->getEmpStat();
             $form_creator->popArr['languageList'] = $langObj->getLang();
             $form_creator->popArr['skillList'] = $skillObj->getSkillCodes();
             if ($getArr['capturemode'] == 'updatemode') {
                 $form_creator->popArr['editArr'] = $edit = $report->filterReport($getArr['id']);
                 $criteria_value = explode('|', $edit[0][2]);
                 for ($c = 0; count($criteria_value) > $c; $c++) {
                     $crit_data = explode("=", $criteria_value[$c]);
                     $criteriaChkBox[$c] = $crit_data[0];
                     for ($d = 1; count($crit_data) > $d; $d++) {
                         $crit_form_data[$crit_data[0]][$d - 1] = $crit_data[$d];
                     }
                 }
                 $form_creator->popArr['editCriteriaChk'] = $criteriaChkBox;
                 $form_creator->popArr['editCriteriaData'] = $crit_form_data;
                 $form_creator->popArr['fieldList'] = explode('|', $edit[0][3]);
             }
             if ($object != null) {
                 $form_creator->popArr['empqual'] = $empqual->getQualifications($object->TypeCode);
             }
             break;
         case 'EMPVIEW':
             $report = new EmpReport();
             $repgen = new ReportGenerator();
             $edit = $report->filterReport($getArr['id']);
             $repgen->reportId = $edit[0][0];
             /* TODO: The following actions should be moved to model class */
             $criteria = explode('|', $edit[0][2]);
             $criteriaCount = count($criteria);
             for ($c = 0; $criteriaCount > $c; $c++) {
                 $crit_value = explode("=", $criteria[$c]);
                 $repgen->setCriteria($crit_value[0], '');
                 $criteriaValueCount = count($crit_value);
                 for ($d = 1; $criteriaValueCount > $d; $d++) {
                     if ($d == count($crit_value) - 1) {
                         $repgen->setCriteria($crit_value[0], $crit_value[$d], true);
                     } else {
                         $repgen->setCriteria($crit_value[0], $crit_value[$d] . "|", true);
                     }
                 }
             }
             $field = explode('|', $edit[0][3]);
             $fieldCount = count($field);
             for ($c = 0; $fieldCount > $c; $c++) {
                 $repgen->setField($field[$c], 1);
             }
             $sqlQ = $repgen->buildReportQuery();
             $arrayDispList = $repgen->buildDisplayList($sqlQ);
             $employee = array();
             if (is_array($arrayDispList)) {
                 $employee = current($arrayDispList);
             }
             $columns = count($employee);
             $rows = count($arrayDispList);
             $objs['reportName'] = $edit[0][1];
             $objs['arrayDispList'] = $arrayDispList;
             $objs['headerNames'] = $repgen->getHeaders();
             $objs['replacements'] = array('directReportingMode' => EmpRepTo::REPORTING_MODE_DIRECT, 'indirectReportingMode' => EmpRepTo::REPORTING_MODE_INDIRECT);
             $templatePath = '/templates/report/report.php';
             $template = new TemplateMerger($objs, $templatePath, null, null);
             $template->display();
             return;
             break;
         case 'RUG':
             $form_creator->formPath = '/templates/report/repusg.php';
             $report = new EmpReport();
             $emprepgroup = new EmpRepUserGroup();
             $form_creator->popArr['report'] = $report->filterReport($getArr['id']);
             $form_creator->popArr['usgAll'] = $emprepgroup->getAllUserGroups();
             $form_creator->popArr['repUsgAss'] = $emprepgroup->getAssignedUserGroup($getArr['id']);
             $form_creator->popArr['usgUnAss'] = $emprepgroup->getUnAssUserGroups($getArr['id']);
             break;
     }
     $form_creator->display();
 }
Example #6
0
 function reDirect($getArr, $postArr, $object = null)
 {
     $form_creator = new FormCreator($getArr, $postArr);
     if ($_SESSION['isAdmin'] !== 'Yes') {
         trigger_error("Unauthorized access", E_USER_NOTICE);
     }
     switch ($getArr['repcode']) {
         case 'EMPDEF':
             //if ()
             $form_creator->formPath = '/templates/report/emprepinfo.php';
             $form_creator->popArr['arrAgeSim'] = array('Less Than' => '>', 'Greater Than' => '<', 'Range' => 'range');
             //$form_creator->popArr['arrEmpType']= array( 'Permanent', 'Expatriate', 'Contract', 'Temporary' , 'Others');
             $form_creator->popArr['arrSerPer'] = array('Less Than' => '>', 'Greater Than' => '<', 'Range' => 'range');
             $form_creator->popArr['arrJoiDat'] = array('Joined After' => '>', 'Joined Before' => '<', 'Joined In Between' => 'range');
             $report = new EmpReport();
             $empinfo = new EmpInfo();
             $edu = new Education();
             $jobtit = new JobTitle();
             $salgrd = new SalaryGrades();
             $empstat = new EmploymentStatus();
             $langObj = new LanguageInfo();
             $skillObj = new Skills();
             $form_creator->popArr['grdlist'] = $salgrd->getSalGrdCodes();
             $form_creator->popArr['edulist'] = $edu->getAllEducation();
             $form_creator->popArr['deslist'] = $jobtit->getJobTit();
             $form_creator->popArr['arrEmpType'] = $empstat->getEmpStat();
             $form_creator->popArr['languageList'] = $langObj->getLang();
             $form_creator->popArr['skillList'] = $skillObj->getSkillCodes();
             if ($getArr['capturemode'] == 'updatemode') {
                 $form_creator->popArr['editArr'] = $edit = $report->filterReport($getArr['id']);
                 $criteria_value = explode('|', $edit[0][2]);
                 for ($c = 0; count($criteria_value) > $c; $c++) {
                     $crit_data = explode("=", $criteria_value[$c]);
                     $criteriaChkBox[$c] = $crit_data[0];
                     for ($d = 1; count($crit_data) > $d; $d++) {
                         $crit_form_data[$crit_data[0]][$d - 1] = $crit_data[$d];
                     }
                 }
                 $form_creator->popArr['editCriteriaChk'] = $criteriaChkBox;
                 $form_creator->popArr['editCriteriaData'] = $crit_form_data;
                 $form_creator->popArr['fieldList'] = explode('|', $edit[0][3]);
             }
             if ($object != null) {
                 $form_creator->popArr['empqual'] = $empqual->getQualifications($object->TypeCode);
             }
             break;
         case 'EMPVIEW':
             $report = new EmpReport();
             $repgen = new ReportGenerator();
             $form_creator->popArr['editArr'] = $edit = $report->filterReport($getArr['id']);
             $repgen->repID = $edit[0][0];
             $repgen->repName = $edit[0][1];
             $criteria = explode('|', $edit[0][2]);
             for ($c = 0; count($criteria) > $c; $c++) {
                 $crit_value = explode("=", $criteria[$c]);
                 $repgen->criteria[$crit_value[0]] = '';
                 for ($d = 1; count($crit_value) > $d; $d++) {
                     if ($d == count($crit_value) - 1) {
                         $repgen->criteria[$crit_value[0]] .= $crit_value[$d];
                     } else {
                         $repgen->criteria[$crit_value[0]] .= $crit_value[$d] . "|";
                     }
                 }
             }
             $field = explode('|', $edit[0][3]);
             $empNoField = false;
             for ($c = 0; count($field) > $c; $c++) {
                 $repgen->field[$field[$c]] = 1;
                 if ($field[$c] == 'EMPNO') {
                     $empNoField = true;
                 }
             }
             $repgen->field['EMPNO'] = 1;
             $sqlQ = $repgen->reportQueryBuilder();
             //echo $sqlQ."<br/>";
             $dbConnection = new DMLFunctions();
             $message2 = $dbConnection->executeQuery($sqlQ);
             $i = 0;
             while ($line = mysql_fetch_array($message2, MYSQL_NUM)) {
                 for ($c = 0; count($repgen->field) * 2 > $c; $c += 2) {
                     $arrayDispList[$line[0]][$c / 2][$line[$c]] = $line[$c + 1];
                 }
                 $i++;
             }
             //print_r($arrayDispList);
             if (!isset($arrayDispList)) {
                 $arrayDispList = null;
             }
             $repgen->reportDisplay($arrayDispList, $empNoField);
             return;
             break;
         case 'RUG':
             $form_creator->formPath = '/templates/report/repusg.php';
             $emprepgroup = new EmpRepUserGroup();
             $form_creator->popArr['repDet'] = $emprepgroup->getReportInfo();
             $form_creator->popArr['usgAll'] = $emprepgroup->getAllUserGroups();
             $form_creator->popArr['repUsgAss'] = $emprepgroup->getAssignedUserGroup($getArr['id']);
             $form_creator->popArr['usgUnAss'] = $emprepgroup->getUnAssUserGroups($getArr['id']);
             break;
     }
     $form_creator->display();
 }