d6570ba4 by sayhoChun

main page and vehicle info handled

1 parent ed43601a
...@@ -87,19 +87,39 @@ if (! class_exists("ApiBoard")) ...@@ -87,19 +87,39 @@ if (! class_exists("ApiBoard"))
87 87
88 //자유게시판 리스트 88 //자유게시판 리스트
89 function getListOfBoard(){ 89 function getListOfBoard(){
90 $searchText=$this->req["searchText"];
91 $searchType=$this->req["searchType"];
92
93 $where="status=1";
94
95 if(!empty($searchText)){
96 if(empty($search_type)){
97 $where.=" AND (U.userID LIKE '%{$searchText}%' OR B.title LIKE '%{$searchText}%')";
98 }
99 else if($searchType=="작성자"){
100 $where.=" AND U.userID LIKE '%{$searchText}%'";
101 }
102 else if($searchType=="제목"){
103 $where.=" AND B.title LIKE '%{$searchText}%'";
104 }
105 }
106
107
90 $sql=" 108 $sql="
91 SELECT COUNT(*) 109 SELECT COUNT(*)
92 FROM tblBoard 110 FROM tblBoard B
93 WHERE status='Y' 111 JOIN tblUser U ON B.userFk=U.no
112 {$where}
94 ORDER BY boardNo DESC 113 ORDER BY boardNo DESC
95 "; 114 ";
96 $this->rownum = $this->getValue($sql, "rn"); 115 $this->rownum = $this->getValue($sql, "rn");
97 $this->setPageForDevice($this->rownum); 116 $this->setPageForDevice($this->rownum);
98 117
99 $sql=" 118 $sql="
100 SELECT * 119 SELECT B.*, U.userID
101 FROM tblBoard 120 FROM tblBoard B
102 WHERE status='Y' 121 JOIN tblUser U B.userFk=U.no
122 {$where}
103 ORDER BY boardNo DESC 123 ORDER BY boardNo DESC
104 LIMIT {$this->startNum}, {$this->endNum} 124 LIMIT {$this->startNum}, {$this->endNum}
105 "; 125 ";
...@@ -117,7 +137,7 @@ if (! class_exists("ApiBoard")) ...@@ -117,7 +137,7 @@ if (! class_exists("ApiBoard"))
117 $sql=" 137 $sql="
118 SELECT * 138 SELECT *
119 FROM tblBoard 139 FROM tblBoard
120 WHERE boardNo='{$boardNo}' AND status='Y' 140 WHERE boardNo='{$boardNo}' AND status=1
121 LIMIT 1 141 LIMIT 1
122 "; 142 ";
123 $result=$this->getRow($sql); 143 $result=$this->getRow($sql);
...@@ -173,19 +193,39 @@ if (! class_exists("ApiBoard")) ...@@ -173,19 +193,39 @@ if (! class_exists("ApiBoard"))
173 193
174 //고객센터 게시물 리스트 194 //고객센터 게시물 리스트
175 function getListOfCS(){ 195 function getListOfCS(){
196 $searchText=$this->req["searchText"];
197 $searchType=$this->req["searchType"];
198
199 $where="status=1";
200
201 if(!empty($searchText)){
202 if(empty($search_type)){
203 $where.=" AND (U.userID LIKE '%{$searchText}%' OR CS.title LIKE '%{$searchText}%')";
204 }
205 else if($searchType=="작성자"){
206 $where.=" AND U.userID LIKE '%{$searchText}%'";
207 }
208 else if($searchType=="제목"){
209 $where.=" AND CS.title LIKE '%{$searchText}%'";
210 }
211 }
212
213
176 $sql=" 214 $sql="
177 SELECT COUNT(*) 215 SELECT COUNT(*)
178 FROM tblCustomerService 216 FROM tblCustomerService CS
179 WHERE status='Y' 217 JOIN tblUser U ON CS.userFk=U.no
218 WHERE status=1
180 ORDER BY csNo DESC 219 ORDER BY csNo DESC
181 "; 220 ";
182 $this->rownum = $this->getValue($sql, "rn"); 221 $this->rownum = $this->getValue($sql, "rn");
183 $this->setPageForDevice($this->rownum); 222 $this->setPageForDevice($this->rownum);
184 223
185 $sql=" 224 $sql="
186 SELECT * 225 SELECT CS.*, U.userID
187 FORM tblCustomerService 226 FORM tblCustomerService CS
188 WHERE status='Y' 227 JOIN tblUser U ON CS.userFk=U.no
228 WHERE status=1
189 ORDER BY csNo DESC 229 ORDER BY csNo DESC
190 LIMIT {$this->startNum}, {$this->endNum} 230 LIMIT {$this->startNum}, {$this->endNum}
191 "; 231 ";
...@@ -203,7 +243,7 @@ if (! class_exists("ApiBoard")) ...@@ -203,7 +243,7 @@ if (! class_exists("ApiBoard"))
203 $sql=" 243 $sql="
204 SELECT * 244 SELECT *
205 FROM tblCustomerService 245 FROM tblCustomerService
206 WHERE csNo='{$csNo}' AND status='Y' 246 WHERE csNo='{$csNo}' AND status=1
207 LIMIT 1 247 LIMIT 1
208 "; 248 ";
209 $result=$this->getRow($sql); 249 $result=$this->getRow($sql);
...@@ -229,12 +269,12 @@ if (! class_exists("ApiBoard")) ...@@ -229,12 +269,12 @@ if (! class_exists("ApiBoard"))
229 } 269 }
230 270
231 271
232 //AS 엄체 리스트 272 //AS엄체 리스트
233 function getListOfCompany(){ 273 function getListOfCompany(){
234 $sql=" 274 $sql="
235 SELECT COUNT(*) 275 SELECT COUNT(*)
236 FROM tblCompany 276 FROM tblCompany
237 WHERE status='Y' 277 WHERE status=1
238 ORDER BY companyNo DESC 278 ORDER BY companyNo DESC
239 "; 279 ";
240 $this->rownum=$this->getValue($sql, "rn"); 280 $this->rownum=$this->getValue($sql, "rn");
...@@ -243,7 +283,7 @@ if (! class_exists("ApiBoard")) ...@@ -243,7 +283,7 @@ if (! class_exists("ApiBoard"))
243 $sql=" 283 $sql="
244 SELECT * 284 SELECT *
245 FROM tblCompany 285 FROM tblCompany
246 WHERE status='Y' 286 WHERE status=1
247 ORDER BY companyNo DESC 287 ORDER BY companyNo DESC
248 LIMIT {$this->startNum}, {$this->endNum} 288 LIMIT {$this->startNum}, {$this->endNum}
249 "; 289 ";
...@@ -255,13 +295,14 @@ if (! class_exists("ApiBoard")) ...@@ -255,13 +295,14 @@ if (! class_exists("ApiBoard"))
255 return $this->makeResultJson("-1000", "내역이 없습니다."); 295 return $this->makeResultJson("-1000", "내역이 없습니다.");
256 } 296 }
257 297
298 //AS업체 상세
258 function getInfoOfCompany(){ 299 function getInfoOfCompany(){
259 $companyNo=$this->req["no"]; 300 $companyNo=$this->req["no"];
260 301
261 $sql=" 302 $sql="
262 SELECT * 303 SELECT *
263 FROM tblCompany 304 FROM tblCompany
264 WHERE companyNo='{$companyNo}' AND status='Y' 305 WHERE companyNo='{$companyNo}' AND status=1
265 LIMIT 1 306 LIMIT 1
266 "; 307 ";
267 $result=$this->getRow($sql); 308 $result=$this->getRow($sql);
......
...@@ -17,7 +17,7 @@ if (! class_exists("ApiStatic")){ ...@@ -17,7 +17,7 @@ if (! class_exists("ApiStatic")){
17 LIMIT 1 17 LIMIT 1
18 "; 18 ";
19 $payload = $this->getRow($sql); 19 $payload = $this->getRow($sql);
20 return json_encode($payload); 20 return $this->makeResultJson("1", "", $payload);
21 } 21 }
22 22
23 //기관인증 23 //기관인증
...@@ -27,7 +27,82 @@ if (! class_exists("ApiStatic")){ ...@@ -27,7 +27,82 @@ if (! class_exists("ApiStatic")){
27 FROM tblOrganizationCert 27 FROM tblOrganizationCert
28 ORDER BY certNo DESC 28 ORDER BY certNo DESC
29 "; 29 ";
30 return json_encode($this->getArray($sql)); 30 $list=$this->getArray($sql);
31 return $this->makeResultJson("1", "", $list);
32 }
33
34 function getMainImage(){
35 $sql="
36 SELECT imgPathMain, imgPathBuiltIn, imgPathInsulation, imgPathFreezerV, imgPathSpecial, imgPathPowerGate, imgPathWingBody, imgPathFreezerC
37 FROM tblMain
38 LIMIT 1
39 ";
40 $result=$this->getRow($sql);
41 return $this->makeResultJson("1", "", $result);
42 }
43
44 function getMainPhrase(){
45 $sql="
46 SELECT phrase1, phrase2
47 FROM tblMain
48 LIMIT 1
49 ";
50 }
51
52 //메인페이지 공지사항
53 function getLatestNotice(){
54 $sql="
55 SELECT title
56 FROM tblNotice
57 ORDER BY noticeNo DESC
58 LIMIT 1
59 ";
60 $result=$this->getRow($sql);
61 return $this->makeResultJson("1", "", $result);
62 }
63
64 //메인페이지 이벤트
65 function getLatestEvent(){
66 $sql="
67 SELECT title
68 FROM tblEvent
69 ORDER BY eventNo DESC
70 LIMIT 1
71 ";
72 $result=$this->getRow($sql);
73 return $this->makeResultJson("1", "", $result);
74 }
75
76 function getKCBriefInfo(){
77 $sql="
78 SELECT address, telephone, fax, eMail
79 FROM tblKCSpecialVehicleInfo
80 ";
81 }
82
83 function getListOfVehicle(){
84 $vehicleType=$this->req["vehicleType"];
85
86 $sql="
87 SELECT name, imgPathVehicle
88 FROM tblVehicle
89 WHERE vehicleType='{$vehicleType}' AND status=1
90 ORDER BY regDate DESC
91 ";
92 $result=$this->getArray($sql);
93 return $this->makeResultJson("1", "", $result);
94 }
95
96 function getInfoOfVehicle(){
97 $vehicleNo=$this->req["vehicleNo"];
98
99 $sql="
100 SELECT *
101 FROM tblVehicle
102 WHERE vehicleNo='{$vehicleNo}'
103 ";
104 $reusult=$this->getRow($sql);
105 return $this->makeResultJson("1", "", $result);
31 } 106 }
32 107
33 } 108 }
......
...@@ -542,6 +542,25 @@ if (! class_exists("ApiUser")) ...@@ -542,6 +542,25 @@ if (! class_exists("ApiUser"))
542 return $this->makeResultJson("1", "", $userInfo, $addData); 542 return $this->makeResultJson("1", "", $userInfo, $addData);
543 } 543 }
544 544
545 function delUser(){
546 $userNo=$this->appUser["no"];
547
548 $sql="
549 UPDATE tblUser
550 SET expireDate=DATE_FORMAT(NOW() + interval 3 MONTH, '%Y%m%d')
551 WHERE userNo='{$userNo}' AND status=1
552 ";
553 }
554
555 function delCancel(){
556 $userNo=$this->appUser["no"];
557
558 $sql="
559 UPDATE tblUser
560 SET expireDate=NULL
561 WHERE userNo='{$userNo}' AND status=1
562 ";
563 }
545 564
546 565
547 566
......