ESH/data.php

22 lines
1.1 KiB
PHP
Raw Permalink Normal View History

2024-10-23 18:28:06 +05:30
<?php
include('log_entry.php');
$filepath = './data.json';
$json_string = file_get_contents($filepath);
$json_string = rtrim($json_string,"\0");
//error_log("JSON::" .$json_string);
$json_arr = json_decode($json_string, true);
print_r($json_arr);
foreach($json_arr as $elem => $val) {
error_log("DATA::" .$json_arr['Data']);
foreach($elem['Data'] as $data => $val2){
$sql = "insert into patient_master_copy set patient_name='".$data['EmployeeData']['Name']."',emp_code='".$data['EmployeeData']['EmpCode']."',father_name='".$data['EmployeeData']['FatherName']."',gender='".$data['EmployeeData']['Gender']."',dob='".$data['EmployeeData']['DateOfBirth']."',doj='".$data['EmployeeData']['JoiningDate']."',date_of_exit='".$data['EmployeeData']['LeavingDate']."',present_address='".$data['EmployeeData']['Address']."',permanent_address='".$data['EmployeeData']['PermanentAddress']."',primary_phone='".$data['EmployeeData']['Mobile']."',email='".$data['EmployeeData']['Email']."',pan='".$data['EmployeeData']['pan']."',aadhar_no='".$data['EmployeeData']['AadharNo']."'";
}
echo("<br/>");
}
?>