Add files via upload
@@ -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">
|
||||||
|
</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-4">
|
||||||
|
<div class="form-group">
|
||||||
|
<label for="link">URL *</label>
|
||||||
|
<input type="url" pattern="https://.*" name="link" value="" placeholder="https://codecanyon.net" 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">
|
||||||
|
<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>
|
||||||
|
</fieldset>
|
||||||
@@ -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>
|
||||||
@@ -0,0 +1,76 @@
|
|||||||
|
<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="15%">Filename</th>
|
||||||
|
<th width="18%">Unique redirect identifier</th>
|
||||||
|
<th width="36%">URL</th>
|
||||||
|
<th width="8%">Qr code</th>
|
||||||
|
<th width="5%">Scan</th>
|
||||||
|
<th width="23%">Operations</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
<?php foreach ($rows as $row): ?>
|
||||||
|
<tr>
|
||||||
|
<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="'.PATH.htmlspecialchars($row['qrcode']).'" width="100" height="100">'; ?>
|
||||||
|
</td>
|
||||||
|
<td><?php echo htmlspecialchars($row['scan']); ?></td>
|
||||||
|
<td>
|
||||||
|
|
||||||
|
<!-- EDIT -->
|
||||||
|
<a href="edit_dynamic.php?filename=<?php echo $row['filename']; ?>&dynamic_id=<?php echo $row['id']; ?>&operation=edit" class="btn btn-primary"><i class="fas fa-edit"></i></a>
|
||||||
|
|
||||||
|
<!-- DELETE -->
|
||||||
|
<a href="#" class="btn btn-danger delete_btn" data-toggle="modal" data-target="#confirm-delete-<?php echo $row['id']; ?>"><i class="fas fa-trash"></i></a>
|
||||||
|
|
||||||
|
<!-- DOWNLOAD -->
|
||||||
|
<a href="<?php echo PATH.htmlspecialchars($row['qrcode']); ?>" class="btn btn-primary" download><i class="fa fa-download"></i></a>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<!-- Delete Confirmation Modal -->
|
||||||
|
<div class="modal fade" id="confirm-delete-<?php echo $row['id']; ?>" role="dialog">
|
||||||
|
<div class="modal-dialog">
|
||||||
|
<form action="delete_dynamic.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">×</span></button>
|
||||||
|
</div>
|
||||||
|
<div class="modal-body">
|
||||||
|
<input type="hidden" name="del_id" id="del_id" value="<?php echo $row['id']; ?>">
|
||||||
|
<input type="hidden" name="filename" id="filename" value="<?php echo $row['filename']; ?>">
|
||||||
|
<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 -->
|
||||||
|
<?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 -->
|
||||||
@@ -0,0 +1,37 @@
|
|||||||
|
<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>
|
||||||
|
</fieldset>
|
||||||
@@ -0,0 +1,11 @@
|
|||||||
|
<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>
|
||||||
|
|
||||||
|
</fieldset>
|
||||||
@@ -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>
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
<!-- code for logo -->
|
||||||
@@ -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>
|
||||||
@@ -0,0 +1,57 @@
|
|||||||
|
<form class="form" action="./add_static.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>
|
||||||
@@ -0,0 +1,30 @@
|
|||||||
|
<form class="form" action="./add_static.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>
|
||||||
@@ -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 & 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 & 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 & 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 & 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 & 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>
|
||||||
@@ -0,0 +1,38 @@
|
|||||||
|
<form class="form" action="./add_static.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>
|
||||||
@@ -0,0 +1,74 @@
|
|||||||
|
<form class="form" action="./add_static.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>
|
||||||
@@ -0,0 +1,26 @@
|
|||||||
|
<form class="form" action="./add_static.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>
|
||||||
@@ -0,0 +1,110 @@
|
|||||||
|
<form class="form" action="./add_static.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>
|
||||||
@@ -0,0 +1,33 @@
|
|||||||
|
<form class="form" action="./add_static.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>
|
||||||
@@ -0,0 +1,19 @@
|
|||||||
|
<form class="form" action="./add_static.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>
|
||||||
@@ -0,0 +1,40 @@
|
|||||||
|
<form class="form" action="./add_static.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>
|
||||||
@@ -0,0 +1,19 @@
|
|||||||
|
<form class="form" action="./add_static.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>
|
||||||
@@ -0,0 +1,152 @@
|
|||||||
|
<form class="form" action="./add_static.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>
|
||||||
@@ -0,0 +1,40 @@
|
|||||||
|
<form class="form" action="./add_static.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>
|
||||||
@@ -0,0 +1,42 @@
|
|||||||
|
<form class="form" action="./add_static.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>
|
||||||
@@ -0,0 +1,74 @@
|
|||||||
|
<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="12%">Filename</th>
|
||||||
|
<th width="7%">Type</th>
|
||||||
|
<th width="55%">Content</th>
|
||||||
|
<th width="8%">Qr code</th>
|
||||||
|
<th width="23%">Operations</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
<?php foreach ($rows as $row): ?>
|
||||||
|
<tr>
|
||||||
|
<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="'.PATH.htmlspecialchars($row['qrcode']).'" width="100" height="100">'; ?>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
|
||||||
|
<!-- EDIT -->
|
||||||
|
<a href="edit_static.php?filename=<?php echo $row['filename']; ?>&static_id=<?php echo $row['id']; ?>&operation=edit" class="btn btn-primary"><i class="fas fa-edit"></i></a>
|
||||||
|
|
||||||
|
<!-- DELETE -->
|
||||||
|
<a href="#" class="btn btn-danger delete_btn" data-toggle="modal" data-target="#confirm-delete-<?php echo $row['id']; ?>"><i class="fas fa-trash"></i></a>
|
||||||
|
|
||||||
|
<!-- DOWNLOAD -->
|
||||||
|
<a href="<?php echo PATH.htmlspecialchars($row['qrcode']); ?>" class="btn btn-primary" download><i class="fa fa-download"></i></a>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<!-- Delete Confirmation Modal -->
|
||||||
|
<div class="modal fade" id="confirm-delete-<?php echo $row['id']; ?>" role="dialog">
|
||||||
|
<div class="modal-dialog">
|
||||||
|
<form action="delete_static.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">×</span></button>
|
||||||
|
</div>
|
||||||
|
<div class="modal-body">
|
||||||
|
<input type="hidden" name="del_id" id="del_id" value="<?php echo $row['id']; ?>">
|
||||||
|
<input type="hidden" name="filename" id="filename" value="<?php echo $row['filename']; ?>">
|
||||||
|
<p>Are you sure you want to delete this row? Proceeding with the cancellation the image will be deleted from the server and you will have to re-create the qr code with the desired content</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 -->
|
||||||
|
<?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 -->
|
||||||
@@ -0,0 +1,44 @@
|
|||||||
|
<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="" value="<?php echo ($edit) ? $admin_account['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="" 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">
|
||||||
|
<?php //echo $admin_account['admin_type'] ?>
|
||||||
|
<input type="radio" name="admin_type" value="super" required="" <?php echo ($edit && $admin_account['admin_type'] =='super') ? "checked": "" ; ?>/> Super admin</label>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="radio">
|
||||||
|
<label class="radio">
|
||||||
|
<input type="radio" name="admin_type" value="admin" required="" <?php echo ($edit && $admin_account['admin_type'] =='admin') ? "checked": "" ; ?>/> Admin</label>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</fieldset>
|
||||||
@@ -0,0 +1,63 @@
|
|||||||
|
<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="edit_admin.php?admin_user_id=<?php echo $row['id']; ?>&operation=edit" class="btn btn-primary"><i class="fas fa-edit"></i></a>
|
||||||
|
|
||||||
|
<!-- DELETE -->
|
||||||
|
<a href="#" class="btn btn-danger delete_btn" data-toggle="modal" data-target="#confirm-delete-<?php echo $row['id']; ?>"><i class="fas fa-trash"></i></a>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<!-- Delete Confirmation Modal -->
|
||||||
|
<div class="modal fade" id="confirm-delete-<?php echo $row['id']; ?>" role="dialog">
|
||||||
|
<div class="modal-dialog">
|
||||||
|
<form action="delete_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">×</span></button>
|
||||||
|
</div>
|
||||||
|
<div class="modal-body">
|
||||||
|
<input type="hidden" name="del_id" id="del_id" value="<?php echo $row['id']; ?>">
|
||||||
|
<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 -->
|
||||||
|
<?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 -->
|
||||||
@@ -0,0 +1,118 @@
|
|||||||
|
<?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;
|
||||||
|
}
|
||||||
@@ -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');
|
||||||
|
}
|
||||||
|
|
||||||
|
?>
|
||||||
@@ -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']);
|
||||||
|
}
|
||||||
|
|
||||||
|
?>
|
||||||
@@ -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 © 2020 <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> 1.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>
|
||||||
@@ -0,0 +1,18 @@
|
|||||||
|
<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">
|
||||||
@@ -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>
|
||||||
@@ -0,0 +1,37 @@
|
|||||||
|
<?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);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
?>
|
||||||
@@ -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 (CURRENT_PAGE == '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 (CURRENT_PAGE == 'dynamic_qrcodes.php' || CURRENT_PAGE == 'add_dynamic.php' || (substr(CURRENT_PAGE, 0, 16) == 'edit_dynamic.php')) ? ' class="nav-item has-treeview menu-open"' : ' class="nav-item has-treeview"'; ?>>
|
||||||
|
<a href="#" <?php echo (CURRENT_PAGE == 'dynamic_qrcodes.php' || CURRENT_PAGE == 'add_dynamic.php' || (substr(CURRENT_PAGE, 0, 16) == 'edit_dynamic.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 (CURRENT_PAGE == '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="./add_dynamic.php" <?php echo (CURRENT_PAGE == 'add_dynamic.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 (CURRENT_PAGE == 'static_qrcodes.php' || CURRENT_PAGE == 'add_static.php' || (substr(CURRENT_PAGE, 0, 15) == 'edit_static.php')) ? ' class="nav-item has-treeview menu-open"' : ' class="nav-item has-treeview"'; ?>>
|
||||||
|
<a href="#" <?php echo (CURRENT_PAGE == 'static_qrcodes.php' || CURRENT_PAGE == 'add_static.php' || (substr(CURRENT_PAGE, 0, 15) == 'edit_static.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 (CURRENT_PAGE == '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="./add_static.php" <?php echo (CURRENT_PAGE == 'add_static.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 (CURRENT_PAGE == 'admin_users.php' || CURRENT_PAGE == 'add_admin.php' || (substr(CURRENT_PAGE, 0, 14) == 'edit_admin.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>
|
||||||
@@ -0,0 +1,439 @@
|
|||||||
|
<?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
|
||||||
|
*/
|
||||||
|
|
||||||
|
session_start();
|
||||||
|
require_once './config/config.php';
|
||||||
|
require_once 'includes/auth_validate.php';
|
||||||
|
|
||||||
|
//Get DB instance. function is defined in config.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->query("SELECT sum(scan) FROM dynamic_qrcodes");
|
||||||
|
|
||||||
|
/* 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 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 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>PHP Qr Code Generator v1.0</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[0]['sum(scan)']; ?></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>
|
||||||
@@ -0,0 +1,11 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<title>403 Forbidden</title>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
|
||||||
|
<p>Directory access is forbidden.</p>
|
||||||
|
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
|
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>
|
||||||
@@ -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);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
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 */;
|
||||||
@@ -0,0 +1,294 @@
|
|||||||
|
<?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/config.php';
|
||||||
|
|
||||||
|
|
||||||
|
class Dynamic_Qrcode
|
||||||
|
{
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public function __construct()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
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;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This private function is used by both add () and edit () of this class to initially store in the array that will be sent to the database the:
|
||||||
|
* filename, created_at, link
|
||||||
|
*/
|
||||||
|
private function collect()
|
||||||
|
{
|
||||||
|
|
||||||
|
$data_to_db['filename'] = htmlspecialchars($_POST['filename'], ENT_QUOTES, 'UTF-8');
|
||||||
|
$data_to_db['created_at'] = date('Y-m-d H:i:s');
|
||||||
|
$data_to_db['link'] = htmlspecialchars($_POST['link'], ENT_QUOTES, 'UTF-8');
|
||||||
|
|
||||||
|
return $data_to_db;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set option for qr code like:
|
||||||
|
* Error Correction Level, size (default = 100), foreground, background
|
||||||
|
* return array of values
|
||||||
|
*/
|
||||||
|
private function setOptions()
|
||||||
|
{
|
||||||
|
$errorCorrectionLevel = 'L';
|
||||||
|
if (isset($_POST['level']) && in_array($_POST['level'], array('L','M','Q','H')))
|
||||||
|
$errorCorrectionLevel = $_POST['level'];
|
||||||
|
|
||||||
|
$size = 100;
|
||||||
|
if (isset($_POST['size']))
|
||||||
|
$size = min(max((int)$_POST['size'], 100), 1000);
|
||||||
|
|
||||||
|
$foreground = substr($_POST['foreground'], 1); // We eliminate the character "#" for the hexadecimal color
|
||||||
|
$background = substr($_POST['background'], 1);
|
||||||
|
|
||||||
|
//$logo = $_POST['optionlogo'];
|
||||||
|
|
||||||
|
return array(
|
||||||
|
"errorCorrectionLevel" => $errorCorrectionLevel,
|
||||||
|
"size" => $size,
|
||||||
|
"foreground" => $foreground,
|
||||||
|
"background" => $background,
|
||||||
|
//"optionlogo" => $logo,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 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 add()
|
||||||
|
{
|
||||||
|
$data_to_db['created_by'] = $_SESSION['user_id'];
|
||||||
|
$data_to_db = $this->collect();
|
||||||
|
$data_to_db['format'] = $_POST['format'];
|
||||||
|
// for the identifier we create a random alphanumeric string through the function "randomString" in helpers.php > config.php
|
||||||
|
$data_to_db['identifier'] = randomString(rand(5,8));
|
||||||
|
$data_to_db['qrcode'] = $data_to_db['filename'].'.'.$data_to_db['format'];
|
||||||
|
|
||||||
|
$options = $this->setOptions();
|
||||||
|
|
||||||
|
if(!file_exists(DIRECTORY.$data_to_db['filename'].'.'.$data_to_db['format'])){
|
||||||
|
$content = file_get_contents('https://api.qrserver.com/v1/create-qr-code/?data='.READ_PATH.$data_to_db['identifier'].'&&size='.$options['size'].'x'.$options['size'].'&ecc='.$options['errorCorrectionLevel'].'&margin=0&color='.$options['foreground'].'&bgcolor='.$options['background'].'&qzone=2'.'&format='.$data_to_db['format']);
|
||||||
|
|
||||||
|
$filename = DIRECTORY.$data_to_db['filename'].'.'.$data_to_db['format'];
|
||||||
|
|
||||||
|
try{
|
||||||
|
file_put_contents($filename, $content);
|
||||||
|
}
|
||||||
|
catch(Exception $e){
|
||||||
|
$this->failure($e->getMessage());
|
||||||
|
}
|
||||||
|
|
||||||
|
// If you want you can customide qr code with logo
|
||||||
|
//$this->addLogo($data_to_db['qrcode'], $options['optionlogo']);
|
||||||
|
|
||||||
|
$db = getDbInstance();
|
||||||
|
$last_id = $db->insert('dynamic_qrcodes', $data_to_db);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
$this->failure('You cannot create a new qr code with an existing name on the server!');
|
||||||
|
|
||||||
|
if ($last_id){
|
||||||
|
$this->success('Qr code added successfully!');
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
echo 'Insert failed: ' . $db->getLastError();
|
||||||
|
exit();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Edit qr code
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public function edit()
|
||||||
|
{
|
||||||
|
$db = getDbInstance();
|
||||||
|
|
||||||
|
$dynamic_id = htmlspecialchars($_GET['dynamic_id'], ENT_QUOTES, 'UTF-8'); // get dynamic id
|
||||||
|
$old_filename = htmlspecialchars($_GET['filename'], ENT_QUOTES, 'UTF-8'); // get filename
|
||||||
|
|
||||||
|
$query = $db->query("SELECT format FROM dynamic_qrcodes WHERE id=$dynamic_id"); // get format
|
||||||
|
$format = $query[0]['format'];
|
||||||
|
|
||||||
|
$data_to_db = $this->collect();
|
||||||
|
$data_to_db['state'] = $_POST['state']; // update link state
|
||||||
|
$data_to_db['qrcode'] = $data_to_db['filename'].'.'.$format; // update qrcode in db
|
||||||
|
|
||||||
|
if(!file_exists(DIRECTORY.$data_to_db['filename'].'.'.$format) || $data_to_db['filename'] == $old_filename){
|
||||||
|
$db->where('id', $dynamic_id);
|
||||||
|
$stat = $db->update('dynamic_qrcodes', $data_to_db);
|
||||||
|
|
||||||
|
try{
|
||||||
|
rename(DIRECTORY.$old_filename.'.'.$format, DIRECTORY.$data_to_db['filename'].'.'.$format);
|
||||||
|
}
|
||||||
|
catch(Exception $e){
|
||||||
|
$this->failure($e->getMessage());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
$this->failure('You cannot edit a qr code with an existing name on the server!');
|
||||||
|
|
||||||
|
if ($stat){
|
||||||
|
$this->success('Qr code updated successfully!');
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
echo 'Insert failed: ' . $db->getLastError();
|
||||||
|
exit();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Delete qr code
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public function cancel($dynamic_id, $filename)
|
||||||
|
{
|
||||||
|
if($_SESSION['admin_type']!='super')
|
||||||
|
$this->failure('You don\'t have permission to perform this action');
|
||||||
|
|
||||||
|
$db = getDbInstance();
|
||||||
|
|
||||||
|
$query = $db->query("SELECT format FROM dynamic_qrcodes WHERE id=$dynamic_id");
|
||||||
|
$format = $query[0]['format'];
|
||||||
|
|
||||||
|
$db->where('id', $dynamic_id);
|
||||||
|
$status = $db->delete('dynamic_qrcodes');
|
||||||
|
|
||||||
|
try{
|
||||||
|
unlink(DIRECTORY.$filename.'.'.$format);
|
||||||
|
}
|
||||||
|
catch(Exception $e){
|
||||||
|
$this->failure($e->getMessage());
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($status)
|
||||||
|
$this->info('Qr code deleted successfully!');
|
||||||
|
else
|
||||||
|
$this->failure('Unable to delete qr code');
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Add logo
|
||||||
|
* IMPORTANT: I do not recommend to use this option because there may be problems with the scanning of the qr code as some readers may not recognize the code
|
||||||
|
*/
|
||||||
|
private function addLogo($src, $logo = 'none')
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
if($logo != 'none')
|
||||||
|
{
|
||||||
|
$logo = imagecreatefrompng($_SERVER['HTTP_HOST'].'/admin'.$logo);
|
||||||
|
$QR = imagecreatefrompng(BASE_PATH.$src);
|
||||||
|
|
||||||
|
$QR_width = imagesx($QR);
|
||||||
|
$QR_height = imagesy($QR);
|
||||||
|
|
||||||
|
$logo_width = imagesx($logo);
|
||||||
|
$logo_height = imagesy($logo);
|
||||||
|
|
||||||
|
// Scale logo to fit in the QR Code
|
||||||
|
$logo_qr_width = $QR_width/3;
|
||||||
|
$scale = $logo_width/$logo_qr_width;
|
||||||
|
$logo_qr_height = $logo_height/$scale;
|
||||||
|
|
||||||
|
// You can try also with imagecopymerge() with same arguments
|
||||||
|
imagecopyresampled($QR, $logo, $QR_width/3, $QR_height/3, 0, 0, $logo_qr_width, $logo_qr_height, $logo_width, $logo_height);
|
||||||
|
|
||||||
|
//$output = Set directory for saving image;
|
||||||
|
header('Content-Type: image/png');
|
||||||
|
imagepng($QR /*, $output*/);
|
||||||
|
imagedestroy($QR);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch(Exception $e)
|
||||||
|
{
|
||||||
|
$this->failure($e->getMessage());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/* FLASH MESSAGE */
|
||||||
|
/* 3 functions for 3 types of messages with different styles defined in the flash_message.php file
|
||||||
|
Each function takes a string as input and after a redirection it prints the desired message
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Flash message Failure process
|
||||||
|
*/
|
||||||
|
private function failure($message)
|
||||||
|
{
|
||||||
|
$_SESSION['failure'] = $message;
|
||||||
|
// Redirect to the listing page
|
||||||
|
header('Location: dynamic_qrcodes.php');
|
||||||
|
// Important! Don't execute the rest put the exit/die.
|
||||||
|
exit();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Flash message Success process
|
||||||
|
*/
|
||||||
|
private function success($message)
|
||||||
|
{
|
||||||
|
$_SESSION['success'] = $message;
|
||||||
|
// Redirect to the listing page
|
||||||
|
header('Location: dynamic_qrcodes.php');
|
||||||
|
// Important! Don't execute the rest put the exit/die.
|
||||||
|
exit();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Flash message Info process
|
||||||
|
*/
|
||||||
|
private function info($message)
|
||||||
|
{
|
||||||
|
$_SESSION['info'] = $message;
|
||||||
|
// Redirect to the listing page
|
||||||
|
header('Location: dynamic_qrcodes.php');
|
||||||
|
// Important! Don't execute the rest put the exit/die.
|
||||||
|
exit();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
?>
|
||||||
@@ -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);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,593 @@
|
|||||||
|
<?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/config.php';
|
||||||
|
require_once BASE_PATH . '/lib/ICS/ICS.php';
|
||||||
|
require_once BASE_PATH . '/lib/vCard/vCard.php';
|
||||||
|
|
||||||
|
class Static_Qrcode
|
||||||
|
{
|
||||||
|
private $sData; // Data for the qr code
|
||||||
|
private $sContent; // Content to be stored in the database
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public function __construct()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public function __destruct()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set friendly columns\' names to order tables\' entries
|
||||||
|
*/
|
||||||
|
public function setOrderingValues()
|
||||||
|
{
|
||||||
|
$ordering = [
|
||||||
|
'id' => 'ID',
|
||||||
|
'filename' => 'File Name',
|
||||||
|
'type' => 'Type',
|
||||||
|
'content' => 'Content',
|
||||||
|
'qrcode' => 'Qr Code',
|
||||||
|
'created_at' => 'Created at',
|
||||||
|
'updated_at' => 'Updated at'
|
||||||
|
];
|
||||||
|
|
||||||
|
return $ordering;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* create a qr code of type "text"
|
||||||
|
* @string text -> required
|
||||||
|
*/
|
||||||
|
public function textQrcode($text)
|
||||||
|
{
|
||||||
|
if($text != NULL){
|
||||||
|
$this->sData = $text;
|
||||||
|
$this->sContent = '<strong>Text:</strong> '.$text;
|
||||||
|
$this->add($this->sData, $this->sContent);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
$this->requiredFieldsError();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* create a qr code of type "emai"
|
||||||
|
* @string email -> required
|
||||||
|
* @string subject
|
||||||
|
* @string message -> required
|
||||||
|
*/
|
||||||
|
public function emailQrcode($email, $subject, $message)
|
||||||
|
{
|
||||||
|
if($email != NULL && $message != NULL){
|
||||||
|
$this->sData = 'MATMSG:TO:'.$email.';SUB:'.$subject.';BODY:'.$message.';';
|
||||||
|
$this->sContent = '<strong>Email:</strong> '.$email.'<br>'.'<strong>Subject:</strong> '.$subject.'<br>'.'<strong>Message:</strong> '.$message;
|
||||||
|
|
||||||
|
$this->add($this->sData, $this->sContent);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
$this->requiredFieldsError();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* create a qr code of type "phone"
|
||||||
|
* @int country code -> required
|
||||||
|
* @string phone number -> required
|
||||||
|
*/
|
||||||
|
public function phoneQrcode($country_code, $phone_number)
|
||||||
|
{
|
||||||
|
if($phone_number != NULL){
|
||||||
|
$this->sData = 'TEL:'.$country_code.$phone_number;
|
||||||
|
$this->sContent = '<strong>Phone number:</strong> '.$country_code.$phone_number;
|
||||||
|
|
||||||
|
$this->add($this->sData, $this->sContent);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
$this->requiredFieldsError();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* create a qr code of type "sms"
|
||||||
|
* @int country code -> required
|
||||||
|
* @string phone number -> required
|
||||||
|
* @string message -> required
|
||||||
|
*/
|
||||||
|
public function smsQrcode($country_code, $phone_number, $message)
|
||||||
|
{
|
||||||
|
if($phone_number != NULL && $message != NULL){
|
||||||
|
$this->sData = 'SMSTO:'.$country_code.$phone_number.':'.$message;
|
||||||
|
$this->sContent = '<strong>Phone number:</strong> '.$country_code.$phone_number.'<br>'.'<strong>Message:</strong> '.$message;
|
||||||
|
|
||||||
|
$this->add($this->sData, $this->sContent);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
$this->requiredFieldsError();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* create a qr code of type "whatsapp"
|
||||||
|
* @int country code -> required
|
||||||
|
* @string phone number -> required
|
||||||
|
* @string message
|
||||||
|
*/
|
||||||
|
public function whatsappQrcode($country_code, $phone_number, $message)
|
||||||
|
{
|
||||||
|
if($phone_number != NULL){
|
||||||
|
$this->sData = 'https://wa.me/'.$country_code.$phone_number.'?text='.$message;
|
||||||
|
$this->sContent = '<strong>Phone number:</strong> '.$country_code.$phone_number.'<br>'.'<strong>Message:</strong> '.$message;
|
||||||
|
|
||||||
|
$this->add($this->sData, $this->sContent);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
$this->requiredFieldsError();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* create a qr code of type "skype"
|
||||||
|
* @string skype username -> required
|
||||||
|
*/
|
||||||
|
public function skypeQrcode($skype_username)
|
||||||
|
{
|
||||||
|
if($skype_username != NULL){
|
||||||
|
$this->sData = 'skype:'.$skype_username.'?call';
|
||||||
|
$this->sContent = '<strong>Skype username:</strong> '.$skype_username;
|
||||||
|
|
||||||
|
$this->add($this->sData, $this->sContent);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
$this->requiredFieldsError();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* create a qr code of type "location"
|
||||||
|
* @int latitude -> required
|
||||||
|
* @int longitude -> required
|
||||||
|
*/
|
||||||
|
public function locationQrcode($latitude, $longitude)
|
||||||
|
{
|
||||||
|
if($latitude != NULL && $longitude != NULL){
|
||||||
|
$this->sData = 'GEO:'.$latitude.','.$longitude.';';
|
||||||
|
$this->sContent = '<strong>Latitude:</strong> '.$latitude.'<br>'.'<strong>Longitude:</strong> '.$longitude;
|
||||||
|
|
||||||
|
$this->add($this->sData, $this->sContent);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
$this->requiredFieldsError();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* create a qr code of type "vcard"
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public function vcardQrcode($fullname, $nickname, $email, $website, $phone, $home_phone, $work_phone, $company, $role, $categories, $note, $photo, $address, $city, $postcode, $state)
|
||||||
|
{
|
||||||
|
if($fullname != NULL && $phone != NULL){
|
||||||
|
|
||||||
|
$vcard = new vCard;
|
||||||
|
$vcard->name($fullname);
|
||||||
|
$vcard->nickName($nickname);
|
||||||
|
$vcard->email($email);
|
||||||
|
$vcard->url($website);
|
||||||
|
$vcard->cellPhone($phone);
|
||||||
|
$vcard->homePhone($home_phone);
|
||||||
|
$vcard->workPhone($work_phone);
|
||||||
|
$vcard->organization($company);
|
||||||
|
$vcard->role($role);
|
||||||
|
$vcard->categories($categories);
|
||||||
|
$vcard->note($note);
|
||||||
|
$vcard->photo($photo);
|
||||||
|
$vcard->address($address, $city, $postcode, $state);
|
||||||
|
$vcard->create();
|
||||||
|
|
||||||
|
$this->sData = $vcard->get();
|
||||||
|
$this->sContent = '<div class="row"><div class="col-sm-4">';
|
||||||
|
|
||||||
|
$this->sContent .= '<strong>Full name:</strong> '.$fullname.'<br>'.'<strong>Nickname:</strong> '.$nickname.'<br>'.'<strong>Email:</strong> '.$email.'<br>'.'<strong>Website:</strong> '.$website.'</div>';
|
||||||
|
|
||||||
|
$this->sContent .= '<div class="col-sm-4">';
|
||||||
|
|
||||||
|
$this->sContent .= '<strong>Company:</strong> '.$company.'<br>'.'<strong>Role:</strong> '.$role.'<br>'.'<strong>Categories:</strong> '.$categories.'<br>'.'<strong>Note:</strong> '.$note.'</div>';
|
||||||
|
|
||||||
|
$this->sContent .= '<div class="col-sm-4">';
|
||||||
|
|
||||||
|
$this->sContent .= '<strong>Phone:</strong> '.$phone.'<br>'.'<strong>Home Phone:</strong> '.$home_phone.'<br>'.'<strong>Work phone:</strong> '.$work_phone.'<br>'.'<strong>Address:</strong> '.$address.' '.$city.' '.$postcode.' '.$state.'</div>';
|
||||||
|
|
||||||
|
$this->sContent .= '</div>';
|
||||||
|
|
||||||
|
$this->add($this->sData, $this->sContent);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
$this->requiredFieldsError();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* create a qr code of type "event"
|
||||||
|
* @string description -> required
|
||||||
|
* @string start event -> required
|
||||||
|
* @string end event -> required
|
||||||
|
* @string location
|
||||||
|
* @string summary
|
||||||
|
* @string url
|
||||||
|
*/
|
||||||
|
public function eventQrcode($title, $start, $end, $location, $description, $url)
|
||||||
|
{
|
||||||
|
if($description != NULL && $start != NULL && $end != NULL){
|
||||||
|
header('Content-Type: text/calendar; charset=utf-8');
|
||||||
|
header('Content-Disposition: attachment; filename=invite.ics');
|
||||||
|
|
||||||
|
$ics = new ICS(array(
|
||||||
|
'location' => $location,
|
||||||
|
'description' => $description,
|
||||||
|
'dtstart' => $start,
|
||||||
|
'dtend' => $end,
|
||||||
|
'summary' => $title,
|
||||||
|
'url' => $url
|
||||||
|
));
|
||||||
|
|
||||||
|
$this->sData = $ics->to_string();
|
||||||
|
$this->sContent = '<div class="row"><div class="col-sm-4">';
|
||||||
|
|
||||||
|
$this->sContent .= '<strong>Title:</strong> '.$title.'<br>'.'<strong>Start event:</strong> '.$start.'<br>'.'<strong>End event:</strong> '.$end.'<br></div>';
|
||||||
|
|
||||||
|
$this->sContent .= '<div class="col-sm-4">';
|
||||||
|
|
||||||
|
$this->sContent .= '<strong>Location:</strong> '.$location.'<br>'.'<strong>Description:</strong> '.$description.'<br>'.'<strong>URL:</strong> '.$url.'</div>';
|
||||||
|
|
||||||
|
$this->sContent .= '</div>';
|
||||||
|
|
||||||
|
$this->add($this->sData, $this->sContent);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
$this->requiredFieldsError();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* create a qr code of type "bookmark"
|
||||||
|
* @string title
|
||||||
|
* @string url -> required
|
||||||
|
*/
|
||||||
|
public function bookmarkQrcode($url, $title)
|
||||||
|
{
|
||||||
|
if($url != NULL){
|
||||||
|
$this->sData = 'MEBKM:TITLE:'.$title.';URL:'.$url.';';
|
||||||
|
$this->sContent = '<strong>Title:</strong> '.$title.'<br>'.'<strong>Url:</strong> '.$url;
|
||||||
|
|
||||||
|
$this->add($this->sData, $this->sContent);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
$this->requiredFieldsError();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* create a qr code of type "wifi"
|
||||||
|
* @string encryption -> required
|
||||||
|
* @string ssid -> required
|
||||||
|
* @string password
|
||||||
|
*/
|
||||||
|
public function wifiQrcode($encryption, $ssid, $password)
|
||||||
|
{
|
||||||
|
if($ssid != NULL){
|
||||||
|
$this->sData = 'WIFI:T:'.$encryption.';S:'.$ssid.';P:'.$password.';';
|
||||||
|
$this->sContent = '<strong>Encryption:</strong> '.$encryption.'<br>'.'<strong>SSID:</strong> '.$ssid.'<br>'.'<strong>Password:</strong> '.$password;
|
||||||
|
|
||||||
|
$this->add($this->sData, $this->sContent);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
$this->requiredFieldsError();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* create a qr code of type "paypal"
|
||||||
|
* @string payment type -> required
|
||||||
|
* @string email -> required
|
||||||
|
* @string item_name -> required
|
||||||
|
* @int item_id
|
||||||
|
* @int amount -> required
|
||||||
|
* @string currency -> required
|
||||||
|
* @int shipping
|
||||||
|
* @int tax_rate
|
||||||
|
*/
|
||||||
|
public function paypalQrcode($payment_type, $email, $item_name, $item_id, $amount, $currency, $shipping, $tax_rate)
|
||||||
|
{
|
||||||
|
if($email != NULL && $item_name != NULL && $amount != NULL){
|
||||||
|
$this->sData = 'https://www.paypal.com/webapps/xorouter?cmd='.$payment_type.'&business='.$email.'&item_name='.$item_name.'&item_number='.$item_id.'&amount='.$amount.'¤cy_code='.$currency.'&shipping='.$shipping.'&tax_rate='.$tax_rate;
|
||||||
|
|
||||||
|
$this->sContent = '<div class="row"><div class="col-sm-4">';
|
||||||
|
|
||||||
|
$this->sContent .= '<strong>Payment type:</strong> '.$payment_type.'<br>'.'<strong>Email:</strong> '.$email.'<br>'.'<strong>Item name:</strong> '.$item_name.'<br>'.'<strong>Item id:</strong> '.$item_id.'</div>';
|
||||||
|
|
||||||
|
$this->sContent .= '<div class="col-sm-4">';
|
||||||
|
|
||||||
|
$this->sContent .= '<strong>Amount:</strong> '.$amount.'<br>'.'<strong>Currency:</strong> '.$currency.'<br>'.'<strong>Shipping:</strong> '.$shipping.'<br>'.'<strong>Tax rate:</strong> '.$tax_rate.'</div>';
|
||||||
|
|
||||||
|
$this->sContent .= '</div>';
|
||||||
|
|
||||||
|
$this->add($this->sData, $this->sContent);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
$this->requiredFieldsError();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* create a qr code of type "bitcoin"
|
||||||
|
* @string address -> required
|
||||||
|
* @int amount -> required
|
||||||
|
* @string label
|
||||||
|
* @string message
|
||||||
|
*/
|
||||||
|
public function bitcoinQrcode($address, $amount, $label, $message)
|
||||||
|
{
|
||||||
|
if($address != NULL && $amount != NULL){
|
||||||
|
$this->sData = 'bitcoin:'.$address.'?amount='.$amount.'&label='.$label.'&message='.$message;
|
||||||
|
$this->sContent = '<strong>BTC address:</strong> '.$address.'<br>'.'<strong>Amount:</strong> '.$amount.'<br>';
|
||||||
|
$this->sContent .= '<strong>Label:</strong> '.$label.'<br>'.'<strong>Message:</strong> '.$message;
|
||||||
|
|
||||||
|
$this->add($this->sData, $this->sContent);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
$this->requiredFieldsError();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
This private function is used by both add () and edit () of this class to initially store in the array that will be sent to the database the:
|
||||||
|
* filename, created_at, type of qr code
|
||||||
|
* N.B. If the function is called from edit () the "type" field will not be taken as it cannot be modified
|
||||||
|
*/
|
||||||
|
private function collect()
|
||||||
|
{
|
||||||
|
|
||||||
|
$data_to_db['filename'] = htmlspecialchars($_POST['filename'], ENT_QUOTES, 'UTF-8');
|
||||||
|
$data_to_db['created_at'] = date('Y-m-d H:i:s');
|
||||||
|
|
||||||
|
if($_GET['type'] != NULL)
|
||||||
|
$data_to_db['type'] = htmlspecialchars($_GET['type']);
|
||||||
|
|
||||||
|
return $data_to_db;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set option for qr code like:
|
||||||
|
* Error Correction Level, size (default = 100), foreground, background
|
||||||
|
* return array of values
|
||||||
|
*/
|
||||||
|
private function setOptions()
|
||||||
|
{
|
||||||
|
$errorCorrectionLevel = 'L';
|
||||||
|
if (isset($_POST['level']) && in_array($_POST['level'], array('L','M','Q','H')))
|
||||||
|
$errorCorrectionLevel = $_POST['level'];
|
||||||
|
|
||||||
|
$size = 100;
|
||||||
|
if (isset($_POST['size']))
|
||||||
|
$size = min(max((int)$_POST['size'], 100), 1000);
|
||||||
|
|
||||||
|
$foreground = substr($_POST['foreground'], 1); // We eliminate the character "#" for the hexadecimal color
|
||||||
|
$background = substr($_POST['background'], 1);
|
||||||
|
|
||||||
|
//$logo = $_POST['optionlogo'];
|
||||||
|
|
||||||
|
return array(
|
||||||
|
"errorCorrectionLevel" => $errorCorrectionLevel,
|
||||||
|
"size" => $size,
|
||||||
|
"foreground" => $foreground,
|
||||||
|
"background" => $background,
|
||||||
|
//"optionlogo" => $logo,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 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
|
||||||
|
*/
|
||||||
|
private function add($sData, $sContent)
|
||||||
|
{
|
||||||
|
$sData = urlencode($sData);
|
||||||
|
$data_to_db['created_by'] = $_SESSION['user_id'];
|
||||||
|
$data_to_db = $this->collect();
|
||||||
|
$data_to_db['format'] = $_POST['format'];
|
||||||
|
$data_to_db['qrcode'] = $data_to_db['filename'].'.'.$data_to_db['format'];
|
||||||
|
$data_to_db['content'] = $sContent;
|
||||||
|
$options = $this->setOptions();
|
||||||
|
|
||||||
|
if(!file_exists(DIRECTORY.$data_to_db['filename'].'.'.$data_to_db['format'])){
|
||||||
|
$content = file_get_contents('https://api.qrserver.com/v1/create-qr-code/?data='.$sData.'&&size='.$options['size'].'x'.$options['size'].'&ecc='.$options['errorCorrectionLevel'].'&margin=0&color='.$options['foreground'].'&bgcolor='.$options['background'].'&qzone=2'.'&format='.$data_to_db['format']);
|
||||||
|
|
||||||
|
$filename = DIRECTORY.$data_to_db['filename'].'.'.$data_to_db['format'];
|
||||||
|
|
||||||
|
try{
|
||||||
|
file_put_contents($filename, $content);
|
||||||
|
}
|
||||||
|
catch(Exception $e){
|
||||||
|
$this->failure($e->getMessage());
|
||||||
|
}
|
||||||
|
|
||||||
|
// If you want you can customide qr code with logo
|
||||||
|
//$this->addLogo($data_to_db['qrcode'], $options['optionlogo']);
|
||||||
|
|
||||||
|
$db = getDbInstance();
|
||||||
|
$last_id = $db->insert('static_qrcodes', $data_to_db);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
$this->failure('You cannot create a new qr code with an existing name on the server!');
|
||||||
|
|
||||||
|
if ($last_id){
|
||||||
|
$this->success('Qr code added successfully!');
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
echo 'Insert failed: ' . $db->getLastError();
|
||||||
|
exit();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Edit qr code
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public function edit()
|
||||||
|
{
|
||||||
|
$db = getDbInstance();
|
||||||
|
|
||||||
|
$static_id = htmlspecialchars($_GET['static_id'], ENT_QUOTES, 'UTF-8');
|
||||||
|
$old_filename = htmlspecialchars($_GET['filename'], ENT_QUOTES, 'UTF-8');
|
||||||
|
|
||||||
|
$query = $db->query("SELECT format FROM static_qrcodes WHERE id=$static_id"); // get format
|
||||||
|
$format = $query[0]['format'];
|
||||||
|
|
||||||
|
$data_to_db = $this->collect();
|
||||||
|
|
||||||
|
$data_to_db['qrcode'] = $data_to_db['filename'].'.'.$format; // update qrcode in db
|
||||||
|
|
||||||
|
if(!file_exists(DIRECTORY.$data_to_db['filename'].'.'.$format) || $data_to_db['filename'] == $old_filename){
|
||||||
|
$db->where('id', $static_id);
|
||||||
|
$stat = $db->update('static_qrcodes', $data_to_db);
|
||||||
|
|
||||||
|
try{
|
||||||
|
rename(DIRECTORY.$old_filename.'.'.$format, DIRECTORY.$data_to_db['filename'].'.'.$format);
|
||||||
|
}
|
||||||
|
catch(Exception $e){
|
||||||
|
$this->failure($e->getMessage());
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
else
|
||||||
|
$this->failure('You cannot edit a qr code with an existing name on the server!');
|
||||||
|
|
||||||
|
if ($stat){
|
||||||
|
$this->success('Qr code updated successfully!');
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
echo 'Insert failed: ' . $db->getLastError();
|
||||||
|
exit();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Delete qr code
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public function cancel($static_id, $filename)
|
||||||
|
{
|
||||||
|
if($_SESSION['admin_type']!='super')
|
||||||
|
$this->failure('You don\'t have permission to perform this action');
|
||||||
|
|
||||||
|
$db = getDbInstance();
|
||||||
|
|
||||||
|
$query = $db->query("SELECT format FROM static_qrcodes WHERE id=$static_id"); // get format
|
||||||
|
$format = $query[0]['format'];
|
||||||
|
|
||||||
|
$db->where('id', $static_id);
|
||||||
|
$status = $db->delete('static_qrcodes');
|
||||||
|
|
||||||
|
try{
|
||||||
|
unlink(DIRECTORY.$filename.'.'.$format);
|
||||||
|
}
|
||||||
|
catch(Exception $e){
|
||||||
|
$this->failure($e->getMessage());
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($status)
|
||||||
|
$this->info('Qr code deleted successfully!');
|
||||||
|
else
|
||||||
|
$this->failure('Unable to delete qr code');
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Add logo
|
||||||
|
* IMPORTANT: I do not recommend to use this option because there may be problems with the scanning of the qr code as some readers may not recognize the code
|
||||||
|
*/
|
||||||
|
private function addLogo($src, $logo = 'none')
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
if($logo != 'none')
|
||||||
|
{
|
||||||
|
$logo = imagecreatefrompng($_SERVER['HTTP_HOST'].'/admin'.$logo);
|
||||||
|
$QR = imagecreatefrompng(BASE_PATH.$src);
|
||||||
|
|
||||||
|
$QR_width = imagesx($QR);
|
||||||
|
$QR_height = imagesy($QR);
|
||||||
|
|
||||||
|
$logo_width = imagesx($logo);
|
||||||
|
$logo_height = imagesy($logo);
|
||||||
|
|
||||||
|
// Scale logo to fit in the QR Code
|
||||||
|
$logo_qr_width = $QR_width/3;
|
||||||
|
$scale = $logo_width/$logo_qr_width;
|
||||||
|
$logo_qr_height = $logo_height/$scale;
|
||||||
|
|
||||||
|
// You can try also with imagecopymerge() with same arguments
|
||||||
|
imagecopyresampled($QR, $logo, $QR_width/3, $QR_height/3, 0, 0, $logo_qr_width, $logo_qr_height, $logo_width, $logo_height);
|
||||||
|
|
||||||
|
//$output = Set directory for saving image;
|
||||||
|
header('Content-Type: image/png');
|
||||||
|
imagepng($QR /*, $output*/);
|
||||||
|
imagedestroy($QR);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch(Exception $e)
|
||||||
|
{
|
||||||
|
$this->failure($e->getMessage());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Flash message Failure process
|
||||||
|
*/
|
||||||
|
private function failure($message)
|
||||||
|
{
|
||||||
|
$_SESSION['failure'] = $message;
|
||||||
|
// Redirect to the listing page
|
||||||
|
header('Location: static_qrcodes.php');
|
||||||
|
// Important! Don't execute the rest put the exit/die.
|
||||||
|
exit();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Flash message Success process
|
||||||
|
*/
|
||||||
|
private function success($message)
|
||||||
|
{
|
||||||
|
$_SESSION['success'] = $message;
|
||||||
|
// Redirect to the listing page
|
||||||
|
header('Location: static_qrcodes.php');
|
||||||
|
// Important! Don't execute the rest put the exit/die.
|
||||||
|
exit();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Flash message Info process
|
||||||
|
*/
|
||||||
|
private function info($message)
|
||||||
|
{
|
||||||
|
$_SESSION['info'] = $message;
|
||||||
|
// Redirect to the listing page
|
||||||
|
header('Location: static_qrcodes.php');
|
||||||
|
// Important! Don't execute the rest put the exit/die.
|
||||||
|
exit();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Error message if not filled in all the fields required by the type of the qr code
|
||||||
|
*/
|
||||||
|
private function requiredFieldsError()
|
||||||
|
{
|
||||||
|
$this->failure('The qr code cannot be created if you do not fill in all the required fields (*)');
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
?>
|
||||||
@@ -0,0 +1,185 @@
|
|||||||
|
<?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/config.php';
|
||||||
|
|
||||||
|
class Users
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public function __construct()
|
||||||
|
{
|
||||||
|
// Only super admin is allowed to access this page
|
||||||
|
if ($_SESSION['admin_type'] !== 'super')
|
||||||
|
$this->failure('Only a "super admin" account can access the admin listing page', 'Location: index.php');
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public function __destruct()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set friendly columns\' names to order tables\' entries
|
||||||
|
*/
|
||||||
|
public function setOrderingValues()
|
||||||
|
{
|
||||||
|
$ordering = [
|
||||||
|
'id' => 'ID',
|
||||||
|
'user_name' => 'Username',
|
||||||
|
'admin_type' => 'Admin Type'
|
||||||
|
];
|
||||||
|
|
||||||
|
return $ordering;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Collect input
|
||||||
|
*/
|
||||||
|
public function collect()
|
||||||
|
{
|
||||||
|
// Sanitize input post if we want
|
||||||
|
$data_to_db = filter_input_array(INPUT_POST);
|
||||||
|
|
||||||
|
return $data_to_db;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Check username
|
||||||
|
*/
|
||||||
|
public function check($data_to_db)
|
||||||
|
{
|
||||||
|
// Check whether the user name already exists
|
||||||
|
$db = getDbInstance();
|
||||||
|
$db->where('user_name', $data_to_db['user_name']);
|
||||||
|
$db->get('admin_accounts');
|
||||||
|
|
||||||
|
if ($db->count >= 1)
|
||||||
|
$this->failure('Username already exists');
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Add user
|
||||||
|
*/
|
||||||
|
public function add()
|
||||||
|
{
|
||||||
|
$data_to_db = $this->collect();
|
||||||
|
$this->check($data_to_db);
|
||||||
|
|
||||||
|
// Encrypting the password
|
||||||
|
$data_to_db['password'] = password_hash($data_to_db['password'], PASSWORD_DEFAULT);
|
||||||
|
// Reset db instance
|
||||||
|
$db = getDbInstance();
|
||||||
|
$last_id = $db->insert('admin_accounts', $data_to_db);
|
||||||
|
|
||||||
|
if ($last_id)
|
||||||
|
$this->success('Admin user added successfully');
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Edit user
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public function edit()
|
||||||
|
{
|
||||||
|
$data_to_db = $this->collect();
|
||||||
|
|
||||||
|
// Check whether the user name already exists
|
||||||
|
$db = getDbInstance();
|
||||||
|
$db->where('user_name', $data_to_db['user_name']);
|
||||||
|
$db->where('id', $admin_user_id, '!=');
|
||||||
|
$row = $db->getOne('admin_accounts');
|
||||||
|
|
||||||
|
if (!empty($row['user_name']))
|
||||||
|
{
|
||||||
|
$query_string = http_build_query(array(
|
||||||
|
'admin_user_id' => $admin_user_id,
|
||||||
|
'operation' => $operation,
|
||||||
|
));
|
||||||
|
$this->failure('Username already exists', 'Location: edit_admin.php?'.$query_string);
|
||||||
|
}
|
||||||
|
|
||||||
|
$admin_user_id = filter_input(INPUT_GET, 'admin_user_id', FILTER_VALIDATE_INT);
|
||||||
|
// Encrypting the password
|
||||||
|
$data_to_db['password'] = password_hash($data_to_db['password'], PASSWORD_DEFAULT);
|
||||||
|
// Reset db instance
|
||||||
|
$db = getDbInstance();
|
||||||
|
$db->where('id', $admin_user_id);
|
||||||
|
$stat = $db->update('admin_accounts', $data_to_db);
|
||||||
|
|
||||||
|
if ($stat)
|
||||||
|
$this->success('User updated successfully!');
|
||||||
|
else
|
||||||
|
$this->failure('Failed to update Admin user: ' . $db->getLastError());
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Delete user
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public function cancel($del_id)
|
||||||
|
{
|
||||||
|
if($_SESSION['admin_type']!='super'){
|
||||||
|
header('HTTP/1.1 401 Unauthorized', true, 401);
|
||||||
|
exit("401 Unauthorized");
|
||||||
|
}
|
||||||
|
|
||||||
|
$db = getDbInstance();
|
||||||
|
$db->where('id', $del_id);
|
||||||
|
$stat = $db->delete('admin_accounts');
|
||||||
|
|
||||||
|
if ($stat)
|
||||||
|
$this->info('User deleted successfully!');
|
||||||
|
else
|
||||||
|
$this->failure('Unable to delete user');
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Flash message Failure process
|
||||||
|
*/
|
||||||
|
public function failure($message, $location = 'Location: admin_users.php')
|
||||||
|
{
|
||||||
|
$_SESSION['failure'] = $message;
|
||||||
|
// Redirect to the listing page
|
||||||
|
header($location);
|
||||||
|
// Important! Don't execute the rest put the exit/die.
|
||||||
|
exit();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Flash message Success process
|
||||||
|
*/
|
||||||
|
public function success($message)
|
||||||
|
{
|
||||||
|
$_SESSION['success'] = $message;
|
||||||
|
// Redirect to the listing page
|
||||||
|
header('Location: admin_users.php');
|
||||||
|
// Important! Don't execute the rest put the exit/die.
|
||||||
|
exit();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Flash message Info process
|
||||||
|
*/
|
||||||
|
public function info($message)
|
||||||
|
{
|
||||||
|
$_SESSION['info'] = $message;
|
||||||
|
// Redirect to the listing page
|
||||||
|
header('Location: admin_users.php');
|
||||||
|
// Important! Don't execute the rest put the exit/die.
|
||||||
|
exit();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
?>
|
||||||
@@ -0,0 +1,220 @@
|
|||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* @title QR Code
|
||||||
|
* @desc Compatible to vCard 4.0 or higher.
|
||||||
|
*
|
||||||
|
* @author Pierre-Henry Soria <ph7software@gmail.com>
|
||||||
|
* @copyright (c) 2012-2018, Pierre-Henry Soria. All Rights Reserved.
|
||||||
|
* @license GNU General Public License <http://www.gnu.org/licenses/gpl.html>
|
||||||
|
* @version 1.2
|
||||||
|
*/
|
||||||
|
|
||||||
|
class vCard
|
||||||
|
{
|
||||||
|
|
||||||
|
|
||||||
|
private $sData;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Constructor.
|
||||||
|
*/
|
||||||
|
public function __construct()
|
||||||
|
{
|
||||||
|
$this->sData = 'BEGIN:VCARD'."\n";
|
||||||
|
$this->sData .= 'VERSION:4.0'."\n";
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The name of the person.
|
||||||
|
*
|
||||||
|
* @param string $sName
|
||||||
|
*
|
||||||
|
* @return self
|
||||||
|
*/
|
||||||
|
public function name($sName)
|
||||||
|
{
|
||||||
|
$this->sData .= 'N:'.$sName."\n";
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param string $sAddress
|
||||||
|
*
|
||||||
|
* @return self
|
||||||
|
*/
|
||||||
|
public function address($sAddress, $sCity, $sPostcode, $sState)
|
||||||
|
{
|
||||||
|
$this->sData .= 'ADR:;;'.$sAddress.';';
|
||||||
|
$this->sData .= $sCity.';'.$sPostcode.';'.$sState."\n";
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param string $sNickname
|
||||||
|
*
|
||||||
|
* @return self
|
||||||
|
*/
|
||||||
|
public function nickName($sNickname)
|
||||||
|
{
|
||||||
|
$this->sData .= 'NICKNAME:'.$sNickname."\n";
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param string $sMail
|
||||||
|
*
|
||||||
|
* @return self
|
||||||
|
*/
|
||||||
|
public function email($sMail)
|
||||||
|
{
|
||||||
|
$this->sData .= 'EMAIL;TYPE=PREF,INTERNET:'.$sMail."\n";
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param string $sVal
|
||||||
|
*
|
||||||
|
* @return self
|
||||||
|
*/
|
||||||
|
public function workPhone($sVal)
|
||||||
|
{
|
||||||
|
$this->sData .= 'TEL;;TYPE=work:'.$sVal."\n";
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param string $sVal
|
||||||
|
*
|
||||||
|
* @return self
|
||||||
|
*/
|
||||||
|
public function homePhone($sVal)
|
||||||
|
{
|
||||||
|
$this->sData .= 'TEL;;TYPE=home:'.$sVal."\n";
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param string $sVal
|
||||||
|
*
|
||||||
|
* @return self
|
||||||
|
*/
|
||||||
|
public function cellPhone($sVal)
|
||||||
|
{
|
||||||
|
$this->sData .= 'TEL:'.$sVal."\n";
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param string $sUrl
|
||||||
|
*
|
||||||
|
* @return self
|
||||||
|
*/
|
||||||
|
public function url($sUrl)
|
||||||
|
{
|
||||||
|
$sUrl = (substr($sUrl, 0, 4) != 'http') ? 'http://'.$sUrl : $sUrl;
|
||||||
|
$this->sData .= 'URL:'.$sUrl."\n";
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* A list of "tags" that can be used to describe the object represented by this vCard.
|
||||||
|
*
|
||||||
|
* @param string $sCategories
|
||||||
|
*
|
||||||
|
* @return self
|
||||||
|
*/
|
||||||
|
public function categories($sCategories)
|
||||||
|
{
|
||||||
|
$this->sData .= 'CATEGORIES:'.$sCategories."\n";
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Photo (avatar).
|
||||||
|
*
|
||||||
|
* @param string $sImgUrl URL of the image.
|
||||||
|
*
|
||||||
|
* @return self
|
||||||
|
*
|
||||||
|
* @throws InvalidArgumentException If the image format is invalid.
|
||||||
|
*/
|
||||||
|
public function photo($sImgUrl)
|
||||||
|
{
|
||||||
|
if($sImgUrl != NULL){
|
||||||
|
|
||||||
|
$bIsImgExt = strtolower(substr(strrchr($sImgUrl, '.'), 1)); // Get the file extension.
|
||||||
|
|
||||||
|
if ($bIsImgExt == 'jpeg' || $bIsImgExt == 'jpg' || $bIsImgExt == 'png' || $bIsImgExt == 'gif') {
|
||||||
|
$sExt = strtoupper($bIsImgExt);
|
||||||
|
} else {
|
||||||
|
throw new InvalidArgumentException('Invalid format Image!');
|
||||||
|
}
|
||||||
|
|
||||||
|
$this->sData .= 'PHOTO;VALUE=URL;TYPE='.$sExt.':'.$sImgUrl."\n";
|
||||||
|
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The role, occupation, or business category of the vCard object within an organization.
|
||||||
|
*
|
||||||
|
* @param string $sRole e.g., Executive
|
||||||
|
*
|
||||||
|
* @return self
|
||||||
|
*/
|
||||||
|
public function role($sRole)
|
||||||
|
{
|
||||||
|
$this->sData .= 'ROLE:'.$sRole."\n";
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The organization / company.
|
||||||
|
*
|
||||||
|
* The name and optionally the unit(s) of the organization
|
||||||
|
* associated with the vCard object. This property is based on the X.520 Organization Name
|
||||||
|
* attribute and the X.520 Organization Unit attribute.
|
||||||
|
*
|
||||||
|
* @param string $sOrg e.g., Google;GMail Team;Spam Detection Squad
|
||||||
|
*
|
||||||
|
* @return self
|
||||||
|
*/
|
||||||
|
public function organization($sOrg)
|
||||||
|
{
|
||||||
|
$this->sData .= 'ORG:'.$sOrg."\n";
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The supplemental information or a comment that is associated with the vCard.
|
||||||
|
*
|
||||||
|
* @param string $sText
|
||||||
|
*
|
||||||
|
* @return self
|
||||||
|
*/
|
||||||
|
public function note($sText)
|
||||||
|
{
|
||||||
|
$this->sData .= 'NOTE:'.$sText."\n";
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @return self
|
||||||
|
*/
|
||||||
|
public function create()
|
||||||
|
{
|
||||||
|
$this->sData .= 'END:VCARD';
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the vCard data.
|
||||||
|
*/
|
||||||
|
public function get()
|
||||||
|
{
|
||||||
|
return $this->sData;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,151 @@
|
|||||||
|
<?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
|
||||||
|
*/
|
||||||
|
|
||||||
|
session_start();
|
||||||
|
require_once 'config/config.php';
|
||||||
|
$token = bin2hex(openssl_random_pseudo_bytes(16));
|
||||||
|
|
||||||
|
// If User has already logged in, redirect to dashboard page.
|
||||||
|
if (isset($_SESSION['user_logged_in']) && $_SESSION['user_logged_in'] === TRUE)
|
||||||
|
{
|
||||||
|
header('Location: index.php');
|
||||||
|
}
|
||||||
|
|
||||||
|
// If user has previously selected "remember me option":
|
||||||
|
if (isset($_COOKIE['series_id']) && isset($_COOKIE['remember_token']))
|
||||||
|
{
|
||||||
|
// Get user credentials from cookies.
|
||||||
|
$series_id = filter_var($_COOKIE['series_id']);
|
||||||
|
$remember_token = filter_var($_COOKIE['remember_token']);
|
||||||
|
$db = getDbInstance();
|
||||||
|
// Get user By series ID:
|
||||||
|
$db->where('series_id', $series_id);
|
||||||
|
$row = $db->getOne('admin_accounts');
|
||||||
|
|
||||||
|
if ($db->count >= 1)
|
||||||
|
{
|
||||||
|
// User found. verify remember token
|
||||||
|
if (password_verify($remember_token, $row['remember_token']))
|
||||||
|
{
|
||||||
|
// Verify if expiry time is modified.
|
||||||
|
$expires = strtotime($row['expires']);
|
||||||
|
|
||||||
|
if (strtotime(date()) > $expires)
|
||||||
|
{
|
||||||
|
// Remember Cookie has expired.
|
||||||
|
clearAuthCookie();
|
||||||
|
header('Location: login.php');
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
|
||||||
|
$_SESSION['user_logged_in'] = TRUE;
|
||||||
|
$_SESSION['admin_type'] = $row['admin_type'];
|
||||||
|
header('Location: index.php');
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
clearAuthCookie();
|
||||||
|
header('Location: login.php');
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
clearAuthCookie();
|
||||||
|
header('Location: login.php');
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
?>
|
||||||
|
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="en">
|
||||||
|
<title>Login - Qrcode Generator</title>
|
||||||
|
<?php include './includes/head.php'; ?>
|
||||||
|
|
||||||
|
<body class="login-page" style="min-height: 512.391px;">
|
||||||
|
<div class="login-box">
|
||||||
|
<div class="login-logo">
|
||||||
|
<img src="dist/img/DynamicQRCode_Original.png" style="width: 95%; height: 95%">
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="card">
|
||||||
|
<div class="card-body login-card-body">
|
||||||
|
<p class="login-box-msg">Sign in to start your session</p>
|
||||||
|
|
||||||
|
<form method="POST" action="authenticate.php">
|
||||||
|
<div class="input-group mb-3">
|
||||||
|
<input type="text" name="username" class="form-control" placeholder="Username" required="required">
|
||||||
|
<div class="input-group-append">
|
||||||
|
<div class="input-group-text">
|
||||||
|
<span class="fa fa-user"></span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="input-group mb-3">
|
||||||
|
<input type="password" name="password" class="form-control" placeholder="Password" required="required">
|
||||||
|
<div class="input-group-append">
|
||||||
|
<div class="input-group-text">
|
||||||
|
<span class="fas fa-lock"></span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-8">
|
||||||
|
<div class="icheck-primary">
|
||||||
|
<input name="remember" type="checkbox" id="remember">
|
||||||
|
<label for="remember">
|
||||||
|
Remember Me
|
||||||
|
</label>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<!-- /.col -->
|
||||||
|
|
||||||
|
<div class="col-4">
|
||||||
|
<button type="submit" class="btn btn-primary btn-block">Sign In</button>
|
||||||
|
</div>
|
||||||
|
<!-- /.col -->
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</form>
|
||||||
|
|
||||||
|
<?php if (isset($_SESSION['login_failure'])): ?>
|
||||||
|
<br>
|
||||||
|
<div class="text-center mb-3">
|
||||||
|
<div class="card-body p-0">
|
||||||
|
<div class="alert alert-danger alert-dismissable">
|
||||||
|
<button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>
|
||||||
|
<?php
|
||||||
|
echo $_SESSION['login_failure'];
|
||||||
|
unset($_SESSION['login_failure']);
|
||||||
|
?>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<?php endif; ?>
|
||||||
|
|
||||||
|
|
||||||
|
</div>
|
||||||
|
<!-- /.login-card-body -->
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<!-- /.login-box -->
|
||||||
|
|
||||||
|
<!-- jQuery -->
|
||||||
|
<script src="../../plugins/jquery/jquery.min.js"></script>
|
||||||
|
<!-- Bootstrap 4 -->
|
||||||
|
<script src="../../plugins/bootstrap/js/bootstrap.bundle.min.js"></script>
|
||||||
|
<!-- AdminLTE App -->
|
||||||
|
<script src="../../dist/js/adminlte.min.js"></script>
|
||||||
|
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
@@ -0,0 +1,23 @@
|
|||||||
|
<?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/config.php';
|
||||||
|
session_start();
|
||||||
|
session_destroy();
|
||||||
|
|
||||||
|
|
||||||
|
if(isset($_COOKIE['series_id']) && isset($_COOKIE['remember_token'])){
|
||||||
|
clearAuthCookie();
|
||||||
|
}
|
||||||
|
header('Location:index.php');
|
||||||
|
exit;
|
||||||
|
|
||||||
|
?>
|
||||||
|
After Width: | Height: | Size: 545 B |
|
After Width: | Height: | Size: 16 KiB |
|
After Width: | Height: | Size: 1.2 KiB |
|
After Width: | Height: | Size: 295 B |
|
After Width: | Height: | Size: 13 KiB |
|
After Width: | Height: | Size: 6.6 KiB |
|
After Width: | Height: | Size: 558 B |
|
After Width: | Height: | Size: 447 B |
|
After Width: | Height: | Size: 539 B |
|
After Width: | Height: | Size: 1.1 KiB |
|
After Width: | Height: | Size: 398 B |
|
After Width: | Height: | Size: 895 B |
|
After Width: | Height: | Size: 13 KiB |
|
After Width: | Height: | Size: 21 KiB |
|
After Width: | Height: | Size: 462 B |
|
After Width: | Height: | Size: 298 B |
|
After Width: | Height: | Size: 629 B |
|
After Width: | Height: | Size: 14 KiB |
@@ -0,0 +1,103 @@
|
|||||||
|
<?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
|
||||||
|
*/
|
||||||
|
|
||||||
|
session_start();
|
||||||
|
require_once 'config/config.php';
|
||||||
|
require_once BASE_PATH . '/includes/auth_validate.php';
|
||||||
|
|
||||||
|
// Dynamic qrcode class
|
||||||
|
require_once BASE_PATH . '/lib/Static_Qrcode/Static_Qrcode.php';
|
||||||
|
$static_qrcode = new Static_Qrcode();
|
||||||
|
|
||||||
|
// Get DB instance. i.e instance of MYSQLiDB Library
|
||||||
|
$db = getDbInstance();
|
||||||
|
$select = array('id', 'filename', 'type', 'content', 'qrcode', 'created_at', 'updated_at');
|
||||||
|
|
||||||
|
// Search and order php code
|
||||||
|
$search_fields = array('filename', 'type', 'content');
|
||||||
|
require_once BASE_PATH . '/includes/search_order.php';
|
||||||
|
|
||||||
|
// Get current page
|
||||||
|
$page = filter_input(INPUT_GET, 'page', FILTER_SANITIZE_FULL_SPECIAL_CHARS) ?? 1;
|
||||||
|
|
||||||
|
// Set pagination limit
|
||||||
|
$db->pageLimit = 15;
|
||||||
|
|
||||||
|
// Get result of the query
|
||||||
|
$rows = $db->arraybuilder()->paginate('static_qrcodes', $page, $select);
|
||||||
|
$total_pages = $db->totalPages;
|
||||||
|
?>
|
||||||
|
|
||||||
|
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="en">
|
||||||
|
<title>List static - 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">Static Qr codes</h1>
|
||||||
|
</div><!-- /.col -->
|
||||||
|
|
||||||
|
<div class="col-sm-6">
|
||||||
|
<ol class="breadcrumb float-sm-right">
|
||||||
|
<li class="breadcrumb-item">
|
||||||
|
<a href="add_static.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 = $static_qrcode->setOrderingValues();
|
||||||
|
include BASE_PATH . '/forms/filters.php'; ?>
|
||||||
|
<!-- /.Filters-->
|
||||||
|
|
||||||
|
<!-- Main content -->
|
||||||
|
<section class="content">
|
||||||
|
<div class="container-fluid">
|
||||||
|
|
||||||
|
<!-- Table -->
|
||||||
|
<?php include BASE_PATH . '/forms/static_table.php'; ?>
|
||||||
|
<!-- /.Table -->
|
||||||
|
|
||||||
|
</div><!-- /.container-fluid -->
|
||||||
|
</section>
|
||||||
|
</div><!-- /.content-wrapper -->
|
||||||
|
|
||||||
|
<!-- Footer and scripts -->
|
||||||
|
<?php include './includes/footer.php'; ?>
|
||||||
|
<!-- /.Footer and scripts -->
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||