-
Notifications
You must be signed in to change notification settings - Fork 0
/
sd_qt.php
200 lines (163 loc) · 6.86 KB
/
sd_qt.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
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
<?php
require_once("functions/function.php");
get_header();
get_sidebar();
get_bread_four();
$custo_id=NULL;
if(!empty($_GET))
{
$custo_id=$_GET['id'];
}
//require_once("Script/sd.php");
?>
<div class="row-fluid sortable">
<!--
<div class="container">
<button type="button" class="btn btn-primary" id="Display" value="3">Create</button>
<button type="button" class="btn btn-primary" id="Change" value="1">Change</button>
<button type="button" class="btn btn-primary" id="Create" value="2">Display</button>
</div>
-->
<div class="box span12">
<form action="sd_qt_next.php" method="post">
<div style="display: none">
<input type="number" name="custo_id" class="form-control" value="<?= $custo_id ?>" oninvalid="alert('โปรดเลือก Customer ');" required >
</div>
<div class="box-header" data-original-title;>
<h2><i class="icon-file white user"></i><span class="break"></span>Find Customer</h2>
<div class="box-icon">
<a href="#" class="btn-setting"><i class="halflings-icon white wrench"></i></a>
<a href="#" class="btn-minimize"><i class="halflings-icon white chevron-up"></i></a>
<a href="#" class="btn-close"><i class="halflings-icon white remove"></i></a>
</div>
</div>
<div class="box-content">
<?php
include("includes/connection.php");
$sql3 = "SELECT * FROM customer WHERE customer_id = '$custo_id'";
$result3=mysqli_query($connect,$sql3);
$row3=mysqli_fetch_array($result3);
?>
<div class="form-group">
<br>
<label> <button type="button" class="btn btn-primary btn-lg" data-toggle="modal" data-target="#myModalqt">Find Customer</button> <input type="text" name="custo_id" value="<?= $custo_id ?>" class="form-control" disabled> <input type="hidden" name="custo_id" value="<?= $custo_id ?>" > </label> <p></p>
<label>Name :<input type="text" name="customer" class="form-control" placeholder="<?= $row3['first_name'].' '.$row3['last_name'] ?>" disabled></label>
<label>Address : <input type="text" name="customer" class="form-control" placeholder="<?= $row3['house_number'].' '.$row3['district'].' '.$row3['province'] ?>" disabled></labeL>
</div>
<p></p>
<p></p></div>
</div>
<div class="box span12" style="margin-left: 0px;">
<div class="box-header" data-original-title;>
<h2><i class="icon-file white user"></i><span class="break"></span>Find Inquiry</h2>
</div>
<div class="box-content" >
<label for="usr">
<label for="usr">Inquiry Number :
<select name="inq_number" onchange="showCustomer(this.value)">
<?php
include("includes/connection.php");
$sql2 = "SELECT * FROM document WHERE customer_id = '$custo_id'&& doc_type_id=1 ";
$result2=mysqli_query($connect,$sql2); //rs.open sql,con
while ($row=mysqli_fetch_array($result2))
{ ?><!--open of while -->
<option value="<?= $row['doc_id'] ?>"><?= $row['doc_id'] ?></option>
<?php } ?>
</select>
</label>
<p></p>
<button type="submit" class="btn btn-primary btn-lg" role="button" id="copyqt">Copy to Qutation</button>
</label>
</div>
</div>
</form>
<form action="sd_qt_display.php" method="post">
<div style="display: none">
<input type="number" name="custo_id" class="form-control" value="<?= $custo_id ?>" oninvalid="alert('โปรดเลือก Customer ');" required >
</div>
<input type="hidden" name="custo_id" value="<?= $custo_id ?>">
<div class="box span12" style="margin-left: 0px">
<div class="box-header" data-original-title;>
<h2><i class="icon-file white user"></i><span class="break"></span>Find Quotation</h2>
</div>
<div class="box-content" >
<label for="usr">
<label for="usr">Quotation Number :
<select name="inq_number" onchange="showCustomer(this.value)">
<?php
include("includes/connection.php");
$sql2 = "SELECT * FROM document WHERE customer_id = '$custo_id'&& doc_type_id=2 ";
$result2=mysqli_query($connect,$sql2); //rs.open sql,con
while ($row=mysqli_fetch_array($result2))
{ ?><!--open of while -->
<option value="<?= $row['ref_doc'] ?>"><?= $row['doc_id'] ?></option>
<?php } ?>
</select>
</label>
<p></p>
<button type="submit" class="btn btn-primary btn-lg" role="button" id="copyqt">Next</button>
</label>
</div>
</div>
</form>
</div>
</div>
</div><!--/row-->
<!-- Modal 1-->
<div class="modal fade bs-example-modal-lg" id="myModalqt" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
<div class="modal-dialog modal-lg" role="document">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
<h4 class="modal-title" id="myModalLabel">Find Customer</h4>
</div>
<div class="modal-body">
<table class="table table-striped table-bordered bootstrap-datatable datatable">
<thead>
<tr>
<th>Customer number</th>
<th>Customer name</th>
<th>Address</th>
<th>Actions</th>
</tr>
</thead>
<tbody>
<?php
include("includes/connection.php");
$sql2 = "SELECT * FROM customer ";
$result2=mysqli_query($connect,$sql2); //rs.open sql,con
while ($row=mysqli_fetch_array($result2))
{ ?><!--open of while -->
<tr>
<td><?php echo $row['customer_id']; ?></td>
<td><?php echo $row['first_name'].' '.$row['last_name']; ?></td>
<td><?php echo $row['house_number'].' '.$row['district'].' '.$row['province']; ?></td>
<td class="center">
<a class="btn glyphicon glyphicon-ok" id="add_customer" href="sd_qt.php?id=<?= $row['customer_id'] ?>" >
<i class="halflings-icon white edit"></i>
</a>
</td>
</tr>
<?php
} //close of while
?>
</tbody>
</table>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
</div>
</div>
</div>
</div>
<?php
get_footer();
?>
<!-- <div class="common-modal modal fade" id="common-Modal1" tabindex="-1" role="dialog" aria-hidden="true">
<div class="modal-content">
<ul class="list-inline item-details">
<li><a href="http://themifycloud.com">Admin templates</a></li>
<li><a href="http://themescloud.org">Bootstrap themes</a></li>
</ul>
</div>
</div> -->