86 lines
3.2 KiB
PHP
86 lines
3.2 KiB
PHP
<?php
|
|
|
|
namespace lib\Controllers\DBMS\Client;
|
|
|
|
use lib\Utils\Pagination;
|
|
|
|
class PaymentController extends ClientController
|
|
{
|
|
public function __construct()
|
|
{
|
|
parent::__construct();
|
|
$this->getView()->setPath('payment');
|
|
} //
|
|
|
|
//청구서, depositbillpaper.php
|
|
//CLI 접속방법 : php index.php site/client/payment/billpaper
|
|
//WEB 접속방법 : http://localhostsite/client/payment/billpaper
|
|
public function billpaper(array $params): string
|
|
{
|
|
//사이트 정보 가져오기
|
|
if (!array_key_exists('sitekey', $params)) {
|
|
throw new \Exception("sitekey 값이 정의되지 않았습니다.");
|
|
}
|
|
$sitekey = $params['sitekey'];
|
|
$this->siteInfo = DBMS_SITEINFOS[$sitekey];
|
|
if (!array_key_exists($sitekey, DBMS_SITEINFOS)) {
|
|
throw new \Exception("[{$sitekey}]에 해당하는 사이트정보가 없습니다.");
|
|
}
|
|
//사용자정보가져오기
|
|
$client_code = $params['client_code'];
|
|
if (!array_key_exists('client_code', $params)) {
|
|
throw new \Exception("client_code 값이 정의되지 않았습니다.");
|
|
}
|
|
$client = $this->getClientService()->getEntityByCode($client_code);
|
|
if (!$client) {
|
|
throw new \Exception("[{$client_code}]에 해당하는 사이트정보가 없습니다.");
|
|
}
|
|
$this->client = $client;
|
|
return $this->render(__FUNCTION__);
|
|
}
|
|
|
|
//청구서, NonPaymentList.php
|
|
//CLI 접속방법 : php index.php site/client/payment/unpaid
|
|
//WEB 접속방법 : http://localhostsite/client/payment/unpaid
|
|
public function nonpayment(array $params): string
|
|
{
|
|
//사이트 정보 가져오기
|
|
if (!array_key_exists('sitekey', $params)) {
|
|
throw new \Exception("sitekey 값이 정의되지 않았습니다.");
|
|
}
|
|
$sitekey = $params['sitekey'];
|
|
$this->siteInfo = DBMS_SITEINFOS[$sitekey];
|
|
if (!array_key_exists($sitekey, DBMS_SITEINFOS)) {
|
|
throw new \Exception("[{$sitekey}]에 해당하는 사이트정보가 없습니다.");
|
|
}
|
|
//사용자정보가져오기
|
|
$client_code = $params['client_code'];
|
|
if (!array_key_exists('client_code', $params)) {
|
|
throw new \Exception("client_code 값이 정의되지 않았습니다.");
|
|
}
|
|
$client = $this->getClientService()->getEntityByCode($client_code);
|
|
if (!$client) {
|
|
throw new \Exception("[{$client_code}]에 해당하는 사이트정보가 없습니다.");
|
|
}
|
|
$this->client = $client;
|
|
//mode 당일,1일전,2일전,3일전,custom
|
|
$nonpaymentDay = 'all';
|
|
switch ($params['mode']) {
|
|
case '1day':
|
|
break;
|
|
case '2day':
|
|
break;
|
|
case '3day':
|
|
break;
|
|
case 'custom':
|
|
break;
|
|
default:
|
|
}
|
|
$total = count($temps);
|
|
$page = $parmas['page'] ?? 1;
|
|
$perPage = $parmas['perPage'] ?? 10;
|
|
$this->pagination = new Pagination($total, (int)$page, (int)$perPage);
|
|
return $this->render(path: __FUNCTION__);
|
|
}
|
|
} //Class
|