eliminazione file superflui, spostamento file read.php all'interno del progetto, aggiunta astrazione classe Qrcode, miglioramento download bulk, refactoring generale

Signed-off-by: giandonato.inverso@edempg.it <giandonato.inverso@studenti.unimi.it>
This commit is contained in:
Giandonato Inverso
2023-10-16 01:41:27 +02:00
committed by giandonato.inverso@edempg.it
parent 12e358b87c
commit a2ce4b38b6
516 changed files with 1434 additions and 17640 deletions
+98
View File
@@ -0,0 +1,98 @@
<?php
session_start();
require_once 'config/config.php';
require_once BASE_PATH . '/includes/auth_validate.php';
require_once BASE_PATH . '/lib/Users/Users.php';
$user_instance = new Users();
$edit = false;
if($_SERVER["REQUEST_METHOD"] === "GET" && isset($_GET["edit"]) && $_GET["edit"] == "true" && isset($_GET["id"])) {
$edit = true;
$user = $user_instance->getUser($_GET["id"]);
}
if($_SERVER["REQUEST_METHOD"] === "POST" && isset($_POST["del_id"])) {
$user_instance->deleteUser($_POST["del_id"]);
}
if($_SERVER["REQUEST_METHOD"] === "POST" && isset($_POST["edit"])) {
if(
isset($_POST["user_name"]) &&
isset($_POST["password"]) &&
isset($_POST["admin_type"]) &&
isset($_POST["id"])
)
$user_instance->editUser($_POST);
}
if($_SERVER["REQUEST_METHOD"] === "POST" && !isset($_POST["edit"])) {
if(
isset($_POST["user_name"]) &&
isset($_POST["password"]) &&
isset($_POST["admin_type"])
)
$user_instance->addUser($_POST);
}
?>
<!DOCTYPE html>
<html lang="en">
<title>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/form_users.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>
+82
View File
@@ -0,0 +1,82 @@
<?php
session_start();
require_once 'config/config.php';
require_once BASE_PATH . '/includes/auth_validate.php';
require_once BASE_PATH . '/lib/Users/Users.php';
$db = getDbInstance();
$Users = new Users();
$select = array('id', 'user_name', 'admin_type');
$search_fields = array('user_name');
require_once BASE_PATH . '/includes/search_order.php';
$page = filter_input(INPUT_GET, 'page', FILTER_SANITIZE_FULL_SPECIAL_CHARS) ?? 1;
$db->pageLimit = 15;
$rows = $db->arraybuilder()->paginate('admin_accounts', $page, $select);
$total_pages = $db->totalPages;
?>
<!DOCTYPE html>
<html lang="en">
<title>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="admin_user.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/table_users.php'; ?>
<!-- /.Table -->
</div><!-- /.container-fluid -->
</section>
</div><!-- /.content-wrapper -->
<!-- Footer and scripts -->
<?php include './includes/footer.php'; ?>
<!-- /.Footer and scripts -->
</body>
</html>
+72
View File
@@ -0,0 +1,72 @@
<?php
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');
}
+48
View File
@@ -0,0 +1,48 @@
<?php
session_start();
require_once 'config/config.php';
if ($_SERVER['REQUEST_METHOD'] === 'POST') {
$db = getDbInstance();
$json = json_decode(file_get_contents('php://input'), true);
$action = filter_var($json['action'], FILTER_SANITIZE_STRING);
$params = $json['params'];
$files = [];
$type = filter_var($json['type'], FILTER_SANITIZE_STRING);
if (count($params) == 0) {
echo json_encode([
'data' => 'No qrcodes were selected.',
'status' => 400
]);
exit();
}
foreach ($params as $param) {
$row = $db->where('id', $param);
$row = $db->getOne("{$type}_qrcodes");
$files[] = SAVED_QRCODE_FOLDER . $row['qrcode'];
}
$zip = new ZipArchive();
$relative_dir = SAVED_QRCODE_FOLDER. 'zip/qrcodes_'. $_SESSION['user_id'] .'.zip';
unlink($relative_dir);
$url_path = SAVED_QRCODE_URL . 'zip/qrcodes_'. $_SESSION['user_id'] .'.zip';
$zip->open($relative_dir, ZipArchive::CREATE);
foreach ($files as $file) {
$download_file = file_get_contents($file, true);
$zip->addFromString(basename($file), $download_file);
}
$zip->close();
echo json_encode([
'data' => $url_path,
'status' => 200
]);
exit();
} else {
exit('Direct access to this script not allowed.');
}
?>
+35
View File
@@ -0,0 +1,35 @@
<?php
//Note: This file should be included first in every php page.
require_once ('environment.php');
error_reporting(E_ALL);
ini_set('display_errors', 'On');
define('BASE_PATH', dirname(dirname(__FILE__)));
define('CURRENT_PAGE', basename($_SERVER['REQUEST_URI']));
require_once BASE_PATH . '/lib/MysqliDb/MysqliDb.php';
require_once BASE_PATH . '/helpers/helpers.php';
/* SAVED QR CODES */
//You can change the folder where the qr code will be saved
define('SAVED_QRCODE_FOLDER', './saved_qrcode/');
define('SAVED_QRCODE_DIRECTORY', BASE_PATH.'/saved_qrcode/');
define('SAVED_QRCODE_URL', base_url().'/saved_qrcode/');
//You can change the page name for the redirect and the search parameter (the default is "id")
define('READ_PATH', base_url().'/read.php?id=');
/**
* Get instance of DB object
*/
function getDbInstance() {
return new MysqliDb (Array (
'host' => DATABASE_HOST,
'username' => DATABASE_USER,
'password' => DATABASE_PASSWORD,
'db'=> DATABASE_NAME,
'port' => DATABASE_PORT,
'prefix' => DATABASE_PREFIX,
'charset' => DATABASE_CHARSET));
}
+36
View File
@@ -0,0 +1,36 @@
<?php
/*
|--------------------------------------------------------------------------
| DOCKER INSTALLATION
|--------------------------------------------------------------------------
*/
$docker_cid = getenv('DOCKER_CID');
if(is_string($docker_cid)) {
define('DATABASE_HOST', Getenv('DATABASE_HOST'));
define('DATABASE_PORT', filter_var(Getenv('DATABASE_PORT'), FILTER_VALIDATE_INT));
define('DATABASE_NAME', Getenv('DATABASE_NAME'));
define('DATABASE_USER', Getenv('DATABASE_USER'));
define('DATABASE_PASSWORD', Getenv('DATABASE_PASSWORD'));
// This must have a trailing underscore.
// Example: qr_
define('DATABASE_PREFIX', Getenv('DATABASE_PREFIX'));
define('DATABASE_CHARSET', Getenv('DATABASE_CHARSET'));
} else {
define('DATABASE_HOST', "mariadb");
define('DATABASE_PORT', "3306");
define('DATABASE_NAME', "qrcode");
define('DATABASE_USER', "root");
define('DATABASE_PASSWORD', "root");
// This must have a trailing underscore.
// Example: qr_
define('DATABASE_PREFIX', "");
define('DATABASE_CHARSET', "utf8");
}
/*
|--------------------------------------------------------------------------
| INSTALLATION WITHOUT CONTAINER
|--------------------------------------------------------------------------
*/
?>
+31221
View File
File diff suppressed because it is too large Load Diff
+324
View File
File diff suppressed because one or more lines are too long
+12
View File
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large Load Diff
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
+17314
View File
File diff suppressed because it is too large Load Diff
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large Load Diff
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
+445
View File
@@ -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 */
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large Load Diff
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
+9
View File
@@ -0,0 +1,9 @@
.bulk-action-wrapper {
padding: 10px 0;
}
#err-msg {
display: none;
color: red;
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 7.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 8.3 KiB

BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 8.6 KiB

BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 9.6 KiB

BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 7.8 KiB

BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 121 KiB

BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 43 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 373 B

+1896
View File
File diff suppressed because it is too large Load Diff
+489
View File
@@ -0,0 +1,489 @@
/**
* 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');
});
const bulk_action = $('input[name=bulk-select]');
if (bulk_action) {
bulk_action.on('change', function() {
if ($(this).prop('checked')) {
$('input[name^=action]').each(function() {
$(this).prop('checked', true);
});
} else {
$('input[name^=action]').each(function() {
$(this).prop('checked', false);
});
}
});
}
const bulk_form = $('form#bulk-action');
bulk_form.on('submit', function(e) {
e.preventDefault();
const paramsElements = document.querySelectorAll('input[name^=action]');
console.log(paramsElements);
let params = [];
paramsElements.forEach((val) => {
if (val.checked) {
params.push(val.value);
}
});
const data = {
action: $('select[name=bulk-action]').val(),
params: params,
type: $('input[name=type]').val()
}
$.ajax({
url: window.location.origin + '/bulk_action.php',
method: "POST",
data: JSON.stringify(data),
dataType: "json",
contentType: 'application/json',
success: (res) => {
if (res.status == 200) {
window.location.href = res.data;
$('#err-msg').css('display', 'none');
}
if (res.status == 400) {
$('#err-msg').empty();
$('#err-msg').append('<i class="fas fa-exclamation-circle"></i> ' + res.data);
$('#err-msg').css('display', 'block');
}
},
error: (err) => {
$('#err-msg').empty();
$('#err-msg').append('<i class="fas fa-exclamation-circle"></i> ' + res.data);
$('#err-msg').css('display', 'block');
console.log(err);
}
});
return false;
});
})(jQuery)
+136
View File
@@ -0,0 +1,136 @@
<?php
session_start();
require_once 'config/config.php';
require_once BASE_PATH.'/includes/auth_validate.php';
require_once BASE_PATH . '/lib/DynamicQrcode/DynamicQrcode.php';
$dynamic_qrcode_instance = new DynamicQrcode();
$edit = false;
if($_SERVER["REQUEST_METHOD"] === "GET" && isset($_GET["edit"]) && $_GET["edit"] == "true" && isset($_GET["id"])) {
$edit = true;
$dynamic_qrcode = $dynamic_qrcode_instance->getQrcode($_GET["id"]);
}
if($_SERVER["REQUEST_METHOD"] === "POST" && isset($_POST["del_id"])) {
$dynamic_qrcode_instance->deleteQrcode($_POST["del_id"]);
}
if($_SERVER["REQUEST_METHOD"] === "POST" && isset($_POST["edit"])) {
if(
isset($_POST["identifier"]) &&
isset($_POST["filename"]) &&
isset($_POST["link"]) &&
isset($_POST["state"]) &&
isset($_POST["id"])
)
$dynamic_qrcode_instance->editQrcode($_POST);
}
if($_SERVER["REQUEST_METHOD"] === "POST" && !isset($_POST["edit"])) {
if(
isset($_POST["foreground"]) &&
isset($_POST["background"]) &&
isset($_POST["link"]) &&
isset($_POST["filename"]) &&
isset($_POST["format"])
)
$dynamic_qrcode_instance->addQrcode($_POST);
}
?>
<!DOCTYPE html>
<html lang="en">
<title>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) ? "Edit" : "Add"; ?> Qr code</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
if($edit)
include BASE_PATH.'/forms/form_dynamic_edit.php';
else
include BASE_PATH . '/forms/form_dynamic_add.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>
+83
View File
@@ -0,0 +1,83 @@
<?php
session_start();
require_once 'config/config.php';
require_once BASE_PATH . '/includes/auth_validate.php';
require_once BASE_PATH . '/lib/DynamicQrcode/DynamicQrcode.php';
$db = getDbInstance();
$dynamic_qrcode = new DynamicQrcode();
$select = array('id', 'filename', 'identifier', 'link', 'qrcode', 'scan', 'state', 'created_at', 'updated_at');
$search_fields = array('filename', 'identifier', 'link');
require_once BASE_PATH . '/includes/search_order.php';
$page = filter_input(INPUT_GET, 'page', FILTER_SANITIZE_FULL_SPECIAL_CHARS) ?? 1;
$db->pageLimit = 15;
$rows = $db->arraybuilder()->paginate('dynamic_qrcodes', $page, $select);
$total_pages = $db->totalPages;
?>
<!DOCTYPE html>
<html lang="en">
<title>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="dynamic_qrcode.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/table_dynamic.php'; ?>
<!-- /.Table -->
</div><!-- /.container-fluid -->
</section>
</div><!-- /.content-wrapper -->
<!-- Footer and scripts -->
<?php include './includes/footer.php'; ?>
<!-- /.Footer and scripts -->
</body>
</html>
+61
View File
@@ -0,0 +1,61 @@
<div class="content-header" style="margin-left: -18px">
<div class="container-fluid">
<div class="row">
<div class="col-12">
<form action="">
<div class="col-sm-12 mb-2" style="margin-left: 10px">
<div class="row">
<!-- SEARCH -->
<div class="col-5 col-md-2">
<div class="input-group">
<input type="text" class="form-control" placeholder="Search" id="input_search" name="search_str" value="<?php echo htmlspecialchars($search_str??'', ENT_QUOTES, 'UTF-8'); ?>">
<div class="input-group-append">
<span class="input-group-text">
<i class="fas fa-search"></i>
</span>
</div>
</div>
</div>
<!-- ORDER BY -->
<div class="col-5 col-md-1">
<select name="order_by" class="form-control">
<?php
foreach ($options as $opt_value => $opt_name):
($order_by === $opt_value) ? $selected = 'selected' : $selected = '';
echo ' <option value="' . $opt_value . '" ' . $selected . '>' . $opt_name . '</option>';
endforeach;
?>
</select>
</div>
<!-- ASCENDING ORDER -->
<div class="col-5 col-md-1">
<select name="order_dir" class="form-control" id="input_order">
<option value="Asc" <?php
if ($order_dir == 'Asc') {
echo 'selected';
}
?> >Asc</option>
<option value="Desc" <?php
if ($order_dir == 'Desc') {
echo 'selected';
}
?>>Desc</option>
</select>
</div>
<!-- SUBMIT -->
<div class="col-5 col-md-3">
<input type="submit" value="Go" class="btn btn-primary">
</div>
</div><!-- /.row -->
</div><!-- /.col-sm-12 -->
</form>
</div><!-- /.col-12 -->
</div><!-- /.row -->
</div><!-- /.container-fluid -->
</div><!-- /.content header -->
<hr>
+99
View File
@@ -0,0 +1,99 @@
<fieldset>
<div class="col-sm-12 mb-2">
<div class="row">
<div class="col-6 col-md-3">
<label for="foreground">Foreground *</label>
<div class="input-group my-colorpicker2">
<div class="input-group-prepend">
<span class="input-group-text"><i class="fa fa-qrcode"></i></span>
</div>
<input type="text" class="form-control" id="foreground" name="foreground" value="#000000" required="required">
</div>
</div>
<div class="col-6 col-md-3">
<label for="background">Background *</label>
<div class="input-group my-colorpicker2">
<div class="input-group-prepend">
<span class="input-group-text"><i class="fa fa-qrcode"></i></span>
</div>
<input type="text" class="form-control" id="background" name="background" value="#ffffff" required="required">
</div>
</div>
<div class="col-6 col-md-3">
<label for="level">Precision</label>
<select name="level" class="form-control">
<option value="L">L - Smallest</option>
<option value="M">M - Medium</option>
<option value="Q">Q - High</option>
<option value="H">H - Best</option>
</select>
</div>
<div class="col-6 col-md-3">
<label for="size">Size (px)</label>
<select name="size" class="form-control">
<option value="100">100</option>
<option value="200">200</option>
<option value="300">300</option>
<option value="400">400</option>
<option value="500">500</option>
<option value="600">600</option>
<option value="700">700</option>
<option value="800">800</option>
<option value="900">900</option>
<option value="1000">1000</option>
</select>
</div>
</div>
</div>
<!-- Its use is not recommended. Read the documentation
<div class="form-group">
<label for="logo">Logo</label>
<?php //include 'logo.php' ?>
</div>
-->
<div class="col-sm-4">
<div class="form-group">
<label for="link">URL *</label>
<input type="url" pattern="http.*://.*" name="link" value="" placeholder="https://example.com" class="form-control" required="required" id="link">
</div>
</div>
<div class="col-sm-4">
<div class="form-group">
<label for="identifier">Redirect identifier</label>
<p>It will be automatically generated</p>
</div>
</div>
<div class="col-sm-12 mb-2">
<div class="row">
<div class="col-sm-4">
<div class="form-group">
<label for="filename">Filename *</label>
<input type="text" name="filename" value="" placeholder="My first Qrcode" class="form-control error" required="required" id="filename">
</div>
</div>
<div class="col-6 col-md-1">
<label for="format">Format *</label>
<select name="format" class="form-control" required="required">
<option value="png" selected >PNG</option>
<option value="gif">GIF</option>
<option value="jpeg">JPEG</option>
<option value="jpg">JPG</option>
<option value="svg">SVG</option>
<option value="eps">EPS</option>
</select>
</div>
</div>
</div>
</fieldset>
+40
View File
@@ -0,0 +1,40 @@
<fieldset>
<div class="col-sm-4">
<div class="form-group">
<label for="identifier">Redirect identifier</label>
<input type="text" name="identifier" value="<?php echo htmlspecialchars($edit ? $dynamic_qrcode['identifier'] : '', ENT_QUOTES, 'UTF-8'); ?>" placeholder="Identifier" class="form-control" id="identifier" readonly>
</div>
</div>
<div class="col-sm-4">
<div class="form-group">
<label for="filename">Filename *</label>
<p>N.B. You can change the name of the file visible in the table, however a new qr code will NOT be generated</p>
<input type="text" name="filename" value="<?php echo htmlspecialchars($edit ? $dynamic_qrcode['filename'] : '', ENT_QUOTES, 'UTF-8'); ?>" placeholder="Filename" class="form-control" required="required" id = "filename">
</div>
</div>
<div class="col-sm-4">
<div class="form-group">
<label for="link">URL *</label>
<input type="url" pattern="https?://.*" name="link" value="<?php echo htmlspecialchars($edit ? $dynamic_qrcode['link'] : '', ENT_QUOTES, 'UTF-8'); ?>" placeholder="Link" class="form-control" required="required" id="link">
</div>
</div>
<div class="col-sm-4">
<label for="state">Redirect to url *</label>
<div class="form-group">
<label class="radio-inline">
<input type="radio" name="state" value="enable" <?php echo ($edit &&$dynamic_qrcode['state'] =='enable') ? "checked": "" ; ?> required="required" id="enable"/> Enable</label>
<label class="radio-inline">
<input type="radio" name="state" value="disable" <?php echo ($edit && $dynamic_qrcode['state'] =='disable')? "checked": "" ; ?> required="required" id="disable"/> Disable</label>
</div>
</div>
<input type="hidden" name="id" value="<?php echo $dynamic_qrcode['id'];?>"/>
<input type="hidden" name="edit" value="true"/>
<input type="hidden" name="old_filename" value="<?php echo $dynamic_qrcode['filename'];?>"/>
</fieldset>
+90
View File
@@ -0,0 +1,90 @@
<fieldset>
<div class="card card-primary card-outline card-outline-tabs">
<div class="card-header p-0 border-bottom-0">
<ul class="nav nav-tabs" role="tablist">
<li class="nav-item">
<a class="nav-link active" data-toggle="pill" href="#text" role="tab" aria-controls="custom-tabs-four-home" aria-selected="true">Text <i class="fas fa-align-left"></i></a>
</li>
<li class="nav-item">
<a class="nav-link" data-toggle="pill" href="#email" role="tab" aria-controls="custom-tabs-four-profile" aria-selected="false">Email <i class="far fa-envelope"></i></a>
</li>
<li class="nav-item">
<a class="nav-link" data-toggle="pill" href="#phone" role="tab" aria-controls="custom-tabs-four-messages" aria-selected="false">Phone <i class="fas fa-phone-volume"></i></a>
</li>
<li class="nav-item">
<a class="nav-link" data-toggle="pill" href="#sms" role="tab" aria-controls="custom-tabs-four-settings" aria-selected="false">Sms <i class="far fa-comments"></i></a>
</li>
<li class="nav-item">
<a class="nav-link" data-toggle="pill" href="#whatsapp" role="tab" aria-controls="custom-tabs-four-settings" aria-selected="false">Whatsapp <i class="fab fa-whatsapp"></i></a>
</li>
<li class="nav-item">
<a class="nav-link" data-toggle="pill" href="#skype" role="tab" aria-controls="custom-tabs-four-settings" aria-selected="false">Skype <i class="fab fa-skype"></i></a>
</li>
<li class="nav-item">
<a class="nav-link" data-toggle="pill" href="#location" role="tab" aria-controls="custom-tabs-four-settings" aria-selected="false">Location <i class="fas fa-map-marker-alt"></i></a>
</li>
<li class="nav-item">
<a class="nav-link" data-toggle="pill" href="#vcard" role="tab" aria-controls="custom-tabs-four-settings" aria-selected="false">Vcard 4.0 <i class="far fa-address-card"></i></a>
</li>
<li class="nav-item">
<a class="nav-link" data-toggle="pill" href="#event" role="tab" aria-controls="custom-tabs-four-settings" aria-selected="false">Event <i class="fas fa-calendar-alt"></i></a>
</li>
<li class="nav-item">
<a class="nav-link" data-toggle="pill" href="#bookmark" role="tab" aria-controls="custom-tabs-four-settings" aria-selected="false">Bookmark <i class="far fa-bookmark"></i></a>
</li>
<li class="nav-item">
<a class="nav-link" data-toggle="pill" href="#wifi" role="tab" aria-controls="custom-tabs-four-settings" aria-selected="false">Wifi <i class="fas fa-wifi"></i></a>
</li>
<li class="nav-item">
<a class="nav-link" data-toggle="pill" href="#paypal" role="tab" aria-controls="custom-tabs-four-settings" aria-selected="false">Paypal <i class="fab fa-paypal"></i></a>
</li>
<li class="nav-item">
<a class="nav-link" data-toggle="pill" href="#bitcoin" role="tab" aria-controls="custom-tabs-four-settings" aria-selected="false">Bitcoin <i class="fab fa-bitcoin"></i></a>
</li>
</ul>
</div>
<div class="card-body">
<div class="tab-content" >
<div class="tab-pane fade show active" id="text" role="tabpanel" aria-labelledby="custom-tabs-four-home-tab">
<?php include BASE_PATH . '/forms/static/text.php'; ?>
</div>
<div class="tab-pane fade" id="email" role="tabpanel" aria-labelledby="custom-tabs-four-profile-tab">
<?php include BASE_PATH . '/forms/static/email.php'; ?>
</div>
<div class="tab-pane fade" id="phone" role="tabpanel" aria-labelledby="custom-tabs-four-profile-tab">
<?php include BASE_PATH . '/forms/static/phone.php'; ?>
</div>
<div class="tab-pane fade" id="sms" role="tabpanel" aria-labelledby="custom-tabs-four-profile-tab">
<?php include BASE_PATH . '/forms/static/sms.php'; ?>
</div>
<div class="tab-pane fade" id="whatsapp" role="tabpanel" aria-labelledby="custom-tabs-four-profile-tab">
<?php include BASE_PATH . '/forms/static/whatsapp.php'; ?>
</div>
<div class="tab-pane fade" id="skype" role="tabpanel" aria-labelledby="custom-tabs-four-profile-tab">
<?php include BASE_PATH . '/forms/static/skype.php'; ?>
</div>
<div class="tab-pane fade" id="location" role="tabpanel" aria-labelledby="custom-tabs-four-profile-tab">
<?php include BASE_PATH . '/forms/static/location.php'; ?>
</div>
<div class="tab-pane fade" id="vcard" role="tabpanel" aria-labelledby="custom-tabs-four-profile-tab">
<?php include BASE_PATH . '/forms/static/vcard.php'; ?>
</div>
<div class="tab-pane fade" id="event" role="tabpanel" aria-labelledby="custom-tabs-four-profile-tab">
<?php include BASE_PATH . '/forms/static/event.php'; ?>
</div>
<div class="tab-pane fade" id="bookmark" role="tabpanel" aria-labelledby="custom-tabs-four-profile-tab">
<?php include BASE_PATH . '/forms/static/bookmark.php'; ?>
</div>
<div class="tab-pane fade" id="wifi" role="tabpanel" aria-labelledby="custom-tabs-four-profile-tab">
<?php include BASE_PATH . '/forms/static/wifi.php'; ?>
</div>
<div class="tab-pane fade" id="paypal" role="tabpanel" aria-labelledby="custom-tabs-four-profile-tab">
<?php include BASE_PATH . '/forms/static/paypal.php'; ?>
</div>
<div class="tab-pane fade" id="bitcoin" role="tabpanel" aria-labelledby="custom-tabs-four-profile-tab">
<?php include BASE_PATH . '/forms/static/bitcoin.php'; ?>
</div>
</div>
</div>
</div><!-- /.card -->
</fieldset>
+13
View File
@@ -0,0 +1,13 @@
<fieldset>
<div class="col-sm-4">
<div class="form-group">
<label for="filename">Filename *</label>
<p>N.B. You can change the name of the file visible in the table, however a new qr code will NOT be generated</p>
<input type="text" name="filename" value="<?php echo htmlspecialchars($edit ? $static_qrcode['filename'] : '', ENT_QUOTES, 'UTF-8'); ?>" placeholder="Filename" class="form-control" required="required" id = "filename">
</div>
</div>
<input type="hidden" name="id" value="<?php echo $static_qrcode['id'];?>"/>
<input type="hidden" name="edit" value="true"/>
<input type="hidden" name="old_filename" value="<?php echo $static_qrcode['filename'];?>"/>
</fieldset>
+47
View File
@@ -0,0 +1,47 @@
<fieldset>
<div class="col-sm-4">
<div class="form-group">
<label for="username">Username *</label>
<div class="input-group">
<div class="input-group-prepend">
<span class="input-group-text"><i class="fa fa-user"></i></span>
</div>
<input type="text" name="user_name" placeholder="Username" class="form-control" required="required" value="<?php echo ($edit) ? $user['user_name'] : ''; ?>" autocomplete="off">
</div>
</div>
</div>
<div class="col-sm-4">
<div class="form-group">
<label for="password">Password *</label>
<div class="input-group">
<div class="input-group-prepend">
<span class="input-group-text"><i class="fa fa-lock"></i></span>
</div>
<input type="password" name="password" placeholder="Password" class="form-control" required="required" autocomplete="off">
</div>
</div>
</div>
<div class="col-sm-4">
<label for="user-type">User type *</label>
<div class="form-group">
<div class="radio">
<label class="radio">
<input type="radio" name="admin_type" value="super" required="required" <?php echo ($edit && $user['admin_type'] =='super') ? "checked": "" ; ?>/> Super admin</label>
</div>
<div class="radio">
<label class="radio">
<input type="radio" name="admin_type" value="admin" required="required" <?php echo ($edit && $user['admin_type'] =='admin') ? "checked": "" ; ?>/> Admin</label>
</div>
</div>
</div>
<?php if($edit) { ?>
<input type="hidden" name="id" value="<?php echo $user['id'];?>"/>
<input type="hidden" name="edit" value="true"/>
<?php } ?>
</fieldset>
+1
View File
@@ -0,0 +1 @@
<!-- code for logo -->
+83
View File
@@ -0,0 +1,83 @@
<div class="col-sm-12 mb-2">
<div class="row">
<div class="col-6 col-md-3">
<label for="foreground">Foreground:</label>
<div class="input-group my-colorpicker2">
<div class="input-group-prepend">
<span class="input-group-text"><i class="fa fa-qrcode"></i></span>
</div>
<input type="text" class="form-control" id="foreground" name="foreground" value="#000000">
</div>
</div>
<div class="col-6 col-md-3">
<label for="background">Background:</label>
<div class="input-group my-colorpicker2">
<div class="input-group-prepend">
<span class="input-group-text"><i class="fa fa-qrcode"></i></span>
</div>
<input type="text" class="form-control" id="background" name="background" value="#ffffff">
</div>
</div>
<div class="col-6 col-md-3">
<label for="level">Precision</label>
<select name="level" class="form-control">
<option value="L">L - Smallest</option>
<option value="M">M - Medium</option>
<option value="Q">Q - High</option>
<option value="H">H - Best</option>
</select>
</div>
<div class="col-6 col-md-3">
<label for="size">Size (px)</label>
<select name="size" class="form-control">
<option value="100">100</option>
<option value="200">200</option>
<option value="300">300</option>
<option value="400">400</option>
<option value="500">500</option>
<option value="600">600</option>
<option value="700">700</option>
<option value="800">800</option>
<option value="900">900</option>
<option value="1000">1000</option>
</select>
</div>
</div>
</div>
<!-- Its use is not recommended. Read the documentation
<div class="form-group">
<label for="logo">Logo</label>
<?php //include 'logo.php' ?>
</div>
-->
<div class="col-sm-12 mb-2">
<div class="row">
<div class="col-sm-4">
<div class="form-group">
<label for="filename">Filename *</label>
<input type="text" name="filename" value="" placeholder="My first Qrcode" class="form-control error" required="required" id = "filename">
</div>
</div>
<div class="col-6 col-md-1">
<label for="format">Format</label>
<select name="format" class="form-control">
<option value="png">PNG</option>
<option value="gif">GIF</option>
<option value="jpeg">JPEG</option>
<option value="jpg">JPG</option>
<option value="svg">SVG</option>
<option value="eps">EPS</option>
</select>
</div>
</div>
</div>
<br>
+57
View File
@@ -0,0 +1,57 @@
<form class="form" action="static_qrcode.php?type=bitcoin" method="post" id="static_form" enctype="multipart/form-data">
<?php include BASE_PATH.'/forms/qrcode_options.php'; ?>
<!-- Input forms -->
<div class="col-sm-12 mb-2">
<div class="row">
<div class="col-6 col-md-3">
<div class="form-group">
<label>BTC address *</label>
<input type="text" name="address" value="" placeholder="" class="form-control">
</div>
</div>
<div class="col-6 col-md-3">
<div class="form-group">
<label>Amount *</label>
<div class="input-group">
<input type="number" name="amount" value="" placeholder="" class="form-control" step="0.0001">
<div class="input-group-append">
<span class="input-group-text"><i class="fab fa-bitcoin"></i></span>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="col-sm-12 mb-2">
<div class="row">
<div class="col-6 col-md-3">
<div class="form-group">
<label>Label</label>
<input type="text" name="label" value="" placeholder="Item name" class="form-control">
</div>
</div>
<div class="col-6 col-md-3">
<div class="form-group">
<label>Message</label>
<input type="text" name="message" value="" placeholder="" class="form-control">
</div>
</div>
</div>
</div>
<div class="col-sm-12 mb-2">
<div class="row">
<div class="col-6 col-md-3">
<button type="submit" class="btn btn-primary">Submit</button>
</div>
</div>
</div>
</form>
+30
View File
@@ -0,0 +1,30 @@
<form class="form" action="static_qrcode.php?type=bookmark" method="post" id="static_form" enctype="multipart/form-data">
<?php include BASE_PATH.'/forms/qrcode_options.php'; ?>
<!-- Input forms -->
<div class="col-sm-12 mb-2">
<div class="row">
<div class="col-6 col-md-3">
<div class="form-group">
<label>URL *</label>
<input type="text" name="url" value="" placeholder="" class="form-control">
</div>
</div>
<div class="col-6 col-md-3">
<div class="form-group">
<label>Title </label>
<input type="text" name="title" value="" placeholder="" class="form-control">
</div>
</div>
</div>
</div>
<div class="col-sm-12 mb-2">
<div class="row">
<div class="col-6 col-md-3">
<button type="submit" class="btn btn-primary">Submit</button>
</div>
</div>
</div>
</form>
+218
View File
@@ -0,0 +1,218 @@
<option data-countryCode="US" value="1" Selected>USA (+1)</option>
<option data-countryCode="GB" value="44">UK (+44)</option>
<optgroup label="Other countries">
<option data-countryCode="DZ" value="213">Algeria (+213)</option>
<option data-countryCode="AD" value="376">Andorra (+376)</option>
<option data-countryCode="AO" value="244">Angola (+244)</option>
<option data-countryCode="AI" value="1264">Anguilla (+1264)</option>
<option data-countryCode="AG" value="1268">Antigua &amp; Barbuda (+1268)</option>
<option data-countryCode="AR" value="54">Argentina (+54)</option>
<option data-countryCode="AM" value="374">Armenia (+374)</option>
<option data-countryCode="AW" value="297">Aruba (+297)</option>
<option data-countryCode="AU" value="61">Australia (+61)</option>
<option data-countryCode="AT" value="43">Austria (+43)</option>
<option data-countryCode="AZ" value="994">Azerbaijan (+994)</option>
<option data-countryCode="BS" value="1242">Bahamas (+1242)</option>
<option data-countryCode="BH" value="973">Bahrain (+973)</option>
<option data-countryCode="BD" value="880">Bangladesh (+880)</option>
<option data-countryCode="BB" value="1246">Barbados (+1246)</option>
<option data-countryCode="BY" value="375">Belarus (+375)</option>
<option data-countryCode="BE" value="32">Belgium (+32)</option>
<option data-countryCode="BZ" value="501">Belize (+501)</option>
<option data-countryCode="BJ" value="229">Benin (+229)</option>
<option data-countryCode="BM" value="1441">Bermuda (+1441)</option>
<option data-countryCode="BT" value="975">Bhutan (+975)</option>
<option data-countryCode="BO" value="591">Bolivia (+591)</option>
<option data-countryCode="BA" value="387">Bosnia Herzegovina (+387)</option>
<option data-countryCode="BW" value="267">Botswana (+267)</option>
<option data-countryCode="BR" value="55">Brazil (+55)</option>
<option data-countryCode="BN" value="673">Brunei (+673)</option>
<option data-countryCode="BG" value="359">Bulgaria (+359)</option>
<option data-countryCode="BF" value="226">Burkina Faso (+226)</option>
<option data-countryCode="BI" value="257">Burundi (+257)</option>
<option data-countryCode="KH" value="855">Cambodia (+855)</option>
<option data-countryCode="CM" value="237">Cameroon (+237)</option>
<option data-countryCode="CA" value="1">Canada (+1)</option>
<option data-countryCode="CV" value="238">Cape Verde Islands (+238)</option>
<option data-countryCode="KY" value="1345">Cayman Islands (+1345)</option>
<option data-countryCode="CF" value="236">Central African Republic (+236)</option>
<option data-countryCode="CL" value="56">Chile (+56)</option>
<option data-countryCode="CN" value="86">China (+86)</option>
<option data-countryCode="CO" value="57">Colombia (+57)</option>
<option data-countryCode="KM" value="269">Comoros (+269)</option>
<option data-countryCode="CG" value="242">Congo (+242)</option>
<option data-countryCode="CK" value="682">Cook Islands (+682)</option>
<option data-countryCode="CR" value="506">Costa Rica (+506)</option>
<option data-countryCode="HR" value="385">Croatia (+385)</option>
<option data-countryCode="CU" value="53">Cuba (+53)</option>
<option data-countryCode="CY" value="90392">Cyprus North (+90392)</option>
<option data-countryCode="CY" value="357">Cyprus South (+357)</option>
<option data-countryCode="CZ" value="42">Czech Republic (+42)</option>
<option data-countryCode="DK" value="45">Denmark (+45)</option>
<option data-countryCode="DJ" value="253">Djibouti (+253)</option>
<option data-countryCode="DM" value="1809">Dominica (+1809)</option>
<option data-countryCode="DO" value="1809">Dominican Republic (+1809)</option>
<option data-countryCode="EC" value="593">Ecuador (+593)</option>
<option data-countryCode="EG" value="20">Egypt (+20)</option>
<option data-countryCode="SV" value="503">El Salvador (+503)</option>
<option data-countryCode="GQ" value="240">Equatorial Guinea (+240)</option>
<option data-countryCode="ER" value="291">Eritrea (+291)</option>
<option data-countryCode="EE" value="372">Estonia (+372)</option>
<option data-countryCode="ET" value="251">Ethiopia (+251)</option>
<option data-countryCode="FK" value="500">Falkland Islands (+500)</option>
<option data-countryCode="FO" value="298">Faroe Islands (+298)</option>
<option data-countryCode="FJ" value="679">Fiji (+679)</option>
<option data-countryCode="FI" value="358">Finland (+358)</option>
<option data-countryCode="FR" value="33">France (+33)</option>
<option data-countryCode="GF" value="594">French Guiana (+594)</option>
<option data-countryCode="PF" value="689">French Polynesia (+689)</option>
<option data-countryCode="GA" value="241">Gabon (+241)</option>
<option data-countryCode="GM" value="220">Gambia (+220)</option>
<option data-countryCode="GE" value="7880">Georgia (+7880)</option>
<option data-countryCode="DE" value="49">Germany (+49)</option>
<option data-countryCode="GH" value="233">Ghana (+233)</option>
<option data-countryCode="GI" value="350">Gibraltar (+350)</option>
<option data-countryCode="GR" value="30">Greece (+30)</option>
<option data-countryCode="GL" value="299">Greenland (+299)</option>
<option data-countryCode="GD" value="1473">Grenada (+1473)</option>
<option data-countryCode="GP" value="590">Guadeloupe (+590)</option>
<option data-countryCode="GU" value="671">Guam (+671)</option>
<option data-countryCode="GT" value="502">Guatemala (+502)</option>
<option data-countryCode="GN" value="224">Guinea (+224)</option>
<option data-countryCode="GW" value="245">Guinea - Bissau (+245)</option>
<option data-countryCode="GY" value="592">Guyana (+592)</option>
<option data-countryCode="HT" value="509">Haiti (+509)</option>
<option data-countryCode="HN" value="504">Honduras (+504)</option>
<option data-countryCode="HK" value="852">Hong Kong (+852)</option>
<option data-countryCode="HU" value="36">Hungary (+36)</option>
<option data-countryCode="IS" value="354">Iceland (+354)</option>
<option data-countryCode="IN" value="91">India (+91)</option>
<option data-countryCode="ID" value="62">Indonesia (+62)</option>
<option data-countryCode="IR" value="98">Iran (+98)</option>
<option data-countryCode="IQ" value="964">Iraq (+964)</option>
<option data-countryCode="IE" value="353">Ireland (+353)</option>
<option data-countryCode="IL" value="972">Israel (+972)</option>
<option data-countryCode="IT" value="39">Italy (+39)</option>
<option data-countryCode="JM" value="1876">Jamaica (+1876)</option>
<option data-countryCode="JP" value="81">Japan (+81)</option>
<option data-countryCode="JO" value="962">Jordan (+962)</option>
<option data-countryCode="KZ" value="7">Kazakhstan (+7)</option>
<option data-countryCode="KE" value="254">Kenya (+254)</option>
<option data-countryCode="KI" value="686">Kiribati (+686)</option>
<option data-countryCode="KP" value="850">Korea North (+850)</option>
<option data-countryCode="KR" value="82">Korea South (+82)</option>
<option data-countryCode="KW" value="965">Kuwait (+965)</option>
<option data-countryCode="KG" value="996">Kyrgyzstan (+996)</option>
<option data-countryCode="LA" value="856">Laos (+856)</option>
<option data-countryCode="LV" value="371">Latvia (+371)</option>
<option data-countryCode="LB" value="961">Lebanon (+961)</option>
<option data-countryCode="LS" value="266">Lesotho (+266)</option>
<option data-countryCode="LR" value="231">Liberia (+231)</option>
<option data-countryCode="LY" value="218">Libya (+218)</option>
<option data-countryCode="LI" value="417">Liechtenstein (+417)</option>
<option data-countryCode="LT" value="370">Lithuania (+370)</option>
<option data-countryCode="LU" value="352">Luxembourg (+352)</option>
<option data-countryCode="MO" value="853">Macao (+853)</option>
<option data-countryCode="MK" value="389">Macedonia (+389)</option>
<option data-countryCode="MG" value="261">Madagascar (+261)</option>
<option data-countryCode="MW" value="265">Malawi (+265)</option>
<option data-countryCode="MY" value="60">Malaysia (+60)</option>
<option data-countryCode="MV" value="960">Maldives (+960)</option>
<option data-countryCode="ML" value="223">Mali (+223)</option>
<option data-countryCode="MT" value="356">Malta (+356)</option>
<option data-countryCode="MH" value="692">Marshall Islands (+692)</option>
<option data-countryCode="MQ" value="596">Martinique (+596)</option>
<option data-countryCode="MR" value="222">Mauritania (+222)</option>
<option data-countryCode="YT" value="269">Mayotte (+269)</option>
<option data-countryCode="MX" value="52">Mexico (+52)</option>
<option data-countryCode="FM" value="691">Micronesia (+691)</option>
<option data-countryCode="MD" value="373">Moldova (+373)</option>
<option data-countryCode="MC" value="377">Monaco (+377)</option>
<option data-countryCode="MN" value="976">Mongolia (+976)</option>
<option data-countryCode="MS" value="1664">Montserrat (+1664)</option>
<option data-countryCode="MA" value="212">Morocco (+212)</option>
<option data-countryCode="MZ" value="258">Mozambique (+258)</option>
<option data-countryCode="MN" value="95">Myanmar (+95)</option>
<option data-countryCode="NA" value="264">Namibia (+264)</option>
<option data-countryCode="NR" value="674">Nauru (+674)</option>
<option data-countryCode="NP" value="977">Nepal (+977)</option>
<option data-countryCode="NL" value="31">Netherlands (+31)</option>
<option data-countryCode="NC" value="687">New Caledonia (+687)</option>
<option data-countryCode="NZ" value="64">New Zealand (+64)</option>
<option data-countryCode="NI" value="505">Nicaragua (+505)</option>
<option data-countryCode="NE" value="227">Niger (+227)</option>
<option data-countryCode="NG" value="234">Nigeria (+234)</option>
<option data-countryCode="NU" value="683">Niue (+683)</option>
<option data-countryCode="NF" value="672">Norfolk Islands (+672)</option>
<option data-countryCode="NP" value="670">Northern Marianas (+670)</option>
<option data-countryCode="NO" value="47">Norway (+47)</option>
<option data-countryCode="OM" value="968">Oman (+968)</option>
<option data-countryCode="PW" value="680">Palau (+680)</option>
<option data-countryCode="PA" value="507">Panama (+507)</option>
<option data-countryCode="PG" value="675">Papua New Guinea (+675)</option>
<option data-countryCode="PY" value="595">Paraguay (+595)</option>
<option data-countryCode="PE" value="51">Peru (+51)</option>
<option data-countryCode="PH" value="63">Philippines (+63)</option>
<option data-countryCode="PL" value="48">Poland (+48)</option>
<option data-countryCode="PT" value="351">Portugal (+351)</option>
<option data-countryCode="PR" value="1787">Puerto Rico (+1787)</option>
<option data-countryCode="QA" value="974">Qatar (+974)</option>
<option data-countryCode="RE" value="262">Reunion (+262)</option>
<option data-countryCode="RO" value="40">Romania (+40)</option>
<option data-countryCode="RU" value="7">Russia (+7)</option>
<option data-countryCode="RW" value="250">Rwanda (+250)</option>
<option data-countryCode="SM" value="378">San Marino (+378)</option>
<option data-countryCode="ST" value="239">Sao Tome &amp; Principe (+239)</option>
<option data-countryCode="SA" value="966">Saudi Arabia (+966)</option>
<option data-countryCode="SN" value="221">Senegal (+221)</option>
<option data-countryCode="CS" value="381">Serbia (+381)</option>
<option data-countryCode="SC" value="248">Seychelles (+248)</option>
<option data-countryCode="SL" value="232">Sierra Leone (+232)</option>
<option data-countryCode="SG" value="65">Singapore (+65)</option>
<option data-countryCode="SK" value="421">Slovak Republic (+421)</option>
<option data-countryCode="SI" value="386">Slovenia (+386)</option>
<option data-countryCode="SB" value="677">Solomon Islands (+677)</option>
<option data-countryCode="SO" value="252">Somalia (+252)</option>
<option data-countryCode="ZA" value="27">South Africa (+27)</option>
<option data-countryCode="ES" value="34">Spain (+34)</option>
<option data-countryCode="LK" value="94">Sri Lanka (+94)</option>
<option data-countryCode="SH" value="290">St. Helena (+290)</option>
<option data-countryCode="KN" value="1869">St. Kitts (+1869)</option>
<option data-countryCode="SC" value="1758">St. Lucia (+1758)</option>
<option data-countryCode="SD" value="249">Sudan (+249)</option>
<option data-countryCode="SR" value="597">Suriname (+597)</option>
<option data-countryCode="SZ" value="268">Swaziland (+268)</option>
<option data-countryCode="SE" value="46">Sweden (+46)</option>
<option data-countryCode="CH" value="41">Switzerland (+41)</option>
<option data-countryCode="SI" value="963">Syria (+963)</option>
<option data-countryCode="TW" value="886">Taiwan (+886)</option>
<option data-countryCode="TJ" value="7">Tajikstan (+7)</option>
<option data-countryCode="TH" value="66">Thailand (+66)</option>
<option data-countryCode="TG" value="228">Togo (+228)</option>
<option data-countryCode="TO" value="676">Tonga (+676)</option>
<option data-countryCode="TT" value="1868">Trinidad &amp; Tobago (+1868)</option>
<option data-countryCode="TN" value="216">Tunisia (+216)</option>
<option data-countryCode="TR" value="90">Turkey (+90)</option>
<option data-countryCode="TM" value="7">Turkmenistan (+7)</option>
<option data-countryCode="TM" value="993">Turkmenistan (+993)</option>
<option data-countryCode="TC" value="1649">Turks &amp; Caicos Islands (+1649)</option>
<option data-countryCode="TV" value="688">Tuvalu (+688)</option>
<option data-countryCode="UG" value="256">Uganda (+256)</option>
<!-- <option data-countryCode="GB" value="44">UK (+44)</option> -->
<option data-countryCode="UA" value="380">Ukraine (+380)</option>
<option data-countryCode="AE" value="971">United Arab Emirates (+971)</option>
<option data-countryCode="UY" value="598">Uruguay (+598)</option>
<!-- <option data-countryCode="US" value="1">USA (+1)</option> -->
<option data-countryCode="UZ" value="7">Uzbekistan (+7)</option>
<option data-countryCode="VU" value="678">Vanuatu (+678)</option>
<option data-countryCode="VA" value="379">Vatican City (+379)</option>
<option data-countryCode="VE" value="58">Venezuela (+58)</option>
<option data-countryCode="VN" value="84">Vietnam (+84)</option>
<option data-countryCode="VG" value="84">Virgin Islands - British (+1284)</option>
<option data-countryCode="VI" value="84">Virgin Islands - US (+1340)</option>
<option data-countryCode="WF" value="681">Wallis &amp; Futuna (+681)</option>
<option data-countryCode="YE" value="969">Yemen (North)(+969)</option>
<option data-countryCode="YE" value="967">Yemen (South)(+967)</option>
<option data-countryCode="ZM" value="260">Zambia (+260)</option>
<option data-countryCode="ZW" value="263">Zimbabwe (+263)</option>
</optgroup>
+38
View File
@@ -0,0 +1,38 @@
<form class="form" action="static_qrcode.php?type=email" method="post" id="static_form" enctype="multipart/form-data">
<?php include BASE_PATH.'/forms/qrcode_options.php'; ?>
<!-- Input forms -->
<div class="col-sm-12 mb-2">
<div class="row">
<div class="col-6 col-md-3">
<div class="form-group">
<label>Send to *</label>
<input type="email" name="email" value="" placeholder="E-mail" class="form-control">
</div>
</div>
<div class="col-6 col-md-3">
<div class="form-group">
<label>Subject </label>
<input type="text" name="subject" value="" placeholder="" class="form-control">
</div>
</div>
</div>
</div>
<div class="col-sm-6">
<div class="form-group">
<label>Message *</label>
<textarea class="form-control" name="message" value="" rows="5" placeholder=""></textarea>
</div>
</div>
<div class="col-sm-12 mb-2">
<div class="row">
<div class="col-6 col-md-3">
<button type="submit" class="btn btn-primary">Submit</button>
</div>
</div>
</div>
</form>
+74
View File
@@ -0,0 +1,74 @@
<form class="form" action="static_qrcode.php?type=event" method="post" id="static_form" enctype="multipart/form-data">
<?php include BASE_PATH.'/forms/qrcode_options.php'; ?>
<!-- Input forms -->
<div class="col-sm-12 mb-2">
<div class="row">
<div class="col-6 col-md-3">
<div class="form-group">
<label>Title: *</label>
<input type="text" name="title" value="" placeholder="" class="form-control">
</div>
</div>
<div class="col-6 col-md-4">
<div class="form-group">
<label>Date start: *</label>
<div class="input-group">
<div class="input-group-prepend">
<span class="input-group-text"><i class="far fa-clock"></i></span>
</div>
<input type="text" name="start" value="" class="form-control float-right" id="start">
</div><!-- /.input group -->
</div>
</div>
<div class="col-6 col-md-4">
<div class="form-group">
<label>Date end: *</label>
<div class="input-group">
<div class="input-group-prepend">
<span class="input-group-text"><i class="far fa-clock"></i></span>
</div>
<input type="text" name="end" value="" class="form-control float-right" id="end">
</div><!-- /.input group -->
</div>
</div>
</div>
</div>
<div class="col-sm-12 mb-2">
<div class="row">
<div class="col-6 col-md-3">
<div class="form-group">
<label>Location: </label>
<input type="text" name="location" value="" placeholder="" class="form-control">
</div>
</div>
<div class="col-6 col-md-5">
<div class="form-group">
<label>Event description </label>
<input type="text" name="description" value="" placeholder="" class="form-control">
</div>
</div>
<div class="col-6 col-md-3">
<div class="form-group">
<label>URL: </label>
<input type="url" name="url" value="" placeholder="" class="form-control">
</div>
</div>
</div>
</div>
<div class="col-sm-12 mb-2">
<div class="row">
<div class="col-6 col-md-3">
<button type="submit" class="btn btn-primary">Submit</button>
</div>
</div>
</div>
</form>
<script src="plugins/moment/moment.min.js"></script>
+26
View File
@@ -0,0 +1,26 @@
<form class="form" action="static_qrcode.php?type=location" method="post" id="static_form" enctype="multipart/form-data">
<?php include BASE_PATH.'/forms/qrcode_options.php'; ?>
<!-- Input forms -->
<div class="col-sm-4">
<div class="form-group">
<label>Latitude *</label>
<input type="text" name="latitude" value="" placeholder="40.7127753" class="form-control">
</div>
</div>
<div class="col-sm-4">
<div class="form-group">
<label>Longitude *</label>
<input type="text" name="longitude" value="" placeholder="-74.0059728" class="form-control">
</div>
</div>
<div class="col-sm-12 mb-2">
<div class="row">
<div class="col-6 col-md-3">
<button type="submit" class="btn btn-primary">Submit</button>
</div>
</div>
</div>
</form>
+110
View File
@@ -0,0 +1,110 @@
<form class="form" action="static_qrcode.php?type=paypal" method="post" id="static_form" enctype="multipart/form-data">
<?php include BASE_PATH.'/forms/qrcode_options.php'; ?>
<!-- Input forms -->
<div class="col-sm-12 mb-2">
<div class="row">
<div class="col-6 col-md-4">
<div class="form-group">
<label>Payment type *</label>
<select name="payment_type" class="form-control">
<option value="_click" selected>Buy now</option>
<option value="_cart">Add to cart</option>
<option value="_donations">Donations</option>
</select>
</div>
</div>
<div class="col-6 col-md-4">
<div class="form-group">
<label>Email *</label>
<input type="email" name="email" value="" placeholder="" class="form-control">
</div>
</div>
</div>
</div>
<div class="col-sm-12 mb-2">
<div class="row">
<div class="col-6 col-md-4">
<div class="form-group">
<label>Item name *</label>
<input type="text" name="item_name" value="" placeholder="" class="form-control">
</div>
</div>
<div class="col-6 col-md-4">
<div class="form-group">
<label>Item ID</label>
<input type="text" name="item_id" value="" placeholder="" class="form-control">
</div>
</div>
</div>
</div>
<div class="col-sm-12 mb-2">
<div class="row">
<div class="col-6 col-md-2">
<div class="form-group">
<label>Amount *</label>
<input type="number" name="amount" value="" placeholder="" class="form-control">
</div>
</div>
<div class="col-6 col-md-2">
<div class="form-group">
<label>Currency *</label>
<select name="currency" class="form-control">
<option value="USD" selected>USD</option>
<option value="EUR">EUR</option>
<option value="AUD">AUD</option>
<option value="CAD">CAD</option>
<option value="CZK">CZK</option>
<option value="DKK">DKK</option>
<option value="HKD">HKD</option>
<option value="HUF">HUF</option>
<option value="JPY">JPY</option>
<option value="NOK">NOK</option>
<option value="NZD">NZD</option>
<option value="PLN">PLN</option>
<option value="GBP">GBP</option>
<option value="SGD">SGD</option>
<option value="SEK">SEK</option>
</select>
</div>
</div>
<div class="col-6 col-md-2">
<div class="form-group">
<label>Shipping </label>
<input type="number" name="shipping" value="" placeholder="" class="form-control">
</div>
</div>
<div class="col-6 col-md-2">
<div class="form-group">
<label>Tax rate </label>
<div class="input-group">
<input type="text" name="tax_rate" value="" placeholder="" class="form-control">
<div class="input-group-append">
<span class="input-group-text"><i class="fas fa-percent"></i></span>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="col-sm-12 mb-2">
<div class="row">
<div class="col-6 col-md-3">
<button type="submit" class="btn btn-primary">Submit</button>
</div>
</div>
</div>
</form>
+33
View File
@@ -0,0 +1,33 @@
<form class="form" action="static_qrcode.php?type=phone" method="post" id="static_form" enctype="multipart/form-data">
<?php include BASE_PATH.'/forms/qrcode_options.php'; ?>
<!-- Input forms -->
<div class="col-sm-12 mb-2">
<div class="row">
<div class="col-6 col-md-3">
<div class="form-group">
<label>Country Code *</label>
<select name="country_code" class="form-control">
<?php include BASE_PATH . '/forms/static/country-code.html'; ?>
</select>
</div>
</div>
<div class="col-6 col-md-3">
<div class="form-group">
<label>Phone number * </label>
<input type="text" name="phone_number" value="" placeholder="" class="form-control">
</div>
</div>
</div>
</div>
<div class="col-sm-12 mb-2">
<div class="row">
<div class="col-6 col-md-3">
<button type="submit" class="btn btn-primary">Submit</button>
</div>
</div>
</div>
</form>
+19
View File
@@ -0,0 +1,19 @@
<form class="form" action="static_qrcode.php?type=skype" method="post" id="static_form" enctype="multipart/form-data">
<?php include BASE_PATH.'/forms/qrcode_options.php'; ?>
<!-- Input forms -->
<div class="col-sm-4">
<div class="form-group">
<label>Skype username *</label>
<input type="text" name="skype_username" value="" placeholder="" class="form-control">
</div>
</div>
<div class="col-sm-12 mb-2">
<div class="row">
<div class="col-6 col-md-3">
<button type="submit" class="btn btn-primary">Submit</button>
</div>
</div>
</div>
</form>
+40
View File
@@ -0,0 +1,40 @@
<form class="form" action="static_qrcode.php?type=sms" method="post" id="static_form" enctype="multipart/form-data">
<?php include BASE_PATH.'/forms/qrcode_options.php'; ?>
<!-- Input forms -->
<div class="col-sm-12 mb-2">
<div class="row">
<div class="col-6 col-md-3">
<div class="form-group">
<label>Country Code *</label>
<select name="country_code" class="form-control">
<?php include BASE_PATH . '/forms/static/country-code.html'; ?>
</select>
</div>
</div>
<div class="col-6 col-md-3">
<div class="form-group">
<label>Phone number * </label>
<input type="text" name="phone_number" value="" placeholder="" class="form-control">
</div>
</div>
</div>
</div>
<div class="col-sm-6">
<div class="form-group">
<label>Message *</label>
<textarea class="form-control" name="message" value="" rows="5" placeholder=""></textarea>
</div>
</div>
<div class="col-sm-12 mb-2">
<div class="row">
<div class="col-6 col-md-3">
<button type="submit" class="btn btn-primary">Submit</button>
</div>
</div>
</div>
</form>
+19
View File
@@ -0,0 +1,19 @@
<form class="form" action="static_qrcode.php?type=text" method="post" id="static_form" enctype="multipart/form-data">
<?php include BASE_PATH.'/forms/qrcode_options.php'; ?>
<!-- Input forms -->
<div class="col-sm-6">
<div class="form-group">
<label>Text *</label>
<textarea class="form-control" name="text" value="" rows="5" placeholder=""></textarea>
</div>
</div>
<div class="col-sm-12 mb-2">
<div class="row">
<div class="col-6 col-md-3">
<button type="submit" class="btn btn-primary">Submit</button>
</div>
</div>
</div>
</form>
+152
View File
@@ -0,0 +1,152 @@
<form class="form" action="static_qrcode.php?type=vcard" method="post" id="static_form" enctype="multipart/form-data">
<?php include BASE_PATH.'/forms/qrcode_options.php'; ?>
<!-- Input forms -->
<!-- First row -->
<div class="col-sm-12 mb-2">
<div class="row">
<div class="col-6 col-md-3">
<div class="form-group">
<label>Full name *</label>
<input type="text" name="full_name" value="" placeholder="" class="form-control">
</div>
</div>
<div class="col-6 col-md-3">
<div class="form-group">
<label>Nickname</label>
<input type="text" name="nickname" value="" placeholder="" class="form-control">
</div>
</div>
<div class="col-6 col-md-3">
<div class="form-group">
<label>Email</label>
<input type="email" name="email" value="" placeholder="" class="form-control">
</div>
</div>
<div class="col-6 col-md-3">
<div class="form-group">
<label>Website</label>
<input type="url" name="website" value="" placeholder="https://google.it" class="form-control">
</div>
</div>
</div>
</div>
<!-- Second row -->
<div class="col-sm-12 mb-2">
<div class="row">
<div class="col-6 col-md-3">
<div class="form-group">
<label>Phone *</label>
<input type="text" name="phone" value="" placeholder="" class="form-control">
</div>
</div>
<div class="col-6 col-md-3">
<div class="form-group">
<label>Home Phone</label>
<input type="text" name="home_phone" value="" placeholder="" class="form-control">
</div>
</div>
<div class="col-6 col-md-3">
<div class="form-group">
<label>Work phone</label>
<input type="text" name="work_phone" value="" placeholder="" class="form-control">
</div>
</div>
<div class="col-6 col-md-3">
<div class="form-group">
<label>Company</label>
<input type="text" name="company" value="" placeholder="" class="form-control">
</div>
</div>
</div>
</div>
<!-- Third row -->
<div class="col-sm-12 mb-2">
<div class="row">
<div class="col-6 col-md-3">
<div class="form-group">
<label>Role</label>
<input type="text" name="role" value="" placeholder="CEO, CFO, COO" class="form-control">
</div>
</div>
<div class="col-6 col-md-3">
<div class="form-group">
<label>Categories</label>
<input type="text" name="categories" value="" placeholder="A list of tags" class="form-control">
</div>
</div>
<div class="col-6 col-md-3">
<div class="form-group">
<label>Note</label>
<input type="text" name="note" value="" placeholder="" class="form-control">
</div>
</div>
<div class="col-6 col-md-3">
<div class="form-group">
<label>Photo</label>
<input type="url" name="photo" value="" placeholder="Enter the url of the photo" class="form-control">
</div>
</div>
</div>
</div>
<!-- Fourth row -->
<div class="col-sm-12 mb-2">
<div class="row">
<div class="col-6 col-md-3">
<div class="form-group">
<label>Address</label>
<input type="text" name="address" value="" placeholder="" class="form-control">
</div>
</div>
<div class="col-6 col-md-3">
<div class="form-group">
<label>City</label>
<input type="text" name="city" value="" placeholder="" class="form-control">
</div>
</div>
<div class="col-6 col-md-3">
<div class="form-group">
<label>Post Code</label>
<input type="text" name="post_code" value="" placeholder="" class="form-control">
</div>
</div>
<div class="col-6 col-md-3">
<div class="form-group">
<label>State</label>
<input type="text" name="state" value="" placeholder="" class="form-control">
</div>
</div>
</div>
</div>
<div class="col-sm-12 mb-2">
<div class="row">
<div class="col-6 col-md-3">
<button type="submit" class="btn btn-primary">Submit</button>
</div>
</div>
</div>
</form>
+40
View File
@@ -0,0 +1,40 @@
<form class="form" action="static_qrcode.php?type=whatsapp" method="post" id="static_form" enctype="multipart/form-data">
<?php include BASE_PATH.'/forms/qrcode_options.php'; ?>
<!-- Input forms -->
<div class="col-sm-12 mb-2">
<div class="row">
<div class="col-6 col-md-3">
<div class="form-group">
<label>Country Code *</label>
<select name="country_code" class="form-control">
<?php include BASE_PATH . '/forms/static/country-code.html'; ?>
</select>
</div>
</div>
<div class="col-6 col-md-3">
<div class="form-group">
<label>Phone number * </label>
<input type="text" name="phone_number" value="" placeholder="" class="form-control">
</div>
</div>
</div>
</div>
<div class="col-sm-6">
<div class="form-group">
<label>Message *</label>
<textarea class="form-control" name="message" value="" rows="5" placeholder=""></textarea>
</div>
</div>
<div class="col-sm-12 mb-2">
<div class="row">
<div class="col-6 col-md-3">
<button type="submit" class="btn btn-primary">Submit</button>
</div>
</div>
</div>
</form>
+42
View File
@@ -0,0 +1,42 @@
<form class="form" action="static_qrcode.php?type=wifi" method="post" id="static_form" enctype="multipart/form-data">
<?php include BASE_PATH.'/forms/qrcode_options.php'; ?>
<!-- Input forms -->
<div class="col-sm-12 mb-2">
<div class="row">
<div class="col-6 col-md-3">
<div class="form-group">
<label>Encryption *</label>
<select name="encryption" class="form-control">
<option value="WPA" Selected>WPA/WPA2</option>
<option value="WEP">WEP</option>
<option value="">None</option>
</select>
</div>
</div>
<div class="col-6 col-md-3">
<div class="form-group">
<label>SSID *</label>
<input type="text" name="ssid" value="" placeholder="" class="form-control">
</div>
</div>
<div class="col-6 col-md-3">
<div class="form-group">
<label>Password</label>
<input type="text" name="password" value="" placeholder="" class="form-control">
</div>
</div>
</div>
</div>
<div class="col-sm-12 mb-2">
<div class="row">
<div class="col-6 col-md-3">
<button type="submit" class="btn btn-primary">Submit</button>
</div>
</div>
</div>
</form>
+124
View File
@@ -0,0 +1,124 @@
<div class="row">
<div class="col-12" id="bulk-action-div" style="display: none;">
<div id="err-msg"></div>
<div class="bulk-action-wrapper">
<form id="bulk-action" action="bulk_action.php" method="POST">
<button type="submit" class="btn btn-primary">Download selected</button>
<input type="hidden" name="type" value="dynamic">
</form>
</div>
</div>
<div class="col-12">
<div class="card">
<div class="card-body table-responsive p-0">
<table class="table table-striped table-bordered">
<thead>
<tr>
<th><input type="checkbox" name="bulk-select" value="1"></th>
<th>ID</th>
<th>Filename</th>
<th>Unique redirect identifier</th>
<th>URL</th>
<th>Qr code</th>
<th>Scan</th>
<th>Status</th>
<th>Operations</th>
</tr>
</thead>
<tbody>
<?php foreach ($rows as $row): ?>
<tr>
<td><input type="checkbox" name="action[]" value="<?=$row['id']?>" onchange="updateBulkActionVisibility()"></td>
<td><?php echo $row['id']; ?></td>
<td><?php echo htmlspecialchars($row['filename']); ?></td>
<td><?php echo htmlspecialchars($row['identifier']); ?></td>
<td><?php echo htmlspecialchars($row['link']); ?></td>
<td>
<?php echo '<img src="'.SAVED_QRCODE_FOLDER.htmlspecialchars($row['qrcode']).'" width="100" height="100">'; ?>
</td>
<td><?php echo htmlspecialchars($row['scan']); ?></td>
<td><?php echo htmlspecialchars($row['state']); ?></td>
<td>
<!-- EDIT -->
<a href="dynamic_qrcode.php?edit=true&id=<?php echo $row['id']; ?>" class="btn btn-primary"><i class="fas fa-edit"></i></a>
<!-- DELETE -->
<a
class="btn btn-danger delete_btn"
data-toggle="modal"
data-target="#delete-modal"
data-del_id="<?php echo $row["id"];?>"
><i class="fas fa-trash"></i></a>
<!-- DOWNLOAD -->
<a href="<?php echo SAVED_QRCODE_FOLDER.htmlspecialchars($row['qrcode']); ?>" class="btn btn-primary" download><i class="fa fa-download"></i></a>
</td>
</tr>
<?php endforeach; ?>
</tbody>
</table>
</div><!-- /.Card body -->
<div class="card-footer clearfix">
<?php echo paginationLinks($page, $total_pages, 'dynamic_qrcodes.php'); ?>
</div><!-- /.Card footer -->
</div><!-- /.Card -->
</div><!-- /.col -->
</div><!-- /.row -->
<!-- Delete Confirmation Modal -->
<div class="modal fade" id="delete-modal" role="dialog">
<div class="modal-dialog">
<form action="dynamic_qrcode.php" method="POST">
<!-- Modal content -->
<div class="modal-content">
<div class="modal-header">
<h4 class="modal-title">Confirm</h4>
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
</div>
<div class="modal-body">
<input type="hidden" name="del_id" id="del_id" value="">
<p>Are you sure you want to delete this row? Proceeding with the cancellation it will no longer be possible to recover the unique identifier and you will delete the created QR code from the server</p>
</div>
<div class="modal-footer">
<button type="submit" class="btn btn-primary">Save changes</button>
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
</div>
</div>
</form>
</div>
</div>
<!-- /.Delete Confirmation Modal -->
<script>
const deleteButtons = document.querySelectorAll('.delete_btn');
deleteButtons.forEach(button => {
button.addEventListener('click', function () {
document.getElementById('del_id').value = button.getAttribute('data-del_id');
const deleteModal = document.querySelector('#delete-modal');
deleteModal.style.display = 'block';
});
});
</script>
<script>
function updateBulkActionVisibility() {
const checkboxes = document.querySelectorAll('input[name="action[]"]');
const bulkActionDiv = document.getElementById('bulk-action-div');
const selectedCheckboxes = Array.from(checkboxes).filter(checkbox => checkbox.checked);
if (selectedCheckboxes.length > 0) {
bulkActionDiv.style.display = 'block';
} else {
bulkActionDiv.style.display = 'none';
}
}
updateBulkActionVisibility();
</script>
+120
View File
@@ -0,0 +1,120 @@
<div class="row">
<div class="col-12" id="bulk-action-div" style="display: none;">
<div id="err-msg"></div>
<div class="bulk-action-wrapper">
<form id="bulk-action" action="bulk_action.php" method="POST">
<button type="submit" class="btn btn-primary">Download selected</button>
<input type="hidden" name="type" value="dynamic">
</form>
</div>
</div>
<div class="col-12">
<div class="card">
<div class="card-body table-responsive p-0">
<table class="table table-striped table-bordered">
<thead>
<tr>
<th><input type="checkbox" name="bulk-select" value="1"></th>
<th>ID</th>
<th>Filename</th>
<th>Type</th>
<th>Content</th>
<th>Qr code</th>
<th>Operations</th>
</tr>
</thead>
<tbody>
<?php foreach ($rows as $row): ?>
<tr>
<td><input type="checkbox" name="action[]" value="<?=$row['id']?>" onchange="updateBulkActionVisibility()"></td>
<td><?php echo $row['id']; ?></td>
<td><?php echo htmlspecialchars($row['filename']); ?></td>
<td><?php echo htmlspecialchars($row['type']); ?></td>
<td><?php echo $row['content']; ?></td>
<td>
<?php echo '<img src="'.SAVED_QRCODE_FOLDER.htmlspecialchars($row['qrcode']).'" width="100" height="100">'; ?>
</td>
<td>
<!-- EDIT -->
<a href="static_qrcode.php?edit=true&id=<?php echo $row['id']; ?>" class="btn btn-primary"><i class="fas fa-edit"></i></a>
<!-- DELETE -->
<a
class="btn btn-danger delete_btn"
data-toggle="modal"
data-target="#delete-modal"
data-del_id="<?php echo $row["id"];?>"
><i class="fas fa-trash"></i></a>
<!-- DOWNLOAD -->
<a href="<?php echo SAVED_QRCODE_FOLDER.htmlspecialchars($row['qrcode']); ?>" class="btn btn-primary" download><i class="fa fa-download"></i></a>
</td>
</tr>
<?php endforeach; ?>
</tbody>
</table>
</div><!-- /.Card body -->
<div class="card-footer clearfix">
<?php echo paginationLinks($page, $total_pages, 'static_qrcodes.php'); ?>
</div><!-- /.Card footer -->
</div><!-- /.Card -->
</div><!-- /.col -->
</div><!-- /.row -->
<!-- Delete Confirmation Modal -->
<div class="modal fade" id="delete-modal" role="dialog">
<div class="modal-dialog">
<form action="static_qrcode.php" method="POST">
<!-- Modal content -->
<div class="modal-content">
<div class="modal-header">
<h4 class="modal-title">Confirm</h4>
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
</div>
<div class="modal-body">
<input type="hidden" name="del_id" id="del_id" value="">
<p>Are you sure you want to delete this row?</p>
</div>
<div class="modal-footer">
<button type="submit" class="btn btn-primary">Save changes</button>
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
</div>
</div>
</form>
</div>
</div>
<!-- /.Delete Confirmation Modal -->
<script>
const deleteButtons = document.querySelectorAll('.delete_btn');
deleteButtons.forEach(button => {
button.addEventListener('click', function () {
document.getElementById('del_id').value = button.getAttribute('data-del_id');
const deleteModal = document.querySelector('#delete-modal');
deleteModal.style.display = 'block';
});
});
</script>
<script>
function updateBulkActionVisibility() {
const checkboxes = document.querySelectorAll('input[name="action[]"]');
const bulkActionDiv = document.getElementById('bulk-action-div');
const selectedCheckboxes = Array.from(checkboxes).filter(checkbox => checkbox.checked);
if (selectedCheckboxes.length > 0) {
bulkActionDiv.style.display = 'block';
} else {
bulkActionDiv.style.display = 'none';
}
}
updateBulkActionVisibility();
</script>
+82
View File
@@ -0,0 +1,82 @@
<div class="row">
<div class="col-12">
<div class="card">
<div class="card-body table-responsive p-0">
<table class="table table-striped table-bordered">
<thead>
<tr>
<th width="5%">ID</th>
<th width="45%">Username</th>
<th width="40%">Admin type</th>
<th width="10%">Actions</th>
</tr>
</thead>
<tbody>
<?php foreach ($rows as $row): ?>
<tr>
<td><?php echo $row['id']; ?></td>
<td><?php echo htmlspecialchars($row['user_name']); ?></td>
<td><?php echo htmlspecialchars($row['admin_type']); ?></td>
<td>
<!-- EDIT -->
<a href="admin_user.php?edit=true&id=<?php echo $row['id']; ?>" class="btn btn-primary"><i class="fas fa-edit"></i></a>
<!-- DELETE -->
<a
class="btn btn-danger delete_btn"
data-toggle="modal"
data-target="#delete-modal"
data-del_id="<?php echo $row["id"];?>"
><i class="fas fa-trash"></i></a>
</td>
</tr>
<?php endforeach; ?>
</tbody>
</table>
</div><!-- /.Card body -->
<div class="card-footer clearfix">
<?php echo paginationLinks($page, $total_pages, 'admin_users.php'); ?>
</div><!-- /.Card footer -->
</div><!-- /.Card -->
</div><!-- /.col -->
</div><!-- /.row -->
<!-- Delete Confirmation Modal -->
<div class="modal fade" id="delete-modal" role="dialog">
<div class="modal-dialog">
<form action="admin_user.php" method="POST">
<!-- Modal content -->
<div class="modal-content">
<div class="modal-header">
<h4 class="modal-title">Confirm</h4>
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
</div>
<div class="modal-body">
<input type="hidden" name="del_id" id="del_id" value="">
<p>Are you sure you want to delete this row</p>
</div>
<div class="modal-footer">
<button type="submit" class="btn btn-primary">Save changes</button>
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
</div>
</div>
</form>
</div>
</div>
<!-- /.Delete Confirmation Modal -->
<script>
const deleteButtons = document.querySelectorAll('.delete_btn');
deleteButtons.forEach(button => {
button.addEventListener('click', function () {
document.getElementById('del_id').value = button.getAttribute('data-del_id');
const deleteModal = document.querySelector('#delete-modal');
deleteModal.style.display = 'block';
});
});
</script>
+127
View File
@@ -0,0 +1,127 @@
<?php
/**
* Function to generate random string.
* The function takes an integer n as input and generates a string by concatenating n characters chosen randomly from a domain.
N.B. In our case the integer n is randomly chosen between a range of 5 and 8. I chose this "short" range to not overdo the length of the identifier
*/
function randomString($n) {
$generated_string = "";
$domain = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890";
$len = strlen($domain);
// Loop to create random string
for ($i = 0; $i < $n; $i++) {
// Generate a random index to pick characters
$index = rand(0, $len - 1);
// Concatenating the character
// in resultant string
$generated_string = $generated_string . $domain[$index];
}
return $generated_string;
}
/**
*
*/
function getSecureRandomToken() {
$token = bin2hex(openssl_random_pseudo_bytes(16));
return $token;
}
/**
* Clear Auth Cookie
*/
function clearAuthCookie() {
unset($_COOKIE['series_id']);
unset($_COOKIE['remember_token']);
setcookie('series_id', null, -1, '/');
setcookie('remember_token', null, -1, '/');
}
/**
*
*/
function clean_input($data) {
$data = trim($data);
$data = stripslashes($data);
$data = htmlspecialchars($data);
return $data;
}
function paginationLinks($current_page, $total_pages, $base_url) {
if ($total_pages <= 1) {
return false;
}
$html = '';
if (!empty($_GET)) {
// We must unset $_GET[page] if previously built by http_build_query function
unset($_GET['page']);
// To keep the query sting parameters intact while navigating to next/prev page,
$http_query = "?" . http_build_query($_GET);
} else {
$http_query = "?";
}
$html = '<ul class="pagination pagination-sm m-0 float-right">';
if ($current_page == 1) {
$html .= '<li class="page-item disabled"><a class="page-link">First</a></li>';
} else {
$html .= '<li class="page-item"><a class="page-link" href="' . $base_url . $http_query . '&page=1">First</a></li>';
}
// Show pagination links
//var i = (Number(data.page) > 5 ? Number(data.page) - 4 : 1);
if ($current_page > 5) {
$i = $current_page - 4;
} else {
$i = 1;
}
for (; $i <= ($current_page + 4) && ($i <= $total_pages); $i++) {
($current_page == $i) ? $li_class = ' class="active"' : $li_class = '';
$link = $base_url . $http_query;
$html = $html . '<li class="page-item"' . $li_class . '><a class="page-link" href="' . $link . '&page=' . $i . '">' . $i . '</a></li>';
if ($i == $current_page + 4 && $i < $total_pages) {
$html = $html . '<li class="page-item disabled"><a class="page-link">...</a></li>';
}
}
if ($current_page == $total_pages) {
$html .= '<li class="page-item disabled"><a class="page-link">Last</a></li>';
} else {
$html .= '<li class="page-item"><a class="page-link" href="' . $base_url . $http_query . '&page=' . $total_pages . '">Last</a></li>';
}
$html = $html . '</ul>';
return $html;
}
function base_url(){
return sprintf(
"%s://%s:%s",
isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] != 'off' ? 'https' : 'http',
$_SERVER['SERVER_NAME'],
$_SERVER['SERVER_PORT']
);
}
+10
View File
@@ -0,0 +1,10 @@
<?php
//If User is logged in the session['user_logged_in'] will be set to true
//if user is Not Logged in, redirect to login.php page.
if (!isset($_SESSION['user_logged_in'])) {
header('Location:login.php');
}
?>
+63
View File
@@ -0,0 +1,63 @@
<?php
if(isset($_SESSION['success']))
{
echo '
<section class="content">
<div class="container-fluid">
<div class="row">
<div class="col-12">
<div class="card-body p-0">
<div class="alert alert-success alert-dismissible">
<button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>
<i class="icon fas fa-check"></i><strong>Success! </strong>'. $_SESSION['success'].'
</div>
</div>
</div>
</div>
</div>
</section>';
unset($_SESSION['success']);
}
if(isset($_SESSION['failure']))
{
echo '
<section class="content">
<div class="container-fluid">
<div class="row">
<div class="col-12">
<div class="card-body p-0">
<div class="alert alert-danger alert-dismissible">
<button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>
<i class="fas fa-times"></i> <strong>Oops! </strong>'. $_SESSION['failure'].'
</div>
</div>
</div>
</div>
</div>
</section>';
unset($_SESSION['failure']);
}
if(isset($_SESSION['info']))
{
echo '
<section class="content">
<div class="container-fluid">
<div class="row">
<div class="col-12">
<div class="card-body p-0">
<div class="alert alert-info alert-dismissible">
<button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>
<i class="fas fa-info-circle"></i> '. $_SESSION['info'].'
</div>
</div>
</div>
</div>
</div>
</section>';
unset($_SESSION['info']);
}
?>
+32
View File
@@ -0,0 +1,32 @@
<!-- Control Sidebar -->
<aside class="control-sidebar control-sidebar-dark">
<!-- Control sidebar content goes here -->
</aside>
<!-- /.control-sidebar -->
<!-- Main Footer -->
<footer class="main-footer text-sm">
<strong>Copyright &copy; <?php echo date("Y");?> <a href="#">PHP Qrcode Generator</a> - </strong>
All rights reserved by Giandonato Inverso.
<div class="float-right d-none d-sm-inline-block">
<b>Version</b> 2.0.0
</div>
</footer>
</div>
<!-- ./wrapper -->
<!-- REQUIRED SCRIPTS -->
<!-- jQuery -->
<script src="plugins/jquery/jquery.min.js"></script>
<!-- Bootstrap -->
<script src="plugins/bootstrap/js/bootstrap.bundle.min.js"></script>
<!-- AdminLTE App -->
<script src="dist/js/adminlte.js"></script>
<!-- AdminLTE Custom-->
<script src="dist/js/custom.js"></script>
<!-- Color picker -->
<script src="plugins/bootstrap-colorpicker/js/bootstrap-colorpicker.min.js"></script>
<!-- date-range-picker -->
<script src="plugins/daterangepicker/daterangepicker.js"></script>
<!-- Overlay scrollbar -->
<script type="text/javascript" src="plugins/overlayScrollbars/js/OverlayScrollbars.js"></script>
+20
View File
@@ -0,0 +1,20 @@
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta http-equiv="x-ua-compatible" content="ie=edge">
<!-- Font Awesome Icons -->
<link rel="stylesheet" href="plugins/fontawesome-free/css/all.min.css">
<!-- IonIcons -->
<link rel="stylesheet" href="http://code.ionicframework.com/ionicons/2.0.1/css/ionicons.min.css">
<!-- Theme style -->
<link rel="stylesheet" href="dist/css/adminlte.min.css">
<!-- Color picker -->
<link rel="stylesheet" href="plugins/bootstrap-colorpicker/css/bootstrap-colorpicker.min.css">
<!-- daterange picker -->
<link rel="stylesheet" href="plugins/daterangepicker/daterangepicker.css">
<!-- Overlay Scrollbar -->
<link type="text/css" href="plugins/overlayScrollbars/css/OverlayScrollbars.css" rel="stylesheet"/>
<!-- Google Font: Source Sans Pro -->
<link href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:300,400,400i,700" rel="stylesheet">
<!-- Custom Styles -->
<link rel="stylesheet" href="dist/css/custom.css">
+37
View File
@@ -0,0 +1,37 @@
<nav class="main-header navbar navbar-expand navbar-white navbar-light">
<!-- Left navbar links -->
<ul class="navbar-nav">
<li class="nav-item">
<a class="nav-link" data-widget="pushmenu" href="#" role="button"><i class="fas fa-bars"></i></a>
</li>
</ul>
<!-- Right navbar links -->
<ul class="navbar-nav ml-auto">
<!-- Notifications Dropdown Menu -->
<li class="nav-item dropdown">
<a class="nav-link" data-toggle="dropdown" href="#">
<i class="fas fa-user"></i>
</a>
<div class="dropdown-menu dropdown-menu-lg dropdown-menu-right">
<div class="dropdown-divider"></div>
<!--<a href="#" class="dropdown-item">
<i class="fas fa-user"></i> Profile
</a>
<div class="dropdown-divider"></div>
<a href="#" class="dropdown-item">
<i class="fa fa-cog"></i> Settings
</a>-->
<div class="dropdown-divider"></div>
<a href="./logout.php" class="dropdown-item">
<i class="fas fa-sign-out-alt"></i> Logout
</a>
</div>
</li>
<li class="nav-item">
<a class="nav-link" data-widget="control-sidebar" data-slide="true" href="#" role="button"><i
class="fas fa-th-large"></i></a>
</li>
</ul>
</nav>
+33
View File
@@ -0,0 +1,33 @@
<?php
require_once BASE_PATH . '/config/config.php';
// Get Input data from query string
$order_by = filter_input(INPUT_GET, 'order_by', FILTER_SANITIZE_FULL_SPECIAL_CHARS);
$order_dir = filter_input(INPUT_GET, 'order_dir', FILTER_SANITIZE_FULL_SPECIAL_CHARS);
$search_str = filter_input(INPUT_GET, 'search_str', FILTER_SANITIZE_FULL_SPECIAL_CHARS);
// If filter types are not selected we show latest added data first
if (!$order_by) {
$order_by = 'id';
}
if (!$order_dir) {
$order_dir = 'Desc';
}
// Start building query according to input parameters
// If search string
if ($search_str) {
foreach ($search_fields as $value) {
$db->orwhere($value, '%' . $search_str . '%', 'like');
}
}
// If order direction option selected
if ($order_dir) {
$db->orderBy($order_by, $order_dir);
}
?>
+93
View File
@@ -0,0 +1,93 @@
<aside class="main-sidebar sidebar-dark-primary elevation-4">
<!-- Brand Logo -->
<a href="./index.php" class="brand-link">
<img src="dist/img/Symbol_WhiteBlue.png" alt="Logo" class="brand-image"
style="opacity: .8">
<span class="brand-text font-weight-light">Qrcode Generator</span>
</a>
<!-- Sidebar -->
<div class="sidebar">
<!--Sidebar user panel (optional)
<div class="user-panel mt-3 pb-3 mb-3 d-flex">
<div class="image">
<img src="dist/img/avatar5.png" class="img-circle elevation-2" alt="User Image">
</div>
<div class="info">
<a href="#" class="d-block">Superadmin</a>
</div>
</div>
-->
<!-- Sidebar Menu -->
<nav class="mt-2">
<ul class="nav nav-pills nav-sidebar flex-column nav-legacy" data-widget="treeview" role="menu" data-accordion="false">
<!-- Add icons to the links using the .nav-icon class
with font-awesome or any other icon font library -->
<li class="nav-item">
<a href="./index.php" <?php echo ((substr(CURRENT_PAGE, 0, 9) == 'index.php')) ? ' class="nav-link active"' : ' class="nav-link"'; ?>>
<i class="nav-icon fas fa-tachometer-alt"></i>
<p>
Dashboard
</p>
</a>
</li>
<li <?php echo ((substr(CURRENT_PAGE, 0, 19) == 'dynamic_qrcodes.php') || (substr(CURRENT_PAGE, 0, 18) == 'dynamic_qrcode.php')) ? ' class="nav-item has-treeview menu-open"' : ' class="nav-item has-treeview"'; ?>>
<a href="#" <?php echo ((substr(CURRENT_PAGE, 0, 19) == 'dynamic_qrcodes.php') || (substr(CURRENT_PAGE, 0, 18) == 'dynamic_qrcode.php')) ? ' class="nav-link active"' : ' class="nav-link"'; ?>>
<i class="nav-icon fa fa-qrcode"></i>
<p>
Dynamic Qr codes
<i class="right fas fa-angle-left"></i>
</p>
</a>
<ul class="nav nav-treeview">
<li class="nav-item">
<a href="./dynamic_qrcodes.php" <?php echo ((substr(CURRENT_PAGE, 0, 19) == 'dynamic_qrcodes.php')) ? ' class="nav-link active"' : ' class="nav-link"'; ?>>
<i class="far fa-circle nav-icon"></i>
<p>List all</p>
</a>
</li>
<li class="nav-item">
<a href="./dynamic_qrcode.php" <?php echo (CURRENT_PAGE == 'dynamic_qrcode.php') ? ' class="nav-link active"' : ' class="nav-link"'; ?>>
<i class="far fa-circle nav-icon"></i>
<p>Add new</p>
</a>
</li>
</ul>
</li>
<li <?php echo ((substr(CURRENT_PAGE, 0, 18) == 'static_qrcodes.php') || (substr(CURRENT_PAGE, 0, 17) == 'static_qrcode.php')) ? ' class="nav-item has-treeview menu-open"' : ' class="nav-item has-treeview"'; ?>>
<a href="#" <?php echo ((substr(CURRENT_PAGE, 0, 18) == 'static_qrcodes.php') || (substr(CURRENT_PAGE, 0, 17) == 'static_qrcode.php')) ? ' class="nav-link active"' : ' class="nav-link"'; ?>>
<i class="nav-icon fa fa-qrcode"></i>
<p>
Static Qr codes
<i class="right fas fa-angle-left"></i>
</p>
</a>
<ul class="nav nav-treeview">
<li class="nav-item">
<a href="./static_qrcodes.php" <?php echo ((substr(CURRENT_PAGE, 0, 18) == 'static_qrcodes.php')) ? ' class="nav-link active"' : ' class="nav-link"'; ?>>
<i class="far fa-circle nav-icon"></i>
<p>List all</p>
</a>
</li>
<li class="nav-item">
<a href="./static_qrcode.php" <?php echo (CURRENT_PAGE == 'static_qrcode.php') ? ' class="nav-link active"' : ' class="nav-link"'; ?>>
<i class="far fa-circle nav-icon"></i>
<p>Add new</p>
</a>
</li>
</ul>
</li>
<li class="nav-item">
<a href="./admin_users.php" <?php echo ((substr(CURRENT_PAGE, 0, 15) == 'admin_users.php') || (substr(CURRENT_PAGE, 0, 14) == 'admin_user.php')) ? ' class="nav-link active"' : ' class="nav-link"'; ?>>
<i class="fas fa-users nav-icon"></i>
<p>Users</p>
</a>
</li>
</ul>
</nav>
<!-- /.sidebar-menu -->
</div>
<!-- /.sidebar -->
</aside>
+430
View File
@@ -0,0 +1,430 @@
<?php
session_start();
require_once './config/config.php';
require_once 'includes/auth_validate.php';
$db = getDbInstance();
//Get Dynamic qr code rows
$numQrcode_dynamic = $db->getValue("dynamic_qrcodes", "count(*)");
//Get Static qr code rows
$numQrcode_static = $db->getValue("static_qrcodes", "count(*)");
$total = $numQrcode_dynamic + $numQrcode_static;
//Get Total scan
$numScan = $db->getOne(DATABASE_PREFIX."dynamic_qrcodes", "sum(scan) as numScan");
/* CREATED CHART */
//I initialize the variables that will contain the daily values to 0 otherwise in the foreach loop they will be reset every time
//Get the number of DYNAMIC qr code created in 7 days and total scan
$createdQrcode_dynamic = $db->query("select `created_at`, `scan` from ".DATABASE_PREFIX."dynamic_qrcodes where `created_at` > curdate()-7;");
$dynamic_today = $dynamic_oneday = $dynamic_twoday = $dynamic_threeday = $dynamic_fourday = $dynamic_fiveday = $dynamic_sixday = 0;
$scan_today = $scan_oneday = $scan_twoday = $scan_threeday = $scan_fourday = $scan_fiveday = $scan_sixday = 0;
foreach ($createdQrcode_dynamic as $row) {
switch (substr($row['created_at'],0,10)){
case date("Y-m-d",mktime(0,0,0,date('m'),date('d'),date('Y'))): $dynamic_today++; $scan_today = $scan_today + $row['scan']; break;
case date("Y-m-d",mktime(0,0,0,date('m'),date('d')-1,date('Y'))): $dynamic_oneday++; $scan_oneday = $scan_oneday + $row['scan']; break;
case date("Y-m-d",mktime(0,0,0,date('m'),date('d')-2,date('Y'))): $dynamic_twoday++; $scan_twoday = $scan_twoday + $row['scan']; break;
case date("Y-m-d",mktime(0,0,0,date('m'),date('d')-3,date('Y'))): $dynamic_threeday++; $scan_threeday = $scan_threeday + $row['scan']; break;
case date("Y-m-d",mktime(0,0,0,date('m'),date('d')-4,date('Y'))): $dynamic_fourday++; $scan_fourday = $scan_fourday + $row['scan']; break;
case date("Y-m-d",mktime(0,0,0,date('m'),date('d')-5,date('Y'))): $dynamic_fiveday++; $scan_fiveday = $scan_fiveday + $row['scan']; break;
case date("Y-m-d",mktime(0,0,0,date('m'),date('d')-6,date('Y'))): $dynamic_sixday++; $scan_sixday = $scan_sixday + $row['scan']; break;
//I increase the daily variable and update the variable of the number of scans for a given day
}
}
/* SCAN CHART */
//Get the number of STATIC qr code created in 7 days
$createdQrcode_static = $db->query("select `created_at` from ".DATABASE_PREFIX."static_qrcodes where `created_at` > curdate()-7;");
$static_today = $static_oneday = $static_twoday = $static_threeday = $static_fourday = $static_fiveday = $static_sixday = 0;
foreach ($createdQrcode_static as $row) {
switch (substr($row['created_at'],0,10)){
case date("Y-m-d",mktime(0,0,0,date('m'),date('d'),date('Y'))): $static_today++; break;
case date("Y-m-d",mktime(0,0,0,date('m'),date('d')-1,date('Y'))): $static_oneday++; break;
case date("Y-m-d",mktime(0,0,0,date('m'),date('d')-2,date('Y'))): $static_twoday++; break;
case date("Y-m-d",mktime(0,0,0,date('m'),date('d')-3,date('Y'))): $static_threeday++; break;
case date("Y-m-d",mktime(0,0,0,date('m'),date('d')-4,date('Y'))): $static_fourday++; break;
case date("Y-m-d",mktime(0,0,0,date('m'),date('d')-5,date('Y'))): $static_fiveday++; break;
case date("Y-m-d",mktime(0,0,0,date('m'),date('d')-6,date('Y'))): $static_sixday++; break;
}
}
?>
<!DOCTYPE html>
<html lang="en">
<title>Qr Code 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">Dashboard</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">
<!-- Info boxes -->
<div class="row">
<div class="col-12 col-sm-6 col-md-3">
<div class="info-box mb-3 bg-warning">
<span class="info-box-icon"><i class="fa fa-qrcode"></i></span>
<div class="info-box-content">
<span class="info-box-text">Total qr codes</span>
<span class="info-box-number"><?php echo $total; ?></span>
</div><!-- /.info-box-content -->
</div>
</div><!-- /.col -->
<div class="col-12 col-sm-6 col-md-3">
<div class="info-box mb-3 bg-success">
<span class="info-box-icon"><i class="fa fa-qrcode"></i></span>
<div class="info-box-content">
<span class="info-box-text">Dynamic Qr codes</span>
<span class="info-box-number"><?php echo $numQrcode_dynamic; ?></span>
</div><!-- /.info-box-content -->
</div>
</div><!-- /.col -->
<!-- fix for small devices only -->
<div class="clearfix hidden-md-up"></div>
<div class="col-12 col-sm-6 col-md-3">
<div class="info-box mb-3 bg-danger">
<span class="info-box-icon"><i class="fa fa-qrcode"></i></span>
<div class="info-box-content">
<span class="info-box-text">Static QR codes</span>
<span class="info-box-number"><?php echo $numQrcode_static; ?></span>
</div><!-- /.info-box-content -->
</div>
</div><!-- /.col -->
<div class="col-12 col-sm-6 col-md-3">
<div class="info-box mb-3 bg-info">
<span class="info-box-icon"><i class="fas fa-chart-line"></i></span>
<div class="info-box-content">
<span class="info-box-text">Total Scans</span>
<span class="info-box-number"><?php echo $numScan["numScan"]; ?></span>
</div><!-- /.info-box-content -->
</div>
</div><!-- /.col -->
</div><!-- /.row -->
<div class="row">
<div class="col-md-6">
<!-- Created chart -->
<div class="card card-primary">
<div class="card-header">
<h3 class="card-title">Qr codes created in the last week</h3>
<div class="card-tools">
<button type="button" class="btn btn-tool" data-card-widget="collapse"><i class="fas fa-minus"></i>
</button>
<button type="button" class="btn btn-tool" data-card-widget="remove"><i class="fas fa-times"></i></button>
</div>
</div>
<div class="card-body">
<div class="d-flex">
<p class="d-flex flex-column">
<span class="text-bold text-lg"><?php echo $dynamic_today + $dynamic_oneday + $dynamic_twoday + $dynamic_threeday + $dynamic_fourday + $dynamic_fiveday + $dynamic_sixday + $static_today + $static_oneday + $static_twoday + $static_threeday + $static_fourday + $static_fiveday + $static_sixday?></span>
<span>Total qr code created</span>
</p>
</div>
<div class="position-relative mb-4">
<div class="chartjs-size-monitor">
<div class="chartjs-size-monitor-expand">
<div class=""></div>
</div>
<div class="chartjs-size-monitor-shrink">
<div class=""></div>
</div>
</div>
<canvas id="created-chart" height="400" width="958" class="chartjs-render-monitor" style="display: block; height: 200px; width: 479px;"></canvas>
</div>
<div class="d-flex flex-row justify-content-end">
<span class="mr-2">
<i class="fas fa-square text-primary"></i> Dynamic
</span>
<span>
<i class="fas fa-square text-gray"></i> Static
</span>
</div>
</div><!-- /.card-body -->
</div><!-- /.card -->
</div><!-- /.col (LEFT) -->
<div class="col-md-6">
<section class="connectedSortable">
<div class="card bg-gradient-info">
<div class="card-header border-0">
<h3 class="card-title">
<i class="fas fa-th mr-1"></i>
Scan Graph
</h3>
<div class="card-tools">
<button type="button" class="btn bg-info btn-sm" data-card-widget="collapse">
<i class="fas fa-minus"></i>
</button>
<button type="button" class="btn bg-info btn-sm" data-card-widget="remove">
<i class="fas fa-times"></i>
</button>
</div>
</div>
<div class="card-body">
<canvas class="chart" id="scan-chart" style="min-height: 313px; height: 250px; max-height: 250px; max-width: 100%;"></canvas>
</div>
</div>
</section>
</div><!-- /.col (RIGHT) -->
</div><!-- /.row -->
</div><!--/. container-fluid -->
</section><!-- /.content -->
</div><!-- /.content-wrapper -->
<!-- Footer and scripts -->
<?php include './includes/footer.php'; ?>
<!-- ChartJS -->
<script src="plugins/chart.js/Chart.min.js"></script>
<!-- Created Qr code Chart script -->
<script>
$(function () {
'use strict'
var ticksStyle = {
fontColor: '#495057',
fontStyle: 'bold'
}
var mode = 'index'
var intersect = true
var $createdChart = $('#created-chart')
var createdChart = new Chart($createdChart, {
data : {
labels : [
'<?php echo date("Y-m-d",mktime(0,0,0,date('m'),date('d')-6,date('Y'))); ?>',
'<?php echo date("Y-m-d",mktime(0,0,0,date('m'),date('d')-5,date('Y'))); ?>',
'<?php echo date("Y-m-d",mktime(0,0,0,date('m'),date('d')-4,date('Y'))); ?>',
'<?php echo date("Y-m-d",mktime(0,0,0,date('m'),date('d')-3,date('Y'))); ?>',
'<?php echo date("Y-m-d",mktime(0,0,0,date('m'),date('d')-2,date('Y'))); ?>',
'<?php echo date("Y-m-d",mktime(0,0,0,date('m'),date('d')-1,date('Y'))); ?>',
'<?php echo date("Y-m-d",mktime(0,0,0,date('m'),date('d'),date('Y'))); ?>'
],
datasets: [{
type : 'line',
data : [
<?php echo $dynamic_sixday ?>,
<?php echo $dynamic_fiveday ?>,
<?php echo $dynamic_fourday ?>,
<?php echo $dynamic_threeday ?>,
<?php echo $dynamic_twoday ?>,
<?php echo $dynamic_oneday ?>,
<?php echo $dynamic_today ?>,
],
backgroundColor : 'transparent',
borderColor : '#007bff',
pointBorderColor : '#007bff',
pointBackgroundColor: '#007bff',
fill : false
},
{
type : 'line',
data : [
<?php echo $static_sixday ?>,
<?php echo $static_fiveday ?>,
<?php echo $static_fourday ?>,
<?php echo $static_threeday ?>,
<?php echo $static_twoday ?>,
<?php echo $static_oneday ?>,
<?php echo $static_today ?>,
],
backgroundColor : 'tansparent',
borderColor : '#ced4da',
pointBorderColor : '#ced4da',
pointBackgroundColor: '#ced4da',
fill : false
}]
},
options: {
maintainAspectRatio: false,
tooltips : {
mode : mode,
intersect: intersect
},
hover : {
mode : mode,
intersect: intersect
},
legend : {
display: false
},
scales : {
yAxes: [{
// display: false,
gridLines: {
display : true,
lineWidth : '4px',
color : 'rgba(0, 0, 0, .2)',
zeroLineColor: 'transparent'
},
ticks : $.extend({
beginAtZero : true,
suggestedMax: 10
}, ticksStyle)
}],
xAxes: [{
display : true,
gridLines: {
display: false
},
ticks : ticksStyle
}]
}
}
})
})
</script>
<!-- /.Created Chart script -->
<!-- Scan Chart -->
<script>
/*
* Author: Abdullah A Almsaeed
* Date: 4 Jan 2014
**/
$(function () {
'use strict'
/* Chart.js Charts */
// Sales graph chart
var salesGraphChartCanvas = $('#scan-chart').get(0).getContext('2d');
//$('#revenue-chart').get(0).getContext('2d');
var salesGraphChartData = {
labels : [
'<?php echo date("Y-m-d",mktime(0,0,0,date('m'),date('d')-6,date('Y'))); ?>',
'<?php echo date("Y-m-d",mktime(0,0,0,date('m'),date('d')-5,date('Y'))); ?>',
'<?php echo date("Y-m-d",mktime(0,0,0,date('m'),date('d')-4,date('Y'))); ?>',
'<?php echo date("Y-m-d",mktime(0,0,0,date('m'),date('d')-3,date('Y'))); ?>',
'<?php echo date("Y-m-d",mktime(0,0,0,date('m'),date('d')-2,date('Y'))); ?>',
'<?php echo date("Y-m-d",mktime(0,0,0,date('m'),date('d')-1,date('Y'))); ?>',
'<?php echo date("Y-m-d",mktime(0,0,0,date('m'),date('d'),date('Y'))); ?>'
],
datasets: [
{
label : 'Scan',
fill : false,
borderWidth : 2,
lineTension : 0,
spanGaps : true,
borderColor : '#efefef',
pointRadius : 3,
pointHoverRadius : 7,
pointColor : '#efefef',
pointBackgroundColor: '#efefef',
data : [
<?php echo $scan_sixday ?>,
<?php echo $scan_fiveday ?>,
<?php echo $scan_fourday ?>,
<?php echo $scan_threeday ?>,
<?php echo $scan_twoday ?>,
<?php echo $scan_oneday ?>,
<?php echo $scan_today ?>,
],
}
]
}
var salesGraphChartOptions = {
maintainAspectRatio : false,
responsive : true,
legend: {
display: false,
},
scales: {
xAxes: [{
ticks : {
fontColor: '#efefef',
},
gridLines : {
display : false,
color: '#efefef',
drawBorder: false,
}
}],
yAxes: [{
ticks : {
stepSize: 2,
fontColor: '#efefef',
suggestedMax: 30,
},
gridLines : {
display : true,
color: '#efefef',
drawBorder: false,
}
}]
}
}
// This will get the first returned node in the jQuery collection.
var salesGraphChart = new Chart(salesGraphChartCanvas, {
type: 'line',
data: salesGraphChartData,
options: salesGraphChartOptions
}
)
})
</script>
<!-- /. Scan Chart -->
<!-- /.Footer and scripts -->
</body>
</html>
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large Load Diff
File diff suppressed because one or more lines are too long
@@ -0,0 +1,11 @@
<!DOCTYPE html>
<html>
<head>
<title>403 Forbidden</title>
</head>
<body>
<p>Directory access is forbidden.</p>
</body>
</html>
File diff suppressed because it is too large Load Diff

After

Width:  |  Height:  |  Size: 434 KiB

@@ -0,0 +1,11 @@
<!DOCTYPE html>
<html>
<head>
<title>403 Forbidden</title>
</head>
<body>
<p>Directory access is forbidden.</p>
</body>
</html>
@@ -0,0 +1,11 @@
<!DOCTYPE html>
<html>
<head>
<title>403 Forbidden</title>
</head>
<body>
<p>Directory access is forbidden.</p>
</body>
</html>
+263
View File
@@ -0,0 +1,263 @@
body {
font-family: 'Poppins', sans-serif;
color: #444 !important;
font-size: 14px;
background: #56CCF2;
background: -webkit-linear-gradient(to left, #56CCF2, #2F80ED);
background: linear-gradient(to left, #56CCF2, #2F80ED);
}
.logo-cnt {
text-align: center;
color: #fff;
padding: 60px 0 30px 0;
}
.logo-cnt .logo {
font-size: 48px;
line-height: 48px;
}
.logo-cnt p {
font-size: 20px;
}
.install-box {
width: 100%;
padding: 30px;
left: 0;
right: 0;
top: 0;
bottom: 0;
margin: auto;
background-color: #fff;
border-radius: 4px;
display: block;
float: left;
margin-bottom: 100px;
}
.form-input {
box-shadow: none !important;
border: 1px solid #ddd;
height: 44px;
line-height: 44px;
padding: 0 20px;
}
.form-input:focus {
border-color: #2F80ED !important;
}
.btn-custom {
background-color: #2F80ED !important;
border-color: #2F80ED !important;
border: 0 none;
border-radius: 4px;
box-shadow: none;
color: #fff !important;
font-size: 16px;
font-weight: 300;
height: 40px;
line-height: 40px;
margin: 0;
min-width: 105px;
padding: 0 20px;
text-shadow: none;
vertical-align: middle;
}
.btn-custom:hover, .btn-custom:active, .btn-custom:focus {
background-color: #2F80ED;
border-color: #2F80ED;
opacity: .8;
}
.steps {
width: 100%;
overflow: hidden;
position: relative;
margin: auto;
padding: 30px 0;
}
.step {
float: left;
display: block;
padding: 0 5px;
position: relative;
width: 20%;
text-align: center;
}
.step-icon {
background: #ddd;
border-radius: 50%;
color: #fff;
display: inline-block;
font-size: 16px;
height: 40px;
line-height: 40px;
margin-top: 4px;
width: 40px;
text-align: center;
margin: auto;
}
.step p {
color: #ccc;
}
.step.active p {
color: #2F80ED;
}
.step.active .step-icon {
background: #2F80ED;
font-size: 22px;
height: 48px;
line-height: 48px;
margin-top: 0;
width: 48px;
}
.step-progress {
background: #ddd;
height: 1px;
left: 0;
position: absolute;
top: 54px;
width: 100%;
}
.step-progress-line {
background: #2F80ED;
height: 1px;
left: 0;
position: absolute;
top: 0;
}
.step-contents {
float: left;
display: block;
width: 100%;
}
.tab-content {
width: 100%;
float: left;
display: block;
}
.tab-footer {
width: 100%;
float: left;
display: block;
}
.buttons {
display: block;
float: left;
width: 100%;
margin-top: 30px;
}
.step-title {
font-size: 18px;
text-align: left;
font-weight: bold;
border-bottom: 1px solid #ddd;
padding-bottom: 10px;
margin-bottom: 30px;
margin-top: 0;
}
.alert {
text-align: center;
}
.alert strong {
font-weight: 500 !important;
}
.spinner {
margin: 0 auto;
margin-bottom: 20px;
margin-top: 10px;
width: 50px;
height: 40px;
text-align: center;
font-size: 10px;
}
.spinner > div {
background-color: #67A168;
height: 100%;
width: 6px;
display: inline-block;
-webkit-animation: sk-stretchdelay 1.2s infinite ease-in-out;
animation: sk-stretchdelay 1.2s infinite ease-in-out;
}
.spinner .rect2 {
-webkit-animation-delay: -1.1s;
animation-delay: -1.1s;
}
.spinner .rect3 {
-webkit-animation-delay: -1.0s;
animation-delay: -1.0s;
}
.spinner .rect4 {
-webkit-animation-delay: -0.9s;
animation-delay: -0.9s;
}
.spinner .rect5 {
-webkit-animation-delay: -0.8s;
animation-delay: -0.8s;
}
.color-danger {
color: #dc3545;
}
.color-success {
color: #2F80ED;
}
.req-span {
display: block;
width: 220px;
float: left;
}
.req-span i {
font-size: 10px;
line-height: 20px;
}
@-webkit-keyframes sk-stretchdelay {
0%, 40%, 100% {
-webkit-transform: scaleY(0.4)
}
20% {
-webkit-transform: scaleY(1.0)
}
}
@keyframes sk-stretchdelay {
0%, 40%, 100% {
transform: scaleY(0.4);
-webkit-transform: scaleY(0.4);
}
20% {
transform: scaleY(1.0);
-webkit-transform: scaleY(1.0);
}
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 6.9 KiB

+59
View File
@@ -0,0 +1,59 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>PHP Dynamic Qr code - Setup</title>
<!-- Bootstrap CSS -->
<link rel="stylesheet" href="assets/css/bootstrap.min.css">
<link href="https://fonts.googleapis.com/css?family=Poppins:400,500,700" rel="stylesheet">
<!-- Font-awesome CSS -->
<link href="assets/css/font-awesome/css/font-awesome.min.css" rel="stylesheet"/>
<link rel="stylesheet" href="assets/css/style.css">
</head>
<body>
<div class="container">
<div class="row">
<div class="col-md-8 col-sm-12 col-md-offset-2">
<div class="row">
<div class="col-sm-12 logo-cnt">
<img src="assets/img/DynamicQRCode_BlackWhite.png">
</div>
</div>
<div class="row">
<div class="col-sm-12">
<div class="install-box">
<div class="step-contents">
<div class="tab-1">
<div class="form-group">
<p style="font-size: 18px">
<strong>The installation was successful.</strong>
<br>
Keep the documentation handy and log in to the control panel by entering the default credentials:
<br><br>
<b>superadmin</b><br>
<b>superadmin</b><br><br>
We recommend that you create a new superadmin user and to delete the default one mentioned above.<br><br>
<b>N.B.</b> Remember to delete the "install" folder otherwise you could accidentally start the installation procedure again, deleting all the saves in the database</p>
</div>
<div class="buttons">
<a href="../login.php" class="btn btn-success btn-custom pull-right">Log in</a>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</body>
</html>
+57
View File
@@ -0,0 +1,57 @@
<?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
*/
class Database {
// Function to the database and tables and fill them with the default data
function create_database($db_host, $db_user, $db_password, $db_name, $db_port)
{
// Connect to the database
$mysqli = new mysqli($db_host,$db_user,$db_password,'', $db_port);
// Check for errors
if(mysqli_connect_errno())
return false;
// Create the prepared statement
$mysqli->query("CREATE DATABASE IF NOT EXISTS ".$db_name);
// Close the connection
$mysqli->close();
return true;
}
// Function to create the tables and fill them with the default data
function create_tables($db_host, $db_user, $db_password, $db_name, $db_port, $db_prefix)
{
// Connect to the database
$mysqli = new mysqli($db_host,$db_user,$db_password,$db_name, $db_port);
// Check for errors
if(mysqli_connect_errno())
return false;
// Open the default SQL file
$query = file_get_contents('sql/sample_data.sql');
// Run prefix regex; if none is set, then it will replace #prefix# with an empty string.
$query = preg_replace('/#prefix#/', $db_prefix, $query);
// Execute a multi query
$mysqli->multi_query($query);
// Close the connection
$mysqli->close();
return true;
}
}
+62
View File
@@ -0,0 +1,62 @@
<?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/environment.php');
require_once('includes/database_class.php');
/*
|--------------------------------------------------------------------------
| CHECK REQUIREMENTS
|--------------------------------------------------------------------------
*/
if (!(phpversion() >= 5.6)) {
echo "Installation failed. A php version> = 5.6 is required";
die();
}
if (!extension_loaded('curl')) {
echo "Installation failed. The curl extension is required";
die();
}
/*
|--------------------------------------------------------------------------
| CHECK FOLDER PERMISSION
|--------------------------------------------------------------------------
*/
if (!is_writable('../saved_qrcode')) {
echo "Installation failed. The folder where you save the qrcodes must have write permissions";
die();
}
/*
|--------------------------------------------------------------------------
| DATABASE CREATION
|--------------------------------------------------------------------------
*/
$database = new Database();
if (!$database->create_database(DATABASE_HOST, DATABASE_USER, DATABASE_PASSWORD, DATABASE_NAME, DATABASE_PORT)) {
echo "The database could not be created, please check your database credentials!";
die();
}
else if (!$database->create_tables(DATABASE_HOST, DATABASE_USER, DATABASE_PASSWORD, DATABASE_NAME, DATABASE_PORT, DATABASE_PREFIX)) {
echo "The database tables could not be created, please check your database credentials!";
die();
}
// If no errors, redirect to index
header("Refresh: 1; finish.php");
?>
+123
View File
@@ -0,0 +1,123 @@
-- phpMyAdmin SQL Dump
-- version 3.5.8.2
-- http://www.phpmyadmin.net
--
-- Host: 89.46.111.192
-- Generato il: Set 01, 2020 alle 17:55
-- Versione del server: 5.7.29-32-log
-- Versione PHP: 5.3.8
SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */;
--
-- Database: `Sql1431296_1`
--
-- --------------------------------------------------------
--
-- Struttura della tabella `admin_accounts`
--
CREATE TABLE IF NOT EXISTS `#prefix#admin_accounts` (
`id` int(25) NOT NULL AUTO_INCREMENT,
`user_name` varchar(50) NOT NULL,
`password` varchar(255) NOT NULL,
`series_id` varchar(60) DEFAULT NULL,
`remember_token` varchar(255) DEFAULT NULL,
`expires` datetime DEFAULT NULL,
`admin_type` varchar(10) NOT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `user_name` (`user_name`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=14 ;
--
-- Dump dei dati per la tabella `admin_accounts`
--
INSERT INTO `#prefix#admin_accounts` (`id`, `user_name`, `password`, `series_id`, `remember_token`, `expires`, `admin_type`) VALUES
(1, 'superadmin', '$2y$10$xpZc5KC.aU2XHkcqhuZGFuAnqmtL4Unt8MysOyylceq.19XIyoZpG', 'F5V8N81eQKYJbiyj', '$2y$10$MRWA31CVjAmtrojbm4r18ezDfqC3msAxzJ1ZdbyoRpD5pxF3IdJG6', '2020-09-30 16:19:08', 'super');
-- --------------------------------------------------------
--
-- Struttura della tabella `dynamic_qrcodes`
--
CREATE TABLE IF NOT EXISTS `#prefix#dynamic_qrcodes` (
`id` int(10) NOT NULL AUTO_INCREMENT,
`filename` varchar(45) NOT NULL,
`format` varchar(45) DEFAULT NULL,
`identifier` longtext,
`link` varchar(100) DEFAULT NULL,
`qrcode` varchar(60) DEFAULT NULL,
`scan` int(11) NOT NULL DEFAULT '0',
`state` varchar(20) NOT NULL DEFAULT 'enable',
`created_by` int(10) unsigned NOT NULL DEFAULT '0',
`created_at` timestamp NULL DEFAULT NULL,
`updated_by` int(10) unsigned NOT NULL DEFAULT '0',
`updated_at` timestamp NULL DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=221 ;
--
-- Dump dei dati per la tabella `dynamic_qrcodes`
--
INSERT INTO `#prefix#dynamic_qrcodes` (`id`, `filename`, `format`, `identifier`, `link`, `qrcode`, `scan`, `state`, `created_by`, `created_at`, `updated_by`, `updated_at`) VALUES
(1, 'Facebook', 'png', 'rcCeC', 'https://facebook.com', 'Facebook.png', 0, 'enable', 0, '2020-09-01 15:35:13', 0, NULL),
(2, 'Amazon', 'png', 'F7GOY6', 'https://amazon.com', 'Amazon.png', 0, 'enable', 0, '2020-09-01 15:40:34', 0, NULL),
(3, 'Youtube', 'png', '8dK5Nd', 'https://youtube.com', 'Youtube.png', 0, 'enable', 0, '2020-09-01 15:41:43', 0, NULL),
(4, 'Apple', 'jpg', '7zxTKn', 'https://apple.com', 'Apple.jpg', 0, 'enable', 0, '2020-09-01 15:44:20', 0, NULL),
(5, 'Ebay', 'svg', 'a4F3kr', 'https://ebay.com', 'Ebay.svg', 0, 'enable', 0, '2020-09-01 15:44:46', 0, NULL),
(6, 'Google', 'png', 'saJV1y', 'https://google.it', 'Google.png', 0, 'enable', 0, '2020-09-01 15:46:37', 0, NULL);
-- --------------------------------------------------------
--
-- Struttura della tabella `static_qrcodes`
--
CREATE TABLE IF NOT EXISTS `#prefix#static_qrcodes` (
`id` int(10) NOT NULL AUTO_INCREMENT,
`filename` varchar(45) CHARACTER SET utf8 NOT NULL,
`format` varchar(45) DEFAULT NULL,
`type` varchar(45) CHARACTER SET utf8 DEFAULT NULL,
`content` mediumtext CHARACTER SET utf8,
`qrcode` varchar(60) CHARACTER SET utf8 DEFAULT NULL,
`state` varchar(20) CHARACTER SET utf8 NOT NULL DEFAULT 'enable',
`created_by` int(10) unsigned NOT NULL DEFAULT '0',
`created_at` timestamp NULL DEFAULT NULL,
`updated_by` int(10) unsigned NOT NULL DEFAULT '0',
`updated_at` timestamp NULL DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=87 ;
--
-- Dump dei dati per la tabella `static_qrcodes`
--
INSERT INTO `#prefix#static_qrcodes` (`id`, `filename`, `format`, `type`, `content`, `qrcode`, `state`, `created_by`, `created_at`, `updated_by`, `updated_at`) VALUES
(1, 'Text qr code', 'png', 'text', '<strong>Text:</strong> My first text', 'Text qr code.png', 'enable', 0, '2020-08-24 08:41:31', 0, NULL),
(2, 'Email', 'jpg', 'email', '<strong>Email:</strong> assistance@domain.com<br><strong>Subject:</strong> Assistance request<br><strong>Message:</strong> Regarding my order N ° ... I require assistance', 'Email.jpg', 'enable', 0, '2020-08-24 08:44:13', 0, NULL),
(3, 'Call me', 'png', 'phone', '<strong>Phone number:</strong> 12563776756', 'Call me.png', 'enable', 0, '2020-08-24 08:45:10', 0, NULL),
(4, 'Send sms', 'png', 'sms', '<strong>Phone number:</strong> 12563776756<br><strong>Message:</strong> Test message', 'Send sms.png', 'enable', 0, '2020-08-24 08:46:52', 0, NULL),
(5, 'wa.me', 'svg', 'whatsapp', '<strong>Phone number:</strong> 12563776756<br><strong>Message:</strong> Hey there! I am using WhatsApp', 'wa.me.svg', 'enable', 0, '2020-08-24 08:47:49', 0, NULL),
(6, 'New York', 'png', 'location', '<strong>Latitude:</strong> 40.7127753<br><strong>Longitude:</strong> -74.0059728', 'New York.png', 'enable', 0, '2020-08-24 08:51:55', 0, NULL),
(7, 'John Doe', 'png', 'vcard', '<div class="row"><div class="col-sm-4"><strong>Full name:</strong> John Doe<br><strong>Nickname:</strong> John<br><strong>Email:</strong> john@domain.com<br><strong>Website:</strong> https://johndoe.com</div><div class="col-sm-4"><strong>Company:</strong> Doe Inc.<br><strong>Role:</strong> CEO<br><strong>Categories:</strong> electronics, vcard<br><strong>Note:</strong> </div><div class="col-sm-4"><strong>Phone:</strong> 412-999-9988<br><strong>Home Phone:</strong> 412-999-5555<br><strong>Work phone:</strong> 412-444-2222<br><strong>Address:</strong> 123 Main Street&nbsp;Anywhere&nbsp;15523&nbsp;Arizona</div></div>', 'John Doe.png', 'enable', 0, '2020-08-24 08:55:59', 0, NULL),
(8, 'Boat party', 'png', 'event', '<div class="row"><div class="col-sm-4"><strong>Title:</strong> Party with friends<br><strong>Start event:</strong> 2020-08-26 09:00 AM<br><strong>End event:</strong> 2020-08-26 03:00 PM<br></div><div class="col-sm-4"><strong>Location:</strong> New York<br><strong>Description:</strong> Happy Birthday Carl!<br><strong>URL:</strong> </div></div>', 'Boat party.png', 'enable', 0, '2020-08-24 08:58:20', 0, NULL),
(9, 'Save me', 'svg', 'bookmark', '<strong>Title:</strong> Google search<br><strong>Url:</strong> https://google.it', 'Save me.svg', 'enable', 0, '2020-08-24 08:59:46', 0, NULL),
(10, 'Free wifi', 'png', 'wifi', '<strong>Encryption:</strong> WPA<br><strong>SSID:</strong> TP-LINK-AB123<br><strong>Password:</strong> bBB8MR7TwbbUWMZT', 'Free wifi.png', 'enable', 0, '2020-08-24 09:02:35', 0, NULL),
(11, 'Pay here', 'png', 'paypal', '<div class="row"><div class="col-sm-4"><strong>Payment type:</strong> _click<br><strong>Email:</strong> paypal@domain.com<br><strong>Item name:</strong> T-shirt<br><strong>Item id:</strong> 177</div><div class="col-sm-4"><strong>Amount:</strong> 15<br><strong>Currency:</strong> USD<br><strong>Shipping:</strong> 4<br><strong>Tax rate:</strong> </div></div>', 'Pay here.png', 'enable', 0, '2020-08-24 09:04:13', 0, NULL),
(12, 'Send BTC ', 'jpg', 'bitcoin', '<strong>BTC address:</strong> 1A1zP1eP5QGefi2DMPTfTL5SLmv7DivfNa<br><strong>Amount:</strong> 1<br><strong>Label:</strong> <br><strong>Message:</strong> ', 'Send BTC .jpg', 'enable', 0, '2020-09-01 10:51:08', 0, NULL);
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
+122
View File
@@ -0,0 +1,122 @@
<?php
require_once 'config/config.php';
require_once BASE_PATH . '/lib/Qrcode/Qrcode.php';
class DynamicQrcode {
private Qrcode $qrcode_instance;
/**
*
*/
public function __construct() {
$this->qrcode_instance = new Qrcode("dynamic");
}
/**
*
*/
public function __destruct() {
}
/**
* Set friendly columns names to order tables entries
* N.B. This function is called to generate the "list all" table
*/
public function setOrderingValues()
{
$ordering = [
'id' => 'ID',
'filename' => 'File Name',
'identifier' => 'Identifier',
'link' => 'Link',
'qrcode' => 'Qr Code',
'created_at' => 'Created at',
'updated_at' => 'Updated at'
];
return $ordering;
}
public function getQrcode($id) {
return $this->qrcode_instance->getQrcode($id);
}
/**
* Add qr code
* Check out http://goqr.me/api/ for more information
* We save the file obtained with the chosen name and in the selected folder
* We save into db the url of qrcode image
*/
public function addQrcode($input_data) {
$data_to_db['filename'] = htmlspecialchars($input_data['filename'], ENT_QUOTES, 'UTF-8');
$data_to_db['created_at'] = date('Y-m-d H:i:s');
$data_to_db['link'] = htmlspecialchars($input_data['link'], ENT_QUOTES, 'UTF-8');
$data_to_db['created_by'] = $_SESSION['user_id'];
$data_to_db['format'] = $input_data['format'];
$data_to_db['identifier'] = randomString(rand(5,8));
$data_to_db['qrcode'] = $data_to_db['filename'].'.'.$data_to_db['format'];
$data_to_qrcode = READ_PATH.$data_to_db['identifier'];
$this->qrcode_instance->addQrcode($input_data, $data_to_db, $data_to_qrcode);
}
/**
* Edit qr code
*
*/
public function editQrcode($input_data) {
$data_to_db['filename'] = htmlspecialchars($input_data['filename'], ENT_QUOTES, 'UTF-8');
$data_to_db['created_at'] = date('Y-m-d H:i:s');
$data_to_db['link'] = htmlspecialchars($input_data['link'], ENT_QUOTES, 'UTF-8');
$data_to_db['state'] = $input_data['state'];
$this->qrcode_instance->editQrcode($input_data, $data_to_db);
}
/**
* Delete qr code
*
*/
public function deleteQrcode($id) {
if($_SESSION['admin_type'] !== 'super')
$this->failure("You don't have permission to perform this action");
$this->qrcode_instance->deleteQrcode($id);
}
/**
* Flash message Failure process
*/
private function failure($message) {
$_SESSION['failure'] = $message;
header('Location: dynamic_qrcodes.php');
exit();
}
/**
* Flash message Success process
*/
private function success($message) {
$_SESSION['success'] = $message;
header('Location: dynamic_qrcodes.php');
exit();
}
/**
* Flash message Info process
*/
private function info($message) {
$_SESSION['info'] = $message;
header('Location: dynamic_qrcodes.php');
exit();
}
public function debug($data) {
echo '<pre>' . var_export($data, true) . '</pre>';
exit();
}
}
?>
+157
View File
@@ -0,0 +1,157 @@
<?php
/**
* This is free and unencumbered software released into the public domain.
*
* Anyone is free to copy, modify, publish, use, compile, sell, or
* distribute this software, either in source code form or as a compiled
* binary, for any purpose, commercial or non-commercial, and by any
* means.
*
* In jurisdictions that recognize copyright laws, the author or authors
* of this software dedicate any and all copyright interest in the
* software to the public domain. We make this dedication for the benefit
* of the public at large and to the detriment of our heirs and
* successors. We intend this dedication to be an overt act of
* relinquishment in perpetuity of all present and future rights to this
* software under copyright law.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
* IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
* OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
* OTHER DEALINGS IN THE SOFTWARE.
*
* For more information, please refer to <http://unlicense.org>
*
* ICS.php
* =============================================================================
* Use this class to create an .ics file.
*
*
* Usage
* -----------------------------------------------------------------------------
* Basic usage - generate ics file contents (see below for available properties):
* $ics = new ICS($props);
* $ics_file_contents = $ics->to_string();
*
* Setting properties after instantiation
* $ics = new ICS();
* $ics->set('summary', 'My awesome event');
*
* You can also set multiple properties at the same time by using an array:
* $ics->set(array(
* 'dtstart' => 'now + 30 minutes',
* 'dtend' => 'now + 1 hour'
* ));
*
* Available properties
* -----------------------------------------------------------------------------
* description
* String description of the event.
* dtend
* A date/time stamp designating the end of the event. You can use either a
* DateTime object or a PHP datetime format string (e.g. "now + 1 hour").
* dtstart
* A date/time stamp designating the start of the event. You can use either a
* DateTime object or a PHP datetime format string (e.g. "now + 1 hour").
* location
* String address or description of the location of the event.
* summary
* String short summary of the event - usually used as the title.
* url
* A url to attach to the the event. Make sure to add the protocol (http://
* or https://).
*/
class ICS {
const DT_FORMAT = 'Ymd\THis\Z';
protected $properties = array();
private $available_properties = array(
'description',
'dtend',
'dtstart',
'location',
'summary',
'url'
);
public function __construct($props) {
$this->set($props);
}
public function set($key, $val = false) {
if (is_array($key)) {
foreach ($key as $k => $v) {
$this->set($k, $v);
}
} else {
if (in_array($key, $this->available_properties)) {
$this->properties[$key] = $this->sanitize_val($val, $key);
}
}
}
public function to_string() {
$rows = $this->build_props();
return implode("\r\n", $rows);
}
private function build_props() {
// Build ICS properties - add header
$ics_props = array(
'BEGIN:VCALENDAR',
'VERSION:2.0',
'PRODID:-//hacksw/handcal//NONSGML v1.0//EN',
'CALSCALE:GREGORIAN',
'BEGIN:VEVENT'
);
// Build ICS properties - add header
$props = array();
foreach($this->properties as $k => $v) {
$props[strtoupper($k . ($k === 'url' ? ';VALUE=URI' : ''))] = $v;
}
// Set some default values
$props['DTSTAMP'] = $this->format_timestamp('now');
$props['UID'] = uniqid();
// Append properties
foreach ($props as $k => $v) {
$ics_props[] = "$k:$v";
}
// Build ICS properties - add footer
$ics_props[] = 'END:VEVENT';
$ics_props[] = 'END:VCALENDAR';
return $ics_props;
}
private function sanitize_val($val, $key = false) {
switch($key) {
case 'dtend':
case 'dtstamp':
case 'dtstart':
$val = $this->format_timestamp($val);
break;
default:
$val = $this->escape_string($val);
}
return $val;
}
private function format_timestamp($timestamp) {
$dt = new DateTime($timestamp);
return $dt->format(self::DT_FORMAT);
}
private function escape_string($str) {
return preg_replace('/([\,;])/','\\\$1', $str);
}
}
File diff suppressed because it is too large Load Diff

Some files were not shown because too many files have changed in this diff Show More