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
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 */;