end of day commit
2.76 KB
2.68 KB
2.76 KB
2.68 KB
2.76 KB
2.68 KB
2.68 KB
2.09 KB
2.09 KB
2.76 KB
2.68 KB
2.76 KB
2.68 KB
2.09 KB
2.76 KB
2.68 KB
2.76 KB
2.68 KB
2.76 KB
2.68 KB
2.09 KB
2.76 KB
2.68 KB
2.09 KB
2.76 KB
2.76 KB
2.76 KB
2.68 KB
2.09 KB
2.76 KB
2.68 KB
2.76 KB
2.68 KB
2.76 KB
2.76 KB
2.09 KB
2.68 KB
2.76 KB
2.68 KB
2.09 KB
2.76 KB
2.68 KB
2.68 KB
2.76 KB
2.68 KB
2.76 KB
2.68 KB
2.76 KB
2.09 KB
2.76 KB
2.68 KB
12.5 KB
12.3 KB
12.5 KB
12.3 KB
12.5 KB
12.3 KB
12.3 KB
10.9 KB
10.9 KB
12.5 KB
12.3 KB
12.5 KB
12.3 KB
10.9 KB
12.5 KB
12.3 KB
12.5 KB
12.3 KB
12.5 KB
12.3 KB
10.9 KB
12.5 KB
12.3 KB
10.9 KB
12.5 KB
12.5 KB
12.5 KB
12.3 KB
10.9 KB
12.5 KB
12.3 KB
12.5 KB
12.3 KB
12.5 KB
12.5 KB
10.9 KB
12.3 KB
12.5 KB
12.3 KB
10.9 KB
12.5 KB
12.3 KB
12.3 KB
12.5 KB
12.3 KB
12.5 KB
12.3 KB
12.5 KB
10.9 KB
12.5 KB
12.3 KB
22.4 KB
12.3 KB
22.4 KB
12.3 KB
22.4 KB
12.3 KB
12.3 KB
21.1 KB
21.1 KB
22.4 KB
12.3 KB
22.4 KB
12.3 KB
21.1 KB
22.4 KB
12.3 KB
22.4 KB
12.3 KB
22.4 KB
12.3 KB
21.1 KB
22.4 KB
12.3 KB
21.1 KB
22.4 KB
22.4 KB
22.4 KB
12.3 KB
21.1 KB
22.4 KB
12.3 KB
22.4 KB
12.3 KB
22.4 KB
22.4 KB
21.1 KB
12.3 KB
22.4 KB
12.3 KB
21.1 KB
22.4 KB
12.3 KB
12.3 KB
22.4 KB
12.3 KB
22.4 KB
12.3 KB
22.4 KB
21.1 KB
22.4 KB
12.3 KB
33.7 KB
12.3 KB
33.7 KB
12.3 KB
33.7 KB
12.3 KB
12.3 KB
33.7 KB
33.7 KB
33.7 KB
12.3 KB
33.7 KB
12.3 KB
33.7 KB
33.7 KB
12.3 KB
33.7 KB
12.3 KB
33.7 KB
12.3 KB
33.7 KB
33.7 KB
12.3 KB
33.7 KB
33.7 KB
33.7 KB
33.7 KB
12.3 KB
33.7 KB
33.7 KB
12.3 KB
33.7 KB
12.3 KB
33.7 KB
33.7 KB
33.7 KB
12.3 KB
33.7 KB
12.3 KB
33.7 KB
33.7 KB
12.3 KB
12.3 KB
33.7 KB
12.3 KB
33.7 KB
12.3 KB
33.7 KB
33.7 KB
33.7 KB
12.3 KB
39.9 KB
12.3 KB
39.9 KB
12.3 KB
39.9 KB
12.3 KB
12.3 KB
41.2 KB
41.2 KB
39.9 KB
12.3 KB
39.9 KB
12.3 KB
41.2 KB
39.9 KB
12.3 KB
39.9 KB
12.3 KB
39.9 KB
12.3 KB
41.2 KB
39.9 KB
41.2 KB
12.3 KB
39.9 KB
12.3 KB
41.2 KB
39.9 KB
12.3 KB
12.3 KB
39.9 KB
12.3 KB
39.9 KB
12.3 KB
39.9 KB
41.2 KB
39.9 KB
12.3 KB
1 | <? include $_SERVER["DOCUMENT_ROOT"] . "/common/php/LoginUtil.php" ; ?> | 1 | <? include $_SERVER["DOCUMENT_ROOT"] . "/common/php/LoginUtil.php" ; ?> |
2 | <? include $_SERVER["DOCUMENT_ROOT"] . "/common/classes/ApiBase.php" ; ?> | 2 | <? include $_SERVER["DOCUMENT_ROOT"] . "/common/classes/ApiBase.php" ; ?> |
3 | <? include $_SERVER["DOCUMENT_ROOT"] . "/common/classes/ApiUser.php" ; ?> | 3 | <? include $_SERVER["DOCUMENT_ROOT"] . "/common/classes/ApiUser.php" ; ?> |
4 | <? include $_SERVER["DOCUMENT_ROOT"] . "/common/classes/ApiShop.php" ; ?> | ||
5 | <? include $_SERVER["DOCUMENT_ROOT"] . "/common/classes/ApiProcess.php" ; ?> | 4 | <? include $_SERVER["DOCUMENT_ROOT"] . "/common/classes/ApiProcess.php" ; ?> |
6 | <? include $_SERVER["DOCUMENT_ROOT"] . "/common/classes/ApiBoard.php" ; ?> | 5 | <? include $_SERVER["DOCUMENT_ROOT"] . "/common/classes/ApiBoard.php" ; ?> |
7 | <? include $_SERVER["DOCUMENT_ROOT"] . "/common/classes/AdminBase.php" ; ?> | 6 | <? include $_SERVER["DOCUMENT_ROOT"] . "/common/classes/AdminBase.php" ; ?> |
8 | <? include $_SERVER["DOCUMENT_ROOT"] . "/common/classes/Admin.php" ; ?> | 7 | <? include $_SERVER["DOCUMENT_ROOT"] . "/common/classes/Admin.php" ; ?> |
9 | <? include $_SERVER["DOCUMENT_ROOT"] . "/common/classes/AdminUser.php" ; ?> | 8 | <? include $_SERVER["DOCUMENT_ROOT"] . "/common/classes/AdminUser.php" ; ?> |
10 | <? include $_SERVER["DOCUMENT_ROOT"] . "/common/classes/AdminOperate.php" ; ?> | 9 | <? include $_SERVER["DOCUMENT_ROOT"] . "/common/classes/AdminVehicle.php" ; ?> |
10 | <? include $_SERVER["DOCUMENT_ROOT"] . "/common/classes/AdminCompany.php" ; ?> | ||
11 | <? include $_SERVER["DOCUMENT_ROOT"] . "/common/classes/AdminBoard.php" ; ?> | ||
11 | <? include $_SERVER["DOCUMENT_ROOT"] . "/common/classes/AdminPush.php" ; ?> | 12 | <? include $_SERVER["DOCUMENT_ROOT"] . "/common/classes/AdminPush.php" ; ?> |
12 | <? include $_SERVER["DOCUMENT_ROOT"] . "/common/classes/AdminEtc.php" ; ?> | 13 | <? include $_SERVER["DOCUMENT_ROOT"] . "/common/classes/AdminEtc.php" ; ?> |
13 | <? include $_SERVER["DOCUMENT_ROOT"] . "/common/classes/AdminRent.php" ; ?> | ||
14 | <? include $_SERVER["DOCUMENT_ROOT"] . "/common/php/AnyGo.php" ;?> | 14 | <? include $_SERVER["DOCUMENT_ROOT"] . "/common/php/AnyGo.php" ;?> |
15 | <? include $_SERVER["DOCUMENT_ROOT"] . "/common/classes/ApiStatic.php" ;?> | 15 | <? include $_SERVER["DOCUMENT_ROOT"] . "/common/classes/ApiStatic.php" ;?> |
16 | <? | 16 | <? | ... | ... |
1 | <? include $_SERVER["DOCUMENT_ROOT"] . "/common/classes/AdminUser.php" ?> | 1 | <? include $_SERVER["DOCUMENT_ROOT"] . "/common/classes/AdminBoard.php" ?> |
2 | <? include $_SERVER["DOCUMENT_ROOT"] . "/admin/inc/php/header.php" ?> | 2 | <? include $_SERVER["DOCUMENT_ROOT"] . "/admin/inc/php/header.php" ?> |
3 | <? include $_SERVER["DOCUMENT_ROOT"] . "/admin/inc/php/leftBoardManage.php" ?> | 3 | <? include $_SERVER["DOCUMENT_ROOT"] . "/admin/inc/php/leftBoardManage.php" ?> |
4 | <? | 4 | <? |
5 | $obj = new AdminUser($_REQUEST) ; | 5 | $obj = new AdminBoard($_REQUEST) ; |
6 | 6 | ||
7 | //$list = $obj->getListOfUser() ; | 7 | $list = $obj->getListOfBoard() ; |
8 | $boardType=$_REQUEST["boardType"]; | 8 | $boardType=$_REQUEST["boardType"]; |
9 | |||
10 | |||
9 | $vnum = $obj->virtualNum ; | 11 | $vnum = $obj->virtualNum ; |
10 | ?> | 12 | ?> |
11 | <script> | 13 | <script> |
... | @@ -59,7 +61,7 @@ | ... | @@ -59,7 +61,7 @@ |
59 | 61 | ||
60 | 62 | ||
61 | // 회원 탈퇴 | 63 | // 회원 탈퇴 |
62 | $(".jDelUser").click2(function(){ | 64 | $(".jDel").click2(function(){ |
63 | 65 | ||
64 | var no = $(this).attr("no"); | 66 | var no = $(this).attr("no"); |
65 | 67 | ||
... | @@ -73,11 +75,11 @@ | ... | @@ -73,11 +75,11 @@ |
73 | 75 | ||
74 | 76 | ||
75 | // 단체 삭제 | 77 | // 단체 삭제 |
76 | $(".jDelUserMulti").click2(function(){ | 78 | $(".jDelMulti").click2(function(){ |
77 | 79 | ||
78 | 80 | ||
79 | var noArr = new Array(); | 81 | var noArr = new Array(); |
80 | var noCount = $(".jUserNo:checked").length; | 82 | var noCount = $(".jNo:checked").length; |
81 | 83 | ||
82 | if(noCount == 0) | 84 | if(noCount == 0) |
83 | { | 85 | { |
... | @@ -90,10 +92,10 @@ | ... | @@ -90,10 +92,10 @@ |
90 | { | 92 | { |
91 | for(var i = 0; i < noCount; i++ ) | 93 | for(var i = 0; i < noCount; i++ ) |
92 | { | 94 | { |
93 | noArr[i] = $(".jUserNo:checked:eq(" + i + ")").val(); | 95 | noArr[i] = $(".jNo:checked:eq(" + i + ")").val(); |
94 | } | 96 | } |
95 | 97 | ||
96 | deleteUser(noArr); | 98 | deleteAction(noArr); |
97 | } | 99 | } |
98 | 100 | ||
99 | }); | 101 | }); |
... | @@ -121,24 +123,26 @@ | ... | @@ -121,24 +123,26 @@ |
121 | 123 | ||
122 | $("#jCheckAll").change(function(){ | 124 | $("#jCheckAll").change(function(){ |
123 | if($(this).is(":checked")) | 125 | if($(this).is(":checked")) |
124 | $(".jUserNo").prop("checked", true); | 126 | $(".jNo").prop("checked", true); |
125 | else | 127 | else |
126 | $(".jUserNo").prop("checked", false); | 128 | $(".jNo").prop("checked", false); |
127 | }); | 129 | }); |
128 | 130 | ||
129 | }) ; | 131 | }) ; |
130 | 132 | ||
131 | 133 | ||
132 | 134 | ||
133 | function deleteUser(noArr) | 135 | function deleteAction(noArr) |
134 | { | 136 | { |
137 | var boardType='<?=$_REQUEST["boardType"]?>'; | ||
135 | $.ajax({ | 138 | $.ajax({ |
136 | url : "/action_front.php?cmd=AdminUser.deleteUser", | 139 | url : "/action_front.php?cmd=AdminBoard.deleteBoard", |
137 | async : false, | 140 | async : false, |
138 | cache : false, | 141 | cache : false, |
139 | dataType : "json", | 142 | dataType : "json", |
140 | data : { | 143 | data : { |
141 | "no" : noArr | 144 | "no" : noArr, |
145 | "boardType" : boardType | ||
142 | }, | 146 | }, |
143 | success : function(data){ | 147 | success : function(data){ |
144 | alert("삭제되었습니다"); | 148 | alert("삭제되었습니다"); |
... | @@ -207,13 +211,13 @@ | ... | @@ -207,13 +211,13 @@ |
207 | <?=$vnum--?> | 211 | <?=$vnum--?> |
208 | </td> | 212 | </td> |
209 | <td class="center"> | 213 | <td class="center"> |
210 | <input type="checkbox" class="jUserNo" value="<?=$list[$i]["no"] ?>" > | 214 | <input type="checkbox" class="jNo" value="<?=$list[$i]["no"] ?>" > |
211 | </td> | 215 | </td> |
212 | <td class="center"> | 216 | <td class="center"> |
213 | 217 | <?=$list[$i]["title"]?> | |
214 | </td> | 218 | </td> |
215 | <td class="center"> | 219 | <td class="center"> |
216 | 220 | <?=$list[$i]["regDate"]?> | |
217 | </td> | 221 | </td> |
218 | <td class="center"> | 222 | <td class="center"> |
219 | <input type="button" class="button searchsmall white jView" value="상세보기" no="<?=$list[$i]["no"]?>" /> | 223 | <input type="button" class="button searchsmall white jView" value="상세보기" no="<?=$list[$i]["no"]?>" /> | ... | ... |
1 | <? include $_SERVER["DOCUMENT_ROOT"] . "/common/classes/AdminOperate.php" ?> | 1 | <? include $_SERVER["DOCUMENT_ROOT"] . "/common/classes/AdminBoard.php" ?> |
2 | <? include $_SERVER["DOCUMENT_ROOT"] . "/admin/inc/php/header.php" ?> | 2 | <? include $_SERVER["DOCUMENT_ROOT"] . "/admin/inc/php/header.php" ?> |
3 | <? include $_SERVER["DOCUMENT_ROOT"] . "/admin/inc/php/leftBoardManage.php" ?> | 3 | <? include $_SERVER["DOCUMENT_ROOT"] . "/admin/inc/php/leftBoardManage.php" ?> |
4 | <? | 4 | <? |
5 | $obj = new AdminOperate($_REQUEST, ""); | 5 | $obj = new AdminBoard($_REQUEST, ""); |
6 | //$info = $obj->getInfoOfShop(); | 6 | $info = $obj->getInfoOfBoard(); |
7 | 7 | ||
8 | //$cateCodeList = $obj->getShopCategoryCodeList(); | 8 | //$cateCodeList = $obj->getShopCategoryCodeList(); |
9 | //$shopImgList = $obj->getShopImgList($info["no"]); | 9 | //$shopImgList = $obj->getShopImgList($info["no"]); |
10 | 10 | $boardType=$_REQUEST[boardType]; | |
11 | $boardNo=$_REQUEST[no]; | ||
12 | if($boardType=="EV") | ||
13 | $commentList=$obj->getListOfEComment($boardNo); | ||
14 | |||
11 | $admin_type = $obj->admUser["admin_type"]; | 15 | $admin_type = $obj->admUser["admin_type"]; |
12 | 16 | ||
13 | 17 | ||
... | @@ -48,18 +52,20 @@ | ... | @@ -48,18 +52,20 @@ |
48 | 52 | ||
49 | 53 | ||
50 | $(".jSave").click2(function(){ | 54 | $(".jSave").click2(function(){ |
51 | 55 | if(confirm("내용을 저장하시겠습니까?")){ | |
52 | $("#jData").ajaxSubmit({ | 56 | $("#jData").ajaxSubmit({ |
53 | url:"/action_front.php?cmd=AdminOperate.saveShop", | 57 | url:"/action_front.php?cmd=AdminBoard.saveBoard", |
54 | type : "post", | 58 | type : "post", |
55 | forceSync : true, | 59 | forceSync : true, |
56 | dataType : "json", | 60 | dataType : "json", |
57 | success : function(data){ | 61 | success : function(data){ |
58 | alert(data.returnMessage); | 62 | alert(data.returnMessage); |
59 | location.href = _rurl; | 63 | location.href = _rurl; |
60 | } | 64 | } |
61 | 65 | ||
62 | }); | 66 | }); |
67 | } | ||
68 | |||
63 | }); | 69 | }); |
64 | 70 | ||
65 | $("#jCategorCd").change(function(){ | 71 | $("#jCategorCd").change(function(){ |
... | @@ -124,6 +130,7 @@ | ... | @@ -124,6 +130,7 @@ |
124 | 130 | ||
125 | <form id="jData" method="post" enctype="multipart/form-data"> | 131 | <form id="jData" method="post" enctype="multipart/form-data"> |
126 | <input type="hidden" name="no" value="<?=$_REQUEST[no]?>" /> | 132 | <input type="hidden" name="no" value="<?=$_REQUEST[no]?>" /> |
133 | <input type="hidden" name="boardType" value="<?=$_REQUEST[boardType]?>" /> | ||
127 | <table class="datav" style="width:100%;"> | 134 | <table class="datav" style="width:100%;"> |
128 | <colgroup> | 135 | <colgroup> |
129 | <col width="10%" /> | 136 | <col width="10%" /> |
... | @@ -132,14 +139,14 @@ | ... | @@ -132,14 +139,14 @@ |
132 | <tr> | 139 | <tr> |
133 | <th style="height:25px;">제목</th> | 140 | <th style="height:25px;">제목</th> |
134 | <td class="l"> | 141 | <td class="l"> |
135 | <input type="text" name="discount_rate" class="wl" style="width:70%;" value="" /> | 142 | <input type="text" name="title" class="wl" style="width:70%;" value="<?=$info["title"]?>" /> |
136 | 143 | ||
137 | </td> | 144 | </td> |
138 | </tr> | 145 | </tr> |
139 | <tr> | 146 | <tr> |
140 | <th style="height:25px;">내용</th> | 147 | <th style="height:25px;">내용</th> |
141 | <td class="l"> | 148 | <td class="l"> |
142 | <textarea name="special_contract" rows="7" style="width:90%;resize:vertical;"><?=$info["special_contract"]?></textarea> | 149 | <textarea name="content" rows="7" style="width:90%;resize:vertical;"><?=$info["content"]?></textarea> |
143 | </td> | 150 | </td> |
144 | </tr> | 151 | </tr> |
145 | 152 | ||
... | @@ -148,11 +155,12 @@ | ... | @@ -148,11 +155,12 @@ |
148 | <td class="l"> | 155 | <td class="l"> |
149 | <? | 156 | <? |
150 | $fileIndex = "101"; | 157 | $fileIndex = "101"; |
151 | $fileName = "img1"; | 158 | $fileName = "imgPath1"; |
152 | $filePath = ($shopImgList[0]["file_vir_name"] == "" ? "" : $shopImgList[0]["file_vir_name"]); | 159 | $filePath = ($info["imgPath1"] == "" ? "" : $info["imgPath1"]); |
153 | $fileNumber = ($shopImgList[0]["no"] == "" ? "0" : $shopImgList[0]["no"]); | 160 | //$fileNumber = ($shopImgList[0]["no"] == "" ? "0" : $shopImgList[0]["no"]); |
154 | include $_SERVER["DOCUMENT_ROOT"] . "/admin/inc/fileUpload/fileUpload.php"; | 161 | include $_SERVER["DOCUMENT_ROOT"] . "/admin/inc/fileUpload/fileUpload.php"; |
155 | ?> | 162 | ?> |
163 | <input type="hidden" name="imgPath1" value="<?=$info["imgPath1"]?>" /> | ||
156 | </td> | 164 | </td> |
157 | </tr> | 165 | </tr> |
158 | <tr> | 166 | <tr> |
... | @@ -160,11 +168,12 @@ | ... | @@ -160,11 +168,12 @@ |
160 | <td class="l"> | 168 | <td class="l"> |
161 | <? | 169 | <? |
162 | $fileIndex = "102"; | 170 | $fileIndex = "102"; |
163 | $fileName = "img2"; | 171 | $fileName = "imgPath2"; |
164 | $filePath = ($shopImgList[1]["file_vir_name"] == "" ? "" : $shopImgList[1]["file_vir_name"]); | 172 | $filePath = ($info["imgPath2"] == "" ? "" : $info["imgPath2"]); |
165 | $fileNumber = ($shopImgList[1]["no"] == "" ? "0" : $shopImgList[1]["no"]); | 173 | //$fileNumber = ($shopImgList[1]["no"] == "" ? "0" : $shopImgList[1]["no"]); |
166 | include $_SERVER["DOCUMENT_ROOT"] . "/admin/inc/fileUpload/fileUpload.php"; | 174 | include $_SERVER["DOCUMENT_ROOT"] . "/admin/inc/fileUpload/fileUpload.php"; |
167 | ?> | 175 | ?> |
176 | <input type="hidden" name="imgPath2" value="<?=$info["imgPath2"]?>" /> | ||
168 | </td> | 177 | </td> |
169 | </tr> | 178 | </tr> |
170 | <tr> | 179 | <tr> |
... | @@ -172,11 +181,12 @@ | ... | @@ -172,11 +181,12 @@ |
172 | <td class="l"> | 181 | <td class="l"> |
173 | <? | 182 | <? |
174 | $fileIndex = "103"; | 183 | $fileIndex = "103"; |
175 | $fileName = "img3"; | 184 | $fileName = "imgPath3"; |
176 | $filePath = ($shopImgList[2]["file_vir_name"] == "" ? "" : $shopImgList[2]["file_vir_name"]); | 185 | $filePath = ($info["imgPath3"] == "" ? "" : $info["imgPath3"]); |
177 | $fileNumber = ($shopImgList[2]["no"] == "" ? "0" : $shopImgList[2]["no"]); | 186 | //$fileNumber = ($shopImgList[2]["no"] == "" ? "0" : $shopImgList[2]["no"]); |
178 | include $_SERVER["DOCUMENT_ROOT"] . "/admin/inc/fileUpload/fileUpload.php"; | 187 | include $_SERVER["DOCUMENT_ROOT"] . "/admin/inc/fileUpload/fileUpload.php"; |
179 | ?> | 188 | ?> |
189 | <input type="hidden" name="imgPath3" value="<?=$info["imgPath3"]?>" /> | ||
180 | </td> | 190 | </td> |
181 | </tr> | 191 | </tr> |
182 | <tr> | 192 | <tr> |
... | @@ -184,11 +194,12 @@ | ... | @@ -184,11 +194,12 @@ |
184 | <td class="l"> | 194 | <td class="l"> |
185 | <? | 195 | <? |
186 | $fileIndex = "104"; | 196 | $fileIndex = "104"; |
187 | $fileName = "img4"; | 197 | $fileName = "imgPath4"; |
188 | $filePath = ($shopImgList[3]["file_vir_name"] == "" ? "" : $shopImgList[3]["file_vir_name"]); | 198 | $filePath = ($info["imgPath4"] == "" ? "" : $info["imgPath4"]); |
189 | $fileNumber = ($shopImgList[3]["no"] == "" ? "0" : $shopImgList[3]["no"]); | 199 | //$fileNumber = ($shopImgList[3]["no"] == "" ? "0" : $shopImgList[3]["no"]); |
190 | include $_SERVER["DOCUMENT_ROOT"] . "/admin/inc/fileUpload/fileUpload.php"; | 200 | include $_SERVER["DOCUMENT_ROOT"] . "/admin/inc/fileUpload/fileUpload.php"; |
191 | ?> | 201 | ?> |
202 | <input type="hidden" name="imgPath4" value="<?=$info["imgPath4"]?>" /> | ||
192 | </td> | 203 | </td> |
193 | </tr> | 204 | </tr> |
194 | <tr> | 205 | <tr> |
... | @@ -196,15 +207,31 @@ | ... | @@ -196,15 +207,31 @@ |
196 | <td class="l"> | 207 | <td class="l"> |
197 | <? | 208 | <? |
198 | $fileIndex = "105"; | 209 | $fileIndex = "105"; |
199 | $fileName = "img5"; | 210 | $fileName = "imgPath5"; |
200 | $filePath = ($shopImgList[4]["file_vir_name"] == "" ? "" : $shopImgList[4]["file_vir_name"]); | 211 | $filePath = ($info["imgPath5"] == "" ? "" : $info["imgPath5"]); |
201 | $fileNumber = ($shopImgList[4]["no"] == "" ? "0" : $shopImgList[4]["no"]); | 212 | //$fileNumber = ($shopImgList[4]["no"] == "" ? "0" : $shopImgList[4]["no"]); |
202 | include $_SERVER["DOCUMENT_ROOT"] . "/admin/inc/fileUpload/fileUpload.php"; | 213 | include $_SERVER["DOCUMENT_ROOT"] . "/admin/inc/fileUpload/fileUpload.php"; |
203 | ?> | 214 | ?> |
215 | <input type="hidden" name="imgPath5" value="<?=$info["imgPath5"]?>" /> | ||
204 | </td> | 216 | </td> |
205 | </tr> | 217 | </tr> |
206 | </table> | 218 | </table> |
207 | </form> | 219 | </form> |
220 | <h3> | ||
221 | <? | ||
222 | if(sizeof($commentList)>0) | ||
223 | echo "댓글"; | ||
224 | ?> | ||
225 | </h3> | ||
226 | <table class="datav"> | ||
227 | <? for($i=0; $i<sizeof($commentList); $i++){ ?> | ||
228 | <tr> | ||
229 | <th style="width:10%;"><?=$commentList[$i]["userName"]?></td> | ||
230 | <td style="width:50%;"><?=$commentList[$i]["content"]?></td> | ||
231 | <td style="width:20%;"><?=$commentList[$i]["regDate"]?></td> | ||
232 | </tr> | ||
233 | <?}?> | ||
234 | </table> | ||
208 | 235 | ||
209 | <div class="btngroupcenter"> | 236 | <div class="btngroupcenter"> |
210 | <span class="button bigrounded blue jCancel">취소 </span> | 237 | <span class="button bigrounded blue jCancel">취소 </span> | ... | ... |
1 | <? include $_SERVER["DOCUMENT_ROOT"] . "/common/classes/AdminOperate.php" ?> | 1 | <? include $_SERVER["DOCUMENT_ROOT"] . "/common/classes/AdminBoard.php" ?> |
2 | <? include $_SERVER["DOCUMENT_ROOT"] . "/admin/inc/php/header.php" ?> | 2 | <? include $_SERVER["DOCUMENT_ROOT"] . "/admin/inc/php/header.php" ?> |
3 | <? include $_SERVER["DOCUMENT_ROOT"] . "/admin/inc/php/leftBoardManage.php" ?> | 3 | <? include $_SERVER["DOCUMENT_ROOT"] . "/admin/inc/php/leftBoardManage.php" ?> |
4 | <? | 4 | <? |
5 | $obj = new AdminOperate($_REQUEST, "") ; | 5 | $obj = new AdminBoard($_REQUEST, "") ; |
6 | 6 | ||
7 | //$list = $obj->getListOfPopup("2") ; | 7 | $list = $obj->getListOfOrganizationCert() ; |
8 | $vnum = $obj->virtualNum ; | 8 | $vnum = $obj->virtualNum ; |
9 | ?> | 9 | ?> |
10 | <script src="/admin/inc/fileUpload/fileUploadJS.js"></script> | 10 | <script src="/admin/inc/fileUpload/fileUploadJS.js"></script> |
... | @@ -40,7 +40,7 @@ | ... | @@ -40,7 +40,7 @@ |
40 | 40 | ||
41 | $(".jView").click2(function(){ | 41 | $(".jView").click2(function(){ |
42 | var no = $(this).attr("no"); | 42 | var no = $(this).attr("no"); |
43 | location.href = "/admin/boardManage/certificateView.php?no=" + no + "&rurl=" + jQuery.rich.bin2hex(document.URL); | 43 | location.href = "/admin/boardManage/certificateView.php?certNo=" + no + "&rurl=" + jQuery.rich.bin2hex(document.URL); |
44 | }); | 44 | }); |
45 | 45 | ||
46 | 46 | ||
... | @@ -97,7 +97,7 @@ | ... | @@ -97,7 +97,7 @@ |
97 | function deleteAction(noArr) | 97 | function deleteAction(noArr) |
98 | { | 98 | { |
99 | $.ajax({ | 99 | $.ajax({ |
100 | url : "/action_front.php?cmd=AdminOperate.delPopup", | 100 | url : "/action_front.php?cmd=AdminBoard.deleteCert", |
101 | async : false, | 101 | async : false, |
102 | cache : false, | 102 | cache : false, |
103 | dataType : "json", | 103 | dataType : "json", |
... | @@ -144,16 +144,16 @@ | ... | @@ -144,16 +144,16 @@ |
144 | <?=$vnum--?> | 144 | <?=$vnum--?> |
145 | </td> | 145 | </td> |
146 | <td class="center"> | 146 | <td class="center"> |
147 | <input type="checkbox" class="jNo" value="<?=$list[$i]["no"] ?>" > | 147 | <input type="checkbox" class="jNo" value="<?=$list[$i]["certNo"] ?>" > |
148 | </td> | 148 | </td> |
149 | <td class="center"> | 149 | <td class="center"> |
150 | <?= ($list[$i]["status"] == "Y") ? "노출" : "미노출" ?> | 150 | <?=$list[$i]["name"]?> |
151 | </td> | 151 | </td> |
152 | <td class="center"> | 152 | <td class="center"> |
153 | <img alt="" src="/upload_img/<?=$list[$i]["img_path"]?>" style="width: 95%;"> | 153 | <img alt="" src="/720/<?=$list[$i]["imgPathCert"]?>" style="width:100%; height:700%;"> |
154 | </td> | 154 | </td> |
155 | <td class="center"> | 155 | <td class="center"> |
156 | <?=$list[$i]["regist_dt"]?> | 156 | <input type="button" class="button searchsmall white jView" value="상세보기" no="<?=$list[$i]["certNo"]?>" /> |
157 | </td> | 157 | </td> |
158 | 158 | ||
159 | 159 | ... | ... |
1 | <? include $_SERVER["DOCUMENT_ROOT"] . "/common/classes/AdminOperate.php" ?> | 1 | <? include $_SERVER["DOCUMENT_ROOT"] . "/common/classes/AdminBoard.php" ?> |
2 | <? include $_SERVER["DOCUMENT_ROOT"] . "/admin/inc/php/header.php" ?> | 2 | <? include $_SERVER["DOCUMENT_ROOT"] . "/admin/inc/php/header.php" ?> |
3 | <? include $_SERVER["DOCUMENT_ROOT"] . "/admin/inc/php/leftBoardManage.php" ?> | 3 | <? include $_SERVER["DOCUMENT_ROOT"] . "/admin/inc/php/leftBoardManage.php" ?> |
4 | <? | 4 | <? |
5 | $obj = new AdminOperate($_REQUEST, ""); | 5 | $obj = new AdminBoard($_REQUEST, ""); |
6 | //$info = $obj->getInfoOfShop(); | 6 | $info = $obj->getInfoOfOrganizationCert(); |
7 | 7 | ||
8 | //$cateCodeList = $obj->getShopCategoryCodeList(); | 8 | //$cateCodeList = $obj->getShopCategoryCodeList(); |
9 | //$shopImgList = $obj->getShopImgList($info["no"]); | 9 | //$shopImgList = $obj->getShopImgList($info["no"]); |
... | @@ -21,10 +21,6 @@ | ... | @@ -21,10 +21,6 @@ |
21 | $(document).ready(function(){ | 21 | $(document).ready(function(){ |
22 | 22 | ||
23 | initFileUpload(101); | 23 | initFileUpload(101); |
24 | initFileUpload(102); | ||
25 | initFileUpload(103); | ||
26 | initFileUpload(104); | ||
27 | initFileUpload(105); | ||
28 | 24 | ||
29 | <?if($admin_type == 3) { ?> | 25 | <?if($admin_type == 3) { ?> |
30 | setReadOnly(); | 26 | setReadOnly(); |
... | @@ -50,7 +46,7 @@ | ... | @@ -50,7 +46,7 @@ |
50 | $(".jSave").click2(function(){ | 46 | $(".jSave").click2(function(){ |
51 | 47 | ||
52 | $("#jData").ajaxSubmit({ | 48 | $("#jData").ajaxSubmit({ |
53 | url:"/action_front.php?cmd=AdminOperate.saveShop", | 49 | url:"/action_front.php?cmd=AdminBoard.saveOrganizationCert", |
54 | type : "post", | 50 | type : "post", |
55 | forceSync : true, | 51 | forceSync : true, |
56 | dataType : "json", | 52 | dataType : "json", |
... | @@ -116,7 +112,7 @@ | ... | @@ -116,7 +112,7 @@ |
116 | <div class="data" style="width:80%;"> | 112 | <div class="data" style="width:80%;"> |
117 | 113 | ||
118 | <form id="jData" method="post" enctype="multipart/form-data"> | 114 | <form id="jData" method="post" enctype="multipart/form-data"> |
119 | <input type="hidden" name="no" value="<?=$_REQUEST[no]?>" /> | 115 | <input type="hidden" name="certNo" value="<?=$_REQUEST[certNo]?>" /> |
120 | <table class="datav" style="width:100%;"> | 116 | <table class="datav" style="width:100%;"> |
121 | <colgroup> | 117 | <colgroup> |
122 | <col width="10%" /> | 118 | <col width="10%" /> |
... | @@ -125,8 +121,7 @@ | ... | @@ -125,8 +121,7 @@ |
125 | <tr> | 121 | <tr> |
126 | <th style="height:25px;">제목</th> | 122 | <th style="height:25px;">제목</th> |
127 | <td class="l"> | 123 | <td class="l"> |
128 | <input type="text" name="discount_rate" class="wl" style="width:70%;" value="" /> | 124 | <input type="text" name="name" class="wl" style="width:70%;" value="<?=$info["name"]?>" /> |
129 | |||
130 | </td> | 125 | </td> |
131 | </tr> | 126 | </tr> |
132 | <tr> | 127 | <tr> |
... | @@ -134,11 +129,12 @@ | ... | @@ -134,11 +129,12 @@ |
134 | <td class="l"> | 129 | <td class="l"> |
135 | <? | 130 | <? |
136 | $fileIndex = "101"; | 131 | $fileIndex = "101"; |
137 | $fileName = "img1"; | 132 | $fileName = "imgPathCert1"; |
138 | $filePath = ($shopImgList[0]["file_vir_name"] == "" ? "" : $shopImgList[0]["file_vir_name"]); | 133 | $filePath = ($info["imgPathCert"] == "" ? "" : $info["imgPathCert"]); |
139 | $fileNumber = ($shopImgList[0]["no"] == "" ? "0" : $shopImgList[0]["no"]); | 134 | //$fileNumber = ($shopImgList[0]["no"] == "" ? "0" : $shopImgList[0]["no"]); |
140 | include $_SERVER["DOCUMENT_ROOT"] . "/admin/inc/fileUpload/fileUpload.php"; | 135 | include $_SERVER["DOCUMENT_ROOT"] . "/admin/inc/fileUpload/fileUpload.php"; |
141 | ?> | 136 | ?> |
137 | <input type="hidden" value="<?=$info["imgPathCert"]?>" /> | ||
142 | </td> | 138 | </td> |
143 | </tr> | 139 | </tr> |
144 | 140 | ... | ... |
1 | <? include $_SERVER["DOCUMENT_ROOT"] . "/common/classes/AdminUser.php" ?> | 1 | <? include $_SERVER["DOCUMENT_ROOT"] . "/common/classes/AdminCompany.php" ?> |
2 | <? include $_SERVER["DOCUMENT_ROOT"] . "/admin/inc/php/header.php" ?> | 2 | <? include $_SERVER["DOCUMENT_ROOT"] . "/admin/inc/php/header.php" ?> |
3 | <? include $_SERVER["DOCUMENT_ROOT"] . "/admin/inc/php/leftCompanyManage.php" ?> | 3 | <? include $_SERVER["DOCUMENT_ROOT"] . "/admin/inc/php/leftCompanyManage.php" ?> |
4 | <? | 4 | <? |
5 | $obj = new AdminUser($_REQUEST) ; | 5 | $obj = new AdminCompany($_REQUEST) ; |
6 | 6 | ||
7 | //$list = $obj->getListOfUser() ; | 7 | $list = $obj->getListOfCompany() ; |
8 | $productCode=$_REQUEST["productCode"]; | 8 | $productCode=$_REQUEST["productCode"]; |
9 | $productType=$_REQUEST["productCode"]; | 9 | $productType=$_REQUEST["productCode"]; |
10 | $vnum = $obj->virtualNum ; | 10 | $vnum = $obj->virtualNum ; |
... | @@ -47,7 +47,7 @@ | ... | @@ -47,7 +47,7 @@ |
47 | $(".jView").click2(function(){ | 47 | $(".jView").click2(function(){ |
48 | var no = $(this).attr("no"); | 48 | var no = $(this).attr("no"); |
49 | var type='<?=$productType?>'; | 49 | var type='<?=$productType?>'; |
50 | location.href = "/admin/companyManage/companyView.php?no=" + no + "&productType=" + type +"&rurl=" + jQuery.rich.bin2hex(document.URL); | 50 | location.href = "/admin/companyManage/companyView.php?companyNo=" + no + "&productCode=" + type +"&rurl=" + jQuery.rich.bin2hex(document.URL); |
51 | }); | 51 | }); |
52 | 52 | ||
53 | 53 | ||
... | @@ -60,7 +60,7 @@ | ... | @@ -60,7 +60,7 @@ |
60 | 60 | ||
61 | 61 | ||
62 | // 회원 탈퇴 | 62 | // 회원 탈퇴 |
63 | $(".jDelUser").click2(function(){ | 63 | $(".jDel").click2(function(){ |
64 | 64 | ||
65 | var no = $(this).attr("no"); | 65 | var no = $(this).attr("no"); |
66 | 66 | ||
... | @@ -68,17 +68,17 @@ | ... | @@ -68,17 +68,17 @@ |
68 | 68 | ||
69 | if(confirm("정말 삭제하시겠습니까?")) | 69 | if(confirm("정말 삭제하시겠습니까?")) |
70 | { | 70 | { |
71 | deleteUser(noArr); | 71 | deleteAction(noArr); |
72 | } | 72 | } |
73 | }) ; | 73 | }) ; |
74 | 74 | ||
75 | 75 | ||
76 | // 단체 삭제 | 76 | // 단체 삭제 |
77 | $(".jDelUserMulti").click2(function(){ | 77 | $(".jDelMulti").click2(function(){ |
78 | 78 | ||
79 | 79 | ||
80 | var noArr = new Array(); | 80 | var noArr = new Array(); |
81 | var noCount = $(".jUserNo:checked").length; | 81 | var noCount = $(".jNo:checked").length; |
82 | 82 | ||
83 | if(noCount == 0) | 83 | if(noCount == 0) |
84 | { | 84 | { |
... | @@ -91,10 +91,10 @@ | ... | @@ -91,10 +91,10 @@ |
91 | { | 91 | { |
92 | for(var i = 0; i < noCount; i++ ) | 92 | for(var i = 0; i < noCount; i++ ) |
93 | { | 93 | { |
94 | noArr[i] = $(".jUserNo:checked:eq(" + i + ")").val(); | 94 | noArr[i] = $(".jNo:checked:eq(" + i + ")").val(); |
95 | } | 95 | } |
96 | 96 | ||
97 | deleteUser(noArr); | 97 | deleteAction(noArr); |
98 | } | 98 | } |
99 | 99 | ||
100 | }); | 100 | }); |
... | @@ -131,10 +131,10 @@ | ... | @@ -131,10 +131,10 @@ |
131 | 131 | ||
132 | 132 | ||
133 | 133 | ||
134 | function deleteUser(noArr) | 134 | function deleteAction(noArr) |
135 | { | 135 | { |
136 | $.ajax({ | 136 | $.ajax({ |
137 | url : "/action_front.php?cmd=AdminUser.deleteUser", | 137 | url : "/action_front.php?cmd=AdminCompany.deleteCompany", |
138 | async : false, | 138 | async : false, |
139 | cache : false, | 139 | cache : false, |
140 | dataType : "json", | 140 | dataType : "json", |
... | @@ -208,13 +208,22 @@ | ... | @@ -208,13 +208,22 @@ |
208 | <?=$vnum--?> | 208 | <?=$vnum--?> |
209 | </td> | 209 | </td> |
210 | <td class="center"> | 210 | <td class="center"> |
211 | <input type="checkbox" class="jUserNo" value="<?=$list[$i]["no"] ?>" > | 211 | <input type="checkbox" class="jNo" value="<?=$list[$i]["companyNo"] ?>" > |
212 | </td> | 212 | </td> |
213 | <td class="center"> | 213 | <td class="center"> |
214 | 214 | <?=$list[$i]["name"]?> | |
215 | </td> | ||
216 | <td> | ||
217 | <?=$list[$i]["provinceCode"]?> | ||
218 | </td> | ||
219 | <td> | ||
220 | <?=$list[$i]["address"]?> | ||
221 | </td> | ||
222 | <td> | ||
223 | <?=$list[$i]["telephone"]?> | ||
215 | </td> | 224 | </td> |
216 | <td class="center"> | 225 | <td class="center"> |
217 | <input type="button" class="button searchsmall white jView" value="상세보기" no="<?=$list[$i]["no"]?>" /> | 226 | <input type="button" class="button searchsmall white jView" value="상세보기" no="<?=$list[$i]["companyNo"]?>" /> |
218 | </td> | 227 | </td> |
219 | 228 | ||
220 | </tr> | 229 | </tr> | ... | ... |
1 | <? include $_SERVER["DOCUMENT_ROOT"] . "/common/classes/AdminOperate.php" ?> | 1 | <? include $_SERVER["DOCUMENT_ROOT"] . "/common/classes/AdminCompany.php" ?> |
2 | <? include $_SERVER["DOCUMENT_ROOT"] . "/admin/inc/php/header.php" ?> | 2 | <? include $_SERVER["DOCUMENT_ROOT"] . "/admin/inc/php/header.php" ?> |
3 | <? include $_SERVER["DOCUMENT_ROOT"] . "/admin/inc/php/leftCompanyManage.php" ?> | 3 | <? include $_SERVER["DOCUMENT_ROOT"] . "/admin/inc/php/leftCompanyManage.php" ?> |
4 | <? | 4 | <? |
5 | $obj = new AdminOperate($_REQUEST, ""); | 5 | $obj = new AdminCompany($_REQUEST, ""); |
6 | //$info = $obj->getInfoOfShop(); | 6 | $info = $obj->getInfoOfCompany(); |
7 | 7 | ||
8 | $provinceList = $obj->getListOfProvince(); | ||
8 | //$cateCodeList = $obj->getShopCategoryCodeList(); | 9 | //$cateCodeList = $obj->getShopCategoryCodeList(); |
9 | //$shopImgList = $obj->getShopImgList($info["no"]); | 10 | //$shopImgList = $obj->getShopImgList($info["no"]); |
10 | 11 | ||
... | @@ -50,7 +51,7 @@ | ... | @@ -50,7 +51,7 @@ |
50 | $(".jSave").click2(function(){ | 51 | $(".jSave").click2(function(){ |
51 | 52 | ||
52 | $("#jData").ajaxSubmit({ | 53 | $("#jData").ajaxSubmit({ |
53 | url:"/action_front.php?cmd=AdminOperate.saveShop", | 54 | url:"/action_front.php?cmd=AdminCompany.saveCompany", |
54 | type : "post", | 55 | type : "post", |
55 | forceSync : true, | 56 | forceSync : true, |
56 | dataType : "json", | 57 | dataType : "json", |
... | @@ -123,7 +124,8 @@ | ... | @@ -123,7 +124,8 @@ |
123 | <div class="data" style="width:80%;"> | 124 | <div class="data" style="width:80%;"> |
124 | 125 | ||
125 | <form id="jData" method="post" enctype="multipart/form-data"> | 126 | <form id="jData" method="post" enctype="multipart/form-data"> |
126 | <input type="hidden" name="no" value="<?=$_REQUEST[no]?>" /> | 127 | <input type="hidden" name="companyNo" value="<?=$_REQUEST[companyNo]?>" /> |
128 | <input type="hidden" name="productCode" value="<?=$_REQUEST[productCode]?>" /> | ||
127 | <table class="datav" style="width:100%;"> | 129 | <table class="datav" style="width:100%;"> |
128 | <colgroup> | 130 | <colgroup> |
129 | <col width="10%" /> | 131 | <col width="10%" /> |
... | @@ -132,14 +134,19 @@ | ... | @@ -132,14 +134,19 @@ |
132 | <tr> | 134 | <tr> |
133 | <th style="height:25px;">업체명</th> | 135 | <th style="height:25px;">업체명</th> |
134 | <td class="l"> | 136 | <td class="l"> |
135 | <input type="text" name="discount_rate" class="wl" style="width:70%;" value="" /> | 137 | <input type="text" name="name" class="wl" style="width:70%;" value="<?=$info["name"]?>" /> |
136 | 138 | ||
137 | </td> | 139 | </td> |
138 | </tr> | 140 | </tr> |
139 | <tr> | 141 | <tr> |
140 | <th style="height:25px;">지역</th> | 142 | <th style="height:25px;">지역</th> |
141 | <td class="l"> | 143 | <td class="l"> |
142 | <input type="text" name="discount_rate" class="wl" style="width:70%;" value="" /> | 144 | <select name="provinceCode"> |
145 | <option value="">선택</option> | ||
146 | <? for($i=0; $i<sizeof($provinceList); $i++){ ?> | ||
147 | <option value="<?=$provinceList[$i]["provinceNumber"]?>" <?=$info["provinceCode"] == $provinceList[$i]["provinceNumber"] ? "SELECTED" : ""?>><?=$provinceList[$i]["desc"]?></option> | ||
148 | <?}?> | ||
149 | </select> | ||
143 | </td> | 150 | </td> |
144 | </tr> | 151 | </tr> |
145 | 152 | ||
... | @@ -147,32 +154,36 @@ | ... | @@ -147,32 +154,36 @@ |
147 | <tr> | 154 | <tr> |
148 | <th style="height:25px;">상세주소</th> | 155 | <th style="height:25px;">상세주소</th> |
149 | <td class="l"> | 156 | <td class="l"> |
150 | <input type="text" name="discount_rate" class="wl" style="width:70%;" value="<?=$info["discount_rate"] ?>" /> | 157 | <input type="text" name="address" class="wl" style="width:70%;" value="<?=$info["address"] ?>" /> |
151 | </td> | 158 | </td> |
152 | </tr> | 159 | </tr> |
153 | 160 | ||
154 | <tr> | 161 | <tr> |
155 | <th style="height:25px;">전화번호</th> | 162 | <th style="height:25px;">전화번호</th> |
156 | <td class="l"> | 163 | <td class="l"> |
157 | <input type="text" style="width:50px"/> - <input type="text" style="width:50px"/> - <input type="text" style="width:50px"/> | 164 | <input type="text" name="telephone1" style="width:50px" value="<?=substr($info["telephone"], 0, 3)?>"/> - |
165 | <input type="text" name="telephone2" style="width:50px" value="<?=substr($info["telephone"], 3, 4)?>"/> - | ||
166 | <input type="text" name="telephone3" style="width:50px" value="<?=substr($info["telephone"], 7, 4)?>"/> | ||
158 | </td> | 167 | </td> |
159 | </tr> | 168 | </tr> |
160 | <tr> | 169 | <tr> |
161 | <th style="height:25px;">FAX</th> | 170 | <th style="height:25px;">FAX</th> |
162 | <td class="l"> | 171 | <td class="l"> |
163 | <input type="text" style="width:50px"/> - <input type="text" style="width:50px"/> - <input type="text" style="width:50px"/> | 172 | <input type="text" name="fax1" style="width:50px" value="<?=substr($info["fax"], 0, 3)?>"/> - |
173 | <input type="text" name="fax2" style="width:50px" value="<?=substr($info["fax"], 3, 4)?>"/> - | ||
174 | <input type="text" name="fax3" style="width:50px" value="<?=substr($info["fax"], 7, 4)?>"/> | ||
164 | </td> | 175 | </td> |
165 | </tr> | 176 | </tr> |
166 | <tr> | 177 | <tr> |
167 | <th style="height:25px;">E-mail</th> | 178 | <th style="height:25px;">E-mail</th> |
168 | <td class="l"> | 179 | <td class="l"> |
169 | <input type="text" name="discount_rate" class="wl" style="width:70%;" value="<?=$info["discount_rate"] ?>" /> | 180 | <input type="text" name="eMail" class="wl" style="width:70%;" value="<?=$info["eMail"] ?>" /> |
170 | </td> | 181 | </td> |
171 | </tr> | 182 | </tr> |
172 | <tr> | 183 | <tr> |
173 | <th style="height:25px;">주요 담당제품</th> | 184 | <th style="height:25px;">주요 담당제품</th> |
174 | <td class="l"> | 185 | <td class="l"> |
175 | <input type="text" name="discount_rate" class="wl" style="width:70%;" value="<?=$info["discount_rate"] ?>" /> | 186 | <input type="text" name="companyProductList" class="wl" style="width:70%;" value="<?=$info["companyProductList"] ?>" /> |
176 | </td> | 187 | </td> |
177 | </tr> | 188 | </tr> |
178 | 189 | ||
... | @@ -181,11 +192,12 @@ | ... | @@ -181,11 +192,12 @@ |
181 | <td class="l"> | 192 | <td class="l"> |
182 | <? | 193 | <? |
183 | $fileIndex = "101"; | 194 | $fileIndex = "101"; |
184 | $fileName = "img1"; | 195 | $fileName = "imgPathCompany1"; |
185 | $filePath = ($shopImgList[0]["file_vir_name"] == "" ? "" : $shopImgList[0]["file_vir_name"]); | 196 | $filePath = ($info["imgPathCompany1"] == "" ? "" : $info["imgPathCompany1"]); |
186 | $fileNumber = ($shopImgList[0]["no"] == "" ? "0" : $shopImgList[0]["no"]); | 197 | //$fileNumber = ($shopImgList[0]["no"] == "" ? "0" : $shopImgList[0]["no"]); |
187 | include $_SERVER["DOCUMENT_ROOT"] . "/admin/inc/fileUpload/fileUpload.php"; | 198 | include $_SERVER["DOCUMENT_ROOT"] . "/admin/inc/fileUpload/fileUpload.php"; |
188 | ?> | 199 | ?> |
200 | <input type="hidden" name="imgPathCompany1" value="<?=$info["imgPathCompany1"]?>" /> | ||
189 | </td> | 201 | </td> |
190 | </tr> | 202 | </tr> |
191 | <tr> | 203 | <tr> |
... | @@ -193,11 +205,12 @@ | ... | @@ -193,11 +205,12 @@ |
193 | <td class="l"> | 205 | <td class="l"> |
194 | <? | 206 | <? |
195 | $fileIndex = "102"; | 207 | $fileIndex = "102"; |
196 | $fileName = "img2"; | 208 | $fileName = "imgPathCompany2"; |
197 | $filePath = ($shopImgList[1]["file_vir_name"] == "" ? "" : $shopImgList[1]["file_vir_name"]); | 209 | $filePath = ($info["imgPathCompany2"] == "" ? "" : $info["imgPathCompany2"]); |
198 | $fileNumber = ($shopImgList[1]["no"] == "" ? "0" : $shopImgList[1]["no"]); | 210 | //$fileNumber = ($shopImgList[1]["no"] == "" ? "0" : $shopImgList[1]["no"]); |
199 | include $_SERVER["DOCUMENT_ROOT"] . "/admin/inc/fileUpload/fileUpload.php"; | 211 | include $_SERVER["DOCUMENT_ROOT"] . "/admin/inc/fileUpload/fileUpload.php"; |
200 | ?> | 212 | ?> |
213 | <input type="hidden" name="imgPathCompany2" value="<?=$info["imgPathCompany2"]?>" /> | ||
201 | </td> | 214 | </td> |
202 | </tr> | 215 | </tr> |
203 | <tr> | 216 | <tr> |
... | @@ -205,11 +218,12 @@ | ... | @@ -205,11 +218,12 @@ |
205 | <td class="l"> | 218 | <td class="l"> |
206 | <? | 219 | <? |
207 | $fileIndex = "103"; | 220 | $fileIndex = "103"; |
208 | $fileName = "img3"; | 221 | $fileName = "imgPathCompany3"; |
209 | $filePath = ($shopImgList[2]["file_vir_name"] == "" ? "" : $shopImgList[2]["file_vir_name"]); | 222 | $filePath = ($info["imgPathCompany3"] == "" ? "" : $info["imgPathCompany3"]); |
210 | $fileNumber = ($shopImgList[2]["no"] == "" ? "0" : $shopImgList[2]["no"]); | 223 | //$fileNumber = ($shopImgList[2]["no"] == "" ? "0" : $shopImgList[2]["no"]); |
211 | include $_SERVER["DOCUMENT_ROOT"] . "/admin/inc/fileUpload/fileUpload.php"; | 224 | include $_SERVER["DOCUMENT_ROOT"] . "/admin/inc/fileUpload/fileUpload.php"; |
212 | ?> | 225 | ?> |
226 | <input type="hidden" name="imgPathCompany3" value="<?=$info["imgPathCompany3"]?>" /> | ||
213 | </td> | 227 | </td> |
214 | </tr> | 228 | </tr> |
215 | <tr> | 229 | <tr> |
... | @@ -217,11 +231,12 @@ | ... | @@ -217,11 +231,12 @@ |
217 | <td class="l"> | 231 | <td class="l"> |
218 | <? | 232 | <? |
219 | $fileIndex = "104"; | 233 | $fileIndex = "104"; |
220 | $fileName = "img4"; | 234 | $fileName = "imgPathCompany4"; |
221 | $filePath = ($shopImgList[3]["file_vir_name"] == "" ? "" : $shopImgList[3]["file_vir_name"]); | 235 | $filePath = ($info["imgPathCompany4"] == "" ? "" : $info["imgPathCompany4"]); |
222 | $fileNumber = ($shopImgList[3]["no"] == "" ? "0" : $shopImgList[3]["no"]); | 236 | //$fileNumber = ($shopImgList[3]["no"] == "" ? "0" : $shopImgList[3]["no"]); |
223 | include $_SERVER["DOCUMENT_ROOT"] . "/admin/inc/fileUpload/fileUpload.php"; | 237 | include $_SERVER["DOCUMENT_ROOT"] . "/admin/inc/fileUpload/fileUpload.php"; |
224 | ?> | 238 | ?> |
239 | <input type="hidden" name="imgPathCompany4" value="<?=$info["imgPathCompany4"]?>" /> | ||
225 | </td> | 240 | </td> |
226 | </tr> | 241 | </tr> |
227 | <tr> | 242 | <tr> |
... | @@ -229,11 +244,12 @@ | ... | @@ -229,11 +244,12 @@ |
229 | <td class="l"> | 244 | <td class="l"> |
230 | <? | 245 | <? |
231 | $fileIndex = "105"; | 246 | $fileIndex = "105"; |
232 | $fileName = "img5"; | 247 | $fileName = "imgPathCompany5"; |
233 | $filePath = ($shopImgList[4]["file_vir_name"] == "" ? "" : $shopImgList[4]["file_vir_name"]); | 248 | $filePath = ($info["imgPathCompany5"] == "" ? "" : $info["imgPathCompany5"]); |
234 | $fileNumber = ($shopImgList[4]["no"] == "" ? "0" : $shopImgList[4]["no"]); | 249 | //$fileNumber = ($shopImgList[4]["no"] == "" ? "0" : $shopImgList[4]["no"]); |
235 | include $_SERVER["DOCUMENT_ROOT"] . "/admin/inc/fileUpload/fileUpload.php"; | 250 | include $_SERVER["DOCUMENT_ROOT"] . "/admin/inc/fileUpload/fileUpload.php"; |
236 | ?> | 251 | ?> |
252 | <input type="hidden" name="imgPathCompany5" value="<?=$info["imgPathCompany5"]?>" /> | ||
237 | </td> | 253 | </td> |
238 | </tr> | 254 | </tr> |
239 | </table> | 255 | </table> | ... | ... |
... | @@ -4,7 +4,7 @@ | ... | @@ -4,7 +4,7 @@ |
4 | <? | 4 | <? |
5 | $obj = new AdminUser($_REQUEST) ; | 5 | $obj = new AdminUser($_REQUEST) ; |
6 | 6 | ||
7 | //$list = $obj->getListOfUser() ; | 7 | $list = $obj->getListOfUser() ; |
8 | $vnum = $obj->virtualNum ; | 8 | $vnum = $obj->virtualNum ; |
9 | ?> | 9 | ?> |
10 | <script> | 10 | <script> |
... | @@ -47,12 +47,39 @@ | ... | @@ -47,12 +47,39 @@ |
47 | location.href = "/admin/userManage/userView.php?isMS=0&no=" + no + "&rurl=" + jQuery.rich.bin2hex(document.URL); | 47 | location.href = "/admin/userManage/userView.php?isMS=0&no=" + no + "&rurl=" + jQuery.rich.bin2hex(document.URL); |
48 | }); | 48 | }); |
49 | 49 | ||
50 | $(".jInitialize").click2(function(){ | ||
51 | |||
52 | var no = $(this).attr("no"); | ||
53 | if(confirm("초기화를 하시겠습니까? \n변경 후 수정은 불가능합니다")){ | ||
54 | $.ajax({ | ||
55 | url : "/action_front.php?cmd=AdminUser.initializePwd", | ||
56 | async : false, | ||
57 | cache : false, | ||
58 | dataType : "json", | ||
59 | data : { | ||
60 | "userNo" : no | ||
61 | }, | ||
62 | success : function(data){ | ||
63 | alert(data.returnMessage); | ||
64 | location.reload(); | ||
65 | /* | ||
66 | if(_no != "") | ||
67 | location.reload(); | ||
68 | else | ||
69 | location.href = _rurl; | ||
70 | */ | ||
71 | } | ||
72 | }); | ||
73 | } | ||
74 | |||
75 | |||
76 | }); | ||
50 | 77 | ||
51 | $(".jAddUserExcel").click2(function(){ | 78 | $(".jAddUserExcel").click2(function(){ |
52 | var s=$("#search_text").val(); | 79 | var s=$("#search_text").val(); |
53 | location.href = "/admin/excel/userListExcel.php?search_text="+s; | 80 | location.href = "/admin/excel/userListExcel.php?search_text="+s; |
54 | }); | 81 | }); |
55 | 82 | ||
56 | 83 | ||
57 | 84 | ||
58 | 85 | ||
... | @@ -96,25 +123,6 @@ | ... | @@ -96,25 +123,6 @@ |
96 | 123 | ||
97 | }); | 124 | }); |
98 | 125 | ||
99 | $(".jBtnMS").click2(function(){ | ||
100 | var no = $(this).attr("no"); | ||
101 | var member_type = $(this).attr("member_type"); | ||
102 | |||
103 | $.ajax({ | ||
104 | url : "/action_front.php?cmd=AdminUser.processRequestMemberShipUser", | ||
105 | async : false, | ||
106 | cache : false, | ||
107 | dataType : "json", | ||
108 | data : { | ||
109 | "no" : no | ||
110 | , "member_type" : member_type | ||
111 | }, | ||
112 | success : function(data){ | ||
113 | alert(data.returnMessage); | ||
114 | location.reload(); | ||
115 | } | ||
116 | }); | ||
117 | }); | ||
118 | 126 | ||
119 | 127 | ||
120 | $("#jCheckAll").change(function(){ | 128 | $("#jCheckAll").change(function(){ |
... | @@ -161,7 +169,14 @@ | ... | @@ -161,7 +169,14 @@ |
161 | 169 | ||
162 | <label> | 170 | <label> |
163 | <span>조회 조건</span> | 171 | <span>조회 조건</span> |
164 | <input type="text" id="search_text" name="search_text" class="wm" value="<?=$_REQUEST['search_text']?>" /> | 172 | <select name="searchType"> |
173 | <option value="">전체 </option> | ||
174 | <option value="userName" <?=$_REQUEST["searchType"] == "userName" ? "SELECTED" : ""?>>이름</option> | ||
175 | <option value="userID" <?=$_REQUEST["searchType"] == "userID" ? "SELECTED" : ""?>>아이디</option> | ||
176 | <option value="nickName" <?=$_REQUEST["searchType"] == "nickName" ? "SELECTED" : ""?>>닉네임</option> | ||
177 | <option value="userVehicleType" <?=$_REQUEST["searchType"] == "userVehicleType" ? "SELECTED" : ""?>>차종</option> | ||
178 | </select> | ||
179 | <input type="text" id="searchText" name="searchText" class="wm" value="<?=$_REQUEST['searchText']?>" /> | ||
165 | </label> | 180 | </label> |
166 | 181 | ||
167 | <input type="button" class="button smallgrounded blue jSearch btnright_y" value="검색" /> | 182 | <input type="button" class="button smallgrounded blue jSearch btnright_y" value="검색" /> |
... | @@ -179,12 +194,11 @@ | ... | @@ -179,12 +194,11 @@ |
179 | <thead> | 194 | <thead> |
180 | <tr> | 195 | <tr> |
181 | <th class="no" width="5%">No</th> | 196 | <th class="no" width="5%">No</th> |
182 | <th width="2%"><input type="checkbox" id="jCheckAll"></th> | ||
183 | <th width="6%">이름</th> | 197 | <th width="6%">이름</th> |
184 | <th width="10%">아이디</th> | 198 | <th width="10%">아이디</th> |
185 | <th width="10%">닉네임</th> | 199 | <th width="10%">닉네임</th> |
186 | <th width="10%">전화번호</th> | 200 | <th width="10%">전화번호</th> |
187 | <th width="20%">차종</th> | 201 | <th width="10%">차종</th> |
188 | <th width="6%">비밀번호 <br>초기화</th> | 202 | <th width="6%">비밀번호 <br>초기화</th> |
189 | </tr> | 203 | </tr> |
190 | </thead> | 204 | </thead> |
... | @@ -195,41 +209,45 @@ | ... | @@ -195,41 +209,45 @@ |
195 | <?=$vnum--?> | 209 | <?=$vnum--?> |
196 | </td> | 210 | </td> |
197 | <td class="center"> | 211 | <td class="center"> |
198 | <input type="checkbox" class="jUserNo" value="<?=$list[$i]["no"] ?>" > | 212 | <?=$list[$i]["userName"]?> |
199 | </td> | ||
200 | <td class="center"> | ||
201 | <? | ||
202 | if($list[$i]["regi_type"] == "E") | ||
203 | echo $list[$i]["id"]; | ||
204 | else if($list[$i]["regi_type"] == "K") | ||
205 | echo "카카오톡 가입"; | ||
206 | else if($list[$i]["regi_type"] == "F") | ||
207 | echo "페이스북 가입"; | ||
208 | ?> | ||
209 | </td> | ||
210 | <td class="center"> | ||
211 | <?=$list[$i]["name"]?> | ||
212 | </td> | 213 | </td> |
213 | <td class="center"> | 214 | <td class="center"> |
214 | <?=$list[$i]["tel"]?> | 215 | <?=$list[$i]["userID"]?> |
215 | </td> | 216 | </td> |
216 | <td class="center"> | 217 | <td class="center"> |
217 | <?=$list[$i]["group_name"]?> | 218 | <?=$list[$i]["nickName"]?> |
218 | </td> | 219 | </td> |
219 | <td class="center"> | 220 | <td class="center"> |
220 | <?=($list[$i]["member_type"] == "V") ? "O" : "X"?> | 221 | <?=$list[$i]["userTel"]?> |
221 | </td> | 222 | </td> |
222 | <td class="center"> | 223 | <td class="center"> |
223 | <?=($list[$i]["member_type"] == "M") ? "O" : "X"?> | 224 | <?echo $list[$i]["userVehicleTON"]."TON / ".$list[$i]["userVehicleName"]." / "?> |
224 | </td> | 225 | <? |
225 | <td class="center"> | 226 | switch($list[$i]["userVehicleType"]){ |
226 | <?=$list[$i]["reg_dt"]?> | 227 | case "HY": |
228 | echo "현대"; | ||
229 | break; | ||
230 | case "DW": | ||
231 | echo "대우"; | ||
232 | break; | ||
233 | case "VV": | ||
234 | echo "볼보"; | ||
235 | break; | ||
236 | case "SC": | ||
237 | echo "스카니아"; | ||
238 | break; | ||
239 | case "MB": | ||
240 | echo "벤츠"; | ||
241 | break; | ||
242 | case "MA": | ||
243 | echo "만"; | ||
244 | break; | ||
245 | } | ||
246 | ?> | ||
227 | </td> | 247 | </td> |
248 | |||
228 | <td class="center"> | 249 | <td class="center"> |
229 | <input type="button" class="button searchsmall white jViewUser" value="상세보기" no="<?=$list[$i]["no"]?>" /> | 250 | <input type="button" class="button searchsmall white jInitialize" value="초기화" no="<?=$list[$i]["userNo"]?>" /> |
230 | <?if($loginInfo["admin_type"] == "1"){ ?> | ||
231 | <input type="button" class="button searchsmall white jDelUser" value="삭제" no="<?=$list[$i]["no"]?>" /> | ||
232 | <?} ?> | ||
233 | </td> | 251 | </td> |
234 | </tr> | 252 | </tr> |
235 | <? } ?> | 253 | <? } ?> | ... | ... |
... | @@ -4,7 +4,7 @@ | ... | @@ -4,7 +4,7 @@ |
4 | <? | 4 | <? |
5 | $obj = new AdminUser($_REQUEST) ; | 5 | $obj = new AdminUser($_REQUEST) ; |
6 | 6 | ||
7 | //$list = $obj->getListOfUser() ; | 7 | $list = $obj->getListOfManager() ; |
8 | $vnum = $obj->virtualNum ; | 8 | $vnum = $obj->virtualNum ; |
9 | ?> | 9 | ?> |
10 | <script> | 10 | <script> |
... | @@ -97,6 +97,32 @@ | ... | @@ -97,6 +97,32 @@ |
97 | 97 | ||
98 | }); | 98 | }); |
99 | 99 | ||
100 | $(".jInitialize").click2(function(){ | ||
101 | |||
102 | var no = $(this).attr("no"); | ||
103 | if(confirm("초기화를 하시겠습니까? \n변경 후 수정은 불가능합니다")){ | ||
104 | $.ajax({ | ||
105 | url : "/action_front.php?cmd=AdminUser.initializePwd", | ||
106 | async : false, | ||
107 | cache : false, | ||
108 | dataType : "json", | ||
109 | data : { | ||
110 | "userNo" : no | ||
111 | }, | ||
112 | success : function(data){ | ||
113 | alert(data.returnMessage); | ||
114 | location.reload(); | ||
115 | /* | ||
116 | if(_no != "") | ||
117 | location.reload(); | ||
118 | else | ||
119 | location.href = _rurl; | ||
120 | */ | ||
121 | } | ||
122 | }); | ||
123 | } | ||
124 | }); | ||
125 | |||
100 | $(".jBtnMS").click2(function(){ | 126 | $(".jBtnMS").click2(function(){ |
101 | var no = $(this).attr("no"); | 127 | var no = $(this).attr("no"); |
102 | var member_type = $(this).attr("member_type"); | 128 | var member_type = $(this).attr("member_type"); |
... | @@ -162,7 +188,13 @@ | ... | @@ -162,7 +188,13 @@ |
162 | 188 | ||
163 | <label> | 189 | <label> |
164 | <span>조회 조건</span> | 190 | <span>조회 조건</span> |
165 | <input type="text" id="search_text" name="search_text" class="wm" value="<?=$_REQUEST['search_text']?>" /> | 191 | <select name="searchType"> |
192 | <option value="">전체 </option> | ||
193 | <option value="userName" <?=$_REQUEST["searchType"] == "userName" ? "SELECTED" : ""?>>이름</option> | ||
194 | <option value="userID" <?=$_REQUEST["searchType"] == "userID" ? "SELECTED" : ""?>>아이디</option> | ||
195 | <option value="nickName" <?=$_REQUEST["searchType"] == "nickName" ? "SELECTED" : ""?>>닉네임</option> | ||
196 | </select> | ||
197 | <input type="text" id="searchText" name="searchText" class="wm" value="<?=$_REQUEST['searchText']?>" /> | ||
166 | </label> | 198 | </label> |
167 | 199 | ||
168 | <input type="button" class="button smallgrounded blue jSearch btnright_y" value="검색" /> | 200 | <input type="button" class="button smallgrounded blue jSearch btnright_y" value="검색" /> |
... | @@ -185,7 +217,6 @@ | ... | @@ -185,7 +217,6 @@ |
185 | <th width="10%">아이디</th> | 217 | <th width="10%">아이디</th> |
186 | <th width="10%">닉네임</th> | 218 | <th width="10%">닉네임</th> |
187 | <th width="10%">전화번호</th> | 219 | <th width="10%">전화번호</th> |
188 | <th width="20%">차종</th> | ||
189 | <th width="6%">비밀번호 <br>초기화</th> | 220 | <th width="6%">비밀번호 <br>초기화</th> |
190 | </tr> | 221 | </tr> |
191 | </thead> | 222 | </thead> |
... | @@ -195,42 +226,24 @@ | ... | @@ -195,42 +226,24 @@ |
195 | <td class="no center"> | 226 | <td class="no center"> |
196 | <?=$vnum--?> | 227 | <?=$vnum--?> |
197 | </td> | 228 | </td> |
229 | |||
198 | <td class="center"> | 230 | <td class="center"> |
199 | <input type="checkbox" class="jUserNo" value="<?=$list[$i]["no"] ?>" > | 231 | <input type="checkbox" class="jUserNo" value="<?=$list[$i]["userNo"] ?>" > |
200 | </td> | ||
201 | <td class="center"> | ||
202 | <? | ||
203 | if($list[$i]["regi_type"] == "E") | ||
204 | echo $list[$i]["id"]; | ||
205 | else if($list[$i]["regi_type"] == "K") | ||
206 | echo "카카오톡 가입"; | ||
207 | else if($list[$i]["regi_type"] == "F") | ||
208 | echo "페이스북 가입"; | ||
209 | ?> | ||
210 | </td> | 232 | </td> |
211 | <td class="center"> | 233 | <td class="center"> |
212 | <?=$list[$i]["name"]?> | 234 | <?=$list[$i]["userName"]?> |
213 | </td> | 235 | </td> |
214 | <td class="center"> | 236 | <td class="center"> |
215 | <?=$list[$i]["tel"]?> | 237 | <?=$list[$i]["userID"]?> |
216 | </td> | ||
217 | <td class="center"> | ||
218 | <?=$list[$i]["group_name"]?> | ||
219 | </td> | ||
220 | <td class="center"> | ||
221 | <?=($list[$i]["member_type"] == "V") ? "O" : "X"?> | ||
222 | </td> | 238 | </td> |
223 | <td class="center"> | 239 | <td class="center"> |
224 | <?=($list[$i]["member_type"] == "M") ? "O" : "X"?> | 240 | <?=$list[$i]["nickName"]?> |
225 | </td> | 241 | </td> |
226 | <td class="center"> | 242 | <td class="center"> |
227 | <?=$list[$i]["reg_dt"]?> | 243 | <?=$list[$i]["userTel"]?> |
228 | </td> | 244 | </td> |
229 | <td class="center"> | 245 | <td class="center"> |
230 | <input type="button" class="button searchsmall white jViewUser" value="상세보기" no="<?=$list[$i]["no"]?>" /> | 246 | <input type="button" class="button searchsmall white jInitialize" value="초기화" no="<?=$list[$i]["userNo"]?>" /> |
231 | <?if($loginInfo["admin_type"] == "1"){ ?> | ||
232 | <input type="button" class="button searchsmall white jDelUser" value="삭제" no="<?=$list[$i]["no"]?>" /> | ||
233 | <?} ?> | ||
234 | </td> | 247 | </td> |
235 | </tr> | 248 | </tr> |
236 | <? } ?> | 249 | <? } ?> | ... | ... |
... | @@ -9,38 +9,12 @@ | ... | @@ -9,38 +9,12 @@ |
9 | ?> | 9 | ?> |
10 | 10 | ||
11 | <script language="javascript"> | 11 | <script language="javascript"> |
12 | var _rurl = "<?=$rurl?>"; | 12 | var _rurl = "<?=$rurl != "" ? $rurl : 0?>"; |
13 | var _no = "<?=$_REQUEST[no]?>"; | 13 | var _no = "<?=$_REQUEST[no] != "" ? $_REQUEST[no] : 0?>"; |
14 | 14 | ||
15 | 15 | ||
16 | $(document).ready(function(){ | 16 | $(document).ready(function(){ |
17 | 17 | ||
18 | //=====프레입웤 변수들==================================================================================// | ||
19 | var FORM_TARGET_CLS_NM = ".data" ; // 폼을 동적 wrap 할 타겟 ID이름 | ||
20 | var FORM_NAME = "alf" ; // 폼이름 | ||
21 | var FORM_METHOD = "POST" ; // 폼 메쏘드 | ||
22 | var FORM_USE_FILE = false ; // 파일폼 사용 여부 | ||
23 | var FORM_ACTION = "/action_front.php" ; | ||
24 | |||
25 | |||
26 | var NEXT_CMD = "" ; // 다은 수행 할 cmd | ||
27 | //=====================================================================================================// | ||
28 | |||
29 | var dates = $("[name='birthDT[]']").datepicker({ | ||
30 | showMonthAfterYear:true, | ||
31 | inline: true, | ||
32 | changeMonth: true, | ||
33 | changeYear: true, | ||
34 | yearRange: '1970', | ||
35 | dateFormat : 'yy-mm-dd', | ||
36 | dayNamesMin:['일', '월', '화', '수', '목', '금', ' 토'], | ||
37 | monthNames:['1월','2월','3월','4월','5월','6월','7 월','8월','9월','10월','11월','12월'], | ||
38 | monthNamesShort:['1월','2월','3월','4월','5월','6월','7월','8월','9월','10월','11월','12월'], | ||
39 | showButtonPanel: true, currentText: '오늘 ' , closeText: '닫기' | ||
40 | }); | ||
41 | |||
42 | var jForm = $(FORM_TARGET_CLS_NM).mf({ "name" : FORM_NAME , "method" : FORM_METHOD , "action" : FORM_ACTION , "useFile" : FORM_USE_FILE }) ; | ||
43 | |||
44 | $(".jCancel").click2(function(){ | 18 | $(".jCancel").click2(function(){ |
45 | location.href = _rurl; | 19 | location.href = _rurl; |
46 | }); | 20 | }); |
... | @@ -54,11 +28,69 @@ | ... | @@ -54,11 +28,69 @@ |
54 | deleteUser(noArr); | 28 | deleteUser(noArr); |
55 | } | 29 | } |
56 | }); | 30 | }); |
31 | $(".jAdd").click2(function(){ | ||
32 | var data = $("#jData").serialize(); | ||
33 | if(confirm("직원회원 계정을 등록하시겠습니까?")){ | ||
34 | $.ajax({ | ||
35 | url : "/action_front.php?cmd=AdminUser.saveManager", | ||
36 | async : false, | ||
37 | cache : false, | ||
38 | dataType : "json", | ||
39 | data : data, | ||
40 | success : function(data){ | ||
41 | alert(data.returnMessage); | ||
42 | if(data.returnCode == "1") | ||
43 | location.href=_rurl; | ||
44 | |||
45 | /* | ||
46 | if(_no != "") | ||
47 | location.reload(); | ||
48 | else | ||
49 | location.href = _rurl; | ||
50 | */ | ||
51 | } | ||
52 | }); | ||
53 | } | ||
54 | |||
55 | |||
56 | }); | ||
57 | 57 | ||
58 | $(".jCheckIDRedundancy").click2(function(){ | ||
59 | var data = $("#jData").serialize(); | ||
60 | $.ajax({ | ||
61 | url : "/action_front.php?cmd=AdminUser.checkIDRedundancy", | ||
62 | async : false, | ||
63 | cache : false, | ||
64 | dataType : "json", | ||
65 | data : data, | ||
66 | success : function(data){ | ||
67 | alert(data.returnMessage); | ||
68 | } | ||
69 | }); | ||
70 | |||
71 | }); | ||
72 | |||
73 | $(".jCheckNickRedundancy").click2(function(){ | ||
74 | var data = $("#jData").serialize(); | ||
75 | $.ajax({ | ||
76 | url : "/action_front.php?cmd=AdminUser.checkNickRedundancy", | ||
77 | async : false, | ||
78 | cache : false, | ||
79 | dataType : "json", | ||
80 | data : data, | ||
81 | success : function(data){ | ||
82 | alert(data.returnMessage); | ||
83 | } | ||
84 | }); | ||
85 | |||
86 | }); | ||
87 | |||
88 | |||
58 | 89 | ||
59 | }) ; | 90 | }) ; |
60 | 91 | ||
61 | 92 | ||
93 | |||
62 | function deleteUser(noArr) | 94 | function deleteUser(noArr) |
63 | { | 95 | { |
64 | $.ajax({ | 96 | $.ajax({ |
... | @@ -70,7 +102,7 @@ | ... | @@ -70,7 +102,7 @@ |
70 | "no" : noArr | 102 | "no" : noArr |
71 | }, | 103 | }, |
72 | success : function(data){ | 104 | success : function(data){ |
73 | alert("삭제되었습니다"); | 105 | //alert("삭제되었습니다"); |
74 | location.href = _rurl; | 106 | location.href = _rurl; |
75 | } | 107 | } |
76 | }); | 108 | }); |
... | @@ -88,8 +120,8 @@ | ... | @@ -88,8 +120,8 @@ |
88 | </h2> | 120 | </h2> |
89 | <!-- location area --> | 121 | <!-- location area --> |
90 | 122 | ||
91 | 123 | <form id="jData"> | |
92 | <div class="data" style="width:50%;"> | 124 | <div class="jData" style="width:50%;"> |
93 | <table class="datav" style="width:100%;"> | 125 | <table class="datav" style="width:100%;"> |
94 | <colgroup> | 126 | <colgroup> |
95 | <col width="30%" /> | 127 | <col width="30%" /> |
... | @@ -98,44 +130,42 @@ | ... | @@ -98,44 +130,42 @@ |
98 | <tr> | 130 | <tr> |
99 | <th style="height:25px;">아이디</th> | 131 | <th style="height:25px;">아이디</th> |
100 | <td > | 132 | <td > |
101 | <input type="text" style="width:200px"/> | 133 | <input name="userID" type="text" style="width:200px"/> |
102 | <span class="button bigrounded blue" style="color:white; width:70px"> 중복확인 </span> | 134 | <span class="button bigrounded blue jCheckIDRedundancy" style="color:white; width:70px"> 중복확인 </span> |
103 | </td> | 135 | </td> |
104 | </tr> | 136 | </tr> |
105 | <tr> | 137 | <tr> |
106 | <th style="height:25px;">비밀번호</th> | 138 | <th style="height:25px;">비밀번호</th> |
107 | <td > | 139 | <td > |
108 | <input type="text" style="width:200px"/> | 140 | <input name="userPwd" type="text" style="width:200px"/> |
109 | </td> | 141 | </td> |
110 | </tr> | 142 | </tr> |
111 | <tr> | 143 | <tr> |
112 | <th style="height:25px;">직원명</th> | 144 | <th style="height:25px;">직원명</th> |
113 | <td class="l"> | 145 | <td class="l"> |
114 | <input type="text" style="width:200px" /> | 146 | <input name="userName" type="text" style="width:200px" /> |
115 | </td> | 147 | </td> |
116 | </tr> | 148 | </tr> |
117 | <tr> | 149 | <tr> |
118 | <th style="height:25px;">닉네임</th> | 150 | <th style="height:25px;">닉네임</th> |
119 | <td class="l"> | 151 | <td class="l"> |
120 | <input type="text" style="width:200px" /> | 152 | <input name="nickName" type="text" style="width:200px" /> |
121 | <span class="button bigrounded blue" style="color:white; width:70px"> 중복확인 </span> | 153 | <span class="button bigrounded blue jCheckNickRedundancy" style="color:white; width:70px"> 중복확인 </span> |
122 | </td> | 154 | </td> |
123 | </tr> | 155 | </tr> |
124 | <tr> | 156 | <tr> |
125 | <th style="height:25px;">전화번호</th> | 157 | <th style="height:25px;">전화번호</th> |
126 | <td class="l"> | 158 | <td class="l"> |
127 | <input type="text" style="width:50px"/> - <input type="text" style="width:50px"/> - <input type="text" style="width:50px"/> | 159 | <input name="userTel1" type="text" style="width:50px"/> - <input name="userTel2" type="text" style="width:50px"/> - <input name="userTel3" type="text" style="width:50px"/> |
128 | </td> | 160 | </td> |
129 | </tr> | 161 | </tr> |
130 | 162 | ||
131 | </table> | 163 | </table> |
132 | 164 | ||
133 | <div class="btngroupcenter"> | 165 | <div class="btngroupcenter"> |
134 | <span class="button bigrounded blue jCancel">등록</span> | 166 | <span class="button bigrounded blue jAdd">등록</span> |
135 | <?if($loginInfo["admin_type"] == "1"){ ?> | ||
136 | <span class="button bigrounded blue jDelUser" >삭제</span> | ||
137 | <?} ?> | ||
138 | </div> | 167 | </div> |
139 | 168 | ||
140 | </div> | 169 | </div> |
170 | </form> | ||
141 | </div> | 171 | </div> |
... | \ No newline at end of file | ... | \ No newline at end of file | ... | ... |
1 | <? include $_SERVER["DOCUMENT_ROOT"] . "/common/classes/AdminUser.php" ?> | 1 | <? include $_SERVER["DOCUMENT_ROOT"] . "/common/classes/AdminVehicle.php" ?> |
2 | <? include $_SERVER["DOCUMENT_ROOT"] . "/admin/inc/php/header.php" ?> | 2 | <? include $_SERVER["DOCUMENT_ROOT"] . "/admin/inc/php/header.php" ?> |
3 | <? include $_SERVER["DOCUMENT_ROOT"] . "/admin/inc/php/leftVehicleManage.php" ?> | 3 | <? include $_SERVER["DOCUMENT_ROOT"] . "/admin/inc/php/leftVehicleManage.php" ?> |
4 | <? | 4 | <? |
5 | $obj = new AdminUser($_REQUEST) ; | 5 | $obj = new AdminVehicle($_REQUEST) ; |
6 | 6 | ||
7 | //$list = $obj->getListOfUser() ; | 7 | $list = $obj->getListOfVehicle() ; |
8 | $vehicleType=$_REQUEST["vehicleType"]; | 8 | $vehicleType=$_REQUEST["vehicleType"]; |
9 | $vnum = $obj->virtualNum ; | 9 | $vnum = $obj->virtualNum ; |
10 | ?> | 10 | ?> |
... | @@ -46,7 +46,7 @@ | ... | @@ -46,7 +46,7 @@ |
46 | $(".jViewVehicle").click2(function(){ | 46 | $(".jViewVehicle").click2(function(){ |
47 | var no = $(this).attr("no"); | 47 | var no = $(this).attr("no"); |
48 | var type='<?=$vehicleType?>'; | 48 | var type='<?=$vehicleType?>'; |
49 | location.href = "/admin/vehicleManage/vehicleView.php?no=" + no + "&vehicleType=" + type +"&rurl=" + jQuery.rich.bin2hex(document.URL); | 49 | location.href = "/admin/vehicleManage/vehicleView.php?vehicleNo=" + no + "&vehicleType=" + type +"&rurl=" + jQuery.rich.bin2hex(document.URL); |
50 | }); | 50 | }); |
51 | 51 | ||
52 | 52 | ||
... | @@ -58,8 +58,7 @@ | ... | @@ -58,8 +58,7 @@ |
58 | 58 | ||
59 | 59 | ||
60 | 60 | ||
61 | // 회원 탈퇴 | 61 | $(".jDel").click2(function(){ |
62 | $(".jDelUser").click2(function(){ | ||
63 | 62 | ||
64 | var no = $(this).attr("no"); | 63 | var no = $(this).attr("no"); |
65 | 64 | ||
... | @@ -67,21 +66,21 @@ | ... | @@ -67,21 +66,21 @@ |
67 | 66 | ||
68 | if(confirm("정말 삭제하시겠습니까?")) | 67 | if(confirm("정말 삭제하시겠습니까?")) |
69 | { | 68 | { |
70 | deleteUser(noArr); | 69 | deleteAction(noArr); |
71 | } | 70 | } |
72 | }) ; | 71 | }) ; |
73 | 72 | ||
74 | 73 | ||
75 | // 단체 삭제 | 74 | // 단체 삭제 |
76 | $(".jDelUserMulti").click2(function(){ | 75 | $(".jDelMulti").click2(function(){ |
77 | 76 | ||
78 | 77 | ||
79 | var noArr = new Array(); | 78 | var noArr = new Array(); |
80 | var noCount = $(".jUserNo:checked").length; | 79 | var noCount = $(".jNo:checked").length; |
81 | 80 | ||
82 | if(noCount == 0) | 81 | if(noCount == 0) |
83 | { | 82 | { |
84 | alert("삭제할 관리자를 하나 이상 선택해주세요."); | 83 | alert("삭제할 항목을 하나 이상 선택해주세요."); |
85 | return false; | 84 | return false; |
86 | } | 85 | } |
87 | 86 | ||
... | @@ -90,10 +89,10 @@ | ... | @@ -90,10 +89,10 @@ |
90 | { | 89 | { |
91 | for(var i = 0; i < noCount; i++ ) | 90 | for(var i = 0; i < noCount; i++ ) |
92 | { | 91 | { |
93 | noArr[i] = $(".jUserNo:checked:eq(" + i + ")").val(); | 92 | noArr[i] = $(".jNo:checked:eq(" + i + ")").val(); |
94 | } | 93 | } |
95 | 94 | ||
96 | deleteUser(noArr); | 95 | deleteAction(noArr); |
97 | } | 96 | } |
98 | 97 | ||
99 | }); | 98 | }); |
... | @@ -130,10 +129,10 @@ | ... | @@ -130,10 +129,10 @@ |
130 | 129 | ||
131 | 130 | ||
132 | 131 | ||
133 | function deleteUser(noArr) | 132 | function deleteAction(noArr) |
134 | { | 133 | { |
135 | $.ajax({ | 134 | $.ajax({ |
136 | url : "/action_front.php?cmd=AdminUser.deleteUser", | 135 | url : "/action_front.php?cmd=AdminVehicle.deleteVehicle", |
137 | async : false, | 136 | async : false, |
138 | cache : false, | 137 | cache : false, |
139 | dataType : "json", | 138 | dataType : "json", |
... | @@ -243,13 +242,13 @@ | ... | @@ -243,13 +242,13 @@ |
243 | <?=$vnum--?> | 242 | <?=$vnum--?> |
244 | </td> | 243 | </td> |
245 | <td class="center"> | 244 | <td class="center"> |
246 | <input type="checkbox" class="jUserNo" value="<?=$list[$i]["no"] ?>" > | 245 | <input type="checkbox" class="jNo" value="<?=$list[$i]["vehicleNo"] ?>" > |
247 | </td> | 246 | </td> |
248 | <td class="center"> | 247 | <td class="center"> |
249 | 248 | <?=$list[$i]["name"]?> | |
250 | </td> | 249 | </td> |
251 | <td class="center"> | 250 | <td class="center"> |
252 | <input type="button" class="button searchsmall white jViewVehicle" value="상세보기" no="<?=$list[$i]["no"]?>" /> | 251 | <input type="button" class="button searchsmall white jViewVehicle" value="상세보기" no="<?=$list[$i]["vehicleNo"]?>" /> |
253 | </td> | 252 | </td> |
254 | 253 | ||
255 | </tr> | 254 | </tr> | ... | ... |
1 | <? include $_SERVER["DOCUMENT_ROOT"] . "/common/classes/AdminOperate.php" ?> | 1 | <? include $_SERVER["DOCUMENT_ROOT"] . "/common/classes/AdminVehicle.php" ?> |
2 | <? include $_SERVER["DOCUMENT_ROOT"] . "/admin/inc/php/header.php" ?> | 2 | <? include $_SERVER["DOCUMENT_ROOT"] . "/admin/inc/php/header.php" ?> |
3 | <? include $_SERVER["DOCUMENT_ROOT"] . "/admin/inc/php/leftVehicleManage.php" ?> | 3 | <? include $_SERVER["DOCUMENT_ROOT"] . "/admin/inc/php/leftVehicleManage.php" ?> |
4 | <? | 4 | <? |
5 | $obj = new AdminOperate($_REQUEST, ""); | 5 | $obj = new AdminVehicle($_REQUEST, ""); |
6 | //$info = $obj->getInfoOfShop(); | 6 | $info = $obj->getInfoOfVehicle(); |
7 | 7 | ||
8 | //$cateCodeList = $obj->getShopCategoryCodeList(); | 8 | //$cateCodeList = $obj->getShopCategoryCodeList(); |
9 | //$shopImgList = $obj->getShopImgList($info["no"]); | 9 | //$shopImgList = $obj->getShopImgList($info["no"]); |
10 | 10 | ||
11 | $admin_type = $obj->admUser["admin_type"]; | ||
12 | |||
13 | 11 | ||
14 | $rurl = pack("H*", $_REQUEST["rurl"]) ; | 12 | $rurl = pack("H*", $_REQUEST["rurl"]) ; |
15 | ?> | 13 | ?> |
... | @@ -48,18 +46,22 @@ | ... | @@ -48,18 +46,22 @@ |
48 | 46 | ||
49 | 47 | ||
50 | $(".jSave").click2(function(){ | 48 | $(".jSave").click2(function(){ |
51 | 49 | if(confirm("내용을 저장하시겠습니까?")){ | |
52 | $("#jData").ajaxSubmit({ | 50 | $("#jData").ajaxSubmit({ |
53 | url:"/action_front.php?cmd=AdminOperate.saveShop", | 51 | url:"/action_front.php?cmd=AdminVehicle.saveVehicle", |
54 | type : "post", | 52 | type : "post", |
55 | forceSync : true, | 53 | forceSync : true, |
56 | dataType : "json", | 54 | dataType : "json", |
57 | success : function(data){ | 55 | success : function(data){ |
58 | alert(data.returnMessage); | 56 | alert(data.returnMessage); |
59 | location.href = _rurl; | 57 | location.href = _rurl; |
60 | } | 58 | }, |
61 | 59 | error : function(req, res, error){ | |
62 | }); | 60 | alert(req+res+error); |
61 | } | ||
62 | }); | ||
63 | } | ||
64 | |||
63 | }); | 65 | }); |
64 | 66 | ||
65 | $("#jCategorCd").change(function(){ | 67 | $("#jCategorCd").change(function(){ |
... | @@ -110,7 +112,9 @@ | ... | @@ -110,7 +112,9 @@ |
110 | <div class="data" style="width:80%;"> | 112 | <div class="data" style="width:80%;"> |
111 | 113 | ||
112 | <form id="jData" method="post" enctype="multipart/form-data"> | 114 | <form id="jData" method="post" enctype="multipart/form-data"> |
113 | <input type="hidden" name="no" value="<?=$_REQUEST[no]?>" /> | 115 | <input type="hidden" name="vehicleNo" value="<?=$_REQUEST["vehicleNo"]?>" /> |
116 | <input type="hidden" name="vehicleType" value="<?=$_REQUEST["vehicleType"]?>" /> | ||
117 | |||
114 | <table class="datav" style="width:100%;"> | 118 | <table class="datav" style="width:100%;"> |
115 | <colgroup> | 119 | <colgroup> |
116 | <col width="10%" /> | 120 | <col width="10%" /> |
... | @@ -119,14 +123,14 @@ | ... | @@ -119,14 +123,14 @@ |
119 | <tr> | 123 | <tr> |
120 | <th style="height:25px;">제품명</th> | 124 | <th style="height:25px;">제품명</th> |
121 | <td class="l"> | 125 | <td class="l"> |
122 | <input type="text" name="discount_rate" class="wl" style="width:90%;" value="" /> | 126 | <input type="text" name="name" class="wl" style="width:90%;" value="<?=$info["name"]?>" /> |
123 | 127 | ||
124 | </td> | 128 | </td> |
125 | </tr> | 129 | </tr> |
126 | <tr> | 130 | <tr> |
127 | <th style="height:25px;">제품소개</th> | 131 | <th style="height:25px;">제품소개</th> |
128 | <td class="l"> | 132 | <td class="l"> |
129 | <textarea name="special_contract" rows="7" style="width:90%;resize:vertical;"><?=$info["special_contract"]?></textarea> | 133 | <textarea name="spec" rows="7" style="width:90%;resize:vertical;"><?=$info["spec"]?></textarea> |
130 | </td> | 134 | </td> |
131 | </tr> | 135 | </tr> |
132 | 136 | ||
... | @@ -134,7 +138,7 @@ | ... | @@ -134,7 +138,7 @@ |
134 | <tr> | 138 | <tr> |
135 | <th style="height:25px;">이동 URL</th> | 139 | <th style="height:25px;">이동 URL</th> |
136 | <td class="l"> | 140 | <td class="l"> |
137 | <input type="text" name="discount_rate" class="wl" style="width:90%;" value="<?=$info["discount_rate"] ?>" /> | 141 | <input type="text" name="videoURL" class="wl" style="width:90%;" value="<?=$info["videoURL"] ?>" /> |
138 | </td> | 142 | </td> |
139 | </tr> | 143 | </tr> |
140 | 144 | ||
... | @@ -143,11 +147,13 @@ | ... | @@ -143,11 +147,13 @@ |
143 | <td class="l"> | 147 | <td class="l"> |
144 | <? | 148 | <? |
145 | $fileIndex = "101"; | 149 | $fileIndex = "101"; |
146 | $fileName = "img1"; | 150 | $fileName = "imgPathVehicle1"; |
147 | $filePath = ($shopImgList[0]["file_vir_name"] == "" ? "" : $shopImgList[0]["file_vir_name"]); | 151 | $filePath = ($info["imgPathVehicle1"] == "" ? "" : $info["imgPathVehicle1"]); |
148 | $fileNumber = ($shopImgList[0]["no"] == "" ? "0" : $shopImgList[0]["no"]); | 152 | //$fileNumber = ($shopImgList[0]["no"] == "" ? "0" : $shopImgList[0]["no"]); |
149 | include $_SERVER["DOCUMENT_ROOT"] . "/admin/inc/fileUpload/fileUpload.php"; | 153 | include $_SERVER["DOCUMENT_ROOT"] . "/admin/inc/fileUpload/fileUpload.php"; |
150 | ?> | 154 | ?> |
155 | <input type="hidden" name="imgPathVehicle1" value="<?=$info["imgPathVehicle1"]?>" /> | ||
156 | |||
151 | </td> | 157 | </td> |
152 | </tr> | 158 | </tr> |
153 | <tr> | 159 | <tr> |
... | @@ -155,11 +161,12 @@ | ... | @@ -155,11 +161,12 @@ |
155 | <td class="l"> | 161 | <td class="l"> |
156 | <? | 162 | <? |
157 | $fileIndex = "102"; | 163 | $fileIndex = "102"; |
158 | $fileName = "img2"; | 164 | $fileName = "imgPathVehicle2"; |
159 | $filePath = ($shopImgList[1]["file_vir_name"] == "" ? "" : $shopImgList[1]["file_vir_name"]); | 165 | $filePath = ($info["imgPathVehicle2"] == "" ? "" : $info["imgPathVehicle2"]); |
160 | $fileNumber = ($shopImgList[1]["no"] == "" ? "0" : $shopImgList[1]["no"]); | 166 | //$fileNumber = ($shopImgList[1]["no"] == "" ? "0" : $shopImgList[1]["no"]); |
161 | include $_SERVER["DOCUMENT_ROOT"] . "/admin/inc/fileUpload/fileUpload.php"; | 167 | include $_SERVER["DOCUMENT_ROOT"] . "/admin/inc/fileUpload/fileUpload.php"; |
162 | ?> | 168 | ?> |
169 | <input type="hidden" name="imgPathVehicle2" value="<?=$info["imgPathVehicle2"]?>" /> | ||
163 | </td> | 170 | </td> |
164 | </tr> | 171 | </tr> |
165 | <tr> | 172 | <tr> |
... | @@ -167,11 +174,12 @@ | ... | @@ -167,11 +174,12 @@ |
167 | <td class="l"> | 174 | <td class="l"> |
168 | <? | 175 | <? |
169 | $fileIndex = "103"; | 176 | $fileIndex = "103"; |
170 | $fileName = "img3"; | 177 | $fileName = "imgPathVehicle3"; |
171 | $filePath = ($shopImgList[2]["file_vir_name"] == "" ? "" : $shopImgList[2]["file_vir_name"]); | 178 | $filePath = ($info["imgPathVehicle3"] == "" ? "" : $info["imgPathVehicle3"]); |
172 | $fileNumber = ($shopImgList[2]["no"] == "" ? "0" : $shopImgList[2]["no"]); | 179 | //$fileNumber = ($shopImgList[2]["no"] == "" ? "0" : $shopImgList[2]["no"]); |
173 | include $_SERVER["DOCUMENT_ROOT"] . "/admin/inc/fileUpload/fileUpload.php"; | 180 | include $_SERVER["DOCUMENT_ROOT"] . "/admin/inc/fileUpload/fileUpload.php"; |
174 | ?> | 181 | ?> |
182 | <input type="hidden" name="imgPathVehicle3" value="<?=$info["imgPathVehicle3"]?>" /> | ||
175 | </td> | 183 | </td> |
176 | </tr> | 184 | </tr> |
177 | <tr> | 185 | <tr> |
... | @@ -179,11 +187,12 @@ | ... | @@ -179,11 +187,12 @@ |
179 | <td class="l"> | 187 | <td class="l"> |
180 | <? | 188 | <? |
181 | $fileIndex = "104"; | 189 | $fileIndex = "104"; |
182 | $fileName = "img4"; | 190 | $fileName = "imgPathVehicle4"; |
183 | $filePath = ($shopImgList[3]["file_vir_name"] == "" ? "" : $shopImgList[3]["file_vir_name"]); | 191 | $filePath = ($info["imgPathVehicle4"] == "" ? "" : $info["imgPathVehicle4"]); |
184 | $fileNumber = ($shopImgList[3]["no"] == "" ? "0" : $shopImgList[3]["no"]); | 192 | //$fileNumber = ($shopImgList[3]["no"] == "" ? "0" : $shopImgList[3]["no"]); |
185 | include $_SERVER["DOCUMENT_ROOT"] . "/admin/inc/fileUpload/fileUpload.php"; | 193 | include $_SERVER["DOCUMENT_ROOT"] . "/admin/inc/fileUpload/fileUpload.php"; |
186 | ?> | 194 | ?> |
195 | <input type="hidden" name="imgPathVehicle4" value="<?=$info["imgPathVehicle4"]?>" /> | ||
187 | </td> | 196 | </td> |
188 | </tr> | 197 | </tr> |
189 | <tr> | 198 | <tr> |
... | @@ -191,11 +200,12 @@ | ... | @@ -191,11 +200,12 @@ |
191 | <td class="l"> | 200 | <td class="l"> |
192 | <? | 201 | <? |
193 | $fileIndex = "105"; | 202 | $fileIndex = "105"; |
194 | $fileName = "img5"; | 203 | $fileName = "imgPathVehicle5"; |
195 | $filePath = ($shopImgList[4]["file_vir_name"] == "" ? "" : $shopImgList[4]["file_vir_name"]); | 204 | $filePath = ($info["imgPathVehicle5"] == "" ? "" : $info["imgPathVehicle5"]); |
196 | $fileNumber = ($shopImgList[4]["no"] == "" ? "0" : $shopImgList[4]["no"]); | 205 | //$fileNumber = ($shopImgList[4]["no"] == "" ? "0" : $shopImgList[4]["no"]); |
197 | include $_SERVER["DOCUMENT_ROOT"] . "/admin/inc/fileUpload/fileUpload.php"; | 206 | include $_SERVER["DOCUMENT_ROOT"] . "/admin/inc/fileUpload/fileUpload.php"; |
198 | ?> | 207 | ?> |
208 | <input type="hidden" name="imgPathVehicle5" value="<?=$info["imgPathVehicle5"]?>" /> | ||
199 | </td> | 209 | </td> |
200 | </tr> | 210 | </tr> |
201 | </table> | 211 | </table> | ... | ... |
1 | <? include $_SERVER["DOCUMENT_ROOT"] . "/common/classes/AdminBase.php" ; | ||
2 | include $_SERVER[DOCUMENT_ROOT] . "/common/php/LoginUtil.php"; | ||
3 | |||
4 | if (! class_exists("AdminCompany")){ | ||
5 | class AdminCompany extends AdminBase{ | ||
6 | function __construct($req) | ||
7 | { | ||
8 | parent::__construct($req); | ||
9 | } | ||
10 | |||
11 | function getListOfCompany(){ | ||
12 | $productCode=$this->req["productCode"]; | ||
13 | |||
14 | $sql=" | ||
15 | SELECT COUNT(*) AS rn | ||
16 | FROM tblCompany | ||
17 | WHERE productCode='{$productCode}' AND status=1 | ||
18 | "; | ||
19 | $this->initPage(); | ||
20 | $this->rownum=$this->getValue($sql, 'rn'); | ||
21 | $this->setPage($this->rownum); | ||
22 | $limit=" LIMIT {$this->startNum}, {$this->endNum} ;"; | ||
23 | |||
24 | |||
25 | |||
26 | $sql=" | ||
27 | SELECT companyNo, name, provinceCode, address, telephone | ||
28 | FROM tblCompany | ||
29 | WHERE productCode='{$productCode}' AND status=1 | ||
30 | ORDER BY regDate DESC | ||
31 | {$limit} | ||
32 | "; | ||
33 | $result=$this->getArray($sql); | ||
34 | return $result; | ||
35 | } | ||
36 | |||
37 | function getInfoOfCompany(){ | ||
38 | $companyNo=$_REQUEST["companyNo"]; | ||
39 | $sql=" | ||
40 | SELECT * | ||
41 | FROM tblCompany | ||
42 | WHERE companyNo='{$companyNo}' AND status=1 | ||
43 | "; | ||
44 | $result=$this->getRow($sql); | ||
45 | //echo json_encode($result); | ||
46 | return $result; | ||
47 | } | ||
48 | |||
49 | function getListOfProvince(){ | ||
50 | $sql=" | ||
51 | SELECT * | ||
52 | FROM tblZipProvince | ||
53 | ORDER BY provinceNumber ASC | ||
54 | "; | ||
55 | $result=$this->getArray($sql); | ||
56 | return $result; | ||
57 | } | ||
58 | |||
59 | function saveCompany(){ | ||
60 | $companyType=$this->req["companyType"]; | ||
61 | $companyNo=$this->req["companyNo"]; | ||
62 | $name=$this->req["name"]; | ||
63 | |||
64 | $productCode=$this->req["productCode"]; | ||
65 | $provinceCode=$this->req["provinceCode"]; | ||
66 | $address=$this->req["address"]; | ||
67 | $telephone1=$this->req["telephone1"]; | ||
68 | $telephone2=$this->req["telephone2"]; | ||
69 | $telephone3=$this->req["telephone3"]; | ||
70 | $telephone=$telephone1.$telephone2.$telephone3; | ||
71 | $fax1=$this->req["fax1"]; | ||
72 | $fax2=$this->req["fax2"]; | ||
73 | $fax3=$this->req["fax3"]; | ||
74 | $fax=$fax1.$fax2.$fax3; | ||
75 | $eMail=$this->req["eMail"]; | ||
76 | $companyProductList=$this->req["companyProductList"]; | ||
77 | |||
78 | $imgResult = $this->inFn_Common_fileSave($_FILES); | ||
79 | |||
80 | $imgPathCompany1 = $imgResult["imgPathCompany1"]["saveURL"] != "" ? $imgResult["imgPathCompany1"]["saveURL"] : $this->req["imgPathCompany1"]; | ||
81 | $imgPathCompany2 = $imgResult["imgPathCompany2"]["saveURL"] != "" ? $imgResult["imgPathCompany2"]["saveURL"] : $this->req["imgPathCompany2"]; | ||
82 | $imgPathCompany3 = $imgResult["imgPathCompany3"]["saveURL"] != "" ? $imgResult["imgPathCompany3"]["saveURL"] : $this->req["imgPathCompany3"]; | ||
83 | $imgPathCompany4 = $imgResult["imgPathCompany4"]["saveURL"] != "" ? $imgResult["imgPathCompany4"]["saveURL"] : $this->req["imgPathCompany4"]; | ||
84 | $imgPathCompany5 = $imgResult["imgPathCompany5"]["saveURL"] != "" ? $imgResult["imgPathCompany5"]["saveURL"] : $this->req["imgPathCompany5"]; | ||
85 | |||
86 | if($companyNo == ""){ | ||
87 | $sql=" | ||
88 | insert INTO `tblCompany` | ||
89 | ( | ||
90 | `name`, | ||
91 | `imgPathCompany1`, | ||
92 | `imgPathCompany2`, | ||
93 | `imgPathCompany3`, | ||
94 | `imgPathCompany4`, | ||
95 | `imgPathCompany5`, | ||
96 | `provinceCode`, | ||
97 | `productCode`, | ||
98 | `address`, | ||
99 | `telephone`, | ||
100 | `fax`, | ||
101 | `eMail`, | ||
102 | `companyProductList`, | ||
103 | `status`, | ||
104 | `regDate` | ||
105 | ) | ||
106 | VALUES | ||
107 | ( | ||
108 | '{$name}', | ||
109 | '{$imgPathCompany1}', | ||
110 | '{$imgPathCompany2}', | ||
111 | '{$imgPathCompany3}', | ||
112 | '{$imgPathCompany4}', | ||
113 | '{$imgPathCompany5}', | ||
114 | '{$provinceCode}', | ||
115 | '{$productCode}', | ||
116 | '{$address}', | ||
117 | '{$telephone}', | ||
118 | '{$fax}', | ||
119 | '{$eMail}', | ||
120 | '{$companyProductList}', | ||
121 | 1, | ||
122 | NOW() | ||
123 | ); | ||
124 | "; | ||
125 | $this->update($sql); | ||
126 | |||
127 | return $this->makeResultJson(1, "저장되었습니다"); | ||
128 | } | ||
129 | else{ | ||
130 | $sql=" | ||
131 | UPDATE tblCompany | ||
132 | SET | ||
133 | name='{$name}', | ||
134 | `imgPathCompany1`= '{$imgPathCompany1}', | ||
135 | `imgPathCompany2`= '{$imgPathCompany2}', | ||
136 | `imgPathCompany3`= '{$imgPathCompany3}', | ||
137 | `imgPathCompany4`= '{$imgPathCompany4}', | ||
138 | `imgPathCompany5`= '{$imgPathCompany5}', | ||
139 | provinceCode='{$provinceCode}', | ||
140 | productCode='{$productCode}', | ||
141 | address='{$address}', | ||
142 | telephone='{$telephone}', | ||
143 | fax='{$fax}', | ||
144 | eMail='{$eMail}', | ||
145 | companyProductList='{$companyProductList}' | ||
146 | WHERE companyNo='{$companyNo}' | ||
147 | "; | ||
148 | $this->update($sql); | ||
149 | return $this->makeResultJson(1, "수정되었습니다"); | ||
150 | } | ||
151 | } | ||
152 | |||
153 | function deleteCompany(){ | ||
154 | $noArr = $this->req["no"]; | ||
155 | |||
156 | $noStr = implode(',', $noArr); | ||
157 | |||
158 | $sql = " | ||
159 | UPDATE tblCompany | ||
160 | SET status = 0 | ||
161 | WHERE `companyNo` IN({$noStr}) | ||
162 | "; | ||
163 | $this->update($sql); | ||
164 | } | ||
165 | |||
166 | |||
167 | |||
168 | } | ||
169 | } | ||
170 | ?> | ||
... | \ No newline at end of file | ... | \ No newline at end of file |
... | @@ -16,15 +16,15 @@ if(!class_exists("AdminEtc")){ | ... | @@ -16,15 +16,15 @@ if(!class_exists("AdminEtc")){ |
16 | // 관리자 비밀번호 변경 | 16 | // 관리자 비밀번호 변경 |
17 | function chageAdminPWD() | 17 | function chageAdminPWD() |
18 | { | 18 | { |
19 | $no = $this->admUser["no"]; | 19 | $no = $this->admUser["adminNo"]; |
20 | $nowPWD = $this->req["nowPWD"]; | 20 | $nowPWD = $this->req["nowPWD"]; |
21 | $newPWD = $this->req["newPWD"]; | 21 | $newPWD = $this->req["newPWD"]; |
22 | 22 | ||
23 | 23 | ||
24 | $sql = " | 24 | $sql = " |
25 | SELECT * | 25 | SELECT * |
26 | FROM tbl_admin | 26 | FROM tblAdmin |
27 | WHERE `no` = '{$no}' | 27 | WHERE `adminNo` = '{$no}' |
28 | LIMIT 1 | 28 | LIMIT 1 |
29 | "; | 29 | "; |
30 | $result = $this->getRow($sql); | 30 | $result = $this->getRow($sql); |
... | @@ -36,7 +36,7 @@ if(!class_exists("AdminEtc")){ | ... | @@ -36,7 +36,7 @@ if(!class_exists("AdminEtc")){ |
36 | } | 36 | } |
37 | 37 | ||
38 | 38 | ||
39 | if($result["admin_pwd"] != MD5($nowPWD)) | 39 | if($result["adminPwd"] != MD5($nowPWD)) |
40 | { | 40 | { |
41 | $_REQUEST["msg"] = "현재 비밀번호가 일치하지 않습니다."; | 41 | $_REQUEST["msg"] = "현재 비밀번호가 일치하지 않습니다."; |
42 | return false; | 42 | return false; |
... | @@ -44,10 +44,9 @@ if(!class_exists("AdminEtc")){ | ... | @@ -44,10 +44,9 @@ if(!class_exists("AdminEtc")){ |
44 | 44 | ||
45 | 45 | ||
46 | $sql = " | 46 | $sql = " |
47 | UPDATE tbl_admin | 47 | UPDATE tblAdmin |
48 | SET admin_pwd = MD5('{$newPWD}') | 48 | SET adminPwd = MD5('{$newPWD}') |
49 | , admin_pwd_enc = HEX('{$newPWD}') | 49 | WHERE `adminNo` = '{$no}' |
50 | WHERE `no` = '{$no}' | ||
51 | "; | 50 | "; |
52 | $this->update($sql); | 51 | $this->update($sql); |
53 | 52 | ... | ... |
1 | <? include $_SERVER["DOCUMENT_ROOT"] . "/common/classes/AdminBase.php" ;?> | ||
2 | <? | ||
3 | |||
4 | /* | ||
5 | * Admin process | ||
6 | * add by dev.lee | ||
7 | */ | ||
8 | |||
9 | if (! class_exists("AdminRent")) | ||
10 | { | ||
11 | |||
12 | class AdminRent extends AdminBase | ||
13 | { | ||
14 | |||
15 | function __construct($req) | ||
16 | { | ||
17 | parent::__construct($req); | ||
18 | } | ||
19 | |||
20 | public function saveBuilding() | ||
21 | { | ||
22 | $no = $this->req["no"]; | ||
23 | $name = $this->req["name"]; | ||
24 | |||
25 | $sql="SELECT no FROM tbl_user_group WHERE name='{$name}'"; | ||
26 | $result=$this->getRow($sql); | ||
27 | $group_fk=$result["no"]; | ||
28 | |||
29 | $vip_fk=$this->req["vip_fk"]; | ||
30 | |||
31 | $type = $this->req["type"]; | ||
32 | $address = $this->req["address"]; | ||
33 | $expire_date = $this->req["expire_date"]; | ||
34 | $manage_type = $this->req["manage_type"]; | ||
35 | $owner_name = $this->req["owner_name"]; | ||
36 | $owner_tel = $this->req["owner_tel"]; | ||
37 | $owner_address = $this->req["owner_address"]; | ||
38 | $month_account_no = $this->req["month_account_no"]; | ||
39 | $month_account_bank = $this->req["month_account_bank"]; | ||
40 | $month_account_owner = $this->req["month_account_owner"]; | ||
41 | $util_account_no = $this->req["util_account_no"]; | ||
42 | $util_account_bank = $this->req["util_account_bank"]; | ||
43 | $util_account_owner = $this->req["util_account_owner"]; | ||
44 | $owner_account_no = $this->req["owner_account_no"]; | ||
45 | $owner_account_bank = $this->req["owner_account_bank"]; | ||
46 | $owner_account_owner = $this->req["owner_account_owner"]; | ||
47 | $rent_manager = $this->req["rent_manager"]; | ||
48 | $manage_pay_date = $this->req["manage_pay_date"]; | ||
49 | $note = $this->req["note"]; | ||
50 | |||
51 | $expire_date = !strlen($expire_date)?"NULL":"'$expire_date'"; | ||
52 | |||
53 | if($no == "") | ||
54 | { | ||
55 | $sql = " | ||
56 | INSERT INTO | ||
57 | tbl_building(group_fk, vip_fk, name, type, address, expire_date, manage_type, owner_name, owner_tel, owner_address, month_account_no, month_account_bank, month_account_owner, util_account_no, util_account_bank, util_account_owner, owner_account_no, owner_account_bank, owner_account_owner, rent_manager, manage_pay_date, note, insert_datetime, status) | ||
58 | VALUES | ||
59 | ('{$group_fk}', '{$vip_fk}', '{$name}', '{$type}', '{$address}', '{$expire_date}', '{$manage_type}', '{$owner_name}', '{$owner_tel}', '{$owner_address}', '{$month_account_no}', '{$month_account_bank}', '{$month_account_owner}', '{$util_account_no}', '{$util_account_bank}', '{$util_account_owner}', '{$owner_account_no}', '{$owner_account_bank}', '{$owner_account_owner}', '{$rent_manager}', '{$manage_pay_date}', '{$note}', NOW(), 'Y') | ||
60 | "; | ||
61 | |||
62 | $this->update($sql); | ||
63 | |||
64 | $sql=" | ||
65 | UPDATE tbl_user_group | ||
66 | SET | ||
67 | `is_matched` = 'Y' | ||
68 | WHERE `no`='{$group_fk}' | ||
69 | "; | ||
70 | $this->update($sql); | ||
71 | if(!empty($vip_fk)){ | ||
72 | $sql=" | ||
73 | UPDATE tbl_user | ||
74 | SET is_matched = 1 | ||
75 | where no='{$vip_fk}' | ||
76 | "; | ||
77 | $this->update($sql); | ||
78 | } | ||
79 | |||
80 | |||
81 | return $this->makeResultJson(1, "등록되었습니다."); | ||
82 | } | ||
83 | else | ||
84 | { | ||
85 | $sql = " | ||
86 | UPDATE tbl_building | ||
87 | SET | ||
88 | `group_fk` = '{$group_fk}', | ||
89 | `vip_fk` = '{$vip_fk}', | ||
90 | `name` = '{$name}', | ||
91 | `type` = '{$type}', | ||
92 | `address` = '{$address}', | ||
93 | `expire_date` = $expire_date, | ||
94 | `manage_type` = '{$manage_type}', | ||
95 | `owner_name` = '{$owner_name}', | ||
96 | `owner_tel` = '{$owner_tel}', | ||
97 | `owner_address` = '{$owner_address}', | ||
98 | `month_account_no` = '{$month_account_no}', | ||
99 | `month_account_bank` = '{$month_account_bank}', | ||
100 | `month_account_owner` = '{$month_account_owner}', | ||
101 | `util_account_no` = '{$util_account_no}', | ||
102 | `util_account_bank` = '{$util_account_bank}', | ||
103 | `util_account_owner` = '{$util_account_owner}', | ||
104 | `owner_account_no` = '{$owner_account_no}', | ||
105 | `owner_account_bank` = '{$owner_account_bank}', | ||
106 | `owner_account_owner` = '{$owner_account_owner}', | ||
107 | `rent_manager` = '{$rent_manager}', | ||
108 | `manage_pay_date` = '{$manage_pay_date}', | ||
109 | `note` = '{$note}', | ||
110 | `update_datetime` = NOW() | ||
111 | WHERE `no` = '{$no}' | ||
112 | "; | ||
113 | $this->update($sql); | ||
114 | |||
115 | if($vip_fk!=0){ | ||
116 | $sql=" | ||
117 | UPDATE tbl_user | ||
118 | SET is_matched = 1 | ||
119 | where no='{$vip_fk}' | ||
120 | "; | ||
121 | $this->update($sql); | ||
122 | } | ||
123 | |||
124 | $vip=$this->req["current_vip"]; | ||
125 | if($vip != $vip_fk){ | ||
126 | $sql=" | ||
127 | UPDATE tbl_user | ||
128 | SET is_matched=0 | ||
129 | WHERE no='{$vip}' | ||
130 | "; | ||
131 | $this->update($sql); | ||
132 | } | ||
133 | |||
134 | return $this->makeResultJson(1, "수정되었습니다."); | ||
135 | } | ||
136 | } | ||
137 | |||
138 | public function delBuilding() | ||
139 | { | ||
140 | $noArr = $this->req["no"]; | ||
141 | $noStr = implode(',', $noArr); | ||
142 | |||
143 | $sql=" | ||
144 | SELECT vip_fk | ||
145 | FROM tbl_building | ||
146 | WHERE `no` IN({$noStr}) | ||
147 | "; | ||
148 | $result=$this->getArray($sql); | ||
149 | for($i=0;$i<sizeof($result); $i++){ | ||
150 | $userStr = implode(',', $result[$i]); | ||
151 | } | ||
152 | |||
153 | $sql=" | ||
154 | SELECT group_fk | ||
155 | FROM tbl_building | ||
156 | WHERE `no` IN({$noStr}) | ||
157 | "; | ||
158 | $result=$this->getArray($sql); | ||
159 | for($i=0;$i<sizeof($result); $i++){ | ||
160 | $groupStr = implode(',', $result[$i]); | ||
161 | } | ||
162 | |||
163 | $sql=" | ||
164 | UPDATE tbl_user | ||
165 | SET is_matched=0 | ||
166 | WHERE `no` IN({$userStr}) | ||
167 | "; | ||
168 | $this->update($sql); | ||
169 | |||
170 | $sql=" | ||
171 | UPDATE tbl_user_group | ||
172 | SET is_matched='N' | ||
173 | WHERE `no` IN({$groupStr}) | ||
174 | "; | ||
175 | $this->update($sql); | ||
176 | |||
177 | $sql = " | ||
178 | UPDATE tbl_building | ||
179 | SET status = 'N' | ||
180 | WHERE `no` IN({$noStr}) | ||
181 | "; | ||
182 | $this->update($sql); | ||
183 | } | ||
184 | |||
185 | public function saveRoom() | ||
186 | { | ||
187 | |||
188 | |||
189 | |||
190 | $no=$this->req["no"]; | ||
191 | $building_fk=$this->req["building_fk"]; | ||
192 | $name=$this->req["name"]; | ||
193 | $manage_type=$this->req["manage_type"]; | ||
194 | $pw=$this->req["pw"]; | ||
195 | $contract_status=$this->req["contract_status"]; | ||
196 | $contractor_name=$this->req["contractor_name"]; | ||
197 | $contractor_tel=$this->req["contractor_tel"]; | ||
198 | $contractor_car_no=$this->req["contractor_car_no"]; | ||
199 | $contractor_account_no=$this->req["contractor_account_no"]; | ||
200 | $contractor_account_bank=$this->req["contractor_account_bank"]; | ||
201 | $contractor_account_owner=$this->req["contractor_account_owner"]; | ||
202 | $contract_date=$this->req["contract_date"]; | ||
203 | $contract_expire_date=$this->req["contract_expire_date"]; | ||
204 | $move_in_date=$this->req["move_in_date"]; | ||
205 | $deposit=$this->req["deposit"]; | ||
206 | $balance=$this->req["balance"]; | ||
207 | $payment_owner=$this->req["payment_owner"]; | ||
208 | $monthly_rent=$this->req["monthly_rent"]; | ||
209 | $maintenance_fee=$this->req["maintenance_fee"]; | ||
210 | $cable=$this->req["cable"]; | ||
211 | $internet=$this->req["internet"]; | ||
212 | $rent_1=$this->req["rent_1"]; | ||
213 | $rent_2=$this->req["rent_2"]; | ||
214 | $etc=$this->req["etc"]; | ||
215 | $monthly_rent_date=$this->req["monthly_rent_date"]; | ||
216 | $payment_owner_date=$this->req["payment_owner_date"]; | ||
217 | $electricity_check_date=$this->req["electricity_check_date"]; | ||
218 | $gas_check_date=$this->req["gas_check_date"]; | ||
219 | $water_check_date=$this->req["water_check_date"]; | ||
220 | $billing_date=$this->req["billing_date"]; | ||
221 | /* | ||
222 | $gas_charge=$this->req["gas_charge"]; | ||
223 | $electricity_charge=$this->req["electricity_charge"]; | ||
224 | $water_charge=$this->req["water_charge"]; | ||
225 | $community_electricity_charge=$this->req["community_electricity_charge"]; | ||
226 | $community_water_charge=$this->req["community_water_charge"]; | ||
227 | */ | ||
228 | $entering_due_date=$this->req["entering_due_date"]; | ||
229 | $leaving_due_date=$this->req["leaving_due_date"]; | ||
230 | $special_contract=$this->req["special_contract"]; | ||
231 | |||
232 | if($this->req["move_in_date"]==""){ | ||
233 | $move_in_date = NULL; | ||
234 | } | ||
235 | |||
236 | $sql=" | ||
237 | SELECT U.name | ||
238 | FROM tbl_user AS U | ||
239 | JOIN tbl_building AS B ON U.group_fk=B.group_fk | ||
240 | WHERE U.no='{$contractor_name}' | ||
241 | LIMIT 1 | ||
242 | "; | ||
243 | $result=$this->getRow($sql); | ||
244 | $user_fk=$contractor_name; | ||
245 | $contractor_name=$result["name"]; | ||
246 | |||
247 | $contract_expire_date = !strlen($contract_expire_date)?"NULL":"'$contract_expire_date'"; | ||
248 | $move_in_date = !strlen($move_in_date)?"NULL":"'$move_in_date'"; | ||
249 | $contract_date = !strlen($contract_date)?"NULL":"'$contract_date'"; | ||
250 | $entering_due_date = !strlen($entering_due_date)?"NULL":"'$entering_due_date'"; | ||
251 | $leaving_due_date = !strlen($leaving_due_date)?"NULL":"'$leaving_due_date'"; | ||
252 | |||
253 | $returnMessage = "" ; | ||
254 | |||
255 | if($no==""){ | ||
256 | |||
257 | $sql=" | ||
258 | INSERT INTO | ||
259 | tbl_room(building_fk, name, manage_type, pw, contract_status, contractor_name, contractor_tel, | ||
260 | contractor_car_no, contractor_account_no, contractor_account_bank, | ||
261 | contractor_account_owner, contract_date, contract_expire_date, move_in_date, deposit, balance, payment_owner, | ||
262 | monthly_rent, maintenance_fee, cable, internet, rent_1, rent_2, etc, monthly_rent_date, payment_owner_date, | ||
263 | electricity_check_date, gas_check_date, water_check_date, billing_date, entering_due_date, leaving_due_date, | ||
264 | special_contract, status, user_fk, insert_date) | ||
265 | VALUES | ||
266 | ('{$building_fk}', '{$name}', '{$manage_type}', '{$pw}', '{$contract_status}', '{$contractor_name}', '{$contractor_tel}', | ||
267 | '{$contractor_car_no}', '{$contractor_account_no}', '{$contractor_account_bank}', '{$contractor_account_owner}', $contract_date, | ||
268 | $contract_expire_date, $move_in_date, '{$deposit}', '{$balance}', '{$payment_owner}', '{$monthly_rent}', | ||
269 | '{$maintenance_fee}', '{$cable}', '{$internet}', '{$rent_1}', '{$rent_2}', '{$etc}', '{$monthly_rent_date}', | ||
270 | '{$payment_owner_date}', '{$electricity_check_date}', '{$gas_check_date}', '{$water_check_date}', '{$billing_date}', | ||
271 | $entering_due_date, | ||
272 | $leaving_due_date, '{$special_contract}', 'Y', '{$user_fk}', NOW()) | ||
273 | "; | ||
274 | |||
275 | $this->update($sql); | ||
276 | |||
277 | $no = $this->mysql_insert_id() ; | ||
278 | |||
279 | |||
280 | if(!empty($user_fk)){ | ||
281 | $sql=" | ||
282 | UPDATE tbl_user | ||
283 | SET is_matched = 1 | ||
284 | where no='{$user_fk}' | ||
285 | "; | ||
286 | $this->update($sql); | ||
287 | } | ||
288 | |||
289 | |||
290 | $returnMessage = "저장되었습니다." ; | ||
291 | } | ||
292 | else{ | ||
293 | |||
294 | $sql=" | ||
295 | UPDATE tbl_room | ||
296 | SET | ||
297 | `building_fk`='{$building_fk}', | ||
298 | `name`='{$name}', | ||
299 | `manage_type`='{$manage_type}', | ||
300 | `pw`='{$pw}', | ||
301 | `contract_status`= '{$contract_status}', | ||
302 | `contractor_name`= '{$contractor_name}', | ||
303 | `contractor_tel`='{$contractor_tel}', | ||
304 | `contractor_car_no`='{$contractor_car_no}', | ||
305 | `contractor_account_no`='{$contractor_account_no}', | ||
306 | `contractor_account_bank`='{$contractor_account_bank}', | ||
307 | `contractor_account_owner`='{$contractor_account_owner}', | ||
308 | `contract_date`={$contract_date}, | ||
309 | `contract_expire_date`={$contract_expire_date}, | ||
310 | `move_in_date`={$move_in_date}, | ||
311 | `deposit`='{$deposit}', | ||
312 | `balance`= '{$balance}', | ||
313 | `payment_owner`='{$payment_owner}', | ||
314 | `monthly_rent`='{$monthly_rent}', | ||
315 | `maintenance_fee`='{$maintenance_fee}', | ||
316 | `cable`='{$cable}', | ||
317 | `internet`='{$internet}', | ||
318 | `rent_1`='{$rent_1}', | ||
319 | `rent_2`='{$rent_2}', | ||
320 | `etc`='{$etc}', | ||
321 | `monthly_rent_date`='{$monthly_rent_date}', | ||
322 | `payment_owner_date`='{$payment_owner_date}', | ||
323 | `electricity_check_date`='{$electricity_check_date}', | ||
324 | `gas_check_date`='{$gas_check_date}', | ||
325 | `water_check_date`='{$water_check_date}', | ||
326 | `billing_date`='{$billing_date}', | ||
327 | `entering_due_date`={$entering_due_date}, | ||
328 | `leaving_due_date`={$leaving_due_date}, | ||
329 | `special_contract`='{$special_contract}', | ||
330 | `user_fk`='{$user_fk}' | ||
331 | WHERE `no` = '{$no}' | ||
332 | "; | ||
333 | |||
334 | $this->update($sql); | ||
335 | |||
336 | |||
337 | if($user_fk!=0){ | ||
338 | $sql=" | ||
339 | UPDATE tbl_user | ||
340 | SET is_matched = 1 | ||
341 | where no='{$user_fk}' | ||
342 | "; | ||
343 | $this->update($sql); | ||
344 | } | ||
345 | $user_fk2=$this->req["current_contractor"]; | ||
346 | |||
347 | if($user_fk != $user_fk2){ | ||
348 | $sql=" | ||
349 | UPDATE tbl_user | ||
350 | SET is_matched = 0 | ||
351 | where no='{$user_fk2}' | ||
352 | "; | ||
353 | $this->update($sql); | ||
354 | } | ||
355 | |||
356 | $returnMessage = "수정되었습니다." ; | ||
357 | } | ||
358 | |||
359 | |||
360 | $sql = " | ||
361 | INSERT INTO | ||
362 | tbl_room_history(no, building_fk, name, manage_type, pw, contract_status, contractor_name, contractor_tel, | ||
363 | contractor_car_no, contractor_account_no, contractor_account_bank, | ||
364 | contractor_account_owner, contract_date, contract_expire_date, move_in_date, deposit, balance, payment_owner, | ||
365 | monthly_rent, maintenance_fee, cable, internet, rent_1, rent_2, etc, monthly_rent_date, payment_owner_date, | ||
366 | electricity_check_date, gas_check_date, water_check_date, billing_date, entering_due_date, leaving_due_date, | ||
367 | special_contract, status, user_fk, insert_date, history_month) | ||
368 | |||
369 | SELECT | ||
370 | no, building_fk, name, manage_type, pw, contract_status, contractor_name, contractor_tel, | ||
371 | contractor_car_no, contractor_account_no, contractor_account_bank, | ||
372 | contractor_account_owner, contract_date, contract_expire_date, move_in_date, deposit, balance, payment_owner, | ||
373 | monthly_rent, maintenance_fee, cable, internet, rent_1, rent_2, etc, monthly_rent_date, payment_owner_date, | ||
374 | electricity_check_date, gas_check_date, water_check_date, billing_date, entering_due_date, leaving_due_date, | ||
375 | special_contract, status, user_fk, insert_date, NOW() | ||
376 | FROM tbl_room | ||
377 | WHERE `no` = '{$no}' | ||
378 | "; | ||
379 | |||
380 | $this->update($sql); | ||
381 | |||
382 | return $this->makeResultJson(1, $returnMessage); | ||
383 | |||
384 | } | ||
385 | |||
386 | public function saveRequestCharge() | ||
387 | { | ||
388 | $no=$this->req["no"]; | ||
389 | $building_name=$this->req["building_name"]; | ||
390 | $room_name=$this->req["room_name"]; | ||
391 | $request_date=$this->req["request_date"]; | ||
392 | $handled_date=$this->req["handled_date"]; | ||
393 | $charge=$this->req["charge"]; | ||
394 | $info=$this->req["info"]; | ||
395 | |||
396 | if($no==""){ | ||
397 | |||
398 | $sql=" | ||
399 | SELECT `R`.no | ||
400 | FROM tbl_room AS `R` | ||
401 | JOIN tbl_building AS `B` ON `R`.building_fk=`B`.no | ||
402 | WHERE `B`.name='{$building_name}' AND `R`.name='{$room_name}' | ||
403 | "; | ||
404 | |||
405 | $result=$this->getRow($sql); | ||
406 | $room_fk=$result["no"]; | ||
407 | |||
408 | |||
409 | $sql=" | ||
410 | INSERT INTO | ||
411 | tbl_request_charge(`room_fk`, `building_name`, `room_name`, `request_date`, `handled_date`, `charge`, `info`, `status`) | ||
412 | VALUES('{$room_fk}', '{$building_name}', '{$room_name}','{$request_date}', '{$handled_date}', '{$charge}', '{$info}', 'Y') | ||
413 | "; | ||
414 | |||
415 | $this->update($sql); | ||
416 | return $this->makeResultJson(1, "저장되었습니다"); | ||
417 | } | ||
418 | else{ | ||
419 | $sql=" | ||
420 | UPDATE tbl_request_charge | ||
421 | SET | ||
422 | `building_name`='{$building_name}', | ||
423 | `room_name`='{$room_name}', | ||
424 | `request_date`='{$request_date}', | ||
425 | `handled_date`='{$handled_date}', | ||
426 | `charge`='{$charge}', | ||
427 | `info`='{$info}' | ||
428 | WHERE `no`='{$no}' | ||
429 | "; | ||
430 | $this->update($sql); | ||
431 | return $this->makeResultJson(1, "수정되었습니다"); | ||
432 | } | ||
433 | |||
434 | } | ||
435 | |||
436 | public function delRoom() | ||
437 | { | ||
438 | $noArr = $this->req["no"]; | ||
439 | $noStr = implode(',', $noArr); | ||
440 | |||
441 | $sql=" | ||
442 | SELECT user_fk | ||
443 | FROM tbl_room | ||
444 | WHERE `no` IN({$noStr}) | ||
445 | "; | ||
446 | $result=$this->getArray($sql); | ||
447 | |||
448 | for($i=0;$i<sizeof($result); $i++){ | ||
449 | $userStr = implode(',', $result[$i]); | ||
450 | } | ||
451 | |||
452 | $sql=" | ||
453 | UPDATE tbl_user | ||
454 | SET is_matched=0 | ||
455 | WHERE `no` IN({$userStr}) | ||
456 | "; | ||
457 | $this->update($sql); | ||
458 | |||
459 | $sql = " | ||
460 | UPDATE tbl_room | ||
461 | SET status = 'N' | ||
462 | WHERE `no` IN({$noStr}) | ||
463 | "; | ||
464 | $this->update($sql); | ||
465 | } | ||
466 | |||
467 | public function getInfoOfBill() | ||
468 | { | ||
469 | $no=$this->req["no"]; | ||
470 | |||
471 | $sql=" | ||
472 | SELECT electricity_check_date, gas_check_date, water_check_date, electricity_charge, gas_charge, water_charge, community_electricity_check_date, community_electricity_charge, community_water_check_date, community_water_charge | ||
473 | FROM tbl_bill_chunggu | ||
474 | WHERE room_fk = '{$no}' | ||
475 | ORDER BY no desc | ||
476 | LIMIT 1 | ||
477 | "; | ||
478 | $result=$this->getRow($sql); | ||
479 | //echo json_encode($result); | ||
480 | return $result; | ||
481 | } | ||
482 | |||
483 | public function getInfoOfBuilding() | ||
484 | { | ||
485 | $no = $this->req['no']; | ||
486 | if(empty($no)){ | ||
487 | return array(); | ||
488 | } | ||
489 | |||
490 | $select = '*'; | ||
491 | $from = 'FROM tbl_building'; | ||
492 | $where = "WHERE `no` = {$no}"; | ||
493 | |||
494 | $sql = "SELECT {$select} {$from} {$where}"; | ||
495 | $result = $this->getRow($sql); | ||
496 | |||
497 | //echo json_encode($result); | ||
498 | return $result; | ||
499 | } | ||
500 | |||
501 | public function getInfoOfRequstCharge() | ||
502 | { | ||
503 | $no=$this->req["no"]; | ||
504 | |||
505 | $sql=" | ||
506 | SELECT * | ||
507 | FROM tbl_request_charge | ||
508 | WHERE no='{$no}' | ||
509 | "; | ||
510 | $result=$this->getRow($sql); | ||
511 | //echo json_encode($result); | ||
512 | return $result; | ||
513 | } | ||
514 | |||
515 | public function getInfoOfBuildingsRoom() | ||
516 | { | ||
517 | $no=$this->req["no"]; | ||
518 | $month=date("m"); | ||
519 | |||
520 | $sql= | ||
521 | " | ||
522 | SELECT | ||
523 | (SELECT COUNT(*) from tbl_room WHERE building_fk='{$no}' AND status='Y') AS room_cnt, | ||
524 | (SELECT COUNT(*) from tbl_room WHERE building_fk='{$no}' AND (contract_status='RD' OR contract_status='CE') AND status='Y') AS resident_cnt, | ||
525 | (SELECT COUNT(*) from tbl_room WHERE building_fk='{$no}' AND (contract_status='EP' OR contract_status='UC') AND status='Y') AS empty_cnt, | ||
526 | (SELECT COUNT(*) from tbl_room WHERE building_fk='{$no}' AND DATE_FORMAT(leaving_due_date, '%Y%m%d')>DATE_FORMAT(NOW(), '%Y%m%d') AND DATE_FORMAT(leaving_due_date, '%Y%m')=DATE_FORMAT(NOW(), '%Y%m') AND status='Y') AS leaving_cnt, | ||
527 | (SELECT COUNT(*) from tbl_room WHERE building_fk='{$no}' AND DATE_FORMAT(entering_due_date, '%Y%m%d')>DATE_FORMAT(NOW(), '%Y%m%d') AND DATE_FORMAT(entering_due_date, '%Y%m')=DATE_FORMAT(NOW(), '%Y%m') AND status='Y') AS entering_cnt | ||
528 | FROM | ||
529 | DUAL | ||
530 | "; | ||
531 | |||
532 | $result=$this->getRow($sql); | ||
533 | //echo json_encode($result); | ||
534 | |||
535 | return $result; | ||
536 | } | ||
537 | |||
538 | public function getInfoOfPastBuildingsRoom($type) | ||
539 | { | ||
540 | $no=$this->req["no"]; | ||
541 | $month=date("m"); | ||
542 | if($type==1){ | ||
543 | $sql= | ||
544 | " | ||
545 | SELECT | ||
546 | ( | ||
547 | SELECT COUNT(DISTINCT no) | ||
548 | from tbl_room_history | ||
549 | WHERE building_fk='{$no}' | ||
550 | AND DATE_FORMAT(history_month, '%Y%m') <= DATE_FORMAT(NOW() - INTERVAL 1 MONTH, '%Y%m') | ||
551 | AND status='Y' | ||
552 | ) AS room_cnt, | ||
553 | |||
554 | ( | ||
555 | SELECT COUNT(*) | ||
556 | FROM | ||
557 | ( | ||
558 | SELECT TEMP.* | ||
559 | FROM | ||
560 | ( | ||
561 | SELECT * | ||
562 | FROM tbl_room_history | ||
563 | WHERE building_fk='{$no}' | ||
564 | AND DATE_FORMAT(history_month, '%Y%m') <= DATE_FORMAT(NOW() - INTERVAL 1 MONTH, '%Y%m') | ||
565 | AND STATUS='Y' | ||
566 | ORDER BY pno DESC | ||
567 | ) TEMP | ||
568 | GROUP BY TEMP.no | ||
569 | ) tmp | ||
570 | WHERE tmp.contract_status='EP' OR tmp.contract_status='UC' | ||
571 | ) AS empty_cnt | ||
572 | FROM | ||
573 | DUAL | ||
574 | "; | ||
575 | |||
576 | $result=$this->getRow($sql); | ||
577 | //echo json_encode($result); | ||
578 | return $result; | ||
579 | } | ||
580 | else if($type==2){ | ||
581 | $sql=" | ||
582 | SELECT | ||
583 | ( | ||
584 | SELECT COUNT(DISTINCT no) | ||
585 | from tbl_room_history | ||
586 | WHERE building_fk='{$no}' | ||
587 | AND DATE_FORMAT(history_month, '%Y%m') <= DATE_FORMAT(NOW() - INTERVAL 2 MONTH, '%Y%m') | ||
588 | AND status='Y' | ||
589 | ) AS room_cnt, | ||
590 | |||
591 | ( | ||
592 | SELECT COUNT(*) | ||
593 | FROM | ||
594 | ( | ||
595 | SELECT TEMP.* | ||
596 | FROM | ||
597 | ( | ||
598 | SELECT * | ||
599 | FROM tbl_room_history | ||
600 | WHERE building_fk='{$no}' | ||
601 | AND DATE_FORMAT(history_month, '%Y%m') <= DATE_FORMAT(NOW() - INTERVAL 2 MONTH, '%Y%m') | ||
602 | AND STATUS='Y' | ||
603 | ORDER BY pno DESC | ||
604 | ) TEMP | ||
605 | GROUP BY TEMP.no | ||
606 | ) tmp | ||
607 | WHERE tmp.contract_status='EP' OR tmp.contract_status='UC' | ||
608 | ) AS empty_cnt | ||
609 | FROM | ||
610 | DUAL | ||
611 | "; | ||
612 | $result=$this->getRow($sql); | ||
613 | //echo json_encode($result); | ||
614 | return $result; | ||
615 | |||
616 | } | ||
617 | else if($type==3){ | ||
618 | $sql=" | ||
619 | SELECT | ||
620 | ( | ||
621 | SELECT COUNT(DISTINCT no) | ||
622 | from tbl_room_history | ||
623 | WHERE building_fk='{$no}' | ||
624 | AND DATE_FORMAT(history_month, '%Y%m') <= DATE_FORMAT(NOW() - INTERVAL 3 MONTH, '%Y%m') | ||
625 | AND status='Y' | ||
626 | ) AS room_cnt, | ||
627 | |||
628 | ( | ||
629 | SELECT COUNT(*) | ||
630 | FROM | ||
631 | ( | ||
632 | SELECT TEMP.* | ||
633 | FROM | ||
634 | ( | ||
635 | SELECT * | ||
636 | FROM tbl_room_history | ||
637 | WHERE building_fk='{$no}' | ||
638 | AND DATE_FORMAT(history_month, '%Y%m') <= DATE_FORMAT(NOW() - INTERVAL 3 MONTH, '%Y%m') | ||
639 | AND STATUS='Y' | ||
640 | ORDER BY pno DESC | ||
641 | ) TEMP | ||
642 | GROUP BY TEMP.no | ||
643 | ) tmp | ||
644 | WHERE tmp.contract_status='EP' OR tmp.contract_status='UC' | ||
645 | ) AS empty_cnt | ||
646 | FROM | ||
647 | DUAL | ||
648 | "; | ||
649 | $result=$this->getRow($sql); | ||
650 | //echo json_encode($result); | ||
651 | return $result; | ||
652 | } | ||
653 | } | ||
654 | |||
655 | public function getInfoOfRoom(){ | ||
656 | $no=$this->req['no']; | ||
657 | if(empty($no)){ | ||
658 | return array(); | ||
659 | } | ||
660 | |||
661 | $select = 'R.*'; | ||
662 | $from = 'FROM tbl_room AS R '; | ||
663 | $where = "WHERE R.`no` = {$no}"; | ||
664 | |||
665 | $sql = "SELECT {$select} {$from} {$where}"; | ||
666 | $result = $this->getRow($sql); | ||
667 | //echo json_encode($result); | ||
668 | return $result; | ||
669 | } | ||
670 | |||
671 | public function getListOfVIPForBuilding(){ | ||
672 | $sql=" | ||
673 | SELECT no, name | ||
674 | FROM tbl_user | ||
675 | WHERE member_type='V' AND status='Y' AND is_matched = 0 | ||
676 | "; | ||
677 | $result=$this->getArray($sql); | ||
678 | // echo json_encode($result); | ||
679 | return $result; | ||
680 | } | ||
681 | |||
682 | public function getListOfGroupForBuilding(){ | ||
683 | $sql=" | ||
684 | SELECT no, name | ||
685 | FROM tbl_user_group | ||
686 | WHERE is_matched = 'N' AND status='Y' | ||
687 | "; | ||
688 | $result=$this->getArray($sql); | ||
689 | //echo json_encode($result); | ||
690 | return $result; | ||
691 | } | ||
692 | |||
693 | public function getListOfUserForRoom(){ | ||
694 | $no=$this->req['Bno']; | ||
695 | if(empty($no)){ | ||
696 | return array(); | ||
697 | } | ||
698 | $select='group_fk'; | ||
699 | $from = 'FROM tbl_building'; | ||
700 | $where = "WHERE no = {$no}"; | ||
701 | |||
702 | $sql = "SELECT {$select} {$from} {$where}"; | ||
703 | $result=$this->getRow($sql); | ||
704 | |||
705 | $group_fk=$result["group_fk"]; | ||
706 | |||
707 | $sql=" | ||
708 | SELECT U.no, U.name | ||
709 | FROM tbl_user AS U | ||
710 | WHERE U.group_fk='{$group_fk}' AND U.status='Y' AND U.member_type = 'M' AND U.is_matched = 0 | ||
711 | "; | ||
712 | $result=$this->getArray($sql); | ||
713 | //echo json_encode($result); | ||
714 | return $result; | ||
715 | } | ||
716 | |||
717 | public function getListOfBuilding(){ | ||
718 | $search_text = $this->req["search_text"]; | ||
719 | $login_type = $this->admUser["admin_type"]; | ||
720 | $target_fk = $this->admUser["target_fk"]; | ||
721 | |||
722 | $manage_type = $this->req["manage_type"]; | ||
723 | $expire_date= $this->req["expire_date"]; | ||
724 | //최초 페이지 설정 | ||
725 | $this->initPage(); | ||
726 | |||
727 | $where = 'WHERE `B`.`status` = "Y"'; | ||
728 | if(($login_type == "2" || $login_type == "3") && $target_fk != ""){ | ||
729 | $where .= " AND `B`.`group_fk` = '{$target_fk}' "; | ||
730 | } | ||
731 | if(!empty($search_text)){ | ||
732 | |||
733 | switch($search_text){ | ||
734 | case "원룸" : $where .= " AND `B`.`type` = 'SG'"; | ||
735 | break; | ||
736 | case "오피스텔" : $where .= " AND `B`.`type` = 'OF'"; | ||
737 | break; | ||
738 | case "도생" : $where .= " AND `B`.`type` = 'UB'"; | ||
739 | break; | ||
740 | case "아파트" : $where .= " AND `B`.`type` = 'AP'"; | ||
741 | break; | ||
742 | case "주택" : $where .= " AND `B`.`type` = 'HS'"; | ||
743 | break; | ||
744 | case "기타" : $where .= " AND `B`.`type` = 'ET'"; | ||
745 | break; | ||
746 | default : | ||
747 | $where .= " | ||
748 | AND ( | ||
749 | `G`.`name` LIKE '%{$search_text}%' | ||
750 | OR `B`.`name` LIKE '%{$search_text}%' | ||
751 | OR `B`.`address` LIKE '%{$search_text}%' | ||
752 | OR `B`.`owner_name` LIKE '%{$search_text}%' | ||
753 | OR `B`.`owner_tel` LIKE '%{$search_text}%' | ||
754 | ) "; | ||
755 | break; | ||
756 | |||
757 | } | ||
758 | } | ||
759 | |||
760 | if(!empty($manage_type)){ | ||
761 | $where.=" AND `B`.`manage_type`='{$manage_type}'"; | ||
762 | } | ||
763 | |||
764 | if(!empty($expire_date)){ | ||
765 | $where .= " AND `B`.`expire_date` = '{$expire_date}'"; | ||
766 | } | ||
767 | |||
768 | $select = '`B`.`no`, `B`.`name`, `B`.`manage_type`, `B`.`type`, `B`.`owner_name`, `B`.`address`, `B`.`owner_tel`, DATE(`B`.`expire_date`) AS `expire_date`'; | ||
769 | $from = 'FROM tbl_building AS B LEFT JOIN tbl_user_group AS G ON `B`.`group_fk` = `G`.`no`'; | ||
770 | |||
771 | $sql = "SELECT COUNT(*) AS rn {$from} {$where}"; | ||
772 | $this->rownum = $this->getValue($sql, 'rn'); | ||
773 | |||
774 | //총 로우수를 획득후 페이지 최종 설정 | ||
775 | $this->setPage($this->rownum); | ||
776 | $limit = " LIMIT {$this->startNum}, {$this->endNum} ; "; | ||
777 | |||
778 | $where .= "ORDER BY `B`.`no` DESC"; | ||
779 | |||
780 | $sql = "SELECT {$select} {$from} {$where} {$limit}"; | ||
781 | $result = $this->getArray($sql); | ||
782 | |||
783 | return $result; | ||
784 | } | ||
785 | |||
786 | public function getListOfBuildingForRequest(){ | ||
787 | $search_text = $this->req["search_text"]; | ||
788 | $login_type = $this->admUser["admin_type"]; | ||
789 | $target_fk = $this->admUser["target_fk"]; | ||
790 | |||
791 | //최초 페이지 설정 | ||
792 | $this->initPage(); | ||
793 | |||
794 | $where = 'WHERE `B`.`status` = "Y"'; | ||
795 | if(($login_type == "2" || $login_type == "3") && $target_fk != ""){ | ||
796 | $where .= " AND `B`.`group_fk` = '{$target_fk}' "; | ||
797 | } | ||
798 | if(!empty($search_text)){ | ||
799 | $where .= " AND ( | ||
800 | `G`.`name` LIKE '%{$search_text}%' | ||
801 | OR `B`.`name` LIKE '%{$search_text}%' | ||
802 | OR `B`.`address` LIKE '%{$search_text}%' | ||
803 | OR `B`.`rent_manager` LIKE '%{$search_text}%' | ||
804 | OR `B`.`owner_tel` LIKE '%{$search_text}%' | ||
805 | ) "; | ||
806 | } | ||
807 | |||
808 | $select = '`B`.`no`, `B`.`name`, `B`.`manage_type`, `B`.`type`, `B`.`owner_name`, `B`.`address`, `B`.`owner_tel`, `B`.`expire_date`'; | ||
809 | $from = 'FROM tbl_building AS B LEFT JOIN tbl_user_group AS G ON `B`.`group_fk` = `G`.`no`'; | ||
810 | |||
811 | $sql = "SELECT COUNT(*) AS rn {$from} {$where}"; | ||
812 | $this->rownum = $this->getValue($sql, 'rn'); | ||
813 | |||
814 | //총 로우수를 획득후 페이지 최종 설정 | ||
815 | $this->setPage($this->rownum); | ||
816 | $limit = " LIMIT 0, 99999 ; "; | ||
817 | $sql = "SELECT {$select} {$from} {$where} {$limit}"; | ||
818 | $result = $this->getArray($sql); | ||
819 | |||
820 | return $result; | ||
821 | } | ||
822 | |||
823 | public function getListOfRoom() | ||
824 | { | ||
825 | $building_fk=$_REQUEST["no"]; | ||
826 | $search_text=$this->req["search_text"]; | ||
827 | $in_date=$this->req["in_date"]; | ||
828 | $expire_date=$this->req["expire_date"]; | ||
829 | $search_type=$this->req["search_type"]; | ||
830 | |||
831 | $this->initPage(); | ||
832 | |||
833 | $where="WHERE `R`.`status`='Y' AND `R`.`building_fk`= '$building_fk'"; | ||
834 | |||
835 | if(!empty($search_type)){ | ||
836 | if($search_type=="RD" || $search_type=="EP" || $search_type=="UC" || $search_type=="CE"){ | ||
837 | $where .= "AND `R`.`contract_status` = '{$search_type}'"; | ||
838 | } | ||
839 | |||
840 | if($search_type=="LV"){ | ||
841 | $where .= "AND YEAR(`R`.`leaving_due_date`) = YEAR(NOW()) AND MONTH(`R`.`leaving_due_date`) = MONTH(NOW())"; | ||
842 | } | ||
843 | if($search_type=="ET"){ | ||
844 | $where .= "AND YEAR(`R`.`entering_due_date`) = YEAR(NOW()) AND MONTH(`R`.`entering_due_date`) = MONTH(NOW())"; | ||
845 | } | ||
846 | } | ||
847 | |||
848 | if(!empty($search_text)){ | ||
849 | $where .= " AND ( | ||
850 | `R`.`name` LIKE '%{$search_text}%' | ||
851 | OR `R`.`contractor_name` LIKE '%{$search_text}%' | ||
852 | OR `R`.`contractor_tel` LIKE '%{$search_text}%' | ||
853 | OR `R`.`contractor_car_no` LIKE '%{$search_text}%')"; | ||
854 | } | ||
855 | |||
856 | if(!empty($in_date)) $where .= " AND (`R`.`move_in_date` LIKE '%{$in_date}%')"; | ||
857 | if(!empty($expire_date)) $where .= " AND (`R`.`contract_expire_date` LIKE '%{$expire_date}%')"; | ||
858 | |||
859 | $select='`R`.`no`, `R`.`name`, `R`.`manage_type`, `R`.`contractor_name`, `R`.`contractor_tel`, `R`.`contract_status`, DATE(`R`.`contract_date`) AS contract_date, DATE(`R`.`move_in_date`) AS move_in_date, DATE(`R`.`contract_expire_date`) AS contract_expire_date, `R`.`contractor_car_no`'; | ||
860 | $from='FROM tbl_room AS R JOIN tbl_building AS B ON `R`.`building_fk` = `B`.`no`'; | ||
861 | |||
862 | $sql = "SELECT COUNT(*) AS rn {$from} {$where}"; | ||
863 | $this->rownum = $this->getValue($sql, 'rn'); | ||
864 | |||
865 | //총 로우수를 획득후 페이지 최종 설정 | ||
866 | $this->setPage($this->rownum); | ||
867 | $limit = " LIMIT {$this->startNum}, {$this->endNum} ; "; | ||
868 | $sql = "SELECT {$select} {$from} {$where} ORDER BY no DESC {$limit}"; | ||
869 | $result = $this->getArray($sql); | ||
870 | |||
871 | return $result; | ||
872 | } | ||
873 | |||
874 | |||
875 | public function getListOfRoomForChargeSend() | ||
876 | { | ||
877 | $building_fk=$_REQUEST["no"]; | ||
878 | |||
879 | $sql=" | ||
880 | SELECT no, name | ||
881 | FROM tbl_room | ||
882 | WHERE building_fk='{$building_fk}' | ||
883 | "; | ||
884 | |||
885 | $result=$this->getArray($sql); | ||
886 | return json_encode($result); | ||
887 | } | ||
888 | |||
889 | public function getListOfVacancyForExcel($search_text, $manage_type) | ||
890 | { | ||
891 | $where="WHERE `B`.`status`='Y'"; | ||
892 | |||
893 | $where2 = " WHERE `Q`.vacancy_rate LIKE '%{$search_text}%'"; | ||
894 | |||
895 | $select=" | ||
896 | `B`.`no`, | ||
897 | `G`.`name`, | ||
898 | `B`.`manage_type`, | ||
899 | `G`.`manager_name`, | ||
900 | `B`.`address`, | ||
901 | (SELECT COUNT(*) FROM tbl_room WHERE building_fk=`B`.`no`) AS room_cnt, | ||
902 | (SELECT COUNT(*) FROM tbl_room WHERE building_fk=`B`.`no` AND (contract_status='RD' OR contract_status='CE') AND status='Y') AS resident_cnt, | ||
903 | (SELECT COUNT(*) FROM tbl_room WHERE building_fk=`B`.`no` AND (contract_status='EP' OR contract_status='UC') AND status='Y') AS empty_cnt, | ||
904 | (SELECT COUNT(*) FROM tbl_room WHERE building_fk=`B`.`no` AND MONTH(leaving_due_date)=MONTH(NOW()) AND YEAR(leaving_due_date)=YEAR(NOW())) AS leaving_cnt, | ||
905 | (SELECT COUNT(*) FROM tbl_room WHERE building_fk=`B`.`no` AND MONTH(entering_due_date)=MONTH(NOW()) AND YEAR(leaving_due_date)=YEAR(NOW())) AS entering_cnt, | ||
906 | (SELECT (room_cnt - resident_cnt + entering_cnt)/room_cnt)*100 AS vacancy_rate | ||
907 | "; | ||
908 | $from=" FROM tbl_building AS `B` JOIN tbl_user_group AS `G` ON `B`.`group_fk`=`G`.`no`"; | ||
909 | |||
910 | if(!empty($search_text)){ | ||
911 | $where2.=" WHERE `Q`.vacancy_rate LIKE '%{$search_text}%' OR `name` LIKE '%{$search_text}%' OR `manager_name` LIKE '%{$search_text}%' OR `address` LIKE '%{$search_text}%'"; | ||
912 | } | ||
913 | |||
914 | if(!empty($manage_type)){ | ||
915 | $where.=" AND `B`.`manage_type`='{$manage_type}'"; | ||
916 | } | ||
917 | |||
918 | |||
919 | $this->initPage(); | ||
920 | $sql="SELECT COUNT(*) AS rn FROM (SELECT {$select} {$from} {$where}) AS `Q` {$where2}"; | ||
921 | $this->rownum =$this->getValue($sql, 'rn'); | ||
922 | //총 로우수를 획득후 페이지 최종 설정 | ||
923 | $this->setPage($this->rownum); | ||
924 | $limit = " LIMIT 0, 999999 ; "; | ||
925 | $sql="SELECT * FROM (SELECT {$select} {$from} {$where}) AS `Q` {$where2} ORDER BY no DESC {$limit}"; | ||
926 | |||
927 | $result=$this->getArray($sql); | ||
928 | |||
929 | return $result; | ||
930 | } | ||
931 | |||
932 | public function getListOfVacancy() | ||
933 | { | ||
934 | $search_text=$this->req["search_text"]; | ||
935 | $manage_type=$this->req["manage_type"]; | ||
936 | |||
937 | $where="WHERE `B`.`status`='Y'"; | ||
938 | $where2 = ""; | ||
939 | |||
940 | |||
941 | |||
942 | $select=" | ||
943 | `B`.`no`, | ||
944 | `G`.`name`, | ||
945 | `B`.`manage_type`, | ||
946 | `G`.`manager_name`, | ||
947 | `B`.`address`, | ||
948 | (SELECT COUNT(*) FROM tbl_room WHERE building_fk=`B`.`no` AND status='Y') AS room_cnt, | ||
949 | (SELECT COUNT(*) FROM tbl_room WHERE building_fk=`B`.`no` AND (contract_status='RD' OR contract_status='CE') AND status='Y') AS resident_cnt, | ||
950 | (SELECT COUNT(*) FROM tbl_room WHERE building_fk=`B`.`no` AND (contract_status='EP' OR contract_status='UC') AND status='Y') AS empty_cnt, | ||
951 | (SELECT COUNT(*) FROM tbl_room WHERE building_fk=`B`.`no` AND MONTH(leaving_due_date)=MONTH(NOW()) AND YEAR(leaving_due_date)=YEAR(NOW())) AS leaving_cnt, | ||
952 | (SELECT COUNT(*) FROM tbl_room WHERE building_fk=`B`.`no` AND MONTH(entering_due_date)=MONTH(NOW()) AND YEAR(leaving_due_date)=YEAR(NOW())) AS entering_cnt, | ||
953 | (SELECT (room_cnt - resident_cnt + entering_cnt)/room_cnt)*100 AS vacancy_rate | ||
954 | "; | ||
955 | $from=" FROM tbl_building AS `B` JOIN tbl_user_group AS `G` ON `B`.`group_fk`=`G`.`no`"; | ||
956 | |||
957 | if(!empty($search_text)){ | ||
958 | $where2.=" WHERE `Q`.vacancy_rate LIKE '%{$search_text}%' OR `name` LIKE '%{$search_text}%' OR `manager_name` LIKE '%{$search_text}%' OR `address` LIKE '%{$search_text}%'"; | ||
959 | } | ||
960 | |||
961 | if(!empty($manage_type)){ | ||
962 | $where.=" AND `B`.`manage_type`='{$manage_type}'"; | ||
963 | } | ||
964 | |||
965 | $this->initPage(); | ||
966 | $sql="SELECT COUNT(*) AS rn FROM (SELECT {$select} {$from} {$where}) AS `Q` {$where2}"; | ||
967 | $this->rownum =$this->getValue($sql, 'rn'); | ||
968 | //총 로우수를 획득후 페이지 최종 설정 | ||
969 | $this->setPage($this->rownum); | ||
970 | $limit = " LIMIT {$this->startNum}, {$this->endNum} ; "; | ||
971 | $sql="SELECT * FROM (SELECT {$select} {$from} {$where}) AS `Q` {$where2} ORDER BY no DESC {$limit}"; | ||
972 | |||
973 | $result=$this->getArray($sql); | ||
974 | //echo json_encode($result); | ||
975 | return $result; | ||
976 | } | ||
977 | |||
978 | public function getListOfRequestCharge() | ||
979 | { | ||
980 | $where="WHERE status='Y'"; | ||
981 | |||
982 | $search_text=$this->req["search_text"]; | ||
983 | $request_date=$this->req["request_date"]; | ||
984 | $handled_date=$this->req["handled_date"]; | ||
985 | |||
986 | if(!empty($search_text)){ | ||
987 | $where.=" AND building_name LIKE '%{$search_text}%' OR room_name LIKE '%{$search_text}%' OR info LIKE '%{$search_text}%'"; | ||
988 | } | ||
989 | if(!empty($request_date)){ | ||
990 | $where.=" AND request_date LIKE '%{$request_date}%'"; | ||
991 | } | ||
992 | if(!empty($handled_date)){ | ||
993 | $where.=" AND handled_date LIKE '%{$handled_date}%'"; | ||
994 | } | ||
995 | |||
996 | $this->initPage(); | ||
997 | |||
998 | $sql=" | ||
999 | SELECT COUNT(*) as rn | ||
1000 | FROM tbl_request_charge | ||
1001 | {$where} | ||
1002 | "; | ||
1003 | $this->rownum=$this->getValue($sql, 'rn'); | ||
1004 | $this->setPage($this->rownum); | ||
1005 | $limit = " LIMIT {$this->startNum}, {$this->endNum} ; "; | ||
1006 | $where.="ORDER BY `no` DESC"; | ||
1007 | $sql=" | ||
1008 | SELECT * | ||
1009 | FROM tbl_request_charge | ||
1010 | {$where} | ||
1011 | {$limit} | ||
1012 | "; | ||
1013 | $result=$this->getArray($sql); | ||
1014 | return $result; | ||
1015 | } | ||
1016 | |||
1017 | public function getListOfRequestChargeForExcel() | ||
1018 | { | ||
1019 | $where="WHERE status='Y'"; | ||
1020 | |||
1021 | $search_text=$this->req["search_text"]; | ||
1022 | $request_date=$this->req["request_date"]; | ||
1023 | $handled_date=$this->req["handled_date"]; | ||
1024 | |||
1025 | if(!empty($search_text)){ | ||
1026 | $where.=" AND building_name LIKE '%{$search_text}%' OR room_name LIKE '%{$search_text}%' OR info LIKE '%{$search_text}%'"; | ||
1027 | } | ||
1028 | if(!empty($request_date)){ | ||
1029 | $where.=" AND request_date LIKE '%{$request_date}%'"; | ||
1030 | } | ||
1031 | if(!empty($handled_date)){ | ||
1032 | $where.=" AND handled_date LIKE '%{$handled_date}%'"; | ||
1033 | } | ||
1034 | |||
1035 | $this->initPage(); | ||
1036 | |||
1037 | $sql=" | ||
1038 | SELECT COUNT(*) as rn | ||
1039 | FROM tbl_request_charge | ||
1040 | {$where} | ||
1041 | "; | ||
1042 | $this->rownum=$this->getValue($sql, 'rn'); | ||
1043 | $this->setPage($this->rownum); | ||
1044 | $limit = " LIMIT 0, 999999 ; "; | ||
1045 | $sql=" | ||
1046 | SELECT * | ||
1047 | FROM tbl_request_charge | ||
1048 | {$where} | ||
1049 | ORDER BY no DESC | ||
1050 | {$limit} | ||
1051 | "; | ||
1052 | $result=$this->getArray($sql); | ||
1053 | return $result; | ||
1054 | } | ||
1055 | |||
1056 | public function getListOfUser($member_type = "", $target_fk = "") | ||
1057 | { | ||
1058 | $search_text = $this->req["search_text"]; | ||
1059 | $login_type = $this->admUser["admin_type"]; | ||
1060 | |||
1061 | $where = " WHERE status = 'Y' "; | ||
1062 | |||
1063 | if(($login_type == "2" || $login_type == "3") && $target_fk != "") | ||
1064 | { | ||
1065 | $where .= " AND group_fk = '{$target_fk}' "; | ||
1066 | } | ||
1067 | |||
1068 | if($member_type == "M") | ||
1069 | { | ||
1070 | $where .= " AND U.member_type = '{$member_type}' "; | ||
1071 | // add all type | ||
1072 | //$addSelect .= " , IFNULL((SELECT G.name FROM tbl_user_group G WHERE G.no = U.group_fk AND G.status = 'Y' LIMIT 1), '') AS group_name "; | ||
1073 | } | ||
1074 | |||
1075 | if($search_text != "") | ||
1076 | $where .= " AND ((U.id LIKE '%{$search_text}%' AND U.regi_type = 'E') OR U.tel LIKE '%{$search_text}%' OR U.name LIKE '%{$search_text}%' )"; | ||
1077 | |||
1078 | |||
1079 | if($this->req["page"] != "-1") | ||
1080 | { | ||
1081 | //최초 페이지 설정 | ||
1082 | $this->initPage() ; | ||
1083 | |||
1084 | $sql = " | ||
1085 | SELECT COUNT(*) AS rn | ||
1086 | FROM tbl_user U | ||
1087 | {$where} | ||
1088 | "; | ||
1089 | |||
1090 | $this->rownum = $this->getValue($sql, 'rn'); | ||
1091 | |||
1092 | //총 로우수를 획득후 페이지 최종 설정 | ||
1093 | $this->setPage($this->rownum) ; | ||
1094 | |||
1095 | $limit = " LIMIT {$this->startNum}, {$this->endNum} ; "; | ||
1096 | } | ||
1097 | |||
1098 | $sql = " | ||
1099 | SELECT | ||
1100 | U.* | ||
1101 | {$addSelect} | ||
1102 | FROM tbl_user U | ||
1103 | {$where} | ||
1104 | ORDER BY U.no DESC | ||
1105 | {$limit} | ||
1106 | "; | ||
1107 | $result = $this->getArray($sql); | ||
1108 | |||
1109 | return $result; | ||
1110 | } | ||
1111 | |||
1112 | } | ||
1113 | } | ||
1114 | |||
1115 | ?> | ||
... | \ No newline at end of file | ... | \ No newline at end of file |
1 | <? include $_SERVER["DOCUMENT_ROOT"] . "/common/classes/AdminBase.php" ;?> | ||
2 | <? | ||
3 | /* | ||
4 | * Admin process | ||
5 | * add by dev.lee | ||
6 | * */ | ||
7 | if(!class_exists("AdminStats")){ | ||
8 | class AdminStats extends AdminBase { | ||
9 | |||
10 | function __construct($req) | ||
11 | { | ||
12 | parent::__construct($req); | ||
13 | } | ||
14 | |||
15 | |||
16 | /** | ||
17 | * 일별 통계실 필요한 월 일 데이터 | ||
18 | * @param unknown $year | ||
19 | * @param unknown $month | ||
20 | */ | ||
21 | function getMonthDayListData($year, $month) | ||
22 | { | ||
23 | $sql = " | ||
24 | SELECT * | ||
25 | FROM tbl_stats_date SD | ||
26 | WHERE SD.year = '{$year}' AND SD.month = '{$month}' | ||
27 | ORDER BY SD.date ASC | ||
28 | "; | ||
29 | $result = $this->getArray($sql); | ||
30 | |||
31 | return $result; | ||
32 | } | ||
33 | |||
34 | |||
35 | /** | ||
36 | * 마이포인트 통계 | ||
37 | */ | ||
38 | function getListOfPointStatsForUser() | ||
39 | { | ||
40 | $year = $this->req["year"] == "" ? date("Y", time()) : $this->req["year"]; | ||
41 | $month = $this->req["month"] == "" ? date("n", time()) : $this->req["month"]; | ||
42 | |||
43 | |||
44 | $sql = " | ||
45 | SELECT | ||
46 | SD.date | ||
47 | , IFNULL(SUM(CASE WHEN PT.pay_type = '{$this->PAY_TYPE_ADMIN}' AND PT.trans_type = 'I' THEN PT.amt ELSE 0 END), 0) AS input_point | ||
48 | , IFNULL(SUM(CASE WHEN PT.pay_type = '{$this->PAY_TYPE_USE}' AND PT.trans_type = 'O' THEN PT.amt ELSE 0 END), 0) AS output_point | ||
49 | FROM tbl_stats_date SD | ||
50 | LEFT JOIN tbl_point_trans PT ON(SD.date = PT.reg_date AND PT.pay_type != '{$this->PAY_TYPE_RETRIEVE}') | ||
51 | WHERE SD.year = '{$year}' AND SD.month = '{$month}' | ||
52 | GROUP BY SD.date | ||
53 | ORDER BY SD.date ASC | ||
54 | "; | ||
55 | $result = $this->getArray($sql); | ||
56 | |||
57 | return $result; | ||
58 | } | ||
59 | |||
60 | |||
61 | /** | ||
62 | * 통계 정보 조회 | ||
63 | * @return unknown[][]|mixed[][] | ||
64 | */ | ||
65 | function getGroupPointStatsData() | ||
66 | { | ||
67 | $year = $this->req["year"] == "" ? date("Y", time()) : $this->req["year"]; | ||
68 | $pointArr = Array(); | ||
69 | |||
70 | $where = " WHERE G.status = 'Y' "; | ||
71 | $subWhere = " WHERE PT.pay_type != '{$this->PAY_TYPE_RETRIEVE}' AND PT.group_fk > 0 AND YEAR(PT.reg_date) = '{$year}' "; | ||
72 | |||
73 | if($this->admUser["admin_type"] == "2") | ||
74 | { | ||
75 | $where .= " AND G.no = '{$this->admUser["target_fk"]}' "; | ||
76 | $subWhere .= " AND PT.group_fk = '{$this->admUser["target_fk"]}'"; | ||
77 | } | ||
78 | |||
79 | $sql = " | ||
80 | SELECT | ||
81 | P.month, P.input_point, P.output_point, G.name AS group_name, G.no AS group_fk | ||
82 | , IFNULL((SELECT A.admin_name FROM tbl_admin A WHERE A.target_fk = G.no AND A.admin_type = '2' AND A.is_apply = 1 LIMIT 1), '-') AS manager_name | ||
83 | FROM tbl_user_group G | ||
84 | LEFT JOIN ( | ||
85 | SELECT | ||
86 | PT.group_fk | ||
87 | , MONTH(PT.reg_date) AS `month` | ||
88 | , IFNULL(SUM(CASE WHEN PT.pay_type = '{$this->PAY_TYPE_ADMIN}' AND PT.trans_type = 'I' THEN PT.amt ELSE 0 END), 0) AS input_point | ||
89 | , IFNULL(SUM(CASE WHEN PT.pay_type = '{$this->PAY_TYPE_USE}' AND PT.trans_type = 'O' THEN PT.amt ELSE 0 END), 0) AS output_point | ||
90 | FROM tbl_point_trans PT | ||
91 | {$subWhere} | ||
92 | GROUP BY PT.group_fk, `month` | ||
93 | ORDER BY PT.group_fk ASC, `month` ASC | ||
94 | ) P ON(P.group_fk = G.no) | ||
95 | {$where} | ||
96 | "; | ||
97 | $result = $this->getArray($sql); | ||
98 | |||
99 | $monthIndex = 0; | ||
100 | $tmp_group_fk = "0"; | ||
101 | $groupData = Array(); | ||
102 | for($i=0; $i<sizeof($result); $i++) | ||
103 | { | ||
104 | if($result[$i]["group_fk"] != $tmp_group_fk) | ||
105 | { | ||
106 | if($i > 0) | ||
107 | $pointArr[] = $groupData; | ||
108 | |||
109 | $monthIndex = 1; | ||
110 | $tmp_group_fk = $result[$i]["group_fk"]; | ||
111 | $groupData = Array( | ||
112 | "group_fk" => $result[$i]["group_fk"], | ||
113 | "group_name" => $result[$i]["group_name"], | ||
114 | "manager_name" => $result[$i]["manager_name"], | ||
115 | "list" => Array() | ||
116 | ); | ||
117 | } | ||
118 | |||
119 | $groupData["list"][$result[$i]["month"]] = Array("input_point" => $result[$i]["input_point"], "output_point" => $result[$i]["output_point"]); | ||
120 | } | ||
121 | |||
122 | $pointArr[] = $groupData; | ||
123 | |||
124 | return $pointArr; | ||
125 | } | ||
126 | |||
127 | |||
128 | |||
129 | /** | ||
130 | * 상점별 통계 | ||
131 | * @return unknown[][]|mixed[][] | ||
132 | */ | ||
133 | function getShopPointStatsData() | ||
134 | { | ||
135 | |||
136 | $year = $this->req["year"] == "" ? date("Y", time()) : $this->req["year"]; | ||
137 | $pointArr = Array(); | ||
138 | |||
139 | $where = " WHERE S.status = 'Y' "; | ||
140 | $subWhere = " WHERE PT.trans_type = 'O' AND PT.pay_type = '{$this->PAY_TYPE_USE}' AND PT.shop_fk > 0 AND YEAR(PT.reg_date) = '{$year}' "; | ||
141 | |||
142 | if($this->admUser["admin_type"] == "3") | ||
143 | { | ||
144 | $where .= " AND S.no = '{$this->admUser["target_fk"]}' "; | ||
145 | $subWhere .= " AND PT.shop_fk = '{$this->admUser["target_fk"]}'"; | ||
146 | } | ||
147 | |||
148 | $sql = " | ||
149 | SELECT | ||
150 | P.month, P.output_point, S.name AS shop_name, S.no AS shop_fk | ||
151 | , IFNULL((SELECT A.admin_name FROM tbl_admin A WHERE A.target_fk = S.no AND A.admin_type = '3' AND A.is_apply = 1 LIMIT 1), '-') AS manager_name | ||
152 | FROM tbl_shop S | ||
153 | LEFT JOIN ( | ||
154 | SELECT | ||
155 | PT.shop_fk | ||
156 | , MONTH(PT.reg_date) AS `month` | ||
157 | , IFNULL(SUM(PT.amt), 0) AS output_point | ||
158 | FROM tbl_point_trans PT | ||
159 | {$subWhere} | ||
160 | GROUP BY PT.shop_fk, `month` | ||
161 | ORDER BY PT.shop_fk ASC, `month` ASC | ||
162 | ) P ON(P.shop_fk = S.no) | ||
163 | {$where} | ||
164 | "; | ||
165 | $result = $this->getArray($sql); | ||
166 | |||
167 | $monthIndex = 0; | ||
168 | $tmp_shop_fk = "0"; | ||
169 | $shopData = Array(); | ||
170 | for($i=0; $i<sizeof($result); $i++) | ||
171 | { | ||
172 | if($result[$i]["shop_fk"] != $tmp_shop_fk) | ||
173 | { | ||
174 | if($i > 0) | ||
175 | $pointArr[] = $shopData; | ||
176 | |||
177 | $monthIndex = 1; | ||
178 | $tmp_shop_fk = $result[$i]["shop_fk"]; | ||
179 | $shopData = Array( | ||
180 | "shop_fk" => $result[$i]["shop_fk"], | ||
181 | "shop_name" => $result[$i]["shop_name"], | ||
182 | "manager_name" => $result[$i]["manager_name"], | ||
183 | "list" => Array() | ||
184 | ); | ||
185 | } | ||
186 | |||
187 | $shopData["list"][$result[$i]["month"]] = $result[$i]["output_point"]; | ||
188 | } | ||
189 | |||
190 | $pointArr[] = $shopData; | ||
191 | |||
192 | return $pointArr; | ||
193 | |||
194 | } | ||
195 | |||
196 | |||
197 | |||
198 | |||
199 | /** | ||
200 | * 그룹별 상점 통계 | ||
201 | * @return unknown[][]|mixed[][] | ||
202 | */ | ||
203 | function getShopPointStatsDataForGroup() | ||
204 | { | ||
205 | $no = $this->req["no"]; | ||
206 | $year = $this->req["year"] == "" ? date("Y", time()) : $this->req["year"]; | ||
207 | $month = $this->req["month"] == "" ? date("n", time()) : $this->req["month"]; | ||
208 | $pointArr = Array(); | ||
209 | |||
210 | $sql = " | ||
211 | SELECT G.no AS group_fk, G.name AS group_name, SD.date, IFNULL(SUM(PT.amt), 0) AS output_point | ||
212 | FROM | ||
213 | ( | ||
214 | SELECT * | ||
215 | FROM tbl_user_group G | ||
216 | WHERE G.no IN( | ||
217 | SELECT T.group_fk | ||
218 | FROM tbl_point_trans T | ||
219 | WHERE T.shop_fk = '{$no}' AND T.trans_type = 'O' AND T.pay_type = 'use' AND YEAR(T.reg_date) = '{$year}' AND MONTH(T.reg_date) = '{$month}' | ||
220 | GROUP BY T.group_fk | ||
221 | ) | ||
222 | ) G | ||
223 | JOIN tbl_stats_date SD ON (SD.year = '{$year}' AND SD.month = '{$month}') | ||
224 | LEFT JOIN tbl_point_trans PT ON(PT.shop_fk = '{$no}' AND PT.trans_type = 'O' AND PT.pay_type = 'use' AND SD.date = PT.reg_date AND G.no = PT.group_fk) | ||
225 | GROUP BY G.no, SD.date | ||
226 | ORDER BY G.no ASC, SD.date ASC | ||
227 | "; | ||
228 | $result = $this->getArray($sql); | ||
229 | |||
230 | $monthIndex = 0; | ||
231 | $tmp_group_fk = "0"; | ||
232 | $groupData = Array(); | ||
233 | for($i=0; $i<sizeof($result); $i++) | ||
234 | { | ||
235 | if($result[$i]["group_fk"] != $tmp_group_fk) | ||
236 | { | ||
237 | if($i > 0) | ||
238 | $pointArr[] = $groupData; | ||
239 | |||
240 | $monthIndex = 1; | ||
241 | $tmp_group_fk = $result[$i]["group_fk"]; | ||
242 | $groupData = Array( | ||
243 | "group_fk" => $result[$i]["group_fk"], | ||
244 | "group_name" => $result[$i]["group_name"], | ||
245 | "total_point" => 0, | ||
246 | "list" => Array() | ||
247 | ); | ||
248 | } | ||
249 | |||
250 | $groupData["list"][$result[$i]["date"]] = $result[$i]["output_point"]; | ||
251 | $groupData["total_point"] += $result[$i]["output_point"]; | ||
252 | } | ||
253 | |||
254 | $pointArr[] = $groupData; | ||
255 | |||
256 | return $pointArr; | ||
257 | |||
258 | } | ||
259 | |||
260 | |||
261 | /** | ||
262 | * 상점 통계 회원별 | ||
263 | * @return mixed[][] | ||
264 | */ | ||
265 | function getShopPointStatsDataForUser() | ||
266 | { | ||
267 | $no = $this->req["no"]; | ||
268 | $year = $this->req["year"] == "" ? date("Y", time()) : $this->req["year"]; | ||
269 | $month = $this->req["month"] == "" ? date("n", time()) : $this->req["month"]; | ||
270 | $pointArr = Array(); | ||
271 | |||
272 | $sql = " | ||
273 | SELECT | ||
274 | U.no AS user_fk, U.name AS user_name, SD.date, IFNULL(SUM(PT.amt), 0) AS output_point | ||
275 | FROM | ||
276 | ( | ||
277 | SELECT * | ||
278 | FROM tbl_user U | ||
279 | WHERE U.no IN( | ||
280 | SELECT T.user_fk | ||
281 | FROM tbl_point_trans T | ||
282 | WHERE T.shop_fk = '{$no}' AND T.trans_type = 'O' AND T.pay_type = 'use' AND YEAR(T.reg_date) = '{$year}' AND MONTH(T.reg_date) = '{$month}' | ||
283 | GROUP BY T.user_fk | ||
284 | ) | ||
285 | ) U | ||
286 | JOIN tbl_stats_date SD ON (SD.year = '{$year}' AND SD.month = '{$month}') | ||
287 | LEFT JOIN tbl_point_trans PT ON(PT.shop_fk = '{$no}' AND PT.trans_type = 'O' AND PT.pay_type = 'use' AND SD.date = PT.reg_date AND U.no = PT.user_fk) | ||
288 | GROUP BY U.no, SD.date | ||
289 | ORDER BY U.no ASC, SD.date ASC | ||
290 | "; | ||
291 | $result = $this->getArray($sql); | ||
292 | |||
293 | $tmp_user_fk = "0"; | ||
294 | $groupData = Array(); | ||
295 | for($i=0; $i<sizeof($result); $i++) | ||
296 | { | ||
297 | if($result[$i]["user_fk"] != $tmp_user_fk) | ||
298 | { | ||
299 | if($i > 0) | ||
300 | $pointArr[] = $groupData; | ||
301 | |||
302 | $monthIndex = 1; | ||
303 | $tmp_user_fk = $result[$i]["user_fk"]; | ||
304 | $groupData = Array( | ||
305 | "user_fk" => $result[$i]["user_fk"], | ||
306 | "user_name" => $result[$i]["user_name"], | ||
307 | "total_point" => 0, | ||
308 | "list" => Array() | ||
309 | ); | ||
310 | } | ||
311 | |||
312 | $groupData["list"][$result[$i]["date"]] = $result[$i]["output_point"]; | ||
313 | $groupData["total_point"] += $result[$i]["output_point"]; | ||
314 | } | ||
315 | |||
316 | $pointArr[] = $groupData; | ||
317 | |||
318 | return $pointArr; | ||
319 | |||
320 | } | ||
321 | |||
322 | |||
323 | } // class end | ||
324 | } | ||
325 | ?> | ||
... | \ No newline at end of file | ... | \ No newline at end of file |
... | @@ -272,48 +272,52 @@ if(!class_exists("AdminUser")){ | ... | @@ -272,48 +272,52 @@ if(!class_exists("AdminUser")){ |
272 | 272 | ||
273 | 273 | ||
274 | // 회원 리스트 | 274 | // 회원 리스트 |
275 | function getListOfUser($member_type = "", $vip_status = 0) | 275 | function getListOfUser() |
276 | { | 276 | { |
277 | $search_text = $this->req["search_text"]; | 277 | $searchText = $this->req["searchText"]; |
278 | $login_type = $this->admUser["admin_type"]; | 278 | $searchType = $this->req["searchType"]; |
279 | $target_fk = $this->admUser["target_fk"]; | ||
280 | 279 | ||
281 | 280 | ||
282 | $where = " WHERE status = 'Y' "; | 281 | $where = " WHERE status = 1 AND userType=1"; |
283 | 282 | ||
284 | if($login_type != "1") | 283 | |
285 | { | 284 | |
286 | $where .= " AND group_fk = '{$target_fk}' "; | 285 | if($searchType == "userName"){ |
286 | $where.=" AND userName LIKE '%{$searchText}%'"; | ||
287 | } | 287 | } |
288 | 288 | if($searchType == "userID"){ | |
289 | $addSelect = ""; | 289 | $where.=" AND userID LIKE '%{$searchText}%'"; |
290 | $addSelect .= " , IFNULL((SELECT G.name FROM tbl_user_group G WHERE G.no = U.group_fk AND G.status = 'Y' LIMIT 1), '') AS group_name "; | ||
291 | |||
292 | if($member_type == "M") | ||
293 | { | ||
294 | $where .= " AND U.member_type = '{$member_type}' "; | ||
295 | // add all type | ||
296 | //$addSelect .= " , IFNULL((SELECT G.name FROM tbl_user_group G WHERE G.no = U.group_fk AND G.status = 'Y' LIMIT 1), '') AS group_name "; | ||
297 | } | 290 | } |
298 | 291 | if($searchType == "nickName"){ | |
299 | 292 | $where.=" AND nickName LIKE '%{$searchText}%'"; | |
300 | |||
301 | if($member_type == "V") | ||
302 | { | ||
303 | $where .= " AND (U.member_type = '{$member_type}' OR U.member_type = 'VH') "; | ||
304 | // add all type | ||
305 | //$addSelect .= " , IFNULL((SELECT G.name FROM tbl_user_group G WHERE G.no = U.group_fk AND G.status = 'Y' LIMIT 1), '') AS group_name "; | ||
306 | } | 293 | } |
307 | 294 | if($searchType == "userVehicleType"){ | |
308 | if($vip_status == 1){ | 295 | switch($searchText){ |
309 | $where .= "AND U.vip_status = {$vip_status} "; | 296 | case "현대": |
297 | $searchText="HY"; | ||
298 | break; | ||
299 | case "대우": | ||
300 | $searchText="DW"; | ||
301 | break; | ||
302 | case "볼보": | ||
303 | $searchText="VV"; | ||
304 | break; | ||
305 | case "스카니아": | ||
306 | $searchText="SC"; | ||
307 | break; | ||
308 | case "벤츠": | ||
309 | $searchText="MB"; | ||
310 | break; | ||
311 | case "만": | ||
312 | $searchText="MA"; | ||
313 | break; | ||
314 | } | ||
315 | $where.=" AND userVehicleType LIKE '%{$searchText}%'"; | ||
310 | } | 316 | } |
311 | 317 | if($searchText=="" && $searchType != ""){ | |
312 | if($search_text != ""){ | 318 | $where.=" AND userNo=0"; |
313 | $where .= " AND ((U.id LIKE '%{$search_text}%' AND U.regi_type = 'E') OR U.tel LIKE '%{$search_text}%' OR U.name LIKE '%{$search_text}%' ) "; | ||
314 | } | 319 | } |
315 | 320 | ||
316 | |||
317 | 321 | ||
318 | if($this->req["page"] != "-1") | 322 | if($this->req["page"] != "-1") |
319 | { | 323 | { |
... | @@ -322,7 +326,7 @@ if(!class_exists("AdminUser")){ | ... | @@ -322,7 +326,7 @@ if(!class_exists("AdminUser")){ |
322 | 326 | ||
323 | $sql = " | 327 | $sql = " |
324 | SELECT COUNT(*) AS rn | 328 | SELECT COUNT(*) AS rn |
325 | FROM tbl_user U | 329 | FROM tblUser U |
326 | {$where} | 330 | {$where} |
327 | "; | 331 | "; |
328 | 332 | ||
... | @@ -337,10 +341,9 @@ if(!class_exists("AdminUser")){ | ... | @@ -337,10 +341,9 @@ if(!class_exists("AdminUser")){ |
337 | $sql = " | 341 | $sql = " |
338 | SELECT | 342 | SELECT |
339 | U.* | 343 | U.* |
340 | {$addSelect} | 344 | FROM tblUser U |
341 | FROM tbl_user U | ||
342 | {$where} | 345 | {$where} |
343 | ORDER BY U.no DESC | 346 | ORDER BY U.regDate DESC |
344 | {$limit} | 347 | {$limit} |
345 | "; | 348 | "; |
346 | 349 | ||
... | @@ -350,6 +353,176 @@ if(!class_exists("AdminUser")){ | ... | @@ -350,6 +353,176 @@ if(!class_exists("AdminUser")){ |
350 | return $result; | 353 | return $result; |
351 | } | 354 | } |
352 | 355 | ||
356 | function getListOfManager(){ | ||
357 | $searchText = $this->req["searchText"]; | ||
358 | $searchType=$this->req["searchType"]; | ||
359 | |||
360 | $login_type = $this->admUser["admin_type"]; | ||
361 | $target_fk = $this->admUser["target_fk"]; | ||
362 | |||
363 | |||
364 | $where = " WHERE status = 1 AND userType=2"; | ||
365 | |||
366 | |||
367 | |||
368 | if($searchType == "userName"){ | ||
369 | $where.=" AND userName LIKE '%{$searchText}%'"; | ||
370 | } | ||
371 | if($searchType == "userID"){ | ||
372 | $where.=" AND userID LIKE '%{$searchText}%'"; | ||
373 | } | ||
374 | if($searchType == "nickName"){ | ||
375 | $where.=" AND nickName LIKE '%{$searchText}%'"; | ||
376 | } | ||
377 | |||
378 | if($searchText=="" && $searchType != ""){ | ||
379 | $where.=" AND userNo=0"; | ||
380 | } | ||
381 | |||
382 | |||
383 | |||
384 | if($this->req["page"] != "-1") | ||
385 | { | ||
386 | //최초 페이지 설정 | ||
387 | $this->initPage() ; | ||
388 | |||
389 | $sql = " | ||
390 | SELECT COUNT(*) AS rn | ||
391 | FROM tblUser U | ||
392 | {$where} | ||
393 | "; | ||
394 | |||
395 | $this->rownum = $this->getValue($sql, 'rn'); | ||
396 | |||
397 | //총 로우수를 획득후 페이지 최종 설정 | ||
398 | $this->setPage($this->rownum) ; | ||
399 | |||
400 | $limit = " LIMIT {$this->startNum}, {$this->endNum} ; "; | ||
401 | } | ||
402 | |||
403 | $sql = " | ||
404 | SELECT | ||
405 | U.* | ||
406 | FROM tblUser U | ||
407 | {$where} | ||
408 | ORDER BY U.regDate DESC | ||
409 | {$limit} | ||
410 | "; | ||
411 | |||
412 | $result = $this->getArray($sql); | ||
413 | |||
414 | //echo json_encode($result); | ||
415 | return $result; | ||
416 | } | ||
417 | |||
418 | function initializePwd(){ | ||
419 | $userNo=$this->req["userNo"]; | ||
420 | |||
421 | $sql=" | ||
422 | UPDATE tblUser | ||
423 | SET userPwd=md5('abc123') | ||
424 | WHERE userNo='{$userNo}' | ||
425 | "; | ||
426 | $this->update($sql); | ||
427 | return $this->makeResultJson(1, "초기화 되었습니다"); | ||
428 | } | ||
429 | |||
430 | function checkIDRedundancy(){ | ||
431 | $userID=$this->req["userID"]; | ||
432 | |||
433 | $sql=" | ||
434 | SELECT * | ||
435 | FROM tblUser | ||
436 | WHERE userID='{$userID}' AND status=1 | ||
437 | LIMIT 0, 1 | ||
438 | "; | ||
439 | $result=$this->getRow($sql); | ||
440 | |||
441 | if($result != null) | ||
442 | return $this->makeResultJson(-100, "사용할 수 없는 아이디 입니다"); | ||
443 | else | ||
444 | return $this->makeResultJson(1, "사용할 수 있는 아이디 입니다"); | ||
445 | } | ||
446 | |||
447 | function checkNickRedundancy(){ | ||
448 | $nickName=$this->req["nickName"]; | ||
449 | |||
450 | $sql=" | ||
451 | SELECT * | ||
452 | FROM tblUser | ||
453 | WHERE nickName='{$nickName}' AND status=1 | ||
454 | LIMIT 0, 1 | ||
455 | "; | ||
456 | $result=$this->getRow($sql); | ||
457 | |||
458 | if($result != null) | ||
459 | return $this->makeResultJson(-100, "사용할 수 없는 닉네임 입니다"); | ||
460 | else | ||
461 | return $this->makeResultJson(1, "사용할 수 있는 닉네임 입니다"); | ||
462 | } | ||
463 | |||
464 | function saveManager(){ | ||
465 | $userNo=$this->req["userNo"]; | ||
466 | $userID=$this->req["userID"]; | ||
467 | $userPwd=md5($this->req["userPwd"]); | ||
468 | $userName=$this->req["userName"]; | ||
469 | $nickName=$this->req["nickName"]; | ||
470 | $userTel1=$this->req["userTel1"]; | ||
471 | $userTel2=$this->req["userTel2"]; | ||
472 | $userTel3=$this->req["userTel3"]; | ||
473 | |||
474 | $userTel=$userTel1.$userTel2.$userTel3; | ||
475 | |||
476 | $sql=" | ||
477 | SELECT * | ||
478 | FROM tblUser | ||
479 | WHERE userID='{$userID}' AND status=1 | ||
480 | LIMIT 0, 1 | ||
481 | "; | ||
482 | $result=$this->getRow($sql); | ||
483 | |||
484 | if($result != null) | ||
485 | return $this->makeResultJson(-100, "사용할 수 없는 아이디 입니다"); | ||
486 | |||
487 | $sql=" | ||
488 | SELECT * | ||
489 | FROM tblUser | ||
490 | WHERE nickName='{$nickName}' AND status=1 | ||
491 | LIMIT 0, 1 | ||
492 | "; | ||
493 | $result=$this->getRow($sql); | ||
494 | |||
495 | if($result != null) | ||
496 | return $this->makeResultJson(-100, "사용할 수 없는 닉네임 입니다"); | ||
497 | |||
498 | $sql=" | ||
499 | INSERT INTO `tblUser` | ||
500 | (`userNo`, | ||
501 | `userType`, | ||
502 | `userID`, | ||
503 | `userPwd`, | ||
504 | `userName`, | ||
505 | `nickName`, | ||
506 | `userTel`, | ||
507 | `push`, | ||
508 | `status`, | ||
509 | `regDate`) | ||
510 | VALUES | ||
511 | ('{$userNo}', | ||
512 | 2, | ||
513 | '{$userID}', | ||
514 | '{$userPwd}', | ||
515 | '{$userName}', | ||
516 | '{$nickName}', | ||
517 | '{$userTel}', | ||
518 | 1, | ||
519 | 1, | ||
520 | NOW()); | ||
521 | "; | ||
522 | $this->update($sql); | ||
523 | return $this->makeResultJson(1, "등록되었습니다"); | ||
524 | } | ||
525 | |||
353 | function getListOfUserForExcel($member_type = "") | 526 | function getListOfUserForExcel($member_type = "") |
354 | { | 527 | { |
355 | $search_text = $this->req["search_text"]; | 528 | $search_text = $this->req["search_text"]; |
... | @@ -502,53 +675,11 @@ if(!class_exists("AdminUser")){ | ... | @@ -502,53 +675,11 @@ if(!class_exists("AdminUser")){ |
502 | $noArr = $this->req["no"]; | 675 | $noArr = $this->req["no"]; |
503 | 676 | ||
504 | $noStr = implode(',', $noArr); | 677 | $noStr = implode(',', $noArr); |
505 | |||
506 | $sql=" | ||
507 | SELECT no | ||
508 | FROM tbl_building | ||
509 | WHERE `vip_fk` IN({$noStr}) AND `status` = 'Y' | ||
510 | "; | ||
511 | $result=$this->getArray($sql); | ||
512 | |||
513 | for($i=0;$i<sizeof($result); $i++){ | ||
514 | $vipStr = implode(',', $result[$i]); | ||
515 | } | ||
516 | |||
517 | $sql=" | ||
518 | SELECT no | ||
519 | FROM tbl_room | ||
520 | WHERE `user_fk` IN({$noStr}) AND `status` = 'Y' | ||
521 | "; | ||
522 | $result=$this->getArray($sql); | ||
523 | |||
524 | for($i=0;$i<sizeof($result); $i++){ | ||
525 | $userStr = implode(',', $result[$i]); | ||
526 | } | ||
527 | 678 | ||
528 | if(!empty($vipStr)){ | ||
529 | $sql=" | ||
530 | UPDATE tbl_building | ||
531 | SET vip_fk = 0, owner_name = NULL | ||
532 | WHERE `no` IN({$vipStr}) | ||
533 | "; | ||
534 | $this->update($sql); | ||
535 | |||
536 | } | ||
537 | |||
538 | if(!empty($userStr)){ | ||
539 | $sql=" | ||
540 | UPDATE tbl_room | ||
541 | SET user_fk = 0, contractor_name = NULL | ||
542 | WHERE `no` IN({$userStr}) | ||
543 | "; | ||
544 | $this->update($sql); | ||
545 | } | ||
546 | |||
547 | |||
548 | $sql = " | 679 | $sql = " |
549 | UPDATE tbl_user | 680 | UPDATE tblUser |
550 | SET status = 'N' | 681 | SET status = 0 |
551 | WHERE `no` IN({$noStr}) | 682 | WHERE `userNo` IN({$noStr}) |
552 | "; | 683 | "; |
553 | $this->update($sql); | 684 | $this->update($sql); |
554 | } | 685 | } | ... | ... |
... | @@ -16,8 +16,9 @@ if (! class_exists("ApiBoard")) | ... | @@ -16,8 +16,9 @@ if (! class_exists("ApiBoard")) |
16 | function getListOfNotice(){ | 16 | function getListOfNotice(){ |
17 | 17 | ||
18 | $sql=" | 18 | $sql=" |
19 | SELECT COUNT(*) | 19 | SELECT COUNT(*) AS rn |
20 | FROM tblNotice | 20 | FROM tblNotice |
21 | WHERE status=1 | ||
21 | ORDER BY noticeNo DESC | 22 | ORDER BY noticeNo DESC |
22 | "; | 23 | "; |
23 | 24 | ||
... | @@ -28,6 +29,7 @@ if (! class_exists("ApiBoard")) | ... | @@ -28,6 +29,7 @@ if (! class_exists("ApiBoard")) |
28 | $sql=" | 29 | $sql=" |
29 | SELECT * | 30 | SELECT * |
30 | FROM tblNotice | 31 | FROM tblNotice |
32 | WHERE status=1 | ||
31 | ORDER BY noticeNo DESC | 33 | ORDER BY noticeNo DESC |
32 | "; | 34 | "; |
33 | 35 | ||
... | @@ -52,8 +54,9 @@ if (! class_exists("ApiBoard")) | ... | @@ -52,8 +54,9 @@ if (! class_exists("ApiBoard")) |
52 | //이벤트 리스트 | 54 | //이벤트 리스트 |
53 | function getListOfEvent(){ | 55 | function getListOfEvent(){ |
54 | $sql=" | 56 | $sql=" |
55 | SELECT COUNT(*) | 57 | SELECT COUNT(*) AS rn |
56 | FROM tblEvent | 58 | FROM tblEvent |
59 | WHERE status=1 | ||
57 | ORDER BY eventNo DESC | 60 | ORDER BY eventNo DESC |
58 | "; | 61 | "; |
59 | $this->rownum=$this->getValue($sql, "rn"); | 62 | $this->rownum=$this->getValue($sql, "rn"); |
... | @@ -63,6 +66,7 @@ if (! class_exists("ApiBoard")) | ... | @@ -63,6 +66,7 @@ if (! class_exists("ApiBoard")) |
63 | $sql=" | 66 | $sql=" |
64 | SELECT * | 67 | SELECT * |
65 | FROM tblEvent | 68 | FROM tblEvent |
69 | WHERE status=1 | ||
66 | ORDER BY eventNo DESC | 70 | ORDER BY eventNo DESC |
67 | "; | 71 | "; |
68 | $result=$this->getArray($sql); | 72 | $result=$this->getArray($sql); |
... | @@ -100,13 +104,15 @@ if (! class_exists("ApiBoard")) | ... | @@ -100,13 +104,15 @@ if (! class_exists("ApiBoard")) |
100 | } | 104 | } |
101 | 105 | ||
102 | function getListCountBoard(){ | 106 | function getListCountBoard(){ |
103 | $sql="SELECT COUNT(*) FROM tblBoard WHERE status=1"; | 107 | $sql="SELECT COUNT(*) AS rn FROM tblBoard WHERE status=1"; |
104 | $result=$this->getValue($sql, "rn"); | 108 | $result=$this->getValue($sql, "rn"); |
105 | return $this->makeResultJson("1", "", $result); | 109 | return $this->makeResultJson("1", "", $result); |
106 | } | 110 | } |
107 | 111 | ||
108 | function getListCountCS(){ | 112 | function getListCountCS(){ |
109 | $sql="SELECT COUNT(*) FROM tblCustomerService WHERE status=1"; | 113 | $sql="SELECT COUNT(*) AS rn FROM tblCustomerService WHERE status=1"; |
114 | $result=$this->getValue($sql, "rn"); | ||
115 | return $this->makeResultJson("1", "", $result); | ||
110 | } | 116 | } |
111 | 117 | ||
112 | 118 | ||
... | @@ -168,14 +174,15 @@ if (! class_exists("ApiBoard")) | ... | @@ -168,14 +174,15 @@ if (! class_exists("ApiBoard")) |
168 | 174 | ||
169 | 175 | ||
170 | $sql=" | 176 | $sql=" |
171 | SELECT COUNT(*) | 177 | SELECT COUNT(*) AS rn |
172 | FROM tblBoard B | 178 | FROM tblBoard B |
173 | JOIN tblUser U ON B.userFk=U.userNo | 179 | JOIN tblUser U ON B.userFk=U.userNo |
174 | {$where} | 180 | {$where} |
175 | ORDER BY boardNo DESC | 181 | ORDER BY boardNo DESC |
176 | "; | 182 | "; |
177 | $this->rownum = $this->getValue($sql, "rn"); | ||
178 | $this->initPage(); | 183 | $this->initPage(); |
184 | $this->rownum = $this->getValue($sql, "rn"); | ||
185 | |||
179 | $this->setPageForDevice($this->rownum); | 186 | $this->setPageForDevice($this->rownum); |
180 | 187 | ||
181 | $sql=" | 188 | $sql=" |
... | @@ -369,14 +376,15 @@ if (! class_exists("ApiBoard")) | ... | @@ -369,14 +376,15 @@ if (! class_exists("ApiBoard")) |
369 | 376 | ||
370 | 377 | ||
371 | $sql=" | 378 | $sql=" |
372 | SELECT COUNT(*) | 379 | SELECT COUNT(*) AS rn |
373 | FROM tblCustomerService CS | 380 | FROM tblCustomerService CS |
374 | JOIN tblUser U ON CS.userFk=U.userNo | 381 | JOIN tblUser U ON CS.userFk=U.userNo |
375 | WHERE CS.status=1 | 382 | WHERE CS.status=1 |
376 | ORDER BY csNo DESC | 383 | ORDER BY csNo DESC |
377 | "; | 384 | "; |
378 | $this->rownum = $this->getValue($sql, "rn"); | ||
379 | $this->initPage(); | 385 | $this->initPage(); |
386 | $this->rownum = $this->getValue($sql, "rn"); | ||
387 | |||
380 | $this->setPageForDevice($this->rownum); | 388 | $this->setPageForDevice($this->rownum); |
381 | 389 | ||
382 | $sql=" | 390 | $sql=" |
... | @@ -449,13 +457,14 @@ if (! class_exists("ApiBoard")) | ... | @@ -449,13 +457,14 @@ if (! class_exists("ApiBoard")) |
449 | } | 457 | } |
450 | 458 | ||
451 | $sql=" | 459 | $sql=" |
452 | SELECT COUNT(*) | 460 | SELECT COUNT(*) AS rn |
453 | FROM tblCompany | 461 | FROM tblCompany |
454 | {$where} | 462 | {$where} |
455 | ORDER BY companyNo DESC | 463 | ORDER BY companyNo DESC |
456 | "; | 464 | "; |
457 | $this->rownum=$this->getValue($sql, "rn"); | ||
458 | $this->initPage(); | 465 | $this->initPage(); |
466 | $this->rownum=$this->getValue($sql, "rn"); | ||
467 | |||
459 | $this->setPageForDevice($this->rownum); | 468 | $this->setPageForDevice($this->rownum); |
460 | 469 | ||
461 | $sql=" | 470 | $sql=" |
... | @@ -773,13 +782,14 @@ if (! class_exists("ApiBoard")) | ... | @@ -773,13 +782,14 @@ if (! class_exists("ApiBoard")) |
773 | $userFk=1; | 782 | $userFk=1; |
774 | 783 | ||
775 | $sql=" | 784 | $sql=" |
776 | SELECT COUNT(*) | 785 | SELECT COUNT(*) AS rn |
777 | FROM tblProductionSpec | 786 | FROM tblProductionSpec |
778 | WHERE userFk='{$userFk}' AND status=1 | 787 | WHERE userFk='{$userFk}' AND status=1 |
779 | ORDER BY productionNo DESC | 788 | ORDER BY productionNo DESC |
780 | "; | 789 | "; |
781 | $this->rownum=$this->getValue($sql, "rn"); | ||
782 | $this->initPage(); | 790 | $this->initPage(); |
791 | $this->rownum=$this->getValue($sql, "rn"); | ||
792 | |||
783 | $this->setPageForDevice($this->rownum); | 793 | $this->setPageForDevice($this->rownum); |
784 | 794 | ||
785 | $sql=" | 795 | $sql=" |
... | @@ -814,13 +824,14 @@ if (! class_exists("ApiBoard")) | ... | @@ -814,13 +824,14 @@ if (! class_exists("ApiBoard")) |
814 | } | 824 | } |
815 | 825 | ||
816 | $sql=" | 826 | $sql=" |
817 | SELECT COUNT(*) | 827 | SELECT COUNT(*) AS rn |
818 | FROM tblProductionSpec | 828 | FROM tblProductionSpec |
819 | {$where} | 829 | {$where} |
820 | ORDER BY productionNo DESC | 830 | ORDER BY productionNo DESC |
821 | "; | 831 | "; |
822 | $this->rownum=$this->getValue($sql, "rn"); | ||
823 | $this->initPage(); | 832 | $this->initPage(); |
833 | $this->rownum=$this->getValue($sql, "rn"); | ||
834 | |||
824 | $this->setPageForDevice($this->rownum); | 835 | $this->setPageForDevice($this->rownum); |
825 | 836 | ||
826 | 837 | ||
... | @@ -886,14 +897,15 @@ if (! class_exists("ApiBoard")) | ... | @@ -886,14 +897,15 @@ if (! class_exists("ApiBoard")) |
886 | $userNo=$this->appUser["no"]; | 897 | $userNo=$this->appUser["no"]; |
887 | 898 | ||
888 | $sql=" | 899 | $sql=" |
889 | SELECT COUNT(*) | 900 | SELECT COUNT(*) AS rn |
890 | FROM tblProductionSpec PS | 901 | FROM tblProductionSpec PS |
891 | JOIN tblLike L ON PS.productionNo=L.productionNo | 902 | JOIN tblLike L ON PS.productionNo=L.productionNo |
892 | WHERE L.userNo='{$userNo}' AND PS.status=1 | 903 | WHERE L.userNo='{$userNo}' AND PS.status=1 |
893 | ORDER BY regDate DESC | 904 | ORDER BY regDate DESC |
894 | "; | 905 | "; |
895 | $this->rownum=$this->getValue($sql, "rn"); | ||
896 | $this->initPage(); | 906 | $this->initPage(); |
907 | $this->rownum=$this->getValue($sql, "rn"); | ||
908 | |||
897 | $this->setPageForDevice($this->rownum); | 909 | $this->setPageForDevice($this->rownum); |
898 | 910 | ||
899 | $sql=" | 911 | $sql=" |
... | @@ -909,13 +921,14 @@ if (! class_exists("ApiBoard")) | ... | @@ -909,13 +921,14 @@ if (! class_exists("ApiBoard")) |
909 | 921 | ||
910 | function getListOfProductionPortrait(){ | 922 | function getListOfProductionPortrait(){ |
911 | $sql=" | 923 | $sql=" |
912 | SELECT COUNT(*) | 924 | SELECT COUNT(*) AS rn |
913 | FROM tblProductionPortrait | 925 | FROM tblProductionPortrait |
914 | WHERE status=1 | 926 | WHERE status=1 |
915 | ORDER BY regDate DESC | 927 | ORDER BY regDate DESC |
916 | "; | 928 | "; |
917 | $this->rownum=$this->getValue($sql, "rn"); | ||
918 | $this->initPage(); | 929 | $this->initPage(); |
930 | $this->rownum=$this->getValue($sql, "rn"); | ||
931 | |||
919 | $this->setPageForDevice($this->rownum); | 932 | $this->setPageForDevice($this->rownum); |
920 | 933 | ||
921 | $sql=" | 934 | $sql=" | ... | ... |
1 | <? include $_SERVER["DOCUMENT_ROOT"] . "/common/classes/ApiBase.php" ;?> | ||
2 | <? | ||
3 | |||
4 | /* | ||
5 | * Admin process | ||
6 | * add by dev.lee | ||
7 | */ | ||
8 | if (! class_exists("ApiShop")) | ||
9 | { | ||
10 | |||
11 | class ApiShop extends ApiBase | ||
12 | { | ||
13 | |||
14 | function __construct($req) | ||
15 | { | ||
16 | parent::__construct($req); | ||
17 | } | ||
18 | |||
19 | // 카테고리 (http://106.240.232.36:8004/action_front.php?cmd=ApiShop.getListOfCategory) | ||
20 | function getListOfCategory() | ||
21 | { | ||
22 | $sql = " | ||
23 | SELECT * | ||
24 | FROM v_alive_category | ||
25 | ORDER BY no ASC | ||
26 | "; | ||
27 | |||
28 | $list = $this->getArray($sql); | ||
29 | |||
30 | if (sizeof($list) > 0) | ||
31 | return $this->makeResultJson("1", "", $list); | ||
32 | else | ||
33 | return $this->makeResultJson("-1000", "내역이 없습니다."); | ||
34 | } | ||
35 | |||
36 | // 상점리스트 (http://106.240.232.36:8004/action_front.php?cmd=ApiShop.getListOfShop) | ||
37 | function getListOfShop() | ||
38 | { | ||
39 | $categoryCD = $this->req["categoryCD"]; | ||
40 | $promotion = $this->req["promotion"]; | ||
41 | $isAll = $this->req["isAll"]; | ||
42 | $isUnlimitDistance = $this->req["isUnlimitDistance"]; | ||
43 | $name = $this->req["name"]; | ||
44 | $page = $this->req["page"]; | ||
45 | |||
46 | $lat = $this->req["lat"] == "" ? 0 : (int) ($this->req["lat"] * 1E6); | ||
47 | $lng = $this->req["lng"] == "" ? 0 : (int) ($this->req["lng"] * 1E6); | ||
48 | |||
49 | $disKM = 1; | ||
50 | $latRadius = $this->LAT_ONE_KM * $disKM; | ||
51 | $lngRadius = $this->LNG_ONE_KM * $disKM; | ||
52 | |||
53 | // $group_fk = $this->appUser["group_fk"]; | ||
54 | // $memberType = $this->appUser["member_type"]; | ||
55 | $group_fk = 8; | ||
56 | $memberType = M; | ||
57 | |||
58 | if ($lat == 0 && lng == 0) | ||
59 | { | ||
60 | // 멤버쉽일 경우 지정된 그룹의 주소 기반으로 | ||
61 | if ($memberType == $this->MEM_TYPE_MEMBER) | ||
62 | { | ||
63 | $sql = " | ||
64 | SELECT * | ||
65 | FROM v_alive_user_group | ||
66 | WHERE `no`='{$group_fk}' | ||
67 | LIMIT 0, 1 | ||
68 | "; | ||
69 | |||
70 | $memRow = $this->getRow($sql); | ||
71 | |||
72 | $lat = $memRow["latitude"]; | ||
73 | $lng = $memRow["longitude"]; | ||
74 | } | ||
75 | else | ||
76 | { | ||
77 | $lat = 37565852; | ||
78 | $lng = 126977984; | ||
79 | } | ||
80 | } | ||
81 | |||
82 | $where = " WHERE 1=1 "; | ||
83 | |||
84 | if($isUnlimitDistance != "1") | ||
85 | { | ||
86 | $where .= " AND sh.latitude BETWEEN ({$lat} - $latRadius) AND ({$lat} + $latRadius) "; | ||
87 | $where .= " AND sh.longitude BETWEEN ({$lng} - $lngRadius) AND ({$lng} + $lngRadius) "; | ||
88 | |||
89 | $outWhere = " WHERE distance_km < {$disKM} "; | ||
90 | } | ||
91 | |||
92 | // rowPerPage | ||
93 | |||
94 | |||
95 | if ($categoryCD != "") | ||
96 | $where .= " AND sh.category_cd='{$categoryCD}' "; | ||
97 | |||
98 | if ($promotion != "") | ||
99 | $where .= " AND sh.promotion='{$promotion}' "; | ||
100 | |||
101 | if ($name != "") | ||
102 | $where .= " AND sh.name like '%{$name}%' "; | ||
103 | |||
104 | $orderBy = " ORDER BY promotion DESC, distance_m ASC"; | ||
105 | |||
106 | $limitStr = ""; | ||
107 | if ($isAll == "N") | ||
108 | { | ||
109 | $this->initPage(); | ||
110 | $sql = " | ||
111 | SELECT COUNT(TMP.no) AS rn | ||
112 | FROM | ||
113 | ( | ||
114 | SELECT | ||
115 | sh.*, | ||
116 | (FLOOR(SQRT(POWER(ABS({$lat} - sh.latitude), 2) + POWER(ABS({$lng} - sh.longitude), 2)) / 10) / 1000) AS distance_km | ||
117 | FROM v_alive_shop sh | ||
118 | {$where} | ||
119 | ) AS TMP | ||
120 | {$outWhere} | ||
121 | "; | ||
122 | |||
123 | $this->rownum = $this->getValue($sql, "rn"); | ||
124 | |||
125 | $this->setPage($this->rownum); | ||
126 | $limitStr = " LIMIT {$this->startNum}, {$this->endNum} "; | ||
127 | } | ||
128 | else | ||
129 | { | ||
130 | $limitStr = " LIMIT 1000; "; | ||
131 | } | ||
132 | |||
133 | $sql = " | ||
134 | SELECT | ||
135 | TMP.* | ||
136 | , (TMP.longitude / 1E6) AS longitude | ||
137 | , (TMP.latitude / 1E6) AS latitude | ||
138 | FROM | ||
139 | ( | ||
140 | SELECT | ||
141 | sh.no | ||
142 | , sh.name | ||
143 | , sh.tel | ||
144 | , sh.addr_old | ||
145 | , sh.addr_new | ||
146 | , sh.latitude | ||
147 | , sh.longitude | ||
148 | , sh.discount_desc | ||
149 | , sh.category_cd | ||
150 | , sh.promotion | ||
151 | , IFNULL((SELECT F.file_vir_name FROM tbl_file F WHERE F.pa_no= sh.no AND F.file_type='{$this->FILE_TYPE_SHOP}' ORDER BY RAND() DESC LIMIT 1), '') AS img_path | ||
152 | , IFNULL((SELECT GR.discount_rate FROM tbl_shop_group_rate GR WHERE sh.no = GR.shop_fk AND GR.group_fk = '{$group_fk}' LIMIT 1), sh.discount_rate) AS discount_rate | ||
153 | , COUNT(co.no) AS comment_count | ||
154 | , TRUNCATE(IFNULL(AVG(co.rank), 0), 0) AS rank | ||
155 | , (FLOOR(SQRT(POWER(ABS('{$lat}' - sh.latitude), 2) + POWER(ABS('{$lng}' - sh.longitude), 2))) / 10.0) AS distance_m | ||
156 | , (FLOOR(SQRT(POWER(ABS({$lat} - sh.latitude), 2) + POWER(ABS({$lng} - sh.longitude), 2)) / 10) / 1000) AS distance_km | ||
157 | FROM v_alive_shop sh | ||
158 | LEFT JOIN tbl_comment co ON(co.target_fk = sh.no AND comm_type = '{$this->COMMENT_TYPE_SHOP}') | ||
159 | {$where} | ||
160 | GROUP BY sh.no | ||
161 | {$orderBy} | ||
162 | ) TMP | ||
163 | {$outWhere} | ||
164 | {$limitStr} | ||
165 | "; | ||
166 | |||
167 | $list = $this->getArray($sql); | ||
168 | |||
169 | |||
170 | if (sizeof($list) > 0) | ||
171 | return $this->makeResultJson("1", "", $list); | ||
172 | else | ||
173 | return $this->makeResultJson("-1000", "내역이 없습니다."); | ||
174 | } | ||
175 | |||
176 | // 상점상세보기 (http://106.240.232.36:8004/action_front.php?cmd=ApiShop.getInfoOfShop) | ||
177 | function getInfoOfShop() | ||
178 | { | ||
179 | $no = $this->req["no"]; | ||
180 | |||
181 | $lat = $this->req["lat"] == "" ? 0 : (int) ($this->req["lat"] * 1E6); | ||
182 | $lng = $this->req["lng"] == "" ? 0 : (int) ($this->req["lng"] * 1E6); | ||
183 | |||
184 | $memberType = $this->appUser["member_type"]; | ||
185 | $group_fk = $this->appUser["group_fk"]; | ||
186 | |||
187 | if ($lat == 0 && lng == 0) | ||
188 | { | ||
189 | // 멤버쉽일 경우 지정된 그룹의 주소 기반으로 | ||
190 | if ($memberType == $this->MEM_TYPE_MEMBER) | ||
191 | { | ||
192 | $sql = " | ||
193 | SELECT * | ||
194 | FROM v_alive_user_group | ||
195 | WHERE `no` = '{$group_fk}' | ||
196 | LIMIT 0, 1 | ||
197 | "; | ||
198 | |||
199 | $memRow = $this->getRow($sql); | ||
200 | |||
201 | $lat = $memRow["latitude"]; | ||
202 | $lng = $memRow["longitude"]; | ||
203 | } | ||
204 | else | ||
205 | { | ||
206 | $lat = 37565852; | ||
207 | $lng = 126977984; | ||
208 | } | ||
209 | } | ||
210 | |||
211 | $sql = " | ||
212 | SELECT | ||
213 | sh.no | ||
214 | , sh.name | ||
215 | , sh.tel | ||
216 | , sh.addr_new | ||
217 | , sh.addr_old | ||
218 | , sh.latitude | ||
219 | , sh.longitude | ||
220 | , sh.discount_desc | ||
221 | , sh.category_cd | ||
222 | , sh.promotion | ||
223 | , IFNULL((SELECT GR.discount_rate FROM tbl_shop_group_rate GR WHERE sh.no = GR.shop_fk AND GR.group_fk = '{$group_fk}' LIMIT 1), sh.discount_rate) AS discount_rate | ||
224 | , (sh.longitude / 1E6) AS longitude | ||
225 | , (sh.latitude / 1E6) AS latitude | ||
226 | , COUNT(co.no) AS comment_count | ||
227 | , TRUNCATE(IFNULL(AVG(co.rank), 0), 0) AS rank | ||
228 | , (FLOOR(SQRT(POWER(ABS('{$lat}' - sh.latitude), 2) + POWER(ABS('{$lng}' - sh.longitude), 2))) / 10.0) AS distance_m | ||
229 | , (FLOOR(SQRT(POWER(ABS({$lat} - sh.latitude), 2) + POWER(ABS({$lng} - sh.longitude), 2)) / 10) / 1000) AS distance_km | ||
230 | FROM v_alive_shop sh | ||
231 | LEFT JOIN tbl_comment co ON(co.target_fk = sh.no AND comm_type = '{$this->COMMENT_TYPE_SHOP}') | ||
232 | WHERE sh.no = '{$no}' | ||
233 | GROUP BY sh.no | ||
234 | LIMIT 0, 1 | ||
235 | "; | ||
236 | |||
237 | $row = $this->getRow($sql); | ||
238 | |||
239 | $sql = " | ||
240 | SELECT * | ||
241 | FROM tbl_file | ||
242 | WHERE pa_no='{$no}' and file_type='{$this->FILE_TYPE_SHOP}' | ||
243 | "; | ||
244 | |||
245 | $list = $this->getArray($sql); | ||
246 | |||
247 | $entity = array( | ||
248 | "row" => $row, | ||
249 | "files" => $list | ||
250 | ); | ||
251 | |||
252 | return $this->makeResultJson("1", "", $entity); | ||
253 | } | ||
254 | |||
255 | // 상점에 달린 코멘트 보기 (http://106.240.232.36:8004/action_front.php?cmd=ApiShop.getListOfShopComment&no=1) | ||
256 | function getListOfShopComment() | ||
257 | { | ||
258 | $no = $this->req["no"]; | ||
259 | |||
260 | $this->initPage(); | ||
261 | |||
262 | $sql = " | ||
263 | SELECT COUNT(*) | ||
264 | FROM v_alive_shop_comment co, v_alive_user us | ||
265 | WHERE | ||
266 | co.target_fk='{$no}' | ||
267 | AND co.user_fk = us.no | ||
268 | ORDER BY co.no ASC | ||
269 | "; | ||
270 | |||
271 | $this->rownum = $this->getValue($sql, "rn"); | ||
272 | |||
273 | $this->setPage($this->rownum); | ||
274 | |||
275 | $sql = " | ||
276 | SELECT | ||
277 | co.* | ||
278 | , us.name as mem_name | ||
279 | , (SELECT f.file_vir_name FROM tbl_file f WHERE f.pa_no=us.no AND f.file_type='{$this->FILE_TYPE_MEM}' LIMIT 0, 1) AS mem_file | ||
280 | FROM | ||
281 | v_alive_shop_comment co, v_alive_user us | ||
282 | WHERE | ||
283 | co.target_fk='{$no}' | ||
284 | AND co.user_fk = us.no | ||
285 | ORDER BY co.no ASC | ||
286 | LIMIT {$this->startNum}, {$this->endNum} | ||
287 | "; | ||
288 | |||
289 | $list = $this->getArray($sql); | ||
290 | |||
291 | if (sizeof($list) > 0) | ||
292 | return $this->makeResultJson("1", "", $list); | ||
293 | else | ||
294 | return $this->makeResultJson("-1000", "내역이 없습니다."); | ||
295 | } | ||
296 | |||
297 | // 할인 금액 | ||
298 | // /action_front.php?cmd=ApiShop.useUserPoint&no=1&usePoint=100 | ||
299 | function useUserPoint() | ||
300 | { | ||
301 | $userNo = $this->appUser["no"]; | ||
302 | $groupNo = $this->appUser["group_fk"]; | ||
303 | $shopNo = $this->req["no"]; | ||
304 | $usePoint = $this->req["usePoint"]; | ||
305 | $payAmount = $this->req["payAmount"]; | ||
306 | |||
307 | $userBalanceAmt = $this->inFn_Common_getUserPointBalance($userNo); | ||
308 | |||
309 | if ($userBalanceAmt < $usePoint) | ||
310 | return $this->makeResultJson("-100", "보유 포인트가 부족합니다.", $userBalanceAmt); | ||
311 | |||
312 | $result = $this->inFn_Common_savePointTrans("O", $userNo, $usePoint, $groupNo, $shopNo, $this->PAY_TYPE_USE, $payAmount); | ||
313 | |||
314 | if ($result) | ||
315 | return $this->makeResultJson("1", "포인트가 차감되었습니다.", ($userBalanceAmt - $usePoint)); | ||
316 | else | ||
317 | return $this->makeResultJson("-1", "포인트 차감에 실패했습니다.", $userBalanceAmt); | ||
318 | } | ||
319 | |||
320 | /** | ||
321 | * 상점 리뷰 등록 | ||
322 | * /action_front.php?cmd=ApiShop.saveShopComment&shopNo=1&rank=1&comment=테스트 | ||
323 | * | ||
324 | * @return string | ||
325 | */ | ||
326 | function saveShopComment() | ||
327 | { | ||
328 | $shopNo = $this->req["shopNo"]; | ||
329 | $userNo = $this->appUser["no"]; | ||
330 | $rank = $this->req["rank"]; | ||
331 | $comment = $this->req["comment"]; | ||
332 | //$userNo = 1; | ||
333 | |||
334 | if ($shopNo == "") | ||
335 | return $this->makeResultJson("-100", "비정상 접근"); | ||
336 | if ($rank == "" || $rank == "0") | ||
337 | return $this->makeResultJson("-101", "별점을 입력해주세요."); | ||
338 | if ($comment == "") | ||
339 | return $this->makeResultJson("-102", "리뷰 내용을 입력해주세요."); | ||
340 | |||
341 | $sql = " | ||
342 | INSERT INTO tbl_comment(user_fk, target_fk, comment, comm_type, rank, reg_dt) | ||
343 | VALUES('{$userNo}', '{$shopNo}', '{$comment}', '{$this->COMMENT_TYPE_SHOP}', '{$rank}', NOW()) | ||
344 | "; | ||
345 | $result = $this->update($sql); | ||
346 | |||
347 | if ($result > 0) | ||
348 | return $this->makeResultJson("1", "등록되었습니다."); | ||
349 | else | ||
350 | return $this->makeResultJson("-1", "등록에 실패했습니다."); | ||
351 | } | ||
352 | } // 클래스 종료 | ||
353 | } | ||
354 | ?> | ||
... | \ No newline at end of file | ... | \ No newline at end of file |
... | @@ -25,6 +25,7 @@ if (! class_exists("ApiStatic")){ | ... | @@ -25,6 +25,7 @@ if (! class_exists("ApiStatic")){ |
25 | $sql=" | 25 | $sql=" |
26 | SELECT * | 26 | SELECT * |
27 | FROM tblOrganizationCert | 27 | FROM tblOrganizationCert |
28 | WHERE status=1 | ||
28 | ORDER BY certNo DESC | 29 | ORDER BY certNo DESC |
29 | "; | 30 | "; |
30 | $list=$this->getArray($sql); | 31 | $list=$this->getArray($sql); |
... | @@ -59,6 +60,7 @@ if (! class_exists("ApiStatic")){ | ... | @@ -59,6 +60,7 @@ if (! class_exists("ApiStatic")){ |
59 | $sql=" | 60 | $sql=" |
60 | SELECT title | 61 | SELECT title |
61 | FROM tblNotice | 62 | FROM tblNotice |
63 | WHERE status=1 | ||
62 | ORDER BY noticeNo DESC | 64 | ORDER BY noticeNo DESC |
63 | LIMIT 1 | 65 | LIMIT 1 |
64 | "; | 66 | "; |
... | @@ -71,6 +73,7 @@ if (! class_exists("ApiStatic")){ | ... | @@ -71,6 +73,7 @@ if (! class_exists("ApiStatic")){ |
71 | $sql=" | 73 | $sql=" |
72 | SELECT title | 74 | SELECT title |
73 | FROM tblEvent | 75 | FROM tblEvent |
76 | WHERE status=1 | ||
74 | ORDER BY eventNo DESC | 77 | ORDER BY eventNo DESC |
75 | LIMIT 1 | 78 | LIMIT 1 |
76 | "; | 79 | "; |
... | @@ -103,7 +106,7 @@ if (! class_exists("ApiStatic")){ | ... | @@ -103,7 +106,7 @@ if (! class_exists("ApiStatic")){ |
103 | $vehicleType=$this->req["vehicleType"]; | 106 | $vehicleType=$this->req["vehicleType"]; |
104 | $vehicleType="IS"; | 107 | $vehicleType="IS"; |
105 | $sql=" | 108 | $sql=" |
106 | SELECT vehicleNo, name, imgPathVehicle | 109 | SELECT vehicleNo, name, imgPathVehicle1, imgPathVehicle2, imgPathVehicle3, imgPathVehicle4, imgPathVehicle5 |
107 | FROM tblVehicle | 110 | FROM tblVehicle |
108 | WHERE vehicleType='{$vehicleType}' AND status=1 | 111 | WHERE vehicleType='{$vehicleType}' AND status=1 |
109 | ORDER BY regDate DESC | 112 | ORDER BY regDate DESC | ... | ... |
1 | <? | ||
2 | include $_SERVER["DOCUMENT_ROOT"] . "/common/classes/AdminBase.php" ; | ||
3 | include $_SERVER[DOCUMENT_ROOT] . "/common/php/LoginUtil.php"; | ||
4 | |||
5 | if (! class_exists("AdminBoard")){ | ||
6 | class AdminBoard extends AdminBase{ | ||
7 | function __construct($req) | ||
8 | { | ||
9 | parent::__construct($req); | ||
10 | } | ||
11 | |||
12 | function getListOfBoard(){ | ||
13 | $boardType=$this->req["boardType"]; | ||
14 | |||
15 | if($boardType == "NO"){ | ||
16 | $sql=" | ||
17 | SELECT COUNT(*) AS rn | ||
18 | FROM tblNotice | ||
19 | WHERE status=1 | ||
20 | "; | ||
21 | $this->initPage(); | ||
22 | $this->rownum=$this->getValue($sql, 'rn'); | ||
23 | $this->setPage($this->rownum); | ||
24 | $limit=" LIMIT {$this->startNum}, {$this->endNum} ;"; | ||
25 | |||
26 | $sql=" | ||
27 | SELECT N.noticeNo AS no, N.title, DATE_FORMAT(N.regDATE, '%Y%m%d') AS regDate | ||
28 | FROM tblNotice N | ||
29 | WHERE N.status=1 | ||
30 | ORDER BY N.regDate DESC | ||
31 | {$limit} | ||
32 | "; | ||
33 | $result=$this->getArray($sql); | ||
34 | return $result; | ||
35 | } | ||
36 | else if($boardType == "EV"){ | ||
37 | $sql=" | ||
38 | SELECT COUNT(*) AS rn | ||
39 | FROM tblEvent | ||
40 | WHERE status=1 | ||
41 | "; | ||
42 | $this->initPage(); | ||
43 | $this->rownum=$this->getValue($sql, 'rn'); | ||
44 | $this->setPage($this->rownum); | ||
45 | $limit=" LIMIT {$this->startNum}, {$this->endNum} ;"; | ||
46 | |||
47 | $sql=" | ||
48 | SELECT E.eventNo AS no, E.title, DATE_FORMAT(E.regDATE, '%Y%m%d') AS regDate | ||
49 | FROM tblEvent E | ||
50 | WHERE E.status=1 | ||
51 | ORDER BY E.regDate DESC | ||
52 | {$limit} | ||
53 | "; | ||
54 | $result=$this->getArray($sql); | ||
55 | return $result; | ||
56 | } | ||
57 | } | ||
58 | |||
59 | function getInfoOfBoard(){ | ||
60 | $boardType=$this->req["boardType"]; | ||
61 | $boardNo=$this->req["no"]; | ||
62 | |||
63 | if($boardType == "NO"){ | ||
64 | $sql=" | ||
65 | SELECT noticeNo AS no, title, imgPathNotice1 AS imgPath1, imgPathNotice2 AS imgPath2, imgPathNotice3 AS imgPath3, imgPathNotice4 AS imgPath4, imgPathNotice5 AS imgPath5, content, regDate | ||
66 | FROM tblNotice | ||
67 | WHERE noticeNo='{$boardNo}' | ||
68 | "; | ||
69 | $result=$this->getRow($sql); | ||
70 | //echo json_encode($result); | ||
71 | return $result; | ||
72 | } | ||
73 | else if($boardType == "EV"){ | ||
74 | $sql=" | ||
75 | SELECT eventNo AS no, title, imgPathEvent1 AS imgPath1, imgPathEvent2 AS imgPath2, imgPathEvent3 AS imgPath3, imgPathEvent4 AS imgPath4, imgPathEvent5 AS imgPath5, content, regDate | ||
76 | FROM tblEvent | ||
77 | WHERE eventNo='{$boardNo}' | ||
78 | "; | ||
79 | $result=$this->getRow($sql); | ||
80 | return $result; | ||
81 | } | ||
82 | } | ||
83 | |||
84 | function getListOfEComment($boardNo){ | ||
85 | $no=$this->req["no"]; | ||
86 | if($boardNo != ""){ | ||
87 | $sql=" | ||
88 | SELECT C.*, U.userName | ||
89 | FROM tblComment C | ||
90 | JOIN tblUser U ON C.userFk=U.userNo | ||
91 | WHERE C.commentType='EV' AND C.targetFk='{$no}' AND C.status=1 AND U.status=1 | ||
92 | ORDER BY commentGroup DESC, gOrder ASC | ||
93 | "; | ||
94 | $result=$this->getArray($sql); | ||
95 | //echo json_encode($result); | ||
96 | return $result; | ||
97 | } | ||
98 | |||
99 | } | ||
100 | |||
101 | function saveBoard(){ | ||
102 | $no=$this->req["no"]; | ||
103 | $boardType=$this->req["boardType"]; | ||
104 | |||
105 | $title=$this->req["title"]; | ||
106 | $content=$this->req["content"]; | ||
107 | |||
108 | $imgResult = $this->inFn_Common_fileSave($_FILES); | ||
109 | |||
110 | $imgPath1 = $imgResult["imgPath1"]["saveURL"] != "" ? $imgResult["imgPath1"]["saveURL"] : $this->req["imgPath1"]; | ||
111 | $imgPath2 = $imgResult["imgPath2"]["saveURL"] != "" ? $imgResult["imgPath2"]["saveURL"] : $this->req["imgPath2"]; | ||
112 | $imgPath3 = $imgResult["imgPath3"]["saveURL"] != "" ? $imgResult["imgPath3"]["saveURL"] : $this->req["imgPath3"]; | ||
113 | $imgPath4 = $imgResult["imgPath4"]["saveURL"] != "" ? $imgResult["imgPath4"]["saveURL"] : $this->req["imgPath4"]; | ||
114 | $imgPath5 = $imgResult["imgPath5"]["saveURL"] != "" ? $imgResult["imgPath5"]["saveURL"] : $this->req["imgPath5"]; | ||
115 | |||
116 | if($no == ""){ | ||
117 | if($boardType=="NO"){ | ||
118 | $sql=" | ||
119 | INSERT INTO `tblNotice` | ||
120 | ( | ||
121 | `title`, | ||
122 | `imgPathNotice1`, | ||
123 | `imgPathNotice2`, | ||
124 | `imgPathNotice3`, | ||
125 | `imgPathNotice4`, | ||
126 | `imgPathNotice5`, | ||
127 | `content`, | ||
128 | `status`, | ||
129 | `regDate` | ||
130 | ) | ||
131 | VALUES | ||
132 | ( | ||
133 | '{$title}', | ||
134 | '{$imgPath1}', | ||
135 | '{$imgPath2}', | ||
136 | '{$imgPath3}', | ||
137 | '{$imgPath4}', | ||
138 | '{$imgPath5}', | ||
139 | '{$content}', | ||
140 | 1, | ||
141 | NOW() | ||
142 | ); | ||
143 | "; | ||
144 | $this->update($sql); | ||
145 | return $this->makeResultJson(1, "공지사항이 저장되었습니다"); | ||
146 | } | ||
147 | else if($boardType=="EV"){ | ||
148 | $sql=" | ||
149 | INSERT INTO `tblEvent` | ||
150 | ( | ||
151 | `title`, | ||
152 | `imgPathEvent1`, | ||
153 | `imgPathEvent2`, | ||
154 | `imgPathEvent3`, | ||
155 | `imgPathEvent4`, | ||
156 | `imgPathEvent5`, | ||
157 | `content`, | ||
158 | `status`, | ||
159 | `regDate`) | ||
160 | VALUES | ||
161 | ( | ||
162 | '{$title}', | ||
163 | '{$imgPath1}', | ||
164 | '{$imgPath2}', | ||
165 | '{$imgPath3}', | ||
166 | '{$imgPath4}', | ||
167 | '{$imgPath5}', | ||
168 | '{$content}', | ||
169 | 1, | ||
170 | NOW() | ||
171 | ); | ||
172 | "; | ||
173 | $this->update($sql); | ||
174 | return $this->makeResultJson(1, "이벤트가 저장되었습니다"); | ||
175 | } | ||
176 | } | ||
177 | else{ | ||
178 | if($boardType=="NO"){ | ||
179 | $sql=" | ||
180 | UPDATE `tblNotice` | ||
181 | SET | ||
182 | `title` = '{$title}', | ||
183 | `imgPathNotice1` = '{$imgPath1}', | ||
184 | `imgPathNotice2` = '{$imgPath2}', | ||
185 | `imgPathNotice3` = '{$imgPath3}', | ||
186 | `imgPathNotice4` = '{$imgPath4}', | ||
187 | `imgPathNotice5` = '{$imgPath5}', | ||
188 | `content` = '{$content}' | ||
189 | WHERE `noticeNo` = '{$no}'; | ||
190 | "; | ||
191 | $this->update($sql); | ||
192 | return $this->makeResultJson(1, "공지사항이 수정되었습니다"); | ||
193 | } | ||
194 | else if($boardType=="EV"){ | ||
195 | $sql=" | ||
196 | UPDATE `tblEvent` | ||
197 | SET | ||
198 | `title` = '{$title}', | ||
199 | `imgPathEvent1` = '{$imgPath1}', | ||
200 | `imgPathEvent2` = '{$imgPath2}', | ||
201 | `imgPathEvent3` = '{$imgPath3}', | ||
202 | `imgPathEvent4` = '{$imgPath4}', | ||
203 | `imgPathEvent5` = '{$imgPath5}', | ||
204 | `content` = '{$content}' | ||
205 | WHERE `eventNo` = '{$no}'; | ||
206 | "; | ||
207 | $this->update($sql); | ||
208 | return $this->makeResultJson(1, "이벤트가 수정되었습니다"); | ||
209 | } | ||
210 | } | ||
211 | } | ||
212 | |||
213 | function deleteBoard(){ | ||
214 | $noArr = $this->req["no"]; | ||
215 | $boardType=$this->req["boardType"]; | ||
216 | $noStr = implode(',', $noArr); | ||
217 | |||
218 | if($boardType == "NO"){ | ||
219 | $sql = " | ||
220 | UPDATE tblNotice | ||
221 | SET status = 0 | ||
222 | WHERE `noticeNo` IN({$noStr}) | ||
223 | "; | ||
224 | $this->update($sql); | ||
225 | } | ||
226 | else if($boardType=="EV"){ | ||
227 | $sql = " | ||
228 | UPDATE tblEvent | ||
229 | SET status = 0 | ||
230 | WHERE `eventNo` IN({$noStr}) | ||
231 | "; | ||
232 | $this->update($sql); | ||
233 | } | ||
234 | |||
235 | } | ||
236 | |||
237 | function getListOfOrganizationCert(){ | ||
238 | $sql=" | ||
239 | SELECT COUNT(*) AS rn | ||
240 | FROM tblOrganizationCert | ||
241 | WHERE status=1 | ||
242 | "; | ||
243 | $this->initPage(); | ||
244 | $this->rownum=$this->getValue($sql, 'rn'); | ||
245 | $this->setPage($this->rownum); | ||
246 | $limit=" LIMIT {$this->startNum}, {$this->endNum} ;"; | ||
247 | |||
248 | $sql=" | ||
249 | SELECT * | ||
250 | FROM tblOrganizationCert | ||
251 | WHERE status=1 | ||
252 | ORDER BY regDate DESC | ||
253 | {$limit} | ||
254 | "; | ||
255 | $result=$this->getArray($sql); | ||
256 | return $result; | ||
257 | } | ||
258 | |||
259 | function getInfoOfOrganizationCert(){ | ||
260 | $certNo=$this->req["certNo"]; | ||
261 | |||
262 | $sql=" | ||
263 | SELECT * | ||
264 | FROM tblOrganizationCert | ||
265 | WHERE certNo='{$certNo}' | ||
266 | LIMIT 1 | ||
267 | "; | ||
268 | $result=$this->getRow($sql); | ||
269 | return $result; | ||
270 | } | ||
271 | |||
272 | function saveOrganizationCert(){ | ||
273 | $name=$this->req["name"]; | ||
274 | $imgResult = $this->inFn_Common_fileSave($_FILES); | ||
275 | $imgPathCert = $imgResult["imgPathCert1"]["saveURL"] != "" ? $imgResult["imgPathCert1"]["saveURL"] : $this->req["imgPathCert"]; | ||
276 | |||
277 | $certNo=$this->req["certNo"]; | ||
278 | |||
279 | if($certNo == ""){ | ||
280 | $sql=" | ||
281 | INSERT INTO tblOrganizationCert(name, imgPathCert, status, regDate) | ||
282 | VALUES | ||
283 | ( | ||
284 | '{$name}', | ||
285 | '{$imgPathCert}', | ||
286 | 1, | ||
287 | NOW() | ||
288 | ) | ||
289 | "; | ||
290 | $this->update($sql); | ||
291 | return $this->makeResultJson(1, "저장되었습니다"); | ||
292 | } | ||
293 | else{ | ||
294 | $sql=" | ||
295 | UPDATE tblOrganizationCert | ||
296 | SET | ||
297 | name='{$name}', | ||
298 | imgPathCert='{$imgPathCert}' | ||
299 | WHERE certNo='{$certNo}' | ||
300 | "; | ||
301 | $this->update($sql); | ||
302 | return $this->makeResultJson(1, "수정되었습니다"); | ||
303 | } | ||
304 | } | ||
305 | |||
306 | function deleteCert(){ | ||
307 | $noArr = $this->req["no"]; | ||
308 | |||
309 | $noStr = implode(',', $noArr); | ||
310 | |||
311 | $sql = " | ||
312 | UPDATE tblOrganizationCert | ||
313 | SET status = 0 | ||
314 | WHERE `certNo` IN({$noStr}) | ||
315 | "; | ||
316 | $this->update($sql); | ||
317 | } | ||
318 | |||
319 | } | ||
320 | |||
321 | } | ||
322 | |||
323 | ?> | ||
... | \ No newline at end of file | ... | \ No newline at end of file |
1 | <? include $_SERVER["DOCUMENT_ROOT"] . "/common/classes/AdminBase.php" ; | ||
2 | include $_SERVER[DOCUMENT_ROOT] . "/common/php/LoginUtil.php"; | ||
3 | |||
4 | if (! class_exists("AdminVehicle")){ | ||
5 | class AdminVehicle extends AdminBase{ | ||
6 | |||
7 | function __construct($req) | ||
8 | { | ||
9 | parent::__construct($req); | ||
10 | } | ||
11 | |||
12 | function getListOfVehicle(){ | ||
13 | $vehicleType=$this->req["vehicleType"]; | ||
14 | |||
15 | |||
16 | |||
17 | $sql=" | ||
18 | SELECT COUNT(*) AS rn | ||
19 | FROM tblVehicle | ||
20 | WHERE vehicleType='{$vehicleType}' AND status=1 | ||
21 | "; | ||
22 | $this->initPage(); | ||
23 | $this->rownum=$this->getValue($sql, 'rn'); | ||
24 | $this->setPage($this->rownum); | ||
25 | $limit=" LIMIT {$this->startNum}, {$this->endNum} ;"; | ||
26 | |||
27 | |||
28 | |||
29 | $sql=" | ||
30 | SELECT vehicleNo, name | ||
31 | FROM tblVehicle | ||
32 | WHERE vehicleType='{$vehicleType}' AND status=1 | ||
33 | ORDER BY regDate DESC | ||
34 | {$limit} | ||
35 | "; | ||
36 | $result=$this->getArray($sql); | ||
37 | return $result; | ||
38 | } | ||
39 | |||
40 | function getInfoOfVehicle(){ | ||
41 | $vehicleNo=$this->req["vehicleNo"]; | ||
42 | |||
43 | $sql=" | ||
44 | SELECT * | ||
45 | FROM tblVehicle | ||
46 | WHERE vehicleNo='{$vehicleNo}' AND status=1 | ||
47 | "; | ||
48 | $result=$this->getRow($sql); | ||
49 | return $result; | ||
50 | } | ||
51 | |||
52 | |||
53 | function saveVehicle(){ | ||
54 | $vehicleType=$this->req["vehicleType"]; | ||
55 | $vehicleNo=$this->req["vehicleNo"]; | ||
56 | $name=$this->req["name"]; | ||
57 | $spec=$this->req["spec"]; | ||
58 | $videoURL=$this->req["videoURL"]; | ||
59 | $imgResult = $this->inFn_Common_fileSave($_FILES); | ||
60 | |||
61 | |||
62 | $imgPathVehicle1 = $imgResult["imgPathVehicle1"]["saveURL"] != "" ? $imgResult["imgPathVehicle1"]["saveURL"] : $this->req["imgPathVehicle1"]; | ||
63 | $imgPathVehicle2 = $imgResult["imgPathVehicle2"]["saveURL"] != "" ? $imgResult["imgPathVehicle2"]["saveURL"] : $this->req["imgPathVehicle2"]; | ||
64 | $imgPathVehicle3 = $imgResult["imgPathVehicle3"]["saveURL"] != "" ? $imgResult["imgPathVehicle3"]["saveURL"] : $this->req["imgPathVehicle3"]; | ||
65 | $imgPathVehicle4 = $imgResult["imgPathVehicle4"]["saveURL"] != "" ? $imgResult["imgPathVehicle4"]["saveURL"] : $this->req["imgPathVehicle4"]; | ||
66 | $imgPathVehicle5 = $imgResult["imgPathVehicle5"]["saveURL"] != "" ? $imgResult["imgPathVehicle5"]["saveURL"] : $this->req["imgPathVehicle5"]; | ||
67 | |||
68 | if($vehicleNo == ""){ | ||
69 | $sql=" | ||
70 | INSERT INTO tblVehicle(vehicleType, name, spec, videoURL, status, regDate) | ||
71 | VALUES | ||
72 | ( | ||
73 | '{$vehicleType}', | ||
74 | '{$name}', | ||
75 | '{$spec}', | ||
76 | '{$videoURL}', | ||
77 | 1, | ||
78 | NOW() | ||
79 | ) | ||
80 | "; | ||
81 | $this->update($sql); | ||
82 | |||
83 | $lastNo=$this->mysql_insert_id(); | ||
84 | |||
85 | $sql=" | ||
86 | UPDATE tblVehicle | ||
87 | SET | ||
88 | imgPathVehicle1='{$imgPathVehicle1}', | ||
89 | imgPathVehicle2='{$imgPathVehicle2}', | ||
90 | imgPathVehicle3='{$imgPathVehicle3}', | ||
91 | imgPathVehicle4='{$imgPathVehicle4}', | ||
92 | imgPathVehicle5='{$imgPathVehicle5}' | ||
93 | WHERE vehicleNo='{$lastNo}' | ||
94 | "; | ||
95 | $this->update($sql); | ||
96 | |||
97 | return $this->makeResultJson(1, "저장되었습니다"); | ||
98 | } | ||
99 | else{ | ||
100 | $sql=" | ||
101 | UPDATE tblVehicle | ||
102 | SET | ||
103 | name='{$name}', | ||
104 | spec='{$spec}', | ||
105 | videoURL='{$videoURL}', | ||
106 | imgPathVehicle1='{$imgPathVehicle1}', | ||
107 | imgPathVehicle2='{$imgPathVehicle2}', | ||
108 | imgPathVehicle3='{$imgPathVehicle3}', | ||
109 | imgPathVehicle4='{$imgPathVehicle4}', | ||
110 | imgPathVehicle5='{$imgPathVehicle5}' | ||
111 | WHERE vehicleNo='{$vehicleNo}' | ||
112 | "; | ||
113 | $this->update($sql); | ||
114 | |||
115 | return $this->makeResultJson(1, "수정되었습니다"); | ||
116 | } | ||
117 | } | ||
118 | |||
119 | function deleteVehicle() | ||
120 | { | ||
121 | $noArr = $this->req["no"]; | ||
122 | |||
123 | $noStr = implode(',', $noArr); | ||
124 | |||
125 | $sql = " | ||
126 | UPDATE tblVehicle | ||
127 | SET status = 0 | ||
128 | WHERE `vehicleNo` IN({$noStr}) | ||
129 | "; | ||
130 | $this->update($sql); | ||
131 | } | ||
132 | |||
133 | |||
134 | |||
135 | } | ||
136 | } | ||
137 | |||
138 | ?> | ||
... | \ No newline at end of file | ... | \ No newline at end of file |
343 KB
9.56 KB
343 KB
9.56 KB
343 KB
9.56 KB
9.56 KB
393 KB
393 KB
343 KB
9.56 KB
343 KB
9.56 KB
393 KB
343 KB
9.56 KB
343 KB
9.56 KB
343 KB
9.56 KB
393 KB
343 KB
9.56 KB
393 KB
343 KB
343 KB
343 KB
9.56 KB
393 KB
343 KB
9.56 KB
343 KB
9.56 KB
343 KB
343 KB
393 KB
9.56 KB
343 KB
9.56 KB
393 KB
343 KB
9.56 KB
9.56 KB
343 KB
9.56 KB
343 KB
9.56 KB
343 KB
393 KB
343 KB
9.56 KB
-
Please register or sign in to post a comment