23e8d9b765
Applies the approved QRForge brand kit throughout the app: - New logo/icon SVGs, favicon set (ico/svg/png), apple-touch-icon, all copied from the approved brand kit into src/dist/img/brand/. Old Symbol_WhiteBlue.png/DynamicQRCode_Original.png removed (unused after the swap). - Sidebar brand image/text, login and change-password page logos, all <title> tags, manifest.json name/theme-color, and the PWA icons (dist/img/icon-192.png/icon-512.png, same filenames so no other reference needed to change) updated to QRForge branding and the #2563EB brand blue. - New about.php page (+ sidebar link): credits the original upstream fork (Giandonato Inverso) and chillerlan/php-qrcode, links to the free qr.ensembia.com try-out, the commercial www.qrforge.eu product page, and this GitHub repo for self-hosters. - Footer now reads "QRForge" + "About / credits" + "Version 3.0" (replaces the inherited "PHP Qrcode Generator by Giandonato Inverso" / "Version 2.3.0" line - full credit moved to the About page instead). - README.md rewritten: current feature set (all 16 static qr types, presets, scanner, PWA, location search, roles), qr.ensembia.com as the free try-out, www.qrforge.eu as the commercial product page, corrected Docker Compose setup steps (.env is required now, the old README still described the single-file demo setup from the original upstream fork). IMPORTANT: not pushed to origin/gitea. Per user instruction, no push until qrforge.eu domain registration is confirmed.
158 lines
4.7 KiB
PHP
158 lines
4.7 KiB
PHP
<?php
|
|
require_once 'includes/bootstrap.php';
|
|
require_once BASE_PATH.'/includes/auth_validate.php';
|
|
require_once BASE_PATH . '/lib/DynamicQrcode/DynamicQrcode.php';
|
|
|
|
if ($_SESSION['type'] === 'user') {
|
|
$_SESSION['failure'] = 'The "user" role is read-only and cannot create, edit or delete qr codes.';
|
|
header('Location: index.php');
|
|
exit;
|
|
}
|
|
|
|
$dynamic_qrcode_instance = new DynamicQrcode();
|
|
|
|
if ($_SERVER['REQUEST_METHOD'] === 'POST') {
|
|
csrf_verify_or_die();
|
|
}
|
|
|
|
$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_owner"]) &&
|
|
isset($_POST["id"])
|
|
)
|
|
$dynamic_qrcode_instance->editQrcode($_POST);
|
|
}
|
|
|
|
if($_SERVER["REQUEST_METHOD"] === "POST" && !isset($_POST["edit"]) && !isset($_POST["del_id"])) {
|
|
if(
|
|
isset($_POST["foreground"]) &&
|
|
isset($_POST["background"]) &&
|
|
isset($_POST["link"]) &&
|
|
isset($_POST["filename"]) &&
|
|
isset($_POST["format"]) &&
|
|
isset($_POST["id_owner"])
|
|
) {
|
|
$icon_upload = qr_handle_icon_upload('icon');
|
|
if (!$icon_upload['ok']) {
|
|
$_SESSION['failure'] = $icon_upload['error'];
|
|
header('Location: ' . basename(__FILE__));
|
|
exit;
|
|
}
|
|
$_POST['icon_tmp_path'] = $icon_upload['path'];
|
|
|
|
$dynamic_qrcode_instance->addQrcode($_POST);
|
|
}
|
|
}
|
|
?>
|
|
<!DOCTYPE html>
|
|
<html lang="en">
|
|
<title>QRForge</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">
|
|
<?php echo csrf_field(); ?>
|
|
<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>
|