| Current Path : /var/www/html/bankrakyat/backend/views/layouts/ |
| Current File : /var/www/html/bankrakyat/backend/views/layouts/main.php |
<?php
use yii\helpers\Url;
use yii\helpers\Html;
use common\widgets\inspinia\InspiniaAsset;
use common\components\LanguageSwitcher;
use backend\modules\theme\models\ThemeSetting;
$this->params['extra-asset']['CSS'][] = 'plugins/select2/select2.min.css';
$this->params['extra-asset']['JS'][] = 'plugins/select2/select2.full.min.js';
$this->params['extra-asset']['JS'][] = 'sweetalert2@11.js';
$this->registerJs(
<<<JS
$('.select2').select2({width:'100%'});
JS
);
$assetBundle = InspiniaAsset::register($this);
$this->title = $this->title ?? Yii::$app->name;
//fullname
$fullname = !empty(Yii::$app->user->identity->staff->staff_name) ?
Yii::$app->user->identity->staff->staff_name :
Yii::$app->user->identity->fullname;
/* load addtional assets */
if (!empty($this->params['extra-asset'])) {
if (isset($this->params['extra-asset']['JS']))
foreach ($this->params['extra-asset']['JS'] as $ejs) {
$this->registerJsFile($assetBundle->baseUrl . '/js/' . $ejs, ['depends' => [\yii\web\JqueryAsset::className()]]);
}
if (isset($this->params['extra-asset']['CSS']))
foreach ($this->params['extra-asset']['CSS'] as $ecss) {
$this->registerCssFile($assetBundle->baseUrl . '/css/' . $ecss);
}
}
//theme setting
$theme = ThemeSetting::find()->where(['setting_rule_id' => '9000'])->all();
foreach ($theme as $t) {
if ($t->setting_param_name === 'page-title') {
$this->title = !empty($t->setting_param_value) ? $t->setting_param_value : Yii::$app->name;
}
}
?>
<?php $this->beginPage() ?>
<!DOCTYPE html>
<html lang="<?= Yii::$app->language ?>">
<head>
<meta charset="<?= Yii::$app->charset ?>">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<?= Html::tag('title', Html::encode($this->title)); ?>
<link rel="shortcut icon" href="<?= yii\helpers\Url::to('@web/') ?>favicon.ico?<?= time() ?>">
<?= Html::csrfMetaTags() ?>
<?php $this->head() ?>
<link rel="stylesheet" href="<?= yii\helpers\Url::to('@web/') ?>css/theme-module.css?<?= time() ?>">
<style>
.note-editor{border:1px solid #e5e6e7 !important}
.datepicker{border-radius:0;padding: 6px 12px;}
.grid-view > .table > thead > tr > th{text-align:center;}
.version{
text-align : center;
color : #ccc;
}
.hint-block{
margin-top : 5px;
}
.swal2-popup{
width: 40em !important;
padding: 2em !important;
}
.swal2-title{
font-size: 2.5em !important;
}
.swal2-html-container, .swal2-styled.swal2-confirm, .swal2-styled.swal2-cancel{
font-size: 1.5em !important;
}
/*@media (min-width: 768px) {
#page-wrapper {
max-height : 100vh;
overflow-y:auto;
overflow-x: hidden;
}
}*/
.grid-view {
overflow-x: auto;
padding: 10px;
box-shadow: rgba(0, 0, 0, 0.1) 0px 4px 12px;
}
#help-overlay {
position:fixed;
padding:0;
margin:0;
top:0;
left:0;
width: 100%;
height: 100%;
z-index:9999;
display:none;
}
.help-clip {
position: absolute;
top: 0;
left: 0;
width:100%;
height:100%;
background-color: transparent;
background-image: radial-gradient(circle at center, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 1) 100%);
background-position: 50% 20%;
cursor: pointer;
}
.help-tooltip {
position: absolute;
z-index:10000;
}
.help-tooltip-inner {
position: relative;
z-index: 1;
background-color: #fefefe;
max-width: 200px;
color: #000;
padding: 0;
border-radius: 4px;
text-align: center;
box-shadow: rgba(0, 0, 0, 0.3) 0px 19px 38px, rgba(0, 0, 0, 0.22) 0px 15px 12px;
}
.help-tooltip-pointer-bottom {
position: absolute;
bottom: 0px;
left: 50%;
transform: translateX(-50%);
width: 0;
height: 0;
z-index:1;
border-style: solid;
border-width: 10px 10px 0 10px;
border-color: #fefefe transparent transparent transparent;
box-shadow: rgba(0, 0, 0, 0.3) 0px 19px 38px, rgba(0, 0, 0, 0.22) 0px 15px 12px;
}
.help-tooltip-pointer-left {
position: absolute;
top: 50%;
left: -10px;
transform: translateY(-50%);
width: 0;
height: 0;
z-index:1;
border-style: solid;
border-width: 10px 10px 10px 0;
border-color: transparent #fefefe transparent transparent ;
}
.help-tooltip-pointer-right {
position: absolute;
top: 50%;
right: -10px;
transform: translateY(-50%);
width: 0;
height: 0;
z-index:1;
border-style: solid;
border-width: 10px 0 10px 10px;
border-color: transparent transparent transparent #fefefe;
}
.help-tooltip-pointer-top {
position: absolute;
top: -5px;
left: 50%;
transform: translateX(-50%);
width: 0;
height: 0;
z-index:1;
border-style: solid;
border-width: 0 10px 10px 10px;
border-color: transparent transparent #f0f0f0 transparent;
}
.label-button{
border-radius:10px;
display : block;
margin-bottom : 2px;
padding : 5px 0;
width : 90px;
cursor:pointer;
font-size : 11px !important;
}
.select2-container--default .select2-selection--multiple,.select2-container--default .select2-selection--single{
border-radius:0;
background-color: #f0f0f0;
box-shadow: rgba(99, 99, 99, 0.2) 0px 2px 8px 0px;
}
.select2-container .select2-selection--single, .select2-container .select2-selection--multiple{
height: 34px;
}
.select2-container--default .select2-selection--single .select2-selection__rendered{
line-height: 34px;
}
.summary{
padding : 2em 0 0 2em;
/*padding : 10px;*/
/*border-bottom : 1px solid #DDDDDD;*/
}
.pagination {
margin-right : 2em;
float: right;
/*float : none !important;*/
/*display: flex;*/
/*justify-content: center;*/
}
.gridview-top-wrapper{
overflow: hidden;
}
</style>
</head>
<body>
<?php $this->beginBody() ?>
<!-- Wrapper-->
<div id="wrapper">
<div id="help-overlay">
<div class="help-clip">
<div class="help-tooltip" style="top: 75%;left: 50%;transform: translate(-50%, -50%);">
<div class="help-tooltip-inner">
<h4 style="font-size: 20px;padding-bottom: 5px;border-bottom: 1px solid #dedede;padding-top: 5px;background: #f0f0f0;">Work Area<h4>
<p style="font-weight: 500;padding:10px;">This is the main work area for all the modules. When you select a module from the menu, the content for the module will appear here.</p>
<p style="font-weight: 500;padding:10px;">You can view list of data or records, create new or update records, delete records or perform other transactions</p>
</div>
<div class="help-tooltip-pointer-bottom"></div>
</div>
<div class="help-tooltip" style="top: 7%;right: 5%;">
<div class="help-tooltip-inner" style="max-width:300px">
<h4 style="font-size: 20px;padding-bottom: 5px;border-bottom: 1px solid #dedede;padding-top: 5px;background: #f0f0f0;">User Profile<h4>
<p style="font-weight: 500;padding:10px;">Click the User Icon to get the User Profile Menu where you can choose to access functions whether to update your profile or change your password.</p>
<p style="font-weight: 500;padding:10px;">Click the Logout option to log out from the system</p>
</div>
<div class="help-tooltip-pointer-top" style="left: 90%;"></div>
</div>
<div class="help-tooltip" style="top: 37%;left: 5%;">
<div class="help-tooltip-inner" style="max-width:300px">
<h4 style="font-size: 20px;padding-bottom: 5px;border-bottom: 1px solid #dedede;padding-top: 5px;background: #f0f0f0;">Module Menu<h4>
<p style="font-weight: 500;padding:10px;">This is the menu that gives you access to selected modules based on your role and access rights.</p>
</div>
<div class="help-tooltip-pointer-left" style=""></div>
</div>
</div>
</div>
<!-- Navigation -->
<?= $this->render('_navigation', ['assetBundle' => $assetBundle]) ?>
<!-- Page wraper -->
<!-- div id="page-wrapper" class="gray-bg" -->
<!-- Background Colour Belakang -->
<div id="page-wrapper" class="gray-bg">
<!-- Page wrapper -->
<div class="row border-bottom">
<!--nav class="navbar navbar-static-top" role="navigation" style="margin-bottom: 0"-->
<!-- Background Colour Navigation Bar -->
<nav class="navbar navbar-static-top" role="navigation" style="margin-bottom: 0">
<div class="navbar-header">
<a class="navbar-minimalize minimalize-styl-2 btn btn-primary" href="#" ><i class="fa fa-bars"></i> </a>
</div>
<ul class="nav navbar-top-links navbar-right" style=" text-align: right;">
<li style="border:none;">
<span class="m-r-sm text-muted welcome-message"><?= Yii::t('app', 'Welcome') ?> - <strong><?= Html::encode($fullname) ?></strong></span>
</li>
<li class="dropdown">
<a class="dropdown-toggle count-info" data-toggle="dropdown" href="#" aria-expanded="false">
<i class="fa fa-question-circle"></i>
<!--span class="label label-primary">8</span-->
</a>
<ul class="dropdown-menu dropdown-alerts" style="box-shadow: rgba(50, 50, 93, 0.25) 0px 50px 100px -20px, rgba(0, 0, 0, 0.3) 0px 30px 60px -30px;">
<li>
<a href="https://repository.dynaweb4.com">
<div>
<i class="fa fa-globe fa-fw"></i> Visit our online portal, repository, forum and knowledge base.
<!--span class="pull-right text-muted small">4 minutes ago</span-->
</div>
</a>
</li>
<li class="divider"></li>
<li>
<a href="https://ebook.dynawek4.com">
<div>
<i class="fa fa-book fa-fw"></i> Read the technical manuals and reference books.
<!--span class="pull-right text-muted small">12 minutes ago</span-->
</div>
</a>
</li>
<li class="divider"></li>
<li>
<div class="text-center link-block">
<a href="#" id="help-show">
<strong>See Main Tooltip Help Information</strong>
<i class="fa fa-angle-right"></i>
</a>
</div>
</li>
</ul>
</li>
<!-- language -->
<?= languageSwitcher::Widget(["bundleBase" => $assetBundle->baseUrl]) ?>
<li style="border:none;">
<div class="dropdown profile-element">
<span>
<a data-toggle="dropdown" class="dropdown-toggle" href="#">
<!--<img alt="image" class="img-circle" src="images/user_icon.png" />-->
<?php
if (!\Yii::$app->user->isGuest) {
if (Yii::$app->user->identity->staff && strlen(Yii::$app->user->identity->staff->staff_photo) > 0) {
echo Html::img('@web/' . Yii::$app->params['avatarSetting']['avatarUploadPath'] . '/' . Yii::$app->user->identity->staff->id . '.jpg?' . time(), ['class' => 'img-circle avatar-img', 'width' => '50', 'height' => '50']);
} else {
echo Html::img('@web/images/user_icon.png', ['class' => 'img-circle', 'width' => '50', 'height' => '50']);
}
}
?>
</a>
<ul class="dropdown-menu animated fadeInRight m-t-xs">
<li><a href="<?= Url::to(['/user-info']) ?>"><i class="fa fa-at"></i> <?= Html::encode(Yii::$app->user->identity->username) ?></a></li>
<li><a href="<?= Url::to(['/user-info']) ?>"><i class="fa fa-user"></i> <?= Yii::t('app', 'Profile') ?></a></li>
<li><a href="<?= Url::to(['/user-info/change-password']) ?>"><i class="fa fa-unlock-alt"></i> <?= Yii::t('app', 'Change password') ?></a></li>
<li class="divider"></li>
<li>
<?php
echo Html::a('<i class="fa fa-sign-out"></i> ' . Yii::t('app', 'Log Out'), '#', [
'title' => Yii::t('app', 'Sign Out'),
'onclick' => 'showmodal()'
]);
// echo Html::a('<i class="fa fa-sign-out"></i> ' . Yii::t('app', 'Log Out'), Url::to(['/site/logout']), [
// 'title' => Yii::t('app', 'Sign Out'),
// 'data' => [
// 'method' => 'post',
// 'confirm' => Yii::t('app', 'You can improve your security further after logging out by closing this opened browser')
// ]
// ]);
?>
</li>
</ul>
</span>
</div>
</li>
</ul>
</nav>
</div>
<!-- Main view -->
<?= $this->render('_breadcrumb', ['assetBundle' => $assetBundle]) ?>
<!-- Content view -->
<?= $content ?>
</div>
<!-- End page wrapper-->
</div>
<!-- End wrapper-->
<?php $this->endBody() ?>
<script>
var helpContainer = document.getElementById("help-overlay");
var helpTrigger = document.getElementById("help-show");
helpTrigger.addEventListener("click", function () {
helpContainer.style.display = "block";
});
helpContainer.addEventListener("click", function () {
helpContainer.style.display = "none";
});
</script>
</body>
</html>
<?php $this->endPage() ?>
<script>
function showmodal() {
Swal.fire({
title: 'Logout',
text: "Are you sure you want to logout?",
icon: 'warning',
showCancelButton: true,
confirmButtonColor: '#3085d6',
cancelButtonColor: '#d33',
confirmButtonText: 'Yes'
}).then((result) => {
if (result.value) {
window.location = '/admin/site/logout';
}
});
}
</script>