Merge pull request #37 from 0xRenegade/feature/download-multiple-qr-img-at-once

Error Message for no qrcodes selected.
This commit is contained in:
Giandonato Inverso
2022-09-24 22:43:16 +02:00
committed by GitHub
5 changed files with 24 additions and 0 deletions
+8
View File
@@ -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");
+4
View File
@@ -10,4 +10,8 @@
.bulk-action-wrapper {
padding: 10px 0;
}
#err-msg {
display: none;
color: red;
}
+10
View File
@@ -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
View File
@@ -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
View File
@@ -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>