diff --git a/extdbms/lib/Controllers/DBMS/Client/CouponController.php b/extdbms/lib/Controllers/DBMS/Client/CouponController.php
index 5a70ed6..4b84c8b 100644
--- a/extdbms/lib/Controllers/DBMS/Client/CouponController.php
+++ b/extdbms/lib/Controllers/DBMS/Client/CouponController.php
@@ -38,10 +38,33 @@ class CouponController extends ClientController
}
return $this->_historyService;
}
- //IdcCouponUseMK.jsp -> domain_coupon_use.php
+
+ //IdcCouponListMK.jsp -> domain_coupon.php
//CLI 접속방법 : php index.php site/client/counpon/index
//WEB 접속방법 : http://localhost/site/client/coupon/index
public function index(array $params)
+ {
+ //전체 관리자정보(등록자)
+ if (!array_key_exists('mkid', $params)) {
+ throw new \Exception("mkid 값이 정의되지 않았습니다.");
+ }
+ //쿠폰내역
+ $this->curPage = intval($params['curPage'] ?? $this->request->get('curPage') ?? 1);
+ $this->perPage = intval($params['perPage'] ?? $this->request->get('perPage') ?? VIEW_LIST_PERPAGE);
+ [$this->total, $this->services] = $this->getServiceService()->getEntitiesForCoupon($this->curPage, $this->perPage);
+ $this->pagination = new Pagination($this->total, (int)$this->curPage, (int)$this->perPage);
+ $total_coupon = 0;
+ foreach ($this->services as $service) {
+ $total_coupon += $service->getCoupon();
+ }
+ $this->total_coupon = $total_coupon;
+ return $this->render(__FUNCTION__);
+ }
+
+ //IdcCouponUseMK.jsp -> domain_coupon_use.php
+ //CLI 접속방법 : php index.php site/client/counpon/client/client_code/코드
+ //WEB 접속방법 : http://localhost/site/client/coupon/client/client_code/코드
+ public function client(array $params)
{
//사용자정보
if (!array_key_exists('client_code', $params)) {
@@ -66,7 +89,7 @@ class CouponController extends ClientController
//쿠폰내역
$this->curPage = intval($params['curPage'] ?? $this->request->get('curPage') ?? 1);
$this->perPage = intval($params['perPage'] ?? $this->request->get('perPage') ?? VIEW_LIST_PERPAGE);
- [$this->total, $this->services] = $this->getServiceService()->getEntitiesByClient($this->curPage, $this->perPage, $client_code);
+ [$this->total, $this->services] = $this->getServiceService()->getEntitiesForCoupon($this->curPage, $this->perPage, $client_code);
$this->pagination = new Pagination($this->total, (int)$this->curPage, (int)$this->perPage);
$total_coupon = 0;
foreach ($this->services as $service) {
diff --git a/extdbms/lib/Services/ServiceService.php b/extdbms/lib/Services/ServiceService.php
index 6982206..74481f7 100644
--- a/extdbms/lib/Services/ServiceService.php
+++ b/extdbms/lib/Services/ServiceService.php
@@ -38,8 +38,11 @@ class ServiceService extends CommonService
}
//사용자별 서비스리스트트
- public function getEntitiesByClient(int $curPage, int $perPage, string $client_code): array
+ public function getEntitiesForCoupon(int $curPage, int $perPage, ?string $client_code = null): array
{
+ if ($client_code) {
+ $this->getModel()->where("client_code", $client_code);
+ }
$this->getModel()->where("client_code", $client_code);
$this->getModel()->whereNotIn("service_line", ['vpn', 'test', 'solo', 'substitution', 'event']);
//Query문 Rest여부 -> 같은조건에 Count 받고, 결과값을 받고 싶을때는 continue()
diff --git a/extdbms/lib/Views/dbms/client/coupon/client.php b/extdbms/lib/Views/dbms/client/coupon/client.php
new file mode 100644
index 0000000..ad8917b
--- /dev/null
+++ b/extdbms/lib/Views/dbms/client/coupon/client.php
@@ -0,0 +1,44 @@
+
고객명 : = $this->client->getTitle() ?> / 쿠폰발급대상 : = count($this->services) ?> 대 / 전체 남은 수량 : = $this->total_coupon; ?> 개
+
+
+
+
+
+ No
+ 서비스코드
+ 장비명
+ 서버IP
+ 서비스개시일
+ 회선종류
+ 쿠폰 누적수
+ 쿠폰 잔량수
+ 쿠폰 사용수
+ 사용
+
+
+
+
+ services as $service) { ?>
+ services) - $i; ?>
+
+ = $num ?>
+ = $service->getServiceCode() ?>
+ = $service->getServerCode() ?>
+ = $service->service_ip ?>
+ = $service->service_open_date ?>
+ = $service->service_line ?>
+ = $service->getCoupon() + $service->getUsedCoupon() ?>
+ = $service->getCoupon() ?>
+ = $service->getUsedCoupon() ?>
+ getCoupon()) { ?>
+ 사용완료
+
+ 사용하기
+
+
+
+
+
+
+
+= $this->pagination->render(DBMS_SITE_URL . "/IdcCouponUseMK.cup", ['client_code' => $this->client->getClientCode(), 'member_code' => $this->member->getPK(), 'curPage' => $this->curPage, 'perPage' => $this->perPage]) ?>
\ No newline at end of file
diff --git a/extdbms/lib/Views/dbms/client/coupon/index.php b/extdbms/lib/Views/dbms/client/coupon/index.php
index ad8917b..aa7e4a8 100644
--- a/extdbms/lib/Views/dbms/client/coupon/index.php
+++ b/extdbms/lib/Views/dbms/client/coupon/index.php
@@ -1,4 +1,3 @@
-고객명 : = $this->client->getTitle() ?> / 쿠폰발급대상 : = count($this->services) ?> 대 / 전체 남은 수량 : = $this->total_coupon; ?> 개
@@ -13,7 +12,6 @@
쿠폰 누적수
쿠폰 잔량수
쿠폰 사용수
- 사용
@@ -28,17 +26,12 @@
= $service->service_open_date ?>
= $service->service_line ?>
= $service->getCoupon() + $service->getUsedCoupon() ?>
- = $service->getCoupon() ?>
+ = $service->getCoupon() ?>
= $service->getUsedCoupon() ?>
- getCoupon()) { ?>
- 사용완료
-
- 사용하기
-
-= $this->pagination->render(DBMS_SITE_URL . "/IdcCouponUseMK.cup", ['client_code' => $this->client->getClientCode(), 'member_code' => $this->member->getPK(), 'curPage' => $this->curPage, 'perPage' => $this->perPage]) ?>
\ No newline at end of file
+= $this->pagination->render(DBMS_SITE_URL . "/IdcCouponListMK.cup", ['curPage' => $this->curPage, 'perPage' => $this->perPage]) ?>
\ No newline at end of file
diff --git a/idcproject/WebContent/jsp/cupon/IdcCouponListMK.jsp b/idcproject/WebContent/jsp/cupon/IdcCouponListMK.jsp
index 3cf72b4..db5dd1b 100644
--- a/idcproject/WebContent/jsp/cupon/IdcCouponListMK.jsp
+++ b/idcproject/WebContent/jsp/cupon/IdcCouponListMK.jsp
@@ -58,7 +58,7 @@ $(function()
-
+
diff --git a/idcproject/WebContent/jsp/cupon/IdcCouponUseMK.jsp b/idcproject/WebContent/jsp/cupon/IdcCouponUseMK.jsp
index 1e60c0e..30d74f6 100644
--- a/idcproject/WebContent/jsp/cupon/IdcCouponUseMK.jsp
+++ b/idcproject/WebContent/jsp/cupon/IdcCouponUseMK.jsp
@@ -11,7 +11,7 @@
도메인 쿠폰 사용하기
-
+