Merge pull request #37 from 0xRenegade/feature/download-multiple-qr-img-at-once
Error Message for no qrcodes selected.
This commit is contained in:
@@ -20,6 +20,14 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') {
|
||||
$files = [];
|
||||
$type = filter_var($json['type'], FILTER_SANITIZE_STRING);
|
||||
|
||||
if (count($params) == 0) {
|
||||
echo json_encode([
|
||||
'data' => 'No qrcodes were selected.',
|
||||
'status' => 400
|
||||
]);
|
||||
exit();
|
||||
}
|
||||
|
||||
foreach ($params as $param) {
|
||||
$row = $db->where('id', $param);
|
||||
$row = $db->getOne("{$type}_qrcodes");
|
||||
|
||||
Vendored
+4
@@ -11,3 +11,7 @@
|
||||
.bulk-action-wrapper {
|
||||
padding: 10px 0;
|
||||
}
|
||||
#err-msg {
|
||||
display: none;
|
||||
color: red;
|
||||
}
|
||||
Vendored
+10
@@ -467,9 +467,19 @@
|
||||
success: (res) => {
|
||||
if (res.status == 200) {
|
||||
window.location.href = res.data;
|
||||
$('#err-msg').css('display', 'none');
|
||||
}
|
||||
|
||||
if (res.status == 400) {
|
||||
$('#err-msg').empty();
|
||||
$('#err-msg').append('<i class="fas fa-exclamation-circle"></i> ' + res.data);
|
||||
$('#err-msg').css('display', 'block');
|
||||
}
|
||||
},
|
||||
error: (err) => {
|
||||
$('#err-msg').empty();
|
||||
$('#err-msg').append('<i class="fas fa-exclamation-circle"></i> ' + res.data);
|
||||
$('#err-msg').css('display', 'block');
|
||||
console.log(err);
|
||||
}
|
||||
});
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<div id="err-msg"></div>
|
||||
<div class="bulk-action-wrapper">
|
||||
<form id="bulk-action" action="/bulk_action.php" method="POST">
|
||||
<button type="submit" class="btn btn-primary">Bulk Action</button>
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<div id="err-msg"></div>
|
||||
<div class="bulk-action-wrapper">
|
||||
<form id="bulk-action" action="/bulk_action.php" method="POST">
|
||||
<button type="submit" class="btn btn-primary">Bulk Action</button>
|
||||
|
||||
Reference in New Issue
Block a user