This repository was archived by the owner on Sep 2, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 5 files changed +24
-0
lines changed Expand file tree Collapse file tree 5 files changed +24
-0
lines changed Original file line number Diff line number Diff line change 2020 $ files = [];
2121 $ type = filter_var ($ json ['type ' ], FILTER_SANITIZE_STRING );
2222
23+ if (count ($ params ) == 0 ) {
24+ echo json_encode ([
25+ 'data ' => 'No qrcodes were selected. ' ,
26+ 'status ' => 400
27+ ]);
28+ exit ();
29+ }
30+
2331 foreach ($ params as $ param ) {
2432 $ row = $ db ->where ('id ' , $ param );
2533 $ row = $ db ->getOne ("{$ type }_qrcodes " );
Original file line number Diff line number Diff line change 1010
1111.bulk-action-wrapper {
1212 padding : 10px 0 ;
13+ }
14+ # err-msg {
15+ display : none;
16+ color : red;
1317}
Original file line number Diff line number Diff line change 467467 success : ( res ) => {
468468 if ( res . status == 200 ) {
469469 window . location . href = res . data ;
470+ $ ( '#err-msg' ) . css ( 'display' , 'none' ) ;
471+ }
472+
473+ if ( res . status == 400 ) {
474+ $ ( '#err-msg' ) . empty ( ) ;
475+ $ ( '#err-msg' ) . append ( '<i class="fas fa-exclamation-circle"></i> ' + res . data ) ;
476+ $ ( '#err-msg' ) . css ( 'display' , 'block' ) ;
470477 }
471478 } ,
472479 error : ( err ) => {
480+ $ ( '#err-msg' ) . empty ( ) ;
481+ $ ( '#err-msg' ) . append ( '<i class="fas fa-exclamation-circle"></i> ' + res . data ) ;
482+ $ ( '#err-msg' ) . css ( 'display' , 'block' ) ;
473483 console . log ( err ) ;
474484 }
475485 } ) ;
Original file line number Diff line number Diff line change 11<div class="row">
22 <div class="col-12">
3+ <div id="err-msg"></div>
34 <div class="bulk-action-wrapper">
45 <form id="bulk-action" action="/bulk_action.php" method="POST">
56 <button type="submit" class="btn btn-primary">Bulk Action</button>
Original file line number Diff line number Diff line change 11<div class="row">
22 <div class="col-12">
3+ <div id="err-msg"></div>
34 <div class="bulk-action-wrapper">
45 <form id="bulk-action" action="/bulk_action.php" method="POST">
56 <button type="submit" class="btn btn-primary">Bulk Action</button>
You can’t perform that action at this time.
0 commit comments