dbms_primeidc_init...1
This commit is contained in:
parent
ee402dcb72
commit
3ad960fd59
@ -38,10 +38,33 @@ class CouponController extends ClientController
|
|||||||
}
|
}
|
||||||
return $this->_historyService;
|
return $this->_historyService;
|
||||||
}
|
}
|
||||||
//IdcCouponUseMK.jsp -> domain_coupon_use.php
|
|
||||||
|
//IdcCouponListMK.jsp -> domain_coupon.php
|
||||||
//CLI 접속방법 : php index.php site/client/counpon/index
|
//CLI 접속방법 : php index.php site/client/counpon/index
|
||||||
//WEB 접속방법 : http://localhost/site/client/coupon/index
|
//WEB 접속방법 : http://localhost/site/client/coupon/index
|
||||||
public function index(array $params)
|
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)) {
|
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->curPage = intval($params['curPage'] ?? $this->request->get('curPage') ?? 1);
|
||||||
$this->perPage = intval($params['perPage'] ?? $this->request->get('perPage') ?? VIEW_LIST_PERPAGE);
|
$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);
|
$this->pagination = new Pagination($this->total, (int)$this->curPage, (int)$this->perPage);
|
||||||
$total_coupon = 0;
|
$total_coupon = 0;
|
||||||
foreach ($this->services as $service) {
|
foreach ($this->services as $service) {
|
||||||
|
|||||||
@ -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()->where("client_code", $client_code);
|
||||||
$this->getModel()->whereNotIn("service_line", ['vpn', 'test', 'solo', 'substitution', 'event']);
|
$this->getModel()->whereNotIn("service_line", ['vpn', 'test', 'solo', 'substitution', 'event']);
|
||||||
//Query문 Rest여부 -> 같은조건에 Count 받고, 결과값을 받고 싶을때는 continue()
|
//Query문 Rest여부 -> 같은조건에 Count 받고, 결과값을 받고 싶을때는 continue()
|
||||||
|
|||||||
44
extdbms/lib/Views/dbms/client/coupon/client.php
Normal file
44
extdbms/lib/Views/dbms/client/coupon/client.php
Normal file
@ -0,0 +1,44 @@
|
|||||||
|
<h3>고객명 : <a href="/serviceDetail.sev?client_code=<?= $this->client->getClientCode() ?>"><?= $this->client->getTitle() ?></a> / 쿠폰발급대상 : <?= count($this->services) ?> 대 / 전체 남은 수량 : <?= $this->total_coupon; ?> 개</h3>
|
||||||
|
<div class="table-responsive" id="table">
|
||||||
|
<input type="hidden" id="token">
|
||||||
|
<table class="table table-bordered table-hover table-striped" style="text-align:center;">
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th style="text-align:center;">No</th>
|
||||||
|
<th style="text-align:center;">서비스코드</th>
|
||||||
|
<th style="text-align:center;">장비명</th>
|
||||||
|
<th style="text-align:center;">서버IP</th>
|
||||||
|
<th style="text-align:center;">서비스개시일</th>
|
||||||
|
<th style="text-align:center;">회선종류</th>
|
||||||
|
<th style="text-align:center;">쿠폰 누적수</th>
|
||||||
|
<th style="text-align:center;">쿠폰 잔량수</th>
|
||||||
|
<th style="text-align:center;">쿠폰 사용수</th>
|
||||||
|
<th style="text-align:center;">사용</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
<?php $i = 0; ?>
|
||||||
|
<?php foreach ($this->services as $service) { ?>
|
||||||
|
<?php $num = count($this->services) - $i; ?>
|
||||||
|
<tr>
|
||||||
|
<td><?= $num ?></td>
|
||||||
|
<td><a href="/serviceDetailSolo.sev?client_code=<?= $service->getClientCode() ?>&service_code=<?= $service->getServiceCode() ?>"><?= $service->getServiceCode() ?></td>
|
||||||
|
<td><?= $service->getServerCode() ?></td>
|
||||||
|
<td><?= $service->service_ip ?></td>
|
||||||
|
<td><?= $service->service_open_date ?></td>
|
||||||
|
<td><?= $service->service_line ?></td>
|
||||||
|
<td><?= $service->getCoupon() + $service->getUsedCoupon() ?></td>
|
||||||
|
<td onclick="location.href='/IdcCouponBuyMK.cup?service_code=<?= $service->getServiceCode() ?>&mkid=<?= $this->member->getPK() ?>'" style=" cursor: pointer;"><?= $service->getCoupon() ?></td>
|
||||||
|
<td><?= $service->getUsedCoupon() ?></td>
|
||||||
|
<?php if (!$service->getCoupon()) { ?>
|
||||||
|
<td><a href="/IdcCouponBuyMK.cup?service_code=<?= $service->getServiceCode() ?>&mkid=<?= $this->member->getPK() ?>">사용완료</a></td>
|
||||||
|
<?php } else { ?>
|
||||||
|
<td><a href="/IdcCouponBuyMK.cup?service_code=<?= $service->getServiceCode() ?>&mkid=<?= $this->member->getPK() ?>">사용하기</a></td>
|
||||||
|
<?php } ?>
|
||||||
|
</tr>
|
||||||
|
<?php $i++; ?>
|
||||||
|
<?php } ?>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
<div align='center'><?= $this->pagination->render(DBMS_SITE_URL . "/IdcCouponUseMK.cup", ['client_code' => $this->client->getClientCode(), 'member_code' => $this->member->getPK(), 'curPage' => $this->curPage, 'perPage' => $this->perPage]) ?></div>
|
||||||
@ -1,4 +1,3 @@
|
|||||||
<h3>고객명 : <a href="/serviceDetail.sev?client_code=<?= $this->client->getClientCode() ?>"><?= $this->client->getTitle() ?></a> / 쿠폰발급대상 : <?= count($this->services) ?> 대 / 전체 남은 수량 : <?= $this->total_coupon; ?> 개</h3>
|
|
||||||
<div class="table-responsive" id="table">
|
<div class="table-responsive" id="table">
|
||||||
<input type="hidden" id="token">
|
<input type="hidden" id="token">
|
||||||
<table class="table table-bordered table-hover table-striped" style="text-align:center;">
|
<table class="table table-bordered table-hover table-striped" style="text-align:center;">
|
||||||
@ -13,7 +12,6 @@
|
|||||||
<th style="text-align:center;">쿠폰 누적수</th>
|
<th style="text-align:center;">쿠폰 누적수</th>
|
||||||
<th style="text-align:center;">쿠폰 잔량수</th>
|
<th style="text-align:center;">쿠폰 잔량수</th>
|
||||||
<th style="text-align:center;">쿠폰 사용수</th>
|
<th style="text-align:center;">쿠폰 사용수</th>
|
||||||
<th style="text-align:center;">사용</th>
|
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
@ -28,17 +26,12 @@
|
|||||||
<td><?= $service->service_open_date ?></td>
|
<td><?= $service->service_open_date ?></td>
|
||||||
<td><?= $service->service_line ?></td>
|
<td><?= $service->service_line ?></td>
|
||||||
<td><?= $service->getCoupon() + $service->getUsedCoupon() ?></td>
|
<td><?= $service->getCoupon() + $service->getUsedCoupon() ?></td>
|
||||||
<td onclick="location.href='/IdcCouponBuyMK.cup?service_code=<?= $service->getServiceCode() ?>&mkid=<?= $this->member->getPK() ?>'" style=" cursor: pointer;"><?= $service->getCoupon() ?></td>
|
<td><?= $service->getCoupon() ?></td>
|
||||||
<td><?= $service->getUsedCoupon() ?></td>
|
<td><?= $service->getUsedCoupon() ?></td>
|
||||||
<?php if (!$service->getCoupon()) { ?>
|
|
||||||
<td><a href="/IdcCouponBuyMK.cup?service_code=<?= $service->getServiceCode() ?>&mkid=<?= $this->member->getPK() ?>">사용완료</a></td>
|
|
||||||
<?php } else { ?>
|
|
||||||
<td><a href="/IdcCouponBuyMK.cup?service_code=<?= $service->getServiceCode() ?>&mkid=<?= $this->member->getPK() ?>">사용하기</a></td>
|
|
||||||
<?php } ?>
|
|
||||||
</tr>
|
</tr>
|
||||||
<?php $i++; ?>
|
<?php $i++; ?>
|
||||||
<?php } ?>
|
<?php } ?>
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
<div align='center'><?= $this->pagination->render(DBMS_SITE_URL . "/IdcCouponUseMK.cup", ['client_code' => $this->client->getClientCode(), 'member_code' => $this->member->getPK(), 'curPage' => $this->curPage, 'perPage' => $this->perPage]) ?></div>
|
<div align='center'><?= $this->pagination->render(DBMS_SITE_URL . "/IdcCouponListMK.cup", ['curPage' => $this->curPage, 'perPage' => $this->perPage]) ?></div>
|
||||||
@ -58,7 +58,7 @@ $(function()
|
|||||||
</div>
|
</div>
|
||||||
<div class="panel-body">
|
<div class="panel-body">
|
||||||
|
|
||||||
<c:import url="${phpurl}/domain_coupon.php?ea=&curPage=${curPage }" />
|
<c:import url="${phpurl}/dbms/client/coupon/index" />
|
||||||
</div>
|
</div>
|
||||||
<!-- panel-body -->
|
<!-- panel-body -->
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@ -11,7 +11,7 @@
|
|||||||
<h4><i class="fa fa-desktop fa-fw"></i> 도메인 쿠폰 사용하기</h4>
|
<h4><i class="fa fa-desktop fa-fw"></i> 도메인 쿠폰 사용하기</h4>
|
||||||
</div>
|
</div>
|
||||||
<div class="panel-body">
|
<div class="panel-body">
|
||||||
<c:import url="${phpurl}/dbms/client/coupon/index/client_code/${mk_client_code}/mkid/${member.id}" />
|
<c:import url="${phpurl}/dbms/client/coupon/client/client_code/${mk_client_code}/mkid/${member.id}" />
|
||||||
</div>
|
</div>
|
||||||
<!-- panel-body -->
|
<!-- panel-body -->
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user