cfmgrv4 init...2

This commit is contained in:
최준흠 2024-10-09 16:59:52 +09:00
parent cb004fdb55
commit cb88715ed4
7 changed files with 209 additions and 24 deletions

28
app/Views/admin/login.php Normal file
View File

@ -0,0 +1,28 @@
<?= $this->extend(LAYOUTS[$viewDatas['layout']]['path']) ?>
<?= $this->section('content') ?>
<div class="layout_middle">
<div class="layout_right">
<div id="container" class="content">
<link href="/css/<?= $viewDatas['layout'] ?>/login.css" media="screen" rel="stylesheet" type="text/css" />
<div class="login-container border rounded p-4 shadow">
<?= form_open(current_url(), $viewDatas['forms']['attributes'], $viewDatas['forms']['hiddens']) ?>
<h2 class="text-center mb-4">로그인</h2>
<div class="mb-3">
<label for="userId" class="form-label">아이디</label>
<input type="text" class="form-control" id="userId" name="id" value="<?= set_value('id') ?>" required>
</div>
<div class="mb-3">
<label for="userPassword" class="form-label">비밀번호</label>
<input type="password" class="form-control" id="userPassword" name="passwd" required>
</div>
<div class="d-flex justify-content-between align-items-center">
<button type="submit" class="btn btn-primary">로그인</button>
<?= anchor($viewDatas['google_url'], ICONS['GOOGLE'] . 'Google 로그인', ["class" => "btn btn-danger"]) ?>
<button type="button" class="btn btn-outline-primary">회원가입</button>
</div>
<?= form_close(); ?>
</div>
</div>
</div>
</div>
<?= $this->endSection() ?>

View File

@ -0,0 +1,35 @@
<?= $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" />
<?= form_open(current_url(), $viewDatas['forms']['attributes'], $viewDatas['forms']['hiddens']) ?>
<div class="action_form">
<table class="table table-bordered">
<?php $cnt = 1 ?>
<?php foreach ($viewDatas['fields'] as $field): ?>
<tr>
<th nowrap class="text-end"><?= $viewDatas['helper']->getFieldLabel($field, $viewDatas) ?></th>
<td nowrap class="text-start">
<?php
$extras = ["class" => "form-control"];
if (strpos($viewDatas['field_rules'][$field], 'required') !== false) {
$extras = ["required" => "", ...$extras];
}
?>
<?= $viewDatas['helper']->getFieldForm($field, old($field), $viewDatas, $extras) ?>
<div><?= validation_show_error($field); ?></div>
</td>
<?php $cnt++ ?>
</tr>
<?php endforeach; ?>
<tr>
<td colspan="<?= $cnt * 2 ?>" class="text-center">
<?= form_submit('', '입력', array("class" => "btn btn-outline btn-primary")); ?>
</td>
</tr>
</table>
<?= form_close(); ?>
</div>
</div>
<script type="text/javascript" src="/js/<?= $viewDatas['layout'] ?>/form.js"></script>
<?= $this->endSection() ?>

56
app/Views/front/index.php Normal file
View File

@ -0,0 +1,56 @@
<?= $this->extend(LAYOUTS[$viewDatas['layout']]['path']) ?>
<?= $this->section('content') ?>
<div class="layout_top"><?= $this->include(LAYOUTS[$viewDatas['layout']]['path'] . '/top'); ?></div>
<div class="layout_middle">
<div class="layout_left"><?= $this->include(LAYOUTS[$viewDatas['layout']]['path'] . '/left_menu'); ?></div>
<div class="layout_right">
<?= $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" />
<link href="/css/common/resizeTable.css" media="screen" rel="stylesheet" type="text/css" />
<div class="index_body">
<?= $this->include("templates/{$viewDatas['layout']}/index_content_top"); ?>
<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['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['entitys'] as $entity): ?>
<tr <?= $viewDatas['helper']->getListRowColor($entity) ?>>
<?php $viewDatas['cnt'] = $viewDatas['total_count'] - (($viewDatas['page'] - 1) * $viewDatas['per_page'] + $cnt); ?>
<?php $viewDatas['entity'] = $entity; ?>
<td>
<?= $viewDatas['helper']->getListButton('modify', $viewDatas) ?>
</td>
<?php foreach ($viewDatas['fields'] as $field): ?>
<td><?= $viewDatas['helper']->getFieldView($field, $viewDatas) ?></td>
<?php endforeach ?>
<td>
<?= $viewDatas['helper']->getListButton('delete', $viewDatas) ?>
</td>
</tr>
<?php $cnt++ ?>
<?php endforeach ?>
</tbody>
</table>
<?= $this->include("templates/{$viewDatas['layout']}/index_content_batchjob"); ?>
</div>
<div class=" index_pagination"><?= $viewDatas['pagination'] ?></div>
<div class="index_bottom"><?= $this->include("templates/common/modal_iframe"); ?></div>
<script type="text/javascript" src="/js/common/resizeTable.js"></script>
<script type="text/javascript" src="/js/<?= $viewDatas['layout'] ?>/index.js"></script>
</div>
<div class="layout_footer"><?= $this->include("templates/{$viewDatas['layout']}/index_footer"); ?></div>
</div>
</div>
<div class="layout_bottom">
<?= $this->include(LAYOUTS[$viewDatas['layout']]['path'] . '/bottom'); ?>
</div>
<?= $this->endSection() ?>

View File

@ -1,22 +1,28 @@
<?= $this->extend(LAYOUTS[$viewDatas['layout']]['path']) ?>
<?= $this->section('content') ?>
<link href="/css/<?= $viewDatas['layout'] ?>/login.css" media="screen" rel="stylesheet" type="text/css" />
<div class="login-container border rounded p-4 shadow">
<?= form_open(current_url(), $viewDatas['forms']['attributes'], $viewDatas['forms']['hiddens']) ?>
<h2 class="text-center mb-4">로그인</h2>
<div class="mb-3">
<label for="userId" class="form-label">아이디</label>
<input type="text" class="form-control" id="userId" name="id" value="<?= set_value('id') ?>" required>
<div class="layout_middle">
<div class="layout_right">
<div id="container" class="content">
<link href="/css/<?= $viewDatas['layout'] ?>/login.css" media="screen" rel="stylesheet" type="text/css" />
<div class="login-container border rounded p-4 shadow">
<?= form_open(current_url(), $viewDatas['forms']['attributes'], $viewDatas['forms']['hiddens']) ?>
<h2 class="text-center mb-4">로그인</h2>
<div class="mb-3">
<label for="userId" class="form-label">아이디</label>
<input type="text" class="form-control" id="userId" name="id" value="<?= set_value('id') ?>" required>
</div>
<div class="mb-3">
<label for="userPassword" class="form-label">비밀번호</label>
<input type="password" class="form-control" id="userPassword" name="passwd" required>
</div>
<div class="d-flex justify-content-between align-items-center">
<button type="submit" class="btn btn-primary">로그인</button>
<?= anchor($viewDatas['google_url'], ICONS['GOOGLE'] . 'Google 로그인', ["class" => "btn btn-danger"]) ?>
<button type="button" class="btn btn-outline-primary">회원가입</button>
</div>
<?= form_close(); ?>
</div>
</div>
</div>
<div class="mb-3">
<label for="userPassword" class="form-label">비밀번호</label>
<input type="password" class="form-control" id="userPassword" name="passwd" required>
</div>
<div class="d-flex justify-content-between align-items-center">
<button type="submit" class="btn btn-primary">로그인</button>
<?= anchor($viewDatas['google_url'], ICONS['GOOGLE'] . 'Google 로그인', ["class" => "btn btn-danger"]) ?>
<button type="button" class="btn btn-outline-primary">회원가입</button>
</div>
<?= form_close(); ?>
</div>
<?= $this->endSection() ?>

View File

@ -0,0 +1,34 @@
<?= $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" />
<?= form_open(current_url(), ['id' => 'action_form', ...$viewDatas['forms']['attributes']], $viewDatas['forms']['hiddens']) ?>
<div class="action_form">
<table class="table table-bordered">
<?php $cnt = 1 ?>
<?php foreach ($viewDatas['fields'] as $field): ?>
<tr>
<th nowrap class="text-end"><?= $viewDatas['helper']->getFieldLabel($field, $viewDatas) ?></th>
<td nowrap class="text-start">
<?php
$extras = ["class" => 'form-control'];
if (strpos($viewDatas['field_rules'][$field], 'required') !== false) {
$extras = ["required" => "", ...$extras];
}
?>
<?= $viewDatas['helper']->getFieldForm($field, old($field) ?? $viewDatas['entity']->$field, $viewDatas, $extras) ?>
<div><?= validation_show_error($field); ?></div>
</td>
<?php $cnt++ ?>
</tr>
<?php endforeach; ?>
<tr>
<td colspan="<?= $cnt * 2 ?>" class="text-center">
<?= form_submit("", '수정', ["class" => "btn btn-outline btn-primary"]) ?>
</td>
</tr>
</table>
<?= form_close(); ?>
</div>
</div>
<?= $this->endSection() ?>

27
app/Views/front/view.php Normal file
View File

@ -0,0 +1,27 @@
<?= $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">
<?php $cnt = 1 ?>
<?php foreach ($viewDatas['fields'] as $field): ?>
<tr>
<th nowrap class="text-end"><?= $viewDatas['helper']->getFieldLabel($field, $viewDatas) ?></th>
<td nowrap class="text-start">
<?= $viewDatas['helper']->getFieldView($field, $viewDatas, $viewDatas) ?>
</td>
<?php $cnt++ ?>
</tr>
<?php endforeach; ?>
<tr>
<td colspan="<?= $cnt * 2 ?>" class="text-center">
<div><?= $viewDatas['message'] ?></div>
<p>작업 완료 아래 버튼을 클릭하면 모달이 닫힙니다.</p>
<button onclick="parent.closeBootstrapModal()">작업 완료</button>
</td>
</tr>
</table>
</div>
</div>
<?= $this->endSection() ?>

View File

@ -1,11 +1,9 @@
.login-wrapper {
display: flex;
justify-content: center;
align-items: center;
height: 100vh;
}
.login-container {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
width: 400px;
height: 400px;
overflow-y: auto;
@ -14,4 +12,5 @@
flex-direction: column;
justify-content: center;
align-items: center;
/* border: 1px solid red; */
}