示例#1
0
 function delEmpFormData($getArr, $postArr)
 {
     if (isset($postArr['econtactSTAT']) && $postArr['econtactSTAT'] == 'DEL') {
         $econ = new EmpEmergencyCon();
         $arr[1] = $postArr['chkecontactdel'];
         for ($c = 0; count($arr[1]) > $c; $c++) {
             if ($arr[1][$c] != NULL) {
                 $arr[0][$c] = $getArr['id'];
             }
         }
         $econ->delEmpEC($arr);
     }
     if (isset($postArr['passportSTAT']) && $postArr['passportSTAT'] == 'DEL') {
         $passport = new EmpPassPort();
         $arr[1] = $postArr['chkpassportdel'];
         for ($c = 0; count($arr[1]) > $c; $c++) {
             if ($arr[1][$c] != NULL) {
                 $arr[0][$c] = $getArr['id'];
             }
         }
         $passport->delEmpPP($arr);
     }
     if (isset($postArr['directDebitSTAT']) && $postArr['directDebitSTAT'] == 'DEL') {
         $directDebit = new EmpDirectDebit();
         $directDebit->delete($getArr['id'], $postArr['chkdebitdel']);
     }
     if (isset($postArr['wrkexpSTAT']) && $postArr['wrkexpSTAT'] == 'DEL') {
         $empwrkexp = new EmpWorkExp();
         $arr[1] = $postArr['chkwrkexpdel'];
         for ($c = 0; count($arr[1]) > $c; $c++) {
             if ($arr[1][$c] != NULL) {
                 $arr[0][$c] = $getArr['id'];
             }
         }
         $empwrkexp->delEmpWorkExp($arr);
     }
     if (isset($postArr['licenseSTAT']) && $postArr['licenseSTAT'] == 'DEL') {
         $license = new EmpLicenses();
         $arr[1] = $postArr['chklicdel'];
         for ($c = 0; count($arr[1]) > $c; $c++) {
             if ($arr[1][$c] != NULL) {
                 $arr[0][$c] = $getArr['id'];
             }
         }
         $license->delEmpLicenses($arr);
     }
     if (isset($postArr['skillSTAT']) && $postArr['skillSTAT'] == 'DEL') {
         $empskill = new EmpSkill();
         $arr[1] = $postArr['chkskilldel'];
         for ($c = 0; count($arr[1]) > $c; $c++) {
             if ($arr[1][$c] != NULL) {
                 $arr[0][$c] = $getArr['id'];
             }
         }
         $empskill->delEmpSkill($arr);
     }
     if (isset($postArr['educationSTAT']) && $postArr['educationSTAT'] == 'DEL') {
         $empeducation = new EmpEducation();
         $arr[1] = $postArr['chkedudel'];
         for ($c = 0; count($arr[1]) > $c; $c++) {
             if ($arr[1][$c] != NULL) {
                 $arr[0][$c] = $getArr['id'];
             }
         }
         $empeducation->delEmpEducation($arr);
     }
     if (isset($postArr['membershipSTAT']) && $postArr['membershipSTAT'] == 'DEL') {
         $empmem = new EmpMembership();
         $arr = $postArr['chkmemdel'];
         for ($c = 0; count($arr) > $c; $c++) {
             $frg = explode("|", $arr[$c]);
             $arrpass[1][$c] = $frg[0];
             $arrpass[2][$c] = $frg[1];
         }
         for ($c = 0; count($arr) > $c; $c++) {
             if ($arr[$c] != NULL) {
                 $arrpass[0][$c] = $getArr['id'];
             }
         }
         $empmem->delEmpMembership($arrpass);
     }
     if (isset($postArr['paymentSTAT']) && $postArr['paymentSTAT'] == 'DEL') {
         $emppayment = new EmpBasSalary();
         $arr = $postArr['chkpaydel'];
         for ($c = 0; count($arr) > $c; $c++) {
             $frg = explode("|", $arr[$c]);
             $arrpass[1][$c] = $frg[0];
             $arrpass[2][$c] = $frg[1];
         }
         for ($c = 0; count($arr) > $c; $c++) {
             if ($arr[$c] != NULL) {
                 $arrpass[0][$c] = $getArr['id'];
             }
         }
         $emppayment->delEmpBasSal($arrpass);
     }
     if (isset($postArr['reporttoSTAT']) && $postArr['reporttoSTAT'] == 'DEL') {
         $emprepto = new EmpRepTo();
         if ($postArr['delSupSub'] == 'sup') {
             $arr = $postArr['chksupdel'];
             for ($c = 0; count($arr) > $c; $c++) {
                 $frg = explode("|", $arr[$c]);
                 $arrpass[0][$c] = $frg[0];
                 $arrpass[2][$c] = $frg[1];
             }
             for ($c = 0; count($arr) > $c; $c++) {
                 if ($arr[$c] != NULL) {
                     $arrpass[1][$c] = $getArr['id'];
                 }
             }
         } elseif ($postArr['delSupSub'] == 'sub') {
             $arr = $postArr['chksubdel'];
             for ($c = 0; count($arr) > $c; $c++) {
                 $frg = explode("|", $arr[$c]);
                 $arrpass[1][$c] = $frg[0];
                 $arrpass[2][$c] = $frg[1];
             }
             for ($c = 0; count($arr) > $c; $c++) {
                 if ($arr[$c] != NULL) {
                     $arrpass[0][$c] = $getArr['id'];
                 }
             }
         }
         $emprepto->delEmpRepTo($arrpass);
     }
     if (isset($postArr['langSTAT']) && $postArr['langSTAT'] == 'DEL') {
         $emplan = new EmpLanguage();
         $arr = $postArr['chklangdel'];
         for ($c = 0; count($arr) > $c; $c++) {
             $frg = explode("|", $arr[$c]);
             $arrpass[1][$c] = $frg[0];
             $arrpass[2][$c] = $frg[1];
         }
         for ($c = 0; count($arr) > $c; $c++) {
             if ($arr[$c] != NULL) {
                 $arrpass[0][$c] = $getArr['id'];
             }
         }
         $emplan->delEmpLang($arrpass);
     }
     if (isset($postArr['dependentSTAT']) && $postArr['dependentSTAT'] == 'DEL') {
         $dep = new EmpDependents();
         $arr[1] = $postArr['chkdepdel'];
         for ($c = 0; count($arr[1]) > $c; $c++) {
             if ($arr[1][$c] != NULL) {
                 $arr[0][$c] = $getArr['id'];
             }
         }
         $dep->delEmpDep($arr);
     }
     if (isset($postArr['conextSTAT']) && $postArr['conextSTAT'] == 'DEL') {
         $conext = new EmpConExt();
         $arr[1] = $postArr['chkconextdel'];
         for ($c = 0; count($arr[1]) > $c; $c++) {
             if ($arr[1][$c] != NULL) {
                 $arr[0][$c] = $getArr['id'];
             }
         }
         $conext->delConExt($arr);
     }
     if (isset($postArr['empjobHistorySTAT']) && $postArr['empjobHistorySTAT'] == 'DEL') {
         // Job title history
         if (isset($postArr['chkjobtitHistory'])) {
             $jobTitleHistory = new JobTitleHistory();
             $jobTitleHistory->delete($postArr['chkjobtitHistory']);
         }
         // Sub division history
         if (isset($postArr['chksubdivisionHistory'])) {
             $empDivisionHistory = new SubDivisionHistory();
             $empDivisionHistory->delete($postArr['chksubdivisionHistory']);
         }
         // Location history
         if (isset($postArr['chklocationHistory'])) {
             $locationHistory = new LocationHistory();
             $locationHistory->delete($postArr['chklocationHistory']);
         }
     }
     if (isset($postArr['childrenSTAT']) && $postArr['childrenSTAT'] == 'DEL') {
         $chi = new EmpChildren();
         $arr[1] = $postArr['chkchidel'];
         for ($c = 0; count($arr[1]) > $c; $c++) {
             if ($arr[1][$c] != NULL) {
                 $arr[0][$c] = $getArr['id'];
             }
         }
         $chi->delEmpChi($arr);
     }
     if (isset($postArr['brchSTAT']) && $postArr['brchSTAT'] == 'DEL') {
         $bankacc = new EmpBank();
         $arr[1] = $postArr['chkbrchdel'];
         for ($c = 0; count($arr[1]) > $c; $c++) {
             if ($arr[1][$c] != NULL) {
                 $arr[0][$c] = $getArr['id'];
             }
         }
         $bankacc->delEmpBank($arr);
     }
     if (isset($postArr['attSTAT']) && $postArr['attSTAT'] == 'DEL') {
         $attachment = new EmpAttach();
         $arr[1] = $postArr['chkattdel'];
         for ($c = 0; count($arr[1]) > $c; $c++) {
             if ($arr[1][$c] != NULL) {
                 $arr[0][$c] = $getArr['id'];
             }
         }
         $attachment->delEmpAtt($arr);
     }
 }