Add files via upload
@@ -0,0 +1,85 @@
|
|||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* PHP Dynamic Qr code
|
||||||
|
*
|
||||||
|
* @author Giandonato Inverso <info@giandonatoinverso.it>
|
||||||
|
* @copyright Copyright (c) 2020-2021
|
||||||
|
* @license https://opensource.org/licenses/MIT MIT License
|
||||||
|
* @link https://github.com/giandonatoinverso/PHP-Dynamic-Qr-code
|
||||||
|
* @version 1.0
|
||||||
|
*/
|
||||||
|
|
||||||
|
session_start();
|
||||||
|
require_once 'config/config.php';
|
||||||
|
require_once BASE_PATH . '/includes/auth_validate.php';
|
||||||
|
|
||||||
|
// Users class
|
||||||
|
require_once BASE_PATH . '/lib/Users/Users.php';
|
||||||
|
$users = new Users();
|
||||||
|
|
||||||
|
// We are using same form for adding and editing. This is a create form so declare $edit = false.
|
||||||
|
$edit = false;
|
||||||
|
|
||||||
|
// Serve POST request
|
||||||
|
if ($_SERVER['REQUEST_METHOD'] === 'POST')
|
||||||
|
$users->add();
|
||||||
|
?>
|
||||||
|
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="en">
|
||||||
|
<title>Add admin - Qrcode Generator</title>
|
||||||
|
<head>
|
||||||
|
<?php include './includes/head.php'; ?>
|
||||||
|
</head>
|
||||||
|
<body class="hold-transition sidebar-mini layout-fixed layout-navbar-fixed layout-footer-fixed">
|
||||||
|
<div class="wrapper">
|
||||||
|
<!-- Navbar -->
|
||||||
|
<?php include './includes/navbar.php'; ?>
|
||||||
|
<!-- /.navbar -->
|
||||||
|
|
||||||
|
<!-- Main Sidebar Container -->
|
||||||
|
<?php include './includes/sidebar.php'; ?>
|
||||||
|
<!-- /.Main Sidebar Container -->
|
||||||
|
|
||||||
|
<!-- Content Wrapper. Contains page content -->
|
||||||
|
<div class="content-wrapper">
|
||||||
|
<!-- Content Header (Page header) -->
|
||||||
|
<div class="content-header">
|
||||||
|
<div class="container-fluid">
|
||||||
|
<div class="row mb-2">
|
||||||
|
<div class="col-sm-6">
|
||||||
|
<h1 class="m-0 text-dark"><?php echo (!$edit) ? 'Add' : 'Update'; ?> User</h1>
|
||||||
|
</div><!-- /.col -->
|
||||||
|
</div><!-- /.row -->
|
||||||
|
</div><!-- /.container-fluid -->
|
||||||
|
</div>
|
||||||
|
<!-- /.content-header -->
|
||||||
|
|
||||||
|
<!-- Main content -->
|
||||||
|
<section class="content">
|
||||||
|
<div class="container-fluid">
|
||||||
|
<!-- Flash messages -->
|
||||||
|
<?php include BASE_PATH.'/includes/flash_messages.php'; ?>
|
||||||
|
|
||||||
|
<div class="card card-primary">
|
||||||
|
<div class="card-header">
|
||||||
|
<h3 class="card-title">Enter the requested data</h3>
|
||||||
|
</div>
|
||||||
|
<form class="well form-horizontal" action="" method="post" id="contact_form" enctype="multipart/form-data">
|
||||||
|
<div class="card-body">
|
||||||
|
<?php include BASE_PATH . '/forms/users_form.php'; ?>
|
||||||
|
</div>
|
||||||
|
<div class="card-footer">
|
||||||
|
<button type="submit" class="btn btn-primary">Submit</button>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div><!--/. container-fluid -->
|
||||||
|
</section><!-- /.content -->
|
||||||
|
</div><!-- /.content-wrapper -->
|
||||||
|
|
||||||
|
<!-- Footer and scripts -->
|
||||||
|
<?php include './includes/footer.php'; ?>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
@@ -0,0 +1,113 @@
|
|||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* PHP Dynamic Qr code
|
||||||
|
*
|
||||||
|
* @author Giandonato Inverso <info@giandonatoinverso.it>
|
||||||
|
* @copyright Copyright (c) 2020-2021
|
||||||
|
* @license https://opensource.org/licenses/MIT MIT License
|
||||||
|
* @link https://github.com/giandonatoinverso/PHP-Dynamic-Qr-code
|
||||||
|
* @version 1.0
|
||||||
|
*/
|
||||||
|
|
||||||
|
session_start();
|
||||||
|
require_once 'config/config.php';
|
||||||
|
require_once BASE_PATH.'/includes/auth_validate.php';
|
||||||
|
|
||||||
|
// Dynamic qrcode class
|
||||||
|
require_once BASE_PATH . '/lib/Dynamic_Qrcode/Dynamic_Qrcode.php';
|
||||||
|
$dynamic_qrcode = new Dynamic_Qrcode();
|
||||||
|
|
||||||
|
// Serve POST method, After successful insert, redirect to dynamic_qrcodes.php page.
|
||||||
|
if ($_SERVER['REQUEST_METHOD'] === 'POST')
|
||||||
|
$dynamic_qrcode->add();
|
||||||
|
?>
|
||||||
|
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="en">
|
||||||
|
<title>Add dynamic - Qrcode Generator</title>
|
||||||
|
<head>
|
||||||
|
<?php include './includes/head.php'; ?>
|
||||||
|
</head>
|
||||||
|
<body class="hold-transition sidebar-mini layout-fixed layout-navbar-fixed layout-footer-fixed">
|
||||||
|
<div class="wrapper">
|
||||||
|
<!-- Navbar -->
|
||||||
|
<?php include './includes/navbar.php'; ?>
|
||||||
|
<!-- /.navbar -->
|
||||||
|
|
||||||
|
<!-- Main Sidebar Container -->
|
||||||
|
<?php include './includes/sidebar.php'; ?>
|
||||||
|
<!-- /.Main Sidebar Container -->
|
||||||
|
|
||||||
|
<!-- Content Wrapper. Contains page content -->
|
||||||
|
<div class="content-wrapper">
|
||||||
|
<!-- Content Header (Page header) -->
|
||||||
|
<div class="content-header">
|
||||||
|
<div class="container-fluid">
|
||||||
|
<div class="row mb-2">
|
||||||
|
<div class="col-sm-6">
|
||||||
|
<h1 class="m-0 text-dark">Add qr code</h1>
|
||||||
|
</div><!-- /.col -->
|
||||||
|
</div><!-- /.row -->
|
||||||
|
</div><!-- /.container-fluid -->
|
||||||
|
</div>
|
||||||
|
<!-- /.content-header -->
|
||||||
|
|
||||||
|
<!-- Flash message-->
|
||||||
|
<?php include BASE_PATH . '/includes/flash_messages.php'; ?>
|
||||||
|
<!-- /.Flash message-->
|
||||||
|
|
||||||
|
<!-- Main content -->
|
||||||
|
<section class="content">
|
||||||
|
<div class="container-fluid">
|
||||||
|
<div class="card card-primary">
|
||||||
|
<div class="card-header">
|
||||||
|
<h3 class="card-title">Enter the requested data</h3>
|
||||||
|
</div>
|
||||||
|
<form class="form" action="" method="post" id="dynamic_form" enctype="multipart/form-data">
|
||||||
|
<div class="card-body">
|
||||||
|
<?php include BASE_PATH.'/forms/add_dynamic_form.php'; ?>
|
||||||
|
</div>
|
||||||
|
<div class="card-footer">
|
||||||
|
<button type="submit" class="btn btn-primary">Submit</button>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
</div><!--/. container-fluid -->
|
||||||
|
</section><!-- /.content -->
|
||||||
|
</div><!-- /.content-wrapper -->
|
||||||
|
|
||||||
|
<!-- Footer and scripts -->
|
||||||
|
<?php include './includes/footer.php'; ?>
|
||||||
|
|
||||||
|
<!-- Page script -->
|
||||||
|
<script type="text/javascript">
|
||||||
|
$(document).ready(function(){
|
||||||
|
$('#dynamic_form').validate({
|
||||||
|
rules: {
|
||||||
|
filename: {
|
||||||
|
required: true,
|
||||||
|
},
|
||||||
|
link: {
|
||||||
|
required: true,
|
||||||
|
minlength: 3
|
||||||
|
},
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
<script>
|
||||||
|
$(function () {
|
||||||
|
|
||||||
|
//Colorpicker
|
||||||
|
$('.my-colorpicker1').colorpicker()
|
||||||
|
//color picker with addon
|
||||||
|
$('.my-colorpicker2').colorpicker()
|
||||||
|
|
||||||
|
$('.my-colorpicker2').on('colorpickerChange', function(event) {
|
||||||
|
$('.my-colorpicker2 .fa-square').css('color', event.color.toString());
|
||||||
|
});
|
||||||
|
|
||||||
|
})
|
||||||
|
</script>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
@@ -0,0 +1,169 @@
|
|||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* PHP Dynamic Qr code
|
||||||
|
*
|
||||||
|
* @author Giandonato Inverso <info@giandonatoinverso.it>
|
||||||
|
* @copyright Copyright (c) 2020-2021
|
||||||
|
* @license https://opensource.org/licenses/MIT MIT License
|
||||||
|
* @link https://github.com/giandonatoinverso/PHP-Dynamic-Qr-code
|
||||||
|
* @version 1.0
|
||||||
|
*/
|
||||||
|
|
||||||
|
session_start();
|
||||||
|
require_once 'config/config.php';
|
||||||
|
require_once BASE_PATH.'/includes/auth_validate.php';
|
||||||
|
|
||||||
|
// Dynamic qrcode class
|
||||||
|
require_once BASE_PATH . '/lib/Static_Qrcode/Static_Qrcode.php';
|
||||||
|
$static_qrcode = new Static_Qrcode();
|
||||||
|
|
||||||
|
// Serve POST method, After successful insert, redirect to static_qrcodes.php page.
|
||||||
|
if ($_SERVER['REQUEST_METHOD'] === 'POST'){
|
||||||
|
|
||||||
|
switch($_GET['type']){
|
||||||
|
case 'text': $static_qrcode->textQrcode($_POST['text']);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 'email': $static_qrcode->emailQrcode($_POST['email'], $_POST['subject'], $_POST['message']);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 'phone': $static_qrcode->phoneQrcode($_POST['country_code'], $_POST['phone_number']);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 'sms': $static_qrcode->smsQrcode($_POST['country_code'], $_POST['phone_number'],$_POST['message']);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 'whatsapp': $static_qrcode->whatsappQrcode($_POST['country_code'], $_POST['phone_number'],$_POST['message']);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 'skype': $static_qrcode->skypeQrcode($_POST['skype_username']);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 'location': $static_qrcode->locationQrcode($_POST['latitude'], $_POST['longitude']);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 'vcard': $static_qrcode->vcardQrcode($_POST['full_name'], $_POST['nickname'], $_POST['email'], $_POST['website'], $_POST['phone'], $_POST['home_phone'], $_POST['work_phone'], $_POST['company'], $_POST['role'], $_POST['categories'], $_POST['note'], $_POST['photo'], $_POST['address'], $_POST['city'], $_POST['post_code'], $_POST['state']);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 'event': $static_qrcode->eventQrcode($_POST['title'], $_POST['start'], $_POST['end'], $_POST['location'], $_POST['description'], $_POST['url']);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 'bookmark': $static_qrcode->bookmarkQrcode($_POST['url'], $_POST['title']);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 'wifi': $static_qrcode->wifiQrcode($_POST['encryption'], $_POST['ssid'], $_POST['password']);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 'paypal': $static_qrcode->paypalQrcode($_POST['payment_type'], $_POST['email'], $_POST['item_name'], $_POST['item_id'], $_POST['amount'], $_POST['currency'], $_POST['shipping'], $_POST['tax_rate']);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 'bitcoin': $static_qrcode->bitcoinQrcode($_POST['address'], $_POST['amount'], $_POST['label'], $_POST['message']);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
?>
|
||||||
|
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="en">
|
||||||
|
<title>Add static - Qrcode Generator</title>
|
||||||
|
<head>
|
||||||
|
<?php include './includes/head.php'; ?>
|
||||||
|
</head>
|
||||||
|
<body class="hold-transition sidebar-mini layout-fixed layout-navbar-fixed layout-footer-fixed">
|
||||||
|
<div class="wrapper">
|
||||||
|
<!-- Navbar -->
|
||||||
|
<?php include './includes/navbar.php'; ?>
|
||||||
|
<!-- /.navbar -->
|
||||||
|
|
||||||
|
<!-- Main Sidebar Container -->
|
||||||
|
<?php include './includes/sidebar.php'; ?>
|
||||||
|
<!-- /.Main Sidebar Container -->
|
||||||
|
|
||||||
|
<!-- Content Wrapper. Contains page content -->
|
||||||
|
<div class="content-wrapper">
|
||||||
|
<!-- Content Header (Page header) -->
|
||||||
|
<div class="content-header">
|
||||||
|
<div class="container-fluid">
|
||||||
|
<div class="row mb-2">
|
||||||
|
<div class="col-sm-6">
|
||||||
|
<h1 class="m-0 text-dark">Add qr code</h1>
|
||||||
|
</div><!-- /.col -->
|
||||||
|
</div><!-- /.row -->
|
||||||
|
</div><!-- /.container-fluid -->
|
||||||
|
</div>
|
||||||
|
<!-- /.content-header -->
|
||||||
|
|
||||||
|
<!-- Flash message-->
|
||||||
|
<?php include BASE_PATH . '/includes/flash_messages.php'; ?>
|
||||||
|
<!-- /.Flash message-->
|
||||||
|
|
||||||
|
<!-- Main content -->
|
||||||
|
<section class="content">
|
||||||
|
<div class="container-fluid">
|
||||||
|
<div class="card card-primary">
|
||||||
|
<div class="card-header">
|
||||||
|
<h3 class="card-title">Enter the requested data</h3>
|
||||||
|
</div>
|
||||||
|
<div class="card-body">
|
||||||
|
<?php include BASE_PATH.'/forms/add_static_form.php'; ?>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div><!--/. container-fluid -->
|
||||||
|
</section><!-- /.content -->
|
||||||
|
</div><!-- /.content-wrapper -->
|
||||||
|
|
||||||
|
<!-- Footer and scripts -->
|
||||||
|
<?php include './includes/footer.php'; ?>
|
||||||
|
|
||||||
|
<!-- Page script -->
|
||||||
|
<script type="text/javascript">
|
||||||
|
$(document).ready(function(){
|
||||||
|
$('#static_form').validate({
|
||||||
|
rules: {
|
||||||
|
filename: {
|
||||||
|
required: true,
|
||||||
|
},
|
||||||
|
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
<script>
|
||||||
|
$(function () {
|
||||||
|
|
||||||
|
//Colorpicker
|
||||||
|
$('.my-colorpicker1').colorpicker()
|
||||||
|
//color picker with addon
|
||||||
|
$('.my-colorpicker2').colorpicker()
|
||||||
|
|
||||||
|
$('.my-colorpicker2').on('colorpickerChange', function(event) {
|
||||||
|
$('.my-colorpicker2 .fa-square').css('color', event.color.toString());
|
||||||
|
});
|
||||||
|
|
||||||
|
$('#start').daterangepicker({
|
||||||
|
timePicker: true,
|
||||||
|
singleDatePicker: true,
|
||||||
|
showDropdowns: true,
|
||||||
|
minYear: 2020,
|
||||||
|
maxYear: 2030,
|
||||||
|
locale: {
|
||||||
|
format: 'YYYY-MM-DD hh:mm A'
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
$('#end').daterangepicker({
|
||||||
|
timePicker: true,
|
||||||
|
singleDatePicker: true,
|
||||||
|
showDropdowns: true,
|
||||||
|
minYear: 2020,
|
||||||
|
maxYear: 2030,
|
||||||
|
locale: {
|
||||||
|
format: 'YYYY-MM-DD hh:mm A'
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
})
|
||||||
|
</script>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
@@ -0,0 +1,105 @@
|
|||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* PHP Dynamic Qr code
|
||||||
|
*
|
||||||
|
* @author Giandonato Inverso <info@giandonatoinverso.it>
|
||||||
|
* @copyright Copyright (c) 2020-2021
|
||||||
|
* @license https://opensource.org/licenses/MIT MIT License
|
||||||
|
* @link https://github.com/giandonatoinverso/PHP-Dynamic-Qr-code
|
||||||
|
* @version 1.0
|
||||||
|
*/
|
||||||
|
|
||||||
|
session_start();
|
||||||
|
require_once 'config/config.php';
|
||||||
|
require_once BASE_PATH . '/includes/auth_validate.php';
|
||||||
|
|
||||||
|
// Users class
|
||||||
|
require_once BASE_PATH . '/lib/Users/Users.php';
|
||||||
|
$Users = new Users();
|
||||||
|
|
||||||
|
// Get DB instance. i.e instance of MYSQLiDB Library
|
||||||
|
$db = getDbInstance();
|
||||||
|
$select = array('id', 'user_name', 'admin_type');
|
||||||
|
|
||||||
|
// Search and order
|
||||||
|
$search_fields = array('user_name');
|
||||||
|
require_once BASE_PATH . '/includes/search_order.php';
|
||||||
|
|
||||||
|
// Set pagination limit
|
||||||
|
$db->pageLimit = 15;
|
||||||
|
|
||||||
|
// Get current page
|
||||||
|
$page = filter_input(INPUT_GET, 'page', FILTER_SANITIZE_FULL_SPECIAL_CHARS) ?? 1;
|
||||||
|
|
||||||
|
// Get Input data from query string
|
||||||
|
$del_id = filter_input(INPUT_GET, 'del_id', FILTER_SANITIZE_FULL_SPECIAL_CHARS);
|
||||||
|
|
||||||
|
// Get result of the query
|
||||||
|
$rows = $db->arraybuilder()->paginate('admin_accounts', $page, $select);
|
||||||
|
$total_pages = $db->totalPages;
|
||||||
|
?>
|
||||||
|
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="en">
|
||||||
|
<title>List admin - Qrcode Generator</title>
|
||||||
|
<head>
|
||||||
|
<?php include './includes/head.php'; ?>
|
||||||
|
</head>
|
||||||
|
<body class="hold-transition sidebar-mini layout-fixed layout-navbar-fixed layout-footer-fixed">
|
||||||
|
<div class="wrapper">
|
||||||
|
<!-- Navbar -->
|
||||||
|
<?php include './includes/navbar.php'; ?>
|
||||||
|
<!-- /.navbar -->
|
||||||
|
|
||||||
|
<!-- Main Sidebar Container -->
|
||||||
|
<?php include './includes/sidebar.php'; ?>
|
||||||
|
<!-- /.Main Sidebar Container -->
|
||||||
|
|
||||||
|
<!-- Content Wrapper. Contains page content -->
|
||||||
|
<div class="content-wrapper">
|
||||||
|
<!-- Content Header (Page header) -->
|
||||||
|
<div class="content-header">
|
||||||
|
<div class="container-fluid">
|
||||||
|
<div class="row mb-2">
|
||||||
|
|
||||||
|
<div class="col-sm-6">
|
||||||
|
<h1 class="m-0 text-dark">Admin users</h1>
|
||||||
|
</div><!-- /.col -->
|
||||||
|
|
||||||
|
<div class="col-sm-6">
|
||||||
|
<ol class="breadcrumb float-sm-right">
|
||||||
|
<li class="breadcrumb-item">
|
||||||
|
<a href="add_admin.php" class="btn btn-success"><i class="fa fa-plus"></i> Add new</a>
|
||||||
|
</li>
|
||||||
|
</ol>
|
||||||
|
</div><!-- /.col -->
|
||||||
|
</div><!-- /.row -->
|
||||||
|
</div><!-- /.container-fluid -->
|
||||||
|
</div><!-- /.content-header -->
|
||||||
|
|
||||||
|
<!-- Flash message-->
|
||||||
|
<?php include BASE_PATH . '/includes/flash_messages.php'; ?>
|
||||||
|
<!-- /.Flash message-->
|
||||||
|
|
||||||
|
<!-- Filters -->
|
||||||
|
<?php $options = $Users->setOrderingValues();
|
||||||
|
include BASE_PATH . '/forms/filters.php'; ?>
|
||||||
|
<!-- /.Filters -->
|
||||||
|
|
||||||
|
<!-- Main content -->
|
||||||
|
<section class="content">
|
||||||
|
<div class="container-fluid">
|
||||||
|
|
||||||
|
<!-- Table -->
|
||||||
|
<?php include BASE_PATH . '/forms/users_table.php'; ?>
|
||||||
|
<!-- /.Table -->
|
||||||
|
|
||||||
|
</div><!-- /.container-fluid -->
|
||||||
|
</section>
|
||||||
|
</div><!-- /.content-wrapper -->
|
||||||
|
|
||||||
|
<!-- Footer and scripts -->
|
||||||
|
<?php include './includes/footer.php'; ?>
|
||||||
|
<!-- /.Footer and scripts -->
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
@@ -0,0 +1,80 @@
|
|||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* PHP Dynamic Qr code
|
||||||
|
*
|
||||||
|
* @author Giandonato Inverso <info@giandonatoinverso.it>
|
||||||
|
* @copyright Copyright (c) 2020-2021
|
||||||
|
* @license https://opensource.org/licenses/MIT MIT License
|
||||||
|
* @link https://github.com/giandonatoinverso/PHP-Dynamic-Qr-code
|
||||||
|
* @version 1.0
|
||||||
|
*/
|
||||||
|
|
||||||
|
require_once 'config/config.php';
|
||||||
|
session_start();
|
||||||
|
|
||||||
|
if ($_SERVER['REQUEST_METHOD'] === 'POST')
|
||||||
|
{
|
||||||
|
$username = filter_input(INPUT_POST, 'username');
|
||||||
|
$password = filter_input(INPUT_POST, 'password');
|
||||||
|
$remember = filter_input(INPUT_POST, 'remember');
|
||||||
|
|
||||||
|
// Get DB instance.
|
||||||
|
$db = getDbInstance();
|
||||||
|
|
||||||
|
$db->where('user_name', $username);
|
||||||
|
$row = $db->getOne('admin_accounts');
|
||||||
|
|
||||||
|
if ($db->count >= 1)
|
||||||
|
{
|
||||||
|
$db_password = $row['password'];
|
||||||
|
$user_id = $row['id'];
|
||||||
|
|
||||||
|
if (password_verify($password, $db_password))
|
||||||
|
{
|
||||||
|
$_SESSION['user_logged_in'] = TRUE;
|
||||||
|
$_SESSION['admin_type'] = $row['admin_type'];
|
||||||
|
$_SESSION['user_id'] = $row['id'];
|
||||||
|
|
||||||
|
if ($remember)
|
||||||
|
{
|
||||||
|
$series_id = randomString(16);
|
||||||
|
$remember_token = getSecureRandomToken(20);
|
||||||
|
$encryted_remember_token = password_hash($remember_token,PASSWORD_DEFAULT);
|
||||||
|
|
||||||
|
$expiry_time = date('Y-m-d H:i:s', strtotime(' + 30 days'));
|
||||||
|
$expires = strtotime($expiry_time);
|
||||||
|
|
||||||
|
setcookie('series_id', $series_id, $expires, '/');
|
||||||
|
setcookie('remember_token', $remember_token, $expires, '/');
|
||||||
|
|
||||||
|
$db = getDbInstance();
|
||||||
|
$db->where ('id',$user_id);
|
||||||
|
|
||||||
|
$update_remember = array(
|
||||||
|
'series_id'=> $series_id,
|
||||||
|
'remember_token' => $encryted_remember_token,
|
||||||
|
'expires' =>$expiry_time
|
||||||
|
);
|
||||||
|
$db->update('admin_accounts', $update_remember);
|
||||||
|
}
|
||||||
|
// Authentication successfull redirect user
|
||||||
|
header('Location: index.php');
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$_SESSION['login_failure'] = 'Invalid username or password';
|
||||||
|
header('Location: login.php');
|
||||||
|
}
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$_SESSION['login_failure'] = 'Invalid username or password';
|
||||||
|
header('Location: login.php');
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
die('Method Not allowed');
|
||||||
|
}
|
||||||
@@ -0,0 +1,14 @@
|
|||||||
|
'use strict'
|
||||||
|
|
||||||
|
module.exports = (ctx) => ({
|
||||||
|
map: ctx.file.dirname.includes('examples') ? false : {
|
||||||
|
inline: false,
|
||||||
|
annotation: true,
|
||||||
|
sourcesContent: true
|
||||||
|
},
|
||||||
|
plugins: {
|
||||||
|
autoprefixer: {
|
||||||
|
cascade: false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
@@ -0,0 +1,29 @@
|
|||||||
|
import babel from 'rollup-plugin-babel'
|
||||||
|
|
||||||
|
const pkg = require('../../package')
|
||||||
|
const year = new Date().getFullYear()
|
||||||
|
|
||||||
|
const globals = {
|
||||||
|
jquery: 'jQuery'
|
||||||
|
}
|
||||||
|
|
||||||
|
export default {
|
||||||
|
input : 'build/js/AdminLTE.js',
|
||||||
|
output : {
|
||||||
|
banner: `/*!
|
||||||
|
* AdminLTE v${pkg.version} (${pkg.homepage})
|
||||||
|
* Copyright 2014-${year} ${pkg.author}
|
||||||
|
* Licensed under MIT (https://github.com/ColorlibHQ/AdminLTE/blob/master/LICENSE)
|
||||||
|
*/`,
|
||||||
|
file : 'dist/js/adminlte.js',
|
||||||
|
format: 'umd',
|
||||||
|
globals,
|
||||||
|
name : 'adminlte'
|
||||||
|
},
|
||||||
|
plugins: [
|
||||||
|
babel({
|
||||||
|
exclude: 'node_modules/**',
|
||||||
|
externalHelpers: true
|
||||||
|
})
|
||||||
|
]
|
||||||
|
}
|
||||||
@@ -0,0 +1,23 @@
|
|||||||
|
import ControlSidebar from './ControlSidebar'
|
||||||
|
import Layout from './Layout'
|
||||||
|
import PushMenu from './PushMenu'
|
||||||
|
import Treeview from './Treeview'
|
||||||
|
import DirectChat from './DirectChat'
|
||||||
|
import TodoList from './TodoList'
|
||||||
|
import CardWidget from './CardWidget'
|
||||||
|
import CardRefresh from './CardRefresh'
|
||||||
|
import Dropdown from './Dropdown'
|
||||||
|
import Toasts from './Toasts'
|
||||||
|
|
||||||
|
export {
|
||||||
|
ControlSidebar,
|
||||||
|
Layout,
|
||||||
|
PushMenu,
|
||||||
|
Treeview,
|
||||||
|
DirectChat,
|
||||||
|
TodoList,
|
||||||
|
CardWidget,
|
||||||
|
CardRefresh,
|
||||||
|
Dropdown,
|
||||||
|
Toasts
|
||||||
|
}
|
||||||
@@ -0,0 +1,168 @@
|
|||||||
|
/**
|
||||||
|
* --------------------------------------------
|
||||||
|
* AdminLTE CardRefresh.js
|
||||||
|
* License MIT
|
||||||
|
* --------------------------------------------
|
||||||
|
*/
|
||||||
|
|
||||||
|
const CardRefresh = (($) => {
|
||||||
|
/**
|
||||||
|
* Constants
|
||||||
|
* ====================================================
|
||||||
|
*/
|
||||||
|
|
||||||
|
const NAME = 'CardRefresh'
|
||||||
|
const DATA_KEY = 'lte.cardrefresh'
|
||||||
|
const EVENT_KEY = `.${DATA_KEY}`
|
||||||
|
const JQUERY_NO_CONFLICT = $.fn[NAME]
|
||||||
|
|
||||||
|
const Event = {
|
||||||
|
LOADED: `loaded${EVENT_KEY}`,
|
||||||
|
OVERLAY_ADDED: `overlay.added${EVENT_KEY}`,
|
||||||
|
OVERLAY_REMOVED: `overlay.removed${EVENT_KEY}`,
|
||||||
|
}
|
||||||
|
|
||||||
|
const ClassName = {
|
||||||
|
CARD: 'card',
|
||||||
|
}
|
||||||
|
|
||||||
|
const Selector = {
|
||||||
|
CARD: `.${ClassName.CARD}`,
|
||||||
|
DATA_REFRESH: '[data-card-widget="card-refresh"]',
|
||||||
|
}
|
||||||
|
|
||||||
|
const Default = {
|
||||||
|
source: '',
|
||||||
|
sourceSelector: '',
|
||||||
|
params: {},
|
||||||
|
trigger: Selector.DATA_REFRESH,
|
||||||
|
content: '.card-body',
|
||||||
|
loadInContent: true,
|
||||||
|
loadOnInit: true,
|
||||||
|
responseType: '',
|
||||||
|
overlayTemplate: '<div class="overlay"><i class="fas fa-2x fa-sync-alt fa-spin"></i></div>',
|
||||||
|
onLoadStart: function () {
|
||||||
|
},
|
||||||
|
onLoadDone: function (response) {
|
||||||
|
return response;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
class CardRefresh {
|
||||||
|
constructor(element, settings) {
|
||||||
|
this._element = element
|
||||||
|
this._parent = element.parents(Selector.CARD).first()
|
||||||
|
this._settings = $.extend({}, Default, settings)
|
||||||
|
this._overlay = $(this._settings.overlayTemplate)
|
||||||
|
|
||||||
|
if (element.hasClass(ClassName.CARD)) {
|
||||||
|
this._parent = element
|
||||||
|
}
|
||||||
|
|
||||||
|
if (this._settings.source === '') {
|
||||||
|
throw new Error('Source url was not defined. Please specify a url in your CardRefresh source option.');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
load() {
|
||||||
|
this._addOverlay()
|
||||||
|
this._settings.onLoadStart.call($(this))
|
||||||
|
|
||||||
|
$.get(this._settings.source, this._settings.params, function (response) {
|
||||||
|
if (this._settings.loadInContent) {
|
||||||
|
if (this._settings.sourceSelector != '') {
|
||||||
|
response = $(response).find(this._settings.sourceSelector).html()
|
||||||
|
}
|
||||||
|
|
||||||
|
this._parent.find(this._settings.content).html(response)
|
||||||
|
}
|
||||||
|
|
||||||
|
this._settings.onLoadDone.call($(this), response)
|
||||||
|
this._removeOverlay();
|
||||||
|
}.bind(this), this._settings.responseType !== '' && this._settings.responseType)
|
||||||
|
|
||||||
|
const loadedEvent = $.Event(Event.LOADED)
|
||||||
|
$(this._element).trigger(loadedEvent)
|
||||||
|
}
|
||||||
|
|
||||||
|
_addOverlay() {
|
||||||
|
this._parent.append(this._overlay)
|
||||||
|
|
||||||
|
const overlayAddedEvent = $.Event(Event.OVERLAY_ADDED)
|
||||||
|
$(this._element).trigger(overlayAddedEvent)
|
||||||
|
};
|
||||||
|
|
||||||
|
_removeOverlay() {
|
||||||
|
this._parent.find(this._overlay).remove()
|
||||||
|
|
||||||
|
const overlayRemovedEvent = $.Event(Event.OVERLAY_REMOVED)
|
||||||
|
$(this._element).trigger(overlayRemovedEvent)
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
// Private
|
||||||
|
|
||||||
|
_init(card) {
|
||||||
|
$(this).find(this._settings.trigger).on('click', () => {
|
||||||
|
this.load()
|
||||||
|
})
|
||||||
|
|
||||||
|
if (this._settings.loadOnInit) {
|
||||||
|
this.load()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Static
|
||||||
|
|
||||||
|
static _jQueryInterface(config) {
|
||||||
|
let data = $(this).data(DATA_KEY)
|
||||||
|
const _options = $.extend({}, Default, $(this).data())
|
||||||
|
|
||||||
|
if (!data) {
|
||||||
|
data = new CardRefresh($(this), _options)
|
||||||
|
$(this).data(DATA_KEY, typeof config === 'string' ? data: config)
|
||||||
|
}
|
||||||
|
|
||||||
|
if (typeof config === 'string' && config.match(/load/)) {
|
||||||
|
data[config]()
|
||||||
|
} else {
|
||||||
|
data._init($(this))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Data API
|
||||||
|
* ====================================================
|
||||||
|
*/
|
||||||
|
|
||||||
|
$(document).on('click', Selector.DATA_REFRESH, function (event) {
|
||||||
|
if (event) {
|
||||||
|
event.preventDefault()
|
||||||
|
}
|
||||||
|
|
||||||
|
CardRefresh._jQueryInterface.call($(this), 'load')
|
||||||
|
})
|
||||||
|
|
||||||
|
$(document).ready(function () {
|
||||||
|
$(Selector.DATA_REFRESH).each(function() {
|
||||||
|
CardRefresh._jQueryInterface.call($(this))
|
||||||
|
})
|
||||||
|
})
|
||||||
|
|
||||||
|
/**
|
||||||
|
* jQuery API
|
||||||
|
* ====================================================
|
||||||
|
*/
|
||||||
|
|
||||||
|
$.fn[NAME] = CardRefresh._jQueryInterface
|
||||||
|
$.fn[NAME].Constructor = CardRefresh
|
||||||
|
$.fn[NAME].noConflict = function () {
|
||||||
|
$.fn[NAME] = JQUERY_NO_CONFLICT
|
||||||
|
return CardRefresh._jQueryInterface
|
||||||
|
}
|
||||||
|
|
||||||
|
return CardRefresh
|
||||||
|
})(jQuery)
|
||||||
|
|
||||||
|
export default CardRefresh
|
||||||
@@ -0,0 +1,253 @@
|
|||||||
|
/**
|
||||||
|
* --------------------------------------------
|
||||||
|
* AdminLTE CardWidget.js
|
||||||
|
* License MIT
|
||||||
|
* --------------------------------------------
|
||||||
|
*/
|
||||||
|
|
||||||
|
const CardWidget = (($) => {
|
||||||
|
/**
|
||||||
|
* Constants
|
||||||
|
* ====================================================
|
||||||
|
*/
|
||||||
|
|
||||||
|
const NAME = 'CardWidget'
|
||||||
|
const DATA_KEY = 'lte.cardwidget'
|
||||||
|
const EVENT_KEY = `.${DATA_KEY}`
|
||||||
|
const JQUERY_NO_CONFLICT = $.fn[NAME]
|
||||||
|
|
||||||
|
const Event = {
|
||||||
|
EXPANDED: `expanded${EVENT_KEY}`,
|
||||||
|
COLLAPSED: `collapsed${EVENT_KEY}`,
|
||||||
|
MAXIMIZED: `maximized${EVENT_KEY}`,
|
||||||
|
MINIMIZED: `minimized${EVENT_KEY}`,
|
||||||
|
REMOVED: `removed${EVENT_KEY}`
|
||||||
|
}
|
||||||
|
|
||||||
|
const ClassName = {
|
||||||
|
CARD: 'card',
|
||||||
|
COLLAPSED: 'collapsed-card',
|
||||||
|
COLLAPSING: 'collapsing-card',
|
||||||
|
EXPANDING: 'expanding-card',
|
||||||
|
WAS_COLLAPSED: 'was-collapsed',
|
||||||
|
MAXIMIZED: 'maximized-card',
|
||||||
|
}
|
||||||
|
|
||||||
|
const Selector = {
|
||||||
|
DATA_REMOVE: '[data-card-widget="remove"]',
|
||||||
|
DATA_COLLAPSE: '[data-card-widget="collapse"]',
|
||||||
|
DATA_MAXIMIZE: '[data-card-widget="maximize"]',
|
||||||
|
CARD: `.${ClassName.CARD}`,
|
||||||
|
CARD_HEADER: '.card-header',
|
||||||
|
CARD_BODY: '.card-body',
|
||||||
|
CARD_FOOTER: '.card-footer',
|
||||||
|
COLLAPSED: `.${ClassName.COLLAPSED}`,
|
||||||
|
}
|
||||||
|
|
||||||
|
const Default = {
|
||||||
|
animationSpeed: 'normal',
|
||||||
|
collapseTrigger: Selector.DATA_COLLAPSE,
|
||||||
|
removeTrigger: Selector.DATA_REMOVE,
|
||||||
|
maximizeTrigger: Selector.DATA_MAXIMIZE,
|
||||||
|
collapseIcon: 'fa-minus',
|
||||||
|
expandIcon: 'fa-plus',
|
||||||
|
maximizeIcon: 'fa-expand',
|
||||||
|
minimizeIcon: 'fa-compress',
|
||||||
|
}
|
||||||
|
|
||||||
|
class CardWidget {
|
||||||
|
constructor(element, settings) {
|
||||||
|
this._element = element
|
||||||
|
this._parent = element.parents(Selector.CARD).first()
|
||||||
|
|
||||||
|
if (element.hasClass(ClassName.CARD)) {
|
||||||
|
this._parent = element
|
||||||
|
}
|
||||||
|
|
||||||
|
this._settings = $.extend({}, Default, settings)
|
||||||
|
}
|
||||||
|
|
||||||
|
collapse() {
|
||||||
|
this._parent.addClass(ClassName.COLLAPSING).children(`${Selector.CARD_BODY}, ${Selector.CARD_FOOTER}`)
|
||||||
|
.slideUp(this._settings.animationSpeed, () => {
|
||||||
|
this._parent.addClass(ClassName.COLLAPSED).removeClass(ClassName.COLLAPSING)
|
||||||
|
})
|
||||||
|
|
||||||
|
this._parent.find('> ' + Selector.CARD_HEADER + ' ' + this._settings.collapseTrigger + ' .' + this._settings.collapseIcon)
|
||||||
|
.addClass(this._settings.expandIcon)
|
||||||
|
.removeClass(this._settings.collapseIcon)
|
||||||
|
|
||||||
|
const collapsed = $.Event(Event.COLLAPSED)
|
||||||
|
|
||||||
|
this._element.trigger(collapsed, this._parent)
|
||||||
|
}
|
||||||
|
|
||||||
|
expand() {
|
||||||
|
this._parent.addClass(ClassName.EXPANDING).children(`${Selector.CARD_BODY}, ${Selector.CARD_FOOTER}`)
|
||||||
|
.slideDown(this._settings.animationSpeed, () => {
|
||||||
|
this._parent.removeClass(ClassName.COLLAPSED).removeClass(ClassName.EXPANDING)
|
||||||
|
})
|
||||||
|
|
||||||
|
this._parent.find('> ' + Selector.CARD_HEADER + ' ' + this._settings.collapseTrigger + ' .' + this._settings.expandIcon)
|
||||||
|
.addClass(this._settings.collapseIcon)
|
||||||
|
.removeClass(this._settings.expandIcon)
|
||||||
|
|
||||||
|
const expanded = $.Event(Event.EXPANDED)
|
||||||
|
|
||||||
|
this._element.trigger(expanded, this._parent)
|
||||||
|
}
|
||||||
|
|
||||||
|
remove() {
|
||||||
|
this._parent.slideUp()
|
||||||
|
|
||||||
|
const removed = $.Event(Event.REMOVED)
|
||||||
|
|
||||||
|
this._element.trigger(removed, this._parent)
|
||||||
|
}
|
||||||
|
|
||||||
|
toggle() {
|
||||||
|
if (this._parent.hasClass(ClassName.COLLAPSED)) {
|
||||||
|
this.expand()
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
this.collapse()
|
||||||
|
}
|
||||||
|
|
||||||
|
maximize() {
|
||||||
|
this._parent.find(this._settings.maximizeTrigger + ' .' + this._settings.maximizeIcon)
|
||||||
|
.addClass(this._settings.minimizeIcon)
|
||||||
|
.removeClass(this._settings.maximizeIcon)
|
||||||
|
this._parent.css({
|
||||||
|
'height': this._parent.height(),
|
||||||
|
'width': this._parent.width(),
|
||||||
|
'transition': 'all .15s'
|
||||||
|
}).delay(150).queue(function(){
|
||||||
|
$(this).addClass(ClassName.MAXIMIZED)
|
||||||
|
$('html').addClass(ClassName.MAXIMIZED)
|
||||||
|
if ($(this).hasClass(ClassName.COLLAPSED)) {
|
||||||
|
$(this).addClass(ClassName.WAS_COLLAPSED)
|
||||||
|
}
|
||||||
|
$(this).dequeue()
|
||||||
|
})
|
||||||
|
|
||||||
|
const maximized = $.Event(Event.MAXIMIZED)
|
||||||
|
|
||||||
|
this._element.trigger(maximized, this._parent)
|
||||||
|
}
|
||||||
|
|
||||||
|
minimize() {
|
||||||
|
this._parent.find(this._settings.maximizeTrigger + ' .' + this._settings.minimizeIcon)
|
||||||
|
.addClass(this._settings.maximizeIcon)
|
||||||
|
.removeClass(this._settings.minimizeIcon)
|
||||||
|
this._parent.css('cssText', 'height:' + this._parent[0].style.height + ' !important;' +
|
||||||
|
'width:' + this._parent[0].style.width + ' !important; transition: all .15s;'
|
||||||
|
).delay(10).queue(function(){
|
||||||
|
$(this).removeClass(ClassName.MAXIMIZED)
|
||||||
|
$('html').removeClass(ClassName.MAXIMIZED)
|
||||||
|
$(this).css({
|
||||||
|
'height': 'inherit',
|
||||||
|
'width': 'inherit'
|
||||||
|
})
|
||||||
|
if ($(this).hasClass(ClassName.WAS_COLLAPSED)) {
|
||||||
|
$(this).removeClass(ClassName.WAS_COLLAPSED)
|
||||||
|
}
|
||||||
|
$(this).dequeue()
|
||||||
|
})
|
||||||
|
|
||||||
|
const MINIMIZED = $.Event(Event.MINIMIZED)
|
||||||
|
|
||||||
|
this._element.trigger(MINIMIZED, this._parent)
|
||||||
|
}
|
||||||
|
|
||||||
|
toggleMaximize() {
|
||||||
|
if (this._parent.hasClass(ClassName.MAXIMIZED)) {
|
||||||
|
this.minimize()
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
this.maximize()
|
||||||
|
}
|
||||||
|
|
||||||
|
// Private
|
||||||
|
|
||||||
|
_init(card) {
|
||||||
|
this._parent = card
|
||||||
|
|
||||||
|
$(this).find(this._settings.collapseTrigger).click(() => {
|
||||||
|
this.toggle()
|
||||||
|
})
|
||||||
|
|
||||||
|
$(this).find(this._settings.maximizeTrigger).click(() => {
|
||||||
|
this.toggleMaximize()
|
||||||
|
})
|
||||||
|
|
||||||
|
$(this).find(this._settings.removeTrigger).click(() => {
|
||||||
|
this.remove()
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// Static
|
||||||
|
|
||||||
|
static _jQueryInterface(config) {
|
||||||
|
let data = $(this).data(DATA_KEY)
|
||||||
|
const _options = $.extend({}, Default, $(this).data())
|
||||||
|
|
||||||
|
if (!data) {
|
||||||
|
data = new CardWidget($(this), _options)
|
||||||
|
$(this).data(DATA_KEY, typeof config === 'string' ? data: config)
|
||||||
|
}
|
||||||
|
|
||||||
|
if (typeof config === 'string' && config.match(/collapse|expand|remove|toggle|maximize|minimize|toggleMaximize/)) {
|
||||||
|
data[config]()
|
||||||
|
} else if (typeof config === 'object') {
|
||||||
|
data._init($(this))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Data API
|
||||||
|
* ====================================================
|
||||||
|
*/
|
||||||
|
|
||||||
|
$(document).on('click', Selector.DATA_COLLAPSE, function (event) {
|
||||||
|
if (event) {
|
||||||
|
event.preventDefault()
|
||||||
|
}
|
||||||
|
|
||||||
|
CardWidget._jQueryInterface.call($(this), 'toggle')
|
||||||
|
})
|
||||||
|
|
||||||
|
$(document).on('click', Selector.DATA_REMOVE, function (event) {
|
||||||
|
if (event) {
|
||||||
|
event.preventDefault()
|
||||||
|
}
|
||||||
|
|
||||||
|
CardWidget._jQueryInterface.call($(this), 'remove')
|
||||||
|
})
|
||||||
|
|
||||||
|
$(document).on('click', Selector.DATA_MAXIMIZE, function (event) {
|
||||||
|
if (event) {
|
||||||
|
event.preventDefault()
|
||||||
|
}
|
||||||
|
|
||||||
|
CardWidget._jQueryInterface.call($(this), 'toggleMaximize')
|
||||||
|
})
|
||||||
|
|
||||||
|
/**
|
||||||
|
* jQuery API
|
||||||
|
* ====================================================
|
||||||
|
*/
|
||||||
|
|
||||||
|
$.fn[NAME] = CardWidget._jQueryInterface
|
||||||
|
$.fn[NAME].Constructor = CardWidget
|
||||||
|
$.fn[NAME].noConflict = function () {
|
||||||
|
$.fn[NAME] = JQUERY_NO_CONFLICT
|
||||||
|
return CardWidget._jQueryInterface
|
||||||
|
}
|
||||||
|
|
||||||
|
return CardWidget
|
||||||
|
})(jQuery)
|
||||||
|
|
||||||
|
export default CardWidget
|
||||||
@@ -0,0 +1,292 @@
|
|||||||
|
/**
|
||||||
|
* --------------------------------------------
|
||||||
|
* AdminLTE ControlSidebar.js
|
||||||
|
* License MIT
|
||||||
|
* --------------------------------------------
|
||||||
|
*/
|
||||||
|
|
||||||
|
const ControlSidebar = (($) => {
|
||||||
|
/**
|
||||||
|
* Constants
|
||||||
|
* ====================================================
|
||||||
|
*/
|
||||||
|
|
||||||
|
const NAME = 'ControlSidebar'
|
||||||
|
const DATA_KEY = 'lte.controlsidebar'
|
||||||
|
const EVENT_KEY = `.${DATA_KEY}`
|
||||||
|
const JQUERY_NO_CONFLICT = $.fn[NAME]
|
||||||
|
const DATA_API_KEY = '.data-api'
|
||||||
|
|
||||||
|
const Event = {
|
||||||
|
COLLAPSED: `collapsed${EVENT_KEY}`,
|
||||||
|
EXPANDED: `expanded${EVENT_KEY}`,
|
||||||
|
}
|
||||||
|
|
||||||
|
const Selector = {
|
||||||
|
CONTROL_SIDEBAR: '.control-sidebar',
|
||||||
|
CONTROL_SIDEBAR_CONTENT: '.control-sidebar-content',
|
||||||
|
DATA_TOGGLE: '[data-widget="control-sidebar"]',
|
||||||
|
CONTENT: '.content-wrapper',
|
||||||
|
HEADER: '.main-header',
|
||||||
|
FOOTER: '.main-footer',
|
||||||
|
}
|
||||||
|
|
||||||
|
const ClassName = {
|
||||||
|
CONTROL_SIDEBAR_ANIMATE: 'control-sidebar-animate',
|
||||||
|
CONTROL_SIDEBAR_OPEN: 'control-sidebar-open',
|
||||||
|
CONTROL_SIDEBAR_SLIDE: 'control-sidebar-slide-open',
|
||||||
|
LAYOUT_FIXED: 'layout-fixed',
|
||||||
|
NAVBAR_FIXED: 'layout-navbar-fixed',
|
||||||
|
NAVBAR_SM_FIXED: 'layout-sm-navbar-fixed',
|
||||||
|
NAVBAR_MD_FIXED: 'layout-md-navbar-fixed',
|
||||||
|
NAVBAR_LG_FIXED: 'layout-lg-navbar-fixed',
|
||||||
|
NAVBAR_XL_FIXED: 'layout-xl-navbar-fixed',
|
||||||
|
FOOTER_FIXED: 'layout-footer-fixed',
|
||||||
|
FOOTER_SM_FIXED: 'layout-sm-footer-fixed',
|
||||||
|
FOOTER_MD_FIXED: 'layout-md-footer-fixed',
|
||||||
|
FOOTER_LG_FIXED: 'layout-lg-footer-fixed',
|
||||||
|
FOOTER_XL_FIXED: 'layout-xl-footer-fixed',
|
||||||
|
}
|
||||||
|
|
||||||
|
const Default = {
|
||||||
|
controlsidebarSlide: true,
|
||||||
|
scrollbarTheme : 'os-theme-light',
|
||||||
|
scrollbarAutoHide: 'l',
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Class Definition
|
||||||
|
* ====================================================
|
||||||
|
*/
|
||||||
|
|
||||||
|
class ControlSidebar {
|
||||||
|
constructor(element, config) {
|
||||||
|
this._element = element
|
||||||
|
this._config = config
|
||||||
|
|
||||||
|
this._init()
|
||||||
|
}
|
||||||
|
|
||||||
|
// Public
|
||||||
|
|
||||||
|
collapse() {
|
||||||
|
// Show the control sidebar
|
||||||
|
if (this._config.controlsidebarSlide) {
|
||||||
|
$('html').addClass(ClassName.CONTROL_SIDEBAR_ANIMATE)
|
||||||
|
$('body').removeClass(ClassName.CONTROL_SIDEBAR_SLIDE).delay(300).queue(function(){
|
||||||
|
$(Selector.CONTROL_SIDEBAR).hide()
|
||||||
|
$('html').removeClass(ClassName.CONTROL_SIDEBAR_ANIMATE)
|
||||||
|
$(this).dequeue()
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
$('body').removeClass(ClassName.CONTROL_SIDEBAR_OPEN)
|
||||||
|
}
|
||||||
|
|
||||||
|
const collapsedEvent = $.Event(Event.COLLAPSED)
|
||||||
|
$(this._element).trigger(collapsedEvent)
|
||||||
|
}
|
||||||
|
|
||||||
|
show() {
|
||||||
|
// Collapse the control sidebar
|
||||||
|
if (this._config.controlsidebarSlide) {
|
||||||
|
$('html').addClass(ClassName.CONTROL_SIDEBAR_ANIMATE)
|
||||||
|
$(Selector.CONTROL_SIDEBAR).show().delay(10).queue(function(){
|
||||||
|
$('body').addClass(ClassName.CONTROL_SIDEBAR_SLIDE).delay(300).queue(function(){
|
||||||
|
$('html').removeClass(ClassName.CONTROL_SIDEBAR_ANIMATE)
|
||||||
|
$(this).dequeue()
|
||||||
|
})
|
||||||
|
$(this).dequeue()
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
$('body').addClass(ClassName.CONTROL_SIDEBAR_OPEN)
|
||||||
|
}
|
||||||
|
|
||||||
|
const expandedEvent = $.Event(Event.EXPANDED)
|
||||||
|
$(this._element).trigger(expandedEvent)
|
||||||
|
}
|
||||||
|
|
||||||
|
toggle() {
|
||||||
|
const shouldClose = $('body').hasClass(ClassName.CONTROL_SIDEBAR_OPEN) || $('body')
|
||||||
|
.hasClass(ClassName.CONTROL_SIDEBAR_SLIDE)
|
||||||
|
if (shouldClose) {
|
||||||
|
// Close the control sidebar
|
||||||
|
this.collapse()
|
||||||
|
} else {
|
||||||
|
// Open the control sidebar
|
||||||
|
this.show()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Private
|
||||||
|
|
||||||
|
_init() {
|
||||||
|
this._fixHeight()
|
||||||
|
this._fixScrollHeight()
|
||||||
|
|
||||||
|
$(window).resize(() => {
|
||||||
|
this._fixHeight()
|
||||||
|
this._fixScrollHeight()
|
||||||
|
})
|
||||||
|
|
||||||
|
$(window).scroll(() => {
|
||||||
|
if ($('body').hasClass(ClassName.CONTROL_SIDEBAR_OPEN) || $('body').hasClass(ClassName.CONTROL_SIDEBAR_SLIDE)) {
|
||||||
|
this._fixScrollHeight()
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
_fixScrollHeight() {
|
||||||
|
const heights = {
|
||||||
|
scroll: $(document).height(),
|
||||||
|
window: $(window).height(),
|
||||||
|
header: $(Selector.HEADER).outerHeight(),
|
||||||
|
footer: $(Selector.FOOTER).outerHeight(),
|
||||||
|
}
|
||||||
|
const positions = {
|
||||||
|
bottom: Math.abs((heights.window + $(window).scrollTop()) - heights.scroll),
|
||||||
|
top: $(window).scrollTop(),
|
||||||
|
}
|
||||||
|
|
||||||
|
let navbarFixed = false;
|
||||||
|
let footerFixed = false;
|
||||||
|
|
||||||
|
if ($('body').hasClass(ClassName.LAYOUT_FIXED)) {
|
||||||
|
if (
|
||||||
|
$('body').hasClass(ClassName.NAVBAR_FIXED)
|
||||||
|
|| $('body').hasClass(ClassName.NAVBAR_SM_FIXED)
|
||||||
|
|| $('body').hasClass(ClassName.NAVBAR_MD_FIXED)
|
||||||
|
|| $('body').hasClass(ClassName.NAVBAR_LG_FIXED)
|
||||||
|
|| $('body').hasClass(ClassName.NAVBAR_XL_FIXED)
|
||||||
|
) {
|
||||||
|
if ($(Selector.HEADER).css("position") === "fixed") {
|
||||||
|
navbarFixed = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (
|
||||||
|
$('body').hasClass(ClassName.FOOTER_FIXED)
|
||||||
|
|| $('body').hasClass(ClassName.FOOTER_SM_FIXED)
|
||||||
|
|| $('body').hasClass(ClassName.FOOTER_MD_FIXED)
|
||||||
|
|| $('body').hasClass(ClassName.FOOTER_LG_FIXED)
|
||||||
|
|| $('body').hasClass(ClassName.FOOTER_XL_FIXED)
|
||||||
|
) {
|
||||||
|
if ($(Selector.FOOTER).css("position") === "fixed") {
|
||||||
|
footerFixed = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (positions.top === 0 && positions.bottom === 0) {
|
||||||
|
$(Selector.CONTROL_SIDEBAR).css('bottom', heights.footer);
|
||||||
|
$(Selector.CONTROL_SIDEBAR).css('top', heights.header);
|
||||||
|
$(Selector.CONTROL_SIDEBAR + ', ' + Selector.CONTROL_SIDEBAR + ' ' + Selector.CONTROL_SIDEBAR_CONTENT).css('height', heights.window - (heights.header + heights.footer))
|
||||||
|
} else if (positions.bottom <= heights.footer) {
|
||||||
|
if (footerFixed === false) {
|
||||||
|
$(Selector.CONTROL_SIDEBAR).css('bottom', heights.footer - positions.bottom);
|
||||||
|
$(Selector.CONTROL_SIDEBAR + ', ' + Selector.CONTROL_SIDEBAR + ' ' + Selector.CONTROL_SIDEBAR_CONTENT).css('height', heights.window - (heights.footer - positions.bottom))
|
||||||
|
} else {
|
||||||
|
$(Selector.CONTROL_SIDEBAR).css('bottom', heights.footer);
|
||||||
|
}
|
||||||
|
} else if (positions.top <= heights.header) {
|
||||||
|
if (navbarFixed === false) {
|
||||||
|
$(Selector.CONTROL_SIDEBAR).css('top', heights.header - positions.top);
|
||||||
|
$(Selector.CONTROL_SIDEBAR + ', ' + Selector.CONTROL_SIDEBAR + ' ' + Selector.CONTROL_SIDEBAR_CONTENT).css('height', heights.window - (heights.header - positions.top))
|
||||||
|
} else {
|
||||||
|
$(Selector.CONTROL_SIDEBAR).css('top', heights.header);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if (navbarFixed === false) {
|
||||||
|
$(Selector.CONTROL_SIDEBAR).css('top', 0);
|
||||||
|
$(Selector.CONTROL_SIDEBAR + ', ' + Selector.CONTROL_SIDEBAR + ' ' + Selector.CONTROL_SIDEBAR_CONTENT).css('height', heights.window)
|
||||||
|
} else {
|
||||||
|
$(Selector.CONTROL_SIDEBAR).css('top', heights.header);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
_fixHeight() {
|
||||||
|
const heights = {
|
||||||
|
window: $(window).height(),
|
||||||
|
header: $(Selector.HEADER).outerHeight(),
|
||||||
|
footer: $(Selector.FOOTER).outerHeight(),
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($('body').hasClass(ClassName.LAYOUT_FIXED)) {
|
||||||
|
let sidebarHeight = heights.window - heights.header;
|
||||||
|
|
||||||
|
if (
|
||||||
|
$('body').hasClass(ClassName.FOOTER_FIXED)
|
||||||
|
|| $('body').hasClass(ClassName.FOOTER_SM_FIXED)
|
||||||
|
|| $('body').hasClass(ClassName.FOOTER_MD_FIXED)
|
||||||
|
|| $('body').hasClass(ClassName.FOOTER_LG_FIXED)
|
||||||
|
|| $('body').hasClass(ClassName.FOOTER_XL_FIXED)
|
||||||
|
) {
|
||||||
|
if ($(Selector.FOOTER).css("position") === "fixed") {
|
||||||
|
sidebarHeight = heights.window - heights.header - heights.footer;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
$(Selector.CONTROL_SIDEBAR + ' ' + Selector.CONTROL_SIDEBAR_CONTENT).css('height', sidebarHeight)
|
||||||
|
|
||||||
|
if (typeof $.fn.overlayScrollbars !== 'undefined') {
|
||||||
|
$(Selector.CONTROL_SIDEBAR + ' ' + Selector.CONTROL_SIDEBAR_CONTENT).overlayScrollbars({
|
||||||
|
className : this._config.scrollbarTheme,
|
||||||
|
sizeAutoCapable : true,
|
||||||
|
scrollbars : {
|
||||||
|
autoHide: this._config.scrollbarAutoHide,
|
||||||
|
clickScrolling : true
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// Static
|
||||||
|
|
||||||
|
static _jQueryInterface(operation) {
|
||||||
|
return this.each(function () {
|
||||||
|
let data = $(this).data(DATA_KEY)
|
||||||
|
const _options = $.extend({}, Default, $(this).data())
|
||||||
|
|
||||||
|
if (!data) {
|
||||||
|
data = new ControlSidebar(this, _options)
|
||||||
|
$(this).data(DATA_KEY, data)
|
||||||
|
}
|
||||||
|
|
||||||
|
if (data[operation] === 'undefined') {
|
||||||
|
throw new Error(`${operation} is not a function`)
|
||||||
|
}
|
||||||
|
|
||||||
|
data[operation]()
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* Data Api implementation
|
||||||
|
* ====================================================
|
||||||
|
*/
|
||||||
|
$(document).on('click', Selector.DATA_TOGGLE, function (event) {
|
||||||
|
event.preventDefault()
|
||||||
|
|
||||||
|
ControlSidebar._jQueryInterface.call($(this), 'toggle')
|
||||||
|
})
|
||||||
|
|
||||||
|
/**
|
||||||
|
* jQuery API
|
||||||
|
* ====================================================
|
||||||
|
*/
|
||||||
|
|
||||||
|
$.fn[NAME] = ControlSidebar._jQueryInterface
|
||||||
|
$.fn[NAME].Constructor = ControlSidebar
|
||||||
|
$.fn[NAME].noConflict = function () {
|
||||||
|
$.fn[NAME] = JQUERY_NO_CONFLICT
|
||||||
|
return ControlSidebar._jQueryInterface
|
||||||
|
}
|
||||||
|
|
||||||
|
return ControlSidebar
|
||||||
|
})(jQuery)
|
||||||
|
|
||||||
|
export default ControlSidebar
|
||||||
|
|
||||||
@@ -0,0 +1,143 @@
|
|||||||
|
/**
|
||||||
|
* --------------------------------------------
|
||||||
|
* AdminLTE Dropdown.js
|
||||||
|
* License MIT
|
||||||
|
* --------------------------------------------
|
||||||
|
*/
|
||||||
|
|
||||||
|
const Dropdown = (($) => {
|
||||||
|
/**
|
||||||
|
* Constants
|
||||||
|
* ====================================================
|
||||||
|
*/
|
||||||
|
|
||||||
|
const NAME = 'Dropdown'
|
||||||
|
const DATA_KEY = 'lte.dropdown'
|
||||||
|
const EVENT_KEY = `.${DATA_KEY}`
|
||||||
|
const JQUERY_NO_CONFLICT = $.fn[NAME]
|
||||||
|
|
||||||
|
const Selector = {
|
||||||
|
NAVBAR: '.navbar',
|
||||||
|
DROPDOWN_MENU: '.dropdown-menu',
|
||||||
|
DROPDOWN_MENU_ACTIVE: '.dropdown-menu.show',
|
||||||
|
DROPDOWN_TOGGLE: '[data-toggle="dropdown"]',
|
||||||
|
}
|
||||||
|
|
||||||
|
const ClassName = {
|
||||||
|
DROPDOWN_HOVER: 'dropdown-hover',
|
||||||
|
DROPDOWN_RIGHT: 'dropdown-menu-right'
|
||||||
|
}
|
||||||
|
|
||||||
|
const Default = {
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Class Definition
|
||||||
|
* ====================================================
|
||||||
|
*/
|
||||||
|
|
||||||
|
class Dropdown {
|
||||||
|
constructor(element, config) {
|
||||||
|
this._config = config
|
||||||
|
this._element = element
|
||||||
|
}
|
||||||
|
|
||||||
|
// Public
|
||||||
|
|
||||||
|
toggleSubmenu() {
|
||||||
|
this._element.siblings().show().toggleClass("show")
|
||||||
|
|
||||||
|
if (! this._element.next().hasClass('show')) {
|
||||||
|
this._element.parents('.dropdown-menu').first().find('.show').removeClass("show").hide()
|
||||||
|
}
|
||||||
|
|
||||||
|
this._element.parents('li.nav-item.dropdown.show').on('hidden.bs.dropdown', function(e) {
|
||||||
|
$('.dropdown-submenu .show').removeClass("show").hide()
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
fixPosition() {
|
||||||
|
let elm = $(Selector.DROPDOWN_MENU_ACTIVE)
|
||||||
|
|
||||||
|
if (elm.length !== 0) {
|
||||||
|
if (elm.hasClass(ClassName.DROPDOWN_RIGHT)) {
|
||||||
|
elm.css('left', 'inherit')
|
||||||
|
elm.css('right', 0)
|
||||||
|
} else {
|
||||||
|
elm.css('left', 0)
|
||||||
|
elm.css('right', 'inherit')
|
||||||
|
}
|
||||||
|
|
||||||
|
let offset = elm.offset()
|
||||||
|
let width = elm.width()
|
||||||
|
let windowWidth = $(window).width()
|
||||||
|
let visiblePart = windowWidth - offset.left
|
||||||
|
|
||||||
|
if (offset.left < 0) {
|
||||||
|
elm.css('left', 'inherit')
|
||||||
|
elm.css('right', (offset.left - 5))
|
||||||
|
} else {
|
||||||
|
if (visiblePart < width) {
|
||||||
|
elm.css('left', 'inherit')
|
||||||
|
elm.css('right', 0)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Static
|
||||||
|
|
||||||
|
static _jQueryInterface(config) {
|
||||||
|
return this.each(function () {
|
||||||
|
let data = $(this).data(DATA_KEY)
|
||||||
|
const _config = $.extend({}, Default, $(this).data())
|
||||||
|
|
||||||
|
if (!data) {
|
||||||
|
data = new Dropdown($(this), _config)
|
||||||
|
$(this).data(DATA_KEY, data)
|
||||||
|
}
|
||||||
|
|
||||||
|
if (config === 'toggleSubmenu' || config == 'fixPosition') {
|
||||||
|
data[config]()
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Data API
|
||||||
|
* ====================================================
|
||||||
|
*/
|
||||||
|
|
||||||
|
$(Selector.DROPDOWN_MENU + ' ' + Selector.DROPDOWN_TOGGLE).on("click", function(event) {
|
||||||
|
event.preventDefault()
|
||||||
|
event.stopPropagation()
|
||||||
|
|
||||||
|
Dropdown._jQueryInterface.call($(this), 'toggleSubmenu')
|
||||||
|
});
|
||||||
|
|
||||||
|
$(Selector.NAVBAR + ' ' + Selector.DROPDOWN_TOGGLE).on("click", function(event) {
|
||||||
|
event.preventDefault()
|
||||||
|
|
||||||
|
setTimeout(function() {
|
||||||
|
Dropdown._jQueryInterface.call($(this), 'fixPosition')
|
||||||
|
}, 1)
|
||||||
|
});
|
||||||
|
|
||||||
|
/**
|
||||||
|
* jQuery API
|
||||||
|
* ====================================================
|
||||||
|
*/
|
||||||
|
|
||||||
|
$.fn[NAME] = Dropdown._jQueryInterface
|
||||||
|
$.fn[NAME].Constructor = Dropdown
|
||||||
|
$.fn[NAME].noConflict = function () {
|
||||||
|
$.fn[NAME] = JQUERY_NO_CONFLICT
|
||||||
|
return Dropdown._jQueryInterface
|
||||||
|
}
|
||||||
|
|
||||||
|
return Dropdown
|
||||||
|
})(jQuery)
|
||||||
|
|
||||||
|
export default Dropdown
|
||||||
@@ -0,0 +1,252 @@
|
|||||||
|
/**
|
||||||
|
* --------------------------------------------
|
||||||
|
* AdminLTE Layout.js
|
||||||
|
* License MIT
|
||||||
|
* --------------------------------------------
|
||||||
|
*/
|
||||||
|
|
||||||
|
const Layout = (($) => {
|
||||||
|
/**
|
||||||
|
* Constants
|
||||||
|
* ====================================================
|
||||||
|
*/
|
||||||
|
|
||||||
|
const NAME = 'Layout'
|
||||||
|
const DATA_KEY = 'lte.layout'
|
||||||
|
const EVENT_KEY = `.${DATA_KEY}`
|
||||||
|
const JQUERY_NO_CONFLICT = $.fn[NAME]
|
||||||
|
|
||||||
|
const Event = {
|
||||||
|
SIDEBAR: 'sidebar'
|
||||||
|
}
|
||||||
|
|
||||||
|
const Selector = {
|
||||||
|
HEADER : '.main-header',
|
||||||
|
MAIN_SIDEBAR : '.main-sidebar',
|
||||||
|
SIDEBAR : '.main-sidebar .sidebar',
|
||||||
|
CONTENT : '.content-wrapper',
|
||||||
|
BRAND : '.brand-link',
|
||||||
|
CONTENT_HEADER : '.content-header',
|
||||||
|
WRAPPER : '.wrapper',
|
||||||
|
CONTROL_SIDEBAR: '.control-sidebar',
|
||||||
|
CONTROL_SIDEBAR_CONTENT: '.control-sidebar-content',
|
||||||
|
CONTROL_SIDEBAR_BTN: '[data-widget="control-sidebar"]',
|
||||||
|
LAYOUT_FIXED : '.layout-fixed',
|
||||||
|
FOOTER : '.main-footer',
|
||||||
|
PUSHMENU_BTN : '[data-widget="pushmenu"]',
|
||||||
|
LOGIN_BOX : '.login-box',
|
||||||
|
REGISTER_BOX : '.register-box'
|
||||||
|
}
|
||||||
|
|
||||||
|
const ClassName = {
|
||||||
|
HOLD : 'hold-transition',
|
||||||
|
SIDEBAR : 'main-sidebar',
|
||||||
|
CONTENT_FIXED : 'content-fixed',
|
||||||
|
SIDEBAR_FOCUSED: 'sidebar-focused',
|
||||||
|
LAYOUT_FIXED : 'layout-fixed',
|
||||||
|
NAVBAR_FIXED : 'layout-navbar-fixed',
|
||||||
|
FOOTER_FIXED : 'layout-footer-fixed',
|
||||||
|
LOGIN_PAGE : 'login-page',
|
||||||
|
REGISTER_PAGE : 'register-page',
|
||||||
|
CONTROL_SIDEBAR_SLIDE_OPEN: 'control-sidebar-slide-open',
|
||||||
|
CONTROL_SIDEBAR_OPEN: 'control-sidebar-open',
|
||||||
|
}
|
||||||
|
|
||||||
|
const Default = {
|
||||||
|
scrollbarTheme : 'os-theme-light',
|
||||||
|
scrollbarAutoHide: 'l',
|
||||||
|
panelAutoHeight: true,
|
||||||
|
loginRegisterAutoHeight: true,
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Class Definition
|
||||||
|
* ====================================================
|
||||||
|
*/
|
||||||
|
|
||||||
|
class Layout {
|
||||||
|
constructor(element, config) {
|
||||||
|
this._config = config
|
||||||
|
this._element = element
|
||||||
|
|
||||||
|
this._init()
|
||||||
|
}
|
||||||
|
|
||||||
|
// Public
|
||||||
|
|
||||||
|
fixLayoutHeight(extra = null) {
|
||||||
|
let control_sidebar = 0
|
||||||
|
|
||||||
|
if ($('body').hasClass(ClassName.CONTROL_SIDEBAR_SLIDE_OPEN) || $('body').hasClass(ClassName.CONTROL_SIDEBAR_OPEN) || extra == 'control_sidebar') {
|
||||||
|
control_sidebar = $(Selector.CONTROL_SIDEBAR_CONTENT).height()
|
||||||
|
}
|
||||||
|
|
||||||
|
const heights = {
|
||||||
|
window: $(window).height(),
|
||||||
|
header: $(Selector.HEADER).length !== 0 ? $(Selector.HEADER).outerHeight() : 0,
|
||||||
|
footer: $(Selector.FOOTER).length !== 0 ? $(Selector.FOOTER).outerHeight() : 0,
|
||||||
|
sidebar: $(Selector.SIDEBAR).length !== 0 ? $(Selector.SIDEBAR).height() : 0,
|
||||||
|
control_sidebar: control_sidebar,
|
||||||
|
}
|
||||||
|
|
||||||
|
const max = this._max(heights)
|
||||||
|
let offset = this._config.panelAutoHeight
|
||||||
|
|
||||||
|
if (offset === true) {
|
||||||
|
offset = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (offset !== false) {
|
||||||
|
if (max == heights.control_sidebar) {
|
||||||
|
$(Selector.CONTENT).css('min-height', (max + offset))
|
||||||
|
} else if (max == heights.window) {
|
||||||
|
$(Selector.CONTENT).css('min-height', (max + offset) - heights.header - heights.footer)
|
||||||
|
} else {
|
||||||
|
$(Selector.CONTENT).css('min-height', (max + offset) - heights.header)
|
||||||
|
}
|
||||||
|
if (this._isFooterFixed()) {
|
||||||
|
$(Selector.CONTENT).css('min-height', parseFloat($(Selector.CONTENT).css('min-height')) + heights.footer);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($('body').hasClass(ClassName.LAYOUT_FIXED)) {
|
||||||
|
if (offset !== false) {
|
||||||
|
$(Selector.CONTENT).css('min-height', (max + offset) - heights.header - heights.footer)
|
||||||
|
}
|
||||||
|
|
||||||
|
if (typeof $.fn.overlayScrollbars !== 'undefined') {
|
||||||
|
$(Selector.SIDEBAR).overlayScrollbars({
|
||||||
|
className : this._config.scrollbarTheme,
|
||||||
|
sizeAutoCapable : true,
|
||||||
|
scrollbars : {
|
||||||
|
autoHide: this._config.scrollbarAutoHide,
|
||||||
|
clickScrolling : true
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
fixLoginRegisterHeight() {
|
||||||
|
if ($(Selector.LOGIN_BOX + ', ' + Selector.REGISTER_BOX).length === 0) {
|
||||||
|
$('body, html').css('height', 'auto')
|
||||||
|
} else if ($(Selector.LOGIN_BOX + ', ' + Selector.REGISTER_BOX).length !== 0) {
|
||||||
|
let box_height = $(Selector.LOGIN_BOX + ', ' + Selector.REGISTER_BOX).height()
|
||||||
|
|
||||||
|
if ($('body').css('min-height') !== box_height) {
|
||||||
|
$('body').css('min-height', box_height)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Private
|
||||||
|
|
||||||
|
_init() {
|
||||||
|
// Activate layout height watcher
|
||||||
|
this.fixLayoutHeight()
|
||||||
|
|
||||||
|
if (this._config.loginRegisterAutoHeight === true) {
|
||||||
|
this.fixLoginRegisterHeight()
|
||||||
|
} else if (Number.isInteger(this._config.loginRegisterAutoHeight)) {
|
||||||
|
setInterval(this.fixLoginRegisterHeight, this._config.loginRegisterAutoHeight);
|
||||||
|
}
|
||||||
|
|
||||||
|
$(Selector.SIDEBAR)
|
||||||
|
.on('collapsed.lte.treeview expanded.lte.treeview', () => {
|
||||||
|
this.fixLayoutHeight()
|
||||||
|
})
|
||||||
|
|
||||||
|
$(Selector.PUSHMENU_BTN)
|
||||||
|
.on('collapsed.lte.pushmenu shown.lte.pushmenu', () => {
|
||||||
|
this.fixLayoutHeight()
|
||||||
|
})
|
||||||
|
|
||||||
|
$(Selector.CONTROL_SIDEBAR_BTN)
|
||||||
|
.on('collapsed.lte.controlsidebar', () => {
|
||||||
|
this.fixLayoutHeight()
|
||||||
|
})
|
||||||
|
.on('expanded.lte.controlsidebar', () => {
|
||||||
|
this.fixLayoutHeight('control_sidebar')
|
||||||
|
})
|
||||||
|
|
||||||
|
$(window).resize(() => {
|
||||||
|
this.fixLayoutHeight()
|
||||||
|
})
|
||||||
|
|
||||||
|
setTimeout(() => {
|
||||||
|
$('body.hold-transition').removeClass('hold-transition')
|
||||||
|
|
||||||
|
}, 50);
|
||||||
|
}
|
||||||
|
|
||||||
|
_max(numbers) {
|
||||||
|
// Calculate the maximum number in a list
|
||||||
|
let max = 0
|
||||||
|
|
||||||
|
Object.keys(numbers).forEach((key) => {
|
||||||
|
if (numbers[key] > max) {
|
||||||
|
max = numbers[key]
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
return max
|
||||||
|
}
|
||||||
|
|
||||||
|
_isFooterFixed() {
|
||||||
|
return $('.main-footer').css('position') === 'fixed';
|
||||||
|
}
|
||||||
|
|
||||||
|
// Static
|
||||||
|
|
||||||
|
static _jQueryInterface(config = '') {
|
||||||
|
return this.each(function () {
|
||||||
|
let data = $(this).data(DATA_KEY)
|
||||||
|
const _options = $.extend({}, Default, $(this).data())
|
||||||
|
|
||||||
|
if (!data) {
|
||||||
|
data = new Layout($(this), _options)
|
||||||
|
$(this).data(DATA_KEY, data)
|
||||||
|
}
|
||||||
|
|
||||||
|
if (config === 'init' || config === '') {
|
||||||
|
data['_init']()
|
||||||
|
} else if (config === 'fixLayoutHeight' || config === 'fixLoginRegisterHeight') {
|
||||||
|
data[config]()
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Data API
|
||||||
|
* ====================================================
|
||||||
|
*/
|
||||||
|
|
||||||
|
$(window).on('load', () => {
|
||||||
|
Layout._jQueryInterface.call($('body'))
|
||||||
|
})
|
||||||
|
|
||||||
|
$(Selector.SIDEBAR + ' a').on('focusin', () => {
|
||||||
|
$(Selector.MAIN_SIDEBAR).addClass(ClassName.SIDEBAR_FOCUSED);
|
||||||
|
})
|
||||||
|
|
||||||
|
$(Selector.SIDEBAR + ' a').on('focusout', () => {
|
||||||
|
$(Selector.MAIN_SIDEBAR).removeClass(ClassName.SIDEBAR_FOCUSED);
|
||||||
|
})
|
||||||
|
|
||||||
|
/**
|
||||||
|
* jQuery API
|
||||||
|
* ====================================================
|
||||||
|
*/
|
||||||
|
|
||||||
|
$.fn[NAME] = Layout._jQueryInterface
|
||||||
|
$.fn[NAME].Constructor = Layout
|
||||||
|
$.fn[NAME].noConflict = function () {
|
||||||
|
$.fn[NAME] = JQUERY_NO_CONFLICT
|
||||||
|
return Layout._jQueryInterface
|
||||||
|
}
|
||||||
|
|
||||||
|
return Layout
|
||||||
|
})(jQuery)
|
||||||
|
|
||||||
|
export default Layout
|
||||||
@@ -0,0 +1,225 @@
|
|||||||
|
/**
|
||||||
|
* --------------------------------------------
|
||||||
|
* AdminLTE PushMenu.js
|
||||||
|
* License MIT
|
||||||
|
* --------------------------------------------
|
||||||
|
*/
|
||||||
|
|
||||||
|
const PushMenu = (($) => {
|
||||||
|
/**
|
||||||
|
* Constants
|
||||||
|
* ====================================================
|
||||||
|
*/
|
||||||
|
|
||||||
|
const NAME = 'PushMenu'
|
||||||
|
const DATA_KEY = 'lte.pushmenu'
|
||||||
|
const EVENT_KEY = `.${DATA_KEY}`
|
||||||
|
const JQUERY_NO_CONFLICT = $.fn[NAME]
|
||||||
|
|
||||||
|
const Event = {
|
||||||
|
COLLAPSED: `collapsed${EVENT_KEY}`,
|
||||||
|
SHOWN: `shown${EVENT_KEY}`
|
||||||
|
}
|
||||||
|
|
||||||
|
const Default = {
|
||||||
|
autoCollapseSize: 992,
|
||||||
|
enableRemember: false,
|
||||||
|
noTransitionAfterReload: true
|
||||||
|
}
|
||||||
|
|
||||||
|
const Selector = {
|
||||||
|
TOGGLE_BUTTON: '[data-widget="pushmenu"]',
|
||||||
|
SIDEBAR_MINI: '.sidebar-mini',
|
||||||
|
SIDEBAR_COLLAPSED: '.sidebar-collapse',
|
||||||
|
BODY: 'body',
|
||||||
|
OVERLAY: '#sidebar-overlay',
|
||||||
|
WRAPPER: '.wrapper'
|
||||||
|
}
|
||||||
|
|
||||||
|
const ClassName = {
|
||||||
|
COLLAPSED: 'sidebar-collapse',
|
||||||
|
OPEN: 'sidebar-open',
|
||||||
|
CLOSED: 'sidebar-closed'
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Class Definition
|
||||||
|
* ====================================================
|
||||||
|
*/
|
||||||
|
|
||||||
|
class PushMenu {
|
||||||
|
constructor(element, options) {
|
||||||
|
this._element = element
|
||||||
|
this._options = $.extend({}, Default, options)
|
||||||
|
|
||||||
|
if (!$(Selector.OVERLAY).length) {
|
||||||
|
this._addOverlay()
|
||||||
|
}
|
||||||
|
|
||||||
|
this._init()
|
||||||
|
}
|
||||||
|
|
||||||
|
// Public
|
||||||
|
|
||||||
|
expand() {
|
||||||
|
if (this._options.autoCollapseSize) {
|
||||||
|
if ($(window).width() <= this._options.autoCollapseSize) {
|
||||||
|
$(Selector.BODY).addClass(ClassName.OPEN)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
$(Selector.BODY).removeClass(ClassName.COLLAPSED).removeClass(ClassName.CLOSED)
|
||||||
|
|
||||||
|
if(this._options.enableRemember) {
|
||||||
|
localStorage.setItem(`remember${EVENT_KEY}`, ClassName.OPEN)
|
||||||
|
}
|
||||||
|
|
||||||
|
const shownEvent = $.Event(Event.SHOWN)
|
||||||
|
$(this._element).trigger(shownEvent)
|
||||||
|
}
|
||||||
|
|
||||||
|
collapse() {
|
||||||
|
if (this._options.autoCollapseSize) {
|
||||||
|
if ($(window).width() <= this._options.autoCollapseSize) {
|
||||||
|
$(Selector.BODY).removeClass(ClassName.OPEN).addClass(ClassName.CLOSED)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
$(Selector.BODY).addClass(ClassName.COLLAPSED)
|
||||||
|
|
||||||
|
if(this._options.enableRemember) {
|
||||||
|
localStorage.setItem(`remember${EVENT_KEY}`, ClassName.COLLAPSED)
|
||||||
|
}
|
||||||
|
|
||||||
|
const collapsedEvent = $.Event(Event.COLLAPSED)
|
||||||
|
$(this._element).trigger(collapsedEvent)
|
||||||
|
}
|
||||||
|
|
||||||
|
toggle() {
|
||||||
|
if (!$(Selector.BODY).hasClass(ClassName.COLLAPSED)) {
|
||||||
|
this.collapse()
|
||||||
|
} else {
|
||||||
|
this.expand()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
autoCollapse(resize = false) {
|
||||||
|
if (this._options.autoCollapseSize) {
|
||||||
|
if ($(window).width() <= this._options.autoCollapseSize) {
|
||||||
|
if (!$(Selector.BODY).hasClass(ClassName.OPEN)) {
|
||||||
|
this.collapse()
|
||||||
|
}
|
||||||
|
} else if (resize == true) {
|
||||||
|
if ($(Selector.BODY).hasClass(ClassName.OPEN)) {
|
||||||
|
$(Selector.BODY).removeClass(ClassName.OPEN)
|
||||||
|
} else if($(Selector.BODY).hasClass(ClassName.CLOSED)) {
|
||||||
|
this.expand()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
remember() {
|
||||||
|
if(this._options.enableRemember) {
|
||||||
|
let toggleState = localStorage.getItem(`remember${EVENT_KEY}`)
|
||||||
|
if (toggleState == ClassName.COLLAPSED){
|
||||||
|
if (this._options.noTransitionAfterReload) {
|
||||||
|
$("body").addClass('hold-transition').addClass(ClassName.COLLAPSED).delay(50).queue(function() {
|
||||||
|
$(this).removeClass('hold-transition')
|
||||||
|
$(this).dequeue()
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
$("body").addClass(ClassName.COLLAPSED)
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if (this._options.noTransitionAfterReload) {
|
||||||
|
$("body").addClass('hold-transition').removeClass(ClassName.COLLAPSED).delay(50).queue(function() {
|
||||||
|
$(this).removeClass('hold-transition')
|
||||||
|
$(this).dequeue()
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
$("body").removeClass(ClassName.COLLAPSED)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Private
|
||||||
|
|
||||||
|
_init() {
|
||||||
|
this.remember()
|
||||||
|
this.autoCollapse()
|
||||||
|
|
||||||
|
$(window).resize(() => {
|
||||||
|
this.autoCollapse(true)
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
_addOverlay() {
|
||||||
|
const overlay = $('<div />', {
|
||||||
|
id: 'sidebar-overlay'
|
||||||
|
})
|
||||||
|
|
||||||
|
overlay.on('click', () => {
|
||||||
|
this.collapse()
|
||||||
|
})
|
||||||
|
|
||||||
|
$(Selector.WRAPPER).append(overlay)
|
||||||
|
}
|
||||||
|
|
||||||
|
// Static
|
||||||
|
|
||||||
|
static _jQueryInterface(operation) {
|
||||||
|
return this.each(function () {
|
||||||
|
let data = $(this).data(DATA_KEY)
|
||||||
|
const _options = $.extend({}, Default, $(this).data())
|
||||||
|
|
||||||
|
if (!data) {
|
||||||
|
data = new PushMenu(this, _options)
|
||||||
|
$(this).data(DATA_KEY, data)
|
||||||
|
}
|
||||||
|
|
||||||
|
if (typeof operation === 'string' && operation.match(/collapse|expand|toggle/)) {
|
||||||
|
data[operation]()
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Data API
|
||||||
|
* ====================================================
|
||||||
|
*/
|
||||||
|
|
||||||
|
$(document).on('click', Selector.TOGGLE_BUTTON, (event) => {
|
||||||
|
event.preventDefault()
|
||||||
|
|
||||||
|
let button = event.currentTarget
|
||||||
|
|
||||||
|
if ($(button).data('widget') !== 'pushmenu') {
|
||||||
|
button = $(button).closest(Selector.TOGGLE_BUTTON)
|
||||||
|
}
|
||||||
|
|
||||||
|
PushMenu._jQueryInterface.call($(button), 'toggle')
|
||||||
|
})
|
||||||
|
|
||||||
|
$(window).on('load', () => {
|
||||||
|
PushMenu._jQueryInterface.call($(Selector.TOGGLE_BUTTON))
|
||||||
|
})
|
||||||
|
|
||||||
|
/**
|
||||||
|
* jQuery API
|
||||||
|
* ====================================================
|
||||||
|
*/
|
||||||
|
|
||||||
|
$.fn[NAME] = PushMenu._jQueryInterface
|
||||||
|
$.fn[NAME].Constructor = PushMenu
|
||||||
|
$.fn[NAME].noConflict = function () {
|
||||||
|
$.fn[NAME] = JQUERY_NO_CONFLICT
|
||||||
|
return PushMenu._jQueryInterface
|
||||||
|
}
|
||||||
|
|
||||||
|
return PushMenu
|
||||||
|
})(jQuery)
|
||||||
|
|
||||||
|
export default PushMenu
|
||||||
@@ -0,0 +1,185 @@
|
|||||||
|
/**
|
||||||
|
* --------------------------------------------
|
||||||
|
* AdminLTE Treeview.js
|
||||||
|
* License MIT
|
||||||
|
* --------------------------------------------
|
||||||
|
*/
|
||||||
|
|
||||||
|
const Treeview = (($) => {
|
||||||
|
/**
|
||||||
|
* Constants
|
||||||
|
* ====================================================
|
||||||
|
*/
|
||||||
|
|
||||||
|
const NAME = 'Treeview'
|
||||||
|
const DATA_KEY = 'lte.treeview'
|
||||||
|
const EVENT_KEY = `.${DATA_KEY}`
|
||||||
|
const JQUERY_NO_CONFLICT = $.fn[NAME]
|
||||||
|
|
||||||
|
const Event = {
|
||||||
|
SELECTED : `selected${EVENT_KEY}`,
|
||||||
|
EXPANDED : `expanded${EVENT_KEY}`,
|
||||||
|
COLLAPSED : `collapsed${EVENT_KEY}`,
|
||||||
|
LOAD_DATA_API: `load${EVENT_KEY}`
|
||||||
|
}
|
||||||
|
|
||||||
|
const Selector = {
|
||||||
|
LI : '.nav-item',
|
||||||
|
LINK : '.nav-link',
|
||||||
|
TREEVIEW_MENU: '.nav-treeview',
|
||||||
|
OPEN : '.menu-open',
|
||||||
|
DATA_WIDGET : '[data-widget="treeview"]'
|
||||||
|
}
|
||||||
|
|
||||||
|
const ClassName = {
|
||||||
|
LI : 'nav-item',
|
||||||
|
LINK : 'nav-link',
|
||||||
|
TREEVIEW_MENU : 'nav-treeview',
|
||||||
|
OPEN : 'menu-open',
|
||||||
|
SIDEBAR_COLLAPSED: 'sidebar-collapse'
|
||||||
|
}
|
||||||
|
|
||||||
|
const Default = {
|
||||||
|
trigger : `${Selector.DATA_WIDGET} ${Selector.LINK}`,
|
||||||
|
animationSpeed : 300,
|
||||||
|
accordion : true,
|
||||||
|
expandSidebar : false,
|
||||||
|
sidebarButtonSelector: '[data-widget="pushmenu"]'
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Class Definition
|
||||||
|
* ====================================================
|
||||||
|
*/
|
||||||
|
class Treeview {
|
||||||
|
constructor(element, config) {
|
||||||
|
this._config = config
|
||||||
|
this._element = element
|
||||||
|
}
|
||||||
|
|
||||||
|
// Public
|
||||||
|
|
||||||
|
init() {
|
||||||
|
this._setupListeners()
|
||||||
|
}
|
||||||
|
|
||||||
|
expand(treeviewMenu, parentLi) {
|
||||||
|
const expandedEvent = $.Event(Event.EXPANDED)
|
||||||
|
|
||||||
|
if (this._config.accordion) {
|
||||||
|
const openMenuLi = parentLi.siblings(Selector.OPEN).first()
|
||||||
|
const openTreeview = openMenuLi.find(Selector.TREEVIEW_MENU).first()
|
||||||
|
this.collapse(openTreeview, openMenuLi)
|
||||||
|
}
|
||||||
|
|
||||||
|
treeviewMenu.stop().slideDown(this._config.animationSpeed, () => {
|
||||||
|
parentLi.addClass(ClassName.OPEN)
|
||||||
|
$(this._element).trigger(expandedEvent)
|
||||||
|
})
|
||||||
|
|
||||||
|
if (this._config.expandSidebar) {
|
||||||
|
this._expandSidebar()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
collapse(treeviewMenu, parentLi) {
|
||||||
|
const collapsedEvent = $.Event(Event.COLLAPSED)
|
||||||
|
|
||||||
|
treeviewMenu.stop().slideUp(this._config.animationSpeed, () => {
|
||||||
|
parentLi.removeClass(ClassName.OPEN)
|
||||||
|
$(this._element).trigger(collapsedEvent)
|
||||||
|
treeviewMenu.find(`${Selector.OPEN} > ${Selector.TREEVIEW_MENU}`).slideUp()
|
||||||
|
treeviewMenu.find(Selector.OPEN).removeClass(ClassName.OPEN)
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
toggle(event) {
|
||||||
|
|
||||||
|
const $relativeTarget = $(event.currentTarget)
|
||||||
|
const $parent = $relativeTarget.parent()
|
||||||
|
|
||||||
|
let treeviewMenu = $parent.find('> ' + Selector.TREEVIEW_MENU)
|
||||||
|
|
||||||
|
if (!treeviewMenu.is(Selector.TREEVIEW_MENU)) {
|
||||||
|
|
||||||
|
if (!$parent.is(Selector.LI)) {
|
||||||
|
treeviewMenu = $parent.parent().find('> ' + Selector.TREEVIEW_MENU)
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!treeviewMenu.is(Selector.TREEVIEW_MENU)) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
event.preventDefault()
|
||||||
|
|
||||||
|
const parentLi = $relativeTarget.parents(Selector.LI).first()
|
||||||
|
const isOpen = parentLi.hasClass(ClassName.OPEN)
|
||||||
|
|
||||||
|
if (isOpen) {
|
||||||
|
this.collapse($(treeviewMenu), parentLi)
|
||||||
|
} else {
|
||||||
|
this.expand($(treeviewMenu), parentLi)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Private
|
||||||
|
|
||||||
|
_setupListeners() {
|
||||||
|
$(document).on('click', this._config.trigger, (event) => {
|
||||||
|
this.toggle(event)
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
_expandSidebar() {
|
||||||
|
if ($('body').hasClass(ClassName.SIDEBAR_COLLAPSED)) {
|
||||||
|
$(this._config.sidebarButtonSelector).PushMenu('expand')
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Static
|
||||||
|
|
||||||
|
static _jQueryInterface(config) {
|
||||||
|
return this.each(function () {
|
||||||
|
let data = $(this).data(DATA_KEY)
|
||||||
|
const _options = $.extend({}, Default, $(this).data())
|
||||||
|
|
||||||
|
if (!data) {
|
||||||
|
data = new Treeview($(this), _options)
|
||||||
|
$(this).data(DATA_KEY, data)
|
||||||
|
}
|
||||||
|
|
||||||
|
if (config === 'init') {
|
||||||
|
data[config]()
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Data API
|
||||||
|
* ====================================================
|
||||||
|
*/
|
||||||
|
|
||||||
|
$(window).on(Event.LOAD_DATA_API, () => {
|
||||||
|
$(Selector.DATA_WIDGET).each(function () {
|
||||||
|
Treeview._jQueryInterface.call($(this), 'init')
|
||||||
|
})
|
||||||
|
})
|
||||||
|
|
||||||
|
/**
|
||||||
|
* jQuery API
|
||||||
|
* ====================================================
|
||||||
|
*/
|
||||||
|
|
||||||
|
$.fn[NAME] = Treeview._jQueryInterface
|
||||||
|
$.fn[NAME].Constructor = Treeview
|
||||||
|
$.fn[NAME].noConflict = function () {
|
||||||
|
$.fn[NAME] = JQUERY_NO_CONFLICT
|
||||||
|
return Treeview._jQueryInterface
|
||||||
|
}
|
||||||
|
|
||||||
|
return Treeview
|
||||||
|
})(jQuery)
|
||||||
|
|
||||||
|
export default Treeview
|
||||||
@@ -0,0 +1,21 @@
|
|||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* PHP Dynamic Qr code
|
||||||
|
*
|
||||||
|
* @author Giandonato Inverso <info@giandonatoinverso.it>
|
||||||
|
* @copyright Copyright (c) 2020-2021
|
||||||
|
* @license https://opensource.org/licenses/MIT MIT License
|
||||||
|
* @link https://github.com/giandonatoinverso/PHP-Dynamic-Qr-code
|
||||||
|
* @version 1.0
|
||||||
|
*/
|
||||||
|
|
||||||
|
session_start();
|
||||||
|
require_once 'includes/auth_validate.php';
|
||||||
|
require_once './config/config.php';
|
||||||
|
|
||||||
|
// Dynamic qrcode class
|
||||||
|
require_once BASE_PATH . '/lib/Dynamic_Qrcode/Dynamic_Qrcode.php';
|
||||||
|
$dynamic_qrcode = new Dynamic_Qrcode();
|
||||||
|
|
||||||
|
if ($_SERVER['REQUEST_METHOD'] === 'POST')
|
||||||
|
$dynamic_qrcode->cancel($_POST['del_id'], $_POST['filename']);
|
||||||
@@ -0,0 +1,21 @@
|
|||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* PHP Dynamic Qr code
|
||||||
|
*
|
||||||
|
* @author Giandonato Inverso <info@giandonatoinverso.it>
|
||||||
|
* @copyright Copyright (c) 2020-2021
|
||||||
|
* @license https://opensource.org/licenses/MIT MIT License
|
||||||
|
* @link https://github.com/giandonatoinverso/PHP-Dynamic-Qr-code
|
||||||
|
* @version 1.0
|
||||||
|
*/
|
||||||
|
|
||||||
|
session_start();
|
||||||
|
require_once 'includes/auth_validate.php';
|
||||||
|
require_once './config/config.php';
|
||||||
|
|
||||||
|
// Dynamic qrcode class
|
||||||
|
require_once BASE_PATH . '/lib/Static_Qrcode/Static_Qrcode.php';
|
||||||
|
$static_qrcode = new Static_Qrcode();
|
||||||
|
|
||||||
|
if ($_SERVER['REQUEST_METHOD'] === 'POST')
|
||||||
|
$static_qrcode->cancel($_POST['del_id'], $_POST['filename']);
|
||||||
@@ -0,0 +1,22 @@
|
|||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* PHP Dynamic Qr code
|
||||||
|
*
|
||||||
|
* @author Giandonato Inverso <info@giandonatoinverso.it>
|
||||||
|
* @copyright Copyright (c) 2020-2021
|
||||||
|
* @license https://opensource.org/licenses/MIT MIT License
|
||||||
|
* @link https://github.com/giandonatoinverso/PHP-Dynamic-Qr-code
|
||||||
|
* @version 1.0
|
||||||
|
*/
|
||||||
|
|
||||||
|
session_start();
|
||||||
|
require_once 'includes/auth_validate.php';
|
||||||
|
require_once './config/config.php';
|
||||||
|
|
||||||
|
// Users class
|
||||||
|
require_once BASE_PATH . '/lib/Users/Users.php';
|
||||||
|
$Users = new Users();
|
||||||
|
|
||||||
|
// Delete a user using user_id
|
||||||
|
if ($_SERVER['REQUEST_METHOD'] === 'POST')
|
||||||
|
$Users->cancel($_POST['del_id']);
|
||||||
@@ -0,0 +1,445 @@
|
|||||||
|
/*!
|
||||||
|
* AdminLTE v3.0.5
|
||||||
|
* Only Pages
|
||||||
|
* Author: Colorlib
|
||||||
|
* Website: AdminLTE.io <http://adminlte.io>
|
||||||
|
* License: Open source - MIT <http://opensource.org/licenses/MIT>
|
||||||
|
*/
|
||||||
|
.close, .mailbox-attachment-close {
|
||||||
|
float: right;
|
||||||
|
font-size: 1.5rem;
|
||||||
|
font-weight: 700;
|
||||||
|
line-height: 1;
|
||||||
|
color: #000;
|
||||||
|
text-shadow: 0 1px 0 #ffffff;
|
||||||
|
opacity: .5;
|
||||||
|
}
|
||||||
|
|
||||||
|
.close:hover, .mailbox-attachment-close:hover {
|
||||||
|
color: #000;
|
||||||
|
text-decoration: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.close:not(:disabled):not(.disabled):hover, .mailbox-attachment-close:not(:disabled):not(.disabled):hover, .close:not(:disabled):not(.disabled):focus, .mailbox-attachment-close:not(:disabled):not(.disabled):focus {
|
||||||
|
opacity: .75;
|
||||||
|
}
|
||||||
|
|
||||||
|
button.close, button.mailbox-attachment-close {
|
||||||
|
padding: 0;
|
||||||
|
background-color: transparent;
|
||||||
|
border: 0;
|
||||||
|
appearance: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
a.close.disabled, a.disabled.mailbox-attachment-close {
|
||||||
|
pointer-events: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.mailbox-messages > .table {
|
||||||
|
margin: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.mailbox-controls {
|
||||||
|
padding: 5px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.mailbox-controls.with-border {
|
||||||
|
border-bottom: 1px solid rgba(0, 0, 0, 0.125);
|
||||||
|
}
|
||||||
|
|
||||||
|
.mailbox-read-info {
|
||||||
|
border-bottom: 1px solid rgba(0, 0, 0, 0.125);
|
||||||
|
padding: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.mailbox-read-info h3 {
|
||||||
|
font-size: 20px;
|
||||||
|
margin: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.mailbox-read-info h5 {
|
||||||
|
margin: 0;
|
||||||
|
padding: 5px 0 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.mailbox-read-time {
|
||||||
|
color: #999;
|
||||||
|
font-size: 13px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.mailbox-read-message {
|
||||||
|
padding: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.mailbox-attachments {
|
||||||
|
padding-left: 0;
|
||||||
|
list-style: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.mailbox-attachments li {
|
||||||
|
border: 1px solid #eee;
|
||||||
|
float: left;
|
||||||
|
margin-bottom: 10px;
|
||||||
|
margin-right: 10px;
|
||||||
|
width: 200px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.mailbox-attachment-name {
|
||||||
|
color: #666;
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
|
|
||||||
|
.mailbox-attachment-icon,
|
||||||
|
.mailbox-attachment-info,
|
||||||
|
.mailbox-attachment-size {
|
||||||
|
display: block;
|
||||||
|
}
|
||||||
|
|
||||||
|
.mailbox-attachment-info {
|
||||||
|
background: #f8f9fa;
|
||||||
|
padding: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.mailbox-attachment-size {
|
||||||
|
color: #999;
|
||||||
|
font-size: 12px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.mailbox-attachment-size > span {
|
||||||
|
display: inline-block;
|
||||||
|
padding-top: 0.75rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.mailbox-attachment-icon {
|
||||||
|
color: #666;
|
||||||
|
font-size: 65px;
|
||||||
|
max-height: 132.5px;
|
||||||
|
padding: 20px 10px;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.mailbox-attachment-icon.has-img {
|
||||||
|
padding: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.mailbox-attachment-icon.has-img > img {
|
||||||
|
height: auto;
|
||||||
|
max-width: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.lockscreen {
|
||||||
|
background: #e9ecef;
|
||||||
|
}
|
||||||
|
|
||||||
|
.lockscreen .lockscreen-name {
|
||||||
|
font-weight: 600;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.lockscreen-logo {
|
||||||
|
font-size: 35px;
|
||||||
|
font-weight: 300;
|
||||||
|
margin-bottom: 25px;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.lockscreen-logo a {
|
||||||
|
color: #495057;
|
||||||
|
}
|
||||||
|
|
||||||
|
.lockscreen-wrapper {
|
||||||
|
margin: 0 auto;
|
||||||
|
margin-top: 10%;
|
||||||
|
max-width: 400px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.lockscreen-item {
|
||||||
|
border-radius: 4px;
|
||||||
|
background: #ffffff;
|
||||||
|
margin: 10px auto 30px;
|
||||||
|
padding: 0;
|
||||||
|
position: relative;
|
||||||
|
width: 290px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.lockscreen-image {
|
||||||
|
border-radius: 50%;
|
||||||
|
background: #ffffff;
|
||||||
|
left: -10px;
|
||||||
|
padding: 5px;
|
||||||
|
position: absolute;
|
||||||
|
top: -25px;
|
||||||
|
z-index: 10;
|
||||||
|
}
|
||||||
|
|
||||||
|
.lockscreen-image > img {
|
||||||
|
border-radius: 50%;
|
||||||
|
height: 70px;
|
||||||
|
width: 70px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.lockscreen-credentials {
|
||||||
|
margin-left: 70px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.lockscreen-credentials .form-control {
|
||||||
|
border: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.lockscreen-credentials .btn {
|
||||||
|
background-color: #ffffff;
|
||||||
|
border: 0;
|
||||||
|
padding: 0 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.lockscreen-footer {
|
||||||
|
margin-top: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.login-logo,
|
||||||
|
.register-logo {
|
||||||
|
font-size: 2.1rem;
|
||||||
|
font-weight: 300;
|
||||||
|
margin-bottom: .9rem;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.login-logo a,
|
||||||
|
.register-logo a {
|
||||||
|
color: #495057;
|
||||||
|
}
|
||||||
|
|
||||||
|
.login-page,
|
||||||
|
.register-page {
|
||||||
|
align-items: center;
|
||||||
|
background: #e9ecef;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
height: 100vh;
|
||||||
|
justify-content: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.login-box,
|
||||||
|
.register-box {
|
||||||
|
width: 360px;
|
||||||
|
}
|
||||||
|
|
||||||
|
@media (max-width: 576px) {
|
||||||
|
.login-box,
|
||||||
|
.register-box {
|
||||||
|
margin-top: .5rem;
|
||||||
|
width: 90%;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.login-card-body,
|
||||||
|
.register-card-body {
|
||||||
|
background: #ffffff;
|
||||||
|
border-top: 0;
|
||||||
|
color: #666;
|
||||||
|
padding: 20px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.login-card-body .input-group .form-control,
|
||||||
|
.register-card-body .input-group .form-control {
|
||||||
|
border-right: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.login-card-body .input-group .form-control:focus,
|
||||||
|
.register-card-body .input-group .form-control:focus {
|
||||||
|
box-shadow: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.login-card-body .input-group .form-control:focus ~ .input-group-append .input-group-text,
|
||||||
|
.register-card-body .input-group .form-control:focus ~ .input-group-append .input-group-text {
|
||||||
|
border-color: #80bdff;
|
||||||
|
}
|
||||||
|
|
||||||
|
.login-card-body .input-group .form-control.is-valid:focus,
|
||||||
|
.register-card-body .input-group .form-control.is-valid:focus {
|
||||||
|
box-shadow: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.login-card-body .input-group .form-control.is-valid ~ .input-group-append .input-group-text,
|
||||||
|
.register-card-body .input-group .form-control.is-valid ~ .input-group-append .input-group-text {
|
||||||
|
border-color: #28a745;
|
||||||
|
}
|
||||||
|
|
||||||
|
.login-card-body .input-group .form-control.is-invalid:focus,
|
||||||
|
.register-card-body .input-group .form-control.is-invalid:focus {
|
||||||
|
box-shadow: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.login-card-body .input-group .form-control.is-invalid ~ .input-group-append .input-group-text,
|
||||||
|
.register-card-body .input-group .form-control.is-invalid ~ .input-group-append .input-group-text {
|
||||||
|
border-color: #dc3545;
|
||||||
|
}
|
||||||
|
|
||||||
|
.login-card-body .input-group .input-group-text,
|
||||||
|
.register-card-body .input-group .input-group-text {
|
||||||
|
background-color: transparent;
|
||||||
|
border-bottom-right-radius: 0.25rem;
|
||||||
|
border-left: 0;
|
||||||
|
border-top-right-radius: 0.25rem;
|
||||||
|
color: #777;
|
||||||
|
transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
|
||||||
|
}
|
||||||
|
|
||||||
|
.login-box-msg,
|
||||||
|
.register-box-msg {
|
||||||
|
margin: 0;
|
||||||
|
padding: 0 20px 20px;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.social-auth-links {
|
||||||
|
margin: 10px 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.error-page {
|
||||||
|
margin: 20px auto 0;
|
||||||
|
width: 600px;
|
||||||
|
}
|
||||||
|
|
||||||
|
@media (max-width: 767.98px) {
|
||||||
|
.error-page {
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.error-page > .headline {
|
||||||
|
float: left;
|
||||||
|
font-size: 100px;
|
||||||
|
font-weight: 300;
|
||||||
|
}
|
||||||
|
|
||||||
|
@media (max-width: 767.98px) {
|
||||||
|
.error-page > .headline {
|
||||||
|
float: none;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.error-page > .error-content {
|
||||||
|
display: block;
|
||||||
|
margin-left: 190px;
|
||||||
|
}
|
||||||
|
|
||||||
|
@media (max-width: 767.98px) {
|
||||||
|
.error-page > .error-content {
|
||||||
|
margin-left: 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.error-page > .error-content > h3 {
|
||||||
|
font-size: 25px;
|
||||||
|
font-weight: 300;
|
||||||
|
}
|
||||||
|
|
||||||
|
@media (max-width: 767.98px) {
|
||||||
|
.error-page > .error-content > h3 {
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.invoice {
|
||||||
|
background: #ffffff;
|
||||||
|
border: 1px solid rgba(0, 0, 0, 0.125);
|
||||||
|
position: relative;
|
||||||
|
}
|
||||||
|
|
||||||
|
.invoice-title {
|
||||||
|
margin-top: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.profile-user-img {
|
||||||
|
border: 3px solid #adb5bd;
|
||||||
|
margin: 0 auto;
|
||||||
|
padding: 3px;
|
||||||
|
width: 100px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.profile-username {
|
||||||
|
font-size: 21px;
|
||||||
|
margin-top: 5px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.post {
|
||||||
|
border-bottom: 1px solid #adb5bd;
|
||||||
|
color: #666;
|
||||||
|
margin-bottom: 15px;
|
||||||
|
padding-bottom: 15px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.post:last-of-type {
|
||||||
|
border-bottom: 0;
|
||||||
|
margin-bottom: 0;
|
||||||
|
padding-bottom: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.post .user-block {
|
||||||
|
margin-bottom: 15px;
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.post .row {
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.product-image {
|
||||||
|
max-width: 100%;
|
||||||
|
height: auto;
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.product-image-thumbs {
|
||||||
|
align-items: stretch;
|
||||||
|
display: flex;
|
||||||
|
margin-top: 2rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.product-image-thumb {
|
||||||
|
box-shadow: 0 1px 2px rgba(0, 0, 0, 0.075);
|
||||||
|
border-radius: 0.25rem;
|
||||||
|
background-color: #ffffff;
|
||||||
|
border: 1px solid #dee2e6;
|
||||||
|
display: flex;
|
||||||
|
margin-right: 1rem;
|
||||||
|
max-width: 7rem;
|
||||||
|
padding: 0.5rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.product-image-thumb img {
|
||||||
|
max-width: 100%;
|
||||||
|
height: auto;
|
||||||
|
align-self: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.product-image-thumb:hover {
|
||||||
|
opacity: 0.5;
|
||||||
|
}
|
||||||
|
|
||||||
|
.product-share a {
|
||||||
|
margin-right: .5rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.projects td {
|
||||||
|
vertical-align: middle;
|
||||||
|
}
|
||||||
|
|
||||||
|
.projects .list-inline {
|
||||||
|
margin-bottom: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.projects img.table-avatar,
|
||||||
|
.projects .table-avatar img {
|
||||||
|
border-radius: 50%;
|
||||||
|
display: inline;
|
||||||
|
width: 2.5rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.projects .project-state {
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*# sourceMappingURL=adminlte.pages.css.map */
|
||||||
|
After Width: | Height: | Size: 7.5 KiB |
|
After Width: | Height: | Size: 1.2 KiB |
|
After Width: | Height: | Size: 8.3 KiB |
|
After Width: | Height: | Size: 14 KiB |
|
After Width: | Height: | Size: 8.6 KiB |
|
After Width: | Height: | Size: 9.6 KiB |
|
After Width: | Height: | Size: 7.8 KiB |
|
After Width: | Height: | Size: 121 KiB |
|
After Width: | Height: | Size: 43 KiB |
|
After Width: | Height: | Size: 373 B |
@@ -0,0 +1,424 @@
|
|||||||
|
/**
|
||||||
|
* AdminLTE Demo Menu
|
||||||
|
* ------------------
|
||||||
|
*/
|
||||||
|
(function ($) {
|
||||||
|
'use strict'
|
||||||
|
|
||||||
|
var $sidebar = $('.control-sidebar')
|
||||||
|
var $container = $('<div />', {
|
||||||
|
class: 'p-3 control-sidebar-content'
|
||||||
|
})
|
||||||
|
|
||||||
|
$sidebar.append($container)
|
||||||
|
|
||||||
|
var navbar_dark_skins = [
|
||||||
|
'navbar-primary',
|
||||||
|
'navbar-secondary',
|
||||||
|
'navbar-info',
|
||||||
|
'navbar-success',
|
||||||
|
'navbar-danger',
|
||||||
|
'navbar-indigo',
|
||||||
|
'navbar-purple',
|
||||||
|
'navbar-pink',
|
||||||
|
'navbar-navy',
|
||||||
|
'navbar-lightblue',
|
||||||
|
'navbar-teal',
|
||||||
|
'navbar-cyan',
|
||||||
|
'navbar-dark',
|
||||||
|
'navbar-gray-dark',
|
||||||
|
'navbar-gray',
|
||||||
|
]
|
||||||
|
|
||||||
|
var navbar_light_skins = [
|
||||||
|
'navbar-light',
|
||||||
|
'navbar-warning',
|
||||||
|
'navbar-white',
|
||||||
|
'navbar-orange',
|
||||||
|
]
|
||||||
|
|
||||||
|
$container.append(
|
||||||
|
'<h5>Customize</h5><hr class="mb-2"/>'
|
||||||
|
)
|
||||||
|
|
||||||
|
var $no_border_checkbox = $('<input />', {
|
||||||
|
type : 'checkbox',
|
||||||
|
value : 1,
|
||||||
|
checked: $('.main-header').hasClass('border-bottom-0'),
|
||||||
|
'class': 'mr-1'
|
||||||
|
}).on('click', function () {
|
||||||
|
if ($(this).is(':checked')) {
|
||||||
|
$('.main-header').addClass('border-bottom-0')
|
||||||
|
} else {
|
||||||
|
$('.main-header').removeClass('border-bottom-0')
|
||||||
|
}
|
||||||
|
})
|
||||||
|
var $no_border_container = $('<div />', {'class': 'mb-1'}).append($no_border_checkbox).append('<span>No Navbar border</span>')
|
||||||
|
$container.append($no_border_container)
|
||||||
|
|
||||||
|
var $text_sm_body_checkbox = $('<input />', {
|
||||||
|
type : 'checkbox',
|
||||||
|
value : 1,
|
||||||
|
checked: $('body').hasClass('text-sm'),
|
||||||
|
'class': 'mr-1'
|
||||||
|
}).on('click', function () {
|
||||||
|
if ($(this).is(':checked')) {
|
||||||
|
$('body').addClass('text-sm')
|
||||||
|
} else {
|
||||||
|
$('body').removeClass('text-sm')
|
||||||
|
}
|
||||||
|
})
|
||||||
|
var $text_sm_body_container = $('<div />', {'class': 'mb-1'}).append($text_sm_body_checkbox).append('<span>Body small text</span>')
|
||||||
|
$container.append($text_sm_body_container)
|
||||||
|
|
||||||
|
var $text_sm_header_checkbox = $('<input />', {
|
||||||
|
type : 'checkbox',
|
||||||
|
value : 1,
|
||||||
|
checked: $('.main-header').hasClass('text-sm'),
|
||||||
|
'class': 'mr-1'
|
||||||
|
}).on('click', function () {
|
||||||
|
if ($(this).is(':checked')) {
|
||||||
|
$('.main-header').addClass('text-sm')
|
||||||
|
} else {
|
||||||
|
$('.main-header').removeClass('text-sm')
|
||||||
|
}
|
||||||
|
})
|
||||||
|
var $text_sm_header_container = $('<div />', {'class': 'mb-1'}).append($text_sm_header_checkbox).append('<span>Navbar small text</span>')
|
||||||
|
$container.append($text_sm_header_container)
|
||||||
|
|
||||||
|
var $text_sm_sidebar_checkbox = $('<input />', {
|
||||||
|
type : 'checkbox',
|
||||||
|
value : 1,
|
||||||
|
checked: $('.nav-sidebar').hasClass('text-sm'),
|
||||||
|
'class': 'mr-1'
|
||||||
|
}).on('click', function () {
|
||||||
|
if ($(this).is(':checked')) {
|
||||||
|
$('.nav-sidebar').addClass('text-sm')
|
||||||
|
} else {
|
||||||
|
$('.nav-sidebar').removeClass('text-sm')
|
||||||
|
}
|
||||||
|
})
|
||||||
|
var $text_sm_sidebar_container = $('<div />', {'class': 'mb-1'}).append($text_sm_sidebar_checkbox).append('<span>Sidebar nav small text</span>')
|
||||||
|
$container.append($text_sm_sidebar_container)
|
||||||
|
|
||||||
|
var $text_sm_footer_checkbox = $('<input />', {
|
||||||
|
type : 'checkbox',
|
||||||
|
value : 1,
|
||||||
|
checked: $('.main-footer').hasClass('text-sm'),
|
||||||
|
'class': 'mr-1'
|
||||||
|
}).on('click', function () {
|
||||||
|
if ($(this).is(':checked')) {
|
||||||
|
$('.main-footer').addClass('text-sm')
|
||||||
|
} else {
|
||||||
|
$('.main-footer').removeClass('text-sm')
|
||||||
|
}
|
||||||
|
})
|
||||||
|
var $text_sm_footer_container = $('<div />', {'class': 'mb-1'}).append($text_sm_footer_checkbox).append('<span>Footer small text</span>')
|
||||||
|
$container.append($text_sm_footer_container)
|
||||||
|
|
||||||
|
var $flat_sidebar_checkbox = $('<input />', {
|
||||||
|
type : 'checkbox',
|
||||||
|
value : 1,
|
||||||
|
checked: $('.nav-sidebar').hasClass('nav-flat'),
|
||||||
|
'class': 'mr-1'
|
||||||
|
}).on('click', function () {
|
||||||
|
if ($(this).is(':checked')) {
|
||||||
|
$('.nav-sidebar').addClass('nav-flat')
|
||||||
|
} else {
|
||||||
|
$('.nav-sidebar').removeClass('nav-flat')
|
||||||
|
}
|
||||||
|
})
|
||||||
|
var $flat_sidebar_container = $('<div />', {'class': 'mb-1'}).append($flat_sidebar_checkbox).append('<span>Sidebar nav flat style</span>')
|
||||||
|
$container.append($flat_sidebar_container)
|
||||||
|
|
||||||
|
var $legacy_sidebar_checkbox = $('<input />', {
|
||||||
|
type : 'checkbox',
|
||||||
|
value : 1,
|
||||||
|
checked: $('.nav-sidebar').hasClass('nav-legacy'),
|
||||||
|
'class': 'mr-1'
|
||||||
|
}).on('click', function () {
|
||||||
|
if ($(this).is(':checked')) {
|
||||||
|
$('.nav-sidebar').addClass('nav-legacy')
|
||||||
|
} else {
|
||||||
|
$('.nav-sidebar').removeClass('nav-legacy')
|
||||||
|
}
|
||||||
|
})
|
||||||
|
var $legacy_sidebar_container = $('<div />', {'class': 'mb-1'}).append($legacy_sidebar_checkbox).append('<span>Sidebar nav legacy style</span>')
|
||||||
|
$container.append($legacy_sidebar_container)
|
||||||
|
|
||||||
|
var $compact_sidebar_checkbox = $('<input />', {
|
||||||
|
type : 'checkbox',
|
||||||
|
value : 1,
|
||||||
|
checked: $('.nav-sidebar').hasClass('nav-compact'),
|
||||||
|
'class': 'mr-1'
|
||||||
|
}).on('click', function () {
|
||||||
|
if ($(this).is(':checked')) {
|
||||||
|
$('.nav-sidebar').addClass('nav-compact')
|
||||||
|
} else {
|
||||||
|
$('.nav-sidebar').removeClass('nav-compact')
|
||||||
|
}
|
||||||
|
})
|
||||||
|
var $compact_sidebar_container = $('<div />', {'class': 'mb-1'}).append($compact_sidebar_checkbox).append('<span>Sidebar nav compact</span>')
|
||||||
|
$container.append($compact_sidebar_container)
|
||||||
|
|
||||||
|
var $child_indent_sidebar_checkbox = $('<input />', {
|
||||||
|
type : 'checkbox',
|
||||||
|
value : 1,
|
||||||
|
checked: $('.nav-sidebar').hasClass('nav-child-indent'),
|
||||||
|
'class': 'mr-1'
|
||||||
|
}).on('click', function () {
|
||||||
|
if ($(this).is(':checked')) {
|
||||||
|
$('.nav-sidebar').addClass('nav-child-indent')
|
||||||
|
} else {
|
||||||
|
$('.nav-sidebar').removeClass('nav-child-indent')
|
||||||
|
}
|
||||||
|
})
|
||||||
|
var $child_indent_sidebar_container = $('<div />', {'class': 'mb-1'}).append($child_indent_sidebar_checkbox).append('<span>Sidebar nav child indent</span>')
|
||||||
|
$container.append($child_indent_sidebar_container)
|
||||||
|
|
||||||
|
var $no_expand_sidebar_checkbox = $('<input />', {
|
||||||
|
type : 'checkbox',
|
||||||
|
value : 1,
|
||||||
|
checked: $('.main-sidebar').hasClass('sidebar-no-expand'),
|
||||||
|
'class': 'mr-1'
|
||||||
|
}).on('click', function () {
|
||||||
|
if ($(this).is(':checked')) {
|
||||||
|
$('.main-sidebar').addClass('sidebar-no-expand')
|
||||||
|
} else {
|
||||||
|
$('.main-sidebar').removeClass('sidebar-no-expand')
|
||||||
|
}
|
||||||
|
})
|
||||||
|
var $no_expand_sidebar_container = $('<div />', {'class': 'mb-1'}).append($no_expand_sidebar_checkbox).append('<span>Main Sidebar disable hover/focus auto expand</span>')
|
||||||
|
$container.append($no_expand_sidebar_container)
|
||||||
|
|
||||||
|
var $text_sm_brand_checkbox = $('<input />', {
|
||||||
|
type : 'checkbox',
|
||||||
|
value : 1,
|
||||||
|
checked: $('.brand-link').hasClass('text-sm'),
|
||||||
|
'class': 'mr-1'
|
||||||
|
}).on('click', function () {
|
||||||
|
if ($(this).is(':checked')) {
|
||||||
|
$('.brand-link').addClass('text-sm')
|
||||||
|
} else {
|
||||||
|
$('.brand-link').removeClass('text-sm')
|
||||||
|
}
|
||||||
|
})
|
||||||
|
var $text_sm_brand_container = $('<div />', {'class': 'mb-4'}).append($text_sm_brand_checkbox).append('<span>Brand small text</span>')
|
||||||
|
$container.append($text_sm_brand_container)
|
||||||
|
|
||||||
|
$container.append('<h6>Navbar Variants</h6>')
|
||||||
|
|
||||||
|
var $navbar_variants = $('<div />', {
|
||||||
|
'class': 'd-flex'
|
||||||
|
})
|
||||||
|
var navbar_all_colors = navbar_dark_skins.concat(navbar_light_skins)
|
||||||
|
var $navbar_variants_colors = createSkinBlock(navbar_all_colors, function (e) {
|
||||||
|
var color = $(this).data('color')
|
||||||
|
var $main_header = $('.main-header')
|
||||||
|
$main_header.removeClass('navbar-dark').removeClass('navbar-light')
|
||||||
|
navbar_all_colors.map(function (color) {
|
||||||
|
$main_header.removeClass(color)
|
||||||
|
})
|
||||||
|
|
||||||
|
if (navbar_dark_skins.indexOf(color) > -1) {
|
||||||
|
$main_header.addClass('navbar-dark')
|
||||||
|
} else {
|
||||||
|
$main_header.addClass('navbar-light')
|
||||||
|
}
|
||||||
|
|
||||||
|
$main_header.addClass(color)
|
||||||
|
})
|
||||||
|
|
||||||
|
$navbar_variants.append($navbar_variants_colors)
|
||||||
|
|
||||||
|
$container.append($navbar_variants)
|
||||||
|
|
||||||
|
var sidebar_colors = [
|
||||||
|
'bg-primary',
|
||||||
|
'bg-warning',
|
||||||
|
'bg-info',
|
||||||
|
'bg-danger',
|
||||||
|
'bg-success',
|
||||||
|
'bg-indigo',
|
||||||
|
'bg-lightblue',
|
||||||
|
'bg-navy',
|
||||||
|
'bg-purple',
|
||||||
|
'bg-fuchsia',
|
||||||
|
'bg-pink',
|
||||||
|
'bg-maroon',
|
||||||
|
'bg-orange',
|
||||||
|
'bg-lime',
|
||||||
|
'bg-teal',
|
||||||
|
'bg-olive'
|
||||||
|
]
|
||||||
|
|
||||||
|
var accent_colors = [
|
||||||
|
'accent-primary',
|
||||||
|
'accent-warning',
|
||||||
|
'accent-info',
|
||||||
|
'accent-danger',
|
||||||
|
'accent-success',
|
||||||
|
'accent-indigo',
|
||||||
|
'accent-lightblue',
|
||||||
|
'accent-navy',
|
||||||
|
'accent-purple',
|
||||||
|
'accent-fuchsia',
|
||||||
|
'accent-pink',
|
||||||
|
'accent-maroon',
|
||||||
|
'accent-orange',
|
||||||
|
'accent-lime',
|
||||||
|
'accent-teal',
|
||||||
|
'accent-olive'
|
||||||
|
]
|
||||||
|
|
||||||
|
var sidebar_skins = [
|
||||||
|
'sidebar-dark-primary',
|
||||||
|
'sidebar-dark-warning',
|
||||||
|
'sidebar-dark-info',
|
||||||
|
'sidebar-dark-danger',
|
||||||
|
'sidebar-dark-success',
|
||||||
|
'sidebar-dark-indigo',
|
||||||
|
'sidebar-dark-lightblue',
|
||||||
|
'sidebar-dark-navy',
|
||||||
|
'sidebar-dark-purple',
|
||||||
|
'sidebar-dark-fuchsia',
|
||||||
|
'sidebar-dark-pink',
|
||||||
|
'sidebar-dark-maroon',
|
||||||
|
'sidebar-dark-orange',
|
||||||
|
'sidebar-dark-lime',
|
||||||
|
'sidebar-dark-teal',
|
||||||
|
'sidebar-dark-olive',
|
||||||
|
'sidebar-light-primary',
|
||||||
|
'sidebar-light-warning',
|
||||||
|
'sidebar-light-info',
|
||||||
|
'sidebar-light-danger',
|
||||||
|
'sidebar-light-success',
|
||||||
|
'sidebar-light-indigo',
|
||||||
|
'sidebar-light-lightblue',
|
||||||
|
'sidebar-light-navy',
|
||||||
|
'sidebar-light-purple',
|
||||||
|
'sidebar-light-fuchsia',
|
||||||
|
'sidebar-light-pink',
|
||||||
|
'sidebar-light-maroon',
|
||||||
|
'sidebar-light-orange',
|
||||||
|
'sidebar-light-lime',
|
||||||
|
'sidebar-light-teal',
|
||||||
|
'sidebar-light-olive'
|
||||||
|
]
|
||||||
|
|
||||||
|
$container.append('<h6>Accent Color Variants</h6>')
|
||||||
|
var $accent_variants = $('<div />', {
|
||||||
|
'class': 'd-flex'
|
||||||
|
})
|
||||||
|
$container.append($accent_variants)
|
||||||
|
$container.append(createSkinBlock(accent_colors, function () {
|
||||||
|
var color = $(this).data('color')
|
||||||
|
var accent_class = color
|
||||||
|
var $body = $('body')
|
||||||
|
accent_colors.map(function (skin) {
|
||||||
|
$body.removeClass(skin)
|
||||||
|
})
|
||||||
|
|
||||||
|
$body.addClass(accent_class)
|
||||||
|
}))
|
||||||
|
|
||||||
|
$container.append('<h6>Dark Sidebar Variants</h6>')
|
||||||
|
var $sidebar_variants_dark = $('<div />', {
|
||||||
|
'class': 'd-flex'
|
||||||
|
})
|
||||||
|
$container.append($sidebar_variants_dark)
|
||||||
|
$container.append(createSkinBlock(sidebar_colors, function () {
|
||||||
|
var color = $(this).data('color')
|
||||||
|
var sidebar_class = 'sidebar-dark-' + color.replace('bg-', '')
|
||||||
|
var $sidebar = $('.main-sidebar')
|
||||||
|
sidebar_skins.map(function (skin) {
|
||||||
|
$sidebar.removeClass(skin)
|
||||||
|
})
|
||||||
|
|
||||||
|
$sidebar.addClass(sidebar_class)
|
||||||
|
}))
|
||||||
|
|
||||||
|
$container.append('<h6>Light Sidebar Variants</h6>')
|
||||||
|
var $sidebar_variants_light = $('<div />', {
|
||||||
|
'class': 'd-flex'
|
||||||
|
})
|
||||||
|
$container.append($sidebar_variants_light)
|
||||||
|
$container.append(createSkinBlock(sidebar_colors, function () {
|
||||||
|
var color = $(this).data('color')
|
||||||
|
var sidebar_class = 'sidebar-light-' + color.replace('bg-', '')
|
||||||
|
var $sidebar = $('.main-sidebar')
|
||||||
|
sidebar_skins.map(function (skin) {
|
||||||
|
$sidebar.removeClass(skin)
|
||||||
|
})
|
||||||
|
|
||||||
|
$sidebar.addClass(sidebar_class)
|
||||||
|
}))
|
||||||
|
|
||||||
|
var logo_skins = navbar_all_colors
|
||||||
|
$container.append('<h6>Brand Logo Variants</h6>')
|
||||||
|
var $logo_variants = $('<div />', {
|
||||||
|
'class': 'd-flex'
|
||||||
|
})
|
||||||
|
$container.append($logo_variants)
|
||||||
|
var $clear_btn = $('<a />', {
|
||||||
|
href: 'javascript:void(0)'
|
||||||
|
}).text('clear').on('click', function () {
|
||||||
|
var $logo = $('.brand-link')
|
||||||
|
logo_skins.map(function (skin) {
|
||||||
|
$logo.removeClass(skin)
|
||||||
|
})
|
||||||
|
})
|
||||||
|
$container.append(createSkinBlock(logo_skins, function () {
|
||||||
|
var color = $(this).data('color')
|
||||||
|
var $logo = $('.brand-link')
|
||||||
|
logo_skins.map(function (skin) {
|
||||||
|
$logo.removeClass(skin)
|
||||||
|
})
|
||||||
|
$logo.addClass(color)
|
||||||
|
}).append($clear_btn))
|
||||||
|
|
||||||
|
function createSkinBlock(colors, callback) {
|
||||||
|
var $block = $('<div />', {
|
||||||
|
'class': 'd-flex flex-wrap mb-3'
|
||||||
|
})
|
||||||
|
|
||||||
|
colors.map(function (color) {
|
||||||
|
var $color = $('<div />', {
|
||||||
|
'class': (typeof color === 'object' ? color.join(' ') : color).replace('navbar-', 'bg-').replace('accent-', 'bg-') + ' elevation-2'
|
||||||
|
})
|
||||||
|
|
||||||
|
$block.append($color)
|
||||||
|
|
||||||
|
$color.data('color', color)
|
||||||
|
|
||||||
|
$color.css({
|
||||||
|
width : '40px',
|
||||||
|
height : '20px',
|
||||||
|
borderRadius: '25px',
|
||||||
|
marginRight : 10,
|
||||||
|
marginBottom: 10,
|
||||||
|
opacity : 0.8,
|
||||||
|
cursor : 'pointer'
|
||||||
|
})
|
||||||
|
|
||||||
|
$color.hover(function () {
|
||||||
|
$(this).css({ opacity: 1 }).removeClass('elevation-2').addClass('elevation-4')
|
||||||
|
}, function () {
|
||||||
|
$(this).css({ opacity: 0.8 }).removeClass('elevation-4').addClass('elevation-2')
|
||||||
|
})
|
||||||
|
|
||||||
|
if (callback) {
|
||||||
|
$color.on('click', callback)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
return $block
|
||||||
|
}
|
||||||
|
|
||||||
|
$('.product-image-thumb').on('click', function() {
|
||||||
|
const image_element = $(this).find('img');
|
||||||
|
$('.product-image').prop('src', $(image_element).attr('src'))
|
||||||
|
$('.product-image-thumb.active').removeClass('active');
|
||||||
|
$(this).addClass('active');
|
||||||
|
});
|
||||||
|
})(jQuery)
|
||||||
@@ -0,0 +1,103 @@
|
|||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* PHP Dynamic Qr code
|
||||||
|
*
|
||||||
|
* @author Giandonato Inverso <info@giandonatoinverso.it>
|
||||||
|
* @copyright Copyright (c) 2020-2021
|
||||||
|
* @license https://opensource.org/licenses/MIT MIT License
|
||||||
|
* @link https://github.com/giandonatoinverso/PHP-Dynamic-Qr-code
|
||||||
|
* @version 1.0
|
||||||
|
*/
|
||||||
|
|
||||||
|
session_start();
|
||||||
|
require_once 'config/config.php';
|
||||||
|
require_once BASE_PATH . '/includes/auth_validate.php';
|
||||||
|
|
||||||
|
// Dynamic qrcode class
|
||||||
|
require_once BASE_PATH . '/lib/Dynamic_Qrcode/Dynamic_Qrcode.php';
|
||||||
|
$dynamic_qrcode = new Dynamic_Qrcode();
|
||||||
|
|
||||||
|
// Get DB instance. i.e instance of MYSQLiDB Library
|
||||||
|
$db = getDbInstance();
|
||||||
|
$select = array('id', 'filename', 'identifier', 'link', 'qrcode', 'scan', 'created_at', 'updated_at');
|
||||||
|
|
||||||
|
// Search and order php code
|
||||||
|
$search_fields = array('filename', 'identifier', 'link');
|
||||||
|
require_once BASE_PATH . '/includes/search_order.php';
|
||||||
|
|
||||||
|
// Get current page
|
||||||
|
$page = filter_input(INPUT_GET, 'page', FILTER_SANITIZE_FULL_SPECIAL_CHARS) ?? 1;
|
||||||
|
|
||||||
|
// Set pagination limit
|
||||||
|
$db->pageLimit = 15;
|
||||||
|
|
||||||
|
// Get result of the query
|
||||||
|
$rows = $db->arraybuilder()->paginate('dynamic_qrcodes', $page, $select);
|
||||||
|
$total_pages = $db->totalPages;
|
||||||
|
?>
|
||||||
|
|
||||||
|
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="en">
|
||||||
|
<title>List dynamic - Qrcode Generator</title>
|
||||||
|
<head>
|
||||||
|
<?php include './includes/head.php'; ?>
|
||||||
|
</head>
|
||||||
|
<body class="hold-transition sidebar-mini layout-fixed layout-navbar-fixed layout-footer-fixed">
|
||||||
|
<div class="wrapper">
|
||||||
|
<!-- Navbar -->
|
||||||
|
<?php include './includes/navbar.php'; ?>
|
||||||
|
<!-- /.navbar -->
|
||||||
|
|
||||||
|
<!-- Main Sidebar Container -->
|
||||||
|
<?php include './includes/sidebar.php'; ?>
|
||||||
|
<!-- /.Main Sidebar Container -->
|
||||||
|
|
||||||
|
<!-- Content Wrapper. Contains page content -->
|
||||||
|
<div class="content-wrapper">
|
||||||
|
<!-- Content Header -->
|
||||||
|
<div class="content-header">
|
||||||
|
<div class="container-fluid">
|
||||||
|
<div class="row mb-2">
|
||||||
|
|
||||||
|
<div class="col-sm-6">
|
||||||
|
<h1 class="m-0 text-dark">Dynamic Qr codes</h1>
|
||||||
|
</div><!-- /.col -->
|
||||||
|
|
||||||
|
<div class="col-sm-6">
|
||||||
|
<ol class="breadcrumb float-sm-right">
|
||||||
|
<li class="breadcrumb-item">
|
||||||
|
<a href="add_dynamic.php" class="btn btn-success"><i class="fa fa-plus"></i> Add new</a>
|
||||||
|
</li>
|
||||||
|
</ol>
|
||||||
|
</div><!-- /.col -->
|
||||||
|
</div><!-- /.row -->
|
||||||
|
</div><!-- /.container-fluid -->
|
||||||
|
</div><!-- /.content-header -->
|
||||||
|
|
||||||
|
<!-- Flash message-->
|
||||||
|
<?php include BASE_PATH . '/includes/flash_messages.php'; ?>
|
||||||
|
<!-- /.Flash message-->
|
||||||
|
|
||||||
|
<!-- Filters -->
|
||||||
|
<?php $options = $dynamic_qrcode->setOrderingValues();
|
||||||
|
include BASE_PATH . '/forms/filters.php'; ?>
|
||||||
|
<!-- /.Filters-->
|
||||||
|
|
||||||
|
<!-- Main content -->
|
||||||
|
<section class="content">
|
||||||
|
<div class="container-fluid">
|
||||||
|
|
||||||
|
<!-- Table -->
|
||||||
|
<?php include BASE_PATH . '/forms/dynamic_table.php'; ?>
|
||||||
|
<!-- /.Table -->
|
||||||
|
|
||||||
|
</div><!-- /.container-fluid -->
|
||||||
|
</section>
|
||||||
|
</div><!-- /.content-wrapper -->
|
||||||
|
|
||||||
|
<!-- Footer and scripts -->
|
||||||
|
<?php include './includes/footer.php'; ?>
|
||||||
|
<!-- /.Footer and scripts -->
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
@@ -0,0 +1,95 @@
|
|||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* PHP Dynamic Qr code
|
||||||
|
*
|
||||||
|
* @author Giandonato Inverso <info@giandonatoinverso.it>
|
||||||
|
* @copyright Copyright (c) 2020-2021
|
||||||
|
* @license https://opensource.org/licenses/MIT MIT License
|
||||||
|
* @link https://github.com/giandonatoinverso/PHP-Dynamic-Qr-code
|
||||||
|
* @version 1.0
|
||||||
|
*/
|
||||||
|
|
||||||
|
session_start();
|
||||||
|
require_once 'config/config.php';
|
||||||
|
require_once BASE_PATH . '/includes/auth_validate.php';
|
||||||
|
|
||||||
|
// Users class
|
||||||
|
require_once BASE_PATH . '/lib/Users/Users.php';
|
||||||
|
$Users = new Users();
|
||||||
|
|
||||||
|
// User ID for which we are performing operation
|
||||||
|
$admin_user_id = htmlspecialchars($_GET['admin_user_id'], ENT_QUOTES, 'UTF-8');
|
||||||
|
$operation = htmlspecialchars($_GET['operation'], ENT_QUOTES, 'UTF-8');
|
||||||
|
($operation == 'edit') ? $edit = true : $edit = false;
|
||||||
|
|
||||||
|
// Serve POST request
|
||||||
|
if ($_SERVER['REQUEST_METHOD'] === 'POST')
|
||||||
|
$Users->edit();
|
||||||
|
|
||||||
|
// Select where clause
|
||||||
|
$db = getDbInstance();
|
||||||
|
$db->where('id', $admin_user_id);
|
||||||
|
|
||||||
|
$admin_account = $db->getOne("admin_accounts");
|
||||||
|
?>
|
||||||
|
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="en">
|
||||||
|
<title>Edit admin - Qrcode Generator</title>
|
||||||
|
<head>
|
||||||
|
<?php include './includes/head.php'; ?>
|
||||||
|
</head>
|
||||||
|
<body class="hold-transition sidebar-mini layout-fixed layout-navbar-fixed layout-footer-fixed">
|
||||||
|
<div class="wrapper">
|
||||||
|
<!-- Navbar -->
|
||||||
|
<?php include './includes/navbar.php'; ?>
|
||||||
|
<!-- /.navbar -->
|
||||||
|
|
||||||
|
<!-- Main Sidebar Container -->
|
||||||
|
<?php include './includes/sidebar.php'; ?>
|
||||||
|
<!-- /.Main Sidebar Container -->
|
||||||
|
|
||||||
|
<!-- Content Wrapper. Contains page content -->
|
||||||
|
<div class="content-wrapper">
|
||||||
|
<!-- Content Header (Page header) -->
|
||||||
|
<div class="content-header">
|
||||||
|
<div class="container-fluid">
|
||||||
|
<div class="row mb-2">
|
||||||
|
<div class="col-sm-6">
|
||||||
|
<h1 class="m-0 text-dark"><?php echo (!$edit) ? 'Add' : 'Update'; ?> User</h1>
|
||||||
|
</div><!-- /.col -->
|
||||||
|
</div><!-- /.row -->
|
||||||
|
</div><!-- /.container-fluid -->
|
||||||
|
</div>
|
||||||
|
<!-- /.content-header -->
|
||||||
|
|
||||||
|
<!-- Flash messages -->
|
||||||
|
<?php include BASE_PATH.'/includes/flash_messages.php'; ?>
|
||||||
|
<!-- /.Flash messages -->
|
||||||
|
|
||||||
|
<!-- Main content -->
|
||||||
|
<section class="content">
|
||||||
|
<div class="container-fluid">
|
||||||
|
|
||||||
|
<div class="card card-primary">
|
||||||
|
<div class="card-header">
|
||||||
|
<h3 class="card-title">Enter the requested data</h3>
|
||||||
|
</div>
|
||||||
|
<form class="well form-horizontal" action="" method="post" id="contact_form" enctype="multipart/form-data">
|
||||||
|
<div class="card-body">
|
||||||
|
<?php include BASE_PATH . '/forms/users_form.php'; ?>
|
||||||
|
</div>
|
||||||
|
<div class="card-footer">
|
||||||
|
<button type="submit" class="btn btn-primary">Submit</button>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div><!--/. container-fluid -->
|
||||||
|
</section><!-- /.content -->
|
||||||
|
</div><!-- /.content-wrapper -->
|
||||||
|
|
||||||
|
<!-- Footer and scripts -->
|
||||||
|
<?php include './includes/footer.php'; ?>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
@@ -0,0 +1,112 @@
|
|||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* PHP Dynamic Qr code
|
||||||
|
*
|
||||||
|
* @author Giandonato Inverso <info@giandonatoinverso.it>
|
||||||
|
* @copyright Copyright (c) 2020-2021
|
||||||
|
* @license https://opensource.org/licenses/MIT MIT License
|
||||||
|
* @link https://github.com/giandonatoinverso/PHP-Dynamic-Qr-code
|
||||||
|
* @version 1.0
|
||||||
|
*/
|
||||||
|
|
||||||
|
session_start();
|
||||||
|
require_once 'config/config.php';
|
||||||
|
require_once BASE_PATH.'/includes/auth_validate.php';
|
||||||
|
|
||||||
|
// Dynamic qrcode class
|
||||||
|
require_once BASE_PATH . '/lib/Dynamic_Qrcode/Dynamic_Qrcode.php';
|
||||||
|
$dynamic_qrcode = new Dynamic_Qrcode();
|
||||||
|
|
||||||
|
$dynamic_id = htmlspecialchars($_GET['dynamic_id'], ENT_QUOTES, 'UTF-8');
|
||||||
|
$operation = htmlspecialchars($_GET['operation'], ENT_QUOTES, 'UTF-8');
|
||||||
|
($operation == 'edit') ? $edit = true : $edit = false;
|
||||||
|
$db = getDbInstance();
|
||||||
|
|
||||||
|
// Handle update request. As the form's action attribute is set to the same script, but 'POST' method,
|
||||||
|
if ($_SERVER['REQUEST_METHOD'] === 'POST')
|
||||||
|
$dynamic_qrcode->edit();
|
||||||
|
|
||||||
|
// If edit variable is set, we are performing the update operation.
|
||||||
|
if ($edit)
|
||||||
|
{
|
||||||
|
$db->where('id', $dynamic_id);
|
||||||
|
// Get data to pre-populate the form.
|
||||||
|
$dynamic_qrcode = $db->getOne('dynamic_qrcodes');
|
||||||
|
}
|
||||||
|
?>
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="en">
|
||||||
|
<title>Edit dynamic - Qrcode Generator</title>
|
||||||
|
<head>
|
||||||
|
<?php include './includes/head.php'; ?>
|
||||||
|
</head>
|
||||||
|
<body class="hold-transition sidebar-mini layout-fixed layout-navbar-fixed layout-footer-fixed">
|
||||||
|
<div class="wrapper">
|
||||||
|
<!-- Navbar -->
|
||||||
|
<?php include './includes/navbar.php'; ?>
|
||||||
|
<!-- /.navbar -->
|
||||||
|
|
||||||
|
<!-- Main Sidebar Container -->
|
||||||
|
<?php include './includes/sidebar.php'; ?>
|
||||||
|
<!-- /.Main Sidebar Container -->
|
||||||
|
|
||||||
|
<!-- Content Wrapper. Contains page content -->
|
||||||
|
<div class="content-wrapper">
|
||||||
|
<!-- Content Header (Page header) -->
|
||||||
|
<div class="content-header">
|
||||||
|
<div class="container-fluid">
|
||||||
|
<div class="row mb-2">
|
||||||
|
|
||||||
|
<div class="col-sm-6">
|
||||||
|
<h1 class="m-0 text-dark">Edit Qr codes</h1>
|
||||||
|
</div><!-- /.col -->
|
||||||
|
</div><!-- /.row -->
|
||||||
|
</div><!-- /.container-fluid -->
|
||||||
|
</div>
|
||||||
|
<!-- /.content-header -->
|
||||||
|
|
||||||
|
<!-- Flash messages -->
|
||||||
|
<?php include BASE_PATH.'/includes/flash_messages.php'; ?>
|
||||||
|
<!-- /.Flash messages -->
|
||||||
|
|
||||||
|
<!-- Main content -->
|
||||||
|
<section class="content">
|
||||||
|
<div class="container-fluid">
|
||||||
|
<div class="card card-primary">
|
||||||
|
<div class="card-header">
|
||||||
|
<h3 class="card-title">Enter the requested data</h3>
|
||||||
|
</div>
|
||||||
|
<form class="form" action="" method="post" id="dynamic_form" enctype="multipart/form-data">
|
||||||
|
<div class="card-body">
|
||||||
|
<?php include BASE_PATH.'/forms/edit_dynamic_form.php'; ?>
|
||||||
|
</div>
|
||||||
|
<div class="card-footer">
|
||||||
|
<button type="submit" class="btn btn-primary">Submit</button>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
</div><!--/. container-fluid -->
|
||||||
|
</section><!-- /.content -->
|
||||||
|
</div><!-- /.content-wrapper -->
|
||||||
|
|
||||||
|
<!-- Footer and scripts -->
|
||||||
|
<?php include './includes/footer.php'; ?>
|
||||||
|
|
||||||
|
<!-- Page script -->
|
||||||
|
<script type="text/javascript">
|
||||||
|
$(document).ready(function(){
|
||||||
|
$('#dynamic_form').validate({
|
||||||
|
rules: {
|
||||||
|
filename: {
|
||||||
|
required: true,
|
||||||
|
},
|
||||||
|
link: {
|
||||||
|
required: true,
|
||||||
|
minlength: 3
|
||||||
|
},
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
@@ -0,0 +1,108 @@
|
|||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* PHP Dynamic Qr code
|
||||||
|
*
|
||||||
|
* @author Giandonato Inverso <info@giandonatoinverso.it>
|
||||||
|
* @copyright Copyright (c) 2020-2021
|
||||||
|
* @license https://opensource.org/licenses/MIT MIT License
|
||||||
|
* @link https://github.com/giandonatoinverso/PHP-Dynamic-Qr-code
|
||||||
|
* @version 1.0
|
||||||
|
*/
|
||||||
|
|
||||||
|
session_start();
|
||||||
|
require_once 'config/config.php';
|
||||||
|
require_once BASE_PATH.'/includes/auth_validate.php';
|
||||||
|
|
||||||
|
// Dynamic qrcode class
|
||||||
|
require_once BASE_PATH . '/lib/Static_Qrcode/Static_Qrcode.php';
|
||||||
|
$static_qrcode = new Static_Qrcode();
|
||||||
|
|
||||||
|
$static_id = htmlspecialchars($_GET['static_id'], ENT_QUOTES, 'UTF-8');
|
||||||
|
$operation = htmlspecialchars($_GET['operation'], ENT_QUOTES, 'UTF-8');
|
||||||
|
($operation == 'edit') ? $edit = true : $edit = false;
|
||||||
|
$db = getDbInstance();
|
||||||
|
|
||||||
|
// Handle update request. As the form's action attribute is set to the same script, but 'POST' method,
|
||||||
|
if ($_SERVER['REQUEST_METHOD'] === 'POST')
|
||||||
|
$static_qrcode->edit();
|
||||||
|
|
||||||
|
// If edit variable is set, we are performing the update operation.
|
||||||
|
if ($edit)
|
||||||
|
{
|
||||||
|
$db->where('id', $static_id);
|
||||||
|
// Get data to pre-populate the form.
|
||||||
|
$static_qrcode = $db->getOne('static_qrcodes');
|
||||||
|
}
|
||||||
|
?>
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="en">
|
||||||
|
<title>Edit static - Qrcode Generator</title>
|
||||||
|
<head>
|
||||||
|
<?php include './includes/head.php'; ?>
|
||||||
|
</head>
|
||||||
|
<body class="hold-transition sidebar-mini layout-fixed layout-navbar-fixed layout-footer-fixed">
|
||||||
|
<div class="wrapper">
|
||||||
|
<!-- Navbar -->
|
||||||
|
<?php include './includes/navbar.php'; ?>
|
||||||
|
<!-- /.navbar -->
|
||||||
|
|
||||||
|
<!-- Main Sidebar Container -->
|
||||||
|
<?php include './includes/sidebar.php'; ?>
|
||||||
|
<!-- /.Main Sidebar Container -->
|
||||||
|
|
||||||
|
<!-- Content Wrapper. Contains page content -->
|
||||||
|
<div class="content-wrapper">
|
||||||
|
<!-- Content Header (Page header) -->
|
||||||
|
<div class="content-header">
|
||||||
|
<div class="container-fluid">
|
||||||
|
<div class="row mb-2">
|
||||||
|
|
||||||
|
<div class="col-sm-6">
|
||||||
|
<h1 class="m-0 text-dark">Edit Qr codes</h1>
|
||||||
|
</div><!-- /.col -->
|
||||||
|
</div><!-- /.row -->
|
||||||
|
</div><!-- /.container-fluid -->
|
||||||
|
</div>
|
||||||
|
<!-- /.content-header -->
|
||||||
|
|
||||||
|
<!-- Flash messages -->
|
||||||
|
<?php include BASE_PATH.'/includes/flash_messages.php'; ?>
|
||||||
|
<!-- /.Flash messages -->
|
||||||
|
|
||||||
|
<!-- Main content -->
|
||||||
|
<section class="content">
|
||||||
|
<div class="container-fluid">
|
||||||
|
<div class="card card-primary">
|
||||||
|
<div class="card-header">
|
||||||
|
<h3 class="card-title">Enter the requested data</h3>
|
||||||
|
</div>
|
||||||
|
<form class="form" action="" method="post" id="static_form" enctype="multipart/form-data">
|
||||||
|
<div class="card-body">
|
||||||
|
<?php include BASE_PATH.'/forms/edit_static_form.php'; ?>
|
||||||
|
</div>
|
||||||
|
<div class="card-footer">
|
||||||
|
<button type="submit" class="btn btn-primary">Submit</button>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
</div><!--/. container-fluid -->
|
||||||
|
</section><!-- /.content -->
|
||||||
|
</div><!-- /.content-wrapper -->
|
||||||
|
|
||||||
|
<!-- Footer and scripts -->
|
||||||
|
<?php include './includes/footer.php'; ?>
|
||||||
|
|
||||||
|
<!-- Page script -->
|
||||||
|
<script type="text/javascript">
|
||||||
|
$(document).ready(function(){
|
||||||
|
$('#dynamic_form').validate({
|
||||||
|
rules: {
|
||||||
|
filename: {
|
||||||
|
required: true,
|
||||||
|
},
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||