-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathload_farmer_details.php
70 lines (56 loc) · 1.99 KB
/
load_farmer_details.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
<?php
include('access1.php');
include('include/connection.php');
$fm_caid = $_SESSION['ca_id'];
$fm_caname = $_SESSION['sqyard_user'];
if($_POST)
{
foreach ($_POST as $k => $value)
{
mysqli_real_escape_string($db_con,@$_POST[$k]);
}
}
if(isset($_POST['hid_spouse_details']) && $_POST['hid_spouse_details'] == '1')
{
include('include/query-helper.php');
$data['fm_id'] = @$_POST['hid_farmer_id'];
$data['fm_caid'] = $fm_caid;
$data['f3_spouse_fname'] = @$_POST['txt_spouse_name'];
$data['f3_spouse_age'] = @$_POST['txt_spouse_age'];
$data['f3_spouse_mobno'] = @$_POST['txt_spouse_mobile_no'];
$data['f3_spouse_adhno'] = @$_POST['txt_spouse_aadhar'];
$data['f3_spouse_shg'] = @$_POST['ddl_part_of_shg'];
if($data['f3_spouse_shg'] == 'yes')
{
$data['f3_spouse_shgname'] = @$_POST['txt_shg_name'];
}
$data['f3_spouse_occp'] = @$_POST['ddl_spouse_occupation'];
$data['f3_spouse_income'] = @$_POST['txt_spouse_incode'];
$data['f3_spouse_mfi'] = @$_POST['ddl_mony_isTaken'];
if($data['f3_spouse_mfi'] == 'yes')
{
$data['f3_spouse_mfiname'] = @$_POST['txt_microfinance_name'];
$data['f3_spouse_mfiamount'] = @$_POST['txt_mony_taken_from_mf'];
}
$data['f3_status'] = '1';
$data['f3_created_date'] = $datetime;
$data['f3_created_by'] = $fm_caid;
$data['f3_affliation_status'] = @$_POST['ddl_affliation'];
$data['f3_fpo_name'] = @$_POST['txt_fpo_name'];
$data['f3_bank_name'] = @$_POST['txt_spouse_bank_name'];
$check_exist = checkExist('tbl_spouse_details',array('fm_id'=>$data['fm_id']),array(),array(),array());
if(!$check_exist)
{
$res = insert('tbl_spouse_details', $data);
quit('Record Submitted Successfully..!',1);
}
else
{
$id = $check_exist['id'];
$data['f3_modified_by'] = $fm_caid;
$data['f3_modified_date'] = $datetime;
$res =update('tbl_spouse_details',$data,array("id"=>$id),array(),array(),array());
quit('Record Updated Successfully..!',1);
}
}
?>