-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcompany_ajax.php
110 lines (100 loc) · 3.23 KB
/
company_ajax.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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
<?php
include("includes/main_init.php");
if(isset($_POST['comp']))
{
$code=find("all",QUOTATION,"DISTINCT c_name", "where c_name like'" .$_POST['comp']."%'", array());
foreach ($code as $key => $item) { ?>
<div onclick="fill_comp('<?php echo $item['c_name'];?>')" style="cursor:pointer;"><?php echo $item['c_name'];?></div>
<?php }
}
if(isset($_POST['comp_name']))
{
$com_det=find("first",QUOTATION,"*", "where c_name ='" .$_POST['comp_name']."'", array());
echo $com_det['c_phone'];
echo "\n";
echo $com_det['c_mail'];
echo "\n";
echo "\n";
echo $com_det['c_address'];
}
if(isset($_POST['cus']))
{
$cus=find("all",CUSTOMER_MASTER,"*", "where company_name like'" .$_POST['cus']."%'", array());
foreach ($cus as $key => $item) { ?>
<div onclick="fill_cus('<?php echo $item['company_name'];?>')" style="cursor:pointer;"><?php echo $item['company_name'];?></div>
<?php }
}
if(isset($_POST['cus_name']))
{
$com_det=find("first",CUSTOMER_MASTER,"*", "where company_name ='" .$_POST['cus_name']."'", array());
echo $com_det['state'];
echo "\n";
echo $com_det['city'];
echo "\n";
echo $com_det['vat'];
echo "\n";
echo "\n";
echo $com_det['address'];
}
if(isset($_POST['cusinfo']))
{
$comp_name=find("first",CUSTOMER_MASTER,"*", "where company_name ='" .$_POST['cusinfo']."'", array());
if (isset($_POST['cont']) && $_POST['cont']!='')
{
$cont=find("all",CUSTOMER_INFO,"*", "where c_id='" .$comp_name['c_id']."' and name like '".$_POST['cont']."%'", array());
foreach ($cont as $key => $item) { ?>
<div onclick="fill_contact('<?php echo $item['name'];?>')" style="cursor:pointer;"><?php echo $item['name'];?></div>
<?php }
}
else
{
$cont=find("all",CUSTOMER_INFO,"*", "where c_id='" .$comp_name['c_id']."'", array());
foreach ($cont as $key => $item) { ?>
<div onclick="fill_contact('<?php echo $item['name'];?>')" style="cursor:pointer;"><?php echo $item['name'];?></div>
<?php }
}
}
if(isset($_POST['contact']))
{
$com_det=find("first",CUSTOMER_INFO,"*", "where name ='" .$_POST['contact']."'", array());
echo $com_det['phone'];
echo "\n";
echo $com_det['email'];
}
if(isset($_POST['cus_nm']))
{
$comp_name=find("first",CUSTOMER_MASTER,"*", "where company_name ='" .$_POST['cus_nm']."'", array());
if (isset($_POST['str']) && $_POST['str']!='')
{
$str=find("all",CUSTOMER_STORE,"*", "where c_id='" .$comp_name['c_id']."' and store_name like '".$_POST['str']."%'", array());
foreach ($str as $key => $item) { ?>
<div onclick="fill_cus_store('<?php echo $item['store_name'];?>')" style="cursor:pointer;"><?php echo $item['store_name'];?></div>
<?php }
}
else
{
$str=find("all",CUSTOMER_STORE,"*", "where c_id='" .$comp_name['c_id']."'", array());
foreach ($str as $key => $item) { ?>
<div onclick="fill_cus_store('<?php echo $item['store_name'];?>')" style="cursor:pointer;"><?php echo $item['store_name'];?></div>
<?php }
}
}
if(isset($_POST['store_nm']))
{
$store_det=find("first",CUSTOMER_STORE,"*", "where store_name ='" .$_POST['store_nm']."'", array());
echo $store_det['store_manager'];
echo "\n";
echo $store_det['phone'];
echo "\n";
echo $store_det['email'];
echo "\n";
echo $store_det['state'];
echo "\n";
echo $store_det['city'];
echo "\n";
echo $store_det['vat'];
echo "\n";
echo "\n";
echo $store_det['address'];
}
?>