shoppingmallv2 init...
This commit is contained in:
parent
4453dccacb
commit
333af5646b
@ -227,6 +227,7 @@ define('AUDIOS', [
|
||||
|
||||
//Default값 정의
|
||||
define('DEFAULTS', [
|
||||
'USER_CATEGORY' => getenv('default.user_category') ?: 12,
|
||||
'ROLE' => getenv('default.role') ?: "guest",
|
||||
'STATUS' => getenv('default.status') ?: "use",
|
||||
'EMPTY' => getenv('default.empty') ?: "",
|
||||
|
||||
@ -35,10 +35,6 @@ $routes->setAutoRoute(false);
|
||||
$routes->addPlaceholder('uuid', '[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}');
|
||||
|
||||
$routes->get('/', 'Home::index');
|
||||
$routes->get('/login', 'AuthController::login');
|
||||
$routes->post('/signup', 'AuthController::signup/local');
|
||||
$routes->get('/signup/(:alpha)', 'AuthController::signup/$1');
|
||||
$routes->get('/logout', 'AuthController::logout');
|
||||
$routes->group('cli', ['namespace' => 'App\Controllers\CLI'], function ($routes) {
|
||||
});
|
||||
$routes->group('ecommerce', ['namespace' => 'App\Controllers'], function ($routes) {
|
||||
@ -131,10 +127,16 @@ $routes->group('admin', ['namespace' => 'App\Controllers\Admin', 'filter' => 'au
|
||||
});
|
||||
});
|
||||
$routes->group('front', ['namespace' => 'App\Controllers\Front'], function ($routes) {
|
||||
$routes->group('user', ['namespace' => 'App\Controllers\Front', 'filter' => 'authFilter:user'], static function ($routes) {
|
||||
$routes->get('', 'UserController::index');
|
||||
$routes->get('update', 'UserController::update_form');
|
||||
$routes->post('update', 'UserController::update');
|
||||
$routes->group('user', static function ($routes) {
|
||||
$routes->get('', 'UserController::index', ['filter' => 'authFilter:user']);
|
||||
$routes->get('insert', 'UserController::insert_form');
|
||||
$routes->post('insert', 'UserController::insert');
|
||||
$routes->get('update/(:uuid)', 'UserController::update_form/$1', ['filter' => 'authFilter:user']);
|
||||
$routes->post('update/(:uuid)', 'UserController::update/$1', ['filter' => 'authFilter:user']);
|
||||
$routes->get('login', 'UserController::login_form');
|
||||
$routes->post('login', 'UserController::login/local');
|
||||
$routes->get('signup/(:alpha)', 'UserController::login/$1');
|
||||
$routes->get('logout', 'UserController::logout', ['filter' => 'authFilter:user']);
|
||||
});
|
||||
$routes->group('board', static function ($routes) {
|
||||
$routes->get('', 'BoardController::index');
|
||||
|
||||
@ -1,102 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace App\Controllers;
|
||||
|
||||
use App\Libraries\Adapter\Auth\Adapter;
|
||||
use CodeIgniter\Controller;
|
||||
use CodeIgniter\HTTP\CLIRequest;
|
||||
use CodeIgniter\HTTP\IncomingRequest;
|
||||
use CodeIgniter\HTTP\RequestInterface;
|
||||
use CodeIgniter\HTTP\ResponseInterface;
|
||||
use Psr\Log\LoggerInterface;
|
||||
|
||||
|
||||
class AuthController extends Controller
|
||||
{
|
||||
/**
|
||||
* Instance of the main Request object.
|
||||
*
|
||||
* @var CLIRequest|IncomingRequest
|
||||
*/
|
||||
protected $request;
|
||||
|
||||
/**
|
||||
* An array of helpers to be loaded automatically upon
|
||||
* class instantiation. These helpers will be available
|
||||
* to all other controllers that extend BaseController.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $helpers = ['Common'];
|
||||
|
||||
/**
|
||||
* Be sure to declare properties for any property fetch you initialized.
|
||||
* The creation of dynamic property is deprecated in PHP 8.2.
|
||||
*/
|
||||
// protected $session;
|
||||
|
||||
/**
|
||||
* Constructor.
|
||||
*/
|
||||
private $_session = null;
|
||||
private $_viewDatas = array();
|
||||
private $_adapters = array();
|
||||
public function initController(RequestInterface $request, ResponseInterface $response, LoggerInterface $logger)
|
||||
{
|
||||
parent::initController($request, $response, $logger);
|
||||
$this->_session = \Config\Services::session();
|
||||
$this->_viewDatas['title'] = 'Auth';
|
||||
$this->_viewDatas['layout'] = LAYOUTS['empty'];
|
||||
$this->_viewDatas['session'] = $this->_session;
|
||||
$this->initAdapters();
|
||||
}
|
||||
|
||||
private function initAdapters()
|
||||
{
|
||||
foreach (array_keys(AUTH_ADAPTERS) as $adapter) {
|
||||
$this->getAdapter($adapter);
|
||||
}
|
||||
}
|
||||
private function getAdapter(string $site): Adapter
|
||||
{
|
||||
$site = ucfirst($site);
|
||||
if (!array_key_exists($site, $this->_adapters)) {
|
||||
$adapterClass = sprintf("\App\Libraries\Adapter\Auth\%sAdapter", $site);
|
||||
$this->_adapters[$site] = new $adapterClass($site, AUTH_ADAPTERS[$site]['DEBUG']);
|
||||
}
|
||||
return $this->_adapters[$site];
|
||||
}
|
||||
|
||||
public function login()
|
||||
{
|
||||
foreach ($this->_adapters as $key => $adapter) {
|
||||
$this->_viewDatas['login_buttons'][$key] = $adapter->getAuthButton();
|
||||
}
|
||||
$this->_viewDatas['forms'] = ['attributes' => ['method' => "post",], 'hiddens' => []];
|
||||
helper(['form']);
|
||||
$this->_session->keepFlashdata(SESSION_NAMES['RETURN_URL']);
|
||||
return view('auth/login', ['viewDatas' => $this->_viewDatas]);
|
||||
}
|
||||
|
||||
public function signup(string $site)
|
||||
{
|
||||
try {
|
||||
//각 Adapter별 인층체크 후 Session에 인증정보 설정
|
||||
$this->getAdapter($site)->signup($this->request->getVar());
|
||||
return redirect()->to($this->_session->getFlashdata(SESSION_NAMES['RETURN_URL']) ?: "/");
|
||||
} catch (\Exception $e) {
|
||||
$this->_session->setFlashdata('return_message', $e->getMessage());
|
||||
$this->_session->keepFlashdata(SESSION_NAMES['RETURN_URL']);
|
||||
return redirect()->back()->withInput();
|
||||
}
|
||||
}
|
||||
|
||||
public function logout()
|
||||
{
|
||||
//로그인 여부 확인후 Session에 Login 정보 삭제
|
||||
if ($this->_session->get(SESSION_NAMES['ISLOGIN'])) {
|
||||
session_destroy();
|
||||
}
|
||||
return redirect()->route('/');
|
||||
}
|
||||
}
|
||||
@ -40,6 +40,13 @@ class BoardController extends FrontController
|
||||
return parent::getFieldBatchFilters();
|
||||
}
|
||||
|
||||
//권한체크
|
||||
protected function isRole($action)
|
||||
{
|
||||
$this->_category = $this->request->getVar('category') ?: throw new \Exception("분류를 지정하지 않으셨습니다.");
|
||||
parent::isRole($action);
|
||||
}
|
||||
|
||||
//Insert관련
|
||||
protected function insert_form_process()
|
||||
{
|
||||
|
||||
@ -28,7 +28,7 @@ abstract class FrontController extends BaseController
|
||||
//권한체크
|
||||
protected function isRole($action)
|
||||
{
|
||||
$this->_category = $this->request->getVar('category') ?: throw new \Exception("분류를 지정하지 않으셨습니다.");
|
||||
$this->_category ?: throw new \Exception("분류를 지정하지 않으셨습니다.");
|
||||
$this->_viewDatas['category'] = $this->getCategoryModel()->getEntity([$this->getCategoryModel()->getPrimaryKey() => $this->_category]);
|
||||
$this->_viewDatas['parent_category'] = $this->getCategoryModel()->getEntity([$this->getCategoryModel()->getPrimaryKey() => $this->_viewDatas['category']->getHierarchy_ParentUID()]);
|
||||
switch ($action) {
|
||||
|
||||
@ -14,6 +14,9 @@ class OrderController extends FrontController
|
||||
$this->_model = new OrderModel($this->getFields());
|
||||
parent::initController($request, $response, $logger);
|
||||
$this->_viewPath .= strtolower($this->_model->getClassName());
|
||||
//Default 회원정보 Category
|
||||
$this->_category = DEFAULTS['USER_CATEGORY'];
|
||||
$this->isRole('index');
|
||||
}
|
||||
|
||||
final public function getFields(string $action = ""): array
|
||||
|
||||
@ -39,6 +39,13 @@ class ProductController extends FrontController
|
||||
{
|
||||
return parent::getFieldBatchFilters();
|
||||
}
|
||||
|
||||
//권한체크
|
||||
protected function isRole($action)
|
||||
{
|
||||
$this->_category = $this->request->getVar('category') ?: throw new \Exception("분류를 지정하지 않으셨습니다.");
|
||||
parent::isRole($action);
|
||||
}
|
||||
//View관련
|
||||
protected function view_process($entity)
|
||||
{
|
||||
|
||||
@ -2,6 +2,7 @@
|
||||
|
||||
namespace App\Controllers\Front;
|
||||
|
||||
use App\Libraries\Adapter\Auth\Adapter;
|
||||
use App\Models\UserModel;
|
||||
use CodeIgniter\HTTP\RequestInterface;
|
||||
use CodeIgniter\HTTP\ResponseInterface;
|
||||
@ -9,11 +10,33 @@ use Psr\Log\LoggerInterface;
|
||||
|
||||
class UserController extends FrontController
|
||||
{
|
||||
private $_adapters = array();
|
||||
public function initController(RequestInterface $request, ResponseInterface $response, LoggerInterface $logger)
|
||||
{
|
||||
$this->_model = new UserModel();
|
||||
parent::initController($request, $response, $logger);
|
||||
$this->_viewPath .= strtolower($this->_model->getClassName());
|
||||
|
||||
$this->initAdapters();
|
||||
//Default 회원정보 Category
|
||||
$this->_category = DEFAULTS['USER_CATEGORY'];
|
||||
$this->isRole('index');
|
||||
}
|
||||
|
||||
private function initAdapters()
|
||||
{
|
||||
foreach (array_keys(AUTH_ADAPTERS) as $adapter) {
|
||||
$this->getAdapter($adapter);
|
||||
}
|
||||
}
|
||||
private function getAdapter(string $site): Adapter
|
||||
{
|
||||
$site = ucfirst($site);
|
||||
if (!array_key_exists($site, $this->_adapters)) {
|
||||
$adapterClass = sprintf("\App\Libraries\Adapter\Auth\%sAdapter", $site);
|
||||
$this->_adapters[$site] = new $adapterClass($site, AUTH_ADAPTERS[$site]['DEBUG']);
|
||||
}
|
||||
return $this->_adapters[$site];
|
||||
}
|
||||
|
||||
//Field별 Form Datas 처리용
|
||||
@ -33,8 +56,13 @@ class UserController extends FrontController
|
||||
|
||||
public function getFields(string $action = ""): array
|
||||
{
|
||||
$fields = ["id", "passwd", 'name', "email", "phone", "mobile",];
|
||||
switch ($action) {
|
||||
case 'insert':
|
||||
return ["id", "passwd", 'name', "email", "phone", "mobile"];
|
||||
break;
|
||||
case 'update':
|
||||
return ["passwd", 'name', "email", "phone", "mobile"];
|
||||
break;
|
||||
case "index":
|
||||
case "excel":
|
||||
return ["id", 'name', "email", "phone", "mobile", 'created_at'];
|
||||
@ -43,7 +71,7 @@ class UserController extends FrontController
|
||||
return ["id", 'name', "email", "phone", "mobile", 'updated_at', 'created_at'];
|
||||
break;
|
||||
default:
|
||||
return $fields;
|
||||
return throw new \Exception("{$action} 해당기능은 없습니다.");
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -55,37 +83,54 @@ class UserController extends FrontController
|
||||
{
|
||||
return parent::getFieldBatchFilters();
|
||||
}
|
||||
//권한체크
|
||||
protected function isRole($action, $entity = null)
|
||||
|
||||
//Insert관련
|
||||
protected function insert_process()
|
||||
{
|
||||
$this->_category = $this->request->getVar('category') ?: $entity->category_uid;
|
||||
parent::isRole($action, $entity);
|
||||
}
|
||||
//Update관련
|
||||
protected function update_form_process($entity)
|
||||
{
|
||||
//권한체크
|
||||
$this->isRole('update');
|
||||
$entity = parent::update_form_process($entity);
|
||||
$this->_viewDatas['forms'] = ['attributes' => ['method' => "post",], 'hiddens' => [
|
||||
'category' => $this->_category
|
||||
]];
|
||||
return $entity;
|
||||
//Role이 반드시 있어야 하기때문에
|
||||
$this->_viewDatas['fieldDatas']['role'] = DEFAULTS['ROLE'] . ',user';
|
||||
return parent::insert_process();
|
||||
}
|
||||
|
||||
//Index관련
|
||||
protected function index_process()
|
||||
{
|
||||
//권한체크
|
||||
$this->isRole('index');
|
||||
parent::index_process();
|
||||
$this->_viewDatas['forms'] = ['attributes' => ['method' => "post",], 'hiddens' => [
|
||||
'category' => $this->_category
|
||||
]];
|
||||
}
|
||||
//사용자 UID 조건추가
|
||||
protected function index_setCondition()
|
||||
{
|
||||
$this->_model->where("uid", $this->_viewDatas['auth'][AUTH_FIELDS['ID']]);
|
||||
parent::index_setCondition();
|
||||
}
|
||||
|
||||
//추가기능
|
||||
public function login_form()
|
||||
{
|
||||
foreach ($this->_adapters as $key => $adapter) {
|
||||
$this->_viewDatas['login_buttons'][$key] = $adapter->getAuthButton();
|
||||
}
|
||||
$this->_viewDatas['forms'] = ['attributes' => ['method' => "post",], 'hiddens' => []];
|
||||
helper(['form']);
|
||||
$this->_session->keepFlashdata(SESSION_NAMES['RETURN_URL']);
|
||||
return view($this->_viewPath . '/login' . $this->request->getVar('v') ?: '', ['viewDatas' => $this->_viewDatas]);
|
||||
}
|
||||
|
||||
public function login(string $site)
|
||||
{
|
||||
try {
|
||||
//각 Adapter별 인층체크 후 Session에 인증정보 설정
|
||||
$this->getAdapter($site)->signup($this->request->getVar());
|
||||
return redirect()->to($this->_session->getFlashdata(SESSION_NAMES['RETURN_URL']) ?: "/");
|
||||
} catch (\Exception $e) {
|
||||
$this->_session->setFlashdata('return_message', $e->getMessage());
|
||||
$this->_session->keepFlashdata(SESSION_NAMES['RETURN_URL']);
|
||||
return redirect()->back()->withInput();
|
||||
}
|
||||
}
|
||||
|
||||
public function logout()
|
||||
{
|
||||
//로그인 여부 확인후 Session에 Login 정보 삭제
|
||||
if ($this->_session->get(SESSION_NAMES['ISLOGIN'])) {
|
||||
session_destroy();
|
||||
}
|
||||
return redirect()->route('/');
|
||||
}
|
||||
}
|
||||
|
||||
@ -30,7 +30,7 @@ class AuthFilter implements FilterInterface
|
||||
$auth = session()->get(SESSION_NAMES['AUTH']);
|
||||
// 회원 ROLES이 필요ROLE($arguments[0]) 목록에 존재하지 않으면(ACL)
|
||||
if (!in_array($arguments[0], explode(DEFAULTS['DELIMITER_ROLE'], $auth[AUTH_FIELDS['ROLE']]))) {
|
||||
return redirect()->to('/login')->with(
|
||||
return redirect()->to('/front/user/login')->with(
|
||||
'return_message',
|
||||
sprintf(
|
||||
"%s,%s회원님은 접속에 필요한 권한[%s]이 없습니다. ",
|
||||
@ -42,7 +42,7 @@ class AuthFilter implements FilterInterface
|
||||
}
|
||||
} else {
|
||||
session()->setFlashdata(SESSION_NAMES['RETURN_URL'], $request->getUri()->getPath() . '?' . $request->getUri()->getQuery());
|
||||
return redirect()->to('/login')->with('return_message', '로그인을하셔야합니다.');
|
||||
return redirect()->to('/front/user/login')->with('return_message', '로그인을하셔야합니다.');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -148,17 +148,6 @@ function alert_CommonHelper(string $msg, $url = null)
|
||||
return "<script type=\"text/javascript\">{$msg}</script>";
|
||||
} //
|
||||
|
||||
function imageSubmit_CommonHelper(string $src, array $attributes = [])
|
||||
{
|
||||
return form_input([
|
||||
'type' => 'image',
|
||||
'src' => base_url() . $src,
|
||||
'name' => array_key_exists('name', $attributes) ? $attributes['name'] : "",
|
||||
'value' => array_key_exists('value', $attributes) ? $attributes['value'] : "",
|
||||
...$attributes,
|
||||
]);
|
||||
}
|
||||
|
||||
// STATUS가 use가 아닐때 option을 disabled되게 하기위함 (override form_dropdown)
|
||||
function form_dropdown_test($data = '', $options = [], $selected = [], $extra = ''): string
|
||||
{
|
||||
|
||||
@ -122,7 +122,7 @@ function getFieldIndex_Row_UserHelper($field, $entity, array $viewDatas): string
|
||||
case 'title':
|
||||
case 'name':
|
||||
return anchor(
|
||||
current_url() . '/view/' . $entity->getPrimaryKey() . '?category=' . $viewDatas['category']->getPrimaryKey(),
|
||||
current_url() . '/view/' . $entity->getPrimaryKey(),
|
||||
$value,
|
||||
["target" => "_self"]
|
||||
);
|
||||
|
||||
@ -15,7 +15,7 @@ class UserModel extends BaseModel
|
||||
parent::__construct('User');
|
||||
$this->allowedFields = [
|
||||
...$this->allowedFields,
|
||||
"id", "passwd", 'name', "email", "role", "status"
|
||||
"id", "passwd", 'name', "email", "phone", "mobile", "role", "status"
|
||||
];
|
||||
$this->validationRules = [...$this->validationRules, ...$this->getFieldRules($this->allowedFields),];
|
||||
}
|
||||
|
||||
@ -1,28 +0,0 @@
|
||||
<?= $this->extend('layouts/empty') ?>
|
||||
<?= $this->section('content') ?>
|
||||
<link href="/css/login.css" media="screen" rel="stylesheet" type="text/css" />
|
||||
<div class="login">
|
||||
<?= form_open(url_to('signup'), $viewDatas['forms']['attributes'], $viewDatas['forms']['hiddens']) ?>
|
||||
<table>
|
||||
<tr>
|
||||
<td class="label">계정</td>
|
||||
<td class="column">
|
||||
<?= form_input('id', old('id', DEFAULTS['EMPTY'])) ?>
|
||||
</td>
|
||||
<td rowspan="2" class="submit"><?= imageSubmit_CommonHelper('/images/common/btn_login.png', ['width' => '57', 'height' => '60']) ?></td>
|
||||
<td rowspan="2">
|
||||
<?php foreach ($viewDatas['login_buttons'] as $key => $login_button) : ?>
|
||||
<?= $login_button ?>
|
||||
<?php endforeach ?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="label">암호</td>
|
||||
<td class="column">
|
||||
<?= form_password('passwd', old('passwd', DEFAULTS['EMPTY'])) ?>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<?= form_close(); ?>
|
||||
</div>
|
||||
<?= $this->endSection() ?>
|
||||
@ -1,58 +0,0 @@
|
||||
<?= $this->extend('layouts/empty') ?>
|
||||
<?= $this->section('content') ?>
|
||||
<style>
|
||||
.divider:after,
|
||||
.divider:before {
|
||||
content: "";
|
||||
flex: 1;
|
||||
height: 1px;
|
||||
background: #eee;
|
||||
}
|
||||
|
||||
.h-custom {
|
||||
height: calc(100% - 73px);
|
||||
}
|
||||
|
||||
@media (max-width: 450px) {
|
||||
.h-custom {
|
||||
height: 100%;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
<section class="vh-100">
|
||||
<div class="container-fluid h-custom">
|
||||
<div class="row d-flex justify-content-center align-items-center h-100">
|
||||
<div class="col-md-9 col-lg-6 col-xl-5"><img src="https://mdbcdn.b-cdn.net/img/Photos/new-templates/bootstrap-login-form/draw2.webp" class="img-fluid" alt="Sample image"></div>
|
||||
<div class="col-md-8 col-lg-6 col-xl-4 offset-xl-1">
|
||||
<form>
|
||||
<div class="d-flex flex-row align-items-center justify-content-center justify-content-lg-start">
|
||||
<p class="lead fw-normal mb-0 me-3">Sign in with</p><button type="button" class="btn btn-primary btn-floating mx-1"><i class="fab fa-facebook-f"></i></button><button type="button" class="btn btn-primary btn-floating mx-1"><i class="fab fa-twitter"></i></button><button type="button" class="btn btn-primary btn-floating mx-1"><i class="fab fa-linkedin-in"></i></button>
|
||||
</div>
|
||||
<div class="divider d-flex align-items-center my-4">
|
||||
<p class="text-center fw-bold mx-3 mb-0">Or</p>
|
||||
</div>
|
||||
<!-- Email input -->
|
||||
<div class="form-outline mb-4"><input type="email" id="form3Example3" class="form-control form-control-lg" placeholder="Enter a valid email address" /><label class="form-label" for="form3Example3">Email address</label></div>
|
||||
<!-- Password input -->
|
||||
<div class="form-outline mb-3"><input type="password" id="form3Example4" class="form-control form-control-lg" placeholder="Enter password" /><label class="form-label" for="form3Example4">Password</label></div>
|
||||
<div class="d-flex justify-content-between align-items-center">
|
||||
<!-- Checkbox -->
|
||||
<div class="form-check mb-0"><input class="form-check-input me-2" type="checkbox" value="" id="form2Example3" /><label class="form-check-label" for="form2Example3">Remember me </label></div><a href="#!" class="text-body">Forgot password?</a>
|
||||
</div>
|
||||
<div class="text-center text-lg-start mt-4 pt-2"><button type="button" class="btn btn-primary btn-lg" style="padding-left: 2.5rem; padding-right: 2.5rem;">Login</button>
|
||||
<p class="small fw-bold mt-2 pt-1 mb-0">Don't have an account? <a href="#!" class="link-danger">Register</a></p>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="d-flex flex-column flex-md-row text-center text-md-start justify-content-between py-4 px-4 px-xl-5 bg-primary">
|
||||
<!-- Copyright -->
|
||||
<div class="text-white mb-3 mb-md-0">Copyright © 2020. All rights reserved. </div>
|
||||
<!-- Copyright -->
|
||||
<!-- Right -->
|
||||
<div><a href="#!" class="text-white me-4"><i class="fab fa-facebook-f"></i></a><a href="#!" class="text-white me-4"><i class="fab fa-twitter"></i></a><a href="#!" class="text-white me-4"><i class="fab fa-google"></i></a><a href="#!" class="text-white"><i class="fab fa-linkedin-in"></i></a></div>
|
||||
<!-- Right -->
|
||||
</div>
|
||||
</section>
|
||||
<?= $this->endSection() ?>
|
||||
@ -15,7 +15,7 @@
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
||||
<tr>
|
||||
<td valign="bottom" colspan="2"><?= form_submit('', '입력', array("class" => "btn btn-outline btn-primary")); ?></td>
|
||||
<td valign="bottom" colspan="2"><?= form_submit('', '답글', array("class" => "btn btn-outline btn-primary")); ?></td>
|
||||
</tr>
|
||||
</table>
|
||||
<?= form_close(); ?>
|
||||
|
||||
@ -15,7 +15,7 @@
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
||||
<tr>
|
||||
<td valign="bottom" colspan="2"><?= form_submit('', '입력', array("class" => "btn btn-outline btn-primary")); ?></td>
|
||||
<td valign="bottom" colspan="2"><?= form_submit('', '수정', array("class" => "btn btn-outline btn-primary")); ?></td>
|
||||
</tr>
|
||||
</table>
|
||||
<?= form_close(); ?>
|
||||
|
||||
24
app/Views/front/user/insert.php
Normal file
24
app/Views/front/user/insert.php
Normal file
@ -0,0 +1,24 @@
|
||||
<?= $this->extend('layouts/front') ?>
|
||||
<?= $this->section('content') ?>
|
||||
<link href="/css/front/content.css" media="screen" rel="stylesheet" type="text/css" />
|
||||
<div id="content">
|
||||
<div><?= html_entity_decode($viewDatas['category']->head) ?></div>
|
||||
<?= form_open_multipart(current_url(), $viewDatas['forms']['attributes'], $viewDatas['forms']['hiddens']) ?>
|
||||
<table class="form table table-bordered table-hover table-striped">
|
||||
<?php foreach ($viewDatas['fields'] as $field) : ?>
|
||||
<tr>
|
||||
<td class="label"><?= getFieldLabel_UserHelper($field, $viewDatas) ?></td>
|
||||
<td class="column">
|
||||
<?= getFieldForm_UserHelper($field, old($field, DEFAULTS['EMPTY']), $viewDatas) ?>
|
||||
<?= validation_show_error($field); ?>
|
||||
</td>
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
||||
<tr>
|
||||
<td valign="bottom" colspan="2"><?= form_submit('', '회원가입', array("class" => "btn btn-outline btn-primary")); ?></td>
|
||||
</tr>
|
||||
</table>
|
||||
<?= form_close(); ?>
|
||||
<div><?= html_entity_decode($viewDatas['category']->tail) ?></div>
|
||||
</div>
|
||||
<?= $this->endSection() ?>
|
||||
43
app/Views/front/user/login.php
Normal file
43
app/Views/front/user/login.php
Normal file
@ -0,0 +1,43 @@
|
||||
<?= $this->extend('layouts/front') ?>
|
||||
<?= $this->section('content') ?>
|
||||
<link href="/css/front/content.css" media="screen" rel="stylesheet" type="text/css" />
|
||||
<link href="/css/front/login.css" media="screen" rel="stylesheet" type="text/css" />
|
||||
<div id="content">
|
||||
<div class="login container">
|
||||
<?= form_open(current_url(), $viewDatas['forms']['attributes'], $viewDatas['forms']['hiddens']) ?>
|
||||
<table>
|
||||
<tr>
|
||||
<td class="label">계정</td>
|
||||
<td class="column">
|
||||
<?= form_input('id', old('id', DEFAULTS['EMPTY'])) ?>
|
||||
</td>
|
||||
<td rowspan="2" class="submit">
|
||||
<?= form_input([
|
||||
'type' => 'image', 'src' => "/images/common/btn_login.png",
|
||||
'width' => '57', 'height' => '60',
|
||||
]) ?>
|
||||
</td>
|
||||
<td rowspan="2">
|
||||
<?php foreach ($viewDatas['login_buttons'] as $key => $login_button) : ?>
|
||||
<?= $login_button ?>
|
||||
<?php endforeach ?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="label">암호</td>
|
||||
<td class="column">
|
||||
<?= form_password('passwd', old('passwd', DEFAULTS['EMPTY'])) ?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="2">
|
||||
<div class="login_bottom">
|
||||
<a href="/front/user/insert">회원가입</a>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<?= form_close(); ?>
|
||||
</div>
|
||||
</div>
|
||||
<?= $this->endSection() ?>
|
||||
37
app/Views/front/user/login_v1.php
Normal file
37
app/Views/front/user/login_v1.php
Normal file
@ -0,0 +1,37 @@
|
||||
<?= $this->extend('layouts/front') ?>
|
||||
<?= $this->section('content') ?>
|
||||
<link href="/css/front/content.css" media="screen" rel="stylesheet" type="text/css" />
|
||||
<link href="/css/front/login_v1.css" media="screen" rel="stylesheet" type="text/css" />
|
||||
<div id="content">
|
||||
<div class="login container">
|
||||
<?= form_open(current_url(), $viewDatas['forms']['attributes'], $viewDatas['forms']['hiddens']) ?>
|
||||
<div class="row mb-3">
|
||||
<div class="label_column col-3">
|
||||
<label class="col-form-label">아이디</label>
|
||||
</div>
|
||||
<div class="col-9">
|
||||
<?= form_input('id', old('id', DEFAULTS['EMPTY'])) ?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row mb-3">
|
||||
<div class="label_column col-3">
|
||||
<label class="col-form-label">비밀번호</label>
|
||||
</div>
|
||||
<div class="col-9">
|
||||
<?= form_password('passwd', old('passwd', DEFAULTS['EMPTY'])) ?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-12 text-center d-grid">
|
||||
<?= form_submit('', '로그인', array("class" => "btn btn-outline btn-primary")) ?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="login_bottom row">
|
||||
<div class="col"><a href="/front/user/insert">회원가입</a></div>
|
||||
<!-- <div class="col"><a href="/front/user/findid">아이디찾기</a></div>
|
||||
<div class="col"><a href="/front/user/findpw">비밀번호찾기</a></div> -->
|
||||
</div>
|
||||
</div>
|
||||
<?= form_close(); ?>
|
||||
</div>
|
||||
<?= $this->endSection() ?>
|
||||
@ -14,6 +14,9 @@
|
||||
</td>
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
||||
<tr>
|
||||
<td valign="bottom" colspan="2"><?= form_submit('', '수정', array("class" => "btn btn-outline btn-primary")); ?></td>
|
||||
</tr>
|
||||
</table>
|
||||
<?= form_close(); ?>
|
||||
<div><?= html_entity_decode($viewDatas['category']->head) ?></div>
|
||||
|
||||
@ -4,11 +4,11 @@
|
||||
<?= ICONS['LOGIN'] ?><?= $viewDatas['session']->get(SESSION_NAMES['AUTH'])[AUTH_FIELDS['TITLE']] ?>
|
||||
</a>
|
||||
<ul class="dropdown-menu dropdown-menu-end">
|
||||
<li><a class="dropdown-item" href="/front/user/update/<?= $viewDatas['session']->get(SESSION_NAMES['AUTH'])[AUTH_FIELDS['ID']] ?>"><?= ICONS['SETUP'] ?>수정</a></li>
|
||||
<li><a class="dropdown-item" href="/front/user/update/<?= $viewDatas['session']->get(SESSION_NAMES['AUTH'])[AUTH_FIELDS['ID']] . '?category=12' ?>"><?= ICONS['SETUP'] ?>수정</a></li>
|
||||
<li>
|
||||
<hr class="dropdown-divider">
|
||||
</li>
|
||||
<li><a class="dropdown-item" href="/logout"><?= ICONS['LOGOUT'] ?>Logout</a></li>
|
||||
<li><a class="dropdown-item" href="/front/user/logout"><?= ICONS['LOGOUT'] ?>Logout</a></li>
|
||||
</ul>
|
||||
<?php else : ?><a class="nav-link dropdown-toggle" href="/login" role="button"><?= ICONS['LOGIN'] ?>Login</a><?php endif ?>
|
||||
<?php else : ?><a class="nav-link dropdown-toggle" href="/front/user/login" role="button"><?= ICONS['LOGIN'] ?>Login</a><?php endif ?>
|
||||
</li>
|
||||
@ -6,6 +6,21 @@ div#content{
|
||||
/* div#content div.top{
|
||||
border:1px solid red;
|
||||
} */
|
||||
|
||||
/* Form Page 관련 전용*/
|
||||
div#content table.form td.label{
|
||||
width:10%;
|
||||
text-align:right;
|
||||
padding-right:20px;
|
||||
background-color:#e8ebe9;
|
||||
}
|
||||
div#content table.form td.column{
|
||||
height:27px;
|
||||
text-align:left;
|
||||
padding-left:20px;
|
||||
}
|
||||
/* Form Page 관련 전용*/
|
||||
|
||||
/*페이지정보*/
|
||||
div#content div.top nav span.pageinfo{
|
||||
font-weight:bold;
|
||||
@ -33,7 +48,6 @@ div#content div.top nav a{
|
||||
border-radius:0px !important;
|
||||
/* border:1px solid red; */
|
||||
}
|
||||
|
||||
/* index block 전용 */
|
||||
div#content table#block tr:first-child {
|
||||
border-top:2px solid black;
|
||||
@ -43,7 +57,6 @@ div#content table#block tr td{
|
||||
text-align:left;
|
||||
}
|
||||
/* index block 전용 */
|
||||
|
||||
div#content table {
|
||||
white-space: nowrap;
|
||||
/* overflow-x: auto;
|
||||
@ -61,30 +74,19 @@ div#content table thead th{
|
||||
background-color:#F5F5F5;
|
||||
/* border:1px solid silver; */
|
||||
}
|
||||
/* div#content table thead th a{
|
||||
border:1px solid silver;
|
||||
} */
|
||||
div#content table thead th a{
|
||||
color:black;
|
||||
/* border:1px solid silver; */
|
||||
}
|
||||
div#content table tbody td {
|
||||
font-weight:bold;
|
||||
/* border:1px solid silver; */
|
||||
text-align:center;
|
||||
}
|
||||
div#content table tbody td a{
|
||||
text-decoration: none;
|
||||
color:gray;
|
||||
/* text-decoration: none; */
|
||||
/* border:1px solid silver; */
|
||||
}
|
||||
div#content table.form td.label{
|
||||
background-color:#e8ebe9;
|
||||
width:10%;
|
||||
text-align:right;
|
||||
padding-right:20px;
|
||||
}
|
||||
div#content table.form td.column{
|
||||
height:27px;
|
||||
text-align:left;
|
||||
padding-left:20px;
|
||||
}
|
||||
|
||||
div#content div.bottom {
|
||||
padding-top:15px;
|
||||
text-align:center;
|
||||
|
||||
@ -4,34 +4,42 @@
|
||||
* Created : 2016/9/11 Tri-aBility by Junheum,Choi
|
||||
* Updated :
|
||||
------------------------------------------------------------ */
|
||||
div.login{
|
||||
div#content div.login{
|
||||
margin-top:30px;
|
||||
}
|
||||
div#content div.login form{
|
||||
position:relative;
|
||||
width: 799px;
|
||||
height: 283px;
|
||||
margin: auto;
|
||||
margin-left:120px;
|
||||
background-image: url('/images/common/adminbg.png');
|
||||
/* border: 1px solid red; */
|
||||
}
|
||||
|
||||
div.login form{
|
||||
margin-top: 150px;
|
||||
margin-left: 320px;
|
||||
padding-top: 150px;
|
||||
div#content div.login form table {
|
||||
position: absolute;
|
||||
top:150px;
|
||||
left:315px;
|
||||
/* border: 1px solid red; */
|
||||
}
|
||||
|
||||
/* div.login form table {
|
||||
border: 1px solid red;
|
||||
} */
|
||||
|
||||
div.login form table td.label {
|
||||
div#content div.login form table td.label {
|
||||
color:white;
|
||||
padding-right:5px;
|
||||
}
|
||||
div.login table td.column {
|
||||
div#content table td.column {
|
||||
height: 27px;
|
||||
}
|
||||
|
||||
/* div.login form table td.submit{
|
||||
div#content div.login_bottom{
|
||||
padding-top:20px;
|
||||
padding-left:150px;
|
||||
}
|
||||
div#content div.login_bottom a{
|
||||
color:white;
|
||||
}
|
||||
|
||||
/* div#content div.login form table input[type=submit]{
|
||||
width: 57px;
|
||||
height: 60px;
|
||||
background: url('/images/common/btn_login.png');
|
||||
50
public/css/front/login_v1.css
Normal file
50
public/css/front/login_v1.css
Normal file
@ -0,0 +1,50 @@
|
||||
/* ------------------------------------------------------------
|
||||
* Name : admin.css
|
||||
* Desc : Admin StyleSheet
|
||||
* Created : 2016/9/11 Tri-aBility by Junheum,Choi
|
||||
* Updated :
|
||||
------------------------------------------------------------ */
|
||||
|
||||
div#content a {
|
||||
color:black;
|
||||
}
|
||||
|
||||
div#content div.login{
|
||||
width: 509px;
|
||||
margin-top:30px;
|
||||
}
|
||||
|
||||
div#content div.login form {
|
||||
padding-top:20px;
|
||||
border:1px solid silver;
|
||||
}
|
||||
|
||||
div#content div.login form div.label_column{
|
||||
text-align:right;
|
||||
/* border:1px solid red; */
|
||||
}
|
||||
|
||||
div#content div.login form label.col-form-label{
|
||||
font-size:18px;
|
||||
font-weight:bold;
|
||||
/* border:1px solid red; */
|
||||
}
|
||||
|
||||
div#content div.login form input[type=text],input[type=password]{
|
||||
text-align:left;
|
||||
height:35px;
|
||||
width:250px;
|
||||
border:1px solid silver;
|
||||
}
|
||||
|
||||
div#content div.login_bottom{
|
||||
padding-top:20px;
|
||||
padding-bottom:20px;
|
||||
text-align:center;
|
||||
}
|
||||
|
||||
/* div#content div.login form table input[type=submit]{
|
||||
width: 57px;
|
||||
height: 60px;
|
||||
background: url('/images/common/btn_login.png');
|
||||
} */
|
||||
Loading…
Reference in New Issue
Block a user