Add files via upload
This commit is contained in:
committed by
GitHub
parent
97df13f3f0
commit
86f32b6327
+6
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>
|
||||
Binary file not shown.
Binary file not shown.
File diff suppressed because it is too large
Load Diff
|
After Width: | Height: | Size: 434 KiB |
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -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>
|
||||
@@ -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 |
@@ -0,0 +1,36 @@
|
||||
<?php
|
||||
|
||||
//Note: This file should be included first in every php page.
|
||||
error_reporting(E_ALL);
|
||||
ini_set('display_errors', 'On');
|
||||
define('BASE_PATH', dirname(dirname(__FILE__)));
|
||||
define('APP_FOLDER', 'simpleadmin');
|
||||
define('CURRENT_PAGE', basename($_SERVER['REQUEST_URI']));
|
||||
|
||||
/* PATH OF SAVED QR CODES */
|
||||
define('PATH', './saved_qrcode/'); //You can change the folder where the qr code will be saved
|
||||
define('DIRECTORY', BASE_PATH.'/saved_qrcode/');
|
||||
|
||||
//You can change the page name for the redirect and the search parameter (the default is "id")
|
||||
define('READ_PATH', $_SERVER['HTTP_HOST'].'/read.php?id=');
|
||||
|
||||
require_once BASE_PATH . '/lib/MysqliDb/MysqliDb.php';
|
||||
require_once BASE_PATH . '/helpers/helpers.php';
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| DATABASE CONFIGURATION
|
||||
|--------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
define('DB_HOST', "%HOSTNAME%");
|
||||
define('DB_USER', "%USERNAME%");
|
||||
define('DB_PASSWORD', "%PASSWORD%");
|
||||
define('DB_NAME', "%DATABASE%");
|
||||
|
||||
/**
|
||||
* Get instance of DB object
|
||||
*/
|
||||
function getDbInstance() {
|
||||
return new MysqliDb(DB_HOST, DB_USER, DB_PASSWORD, DB_NAME);
|
||||
}
|
||||
@@ -0,0 +1,163 @@
|
||||
<?php
|
||||
error_reporting(0);
|
||||
|
||||
if (isset($_POST["btn_install"])) {
|
||||
|
||||
$db_host = $_POST['db_host'];
|
||||
$db_name = $_POST['db_name'];
|
||||
$db_user = $_POST['db_user'];
|
||||
$db_password = $_POST['db_password'];
|
||||
|
||||
// Load the classes and create the new objects
|
||||
require_once('includes/core_class.php');
|
||||
require_once('includes/database_class.php');
|
||||
|
||||
$core = new Core();
|
||||
$database = new Database();
|
||||
|
||||
// Validate the post data
|
||||
if ($core->validate_post($_POST) == true) {
|
||||
// First create the database, then create tables, then write config file
|
||||
if ($database->create_database($_POST) == false) {
|
||||
$message = $core->show_message('error', "The database could not be created, please check your database credentials!");
|
||||
} else if ($database->create_tables($_POST) == false) {
|
||||
$message = $core->show_message('error', "The database tables could not be created, please check your database credentials!");
|
||||
} else if ($core->write_config($_POST) == false) {
|
||||
$message = $core->show_message('error', "The database configuration file could not be written, please chmod application/config/database.php file to 777");
|
||||
}
|
||||
|
||||
// If no errors, redirect to index
|
||||
if (!isset($message)) {
|
||||
header("Refresh: 10; finish.php");
|
||||
$installing = 1;
|
||||
}
|
||||
} else {
|
||||
$message = $core->show_message('error', 'Not all fields have been filled in correctly. The host, username, password, and database name are required.');
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
<!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 - Installer</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="steps">
|
||||
<div class="step-progress">
|
||||
<div class="step-progress-line" data-now-value="72" data-number-of-steps="5" style="width: 72%;"></div>
|
||||
</div>
|
||||
<div class="step">
|
||||
<div class="step-icon"><i class="fa fa-code"></i></div>
|
||||
<p>Start</p>
|
||||
</div>
|
||||
<div class="step">
|
||||
<div class="step-icon"><i class="fa fa-folder-open"></i></div>
|
||||
<p>Folder Permissions</p>
|
||||
</div>
|
||||
<div class="step active">
|
||||
<div class="step-icon"><i class="fa fa-database"></i></div>
|
||||
<p>Database</p>
|
||||
</div>
|
||||
<div class="step">
|
||||
<div class="step-icon"><i class="fa fa-user"></i></div>
|
||||
<p>Finish</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="messages">
|
||||
<?php if (isset($message)) { ?>
|
||||
<div class="alert alert-danger">
|
||||
<strong><?php echo $message; ?></strong>
|
||||
</div>
|
||||
<?php } ?>
|
||||
<?php if (isset($installing)) { ?>
|
||||
<div class="alert alert-success">
|
||||
<strong>The database is being created. Please wait!</strong>
|
||||
</div>
|
||||
<?php } ?>
|
||||
</div>
|
||||
<?php if (isset($installing)) { ?>
|
||||
<div class="col-sm-12">
|
||||
<div class="row">
|
||||
<div class="spinner">
|
||||
<div class="rect1"></div>
|
||||
<div class="rect2"></div>
|
||||
<div class="rect3"></div>
|
||||
<div class="rect4"></div>
|
||||
<div class="rect5"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php } ?>
|
||||
<div class="step-contents">
|
||||
<div class="tab-1">
|
||||
<form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post">
|
||||
<div class="tab-content">
|
||||
<div class="tab_1">
|
||||
<h1 class="step-title">Database</h1>
|
||||
<div class="form-group">
|
||||
<label for="email">Host</label>
|
||||
<input type="text" class="form-control form-input" name="db_host" placeholder="Host"
|
||||
value="<?php echo isset($db_host) ? @$db_host : 'localhost'; ?>" required>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="email">Database Name</label>
|
||||
<input type="text" class="form-control form-input" name="db_name" placeholder="Database Name"
|
||||
value="<?php echo @$db_name; ?>" required>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="email">Username</label>
|
||||
<input type="text" class="form-control form-input" name="db_user" placeholder="Username"
|
||||
value="<?php echo @$db_user; ?>" required>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="email">Password</label>
|
||||
<input type="text" class="form-control form-input" name="db_password" placeholder="Password"
|
||||
value="<?php echo @$db_password; ?>">
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="buttons">
|
||||
<a href="folder-permissions.php" class="btn btn-success btn-custom pull-left">Prev</a>
|
||||
<button type="submit" name="btn_install" class="btn btn-success btn-custom pull-right">Finish</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,96 @@
|
||||
<?php
|
||||
|
||||
if (!file_exists('../config/config.php')) {
|
||||
header("Location: index.php");
|
||||
exit();
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
<!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 - Installer</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="steps">
|
||||
<div class="step-progress">
|
||||
<div class="step-progress-line" data-now-value="100" data-number-of-steps="5" style="width: 100%;"></div>
|
||||
</div>
|
||||
<div class="step">
|
||||
<div class="step-icon"><i class="fa fa-code"></i></div>
|
||||
<p>Start</p>
|
||||
</div>
|
||||
<div class="step">
|
||||
<div class="step-icon"><i class="fa fa-folder-open"></i></div>
|
||||
<p>Folder Permissions</p>
|
||||
</div>
|
||||
<div class="step">
|
||||
<div class="step-icon"><i class="fa fa-database"></i></div>
|
||||
<p>Database</p>
|
||||
</div>
|
||||
<div class="step active">
|
||||
<div class="step-icon"><i class="fa fa-user"></i></div>
|
||||
<p>Finish</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="step-contents">
|
||||
<div class="tab-1">
|
||||
<h1 class="step-title">Finish</h1>
|
||||
<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>
|
||||
@@ -0,0 +1,91 @@
|
||||
<?php
|
||||
|
||||
|
||||
?>
|
||||
|
||||
<!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 - Installer</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="steps">
|
||||
<div class="step-progress">
|
||||
<div class="step-progress-line" data-now-value="50" data-number-of-steps="5" style="width: 50%;"></div>
|
||||
</div>
|
||||
<div class="step">
|
||||
<div class="step-icon"><i class="fa fa-code"></i></div>
|
||||
<p>Start</p>
|
||||
</div>
|
||||
<div class="step active">
|
||||
<div class="step-icon"><i class="fa fa-folder-open"></i></div>
|
||||
<p>Folder Permissions</p>
|
||||
</div>
|
||||
<div class="step">
|
||||
<div class="step-icon"><i class="fa fa-database"></i></div>
|
||||
<p>Database</p>
|
||||
</div>
|
||||
<div class="step">
|
||||
<div class="step-icon"><i class="fa fa-user"></i></i></div>
|
||||
<p>Finish</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="step-contents">
|
||||
<div class="tab-1">
|
||||
<h1 class="step-title">Folder Permissions</h1>
|
||||
<div class="row">
|
||||
<div class="col-sm-6">
|
||||
<p><i class="fa fa-folder-open"></i> /config</p>
|
||||
<p><i class="fa fa-folder-open"></i> /saved_qrcode</p>
|
||||
</div>
|
||||
<div class="col-sm-6 text-right">
|
||||
<p><?php if (is_writable('../config')) { ?><i class="fa fa-check color-success"></i><?php } else { ?><i class="fa fa-close color-danger"></i><?php } ?></p>
|
||||
<p><?php if (is_writable('../saved_qrcode')) { ?><i class="fa fa-check color-success"></i><?php } else { ?><i class="fa fa-close color-danger"></i><?php } ?></p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="buttons">
|
||||
<a href="index.php" class="btn btn-success btn-custom pull-left">Prev</a>
|
||||
|
||||
<a href="database.php" class="btn btn-success btn-custom pull-right">Next</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,61 @@
|
||||
/**
|
||||
* 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
|
||||
*/
|
||||
<?php
|
||||
|
||||
class Core {
|
||||
|
||||
// Function to validate the post data
|
||||
function validate_post($data)
|
||||
{
|
||||
/* Validating the hostname, the database name and the username. The password is optional. */
|
||||
return !empty($data['db_host']) && !empty($data['db_user']) && !empty($data['db_name']);
|
||||
}
|
||||
|
||||
// Function to show an error
|
||||
function show_message($type,$message) {
|
||||
return $message;
|
||||
}
|
||||
|
||||
// Function to write the config file
|
||||
function write_config($data) {
|
||||
|
||||
// Config path
|
||||
$template_path = 'config/database.php';
|
||||
$output_path = '../config/config.php';
|
||||
|
||||
// Open the file
|
||||
$database_file = file_get_contents($template_path);
|
||||
|
||||
$new = str_replace("%HOSTNAME%",$data['db_host'],$database_file);
|
||||
$new = str_replace("%USERNAME%",$data['db_user'],$new);
|
||||
$new = str_replace("%PASSWORD%",$data['db_password'],$new);
|
||||
$new = str_replace("%DATABASE%",$data['db_name'],$new);
|
||||
|
||||
// Write the new database.php file
|
||||
$handle = fopen($output_path,'w+');
|
||||
|
||||
// Chmod the file, in case the user forgot
|
||||
@chmod($output_path,0777);
|
||||
|
||||
// Verify file permissions
|
||||
if(is_writable($output_path)) {
|
||||
|
||||
// Write the file
|
||||
if(fwrite($handle,$new)) {
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,54 @@
|
||||
/**
|
||||
* 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
|
||||
*/
|
||||
<?php
|
||||
|
||||
class Database {
|
||||
|
||||
// Function to the database and tables and fill them with the default data
|
||||
function create_database($data)
|
||||
{
|
||||
// Connect to the database
|
||||
$mysqli = new mysqli($data['db_host'],$data['db_user'],$data['db_password'],'');
|
||||
|
||||
// Check for errors
|
||||
if(mysqli_connect_errno())
|
||||
return false;
|
||||
|
||||
// Create the prepared statement
|
||||
$mysqli->query("CREATE DATABASE IF NOT EXISTS ".$data['db_name']);
|
||||
|
||||
// Close the connection
|
||||
$mysqli->close();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
// Function to create the tables and fill them with the default data
|
||||
function create_tables($data)
|
||||
{
|
||||
// Connect to the database
|
||||
$mysqli = new mysqli($data['db_host'],$data['db_user'],$data['db_password'],$data['db_name']);
|
||||
|
||||
// Check for errors
|
||||
if(mysqli_connect_errno())
|
||||
return false;
|
||||
|
||||
// Open the default SQL file
|
||||
$query = file_get_contents('sql/sample_data.sql');
|
||||
|
||||
// Execute a multi query
|
||||
$mysqli->multi_query($query);
|
||||
|
||||
// Close the connection
|
||||
$mysqli->close();
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,122 @@
|
||||
<?php
|
||||
|
||||
?>
|
||||
|
||||
<!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 - Installer</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">
|
||||
<!--<h1>PHP Dynamic Qr code Generator</h1>-->
|
||||
<img src="assets/img/DynamicQRCode_BlackWhite.png">
|
||||
<!--<p>Welcome to the Installer</p>-->
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-sm-12">
|
||||
|
||||
<div class="install-box">
|
||||
|
||||
|
||||
<div class="steps">
|
||||
<div class="step-progress">
|
||||
<div class="step-progress-line" data-now-value="28" data-number-of-steps="5" style="width: 28%;"></div>
|
||||
</div>
|
||||
<div class="step active">
|
||||
<div class="step-icon"><i class="fa fa-code"></i></div>
|
||||
<p>Start</p>
|
||||
</div>
|
||||
<div class="step">
|
||||
<div class="step-icon"><i class="fa fa-folder-open"></i></div>
|
||||
<p>Folder Permissions</p>
|
||||
</div>
|
||||
<div class="step">
|
||||
<div class="step-icon"><i class="fa fa-database"></i></div>
|
||||
<p>Database</p>
|
||||
</div>
|
||||
<div class="step">
|
||||
<div class="step-icon"><i class="fa fa-user"></i></div>
|
||||
<p>Finish</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="step-contents">
|
||||
<div class="tab-1">
|
||||
<h1 class="step-title">System Requirements</h1>
|
||||
<div class="row">
|
||||
<div class="col-sm-11">
|
||||
<p>
|
||||
<span class="req-span"><i class="fa fa-circle"></i> PHP Version:</span>
|
||||
<?php if (phpversion() >= 5.6): ?>
|
||||
<strong class="color-success"><?php echo phpversion(); ?></strong>
|
||||
<?php else: ?>
|
||||
<strong class="color-danger"><?php echo phpversion(); ?> <small>(Your PHP version must be 5.6 or greater)</small>
|
||||
</strong>
|
||||
<?php endif; ?>
|
||||
</p>
|
||||
<p>
|
||||
<span class="req-span"><i class="fa fa-circle"></i> cURL PHP Extension:</span>
|
||||
<?php if (extension_loaded('curl')): ?>
|
||||
<strong class="color-success">Enabled</strong>
|
||||
<?php else: ?>
|
||||
<strong class="color-danger">Disabled <small>(You should enable "cURL" in your server)</small>
|
||||
</strong>
|
||||
<?php endif; ?>
|
||||
</p>
|
||||
|
||||
</div>
|
||||
<div class="col-sm-1 text-right">
|
||||
<p>
|
||||
<?php if (phpversion() >= 5.6): ?>
|
||||
<i class="fa fa-check color-success"></i>
|
||||
<?php else: ?>
|
||||
<i class="fa fa-times color-danger"></i>
|
||||
<?php endif; ?>
|
||||
</p>
|
||||
<p>
|
||||
<?php if (extension_loaded('curl')): ?>
|
||||
<i class="fa fa-check color-success"></i>
|
||||
<?php else: ?>
|
||||
<i class="fa fa-times color-danger"></i>
|
||||
<?php endif; ?>
|
||||
</p>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="buttons">
|
||||
|
||||
<a href="folder-permissions.php" class="btn btn-success btn-custom pull-right">Next</a>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
</body>
|
||||
</html>
|
||||
@@ -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 `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 `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 `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 `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 `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 `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 Anywhere 15523 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 */;
|
||||
Reference in New Issue
Block a user