80 lines
3.1 KiB
PHP
80 lines
3.1 KiB
PHP
<?php
|
|
|
|
namespace lib\Controllers\DBMS\Client;
|
|
|
|
use lib\Utils\Pagination;
|
|
|
|
class PaymentController extends ClientController
|
|
{
|
|
public function __construct(array $params = [])
|
|
{
|
|
parent::__construct($params);
|
|
$this->getView()->setPath('payment');
|
|
} //
|
|
|
|
//청구서, depositbillpaper.php
|
|
//CLI 접속방법 : php index.php site/client/payment/billpaper
|
|
//WEB 접속방법 : http://localhostsite/client/payment/billpaper
|
|
public function billpaper(): string
|
|
{
|
|
//사이트 정보 가져오기
|
|
$sitekey = $this->request->get('sitekey');
|
|
if (!$sitekey) {
|
|
throw new \Exception("sitekey 값이 정의되지 않았습니다.");
|
|
}
|
|
$this->siteInfo = DBMS_SITEINFOS[$sitekey];
|
|
if (!array_key_exists($sitekey, DBMS_SITEINFOS)) {
|
|
throw new \Exception("[{$sitekey}]에 해당하는 사이트정보가 없습니다.");
|
|
}
|
|
//사용자정보가져오기
|
|
$client_code = $this->request->get('client_code');
|
|
if (!$client_code) {
|
|
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/index
|
|
//WEB 접속방법 : http://localhostsite/client/payment/index
|
|
public function index(): string
|
|
{
|
|
//Client_Code = ["C219"=>WinIDC,"C116"=>IDC-JP"] -> 미지급금계산 제외 Client_Code
|
|
$exclude_clients = ['C116', 'C219'];
|
|
//mode 당일,1일전,2일전,3일전,custom
|
|
$today = date("Y-m-d");;
|
|
$mode = $this->request->get('mode', 'all');
|
|
switch ($mode) {
|
|
case 'today':
|
|
$this->message = "[{$today} 기준 당일 ";
|
|
break;
|
|
case '1day':
|
|
$nonpaymentDay = 1;
|
|
$this->message = "[{$today}] 기준 {$nonpaymentDay}일전";
|
|
break;
|
|
case '2day':
|
|
$nonpaymentDay = 2;
|
|
$this->message = "[{$today}] 기준 {$nonpaymentDay}일전";
|
|
break;
|
|
case '3day':
|
|
$nonpaymentDay = 3;
|
|
$this->message = "[{$today}] 기준 {$nonpaymentDay}일전";
|
|
break;
|
|
case 'all':
|
|
default:
|
|
$this->message = "[{$today}] 기준 전체";
|
|
break;
|
|
}
|
|
$this->mode = $mode;
|
|
$this->curPage = intval($this->request->get('curPage', 1));
|
|
$this->perPage = intval($this->request->get('perPage', VIEW_LIST_PERPAGE));
|
|
[$this->total, $this->entities] = $this->getServiceService()->getEntitiesForNonPayment($this->curPage, $this->perPage, $mode, $exclude_clients);
|
|
$this->pagination = new Pagination($this->total, (int)$this->curPage, (int)$this->perPage);
|
|
return $this->render(path: __FUNCTION__);
|
|
}
|
|
} //Class
|