ok

Mini Shell

Direktori : /home2/selectio/www/wedding-info-new/admin/api/employee/
Upload File :
Current File : /home2/selectio/www/wedding-info-new/admin/api/employee/employee_new.php

<?php
session_start();
/*include "../../config/config.php";*/
include "../../api/config/config.php";
error_log('Form Starts stephen ....');

$date = date('Y-m-d h:i:s a', time());

if (1==1) {
    error_log("Property Verification Form Running");
//69
$position = $_POST['position'] ?? null;
$addr = $_POST['addr'] ?? null;
$site_loc = $_POST['site_loc'] ?? null;
$dept = $_POST['dept'] ?? null;
$desig = $_POST['desig'] ?? null;
$phn = $_POST['phn'] ?? null;
$doj = $_POST['doj'] ?? null;
$fname = $_POST['fname'] ?? null;
$mname = $_POST['mname'] ?? null;
$lname = $_POST['lname'] ?? null;
$dob = $_POST['dob'] ?? null;
$age = $_POST['age'] ?? null;
$sex = $_POST['sex'] ?? null;
$blood = $_POST['blood'] ?? null;
$marital_status = $_POST['marital_status'] ?? null;
$wed_date = $_POST['wed_date'] ?? null;
$lic = $_POST['lic'] ?? null;
$lic_exp = $_POST['lic_exp'] ?? null;
$pan = $_POST['pan'] ?? null;
$nationality = $_POST['nationality'] ?? null;
$relg = $_POST['relg'] ?? null;
$adh_no = $_POST['adh_no'] ?? null;
$Off_email = $_POST['Off_email'] ?? null;
$per_email = $_POST['per_email'] ?? null;
$bank_name = $_POST['bank_name'] ?? null;
$bank_ac_no = $_POST['bank_ac_no'] ?? null;
// $bank_ac_no = $_POST['bank_ac_no'] ?? null;
$fa_name = $_POST['fa_name'] ?? null;
$fa_occ = $_POST['fa_occ'] ?? null;
$fa_dob = $_POST['fa_dob'] ?? null;
$fa_phn = $_POST['fa_phn'] ?? null;
$mo_name = $_POST['mo_name'] ?? null;
$mo_occ = $_POST['mo_occ'] ?? null;
$mo_dob = $_POST['mo_dob'] ?? null;
$mo_phn = $_POST['mo_phn'] ?? null;
$sib1_name = $_POST['sib1_name'] ?? null;
$sib1_occ = $_POST['sib1_occ'] ?? null;
$sib1_dob = $_POST['sib1_dob'] ?? null;
$sib1_phn = $_POST['sib1_phn'] ?? null;
$sib2_name = $_POST['sib2_name'] ?? null;
$sib2_occ = $_POST['sib2_occ'] ?? null;
$sib2_dob = $_POST['sib2_dob'] ?? null;
$sib2_phn = $_POST['sib2_phn'] ?? null;
$sib3_name = $_POST['sib3_name'] ?? null;
$sib3_occ = $_POST['sib3_occ'] ?? null;
$sib3_dob = $_POST['sib3_dob'] ?? null;
$sib3_phn = $_POST['sib3_phn'] ?? null;
$sib4_name = $_POST['sib4_name'] ?? null;
$sib4_occ = $_POST['sib4_occ'] ?? null;
$sib4_dob = $_POST['sib4_dob'] ?? null;
$sib4_phn = $_POST['sib4_phn'] ?? null;
$chld1_name = $_POST['chld1_name'] ?? null;
$chld1_age = $_POST['chld1_age'] ?? null;
$chld1_dob = $_POST['chld1_dob'] ?? null;
$chld1_gender = $_POST['chld1_gender'] ?? null;
$chld2_name = $_POST['chld2_name'] ?? null;
$chld2_age = $_POST['chld2_age'] ?? null;
$chld2_dob = $_POST['chld2_dob'] ?? null;
$chld2_gender = $_POST['chld2_gender'] ?? null;
$ch3d2_name = $_POST['ch3d2_name'] ?? null;
$chld3_age = $_POST['chld3_age'] ?? null;
$chld3_dob = $_POST['chld3_dob'] ?? null;
$chld3_gender = $_POST['chld3_gender'] ?? null;
$health = $_POST['health'] ?? null;
$lang2 = $_POST['lang2'] ?? null;
$lang1 = $_POST['lang1'] ?? null;
$lang3 = $_POST['lang3'] ?? null;
$emg_name = $_POST['emg_name'] ?? null;
$emg_address = $_POST['emg_address'] ?? null;
$emg_relation = $_POST['emg_relation'] ?? null;
$emg_phn = $_POST['emg_phn'] ?? null;
$add = $_POST['add'] ?? null;
$pin_c = $_POST['pin_c'] ?? null;
$state = $_POST['state'] ?? null;
error_log("Test".$position.$site_loc.$dept.$desig.$phn.$doj.$fname.$mname.$lname.$dob.$age.$sex);
// Educational
$ed1= $_POST['ed1'] ?? NULL ;
$board1= $_POST['board1'] ?? NULL ;
$inst1= $_POST['inst1'] ?? NULL ;
$sub1= $_POST['sub1'] ?? NULL ;
$pass1= $_POST['pass1'] ?? NULL ;
$percent1= $_POST['percent1'] ?? NULL ;
$ed2= $_POST['ed2'] ?? NULL ;
$board2= $_POST['board2'] ?? NULL ;
$inst2= $_POST['inst2'] ?? NULL ;
$sub2= $_POST['sub2'] ?? NULL ;
$pass2= $_POST['pass2'] ?? NULL ;
$percent2= $_POST['percent2'] ?? NULL ;
$ed3= $_POST['ed3'] ?? NULL ;
$board3= $_POST['board3'] ?? NULL ;
$inst3= $_POST['inst3'] ?? NULL ;
$sub3= $_POST['sub3'] ?? NULL ;
$pass3= $_POST['pass3'] ?? NULL ;
$percent3= $_POST['percent3'] ?? NULL ;
$ed4= $_POST['ed4'] ?? NULL ;
$board4= $_POST['board4'] ?? NULL ;
$inst4= $_POST['inst4'] ?? NULL ;
$sub4= $_POST['sub4'] ?? NULL ;
$pass4= $_POST['pass4'] ?? NULL ;
$percent4= $_POST['percent4'] ?? NULL ;
$ed5= $_POST['ed5'] ?? NULL ;
$board5= $_POST['board5'] ?? NULL ;
$inst5= $_POST['inst5'] ?? NULL ;
$sub5= $_POST['sub5'] ?? NULL ;
$pass5= $_POST['pass5'] ?? NULL ;
$percent5= $_POST['percent5'] ?? NULL ;
$ed6= $_POST['ed6'] ?? NULL ;
$board6= $_POST['board6'] ?? NULL ;
$inst6= $_POST['inst6'] ?? NULL ;
$sub6= $_POST['sub6'] ?? NULL ;
$pass6= $_POST['pass6'] ?? NULL ;
$percent6= $_POST['percent6'] ?? NULL ;
$ed7= $_POST['ed7'] ?? NULL ;
$board7= $_POST['board7'] ?? NULL ;
$inst7= $_POST['inst7'] ?? NULL ;
$sub7= $_POST['sub7'] ?? NULL ;
$pass7= $_POST['pass7'] ?? NULL ;
$percent7= $_POST['percent7'] ?? NULL ;
$rwds1= $_POST['rwds1'] ?? NULL ;          //146-85=61
$rwds2= $_POST['rwds2'] ?? NULL ;
$rwds3= $_POST['rwds3'] ?? NULL ;
$rwds4= $_POST['rwds4'] ?? NULL ;
$tr_prgm1= $_POST['tr_prgm1'] ?? NULL ;
$tr_inst1= $_POST['tr_inst1'] ?? NULL ;
$tr_dur1= $_POST['tr_dur1'] ?? NULL ;
$tr_yr1= $_POST['tr_yr1'] ?? NULL ;
$tr_prgm2= $_POST['tr_prgm2'] ?? NULL ;
$tr_inst2= $_POST['tr_inst2'] ?? NULL ;
$tr_dur2= $_POST['tr_dur2'] ?? NULL ;
$tr_yr2= $_POST['tr_yr2'] ?? NULL ;
$tr_prgm3= $_POST['tr_prgm3'] ?? NULL ;
$tr_inst3= $_POST['tr_inst3'] ?? NULL ;
$tr_dur3= $_POST['tr_dur3'] ?? NULL ;
$tr_yr3= $_POST['tr_yr3'] ?? NULL ;
$tr_prgm4= $_POST['tr_prgm4'] ?? NULL ;
$tr_inst4= $_POST['tr_inst4'] ?? NULL ;
$tr_dur4= $_POST['tr_dur4'] ?? NULL ;
$tr_yr4= $_POST['tr_yr4'] ?? NULL ;      

//experience
$c_name1 = $_POST['c_name1'] ?? NULL;
$c_desig1 = $_POST['c_desig1'] ?? NULL;
$c_start1 = $_POST['c_start1'] ?? NULL;
$c_end1 = $_POST['c_end1'] ?? NULL;
$c_sal1 = $_POST['c_sal1'] ?? NULL;
$c_name2 = $_POST['c_name2'] ?? NULL;
$c_desig2 = $_POST['c_desig2'] ?? NULL;
$c_start2 = $_POST['c_start2'] ?? NULL;
$c_end2 = $_POST['c_end2'] ?? NULL;
$c_sal2 = $_POST['c_sal2'] ?? NULL;
$c_name3 = $_POST['c_name3'] ?? NULL;
$c_desig3 = $_POST['c_desig3'] ?? NULL;
$c_start3 = $_POST['c_start3'] ?? NULL;
$c_end3 = $_POST['c_end3'] ?? NULL;
$c_sal3 = $_POST['c_sal3'] ?? NULL;
$c_name4 = $_POST['c_name4'] ?? NULL;
$c_desig4 = $_POST['c_desig4'] ?? NULL;
$c_start4 = $_POST['c_start4'] ?? NULL;
$c_end4 = $_POST['c_end4'] ?? NULL;
$c_sal4 = $_POST['c_sal4'] ?? NULL;
$c_name5 = $_POST['c_name5'] ?? NULL;
$c_desig5 = $_POST['c_desig5'] ?? NULL;
$c_start5 = $_POST['c_start5'] ?? NULL;
$c_end5 = $_POST['c_end5'] ?? NULL;
$c_sal5 = $_POST['c_sal5'] ?? NULL;
$c_name6 = $_POST['c_name6'] ?? NULL;
$c_desig6 = $_POST['c_desig6'] ?? NULL;
$c_start6 = $_POST['c_start6'] ?? NULL;
$c_end6 = $_POST['c_end6'] ?? NULL;
$c_sal6 = $_POST['c_sal6'] ?? NULL;


        function handleFileUpload($file, $uploadDir)
        {
            if ($file["error"] == UPLOAD_ERR_OK) {
                $filePath = $uploadDir . basename($file["name"]);
        
                if (move_uploaded_file($file["tmp_name"], '../../'.$filePath)) {
                    return $filePath;
                } else {
                    throw new Exception("Error moving the uploaded file.");
                }
            } else {
                throw new Exception("File upload error: " . $file["error"]);
            }
        }


       $uploadDir = "uploads/";


        // Handle file uploads using a loop
        $fileInputs = ["photo", "aadhar", "pan", "certificate"];
        $filePaths = [];

        foreach ($fileInputs as $input) {
            if (isset($_FILES[$input])) {
                $filePaths[$input] = handleFileUpload($_FILES[$input], $uploadDir);
            }
        }
        $statement = $pdo->prepare("INSERT INTO tbl_employee_personaldata 
        (position, site_loc, dept, desig, phn, doj, fname, mname, lname, dob, 
        age, sex, blood, marital_status, wed_date, lic, lic_exp, pan, nationality, relg, 
        adh_no, Off_email, per_email, bank_name, bank_ac_no, fa_name, fa_occ, fa_dob, fa_phn, mo_name, 
        mo_occ, mo_dob, mo_phn, sib1_name, sib1_occ, sib1_dob, sib1_phn, sib2_name, sib2_occ, sib2_dob, 
        sib2_phn, sib3_name, sib3_occ, sib3_dob, sib3_phn, sib4_name, sib4_occ, sib4_dob, sib4_phn, chld1_name, 
        chld1_age, chld1_dob, chld1_gender, chld2_name, chld2_age, chld2_dob, chld2_gender, ch3d2_name, chld3_age, chld3_dob, 
        chld3_gender, health, lang2, lang1, lang3, emg_name, emg_address, emg_relation,emg_phn,addr,
        pin_c,state, photo, aadhar, pancard, certificate
        
        )
        VALUES (
        ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, 
        ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, 
        ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, 
        ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, 
        ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, 
        ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, 
        ?, ?, ?, ?, ?, ?, ?, ?, ?, ?,
        ?, ?, ?, ?, ?, ?);");
        $result1 = $statement->execute(array(
        $position,$site_loc,$dept,$desig,$phn,$doj,$fname,$mname,$lname,$dob,
        $age,$sex,$blood,$marital_status,$wed_date,$lic,$lic_exp,$pan,$nationality,$relg,
        $adh_no,$Off_email,$per_email,$bank_name,$bank_ac_no,$fa_name,$fa_occ,$fa_dob,$fa_phn,
        $mo_name,$mo_occ,$mo_dob,$mo_phn,$sib1_name,$sib1_occ,$sib1_dob,$sib1_phn,$sib2_name,$sib2_occ,
        $sib2_dob,$sib2_phn,$sib3_name,$sib3_occ,$sib3_dob,$sib3_phn,$sib4_name,$sib4_occ,$sib4_dob,$sib4_phn,
        $chld1_name,$chld1_age,$chld1_dob,$chld1_gender,$chld2_name,$chld2_age,$chld2_dob,$chld2_gender,$ch3d2_name,$chld3_age,
        $chld3_dob,$chld3_gender,$health,$lang2,$lang1,$lang3,$emg_name,$emg_address,$emg_relation,$emg_phn,$addr,
        $pin_c, $state , $filePaths['photo'], $filePaths['aadhar'], $filePaths['pan'], $filePaths['certificate']));
        $emp_id = $pdo->lastInsertId();
 
        if($result1){
            error_log('First experience form starts');

        $statement = $pdo->prepare("INSERT INTO tbl_employee_experiencedata (
        c_name1, c_desig1, c_start1, c_end1, c_sal1, c_name2, c_desig2, c_start2, c_end2, c_sal2, c_name3,
        c_desig3, c_start3, c_end3, c_sal3, c_name4, c_desig4, c_start4, c_end4, c_sal4, c_name5, 
        c_desig5, c_start5, c_end5, c_sal5, c_name6, c_desig6, c_start6, c_end6, c_sal6,
        emp_id)
        VALUES (
        ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, 
        ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, 
        ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, 
        ?);");
        $result2 = $statement->execute(array(
        $c_name1, $c_desig1, $c_start1, $c_end1, $c_sal1, $c_name2, $c_desig2, $c_start2, $c_end2, $c_sal2, 
        $c_name3, $c_desig3, $c_start3, $c_end3, $c_sal3, $c_name4, $c_desig4, $c_start4, $c_end4, $c_sal4, 
        $c_name5, $c_desig5, $c_start5, $c_end5, $c_sal5, $c_name6, $c_desig6, $c_start6, $c_end6, $c_sal6, 
        $emp_id  
        ));
                    
        }
        if($result2){
            
         
            
            error_log('First educational form starts');

        $statement = $pdo->prepare("INSERT INTO tbl_employee_educationaldata (
        ed1, board1, inst1, sub1, pass1, percent1, ed2, board2, inst2, sub2, 
        pass2, percent2, ed3, board3, inst3, sub3, pass3, percent3, ed4, board4, 
        inst4, sub4, pass4, percent4, ed5, board5, inst5, sub5, pass5, percent5, 
        ed6, board6, inst6, sub6, pass6, percent6, ed7, board7, inst7, sub7, 
        pass7, percent7, rwds1, rwds2, rwds3, rwds4, tr_prgm1, tr_inst1, tr_dur1, tr_yr1, 
        tr_prgm2, tr_inst2, tr_dur2, tr_yr2, tr_prgm3, tr_inst3, tr_dur3, tr_yr3, tr_prgm4, tr_inst4, 
        tr_dur4, tr_yr4,emp_id)
        VALUES (
        ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, 
        ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, 
        ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, 
        ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, 
        ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, 
        ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, 
        ?, ?, ?);");
        $resul3 = $statement->execute(array(
            $ed1, $board1, $inst1, $sub1, $pass1, $percent1, $ed2, $board2, $inst2, $sub2, 
            $pass2, $percent2, $ed3, $board3, $inst3, $sub3, $pass3, $percent3, $ed4, $board4, 
            $inst4, $sub4, $pass4, $percent4, $ed5, $board5, $inst5, $sub5, $pass5, $percent5, 
            $ed6, $board6, $inst6, $sub6, $pass6, $percent6, $ed7, $board7, $inst7, $sub7,
            $pass7, $percent7, $rwds1, $rwds2, $rwds3, $rwds4, $tr_prgm1, $tr_inst1, $tr_dur1, $tr_yr1, 
            $tr_prgm2, $tr_inst2, $tr_dur2, $tr_yr2, $tr_prgm3, $tr_inst3, $tr_dur3, $tr_yr3, $tr_prgm4, $tr_inst4, 
            $tr_dur4, $tr_yr4, $emp_id  
        ));
            
        }
                
                

        if ($resul3) {
            header('Location: ../../index.php');
        }

        echo json_encode($return_arr);
    
}
?>

Zerion Mini Shell 1.0