shoppingmallv2 init...

This commit is contained in:
최준흠git config git config --helpgit config --global user.name 최준흠 2023-08-11 21:28:12 +09:00
parent 3a1ecb92eb
commit 55ad4b8792
9 changed files with 109 additions and 13 deletions

View File

@ -133,6 +133,9 @@ $routes->group('admin', ['namespace' => 'App\Controllers\Admin', 'filter' => 'au
$routes->get('toggle/(:uuid)/(:hash)', 'OrderController::toggle/$1/$2');
$routes->post('batchjob', 'OrderController::batchjob`');
});
$routes->group('payment', static function ($routes) {
$routes->get('', 'PaymentController::index');
});
});
$routes->group('front', ['namespace' => 'App\Controllers\Front'], function ($routes) {
$routes->group('user', static function ($routes) {

View File

@ -0,0 +1,46 @@
<?php
namespace App\Controllers\Admin;
use App\Models\PaymentModel;
use CodeIgniter\HTTP\RequestInterface;
use CodeIgniter\HTTP\ResponseInterface;
use Psr\Log\LoggerInterface;
class PaymentController extends AdminController
{
public function initController(RequestInterface $request, ResponseInterface $response, LoggerInterface $logger)
{
$this->_model = new PaymentModel();
$this->_viewDatas['className'] = 'Payment';
parent::initController($request, $response, $logger);
$this->_viewPath .= strtolower($this->_viewDatas['className']);
}
final public function getFields(string $action = ""): array
{
switch ($action) {
case 'insert':
return ["TID", "ORDERNO", "AMOUNT", "QUOTA", "ACCEPTNO", "ACCEPTDATE", "RESULTCODE", "created_at"];
break;
case "index":
case "excel":
case "view":
return ["ORDERNO", "AMOUNT", "QUOTA", "ACCEPTNO", "ACCEPTDATE", "RESULTCODE", "created_at"];
break;
default:
return [];
break;
}
}
final public function getFieldFilters(): array
{
return [];
}
final public function getFieldBatchFilters(): array
{
return [];
}
//추가기능
}

View File

@ -137,9 +137,6 @@ function getFieldIndex_Row_CategoryHelper_Admin($field, $entity, array $viewData
{
$value = $entity->$field ?: DEFAULTS['EMPTY'];
switch ($field) {
case 'linkurl':
return sprintf("<td>%s<BR>%s</td>", $entity->getFileImage('middle', 'photo'), $value);
break;
case 'title':
case 'name':
$depth = "&nbsp;";
@ -158,6 +155,9 @@ function getFieldIndex_Row_CategoryHelper_Admin($field, $entity, array $viewData
);
return sprintf("<td class=\"title hierarchy\">%s%s %s</td>", $depth, $reply, $view);
break;
case 'linkurl':
return sprintf("<td>%s<BR>%s</td>", $entity->getFileImage('middle', 'photo'), $value);
break;
default:
if (in_array($field, $viewDatas['fieldFilters'])) {
$attributes["onChange"] = sprintf(

View File

@ -128,6 +128,7 @@ function getFieldIndex_Row_SitepageHelper($field, $entity, array $viewDatas): st
{
switch ($field) {
default:
//front쪽은 table을 사용하지 않음 주의
return getFieldView_SitepageHelper($field, $entity, $viewDatas);
break;
}
@ -148,7 +149,7 @@ function getFieldIndex_Row_SitepageHelper_Admin($field, $entity, array $viewData
);
return sprintf("<td>%s</td>", getFieldForm_SitepageHelper($field, $entity->$field, $viewDatas, $attributes));
}
return getFieldIndex_Row_SitepageHelper($field, $entity, $viewDatas);
return sprintf("<td>%s</td>", getFieldIndex_Row_SitepageHelper($field, $entity, $viewDatas));
break;
}
} //

View File

@ -0,0 +1,32 @@
<?= $this->extend('layouts/admin') ?>
<?= $this->section('content') ?>
<link href="/css/admin/content.css" media="screen" rel="stylesheet" type="text/css" />
<div id="content">
<div class="top">
<?= $this->include('templates/admin/index_head') ?>
</div>
<table class="table table-hover">
<thead>
<tr>
<th>번호</th>
<?php foreach ($viewDatas['fields'] as $field) : ?><?= getFieldIndex_Column_PaymentHelper($field, $viewDatas) ?><?php endforeach ?>
</tr>
</thead>
<tbody>
<?php $cnt = 0 ?>
<?php foreach ($viewDatas['entitys'] as $entity) : ?>
<tr id="<?= $entity->getPrimaryKey() ?>" <?= $entity->status != DEFAULTS['STATUS'] ? 'class="table-danger" rowcolor="red"' : 'rowcolor="red"' ?> onClick="indexRowCheckBoxToggle(this)">
<td nowrap>
<?= $viewDatas['total_count'] - (($viewDatas['page'] - 1) * $viewDatas['per_page'] + $cnt) ?>
</td>
<?php foreach ($viewDatas['fields'] as $field) : ?>
<?= getFieldIndex_Row_PaymentHelper_Admin($field, $entity, $viewDatas) ?>
<?php endforeach ?>
</tr>
<?php $cnt++ ?>
<?php endforeach ?>
</tbody>
</table>
<div class="bottom"><?= $viewDatas['pagination'] ?></div>
</div>
<?= $this->endSection() ?>

View File

@ -4,6 +4,13 @@
* Created : 2016/9/11 Tri-aBility by Junheum,Choi
* Updated :
------------------------------------------------------------ */
* {
margin:0px;
padding:0px;
border:0px;
font-size:12px;
font: Arial;
}
/* #head{
border:1px solid blue;

View File

@ -3,4 +3,12 @@
* Desc : Admin StyleSheet
* Created : 2016/9/11 Tri-aBility by Junheum,Choi
* Updated :
------------------------------------------------------------ */
------------------------------------------------------------ */
* {
margin:0px;
padding:0px;
border:0px;
font-size:14px;
font: Arial;
}

View File

@ -4,6 +4,13 @@
* Created : 2016/9/11 Tri-aBility by Junheum,Choi
* Updated :
------------------------------------------------------------ */
* {
margin:0px;
padding:0px;
border:0px;
font-size:14px;
font: Arial;
}
/* #head{
border:1px solid blue;

View File

@ -6,14 +6,6 @@
------------------------------------------------------------ */
@charset "utf-8";
* {
margin:0px;
padding:0px;
border:0px;
font-size:14px;
font: Arial;
}
body {
background-color: white;
}