6d4edfe02757fa3bce4ff7eb31151298e0923c41.svn-base
6.44 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
<? include $_SERVER["DOCUMENT_ROOT"] . "/common/classes/AdminRent.php" ?>
<? include $_SERVER["DOCUMENT_ROOT"] . "/admin/inc/php/popupHeader.php" ?>
<?
$obj = new AdminRent($_REQUEST, "");
$info = $obj->getInfoOfRequstCharge();
$building_list = $obj->getListOfBuildingForRequest();
$rurl = pack("H*", $_REQUEST["rurl"]) ;
?>
<script type="text/javascript">
var _rurl = "<?=$rurl?>";
var _no = "<?=$_REQUEST[no]?>";
$(document).ready(function(){
//=====프레입웤 변수들==================================================================================//
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 }) ;
var dates = $('.jRsvDate').datepicker({
showMonthAfterYear:true,
inline: true,
changeMonth: true,
changeYear: true,
dateFormat : 'yy-mm-dd',
dayNamesMin:['일', '월', '화', '수', '목', '금', ' 토'],
monthNames:['1월','2월','3월','4월','5월','6월','7 월','8월','9월','10월','11월','12월'],
monthNamesShort:['1월','2월','3월','4월','5월','6월','7월','8월','9월','10월','11월','12월'],
showButtonPanel: true, currentText: '오늘 ' , closeText: '닫기',
onSelect: function(selectedDate) {
}
});
if($("#building_name").val() != ""){
$.ajax({
url : "/action_front.php?cmd=AdminRent.getListOfRoomForChargeSend",
async : true,
cache : false,
dataType : "json",
data : {
"no" : parseInt($("#building_name option:selected").attr("no"))
},
success : function(data){
for(var i=0; i < data.length; i++){
if("<?=$info["room_name"]?>"==data[i]["name"]){
$("#room_name").append("<option selected>"+data[i]["name"]+"</option>");
}
else{
$("#room_name").append("<option>"+data[i]["name"]+"</option>");
}
}
},
error:function(request,status,error){
alert("호실 정보를 불러오는 중 오류가 발생하였습니다.");
}
});
}
$(".jClose").click2(function(){
window.close();
});
$("#building_name").change(function(){
$("select[name='room_name'] option").remove();
$.ajax({
url : "/action_front.php?cmd=AdminRent.getListOfRoomForChargeSend",
async : true,
cache : false,
dataType : "json",
data : {
"no" : parseInt($("#building_name option:selected").attr("no"))
},
success : function(data){
for(var i=0; i < data.length; i++){
$("#room_name").append("<option>"+data[i]["name"]+"</option>");
}
},
error:function(request,status,error){
alert("호실 정보를 불러오는 중 오류가 발생하였습니다.");
}
});
});
$(".jSend").click2(function(){
var data = $("#jData").serialize();
$.ajax({
url : "/action_front.php?cmd=AdminRent.saveRequestCharge",
async : false,
cache : false,
dataType : "json",
data : data,
success : function(data){
var building_name=$("#building_name").val();
var room_name=$("#room_name").val();
if(confirm("전송하시겠습니까?"))
{
$.ajax({
url : "/action_front.php?cmd=AdminPush.sendPushForChargeSend",
async : true,
cache : false,
dataType : "json",
data : {
"building_name" : building_name,
"room_name" : room_name
},
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();
}
});
}
}
});
});
}) ;
</script>
<div id="Contents" style="width:500px;">
<div class="data" style="width:100%;">
<form id="jData">
<input type="hidden" name="no" value="<?=$_REQUEST[no]?>" />
<table class="datav" style="width:100%;">
<colgroup>
<col width="20%" />
<col width="30%" />
<col width="20%" />
<col width="30%" />
</colgroup>
<tr>
<!-- 건물명 -->
<th style="height:25px;">건물명</th>
<td class="center">
<select name="building_name" class="wm b_name" id="building_name">
<? for($i=0; $i<sizeof($building_list); $i++){ ?>
<option no='<?=$building_list[$i]["no"]?>' value='<?=$building_list[$i]["name"]?>' <?=$info["building_name"] == $building_list[$i]["name"] ? "SELECTED" : ""?>><?=$building_list[$i]["name"]?></option>
<? } ?>
</select>
</td>
<!-- 호실 -->
<th style="height:25px;">호실</th>
<td class="center">
<select name="room_name" class="wm" id="room_name" value="<?=$info["room_name"]?>">
</select>
</td>
</tr>
<tr>
<!-- 신청일 -->
<th style="height:25px;">신청일</th>
<td class="center">
<?
$formattedDate = date('Y-m-d', strtotime($info["request_date"]));
if($formattedDate == "1970-01-01") $formattedDate = "";
?>
<input type="text" name="request_date" value="<?=$formattedDate?>" class="jRsvDate" readonly="true" />
</td>
<!-- 처리일 -->
<th style="height:25px;">처리일</th>
<td class="center">
<?
$formattedDate = date('Y-m-d', strtotime($info["handled_date"]));
if($formattedDate == "1970-01-01") $formattedDate = "";
?>
<input type="text" name="handled_date" value="<?=$formattedDate?>" class="jRsvDate" readonly="true" />
</td>
</tr>
<tr>
<!-- 처리금액 -->
<th style="height:25px;">처리금액</th>
<td class="center" colspan="3">
<input type="number" name="charge" value="<?=$info["charge"]?>" class="ws">
</td>
</tr>
<tr>
<!-- 처리내용 -->
<th style="height:25px;">처리내용</th>
<td class="center" colspan="3">
<textarea rows="20" name="info" style="width:100%; resize:vertical;" ><?=$info["info"]?></textarea>
</td>
</tr>
</table>
</form>
<div class="btngroupcenter">
<span class="button bigrounded blue jSend">확인 발송</span>
<span class="button bigrounded blue jClose">닫기</span>
</div>
</div>
</div>