diff --git a/qrcode/bulk_action.php b/qrcode/bulk_action.php
new file mode 100644
index 0000000..9e33274
--- /dev/null
+++ b/qrcode/bulk_action.php
@@ -0,0 +1,50 @@
+
+* @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';
+
+if ($_SERVER['REQUEST_METHOD'] === 'POST') {
+ $db = getDbInstance();
+ $json = json_decode(file_get_contents('php://input'), true);
+ $action = filter_var($json['action'], FILTER_SANITIZE_STRING);
+ $params = $json['params'];
+ $files = [];
+ $type = filter_var($json['type'], FILTER_SANITIZE_STRING);
+
+ foreach ($params as $param) {
+ $row = $db->where('id', $param);
+ $row = $db->getOne("{$type}_qrcodes");
+ $files[] = './saved_qrcode/' . $row['qrcode'];
+ }
+
+ $zip = new ZipArchive();
+ $relative_dir = './saved_qrcode/zip/qrcodes_'. $_SESSION['user_id'] .'.zip';
+ unlink($relative_dir);
+ $url_path = base_url() . '/saved_qrcode/zip/qrcodes_'. $_SESSION['user_id'] .'.zip';
+ $zip->open($relative_dir, ZipArchive::CREATE);
+
+ foreach ($files as $file) {
+ $download_file = file_get_contents($file, true);
+ $zip->addFromString(basename($file), $download_file);
+ }
+
+ $zip->close();
+
+ echo json_encode([
+ 'data' => $url_path,
+ 'status' => 200
+ ]);
+ exit();
+} else {
+ exit('Direct access to this script not allowed.');
+}
+?>
\ No newline at end of file
diff --git a/qrcode/dist/css/custom.css b/qrcode/dist/css/custom.css
index 44e5f47..bdce243 100644
--- a/qrcode/dist/css/custom.css
+++ b/qrcode/dist/css/custom.css
@@ -6,4 +6,8 @@
* @license https://opensource.org/licenses/MIT MIT License
* @link https://github.com/giandonatoinverso/PHP-Dynamic-Qr-code
* @version 1.0
-*/
\ No newline at end of file
+*/
+
+.bulk-action-wrapper {
+ padding: 10px 0;
+}
\ No newline at end of file
diff --git a/qrcode/dist/js/custom.js b/qrcode/dist/js/custom.js
index 595fce1..c132f2b 100644
--- a/qrcode/dist/js/custom.js
+++ b/qrcode/dist/js/custom.js
@@ -421,4 +421,59 @@
$('.product-image-thumb.active').removeClass('active');
$(this).addClass('active');
});
+
+ const bulk_action = $('input[name=bulk-select]');
+
+ if (bulk_action) {
+ bulk_action.on('change', function() {
+ if ($(this).prop('checked')) {
+ $('input[name^=action]').each(function() {
+ $(this).prop('checked', true);
+ });
+ } else {
+ $('input[name^=action]').each(function() {
+ $(this).prop('checked', false);
+ });
+ }
+ });
+ }
+
+ const bulk_form = $('form#bulk-action');
+
+ bulk_form.on('submit', function(e) {
+ e.preventDefault();
+ const paramsElements = document.querySelectorAll('input[name^=action]');
+ console.log(paramsElements);
+ let params = [];
+
+ paramsElements.forEach((val) => {
+ if (val.checked) {
+ params.push(val.value);
+ }
+ });
+
+ const data = {
+ action: $('select[name=bulk-action]').val(),
+ params: params,
+ type: $('input[name=type]').val()
+ }
+
+ $.ajax({
+ url: window.location.origin + '/bulk_action.php',
+ method: "POST",
+ data: JSON.stringify(data),
+ dataType: "json",
+ contentType: 'application/json',
+ success: (res) => {
+ if (res.status == 200) {
+ window.location.href = res.data;
+ }
+ },
+ error: (err) => {
+ console.log(err);
+ }
+ });
+
+ return false;
+ });
})(jQuery)
\ No newline at end of file
diff --git a/qrcode/forms/dynamic_table.php b/qrcode/forms/dynamic_table.php
index f910cc6..3db28f5 100644
--- a/qrcode/forms/dynamic_table.php
+++ b/qrcode/forms/dynamic_table.php
@@ -1,10 +1,23 @@