billEndSend.php
11.2 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
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
<? include $_SERVER["DOCUMENT_ROOT"] . "/common/classes/AdminRent.php" ?>
<? include $_SERVER["DOCUMENT_ROOT"] . "/common/classes/AdminOperate.php" ?>
<? include $_SERVER["DOCUMENT_ROOT"] . "/admin/inc/php/popupHeader.php" ?>
<?
$obj = new AdminOperate($_REQUEST, "");
$info = $obj->getInfoOfEnd();
$rurl = pack("H*", $_REQUEST["rurl"]) ;
?>
<script type="text/javascript">
var _rurl = "<?=$rurl?>";
var _no = "<?=$_REQUEST[no]?>";
function getTotal(){
var totalValue = 0;
totalValue += $("input[name='daily_fee']").val() == ""? 0: parseInt($("input[name='daily_fee']").val());
totalValue += $("input[name='utility_fee']").val() == ""? 0: parseInt($("input[name='utility_fee']").val());
totalValue += $("input[name='maintenance_fee']").val() == ""? 0: parseInt($("input[name='maintenance_fee']").val());
totalValue += $("input[name='leaving_fee']").val() == ""? 0: parseInt($("input[name='leaving_fee']").val());
totalValue += $("input[name='disposal_fee']").val() == ""? 0: parseInt($("input[name='disposal_fee']").val());
totalValue += $("input[name='damage_fee_1']").val() == ""? 0: parseInt($("input[name='damage_fee_1']").val());
totalValue += $("input[name='damage_fee_2']").val() == ""? 0: parseInt($("input[name='damage_fee_2']").val());
totalValue += $("input[name='damage_fee_3']").val() == ""? 0: parseInt($("input[name='damage_fee_3']").val());
totalValue += $("input[name='damage_fee_4']").val() == ""? 0: parseInt($("input[name='damage_fee_4']").val());
totalValue += $("input[name='cancelation_fee']").val() == ""? 0: parseInt($("input[name='cancelation_fee']").val());
$("#total").attr("value", totalValue);
var balance = <?=$info["balance"]?> == ""? 0 : parseInt(<?=$info["balance"]?>);
balance -= $("input[name='subtraction_total']").val() == ""? 0: parseInt($("input[name='subtraction_total']").val());
$("#balance").attr("value", balance);
}
function getUsage(){
var totalEValue=$("input[name='electricity_usage']").val() == ""? 0: parseInt($("input[name='electricity_usage']").val());
var totalGValue=$("input[name='gas_usage']").val() == ""? 0: parseInt($("input[name='gas_usage']").val());
var totalWValue=$("input[name='water_usage']").val() == ""? 0: parseInt($("input[name='water_usage']").val());
totalEValue -= $("input[name='electricity_usage_lm']").val() == ""? 0: parseInt($("input[name='electricity_usage_lm']").val());
if($("input[name='electricity_usage_lm']").val() == ""){
totalEValue=$("input[name='electricity_usage']").val() == ""? 0: parseInt($("input[name='electricity_usage']").val());
}
totalGValue -= $("input[name='gas_usage_lm']").val() == ""? 0: parseInt($("input[name='gas_usage_lm']").val());
if($("input[name='gas_usage_lm']").val() == ""){
totalGValue=$("input[name='gas_usage']").val() == ""? 0: parseInt($("input[name='gas_usage']").val());
}
totalWValue -= $("input[name='water_usage_lm']").val() == ""? 0: parseInt($("input[name='water_usage_lm']").val());
if($("input[name='water_usage_lm']").val() == ""){
totalWValue=$("input[name='water_usage']").val() == ""? 0: parseInt($("input[name='water_usage']").val());
}
$("#elec_total_usage").attr("value", totalEValue);
$("#gas_total_usage").attr("value", totalGValue);
$("#water_total_usage").attr("value", totalWValue);
}
$(document).ready(function(){
getUsage();
getTotal();
//=====프레입웤 변수들==================================================================================//
var FORM_TARGET_CLS_NM = ".data" ; // 폼을 동적 wrap 할 타겟 ID이름
var FORM_NAME = "alf" ; // 폼이름
var FORM_METHOD = "POST" ; // 폼 메쏘드
var FORM_USE_FILE = false ; // 파일폼 사용 여부
var FORM_ACTION = "/action_front.php" ;
var NEXT_CMD = "" ; // 다은 수행 할 cmd
//=====================================================================================================//
var jForm = $(FORM_TARGET_CLS_NM).mf({ "name" : FORM_NAME , "method" : FORM_METHOD , "action" : FORM_ACTION , "useFile" : FORM_USE_FILE }) ;
$(".jCancel").click2(function(){
location.href = _rurl;
});
$(".jClose").click2(function(){
window.close();
});
$(".jSend").click2(function(){
var data = $("#jData").serialize();
$.ajax({
url : "/action_front.php?cmd=AdminOperate.saveEnd",
async : false,
cache : false,
dataType : "json",
data : data,
success : function(data){
var room_fk=<?=$_REQUEST["no"]?>;
if(confirm("전송하시겠습니까?"))
{
$.ajax({
url : "/action_front.php?cmd=AdminPush.sendPushForBillSend",
async : true,
cache : false,
dataType : "json",
data : {
"room_fk" : room_fk
},
success : function(data){
alert(data.returnMessage);
window.opener.location.reload();
window.close();
},
error:function(request,status,error){
alert("code:"+request.status+"\n"+"message:"+request.responseText+"\n"+"error:"+error);
location.reload();
}
});
}
}
});
});
$(".wb").change(function(e){
getTotal();
});
$(".ws").change(function(e){
getUsage();
});
}) ;
</script>
<div id="Contents" style="width:700px;">
<p style="margin-bottom:5px;">(<?=$info["Rname"]?> 호) <?=$info["contractor_name"]?> 귀하</p>
<p style="margin-bottom:5px;">정산날짜 : <?=$info["leaving_y"]?>년 <?=$info["leaving_m"]?>월 <?=$info["leaving_d"]?>일</p>
<div class="data" style="width:100%;">
<form id="jData">
<input type="hidden" name="no" value="<?=$_REQUEST[no]?>" />
<input type="hidden" name="key" value="<?=$_REQUEST["key"]?>" />
<input type="hidden" name="user_fk" value="<?=$info["user_fk"]?>" />
<input type="hidden" name="month" value="<?=$info["leaving_y"]."-".$info["leaving_m"]."-".$info["leaving_d"]?>" />
<table class="datav" style="width:100%;">
<colgroup>
<col width="30%" />
<col width="25%" />
<col width="25%" />
<col width="25%" />
</colgroup>
<thead>
<tr>
<th style="height:25px;">내역</th>
<th style="height:25px;">예치금총액</th>
<th style="height:25px;">차감액</th>
<th style="height:25px;">잔액</th>
</tr>
</thead>
<tbody>
<tr>
<th style="height:25px;">예치금 혹은 보증금</th>
<!-- 예치금총액 -->
<td>
<input type="text" class="ws" value="<?=$info["balance"]?>" readonly />
</td>
<!-- 차감액 -->
<td>
<input type="text" name="subtraction_total" id="total" class="ws" value="<?=$info["subtraction_total"]?>" readonly/>
</td>
<!-- 잔액 -->
<td>
<input type="text" name="balance" id="balance" class="ws" value="<?=$info["Ebalance"]?>" readonly/>
</td>
</tr>
</tbody>
</table>
<p style="margin-top:20px;">차감 세부내용</p>
<table class="datav" style="width:100%;margin-top:10px;">
<colgroup>
<col width="20%" />
<col width="30%" />
<col width="20%" />
<col width="30%" />
</colgroup>
<tr>
<!-- 일사용료 -->
<th style="height:25px;">일사용료</th>
<td class="center">
<input type="text" name="daily_fee" class="wb" value="<?=$info["daily_fee"]?>" />
</td>
<!-- 파손비1 -->
<th style="height:25px;">파손비1</th>
<td class="center">
<input type="text" name="damage_fee_1" class="wb" value="<?=$info["damage_fee_1"]?>" />
</td>
</tr>
<tr>
<!-- 공과금 -->
<th style="height:25px;">공과금</th>
<td class="center">
<input type="text" name="utility_fee" class="wb" value="<?=$info["utility_fee"]?>" />
</td>
<!-- 파손비2 -->
<th style="height:25px;">파손비2</th>
<td class="center">
<input type="text" name="damage_fee_2" class="wb" value="<?=$info["damage_fee_2"]?>" />
</td>
</tr>
<tr>
<!-- 관리비 -->
<th style="height:25px;">관리비</th>
<td class="center">
<input type="text" name="maintenance_fee" class="wb" value="<?=$info["maintenance_fee"]?>" />
</td>
<!-- 파손비3 -->
<th style="height:25px;">파손비3</th>
<td class="center">
<input type="text" name="damage_fee_3" class="wb" value="<?=$info["damage_fee_3"]?>" />
</td>
</tr>
<tr>
<!-- 퇴실비 -->
<th style="height:25px;">퇴실비</th>
<td class="center">
<input type="text" name="leaving_fee" class="wb" value="<?=$info["leaving_fee"]?>" />
</td>
<!-- 파손비4 -->
<th style="height:25px;">파손비4</th>
<td class="center">
<input type="text" name="damage_fee_4" class="wb" value="<?=$info["damage_fee_4"]?>" />
</td>
</tr>
<tr>
<!-- 폐기물비 -->
<th style="height:25px;">폐기물비</th>
<td class="center">
<input type="text" name="disposal_fee" class="wb" value="<?=$info["disposal_fee"]?>" />
</td>
<!-- 위약금 -->
<th style="height:25px;">위약금</th>
<td class="center">
<input type="text" name="cancelation_fee" class="wb" value="<?=$info["cancelation_fee"]?>" />
</td>
</tr>
</table>
<p style="margin-top:20px;">공과금 내역</p>
<table class="datav" style="width:75%;margin-top:10px;">
<colgroup>
<col width="20%" />
<col width="30%" />
<col width="20%" />
<col width="30%" />
</colgroup>
<thead>
<!-- 항목 제목 -->
<tr>
<th style="height:25px;">항목</th>
<th style="height:25px;">전월</th>
<th style="height:25px;">당월</th>
<th style="height:25px;">사용량</th>
</tr>
</thead>
<tbody>
<!-- 전기 -->
<tr>
<th style="height:25px;">전기</th>
<td class="center">
<input type="text" name="electricity_usage_lm" class="ws" value="<?=$info["electricity_usage_lm"]?>">
</td>
<td class="center">
<input type="text" name="electricity_usage" class="ws" value="<?=$info["electricity_usage"]?>">
</td>
<td class="center">
<input type="text" name="electricity_total_usage" id="elec_total_usage" class="ws" readonly />
</td>
</tr>
<!-- 가스 -->
<tr>
<th style="height:25px;">가스</th>
<td class="center">
<input type="text" name="gas_usage_lm" class="ws" value="<?=$info["gas_usage_lm"]?>">
</td>
<td class="center">
<input type="text" name="gas_usage" class="ws" value="<?=$info["gas_usage"]?>">
</td>
<td class="center">
<input type="text" name="gas_total_usage" id="gas_total_usage" class="ws" readonly/>
</td>
</tr>
<!-- 수도 -->
<tr>
<th style="height:25px;">수도</th>
<td class="center">
<input type="text" name="water_usage_lm" class="ws" value="<?=$info["water_usage_lm"]?>">
</td>
<td class="center">
<input type="text" name="water_usage" class="ws" value="<?=$info["water_usage"]?>">
</td>
<td class="center">
<input type="text" name="water_total_usage" id="water_total_usage" class="ws" readonly/>
</td>
</tr>
</tbody>
</table>
</form>
<div class="btngroupcenter">
<span class="button bigrounded blue jSend">확인 발송</span>
<?if($_REQUEST["key"] == ""){?>
<span class="button bigrounded blue jClose">닫기</span>
<?}else{?>
<span class="button bigrounded blue jCancel">닫기</span>
<?}?>
</div>
</div>
</div>