<?php
$arr= array();
$user_id= $_POST['user_id'];
include("connect_db.php");
$sql_fetch_forms= "SELECT id, name, jilla_id, taluka_id, gram_id, gram_name, name2, survey_name, mbl, adhar, old_tax_no, s_s_no, s_s_m, group_no, plot_no, total_sqft, north_south, east_west, details, north, south, east, west, gate, wife_mbl, wife_adhar, img, mapimg, nal, washroom, tax_number, status, created_at, updated_at, user_id FROM survey_infos WHERE user_id='$user_id'";
$res= mysqli_query($con,$sql_fetch_forms);
if($res){
    if(mysqli_num_rows($res)>0){
        while($row= mysqli_fetch_row($res)){
            $data['id']=$row[0];
            $data['name']=$row[1];
            $data['jilla_id']=$row[2];
            $data['taluka_id']=$row[3];
            $data['gram_id']=$row[4];
            $data['gram_name']=$row[5];
            $data['name2']=$row[6];
            $data['survey_name']=$row[7];
            $data['mbl']=$row[8];
            $data['adhar']=$row[9];
            $data['old_tax_no']=$row[10];
            $data['s_s_no']=$row[11];
            $data['s_s_m']=$row[12];
            $data['group_no']=$row[13];
            $data['plot_no']=$row[14];
            $data['total_sqft']=$row[15];
            $data['north_south']=$row[16];
            $data['east_west']=$row[17];
            $data['details']=$row[18];
            $data['north']=$row[19];
            $data['south']=$row[20];
            $data['east']=$row[21];
            $data['west']=$row[22];
            $data['gate']=$row[23];
            $data['wife_mbl']=$row[24];
            $data['wife_adhar']=$row[25];
            $data['img']=$row[26];
            $data['mapimg']=$row[27];
            $data['nal']=$row[28];
            $data['washroom']=$row[29];
            $data['tax_number']=$row[30];
            $data['status']=$row[31];
            $data['created_at']=$row[32];
            $data['updated_at']=$row[33];
            $data['user_id']=$row[34];
            array_push($arr,$data);
        }
    }
    else{
        $data['status']="fail";
        $data['message']="No data found";
        array_push($arr,$data);
    }
}
else{
    $data['status']="fail";
    $data['message']=mysqli_error($con);
    array_push($arr,$data);
}
echo json_encode($arr);
?>