dbms_primeidc/extdbms/lib/Controllers/DBMS/NavigatorController.php
2025-04-17 19:09:50 +09:00

44 lines
1.6 KiB
PHP

<?php
namespace lib\Controllers\DBMS;
use lib\Helpers\ServiceHelper;
use lib\Services\ClientService;
use lib\Utils\Pagination;
class NavigatorController extends DBMSController
{
private ?ClientService $_clientService = null;
public function __construct(array $params = [])
{
parent::__construct($params);
$this->getView()->setPath('navigator');
$this->helper = new ServiceHelper();
} //
public function getClientService(): ClientService
{
if ($this->_clientService === null) {
$this->_clientService = new ClientService();
}
return $this->_clientService;
}
//부가서비스 : 닷디펜더,딥파인더 등, deepfinder_list.php,dotdefender_list.php
//CLI 접속방법 : php index.php site/navigator/ipsearch
//WEB 접속방법 : http://localhost/site/navigator/ipsearch
public function ipsearch(): string
{
$ip = $this->request->get('ip');
//전체 고객정보
$this->clients = $this->getClientService()->getEntities();
//IP형식이 ipv4인지 확인 후 값가져오기
$this->curPage = intval($this->request->get('curPage', 1));
$this->perPage = intval($this->request->get('perPage', VIEW_LIST_PERPAGE));
[$this->total, $this->entities] = $this->getServiceService()->getEntitiesForIpSearch($this->curPage, $this->perPage, $ip, $this->helper->isIPAddress($ip));
$this->ip = $ip;
$this->pagination = new Pagination($this->total, (int)$this->curPage, (int)$this->perPage);
return $this->render(__FUNCTION__);
}
} //Class