Backups Created:
/home/japatmex/public_html/wp-content/edit-wolf.php
Savvy
W
olf -
MANAGER
Edit File: voucher_tab_vouchers.php
<div class="form-group row"> <div class="col-lg-12"> <div class="page-title d-flex"> <h4><a href="javascript:void(0)" class="BackButton-Link" onclick="goBack()"><i class="icon-arrow-left52 mr-2"></i></a> <?php echo $this->lang->line('vouchers'); ?></h4> </div> </div> </div> <div class="form-group row"> <div class="col-lg-12"> <!-- Our Working Area Start --> <?php if (isset($message) && $message != '') { ?> <div class="form-group row"> <div class="col-lg-12"> <div class="alert alert-success"><?php echo $message; ?></div> </div> </div> <?php } ?> <div class="form-body"> <div class="table-responsive"> <table class="table table-striped table-bordered table-advance table-hover"> <thead> <tr class="bg-primary"> <th><?php echo $this->lang->line('BE_CODE_10'); ?></th> <th><?php echo $this->lang->line('BE_PM_9'); ?></th> <th><?php echo $this->lang->line('BE_PM_11'); ?></th> <th><?php echo $this->lang->line('BE_LBL_987'); ?></th> <th><?php echo $this->lang->line('start_date'); ?></th> <th><?php echo $this->lang->line('end_date'); ?></th> <th><?php echo $this->lang->line('BE_LBL_504'); ?></th> </tr> </thead> <tbody> <?php $i = 1; foreach($vouchers as $row) { ?> <tr> <td><?php echo $i;?></td> <td><?php echo stripslashes($row->name);?></td> <td class="highlight"><? echo $currency.' '.$row->price;?></td> <td><?php echo stripslashes($row->quantity);?></td> <td><?php echo stripslashes($row->from_date);?></td> <td><?php echo stripslashes($row->to_date);?></td> <td> <a title="Overview" href="<?php echo base_url($this->config->item('apanel_name').'/voucher/'); ?>voucher_list?id=<?php echo($row->id); ?>" style="background-color:#AAA8A9; color:#000000" class="btn btn-xs UsersActionButtons"><i class="fa icon-eye"></i></a> <a title="Export Voucher Numbers" data-toggle="modal" data-target="#voucherNumbers" data-id="<?php echo $row->id; ?>" style="background-color:#AAA8A9; color:#000000;padding: 0;width: 28px;height: 24px;border-radius: 0;line-height: 24px;cursor: pointer;" class="btn btn-xs voucherIds"><i class="fa fa-download"></i></a> <a title="Delete Voucher" style="background-color:#AAA8A9; color:#000000;padding: 0;width: 28px;height: 24px;border-radius: 0;line-height: 24px;cursor: pointer;" class="btn btn-xs delete_voucher" data-id="<?php echo $row->id; ?>"><i class="fa fa-times"></i></a> </td> </tr> <?php $i++; } ?> <?php if(empty($vouchers)) { ?> <tr> <td colspan="5"> <strong><?php echo $this->lang->line('BE_GNRL_9'); ?></strong> </td> </tr> <?php } ?> </tbody> </table> </div> </div> </div> </div> <!-- Modal --> <div class="modal fade" id="voucherNumbers" tabindex="-1" role="dialog" aria-labelledby="exampleModalCenterTitle" aria-hidden="true"> <div class="modal-dialog modal-dialog-centered" role="document"> <div class="modal-content"> <div class="modal-header"> <h5 class="modal-title" id="exampleModalLongTitle"><?php echo $this->lang->line('voucher_no'); ?></h5> <button type="button" class="close" data-dismiss="modal" aria-label="Close"> <span aria-hidden="true">×</span> </button> </div> <div class="modal-body"> <pre class="v-ids" id="v_ids_list"> </pre> </div> <div class="modal-footer"> <button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button> <button type="button" class="btn btn-primary copy-vNums">Copy</button> </div> </div> </div> </div> <script> $('.voucherIds').on('click', function(){ var id = $(this).attr('data-id'); var baseurl = '<?php echo base_url(); ?>'; var apanel_name = '<?php echo $this->config->item('apanel_name'); ?>'; var url = baseurl + apanel_name+"/voucher"; $.post(url, { vID:id, }, function(response){ if(response) { var ids_arr = response.list; var new123 = ids_arr.split(",").join("\n"); $(".v-ids").text(new123) ; //arrResponse = response.split('~'); //showStickyErrorToast(arrResponse[0], '', 'success'); } }, 'json'); }); $('.copy-vNums').on('click', function() { // Get the text field var copyText = document.getElementById("v_ids_list").innerText; // Copy the text inside the text field navigator.clipboard.writeText(copyText); // Alert the copied text alert("Code Copied!"); }); $(".delete_voucher").click(function(e){ e.preventDefault(); var _ids = $(this).attr('data-id'); if(_ids!='') { var href = "<?php echo base_url($this->config->item('apanel_name').'/voucher/delete_vouchers?id='); ?>"+_ids; var btn = this; let text; if (confirm("Are you sure, you want to cancel!") == true) { $.ajax({ type:'GET', url:href, dataType: 'json', success:function(res){ console.log(res.success); showStickyErrorToast(res.success, '', 'success'); setTimeout(function () { window.location.reload(true); }, 3000); } }); } else { alert("You canceled the action!"); } } }); </script>