dbms_init...1
This commit is contained in:
parent
48e8689239
commit
050a31479d
@ -163,6 +163,7 @@ define("MESSENGERS", [
|
||||
]);
|
||||
//아이콘 및 Sound관련
|
||||
define('ICONS', [
|
||||
'ADD' => '<i class="bi bi-plus-circle"></i>',
|
||||
'LOGO' => '<img src="/images/logo/android-icon-48x48.png">',
|
||||
'EXCEL' => '<img src="/images/common/excel.png"/>',
|
||||
'PDF' => '<img src="/images/common/pdf.png"/>',
|
||||
@ -175,6 +176,31 @@ define('ICONS', [
|
||||
'NEW' => '<i class="bi bi-database-add"></i>',
|
||||
'REPLY' => '<i class="bi bi-arrow-return-right"></i>',
|
||||
'DATABASE' => '<i class="bi bi-database"></i>',
|
||||
'DISLIKE' => '<i class="bi bi-hand-thumbs-down"></i>',
|
||||
'LIKE' => '<i class="bi bi-hand-thumbs-up"></i>',
|
||||
'DOWNLOAD' => '<i class="bi bi-download"></i>',
|
||||
'UPLOAD' => '<i class="bi bi-upload"></i>',
|
||||
'COPY' => '<i class="bi bi-files"></i>',
|
||||
'PASTE' => '<i class="bi bi-clipboard"></i>',
|
||||
'EDIT' => '<i class="bi bi-pencil-square"></i>',
|
||||
'VIEW' => '<i class="bi bi-eye"></i>',
|
||||
'VIEW_OFF' => '<i class="bi bi-eye-slash"></i>',
|
||||
'PRINT' => '<i class="bi bi-printer"></i>',
|
||||
'SAVE' => '<i class="bi bi-save"></i>',
|
||||
'CANCEL' => '<i class="bi bi-x-circle"></i>',
|
||||
'CLOSE' => '<i class="bi bi-x-circle-fill"></i>',
|
||||
'CLIENT' => '<i class="bi bi-person-circle"></i>',
|
||||
'CHECK' => '<i class="bi bi-check-circle"></i>',
|
||||
'CHECK_OFF' => '<i class="bi bi-check-circle-fill"></i>',
|
||||
'CHECK_ON' => '<i class="bi bi-check2-circle"></i>',
|
||||
'CHECK_ALL' => '<i class="bi bi-check-all"></i>',
|
||||
'CHECK_NONE' => '<i class="bi bi-check2"></i>',
|
||||
'CHECK_SOME' => '<i class="bi bi-check2-square"></i>',
|
||||
'COUPON' => '<i class="bi bi-ticket-perforated"></i>',
|
||||
'HISTORY' => '<i class="bi bi-clock-history"></i>',
|
||||
'MODIFY' => '<i class="bi bi-pencil-square"></i>',
|
||||
'MODIFY_ALL' => '<i class="bi bi-pencil-square"></i>',
|
||||
'BATCHJOB' => '<i class="bi bi-clipboard-data"></i>',
|
||||
'DELETE' => '<i class="bi bi-trash"></i>',
|
||||
'REBOOT' => '<i class="bi bi-repeat"></i>',
|
||||
'RELOAD' => '<i class="bi bi-bootstrap-reboot"></i>',
|
||||
@ -186,6 +212,7 @@ define('ICONS', [
|
||||
'CARD' => '<i class="bi bi-credit-card"></i>',
|
||||
'DEPOSIT' => '<i class="bi bi-cash-coin"></i>',
|
||||
'DESKTOP' => '<i class="bi bi-pc-display-horizontal"></i>',
|
||||
'DEVICE' => '<i class="bi bi-device-hdd"></i>',
|
||||
'UP' => '<i class="bi bi-arrow-up"></i>',
|
||||
'DOWN' => '<i class="bi bi-arrow-down"></i>',
|
||||
'LEFT' => '<i class="bi bi-arrow-left"></i>',
|
||||
@ -198,7 +225,50 @@ define('ICONS', [
|
||||
'BOX' => '<i class="bi bi-box"></i>',
|
||||
'BOXS' => '<i class="bi bi-boxes"></i>',
|
||||
'ONETIME' => '<i class="bi bi-1-circle-fill text-warning"></i>',
|
||||
'SALE' => '<i class="bi bi-graph-down-arrow"></i>',
|
||||
'EMAIL' => '<i class="bi bi-mailbox"></i>',
|
||||
'MAIL' => '<i class="bi bi-envelope"></i>',
|
||||
'PHONE' => '<i class="bi bi-phone"></i>',
|
||||
'POINT' => '<i class="bi bi-coin"></i>',
|
||||
'ALRAM' => '<i class="bi bi-bell"></i>',
|
||||
'PAYMENT' => '<i class="bi bi-credit-card-2-back"></i>',
|
||||
'SALE_UP' => '<i class="bi bi-graph-up-arrow"></i>',
|
||||
'SALE_DOWN' => '<i class="bi bi-graph-down-arrow"></i>',
|
||||
'SERVICE' => '<i class="bi bi-gear-wide-connected"></i>',
|
||||
'SERVICE_ITEM' => '<i class="bi bi-gear-wide-connected"></i>',
|
||||
'SERVICE_ITEM_LINE' => '<i class="bi bi-chat-left-text"></i>',
|
||||
'SERVICE_ITEM_IP' => '<i class="bi bi-globe"></i>',
|
||||
'SERVICE_ITEM_SERVER' => '<i class="bi bi-server"></i>',
|
||||
'SERVICE_ITEM_CPU' => '<i class="bi bi-cpu"></i>',
|
||||
'SERVICE_ITEM_RAM' => '<i class="bi bi-memory"></i>',
|
||||
'SERVICE_ITEM_STORAGE' => '<i class="bi bi-hdd-stack"></i>',
|
||||
'SERVICE_ITEM_SOFTWARE' => '<i class="bi bi-box-seam"></i>',
|
||||
'SERVICE_ITEM_DEFENCE' => '<i class="bi bi-shield-lock"></i>',
|
||||
'SERVICE_ITEM_DOMAIN' => '<i class="bi bi-globe2"></i>',
|
||||
'SERVICE_ITEM_OTHER' => '<i class="bi bi-gear-wide-connected"></i>',
|
||||
|
||||
]);
|
||||
//메신저 아이콘
|
||||
define('MESSENGER_ICONS', [
|
||||
'WHATSAPP' => '<i class="bi bi-whatsapp"></i>',
|
||||
'VIBER' => '<i class="bi bi-viber"></i>',
|
||||
'LINE' => '<i class="bi bi-chat-left-text"></i>',
|
||||
'KAKAO' => '<i class="bi bi-chat-left-text"></i>',
|
||||
'DISCORD' => '<i class="bi bi-discord"></i>',
|
||||
'TELEGRAM' => '<i class="bi bi-telegram"></i>',
|
||||
'SKYPE' => '<i class="bi bi-skype"></i>',
|
||||
'YOUTUBE' => '<i class="bi bi-youtube"></i>',
|
||||
'FACEBOOK' => '<i class="bi bi-facebook"></i>',
|
||||
'TWITTER' => '<i class="bi bi-twitter"></i>',
|
||||
'INSTAGRAM' => '<i class="bi bi-instagram"></i>',
|
||||
'LINKEDIN' => '<i class="bi bi-linkedin"></i>',
|
||||
'GITHUB' => '<i class="bi bi-github"></i>',
|
||||
'GITLAB' => '<i class="bi bi-gitlab"></i>',
|
||||
'BITBUCKET' => '<i class="bi bi-bitbucket"></i>',
|
||||
'REDDIT' => '<i class="bi bi-reddit"></i>',
|
||||
'TIKTOK' => '<i class="bi bi-tiktok"></i>',
|
||||
'PINTEREST' => '<i class="bi bi-pinterest"></i>',
|
||||
'TUMBLR' => '<i class="bi bi-tumblr"></i>',
|
||||
'SNAPCHAT' => '<i class="bi bi-snapchat"></i>',
|
||||
]);
|
||||
//배너관련
|
||||
define('TOP_BANNER', [
|
||||
|
||||
@ -144,6 +144,8 @@ $routes->group('admin', ['namespace' => 'App\Controllers\Admin', 'filter' => 'au
|
||||
$routes->post('batchjob', 'ServicePaymentController::batchjob');
|
||||
$routes->post('batchjob_delete', 'ServicePaymentController::batchjob_delete');
|
||||
$routes->get('download/(:alpha)', 'ServicePaymentController::download/$1');
|
||||
$routes->get('invoice_email', 'ServicePaymentController::invoice_email', []);
|
||||
$routes->get('invoice_mobile', 'ServicePaymentController::invoice_mobile', []);
|
||||
});
|
||||
});
|
||||
$routes->group('equipment', ['namespace' => 'App\Controllers\Admin\Equipment'], function ($routes) {
|
||||
|
||||
@ -2,15 +2,16 @@
|
||||
|
||||
namespace App\Controllers\Admin\Customer;
|
||||
|
||||
use App\Helpers\Customer\ServicePaymentHelper;
|
||||
use App\Libraries\LogCollector;
|
||||
use App\Services\Customer\ServicePaymentService;
|
||||
use App\Services\Customer\ServiceService;
|
||||
|
||||
use CodeIgniter\HTTP\RedirectResponse;
|
||||
use CodeIgniter\HTTP\RequestInterface;
|
||||
use CodeIgniter\HTTP\ResponseInterface;
|
||||
use Psr\Log\LoggerInterface;
|
||||
|
||||
use App\Helpers\Customer\ServicePaymentHelper;
|
||||
use App\Services\Customer\ServicePaymentService;
|
||||
use App\Services\Customer\ServiceService;
|
||||
|
||||
class ServicePaymentController extends CustomerController
|
||||
{
|
||||
private ?ServiceService $_serviceService = null;
|
||||
@ -67,5 +68,73 @@ class ServicePaymentController extends CustomerController
|
||||
}
|
||||
return $options;
|
||||
}
|
||||
protected function getResultSuccess(string $message = MESSAGES["SUCCESS"], ?string $actionTemplate = null): RedirectResponse|string
|
||||
{
|
||||
switch ($this->getAction()) {
|
||||
case 'invoice_email':
|
||||
$result = parent::getResultSuccess($message, 'invoice_email');
|
||||
break;
|
||||
case 'invoice':
|
||||
$result = parent::getResultSuccess($message, 'invoice');
|
||||
break;
|
||||
case 'index':
|
||||
$result = parent::getResultSuccess($message, $this->request->getVar('ActionTemplate') ?? $actionTemplate ?? 'payment');
|
||||
break;
|
||||
default:
|
||||
$result = parent::getResultSuccess($message, $actionTemplate);
|
||||
break;
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
//Index,FieldForm관련
|
||||
private function setService(int $uid): void
|
||||
{
|
||||
$this->getServiceService()->getEntity($uid);
|
||||
$entity = $this->getServiceService()->getEntity($uid);
|
||||
if (!$entity) {
|
||||
throw new \Exception("서비스 정보가 존재하지 않습니다. uid: {$uid}");
|
||||
}
|
||||
$this->_services[$uid] = $entity;
|
||||
}
|
||||
private function invoice_process(): array
|
||||
{
|
||||
//변경할 UIDS
|
||||
$uids = $this->request->getPost('batchjob_uids[]');
|
||||
if (!is_array($uids) || !count($uids)) {
|
||||
throw new \Exception("청구서에 적용될 리스트를 선택하셔야합니다.");
|
||||
}
|
||||
$this->item_fields = ['item_type', 'ammount', 'biiling_cycle'];
|
||||
$entities = [];
|
||||
foreach ($uids as $uid) {
|
||||
//기존 Entity 가져오기
|
||||
$entity = $this->getService()->getEntity($uid);
|
||||
if (!$entity) {
|
||||
LogCollector::debug(__METHOD__ . "에서 {$uid}에 대한 정보를 찾을수 없습니다.");
|
||||
}
|
||||
//서비스 정보 추가
|
||||
$this->addService($entity->getServiceUid());
|
||||
$entities[] = $entity;
|
||||
}
|
||||
return $entities;
|
||||
}
|
||||
public function invoice_email(): RedirectResponse|string
|
||||
{
|
||||
try {
|
||||
$this->setAction(__FUNCTION__);
|
||||
$this->entities = $this->invoice_process();
|
||||
return $this->getResultSuccess();
|
||||
} catch (\Exception $e) {
|
||||
return $this->getResultFail($e->getMessage());
|
||||
}
|
||||
}
|
||||
public function invoice_mobile(): RedirectResponse|string
|
||||
{
|
||||
try {
|
||||
$this->setAction(__FUNCTION__);
|
||||
$this->entities = $this->invoice_process();
|
||||
return $this->getResultSuccess();
|
||||
} catch (\Exception $e) {
|
||||
return $this->getResultFail($e->getMessage());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -8,4 +8,6 @@ class AccountEntity extends CustomerEntity
|
||||
{
|
||||
const PK = AccountModel::PK;
|
||||
const TITLE = AccountModel::TITLE;
|
||||
//고객정보객체-상속
|
||||
//타 객체정의 부분
|
||||
}
|
||||
|
||||
@ -8,6 +8,7 @@ class ClientEntity extends CustomerEntity
|
||||
{
|
||||
const PK = ClientModel::PK;
|
||||
const TITLE = ClientModel::TITLE;
|
||||
//타 객체정의 부분
|
||||
public function getRole(): string
|
||||
{
|
||||
return $this->attributes['role'];
|
||||
|
||||
@ -8,4 +8,6 @@ class CouponEntity extends CustomerEntity
|
||||
{
|
||||
const PK = CouponModel::PK;
|
||||
const TITLE = CouponModel::TITLE;
|
||||
//고객정보객체-상속
|
||||
//타 객체정의 부분
|
||||
}
|
||||
|
||||
@ -3,16 +3,27 @@
|
||||
namespace App\Entities\Customer;
|
||||
|
||||
use App\Entities\CommonEntity;
|
||||
use App\Entities\Customer\ClientEntity;
|
||||
|
||||
abstract class CustomerEntity extends CommonEntity
|
||||
{
|
||||
private ?ClientEntity $_clientEntity = null;
|
||||
public function __construct(array|null $data = null)
|
||||
{
|
||||
parent::__construct($data);
|
||||
}
|
||||
|
||||
//고객정보객체
|
||||
final public function getClientUID(): int
|
||||
{
|
||||
return intval($this->attributes['clientinfo_uid']);
|
||||
}
|
||||
final public function getClient(): ClientEntity|null
|
||||
{
|
||||
return $this->_clientEntity;
|
||||
}
|
||||
final public function setClient(ClientEntity $clientEntity): void
|
||||
{
|
||||
$this->_clientEntity = $clientEntity;
|
||||
}
|
||||
//타 객체정의 부분
|
||||
}
|
||||
|
||||
@ -8,4 +8,6 @@ class PointEntity extends CustomerEntity
|
||||
{
|
||||
const PK = PointModel::PK;
|
||||
const TITLE = PointModel::TITLE;
|
||||
//고객정보객체-상속
|
||||
//타 객체정의 부분
|
||||
}
|
||||
|
||||
@ -2,16 +2,29 @@
|
||||
|
||||
namespace App\Entities\Customer;
|
||||
|
||||
use App\Entities\Customer\ClientEntity;
|
||||
use App\Models\Customer\ServiceModel;
|
||||
|
||||
class ServiceEntity extends CustomerEntity
|
||||
{
|
||||
const PK = ServiceModel::PK;
|
||||
const TITLE = ServiceModel::TITLE;
|
||||
private ?ClientEntity $_ownerEntity = null;
|
||||
//고객정보객체-상속
|
||||
//관리자정보객체
|
||||
final public function getOwnerUID(): int
|
||||
{
|
||||
return intval($this->attributes['ownerinfo_uid']);
|
||||
}
|
||||
final public function getOwner(): ClientEntity|null
|
||||
{
|
||||
return $this->_ownerEntity;
|
||||
}
|
||||
final public function setOwner(ClientEntity $ownerEntity): void
|
||||
{
|
||||
$this->_ownerEntity = $ownerEntity;
|
||||
}
|
||||
//타 객체정의 부분
|
||||
public function getCode(): string
|
||||
{
|
||||
return $this->attributes['code'];
|
||||
@ -20,7 +33,6 @@ class ServiceEntity extends CustomerEntity
|
||||
{
|
||||
return $this->attributes['billing_at'];
|
||||
}
|
||||
|
||||
public function getItemEntities(string $type): array
|
||||
{
|
||||
return $this->attributes[$type] ?? [];
|
||||
|
||||
@ -2,14 +2,26 @@
|
||||
|
||||
namespace App\Entities\Customer;
|
||||
|
||||
use App\Entities\Customer\ServiceEntity;
|
||||
use App\Models\Customer\ServiceHistoryModel;
|
||||
|
||||
class ServiceHistoryEntity extends CustomerEntity
|
||||
{
|
||||
const PK = ServiceHistoryModel::PK;
|
||||
const TITLE = ServiceHistoryModel::TITLE;
|
||||
private ?ServiceEntity $_serviceEntity = null;
|
||||
//서비스정보객체
|
||||
public function getServiceUid(): int
|
||||
{
|
||||
return intval($this->attributes['serviceinfo_uid']);
|
||||
}
|
||||
final public function getService(): ServiceEntity|null
|
||||
{
|
||||
return $this->_serviceEntity;
|
||||
}
|
||||
final public function setService(ServiceEntity $serviceEntity): void
|
||||
{
|
||||
$this->_serviceEntity = $serviceEntity;
|
||||
}
|
||||
//타 객체정의 부분
|
||||
}
|
||||
|
||||
@ -2,16 +2,29 @@
|
||||
|
||||
namespace App\Entities\Customer;
|
||||
|
||||
use App\Entities\Customer\ServiceEntity;
|
||||
use App\Models\Customer\ServiceItemModel;
|
||||
|
||||
class ServiceItemEntity extends CustomerEntity
|
||||
{
|
||||
const PK = ServiceItemModel::PK;
|
||||
const TITLE = ServiceItemModel::TITLE;
|
||||
public function getServiceUid(): int
|
||||
private ?ServiceEntity $_serviceEntity = null;
|
||||
//서비스정보객체
|
||||
final public function getServiceUid(): int
|
||||
{
|
||||
return intval($this->attributes['serviceinfo_uid']);
|
||||
}
|
||||
final public function getService(): ServiceEntity|null
|
||||
{
|
||||
return $this->_serviceEntity;
|
||||
}
|
||||
final public function setService(ServiceEntity $serviceEntity): void
|
||||
{
|
||||
$this->_serviceEntity = $serviceEntity;
|
||||
}
|
||||
//타 객체정의 부분
|
||||
|
||||
public function getItemType(): string
|
||||
{
|
||||
return $this->attributes['item_type'];
|
||||
@ -38,7 +51,7 @@ class ServiceItemEntity extends CustomerEntity
|
||||
}
|
||||
public function getView_Sale(): string
|
||||
{
|
||||
return $this->getPrice() > $this->getAmount() ? "" : ICONS['SALE'];
|
||||
return $this->getPrice() > $this->getAmount() ? "" : ICONS['SALE_DOWN'];
|
||||
}
|
||||
public function getView_BillingCycle(): string
|
||||
{
|
||||
|
||||
@ -2,6 +2,7 @@
|
||||
|
||||
namespace App\Entities\Customer;
|
||||
|
||||
use App\Entities\Customer\ServiceEntity;
|
||||
use App\Models\Customer\ServicePaymentModel;
|
||||
use DateTime;
|
||||
|
||||
@ -9,10 +10,36 @@ class ServicePaymentEntity extends CustomerEntity
|
||||
{
|
||||
const PK = ServicePaymentModel::PK;
|
||||
const TITLE = ServicePaymentModel::TITLE;
|
||||
public function getServiceUid(): int
|
||||
private ?ServiceEntity $_serviceEntity = null;
|
||||
private ?ClientEntity $_ownerEntity = null;
|
||||
//고객정보객체-상속
|
||||
//서비스정보객체
|
||||
final public function getServiceUid(): int
|
||||
{
|
||||
return intval($this->attributes['serviceinfo_uid']);
|
||||
}
|
||||
final public function getService(): ServiceEntity|null
|
||||
{
|
||||
return $this->_serviceEntity;
|
||||
}
|
||||
final public function setService(ServiceEntity $serviceEntity): void
|
||||
{
|
||||
$this->_serviceEntity = $serviceEntity;
|
||||
}
|
||||
//관리자정보객체
|
||||
final public function getOwnerUID(): int
|
||||
{
|
||||
return intval($this->attributes['ownerinfo_uid']);
|
||||
}
|
||||
final public function getOwner(): ClientEntity|null
|
||||
{
|
||||
return $this->_ownerEntity;
|
||||
}
|
||||
final public function setOwner(ClientEntity $ownerEntity): void
|
||||
{
|
||||
$this->_ownerEntity = $ownerEntity;
|
||||
}
|
||||
//타 객체정의 부분
|
||||
public function getItemType(): string
|
||||
{
|
||||
return $this->attributes['item_type'];
|
||||
@ -32,16 +59,20 @@ class ServicePaymentEntity extends CustomerEntity
|
||||
}
|
||||
public function getView_CounDueAt(): string
|
||||
{
|
||||
$now = new DateTime(); // 오늘 날짜
|
||||
$due = new DateTime($this->getBillingAt());
|
||||
if ($due < $now) {
|
||||
$interval = $due->diff($now);
|
||||
return "{$interval->days}일 전";
|
||||
} else if ($due > $now) {
|
||||
$interval = $now->diff($due);
|
||||
return "{$interval->days}일 남음";
|
||||
} else {
|
||||
return "당일";
|
||||
$result = "";
|
||||
if ($this->getStatus() === DEFAULTS['STATUS']) {
|
||||
$now = new DateTime(); // 오늘 날짜
|
||||
$due = new DateTime($this->getBillingAt());
|
||||
if ($due < $now) {
|
||||
$interval = $due->diff($now);
|
||||
$result = "{$interval->days}일전";
|
||||
} else if ($due > $now) {
|
||||
$interval = $now->diff($due);
|
||||
$result = "{$interval->days}일후";
|
||||
} else {
|
||||
$result = "당일";
|
||||
}
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
}
|
||||
|
||||
@ -357,7 +357,7 @@ class CommonHelper
|
||||
// echo current_url() . '/' . $action . '?' . $this->request->getUri()->getQuery();
|
||||
$extras = ["class" => "btn btn-outline btn-primary btn-circle", "target" => "_self", ...$extras];
|
||||
$action = form_label(
|
||||
'입력',
|
||||
ICONS['ADD'],
|
||||
$action,
|
||||
[
|
||||
"data-src" => current_url() . '/' . $action . '?' . $this->request->getUri()->getQuery(),
|
||||
|
||||
@ -113,7 +113,7 @@ class ServiceHelper extends CustomerHelper
|
||||
case 'history':
|
||||
$extras = ["class" => "btn btn-outline btn-primary btn-circle", "target" => "_self", ...$extras];
|
||||
$action = form_label(
|
||||
ICONS['PLAY'],
|
||||
ICONS['HISTORY'],
|
||||
$action,
|
||||
[
|
||||
"data-src" => "/admin/customer/servicehistory?serviceinfo_uid={$viewDatas['entity']->getPK()}",
|
||||
|
||||
@ -72,7 +72,7 @@ class ServicePaymentHelper extends CustomerHelper
|
||||
public function getFieldView(string $field, mixed $value, array $viewDatas, array $extras = []): string|null
|
||||
{
|
||||
switch ($field) {
|
||||
case "due_at":
|
||||
case "countdown": //결제일Countdown
|
||||
$value = $viewDatas['entity']->getView_CounDueAt();
|
||||
break;
|
||||
default:
|
||||
@ -85,4 +85,64 @@ class ServicePaymentHelper extends CustomerHelper
|
||||
}
|
||||
return $value;
|
||||
}
|
||||
public function getListButton(string $action, array $viewDatas, array $extras = []): string
|
||||
{
|
||||
switch ($action) {
|
||||
case 'modify':
|
||||
$checkbox = '';
|
||||
//상태가 미지급이 경우만 checkbox를 표시
|
||||
if ($viewDatas['entity']->getStatus() === DEFAULTS['STATUS']) {
|
||||
$oldBatchJobUids = old("batchjob_uids", null);
|
||||
$oldBatchJobUids = is_array($oldBatchJobUids) ? $oldBatchJobUids : [$oldBatchJobUids];
|
||||
$checkbox = form_checkbox([
|
||||
"id" => "checkbox_uid_{$viewDatas['entity']->getPK()}",
|
||||
"name" => "batchjob_uids[]",
|
||||
"value" => $viewDatas['entity']->getPK(),
|
||||
"class" => "batchjobuids_checkboxs",
|
||||
"checked" => in_array($viewDatas['entity']->getPK(), $oldBatchJobUids)
|
||||
]);
|
||||
}
|
||||
$action = $checkbox . form_label(
|
||||
$viewDatas['cnt'],
|
||||
$action,
|
||||
[
|
||||
"data-src" => current_url() . '/' . $action . '/' . $viewDatas['entity']->getPK() . '?' . $this->request->getUri()->getQuery(),
|
||||
"data-bs-toggle" => "modal",
|
||||
"data-bs-target" => "#index_action_form",
|
||||
...$extras
|
||||
]
|
||||
);
|
||||
break;
|
||||
case 'invoice_email':
|
||||
$extras = ["class" => "btn btn-outline btn-success btn-circle", "target" => "_self", ...$extras];
|
||||
$action = form_label(
|
||||
ICONS['MAIL'],
|
||||
$action,
|
||||
[
|
||||
"data-src" => "/admin/customer/payment/invoice?ActionTemplate=email",
|
||||
"data-bs-toggle" => "modal",
|
||||
"data-bs-target" => "#index_action_form",
|
||||
...$extras
|
||||
]
|
||||
);
|
||||
break;
|
||||
case 'invoice_mobile':
|
||||
$extras = ["class" => "btn btn-outline btn-success btn-circle", "target" => "_self", ...$extras];
|
||||
$action = form_label(
|
||||
ICONS['PHONE'],
|
||||
$action,
|
||||
[
|
||||
"data-src" => "/admin/customer/payment/invoice?ActionTemplate=mobile",
|
||||
"data-bs-toggle" => "modal",
|
||||
"data-bs-target" => "#index_action_form",
|
||||
...$extras
|
||||
]
|
||||
);
|
||||
break;
|
||||
default:
|
||||
$action = parent::getListButton($action, $viewDatas, $extras);
|
||||
break;
|
||||
}
|
||||
return $action;
|
||||
}
|
||||
}
|
||||
|
||||
@ -10,7 +10,7 @@ return [
|
||||
'switch' => "스위치코드",
|
||||
'code' => "서버코드",
|
||||
'raid' => "RAID",
|
||||
'billing_at' => "청구일",
|
||||
'billing_at' => "납부기한",
|
||||
'start_at' => "개통일",
|
||||
'status' => "상태",
|
||||
'updated_at' => "수정일",
|
||||
|
||||
@ -5,7 +5,7 @@ return [
|
||||
'serviceinfo_uid' => "서비스명",
|
||||
'item_type' => "항목형식",
|
||||
'item_uid' => "항목",
|
||||
'billing_cycle' => "청구방식",
|
||||
'billing_cycle' => "납부방식",
|
||||
'price' => "소비자금액",
|
||||
'amount' => "서비스금액",
|
||||
'start_at' => "개통일",
|
||||
|
||||
@ -4,17 +4,17 @@ return [
|
||||
'label' => [
|
||||
'serviceinfo_uid' => "서비스명",
|
||||
'ownerinfo_uid' => "관리자",
|
||||
'item_type' => "항목형식",
|
||||
'item_type' => "항목종류",
|
||||
'item_uid' => "항목",
|
||||
'billing_cycle' => "청구방식",
|
||||
'billing_cycle' => "납부방식",
|
||||
'amount' => "결제금액",
|
||||
'billing_at' => "지급기한일",
|
||||
'billing_at' => "납부기한",
|
||||
'issue_at' => "발행일",
|
||||
'status' => "상태",
|
||||
'updated_at' => "수정일",
|
||||
'created_at' => "신청일",
|
||||
'deleted_at' => "삭제일",
|
||||
'due_at' => "결제일",
|
||||
'countdown' => "납부기간",
|
||||
"LINE" => "라인",
|
||||
"IP" => "IP주소",
|
||||
"SERVER" => "서버",
|
||||
@ -48,6 +48,5 @@ return [
|
||||
"STATUS" => [
|
||||
'default' => "미지급",
|
||||
"paid" => "지급완료",
|
||||
"delete" => "삭제",
|
||||
],
|
||||
];
|
||||
|
||||
@ -58,25 +58,36 @@ abstract class CommonService
|
||||
}
|
||||
return $this->_model;
|
||||
}
|
||||
final public function getEntity(mixed $where, ?string $message = null): mixed
|
||||
//Entity의 관련객체정의용
|
||||
protected function setRelatedEntity(mixed $entity): mixed
|
||||
{
|
||||
return is_array($where) ? $this->getModel()->where($where)->first() : $this->getModel()->find($where);
|
||||
return $entity;
|
||||
}
|
||||
final public function getEntities(mixed $where = null, array $columns = ['*']): array
|
||||
public function getEntity(mixed $where, ?string $message = null): mixed
|
||||
{
|
||||
$entity = is_array($where) ? $this->getModel()->where($where)->first() : $this->getModel()->find($where);
|
||||
if (!$entity) {
|
||||
throw new \Exception($message ?? __METHOD__ . "에서 해당 정보가 존재하지 않습니다");
|
||||
}
|
||||
return $this->setRelatedEntity($entity);
|
||||
}
|
||||
public function getEntities(mixed $where = null, array $columns = ['*']): array
|
||||
{
|
||||
if ($where) {
|
||||
$this->getModel()->where($where);
|
||||
}
|
||||
$entitys = [];
|
||||
$entities = [];
|
||||
foreach ($this->getModel()->select(implode(',', $columns))->findAll() as $entity) {
|
||||
$entitys[$entity->getPK()] = $entity;
|
||||
$entitys[$entity->getPK()] = $this->setRelatedEntity($entity);
|
||||
}
|
||||
if (env('app.debug.index')) {
|
||||
echo $this->getModel()->getLastQuery() . "<BR>";
|
||||
// exit;
|
||||
}
|
||||
return $entitys;
|
||||
return $entities;
|
||||
} //
|
||||
//기본 기능부분
|
||||
|
||||
//FieldForm관련용
|
||||
public function getFormFieldRule(string $action, string $field): string
|
||||
{
|
||||
|
||||
@ -42,6 +42,15 @@ class AccountService extends CustomerService
|
||||
{
|
||||
return ['status'];
|
||||
}
|
||||
//Entity의 관련객체정의용
|
||||
protected function setRelatedEntity(mixed $entity): AccountEntity
|
||||
{
|
||||
//고객정보정의
|
||||
$entity->setClient($this->getClient($entity->getClientUID()));
|
||||
return $entity;
|
||||
}
|
||||
//기본 기능부분
|
||||
|
||||
//고객예치금처리
|
||||
private function setBalance(array $formDatas): ClientEntity
|
||||
{
|
||||
|
||||
@ -40,6 +40,8 @@ class ClientService extends CustomerService
|
||||
{
|
||||
return ['name', 'email', 'phone', 'role', 'account_balance', 'coupon_balance', 'point_balance', 'status'];
|
||||
}
|
||||
//기본 기능부분
|
||||
|
||||
//압금(쿠폰:추가)처리
|
||||
public function deposit(ClientEntity $entity, string $field, int $amount): ClientEntity
|
||||
{
|
||||
|
||||
@ -41,6 +41,15 @@ class CouponService extends CustomerService
|
||||
{
|
||||
return ['status'];
|
||||
}
|
||||
//Entity의 관련객체정의용
|
||||
protected function setRelatedEntity(mixed $entity): CouponEntity
|
||||
{
|
||||
//고객정보정의
|
||||
$entity->setClient($this->getClient($entity->getClientUID()));
|
||||
return $entity;
|
||||
}
|
||||
//기본 기능부분
|
||||
|
||||
//고객예치금처리
|
||||
private function setBalance(array $formDatas): ClientEntity
|
||||
{
|
||||
|
||||
@ -2,19 +2,20 @@
|
||||
|
||||
namespace App\Services\Customer;
|
||||
|
||||
use App\Entities\Customer\ClientEntity;
|
||||
use App\Services\CommonService;
|
||||
use CodeIgniter\HTTP\IncomingRequest;
|
||||
|
||||
use App\Services\Customer\ClientService;
|
||||
use App\Services\Equipment\DomainService;
|
||||
use App\Services\Equipment\Part\CpuService;
|
||||
use App\Services\Equipment\Part\DefenceService;
|
||||
use App\Services\Equipment\Part\StorageService;
|
||||
use App\Services\Equipment\Part\IpService;
|
||||
use App\Services\Equipment\Part\LineService;
|
||||
use App\Services\Equipment\Part\RamService;
|
||||
use App\Services\Equipment\Part\SoftwareService;
|
||||
use App\Services\Equipment\Part\StorageService;
|
||||
use App\Services\Equipment\ServerService;
|
||||
use App\Services\Equipment\DomainService;
|
||||
use CodeIgniter\HTTP\IncomingRequest;
|
||||
|
||||
abstract class CustomerService extends CommonService
|
||||
{
|
||||
@ -71,4 +72,13 @@ abstract class CustomerService extends CommonService
|
||||
}
|
||||
return $this->_equipmentService[$key];
|
||||
}
|
||||
//기본기능
|
||||
final public function getClient(int $uid): ClientEntity
|
||||
{
|
||||
$entity = $this->getClientService()->getEntity($uid);
|
||||
if (!$entity) {
|
||||
throw new \Exception("{$uid}에 해당하는 고객/관리자 정보가 존재하지 않습니다. uid: {$uid}");
|
||||
}
|
||||
return $entity;
|
||||
}
|
||||
}
|
||||
|
||||
@ -41,6 +41,15 @@ class PointService extends CustomerService
|
||||
{
|
||||
return ['status'];
|
||||
}
|
||||
//Entity의 관련객체정의용
|
||||
protected function setRelatedEntity(mixed $entity): PointEntity
|
||||
{
|
||||
//고객정보정의
|
||||
$entity->setClient($this->getClient($entity->getClientUID()));
|
||||
return $entity;
|
||||
}
|
||||
//기본 기능부분
|
||||
|
||||
private function setBalance(array $formDatas): ClientEntity
|
||||
{
|
||||
//point_balance 체크
|
||||
|
||||
@ -4,11 +4,13 @@ namespace App\Services\Customer;
|
||||
|
||||
use App\Entities\Customer\ServiceHistoryEntity;
|
||||
use App\Models\Customer\ServiceHistoryModel;
|
||||
use App\Services\Customer\ServiceService;
|
||||
use CodeIgniter\HTTP\IncomingRequest;
|
||||
|
||||
class ServiceHistoryService extends CustomerService
|
||||
{
|
||||
protected ?IncomingRequest $request = null;
|
||||
private ?ServiceService $_serviceService = null;
|
||||
public function __construct(?IncomingRequest $request = null)
|
||||
{
|
||||
parent::__construct($request);
|
||||
@ -22,6 +24,13 @@ class ServiceHistoryService extends CustomerService
|
||||
{
|
||||
return new ServiceHistoryEntity();
|
||||
}
|
||||
public function getServiceService(): ServiceService
|
||||
{
|
||||
if (!$this->_serviceService) {
|
||||
$this->_serviceService = new ServiceService($this->request);
|
||||
}
|
||||
return $this->_serviceService;
|
||||
}
|
||||
public function getFormFields(): array
|
||||
{
|
||||
return [
|
||||
@ -42,4 +51,12 @@ class ServiceHistoryService extends CustomerService
|
||||
{
|
||||
return ['serviceinfo_uid', 'title', 'status', 'created_at'];
|
||||
}
|
||||
//Entity의 관련객체정의용
|
||||
protected function setRelatedEntity(mixed $entity): ServiceHistoryEntity
|
||||
{
|
||||
//서비스정보정의
|
||||
$entity->setService($this->getClient($entity->getClientUID()));
|
||||
return $entity;
|
||||
}
|
||||
//기본 기능부분
|
||||
}
|
||||
|
||||
@ -64,14 +64,19 @@ class ServiceItemService extends CustomerService
|
||||
{
|
||||
return ['serviceinfo_uid', 'item_type', 'item_uid', 'billing_cycle', 'price', 'amount', 'start_at', 'updated_at', 'status'];
|
||||
}
|
||||
|
||||
//Entity의 관련객체정의용
|
||||
protected function setRelatedEntity(mixed $entity): ServiceItemEntity
|
||||
{
|
||||
//서비스정보정의
|
||||
$entity->setService($this->getClient($entity->getClientUID()));
|
||||
return $entity;
|
||||
}
|
||||
//기본 기능부분
|
||||
public function create(array $formDatas, mixed $entity = null): ServiceItemEntity
|
||||
{
|
||||
$entity = parent::create($formDatas, $entity);
|
||||
//결제방식이 ontime인경우에는 바로 결제정보 ServicePaymentService에 등록
|
||||
if ($entity->getBillingCycle() !== 'ontime') {
|
||||
$this->getServicePaymentService()->createPaymentByServiceItem($entity);
|
||||
}
|
||||
//결제정보 ServicePaymentService에 등록
|
||||
$this->getServicePaymentService()->createPaymentByServiceItem($entity);
|
||||
return $entity;
|
||||
}
|
||||
public function modify(mixed $entity, array $formDatas): ServiceItemEntity
|
||||
|
||||
@ -50,7 +50,7 @@ class ServicePaymentService extends CustomerService
|
||||
}
|
||||
public function getIndexFields(): array
|
||||
{
|
||||
return ['serviceinfo_uid', "ownerinfo_uid", 'item_type', 'item_uid', 'billing_cycle', 'amount', 'billing_at', 'issue_at', 'due_at', 'status'];
|
||||
return ['serviceinfo_uid', "ownerinfo_uid", 'item_type', 'item_uid', 'billing_cycle', 'amount', 'billing_at', 'issue_at', 'countdown', 'status'];
|
||||
}
|
||||
|
||||
public function getServiceService(): ServiceService
|
||||
@ -60,6 +60,16 @@ class ServicePaymentService extends CustomerService
|
||||
}
|
||||
return $this->_serviceService;
|
||||
}
|
||||
//Entity의 관련객체정의용
|
||||
protected function setRelatedEntity(mixed $entity): ServicePaymentEntity
|
||||
{
|
||||
//서비스정보정의
|
||||
$entity->setService($this->getClient($entity->getClientUID()));
|
||||
//관리자정보정의
|
||||
$entity->setOwner($this->getClient($entity->getOwnerUID()));
|
||||
return $entity;
|
||||
}
|
||||
//기본 기능부분
|
||||
|
||||
//ServiceItemService에서 사용
|
||||
public function createPaymentByServiceItem(ServiceItemEntity $serviceItemEntity): ServicePaymentEntity
|
||||
@ -76,7 +86,7 @@ class ServicePaymentService extends CustomerService
|
||||
'billing_cycle' => $serviceItemEntity->getBillingCycle(),
|
||||
'amount' => $serviceItemEntity->getAmount(),
|
||||
'billing_at' => $serviceEntity->getBillingAt(),
|
||||
'issue_at' => $serviceItemEntity->getBillingCycle() === 'onetime' ? date('Y-m-d') : $serviceEntity->getBillingAt(),
|
||||
'issue_at' => date('Y-m-d'),
|
||||
];
|
||||
return $this->create($formDatas);
|
||||
}
|
||||
|
||||
@ -8,6 +8,7 @@ use CodeIgniter\HTTP\IncomingRequest;
|
||||
|
||||
use App\Entities\Equipment\CodeEntity;
|
||||
use App\Services\Equipment\CodeService;
|
||||
use PhpOffice\PhpSpreadsheet\Calculation\Web\Service;
|
||||
|
||||
class ServiceService extends CustomerService
|
||||
{
|
||||
@ -54,7 +55,6 @@ class ServiceService extends CustomerService
|
||||
{
|
||||
return ['clientinfo_uid', 'ownerinfo_uid', 'title', 'type', 'location', 'switch', 'code', 'raid', 'billing_at', 'start_at', 'updated_at', 'status'];
|
||||
}
|
||||
|
||||
public function getCodeService(): CodeService
|
||||
{
|
||||
if (!$this->_codeService) {
|
||||
@ -62,6 +62,17 @@ class ServiceService extends CustomerService
|
||||
}
|
||||
return $this->_codeService;
|
||||
}
|
||||
//Entity의 관련객체정의용
|
||||
protected function setRelatedEntity(mixed $entity): ServiceEntity
|
||||
{
|
||||
//고객정보정의
|
||||
$entity->setClient($this->getClient($entity->getClientUID()));
|
||||
//관리자정보정의
|
||||
$entity->setOwner($this->getClient($entity->getOwnerUID()));
|
||||
return $entity;
|
||||
}
|
||||
//기본 기능부분
|
||||
|
||||
//다음 달로 결제일을 연장합니다.
|
||||
public function extendPaymentDate(ServiceEntity $entity): void
|
||||
{
|
||||
|
||||
76
app/Views/admin/payment/index.php
Normal file
76
app/Views/admin/payment/index.php
Normal file
@ -0,0 +1,76 @@
|
||||
<?= $this->extend(LAYOUTS[$viewDatas['layout']]['path']) ?>
|
||||
<?= $this->section('content') ?>
|
||||
<?php if ($error = session('error')): echo $viewDatas['helper']->alert($error) ?><?php endif ?>
|
||||
<div class="layout_top"><?= $this->include(LAYOUTS[$viewDatas['layout']]['path'] . '/top'); ?></div>
|
||||
<!-- Layout Middle Start -->
|
||||
<table class="layout_middle">
|
||||
<tr>
|
||||
<td class="layout_left">
|
||||
<!-- Layout Left Start -->
|
||||
<?= $this->include(LAYOUTS[$viewDatas['layout']]['path'] . '/left_menu'); ?>
|
||||
<!-- Layout Left End -->
|
||||
</td>
|
||||
<td class="layout_right">
|
||||
<!-- Layout Right Start -->
|
||||
<?= $this->include("templates/{$viewDatas['layout']}/index_header"); ?>
|
||||
<div id="container" class="layout_content">
|
||||
<link href="/css/<?= $viewDatas['layout'] ?>/index.css" media="screen" rel="stylesheet" type="text/css" />
|
||||
<div class="index_body">
|
||||
<?= $this->include("templates/{$viewDatas['layout']}/index_content_top"); ?>
|
||||
<?= form_open(current_url(), ['id' => 'batchjob_form', 'method' => "post"]) ?>
|
||||
<table class="index_table data table table-bordered table-hover table-striped" data-rtc-resizable-table="reisze_table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="index_head_short_column">번호</th>
|
||||
<?php foreach ($viewDatas['control']['index_fields'] as $field): ?>
|
||||
<th data-rtc-resizable="<?= $field ?>"><?= $viewDatas['helper']->getListLabel($field, $viewDatas) ?></th>
|
||||
<?php endforeach ?>
|
||||
<th class="index_head_short_column">작업</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php $cnt = 0 ?>
|
||||
<?php foreach ($viewDatas['entities'] as $entity): ?>
|
||||
<?php $viewDatas['entity'] = $entity; ?>
|
||||
<tr <?= $viewDatas['helper']->getListRowColor($entity) ?>>
|
||||
<?php $viewDatas['cnt'] = $viewDatas['total_count'] - (($viewDatas['page'] - 1) * $viewDatas['per_page'] + $cnt); ?>
|
||||
<td><?= $viewDatas['helper']->getListButton('modify', $viewDatas) ?></td>
|
||||
<?php foreach ($viewDatas['control']['index_fields'] as $field): ?>
|
||||
<td><?= $viewDatas['helper']->getFieldView($field, $entity->$field, $viewDatas) ?></td>
|
||||
<?php endforeach ?>
|
||||
<td nowrap>
|
||||
<?= $viewDatas['helper']->getListButton('view', $viewDatas) ?>
|
||||
<?= $viewDatas['helper']->getListButton('delete', $viewDatas) ?>
|
||||
</td>
|
||||
</tr>
|
||||
<?php $cnt++ ?>
|
||||
<?php endforeach ?>
|
||||
</tbody>
|
||||
</table>
|
||||
<div class="index_batchjob">
|
||||
<ul class="nav justify-content-center">
|
||||
<li class="nav-item"><?= form_checkbox(array("id" => "batchjobuids_checkbox")) ?>ALL</li>
|
||||
<?php foreach ($viewDatas['control']['batchjob_fields'] as $field): ?>
|
||||
<?= $viewDatas['helper']->getFieldForm($field, null, $viewDatas, ['data-batchjob' => 'true']) ?>
|
||||
<?php endforeach ?>
|
||||
<li class="nav-item"><?= $viewDatas['helper']->getListButton('batchjob', $viewDatas) ?></li>
|
||||
<li class="nav-item">청구서: </li>
|
||||
<li class="nav-item"><?= $viewDatas['helper']->getListButton('invoice_email', $viewDatas) ?></li>
|
||||
<li class="nav-item"><?= $viewDatas['helper']->getListButton('invoice_mobile', $viewDatas) ?></li>
|
||||
</ul>
|
||||
<div class=" index_pagination"><?= $viewDatas['pagination'] ?></div>
|
||||
</div>
|
||||
<?= $this->include("templates/{$viewDatas['layout']}/index_content_bottom_script"); ?>
|
||||
<?= form_close() ?>
|
||||
</div>
|
||||
<div class="index_bottom"><?= $this->include("templates/common/" . (isset($viewDatas['modal_type']) ? $viewDatas['modal_type'] : 'modal_iframe')); ?></div>
|
||||
<script type="text/javascript" src="/js/<?= $viewDatas['layout'] ?>/index.js"></script>
|
||||
</div>
|
||||
<div class="layout_footer"><?= $this->include("templates/{$viewDatas['layout']}/index_footer"); ?></div>
|
||||
<!-- Layout Right End -->
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<!-- Layout Middle End -->
|
||||
<div class="layout_bottom"><?= $this->include(LAYOUTS[$viewDatas['layout']]['path'] . '/bottom'); ?></div>
|
||||
<?= $this->endSection() ?>
|
||||
70
app/Views/admin/payment/invoice_email.php
Normal file
70
app/Views/admin/payment/invoice_email.php
Normal file
@ -0,0 +1,70 @@
|
||||
<?= $this->extend(LAYOUTS[$viewDatas['layout']]['path']) ?>
|
||||
<?= $this->section('content') ?>
|
||||
<div id="container" class="content">
|
||||
<link href="/css/<?= $viewDatas['layout'] ?>/form.css" media="screen" rel="stylesheet" type="text/css" />
|
||||
<div class="action_form">
|
||||
<!-- 청구서 정보 -->
|
||||
<table class="table table-bordered">
|
||||
<tbody>
|
||||
<tr>
|
||||
<th>메일 제목</th>
|
||||
<td colspan="3">서비스 요금 청구서 </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>발신자</th>
|
||||
<td><?= $viewDatas['helper']->getFieldView('site_email', $viewDatas) ?></td>
|
||||
<th>발행일</th>
|
||||
<td><?= date("Y-m-d") ?></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<!-- 서비스 테이블 -->
|
||||
<tr>
|
||||
<th>고객코드</th>
|
||||
<td><?= $viewDatas['helper']->getFieldView('ownerinfo_uid', $viewDatas) ?></td>
|
||||
<th>고객명</th>
|
||||
<td><?= $viewDatas['helper']->getFieldView('client_name', $viewDatas) ?></td>
|
||||
</tr>
|
||||
<table class="table table-bordered text-center align-middle">
|
||||
<thead class="table-light">
|
||||
<tr>
|
||||
<th>서비스 코드</th>
|
||||
<th>서비스 종류</th>
|
||||
<th>총 결제 금액</th>
|
||||
<th>납부 기한</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td><?= $viewDatas['helper']->getFieldView('service_title', $viewDatas) ?></td>
|
||||
<td><?= $viewDatas['helper']->getFieldView('service_type', $viewDatas) ?></td>
|
||||
<td class="fw-bold"><?= $viewDatas['helper']->getFieldView('total_amount', $viewDatas) ?>원</td>
|
||||
<td><?= $viewDatas['helper']->getFieldView('billing_at', $viewDatas) ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="4" class="text-start">
|
||||
<table class="table table-bordered text-center align-middle">
|
||||
<thead class="table-light">
|
||||
<tr>
|
||||
<?php foreach ($viewDatas['item_fields'] as $field): ?>
|
||||
<th><?= $viewDatas['helper']->getFieldLabel($field, $viewDatas) ?></th>
|
||||
<?php endforeach; ?>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php foreach ($viewDatas['entities'] as $entity): ?>
|
||||
<?php $viewDatas['entity'] = $entity; ?>
|
||||
<tr>
|
||||
<?php foreach ($viewDatas['item_fields'] as $field): ?>
|
||||
<td><?= $viewDatas['helper']->getFieldView($field, $viewDatas['entity']->$field, $viewDatas) ?></td>
|
||||
<?php endforeach; ?>
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
||||
</tbody>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
<?= $this->endSection() ?>
|
||||
@ -5,7 +5,24 @@
|
||||
<div id="container" class="layout_content">
|
||||
<link href="/css/<?= $viewDatas['layout'] ?>/index.css" media="screen" rel="stylesheet" type="text/css" />
|
||||
<div class="index_body">
|
||||
<?= $this->include("templates/{$viewDatas['layout']}/index_content_top_popup"); ?>
|
||||
<?= form_open(current_url(), ["method" => "get"]) ?>
|
||||
<nav class="index_top navbar navbar-expand-lg">
|
||||
<div class="container-fluid">
|
||||
<nav class="condition nav">
|
||||
조건:
|
||||
<?php foreach ($viewDatas['control']['filter_fields'] as $field): ?>
|
||||
<?= $viewDatas['helper']->getFieldForm($field, $viewDatas[$field] ? $viewDatas[$field] : old($field), $viewDatas) ?>
|
||||
<?php endforeach ?>
|
||||
<button class="btn btn-outline-primary" type="submit">검색</button>
|
||||
</nav>
|
||||
<nav class="pageinfo nav justify-content-end">
|
||||
Page:<?= $viewDatas['page'] ?>/<?= $viewDatas['total_page'] ?>
|
||||
<?= form_dropdown('per_page', $viewDatas['page_options'], $viewDatas['per_page'], ['onChange' => 'this.form.submit()']) ?>
|
||||
/ 총:<?= $viewDatas['total_count'] ?>
|
||||
</nav>
|
||||
</div>
|
||||
</nav>
|
||||
<?= form_close() ?>
|
||||
<?= form_open(current_url(), ['id' => 'batchjob_form', 'method' => "post"]) ?>
|
||||
<table class="index_table data table table-bordered table-hover table-striped" data-rtc-resizable-table="reisze_table">
|
||||
<thead>
|
||||
@ -36,7 +53,13 @@
|
||||
<?php endforeach ?>
|
||||
</tbody>
|
||||
</table>
|
||||
<?= $this->include("templates/{$viewDatas['layout']}/index_content_bottom_popup"); ?>
|
||||
<div class="index_batchjob">
|
||||
<ul class="nav justify-content-center">
|
||||
<li class="nav-item"><?= $viewDatas['helper']->getListButton('create', $viewDatas) ?></li>
|
||||
<li class="nav-item index_pagination"><?= $viewDatas['pagination'] ?></li>
|
||||
</ul>
|
||||
</div>
|
||||
<?= $this->include("templates/{$viewDatas['layout']}/index_content_bottom_script"); ?>
|
||||
<?= form_close() ?>
|
||||
</div>
|
||||
<div class="index_bottom"><?= $this->include("templates/common/" . (isset($viewDatas['modal_type']) ? $viewDatas['modal_type'] : 'modal_iframe')); ?></div>
|
||||
|
||||
@ -2,5 +2,5 @@
|
||||
<a href="/admin/user"><?= ICONS['MEMBER'] ?> 계정 관리</a>
|
||||
</div>
|
||||
<div class="accordion-item">
|
||||
<a href="/admin/mylog"><?= ICONS['FLAG'] ?> Log 관리</a>
|
||||
<a href="/admin/mylog"><?= ICONS['HISTORY'] ?> Log 관리</a>
|
||||
</div>
|
||||
@ -12,15 +12,15 @@
|
||||
<a href="/admin/customer/account"><?= ICONS['DEPOSIT'] ?> 예치금내역</a>
|
||||
</div>
|
||||
<div class="accordion-item">
|
||||
<a href="/admin/customer/coupon"><?= ICONS['CLOUD'] ?> 쿠폰내역</a>
|
||||
<a href="/admin/customer/coupon"><?= ICONS['COUPON'] ?> 쿠폰내역</a>
|
||||
</div>
|
||||
<div class="accordion-item">
|
||||
<a href="/admin/customer/point"><?= ICONS['FLAG'] ?> Point내역</a>
|
||||
<a href="/admin/customer/point"><?= ICONS['POINT'] ?> Point내역</a>
|
||||
</div>
|
||||
<div class="accordion-item">
|
||||
<a href="/admin/customer/service"><?= ICONS['CARD'] ?> 서비스내역</a>
|
||||
<a href="/admin/customer/service"><?= ICONS['SERVICE'] ?> 서비스내역</a>
|
||||
</div>
|
||||
<div class="accordion-item">
|
||||
<a href="/admin/customer/payment"><?= ICONS['CARD'] ?> 결제내역</a>
|
||||
<a href="/admin/customer/payment"><?= ICONS['PAYMENT'] ?> 결제내역</a>
|
||||
</div>
|
||||
</div>
|
||||
@ -1,38 +1,38 @@
|
||||
<h2 class="accordion-header">
|
||||
<button class="accordion-button collapsed" type="button" data-bs-toggle="collapse"
|
||||
data-bs-target="#flush-equipment" aria-expanded="true"
|
||||
aria-controls="flush-equipment"><b><?= ICONS['SETUP'] ?> 장비관리 </b>
|
||||
aria-controls="flush-equipment"><b><?= ICONS['DEVICE'] ?> 장비관리 </b>
|
||||
</button>
|
||||
</h2>
|
||||
<div id="flush-equipment" class="accordion-collapse collapse" aria-labelledby="flush-equipment">
|
||||
<div class="accordion-item">
|
||||
<a href="/admin/equipment/part/line"><?= ICONS['BOX'] ?>회선정보</a>
|
||||
</div>
|
||||
<div class="accordion-item">
|
||||
<a href="/admin/equipment/part/ip"><?= ICONS['DESKTOP'] ?>IP정보</a>
|
||||
</div>
|
||||
<div class="accordion-item">
|
||||
<a href="/admin/equipment/part/defence"><?= ICONS['SETUP'] ?>방어정보</a>
|
||||
</div>
|
||||
<div class="accordion-item">
|
||||
<a href="/admin/equipment/part/software"><?= ICONS['FLAG'] ?>Software정보</a>
|
||||
</div>
|
||||
<div class="accordion-item">
|
||||
<a href="/admin/equipment/domain"><?= ICONS['FLAG'] ?>도메인정보</a>
|
||||
</div>
|
||||
<div class="accordion-item">
|
||||
<a href="/admin/equipment/part/cpu"><?= ICONS['SETUP'] ?>CPU정보</a>
|
||||
</div>
|
||||
<div class="accordion-item">
|
||||
<a href="/admin/equipment/part/ram"><?= ICONS['SETUP'] ?>메모리정보</a>
|
||||
</div>
|
||||
<div class="accordion-item">
|
||||
<a href="/admin/equipment/part/storage"><?= ICONS['SETUP'] ?>저장장치정보</a>
|
||||
</div>
|
||||
<div class="accordion-item">
|
||||
<a href="/admin/equipment/code"><?= ICONS['SETUP'] ?>Code정보</a>
|
||||
</div>
|
||||
<div class="accordion-item">
|
||||
<a href="/admin/equipment/server"><?= ICONS['DESKTOP'] ?>Server정보</a>
|
||||
<a href="/admin/equipment/part/line"><?= ICONS['SERVICE_ITEM_LINE'] ?>회선정보</a>
|
||||
</div>
|
||||
<div class="accordion-item">
|
||||
<a href="/admin/equipment/part/ip"><?= ICONS['SERVICE_ITEM_IP'] ?>IP정보</a>
|
||||
</div>
|
||||
<div class="accordion-item">
|
||||
<a href="/admin/equipment/part/defence"><?= ICONS['SERVICE_ITEM_DEFENCE'] ?>방어정보</a>
|
||||
</div>
|
||||
<div class="accordion-item">
|
||||
<a href="/admin/equipment/part/software"><?= ICONS['SERVICE_ITEM_SOFTWARE'] ?>Software정보</a>
|
||||
</div>
|
||||
<div class="accordion-item">
|
||||
<a href="/admin/equipment/domain"><?= ICONS['SERVICE_ITEM_DOMAIN'] ?>도메인정보</a>
|
||||
</div>
|
||||
<div class="accordion-item">
|
||||
<a href="/admin/equipment/part/cpu"><?= ICONS['SERVICE_ITEM_CPU'] ?>CPU정보</a>
|
||||
</div>
|
||||
<div class="accordion-item">
|
||||
<a href="/admin/equipment/part/ram"><?= ICONS['SERVICE_ITEM_RAM'] ?>메모리정보</a>
|
||||
</div>
|
||||
<div class="accordion-item">
|
||||
<a href="/admin/equipment/part/storage"><?= ICONS['SERVICE_ITEM_STORAGE'] ?>저장장치정보</a>
|
||||
</div>
|
||||
<div class="accordion-item">
|
||||
<a href="/admin/equipment/server"><?= ICONS['SERVICE_ITEM_SERVER'] ?>Server정보</a>
|
||||
</div>
|
||||
</div>
|
||||
@ -1,56 +1,13 @@
|
||||
<div class="index_batchjob">
|
||||
<ul class="nav justify-content-center">
|
||||
<li class="nav-item"><?= $viewDatas['helper']->getListButton('create', $viewDatas) ?></li>
|
||||
<li class="nav-item"><?= form_checkbox(array("id" => "batchjobuids_checkbox")) ?>ALL</li>
|
||||
<?php foreach ($viewDatas['control']['batchjob_fields'] as $field): ?>
|
||||
<?= $viewDatas['helper']->getFieldForm($field, null, $viewDatas, ['data-batchjob' => 'true']) ?>
|
||||
<?php endforeach ?>
|
||||
<li class="nav-item"><?= $viewDatas['helper']->getListButton('batchjob', $viewDatas) ?></li>
|
||||
<li class="nav-item"><?= $viewDatas['helper']->getListButton('create', $viewDatas) ?></li>
|
||||
<li class="nav-item"><?= $viewDatas['helper']->getListButton('batchjob_delete', $viewDatas) ?></li>
|
||||
</ul>
|
||||
<div class=" index_pagination"><?= $viewDatas['pagination'] ?></div>
|
||||
</div>
|
||||
<script>
|
||||
//이 스크립트를 사용하려면 Form 안에 아래 Tag필요
|
||||
// <input type = "hidden"name = "batchjob_uids"id = "batchjob_uids"value = "" >
|
||||
function submitBatchJob() {
|
||||
var validate = false;
|
||||
//batchjob용 선택사항 검증
|
||||
<?php foreach ($viewDatas['control']['batchjob_fields'] as $field): ?>
|
||||
var element = document.querySelector('[name="<?= $field ?>"][data-batchjob="true"]');
|
||||
if (element && element.value !== "") {
|
||||
validate = true;
|
||||
}
|
||||
<?php endforeach ?>
|
||||
if (!validate) {
|
||||
alert('변경할 항목을 선택하셔야합니다.');
|
||||
return false;
|
||||
}
|
||||
//적용받는 uids가 한개라도 선택되었다면 true
|
||||
var batchjobUids = [];
|
||||
var checkboxes = document.querySelectorAll('input[name="batchjob_uids[]"]:checked');
|
||||
checkboxes.forEach(function(checkbox) {
|
||||
batchjobUids.push(checkbox.value);
|
||||
});
|
||||
if (batchjobUids.length === 0) {
|
||||
alert('적용할 리스트를 선택하셔야합니다.');
|
||||
return false;
|
||||
}
|
||||
document.getElementById('batchjob_uids').value = batchjobUids.join(',');
|
||||
return true;
|
||||
}
|
||||
|
||||
function submitBatchJobDelete() {
|
||||
var batchjobUids = [];
|
||||
var checkboxes = document.querySelectorAll('input[name="batchjob_uids[]"]:checked');
|
||||
checkboxes.forEach(function(checkbox) {
|
||||
batchjobUids.push(checkbox.value);
|
||||
});
|
||||
if (batchjobUids.length === 0) {
|
||||
alert('적용할 리스트를 선택하셔야합니다.');
|
||||
return false;
|
||||
}
|
||||
document.getElementById('batchjob_uids').value = batchjobUids.join(',');
|
||||
return true;
|
||||
}
|
||||
</script>
|
||||
<?= $this->include("templates/{$viewDatas['layout']}/index_content_bottom_script"); ?>
|
||||
@ -1,9 +1,3 @@
|
||||
<div class="index_batchjob">
|
||||
<ul class="nav justify-content-center">
|
||||
<li class="nav-item"><?= $viewDatas['helper']->getListButton('create', $viewDatas) ?></li>
|
||||
<li class="nav-item index_pagination"><?= $viewDatas['pagination'] ?></li>
|
||||
</ul>
|
||||
</div>
|
||||
<script>
|
||||
//이 스크립트를 사용하려면 Form 안에 아래 Tag필요
|
||||
// <input type = "hidden"name = "batchjob_uids"id = "batchjob_uids"value = "" >
|
||||
@ -1,18 +0,0 @@
|
||||
<?= form_open(current_url(), ["method" => "get"]) ?>
|
||||
<nav class="index_top navbar navbar-expand-lg">
|
||||
<div class="container-fluid">
|
||||
<nav class="condition nav">
|
||||
조건:
|
||||
<?php foreach ($viewDatas['control']['filter_fields'] as $field): ?>
|
||||
<?= $viewDatas['helper']->getFieldForm($field, $viewDatas[$field] ? $viewDatas[$field] : old($field), $viewDatas) ?>
|
||||
<?php endforeach ?>
|
||||
<button class="btn btn-outline-primary" type="submit">검색</button>
|
||||
</nav>
|
||||
<nav class="pageinfo nav justify-content-end">
|
||||
Page:<?= $viewDatas['page'] ?>/<?= $viewDatas['total_page'] ?>
|
||||
<?= form_dropdown('per_page', $viewDatas['page_options'], $viewDatas['per_page'], ['onChange' => 'this.form.submit()']) ?>
|
||||
/ 총:<?= $viewDatas['total_count'] ?>
|
||||
</nav>
|
||||
</div>
|
||||
</nav>
|
||||
<?= form_close() ?>
|
||||
Loading…
Reference in New Issue
Block a user