/
accept_data_Costs.PHP
318 lines (244 loc) · 9.02 KB
/
accept_data_Costs.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
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
<?php
session_start();
include("connect/connect.php");
include("function.php");
if (!Checklogin())
{
header("location: login_err.php"); //ทำหน้าเพื่อให้เข้าหน้า Login
}
?>
<html>
<head>
<meta charset="UTF-8" />
<title> Manage Customer </title>
<!-- DC Table Styles I CSS -->
<link type="text/css" rel="stylesheet" href="css/dc_tables1.css" />
<link type="text/css" rel="stylesheet" href="css/button.css" />
<!-- Start font-->
<link rel="stylesheet" type="text/css" href="font-awesome\css\font-awesome.min.css">
<!--Bootstrap
<link href="bootstrap_ 2/css/bootstrap.css" rel="stylesheet">-->
<link href="css/flat-ui.css" rel="stylesheet">
<link href="css/demo.css" rel="stylesheet">
<link rel="shortcut icon" href="images/bin.ico">
<!--validation-->
<link rel="stylesheet" href="css/validationEngine.jquery.css" type="text/css" media="screen" title="no title" charset="utf-8" />
<link rel="stylesheet" href="css/template.css" type="text/css" media="screen" title="no title" charset="utf-8" />
<script src="js/jquery.min.js" type="text/javascript"></script>
<!--typeahead-->
<script src="js/typeahead.bundle.js"></script>
<!-- FRENCH LOCALISATION <script src="js/jquery.validationEngine-fr.js" type="text/javascript"></script> -->
<!-- // <script src="js/jquery.validationEngine.js" type="text/javascript"></script> -->
<link rel="shortcut icon" href="images/bin.ico">
<style type="text/css">
.table {
background: white;
border: 1px solid #1abc9c;
border-radius: 6px;
height: 100px;
margin-bottom: 18px;
padding: 6px 1px 1px 6px;
overflow-y: auto;
text-align: left;
line-height: 1.471;
}
.td{
font-size: 17px;
line-height: 1.471;
border-radius: 6px;
padding: 0px 10px;
}
</style>
<!-- breadcrumb -->
<link rel="stylesheet" href="css/style_breadcrumb.css" media="screen" type="text/css" />
</head>
<body bgcolor="#ececec" link="BLUE" vlink="BLUE" alink="BLUE">
<br>
<ul id="breadcrumb" style="font-size: small;">
<li><a href="home.php" target="iframe"><i class="fa fa-home fa-lg"></i> </a></li>
<li><a href="#">ค่าใช้จ่าย</a></li>
</ul>
<?php
error_reporting(E_ERROR | E_WARNING | E_PARSE);
include("connect/connect.php");
include "function.php";
$day = date("Y-m-d");
$today=strtotime($day);
?>
<center>
<form id="form01" name="form01" method="post" action="add_data_Costs.php">
<div colspan="9" align="center" style="font-size: 40px;">
<b><font face ="TH Sarabun New"> ค่าใช้จ่าย</style></b>
</font>
<table class="table"border="0" style="font-size: 40px;">
<tbody>
<tr>
<td>
<br>
</td>
</tr>
<tr>
<td align="right" style="font-size: 30px;"> <b> ค่าใช้จ่าย </b></td>
<td align="left">
<select class="btn btn-default dropdown-toggle" name="costs" value="costs" style="width: 58%; color: black;" > <span class="caret"></span>
<option value="">เลือกค่าใช้จ่าย</option>
<option value="ค่าน้ำประปา">น้ำประปา</option>
<option value="ค่าไฟฟ้า">ไฟฟ้า</option>
<option value="ค่าโทรศัพท์">โทรศัพท์</option>
<option value="ค่าเช่าสถานที่">เช่าสถานที่</option>
</select>
</td></tr>
<tr>
<td align="right"> เลขที่ใบแจ้ง </td>
<td align="left">
<label for=""></label>
<input type="text" name="inv" value="" placeholder="เลขที่ใบแจ้งค่าใช้จ่าย" size="30" class="validate[required] text-input form-control " style="width: 58%;"></td>
</tr>
<tr>
<td align="right"> วันที่แจ้ง </td>
<td align="left">
<input type="date" id="dp1" name="date_in" value="date_in" size="30" class="form-control input-sm">
</td>
</tr>
<tr>
<td align="right"> มูลค่า </td>
<td align="left">
<input type="text" name="pay" id="" value="" placeholder="บาท" size="30" class="validate[required] text-input form-control " style="width: 58%;"></td>
</td>
</tr>
<tr>
<td align="right"> วันที่จ่ายจริง</td>
<td align="left">
<label for="Pro_Price"></label>
<input type="date" id="dp1" name="act" value="" size="30" class="form-control input-sm">
</tr>
<tr>
<td colspan="4" align="center">
<input type="submit" name="btnsummit" id="btnsummit" value=" บันทึกค่าใช้จ่าย" class="btn btn-primary btn-large btn-block" style="width: 26%;">
<input type="reset" name="btnreset" id="btnreset" value="ยกเลิกการบันทึกข้อมูล" class="btn btn-default btn-large btn-block" style="width: 28%;" onclick="javascript:location.reload();">
<br>
</td>
</tr>
<tr>
<td>
<br>
</td>
</tr>
</tbody>
</form>
</table>
<table border="0">
<tr>
<form id="form1" name="form1" method="post" action="accept_data_Costs.php">
<!--รหัสลูกค้า -->
<td>
<div id="remote">
<input type="text" value placeholder="ประเภทค่าใช้จ่าย" name="s_COST" id="s_COST" class="typeahead form-control">
</div>
</td>
<script>
$(function() {
var costDB = new Bloodhound({
datumTokenizer: Bloodhound.tokenizers.obj.whitespace('value'),
queryTokenizer: Bloodhound.tokenizers.whitespace,
//prefetch: 'data.json',
remote: 'typeahead_accept_data_costs.php?c=%QUERY'
});
costDB.initialize();
$('#remote .typeahead').typeahead(null, {
name: 's_COST',
displayKey: 'value',
source: costDB.ttAdapter()
});
$('#s_COST').on('typeahead:selected', function(e) {
var args;//, type, text;
args = [].slice.call(arguments, 1);
args = args[0];
//type = e.type;
//text = window.JSON ? JSON.stringify(args) : '';
//$('#name').text(args['Cid'] + ' ' + args['value']);
});
});
</script>
<td>
</td>
<!--ชื่อลูค้า-->
<td>
<?php
$options['name'] = "s_month";
echo dropdownMonth($options);?>
</td>
<td>
</td>
<td>
<button type="submit" name="btnsearch" id="btnsearch" class="btn btn-block btn-primary"> <i class="fa fa-search"></i> ค้นหา</button>
</td>
<td>
</td>
</form>
</tr>
<tr>
<td>
<br>
</td>
</tr>
</table>
<?php
$q_COST=$_REQUEST['s_COST'];
$q_month=$_REQUEST['s_month'];
if($q_COST=="") $q_COST="%" ;
if($q_month=="") $q_month="%" ;
$sql="select * ";
$sql=$sql."from costs ";
$sql=$sql."where CS_ACT like '%$q_month%'" ;
$sql=$sql."and CS_COST like '%$q_COST%'";
$sql=$sql."order by CS_ID ";
//echo "<br>" .$sql."<br>";
?>
<!-- DC Table Styles I:12 Start -->
<table class="dc_table_s12" summary="Sample Table" style="width:80%;" >
<thead>
<tr style="height: 50px;">
<td><div align="center"><FONT COLOR=#fff> <b> ประเภทค่าใช้จ่าย </b></FONT></div></td>
<td><div align="center"><FONT COLOR=#fff> <b> วันที่แจ้ง </b></FONT></div></td>
<td><div align="center"><FONT COLOR=#fff> <b> วันที่จ่าย </b></FONT></div></td>
<td><div align="center"><FONT COLOR=#fff> <b> มูลค่า </b></div></td>
<form id="form1" name="form1" method="post" action="manage_Customer_Product_in.php">
</form>
</td>
</tr>
</thead>
<?php
$record = mysql_query($sql) or die(mysql_error());
while($data=mysql_fetch_assoc($record)){
$str=$data['CS_DATE_IN'];
$date=strtotime($str);
$str2=$data['CS_ACT'];
$date2=strtotime($str2);
$CS_PAY=$data['CS_PAY'];
?>
<tbody>
<tr>
<td><div align="center"> <?php echo $data['CS_COST'];?> </div></td>
<td><div align="center"><?php echo thai_date4($date);?> </div></td>
<td><div align="center"><?php echo thai_date4($date2);?> </div></td>
<td><div align="center"> <?php echo number_format("$CS_PAY",2);?> </div></td>
<td><img src="images/icons/png/Edit-128.png"></a></div></td>
</tr>
</tbody>
<?php } ?>
<tfoot>
<tr>
<th scope="row"></th>
<td colspan="7"></td>
</tr>
</tfoot>
</table>
</center>
</div>
</body>
</html>