-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathexps2010.php
592 lines (535 loc) · 20.4 KB
/
exps2010.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
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
<?php
session_start();
if(session_is_registered("session_userid")){
$logout="<a href='logout.php'>로그아웃</a>";
}else{
header("Location:index.php");
}
// db관련 파일 인크루드
include "conf.php";
$connect = mysql_connect("localhost", $dbname, $dbpass);
$result=mysql_select_db($dbname, $connect);
if ( !$connect ) {
echo " 데이터베이스에 연결할 수 없습니다.";
}
mysql_query("set session character_set_connection=utf8;");
mysql_query("set session character_set_results=utf8;");
mysql_query("set session character_set_client=utf8;");
//해당 월만 검색하는 query
/*
File: helloworld.php
Test / example page demonstrating the basic xajax implementation.
Title: Hello world sample page.
Please see <copyright.inc.php> for a detailed description, copyright
and license information.
*/
/*
@package xajax
@version $Id: helloworld.php 362 2007-05-29 15:32:24Z calltoconstruct $
@copyright Copyright (c) 2005-2006 by Jared White & J. Max Wilson
@license http://www.xajaxproject.org/bsd_license.txt BSD License
*/
/*
Section: Standard xajax startup
- include <xajax.inc.php>
- instantiate main <xajax> object
*/
require ('./xajax_core/xajax.inc.php');
$xajax = new xajax();
/*
- enable deubgging if desired
- set the javascript uri (location of xajax js files)
*/
//$xajax->configure('debug', true);
$xajax->configure('javascript URI', './');
//comma를 보여주는 함수
function comma($number){
$nl=strlen($number);
if($nl>6){
$no=substr($number,0,$nl-6).",".substr($number,$nl-6,3).",".substr($number,-3);
}
else if($nl>3){
$no=substr($number,0,$nl-3).",".substr($number,-3);
}else{
$no=$number;
}
return $no;
}
// 반복되는 구조 변수
$tfoot[4001]='<tfoot>
<tr><input type="hidden" name="no" id="no" value="" ><input type="hidden" name="etc" id="etc" value="" >
<td class="style2"><input type="hidden" name="exps_code" id="exps_code" value="4001" ></td>
<td class="style2">
<select id="exps_gubn" name="exps_gubn" onchange="CheckEnter(this);" class="clist">
<option value="0">1. 현금</option>
<option value="1">2. 통장</option>
<option value="2">3. 카드(법인)</option>
<option value="3">4. 카드(개인)</option>
</select>
</td>
<td class="style2">
<select id="exps_cate" name="exps_cate" onchange="CheckEnter(this);" class="clist">
<option value="1503">1. 화장품</option>
<option value="1604">2. 잡비</option>
</select>
</td>
<td class="style2"><input type="text" name="exps_cust" id="exps_cust" size="17" Onkeydown="CheckEnter(this)" ></td>
<td class="style2"><input type="text" name="exps_caus" id="exps_caus" size="17" Onkeydown="CheckEnter(this)" ></td>
<td class="style2"><input type="text" name="cash_mony" id="cash_mony" size="15" onkeypress="Keycode(event,this);" Onkeydown="CheckEnter(this)" onkeyup="SumAmount(this);" style="ime-mode:disabled" ></td>
<td class="style2"><input type="button" onclick="CheckCont()" value="저장" ></td>
</tr>
</tfoot>';
$thead[4000]='<table border="1" style="text-align:center;width:100%">
<thead>
<tr>
<td class="style2">선택</td>
<td class="style2">종류</td>
<td class="style2">계정과목</td>
<td class="style2">적요</td>
<td class="style2">지출처</td>
<td class="style2">금액</td>
<td class="style2"></td>
</tr>
</thead>';
$thead[4001]=$thead[4000];
$tfoot[4000]='<tfoot>
<tr><input type="hidden" name="no" id="no" value="" ><input type="hidden" name="etc" id="etc" value="" >
<td class="style2"><input type="hidden" name="exps_code" id="exps_code" value="4000" ></td>
<td class="style2">
<select id="exps_gubn" name="exps_gubn" onchange="CheckEnter(this);" class="clist">
<option value="0">1. 현금</option>
<option value="1">2. 통장</option>
</select>
</td>
<td class="style2">';
/*$tfoot[4000]=$tfoot[4000].'<select id="exps_cate" name="exps_cate" onchange="CheckEnter(this);" class="clist">
<option value="0" selected="selected">선택</option>';
$selSql2="select * from pearl_expc";
$result2 = mysql_query($selSql2, $connect);
$total = mysql_affected_rows(); // 총 레코드 수
$num=$total;
while($total--){
$row2 = mysql_fetch_row($result2);
$tfoot[4000]=$tfoot[4000].'<option value="'.$row2[1].'">'.($num-$total).'. '.$row2[3].'</option>';
}
$tfoot[4000]=$tfoot[4000].'</select>';*/
$tfoot[4000]=$tfoot[4000].'<input type="text" name="exps_cate" id="exps_cate" Onkeydown="CheckEnter(this)" >
</td>
<td class="style2"><input type="text" name="exps_cust" id="exps_cust" size="17" Onkeydown="CheckEnter(this)" ></td>
<td class="style2"><input type="text" name="exps_caus" id="exps_caus" size="17" Onkeydown="CheckEnter(this)" ></td>
<td class="style2"><input type="text" name="cash_mony" id="cash_mony" size="15" onkeypress="Keycode(event,this);" Onkeydown="CheckEnter(this)" onkeyup="SumAmount(this);" style="ime-mode:disabled"></td>
<td class="style2"><input type="button" onclick="CheckCont()" value="저장" ></td>
</tr>
</tfoot>';
$thead[4002]='<table border="1" style="text-align:center;width:100%">
<thead>
<tr>
<td class="style2">선택</td>
<td class="style2">이용카드</td>
<td class="style2">가맹점</td>
<td class="style2">내역</td>
<td class="style2">금액</td>
<td class="style2"></td>
</tr>
</thead>';
$thead[4003]=$thead[4002];
$tfoot[4002]='<tfoot><input type="hidden" name="exps_gubn" id="exps_gubn" value="" >
<tr><input type="hidden" name="no" id="no" value="" ><input type="hidden" name="etc" id="etc" value="" >
<td class="style2"><input type="hidden" name="exps_code" id="exps_code" value="" ></td>
<td class="style2">
<select id="exps_cate" name="exps_cate" onchange="CheckEnter(this);" class="clist">
<option value="0" selected="selected">선택</option>
<option value="2201">1. 하나BC</option>
<option value="2202">2. 현대비자</option>
</select>
</td>
<td class="style2"><input type="text" name="exps_cust" id="exps_cust" size="17" Onkeydown="CheckEnter(this)" ></td>
<td class="style2"><input type="text" name="exps_caus" id="exps_caus" size="17" Onkeydown="CheckEnter(this)" ></td>
<td class="style2"><input type="text" name="cash_mony" id="cash_mony" size="15" onkeypress="Keycode(event,this);" Onkeydown="CheckEnter(this)" onkeyup="SumAmount(this);" style="ime-mode:disabled" ></td>
<td class="style2"><input type="button" onclick="CheckCont()" value="저장" ></td>
</tr>
</tfoot>
</table>';
$tfoot[4003]=$tfoot[4002];
/*
Function: inquiry
inquiry
*/
function inquiry($exps_code,$start_date,$end_date)
{
global $connect, $tfoot, $thead;
$objResponse = new xajaxResponse();
$query="inquiry".$start_date.$end_date;
$start_date=str_replace("-","",$start_date);// '-' 제거
$end_date=str_replace("-","",$end_date);// '-' 제거
$inputDiv=$thead[$exps_code].$tfoot[$exps_code].'</table>';
$selSql="SELECT * FROM `t_closedsale` where `reg_date` = ".$start_date;
$result = mysql_query($selSql, $connect);
$rows = mysql_fetch_row($result);
if($rows[25]!="Y"){
$objResponse->assign('input', 'innerHTML', $inputDiv);
}else{
$objResponse->assign('input', 'innerHTML', '<input type="hidden" name="exps_code" id="exps_code" value="4000" >');
}
$updated=selectSale($exps_code,$start_date,$end_date);
$objResponse->assign('div2', 'innerHTML', $query);
$objResponse->assign('content', 'innerHTML', $updated);
$objResponse->call('bottom');//div scolling
return $objResponse;
}
/*
Function: parent
parent
*/
function parent($exps_code){
global $thead, $tfoot, $connect, $logout;
$objResponse = new xajaxResponse();
$inputDiv=$thead[$exps_code].$tfoot[$exps_code].'</table>';
$cTime=time();
$setTime=date("Y-m-d",$cTime);
$date_input=str_replace("-","",$setTime);// '-' 제거
$updated=selectSale($exps_code,$date_input,$date_input).'</table>';
$menuDiv='<a href="pay.php">수납</a>';
if($_SESSION['session_userid']=="admin"){
$menuDiv=$menuDiv.' <a href="view.php">검토</a> <a href="report.php">보고서<a> ';
}
$menuDiv=$menuDiv.' '.$logout.'<HR>
<a href="pay.php">수입부 입력</a> <a href="exp.php">지출부 입력</a> <a href="static.php">지출부 집계</a> <a href="sum.php">일정산<a><hr />
<a href="exp.php">일지출(피부과)</a> <a href="#" onclick="xajax_parent(4001)">일지출(코스메틱)</a> <a href="#" onclick="xajax_parent(4002)">카드(법인)</a> <a href="#" onclick="xajax_parent(4003)">카드(원장개인)</a> ';
$objResponse->assign('date_input', 'value', $setTime);
$objResponse->assign('content', 'innerHTML', $updated);
$selSql="SELECT * FROM `t_closedsale` where `reg_date` = ".$date_input;
$result = mysql_query($selSql, $connect);
$rows = mysql_fetch_row($result);
if($rows[25]!="Y"){
if($exps_code!=4000)
$objResponse->assign('input', 'innerHTML', $inputDiv);
}else{
$objResponse->assign('input', 'innerHTML', '<input type="hidden" name="exps_code" id="exps_code" value="4000" >');
}
$objResponse->assign('menu', 'innerHTML', $menuDiv);
$objResponse->assign('exps_code', 'value', $exps_code);
$objResponse->call('pp');
return $objResponse;
}
/*
Function: preview
preview
*/
function preview(){
global $theadC, $tfootC, $thead, $tfoot, $connect;
$objResponse = new xajaxResponse();
$updated='<div style="width:100%;text-align:right;background-color:white;"><a href="#" onclick="previewH();">닫기</a></div><table border="1" style="text-align:center;width:100%;background-color:white;">';
$updated=$updated.'<tr>
<td class="style2">카테고리</td>
<td class="style2">항목</td>
<td class="style2">합계</td>
</tr>';
//보험
$selSql="select `cash_mony`,`cscd_mony`,`card_mony`,`yet__mony` from pearl_pay where `sale_code` = '1001' and `insu_code` = '0101' and `date` between '".mktime(0, 0, 0, intval(date('m')), 1, intval(date('Y')))."' and '".mktime(0, 0, 0, intval(date('m'))+1, 0, intval(date('Y')))."' order by no asc";
$result = mysql_query($selSql, $connect);
$total = mysql_affected_rows(); // 총 레코드 수
$num=$total;
while($total--){
$row = mysql_fetch_row($result);
$sum_cash=$sum_cash+$row[0];
$sum_cscd=$sum_cscd+$row[1];
$sum_card=$sum_card+$row[2];
$sum_yet=$sum_yet+$row[3];
}
$sum_ins=$sum_cash+$sum_cscd+$sum_card+$sum_yet;
$updated=$updated.'<tr>
<td class="style2">보험</td>
<td class="style2">현금</td>
<td class="style2">'.comma($sum_cash).'</td>
</tr>';
$updated=$updated.'<tr>
<td class="style2">보험</td>
<td class="style2">현금영수증</td>
<td class="style2">'.comma($sum_cscd).'</td>
</tr>';
$updated=$updated.'<tr>
<td class="style2">보험</td>
<td class="style2">카드</td>
<td class="style2">'.comma($sum_card).'</td>
</tr>';
$updated=$updated.'<tr>
<td class="style2">보험</td>
<td class="style2">미납</td>
<td class="style2">'.comma($sum_yet).'</td>
</tr>';
$updated=$updated.'<tr>
<td class="style3">보험</td>
<td class="style3">소계</td>
<td class="style3">'.comma($sum_ins).'</td>
</tr>';
//일반
$selSql="select `cash_mony`,`cscd_mony`,`card_mony`,`yet__mony` from pearl_pay where `sale_code` = '1001' and `insu_code` = '0102' and `date` between '".mktime(0, 0, 0, intval(date('m')), 1, intval(date('Y')))."' and '".mktime(0, 0, 0, intval(date('m'))+1, 0, intval(date('Y')))."' order by no asc";
$result = mysql_query($selSql, $connect);
$total = mysql_affected_rows(); // 총 레코드 수
$num=$total;
$sum_cash=0;
$sum_cscd=0;
$sum_card=0;
$sum_yet=0;
while($total--){
$row = mysql_fetch_row($result);
$sum_cash=$sum_cash+$row[0];
$sum_cscd=$sum_cscd+$row[1];
$sum_card=$sum_card+$row[2];
$sum_yet=$sum_yet+$row[3];
}
$sum_nin=$sum_cash+$sum_cscd+$sum_card+$sum_yet;
$updated=$updated.'<tr>
<td class="style2">일반</td>
<td class="style2">현금</td>
<td class="style2">'.comma($sum_cash).'</td>
</tr>';
$updated=$updated.'<tr>
<td class="style2">일반</td>
<td class="style2">현금영수증</td>
<td class="style2">'.comma($sum_cscd).'</td>
</tr>';
$updated=$updated.'<tr>
<td class="style2">일반</td>
<td class="style2">카드</td>
<td class="style2">'.comma($sum_card).'</td>
</tr>';
$updated=$updated.'<tr>
<td class="style2">일반</td>
<td class="style2">미납</td>
<td class="style2">'.comma($sum_yet).'</td>
</tr>';
$updated=$updated.'<tr>
<td class="style3">일반</td>
<td class="style3">소계</td>
<td class="style3">'.comma($sum_nin).'</td>
</tr>';
//진료실
$updated=$updated.'<tr>
<td class="style2">진료실</td>
<td class="style2">이름</td>
<td class="style2">'.comma($sum_ins+$sum_nin).'</td>
</tr>';
$updated=$updated.'<tr>
<td class="style3">진료실</td>
<td class="style3">소계</td>
<td class="style3">'.comma($sum_ins+$sum_nin).'</td>
</tr>';
//코스메틱
$selSql="select `cash_mony`,`cscd_mony`,`card_mony`,`yet__mony` from pearl_pay where `sale_code` = '1002' and `date` between '".mktime(0, 0, 0, intval(date('m')), 1, intval(date('Y')))."' and '".mktime(0, 0, 0, intval(date('m'))+1, 0, intval(date('Y')))."' order by no asc";
$result = mysql_query($selSql, $connect);
$total = mysql_affected_rows(); // 총 레코드 수
$num=$total;
$sum_cash=0;
$sum_cscd=0;
$sum_card=0;
$sum_yet=0;
while($total--){
$row = mysql_fetch_row($result);
$sum_cash=$sum_cash+$row[0];
$sum_cscd=$sum_cscd+$row[1];
$sum_card=$sum_card+$row[2];
$sum_yet=$sum_yet+$row[3];
}
$updated=$updated.'<tr>
<td class="style2">코스메틱</td>
<td class="style2">현금</td>
<td class="style2">'.comma($sum_cash).'</td>
</tr>';
$updated=$updated.'<tr>
<td class="style2">코스메틱</td>
<td class="style2">현금영수증</td>
<td class="style2">'.comma($sum_cscd).'</td>
</tr>';
$updated=$updated.'<tr>
<td class="style2">코스메틱</td>
<td class="style2">카드</td>
<td class="style2">'.comma($sum_card).'</td>
</tr>';
$updated=$updated.'<tr>
<td class="style2">코스메틱</td>
<td class="style2">미납</td>
<td class="style2">'.comma($sum_yet).'</td>
</tr>';
$updated=$updated.'<tr>
<td class="style3">코스메틱</td>
<td class="style3">소계</td>
<td class="style3">'.comma($sum_cash+$sum_cscd+$sum_card+$sum_yet).'</td>
</tr>';
$updated=$updated.'</table>';
$objResponse->assign('pdiv', 'innerHTML', $updated);
$objResponse->assign('div2', 'innerHTML', $selSql);
$objResponse->call('preview');
return $objResponse;
}
/*
Function: editBt
editBt
*/
function editBt($no,$exps_code)
{
global $thead, $tfoot, $connect;;
$objResponse = new xajaxResponse();
$selSql="select * from pearl_exp where `no` = ".$no;
$result = mysql_query($selSql, $connect);
$row = mysql_fetch_row($result);
switch($row[2]){
case "0" :
$sel[0]='selected="selected"';
break;
case "1" :
$sel[1]='selected="selected"';
break;
}
if($exps_code==4000){
$query="SELECT `no`, `exps_name` FROM `pearl_expc` WHERE `exps_cate` = '".$row[3]."'";
$resultC = mysql_query($query, $connect);
$rowc = mysql_fetch_row($resultC);
$row[3]=$rowc[0].". ".$rowc[1];
}
$objResponse->assign('no', 'value', $row[0]);
$objResponse->assign('exps_code', 'value', $row[1]);
$objResponse->assign('exps_gubn', 'value', $row[2]);
$objResponse->assign('exps_cate', 'value', $row[3]);
$objResponse->assign('exps_cust', 'value', $row[4]);
$objResponse->assign('exps_caus', 'value', $row[5]);
$objResponse->assign('cash_mony', 'value', $row[6]);
$objResponse->call('top()');
$reg_date=substr($row[7],0,4);
$reg_date=$reg_date."-".substr($row[7],4,2);
$reg_date=$reg_date."-".substr($row[7],6,2);
$query="edit";
$objResponse->assign('date_input', 'value', $reg_date);
$objResponse->assign('div2', 'innerHTML', $query);
return $objResponse;
}
/*
Function: selectSale
seclectSale
*/
function selectSale($exps_code,$start_date,$end_date)
{
global $thead, $connect;
$selSql="SELECT * FROM `t_closedsale` where `reg_date` = ".$start_date;
$resultC = mysql_query($selSql, $connect);
$rowc = mysql_fetch_row($resultC);
$selSql="select * from pearl_exp where `exps_code` = '".$exps_code."' and `reg_date` between '".$start_date."' and '".$end_date."' order by reg_date asc";
$result = mysql_query($selSql, $connect);
$total = mysql_affected_rows(); // 총 레코드 수
$num=$total;
$updated=$thead[$exps_code].'<tbody>';
while($total--){
$row = mysql_fetch_row($result);
switch($row[2]){
case "0" :
$row[2]="현금";
break;
case "1" :
$row[2]="통장";
break;
}
$selSql2="select `exps_name` from pearl_expc where `exps_cate` = '".$row[3]."'";
$result2 = mysql_query($selSql2, $connect);
$row2 = mysql_fetch_row($result2);
$reg_date=substr($row[7],2,2);
$reg_date=$reg_date."/".substr($row[7],4,2);
$reg_date=$reg_date."/".substr($row[7],6,2);
$updated=$updated.'<tr>
<td class="style2">'.$reg_date.'</td>';
if($exps_code==4000 || $exps_code==4001)
$updated=$updated.'<td class="style2">'.$row[2].'</td>';
$updated=$updated.'<td class="style2">'.$row2[0].'</td>';
$updated=$updated.'<td class="cash">'.$row[4].'</td>';
$updated=$updated.'<td class="style2">'.$row[5].'</td>';
$updated=$updated.'<td class="style2">'.comma($row[6]).'</td>';
if($rowc[25]!="Y"){
$updated=$updated.'<td class="style2"><input type="button" value="E" onclick="xajax_editBt('.$row[0].','.$row[1].')" style="width:30px;"><input type="button" value="D" onclick="xajax_deleteId('.$row[0].','.$row[1].', xajax.$(\'date_input\').value,xajax.$(\'date_input\').value)" style="width:30px;"></td>';
}else{
$updated=$updated.'<td>마감(요청)</td>';
}
$updated=$updated.'</tr>';
}
$updated=$updated."</table>";
return $updated;
}
/*
Function: deleteId
delete
*/
function deleteId($id,$exps_code,$date_start,$date_end)
{
global $thead, $tfoot, $connect;
$objResponse = new xajaxResponse();
$query="delete from `pearlclinic`.`pearl_exp` where `no`=".$id;
$execQue = mysql_query($query, $connect);
$date_start=str_replace("-","",$date_start);// '-' 제거
$date_end=str_replace("-","",$date_end);// '-' 제거
$updated=selectSale($exps_code,$date_start,$date_end).'</table>';
$inputDiv=$thead[$exps_code].$tfoot[$exps_code].'</table>';
$objResponse->assign('div2', 'innerHTML', $query);
$objResponse->assign('content', 'innerHTML', $updated);
$objResponse->assign('input', 'innerHTML', $inputDiv);
$objResponse->call('bottom');//div scolling
return $objResponse;
}
/*
Function: savePay
save
*/
function savePay($no,$exps_code,$exps_gubn,$exps_cate,$exps_cust,$exps_caus,$cash_mony,$reg_date,$etc)
{
global $thead, $tfoot, $theadE, $tfootE, $connect;
$objResponse = new xajaxResponse();
$c_time=time();
$date_input=str_replace("-","",$reg_date);// '-' 제거
$cash_mony=str_replace(",","",$cash_mony);// ',' 제거
//자동완성기능을 쓸 경우 문자열->코드
if($exps_code==4000){
$ec=explode(". ",$exps_cate);
$query="SELECT `exps_cate` FROM `pearl_expc` WHERE `exps_name` = '".$ec[1]."'";
$resultC = mysql_query($query, $connect);
$rowc = mysql_fetch_row($resultC);
$exps_cate=$rowc[0];
}
$exps_cust=htmlspecialchars($exps_cust);
$exps_caus=htmlspecialchars($exps_caus);
if($no){
$query="UPDATE `pearl_exp` SET `exps_code` = '".$exps_code."', `exps_gubn` = '".$exps_gubn."', `exps_cate` = '".$exps_cate."',`exps_cust` = '".$exps_cust."',`exps_caus` = '".$exps_caus."',`reg_date` = '".$date_input."',`date` = '".$c_time."',`etc` = '".$etc."' WHERE `no` =".$no;
}else{
$query="INSERT INTO `pearl_exp` ( `no` , `exps_code` , `exps_gubn` , `exps_cate` , `exps_cust` , `exps_caus` , `cash_mony` , `reg_date` , `date` , `etc` ) VALUES ('', '".$exps_code."', '".$exps_gubn."', '".$exps_cate."', '".$exps_cust."', '".$exps_caus."', '".$cash_mony."', '".$date_input."', '".$c_time."', '".$etc."');";
}
$saveQue = mysql_query($query, $connect);
$inputDiv=$thead[$exps_code].$tfoot[$exps_code].'</table>';
$updated=$updated.selectSale($exps_code,$date_input,$date_input).'</table>';
$objResponse->call('fr.reset()');
$objResponse->assign('div2', 'innerHTML', $query);
$objResponse->assign('content', 'innerHTML', $updated);
$objResponse->call('bottom');//div scolling
return $objResponse;
}
/*
Section: Register functions
- <savePay>
- <deleteId>
- <preview>
- <ent>
*/
$reqSavePayBtn =& $xajax->registerFunction('savePay');
$reqDelBtn =& $xajax->registerFunction('deleteId');
$reqPreview =& $xajax->registerFunction('preview');
$reqParent =& $xajax->registerFunction('parent');
$reqInquiry =& $xajax->registerFunction('inquiry');
$reqEditBt =& $xajax->registerFunction('editBt');
/*
Section: processRequest
This will detect an incoming xajax request, process it and exit. If this is
not a xajax request, then it is a request to load the initial contents of the page
(HTML).
Everything prior to this statement will be executed upon each request (whether it
is for the initial page load or a xajax request. Everything after this statement
will be executed only when the page is first loaded.
*/
$xajax->processRequest();
echo '<?xml version="1.0" encoding="UTF-8"?>';
?>