require("./global.php"); $id = $_GET['id']; $employee_info = getRow($con, "SELECT * FROM jeoXillityCrm_users WHERE id = '$id'"); $primaryTableName = "users"; array( // field_name [type, isrequired, array_select, inner_type] <= "template" "name" => ["input", "", "", "text"], "email" => ["input", "", "", "text"], "phone" => ["input", "", "", "text"], "alternative_phone" => ["input", "", "", "text"], "shift" => ["input", "", "", "text"], "country" => ["input", "", "", "text"], "department" => ["input", "", "", "text"], "section" => ["input", "", "", "text"], "sub_section" => ["input", "", "", "text"], "designation" => ["input", "", "", "text"], "employee_type" => ["input", "", "", "text"], "duty_type" => ["input", "", "", "text"], "joining_date" => ["input", "", "", "text"], "leave_expire_date" => ["input", "", "", "text"], "grade" => ["input", "", "", "text"], "starting_gross_salary" => ["input", "", "", "text"], "salary_system" => ["input", "", "", "text"], "mobile_banking_provider_name" => ["input", "", "", "text"], "mobile_banking_account_number" => ["input", "", "", "text"], "bank_name" => ["input", "", "", "text"], "bank_branch_name" => ["input", "", "", "text"], "bank_account_name" => ["input", "", "", "text"], "bank_account_number" => ["input", "", "", "text"], "division" => ["input", "", "", "text"], "district" => ["input", "", "", "text"], "subdistrict" => ["input", "", "", "text"], "post_office" => ["input", "", "", "text"], "post_office" => ["input", "", "", "text"], "present_division" => ["input", "", "", "text"], "present_district" => ["input", "", "", "text"], "present_subdistrict" => ["input", "", "", "text"], "present_post_office" => ["input", "", "", "text"], "present_village_house_road" => ["input", "", "", "text"], "father_husband_name" => ["input", "", "", "text"], "mother_name" => ["input", "", "", "text"], "dob" => ["input", "", "", "text"], "nid_no_birth_certificate" => ["input", "", "", "text"], "profile_pic" => ["input", "", "", "text"], "gender" => ["input", "", "", "text"], "marital_status" => ["input", "", "", "text"], "blood_group" => ["input", "", "", "text"], "religion" => ["input", "", "", "text"], "contact_person_name" => ["input", "", "", "text"], "contact_person_phone" => ["input", "", "", "text"], "relation" => ["input", "", "", "text"], "login_access" => ["input", "", "", "text"], ); $shift_options = convertArrayToIndexArray(["Shift 1", "Shift 2", "Shift 3"]); $country_options = convertArrayToIndexArray(["Afghanistan", "India", "Pakistan", "USA"]); $department_options = convertArrayToIndexArray(["Department 1", "Department 2", "Department 3"]); $section_options = convertArrayToIndexArray(["Section 1", "Section 2", "Section 3"]); $sub_section_options = convertArrayToIndexArray(["Subsection 1", "Subsection 2", "Subsection 3"]); $designation_options = convertArrayToIndexArray(["Designation 1", "Designation 2", "Designation 3"]); $employee_type_options = convertArrayToIndexArray(["Employee Type 1", "Employee Type 2", "Employee Type 3"]); $duty_type_options = convertArrayToIndexArray(["Duty Type 1", "Duty Type 2", "Duty Type 3"]); $grade_options = convertArrayToIndexArray(["Grade 1", "Grade 2", "Grade 3"]); $salary_system_options = convertArrayToIndexArray(["Salary System 1", "Salary System 2", "Salary System 3"]); $division_options = convertArrayToIndexArray(["Division 1", "Division 2", "Division 3"]); $district_options = convertArrayToIndexArray(["District 1", "District 2", "District 3"]); $subdistrict_options = convertArrayToIndexArray(["Subdistrict 1", "Subdistrict 2", "Subdistrict 3"]); $post_office_options = convertArrayToIndexArray(["Post Office 1", "Post Office 2", "Post Office 3"]); $gender_options = convertArrayToIndexArray(["Male", "Female", "Other"]); $marital_status_options = convertArrayToIndexArray(["Married", "Unmarried", "Divorced"]); $blood_group_options = convertArrayToIndexArray(["A+", "A-", "B+", "B-", "O+", "O-", "AB+", "AB-"]); $religion_options = convertArrayToIndexArray(["Christianity", "Islam", "Hinduism", "Buddhism", "Sikhism", "Judaism"]); if (isset($_POST['create_package'])) { $actionId = $id; $name = escape($_POST['name']); $email = escape($_POST['email']); $phone = escape($_POST['phone']); $alternative_phone = escape($_POST['alternative_phone']); $shift = escape($_POST['shift']); $country = escape($_POST['country']); $department = escape($_POST['department']); $section = escape($_POST['section']); $sub_section = escape($_POST['sub_section']); $designation = escape($_POST['designation']); $employee_type = escape($_POST['employee_type']); $duty_type = escape($_POST['duty_type']); $joining_date = escape($_POST['joining_date']); $leave_expire_date = escape($_POST['leave_expire_date']); $grade = escape($_POST['grade']); $starting_gross_salary = escape($_POST['starting_gross_salary']); $salary_system = escape($_POST['salary_system']); $mobile_banking_provider_name = escape($_POST['mobile_banking_provider_name']); $mobile_banking_account_number = escape($_POST['mobile_banking_account_number']); $bank_name = escape($_POST['bank_name']); $bank_branch_name = escape($_POST['bank_branch_name']); $bank_account_name = escape($_POST['bank_account_name']); $bank_account_number = escape($_POST['bank_account_number']); $division = escape($_POST['division']); $district = escape($_POST['district']); $subdistrict = escape($_POST['subdistrict']); $post_office = escape($_POST['post_office']); $present_division = escape($_POST['present_division']); $present_district = escape($_POST['present_district']); $present_subdistrict = escape($_POST['present_subdistrict']); $present_post_office = escape($_POST['present_post_office']); $present_village_house_road = escape($_POST['present_village_house_road']); if ($_POST['present_address_check'] == "Yes") { $present_division = $division; $present_district = $district; $present_subdistrict = $subdistrict; $present_post_office = $post_office; } $father_husband_name = escape($_POST['father_husband_name']); $mother_name = escape($_POST['mother_name']); $dob = escape($_POST['dob']); $nid_no_birth_certificate = escape($_POST['nid_no_birth_certificate']); $profile_pic = escape($_POST['profile_pic']); $gender = escape($_POST['gender']); $marital_status = escape($_POST['marital_status']); $blood_group = escape($_POST['blood_group']); $religion = escape($_POST['religion']); $contact_person_name = escape($_POST['contact_person_name']); $contact_person_phone = escape($_POST['contact_person_phone']); $relation = escape($_POST['relation']); $login_access = escape($_POST['login_access']); if (isset($_POST['password'])) { $password = $_POST['password']; $_POST['password'] = mb_htmlentities(md5(md5(sha1($_POST['password'])) . 'Anomoz')); $passwords = $_POST['password']; } // $password = escape($_POST['password']); if ($actionId == "") { $id = generateRandomString(); $actionId = $id; $query = "insert into jeoXillityCrm_users set id='$id' , name='$name', email='$email', password='$passwords', role='employee', phone='$phone', alternative_phone='$alternative_phone', shift='$shift', country='$country', department='$department', section='$section', sub_section='$sub_section', designation='$designation', employee_type='$employee_type', duty_type='$duty_type', joining_date='$joining_date', leave_expire_date='$leave_expire_date', grade='$grade', starting_gross_salary='$starting_gross_salary', salary_system='$salary_system', mobile_banking_provider_name='$mobile_banking_provider_name', mobile_banking_account_number='$mobile_banking_account_number', bank_name='$bank_name', bank_branch_name='$bank_branch_name', bank_account_name='$bank_account_name', bank_account_number='$bank_account_number', division='$division', district='$district', subdistrict='$subdistrict', post_office='$post_office', present_division='$present_division', present_district='$present_district', present_subdistrict='$present_subdistrict', present_post_office='$present_post_office', present_village_house_road='$present_village_house_road', father_husband_name='$father_husband_name', mother_name='$mother_name', dob='$dob', nid_no_birth_certificate='$nid_no_birth_certificate', gender='$gender', marital_status='$marital_status', blood_group='$blood_group', religion='$religion', contact_person_name='$contact_person_name', contact_person_phone='$contact_person_phone', relation='$relation', login_access='$login_access', timeAdded='$timeAdded', userId='$session_userId' "; } else { $query = "update jeoXillityCrm_users set id='$actionId' , name='$name', email='$email', password='$passwords', role='employee', phone='$phone', alternative_phone='$alternative_phone', shift='$shift', country='$country', department='$department', section='$section', sub_section='$sub_section', designation='$designation', employee_type='$employee_type', duty_type='$duty_type', joining_date='$joining_date', leave_expire_date='$leave_expire_date', grade='$grade', starting_gross_salary='$starting_gross_salary', salary_system='$salary_system', mobile_banking_provider_name='$mobile_banking_provider_name', mobile_banking_account_number='$mobile_banking_account_number', bank_name='$bank_name', bank_branch_name='$bank_branch_name', bank_account_name='$bank_account_name', bank_account_number='$bank_account_number', division='$division', district='$district', subdistrict='$subdistrict', post_office='$post_office', present_division='$present_division', present_district='$present_district', present_subdistrict='$present_subdistrict', present_post_office='$present_post_office', present_village_house_road='$present_village_house_road', father_husband_name='$father_husband_name', mother_name='$mother_name', dob='$dob', nid_no_birth_certificate='$nid_no_birth_certificate', gender='$gender', marital_status='$marital_status', blood_group='$blood_group', religion='$religion', contact_person_name='$contact_person_name', contact_person_phone='$contact_person_phone', relation='$relation', login_access='$login_access' where id='$actionId'"; } // echo $query; // exit; runQuery($query); $profile_pic = storeFile($_FILES['profile_pic']); if ($profile_pic != "") { $query = "update jeoXillityCrm_users set profile_pic='$profile_pic' where id='$actionId'"; runQuery($query); } header("Location: ./all-employee.php?" . generateUrlParams_return(["m" => "Data was saved successfully!", "type" => "success"])); exit(); } if (isset($_GET['delete-record'])) { $id = escape($_GET['delete-record']); $query = "delete from jeoXillityCrm_users where id='$id'"; runQuery($query); } ?>
include("./includes/views/head2.php"); ?>