Local setup eliminated and documentation updated

This commit is contained in:
giandonato.inverso@edempg.it
2025-01-12 23:48:49 +01:00
parent 79d9ac71a3
commit f05c073ad4
20 changed files with 8 additions and 5567 deletions
+7 -13
View File
@@ -61,8 +61,8 @@
<div class="mainpanel">
<div class="title" id="header">
<h1>PHP Dynamic Qr code - v2.x</h1>
<small> Documentation - v2.x / Last Update: 16/10/2023</small>
<h1>PHP Dynamic Qr code - v2.3.0</h1>
<small> Documentation - v2.3.0 / Last Update: 13/01/2025</small>
<!--<h2 style="color: black">Technical documentation deprecated as the core of the project has been modified in version 2.0</h2>-->
</div>
@@ -81,24 +81,18 @@
<div id="setup">
<h2> Setup</h2>
<p>You can choose between local installation (recommended for development) and docker installation (recommended for general use)</p>
<p><u>Follow these steps to install the script locally:</u></p>
<p><u>Local setup:</u></p>
<ol><strong>
<li>Clone the project from github</li>
<li>Use src/ folder as Document Root of your webserver</li>
<li>Edit config/environment.php with your database credential</li>
<li>Launch install/setup.php file in your browser </li>
<p>The script checks the requirements, write permissions on the generated folders and creates a database with sample data</p>
<li>Finish</li>
<p>If all went well you will see a summary screen with a login button (username: superadmin, password: superadmin). Alternatively, you will get an error message</p>
<li>No more available from v2.3.0</li>
</ol>
<p><u>Follow these steps to install the script with docker via docker compose (simplest method, recommended):</u></p>
<p><u>Docker:</u></p>
<ol>
<li>Download docker-compose.yml file from github and edit if you want (recommended)</li>
<li>docker compose build --no-cache && docker compose up -d</li>
<li>Open your browser at http://localhost:80 and login with (username: superadmin, password: superadmin) </li>
<li>Finish</li>
</ol>
<p><u>Follow these steps to install the script with docker via locally build image:</u></p>
<p><u>Docker image building:</u></p>
<ol>
<li>Clone the project from github</li>
<li>Clone the database project from github: https://github.com/giandonatoinverso/PHP-Dynamic-Qr-code-db</li>
@@ -289,7 +283,7 @@ However, this feature is not recommended as it can cause different QR code scann
<h2>Support</h2>
<div class="wrapper">
<div class="alert alert-success alert-dismissible" role="alert">
If you have any question please feel free to email me at <strong><a href="mailto:info@giandonatoinverso.it?Subject=Dynamic%20Qrcode" target="_top">info@giandonatoinverso.it</a></strong>
If you have any question please feel free to email me at <strong><a href="mailto:hello@giandonatoinverso.dev?Subject=Dynamic%20Qrcode" target="_top">hello@giandonatoinverso.dev</a></strong>
</div>
<p>Please don't forget to rate my script on GitHub.
<br>
+1 -1
View File
@@ -8,7 +8,7 @@
<footer class="main-footer text-sm">
<strong><a href="https://github.com/giandonatoinverso/PHP-Dynamic-Qr-code" target="_blank">PHP Qrcode Generator</a> by </strong> Giandonato Inverso
<div class="float-right d-none d-sm-inline-block">
<b>Version</b> 2.2.7
<b>Version</b> 2.3.0
</div>
</footer>
</div>
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
@@ -1,11 +0,0 @@
<!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

Before

Width:  |  Height:  |  Size: 434 KiB

@@ -1,11 +0,0 @@
<!DOCTYPE html>
<html>
<head>
<title>403 Forbidden</title>
</head>
<body>
<p>Directory access is forbidden.</p>
</body>
</html>
@@ -1,11 +0,0 @@
<!DOCTYPE html>
<html>
<head>
<title>403 Forbidden</title>
</head>
<body>
<p>Directory access is forbidden.</p>
</body>
</html>
-263
View File
@@ -1,263 +0,0 @@
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.

Before

Width:  |  Height:  |  Size: 6.9 KiB

-59
View File
@@ -1,59 +0,0 @@
<!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>
-47
View File
@@ -1,47 +0,0 @@
<?php
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;
}
}
-52
View File
@@ -1,52 +0,0 @@
<?php
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");
?>
-81
View File
@@ -1,81 +0,0 @@
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 */;
CREATE TABLE IF NOT EXISTS `#prefix#users` (
`id` int(25) NOT NULL AUTO_INCREMENT,
`username` 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,
`type` varchar(10) NOT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `username` (`username`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=0 ;
INSERT INTO `#prefix#users` (`id`, `username`, `password`, `series_id`, `remember_token`, `expires`, `type`) VALUES
(1, 'superadmin', '$2y$10$xpZc5KC.aU2XHkcqhuZGFuAnqmtL4Unt8MysOyylceq.19XIyoZpG', 'F5V8N81eQKYJbiyj', '$2y$10$MRWA31CVjAmtrojbm4r18ezDfqC3msAxzJ1ZdbyoRpD5pxF3IdJG6', '2020-09-30 16:19:08', 'super');
CREATE TABLE IF NOT EXISTS `#prefix#dynamic_qrcodes` (
`id` int(10) NOT NULL AUTO_INCREMENT,
`id_owner` int(25) NULL DEFAULT NULL,
`filename` varchar(45) NOT NULL,
`format` varchar(45) DEFAULT NULL,
`identifier` longtext,
`link` varchar(500) 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=0 ;
INSERT INTO `#prefix#dynamic_qrcodes` (`id`, `id_owner`, `filename`, `format`, `identifier`, `link`, `qrcode`, `scan`, `state`, `created_by`, `created_at`, `updated_by`, `updated_at`) VALUES
(1, 1, 'Facebook', 'png', 'rcCeC', 'https://facebook.com', 'Facebook.png', 0, 'enable', 0, '2020-09-01 15:35:13', 0, NULL),
(2, 1, 'Amazon', 'png', 'F7GOY6', 'https://amazon.com', 'Amazon.png', 0, 'enable', 0, '2020-09-01 15:40:34', 0, NULL),
(3, 1, 'Youtube', 'png', '8dK5Nd', 'https://youtube.com', 'Youtube.png', 0, 'enable', 0, '2020-09-01 15:41:43', 0, NULL),
(4, 1, 'Apple', 'jpg', '7zxTKn', 'https://apple.com', 'Apple.jpg', 0, 'enable', 0, '2020-09-01 15:44:20', 0, NULL),
(5, 1, 'Ebay', 'svg', 'a4F3kr', 'https://ebay.com', 'Ebay.svg', 0, 'enable', 0, '2020-09-01 15:44:46', 0, NULL),
(6, 1, 'Google', 'png', 'saJV1y', 'https://google.it', 'Google.png', 0, 'enable', 0, '2020-09-01 15:46:37', 0, NULL);
CREATE TABLE IF NOT EXISTS `#prefix#static_qrcodes` (
`id` int(10) NOT NULL AUTO_INCREMENT,
`id_owner` int(25) NULL DEFAULT NULL,
`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=0 ;
INSERT INTO `#prefix#static_qrcodes` (`id`, `id_owner`, `filename`, `format`, `type`, `content`, `qrcode`, `state`, `created_by`, `created_at`, `updated_by`, `updated_at`) VALUES
(1, 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, 1, '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, 1, 'Call me', 'png', 'phone', '<strong>Phone number:</strong> 12563776756', 'Call me.png', 'enable', 0, '2020-08-24 08:45:10', 0, NULL),
(4, 1, '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, 1, '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, 1, '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, 1, '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, 1, '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, 1, '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, 1, '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, 1, '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, 1, '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 */;