-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathhbook.controller.php
More file actions
125 lines (92 loc) · 2.95 KB
/
hbook.controller.php
File metadata and controls
125 lines (92 loc) · 2.95 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
<?php
/**
* @class hbookController
* @author CRA (developers@developers.com)
* Controller class of hbook module
**/
class hbookController extends hbook {
function init() {
}
/**
* @brief BOOK 입력
**/
function procHbookContentWrite() {
// request 값을 모두 받음
$obj = Context::getRequestVars();
// 현재 모듈번호 확인
$obj->module_srl = Context::get('module_srl');
//trade_srl 확인
$trade_srl = Context::get('trade_srl');
// trade_srl에 따라 새로 입력하거나 수정하기 위해
if($trade_srl) {
// trade_srl이 있으면 update
$output = executeQuery("hbook.updateBook", $obj);
$this->setMessage('success_updated');
} else {
// trade_srl이 없으면 insert
$output = executeQuery("hbook.insertSellinfo", $obj);
$output = executeQuery("hbook.insertBook", $obj);
$this->setMessage('success_registed');
}
}
/**
* @brief BOOK 삭제
**/
function procHbookContentDelete() {
// 삭제를 원하는 trade_srl 값을 받음
$obj->trade_srl = Context::get('trade_srl');
// 삭제 실행
$output = executeQuery("hbook.deleteBook", $obj);
$output2 = executeQuery("hbook.deleteOrder", $obj);
if(!$output->toBool() && !$ouput2->toBool())
return $output;
$this->setMessage('success_deleted');
}
/* Failed function
function procHbookContentSearch() {
// searchtype & searchterm 값을 받음
$obj = Context::getRequestVars();
// search 쿼리 날리기
$output = executeQuery("hbook.getHbookContentSearch", $obj);
// template_file을 list.html로 지정
$this->setTemplateFile('list');
}
*/
/**
* @로그인 정보를 받아내고 거래요청 함수
**/
function procHbookOrderinfo() {
// request 값을 모두 받음
$obj = Context::getRequestVars();
//ting값 T/F 에 따라 쿼리 날려주기
if(!$obj->ting){
$obj->ting = !$obj->ting;
$output = executeQuery("hbook.orderBook", $obj);
$output2 = executeQuery("hbook.tradeBook", $obj);
if(!$output->toBool() && !$output2->toBool() ) return $output;
}
else{
$obj->ting = !$obj->ting;
$obj->customer_nick = "undefined";
$output = executeQuery("hbook.orderBook", $obj);
$output2 = executeQuery("hbook.tradeBook", $obj);
if(!$output->toBool() && !$output2->toBool() ) return $output;
}
//메시지 어딧는겨..$this->setMessage('success_ordered');
}
/**
* @brief BOOK 찜하기
**/
function procHbookContentWish() {
// request 값을 모두 받음
$obj = Context::getRequestVars();
// 현재 모듈번호 확인
$obj->module_srl = Context::get('module_srl');
//trade_srl 확인
$trade_srl = Context::get('trade_srl');
//찜하기 쿼리 실행
$output = executeQuery("hbook.insertWishlist", $obj);
$this->setMessage('success_registed');
}
}
?>