forked from jay13patel/LocalKabadi
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathftdfunction.php
More file actions
86 lines (74 loc) · 1.88 KB
/
ftdfunction.php
File metadata and controls
86 lines (74 loc) · 1.88 KB
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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
<?php
function add_pickup($p,$conn)
{
$text='';
//print_r($p);
for($i=1;$i<$p['add_in'];$i++)
$text.=$p['mat_nm_'.$i].','.$p['mat_qty_'.$i].';';
//$text+=$p['mat_nm_'.$i].','.$p['mat_qty_'.$i].';';
//echo $text;
//die();
$sql="INSERT INTO ".PICKUP."(name, city_id,adr,landmark,pincode,date,time_id,phn_no,type,material)VALUES('".$p['name']."','".$p['city']."','".$p['adr']."','".$p['landmark']."','".$p['pincode']."','".$p['date']."','".$p['time']."','".$p['phn']."','".$p['type']."','".$text."')";
if ($conn->query($sql) === TRUE) {
$msg = "Request succesfully registered";
}
else {
$msg = "Error: " . $sql . "<br>" . $conn->error;
}
return $msg;
}
function getmaterial_en($conn){
$sql = "SELECT id,name,rate FROM ".MAT." where switch=1";
$result = $conn->query($sql);
$option=[];
//print_r($result);
if ($result->num_rows > 0){
while ($row=mysqli_fetch_array($result))
{
$option[] = array(
'id' => $row['id'],
'name' => $row['name'],
'rate' => $row['rate'],
);
}
}
return $option;
}
function getstate_patid_en($conn,$id)
{
$sql = "SELECT id,name FROM ".STATE." where parent_id=$id and switch=1";
$result = $conn->query($sql);
$option=[];
//print_r($result);
if ($result->num_rows > 0)
{
while ($row=mysqli_fetch_array($result))
{
$option[] = array(
'id' => $row['id'],
'name' => $row['name'],
);
}
}
return $option;
}
function gettime_en($conn)
{
$sql = "SELECT ini,end,id FROM ".TIME." where switch=1";
$result = $conn->query($sql);
$option=[];
//print_r($result);
if ($result->num_rows > 0)
{
while ($row=mysqli_fetch_array($result))
{
$option[] = array(
'ini' => $row['ini'],
'end' => $row['end'],
'id' => $row['id'],
);
}
}
return $option;
}
?>