Backups Created:
/home/japatmex/public_html/wp-content/edit-wolf.php
Savvy
W
olf -
MANAGER
Edit File: products.php
<style> .page-title { padding: 2rem 0 !important;} .onoffswitch { position: relative; width: 56px; -webkit-user-select: none; -moz-user-select: none; -ms-user-select: none; } .notifyjs-corner{ top: 67px !important; left: 50% !important; } .onoffswitch-checkbox { display: none; } .onoffswitch-label { display: block; overflow: d-none; cursor: pointer; border: 2px solid #FFFFFF; border-radius: 20px; } .onoffswitch-inner { display: block; width: 200%; margin-left: -100%; transition: margin 0.3s ease-in 0s; } .onoffswitch-inner:before, .onoffswitch-inner:after { display: block; float: left; width: 50%; height: 22px; padding: 0; line-height: 22px; font-size: 12px; color: black; font-family: Trebuchet, Arial, sans-serif; font-weight: bold; box-sizing: border-box; } table{ text-align: center !important; } .onoffswitch-inner:before { content: "ON"; padding-left: 0; background-color: #26a69a; color: #FFFFFF; } .onoffswitch-inner:after { content: "OFF"; padding-right: 6px; background-color: rgb(38 50 56); color: #FFFFFF; text-align: right; } .onoffswitch-switch { display: block; width: 12px; margin: 5px; background: #FFFFFF; position: absolute; top: 0; bottom: 0; right: 30px; border: 2px solid #FFFFFF; border-radius: 20px; transition: all 0.3s ease-in 0s; } .onoffswitch-checkbox:checked + .onoffswitch-label .onoffswitch-inner { margin-left: 0; } .onoffswitch-checkbox:checked + .onoffswitch-label .onoffswitch-switch { right: 0px; } td { vertical-align: top; text-align: center; } </style> <!-- Page header --> <div class="page-header border-bottom-0 mt-3 service_top_links ml-2"></div> <div class="page-header border-bottom-0 services_header"> <div class="page-header-content header-elements-md-inline"> <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> <?=$page_title?></h4> </div> <div class=""> <a href="<?php echo base_url($this->config->item('apanel_name')."/ecomm/products/add").get_query_string();?>">+ <?php echo $this->lang->line('BE_LBL_963'); ?></a> </div> </div> </div> <!-- /page header --> <!-- Content area --> <div class="content pt-0"> <div class="card"> <div class="card-header header-elements-inline services_search"> <h5 class="card-title cardCollapse"><?php echo $this->lang->line('CUST_CH_BTN'); ?></h5> <div class="header-elements"> <div class="list-icons"> <a class="list-icons-item rotate-180" data-action="collapse"></a> </div> </div> </div> <div class="card-body CollapsedCardBody" style="display: block;"> <div class="row"> <div class="col-xl-12"> <div class="form-group row mb-0"> <div class="col-md-6 col-12"> <div class="cat-dropdown"> <label class="control-label"><?php echo $this->lang->line('BE_LBL_964'); ?></label> <select name="category_id" class="select2"> <option value="0"><?php echo $this->lang->line('BE_LBL_971'); ?></option> <?php foreach ($categories_dropdown as $key => $value) { ?> <option class="level_0" <?php echo $value['id'] == $this->input->get('category_id') ? 'selected=""' : ''; ?> value="<?=$value['id']?>"><?= $value['category_name']; ?></option> <?php echo get_sub_cats_options($value); ?> <?php } ?> </select> </div> </div> <div class="col-md-6 col-xs-12 text-right"> <div class="search_list"> <label class="control-label" style="float: left;"><?php echo $this->lang->line('BE_LBL_966'); ?></label> <div class="search_block"> <form method="post" action="<?= base_url($this->config->item('apanel_name').'/ecomm/products').get_query_string(); ?>"> <input class="form-control input-sm" placeholder="Search here..." aria-controls="DataTables_Table_0" type="search" name="search_value" value="<?php echo $this->input->post('search_value'); ?>"> <button type="submit" name="data_search" class="btn ThemeColorButton mt-3"><?php echo $this->lang->line('CUST_CH_BTN'); ?></button> </form> </div> </div> </div> <div class="col-12 text-right mt-2"> <form method="post" action=""> <div class="checkbox" style="width: 100px;margin-top: 12px;margin-left: 10px;float: left;right: 110px;position: absolute;"> <input type="checkbox" id="checkall" /> <label for="checkall"> <?php echo $this->lang->line('CUST_CH_137'); ?> </label> </div> <div class="dropdown" style="float:right"> <button class="btn btn-primary dropdown-toggle btn_cust" type="button" data-toggle="dropdown" style="height: 41px;">Action <span class="caret"></span> </button> <ul class="dropdown-menu pl-2" style="right:0;left:auto;"> <li><a href="" class="actions" data-action="enable"><?php echo $this->lang->line('BE_LBL_744'); ?></a></li> <li><a href="" class="actions" data-action="disable"><?php echo $this->lang->line('CUST_CH_119'); ?></a></li> <li><a href="" class="actions" data-action="delete"><?php echo $this->lang->line('BE_GNRL_13'); ?> !</a></li> <li><a href="" class="actions" data-action="set_today_deal"><?php echo $this->lang->line('BE_LBL_979'); ?></a></li> <li><a href="" class="actions" data-action="remove_today_deal"><?php echo $this->lang->line('BE_LBL_980'); ?></a></li> </ul> </div> </form> </div> </div> </div> </div> </div> </div> <div class="card"> <div class="row"> <div class="col-12 col-sm-12 col-md-12 col-lg-12 col-xl-12"> <div class="card-body"> <div class="form-group row"> <div class="col-lg-12"> <div class="table-responsive"> <table class="table table-striped table-bordered table-advance table-hover" width="100%"> <thead> <tr> <th></th> <th><?php echo $this->lang->line('CUST_CH_67'); ?></th> <th><?php echo $this->lang->line('BE_LBL_974'); ?></th> <th><?php echo $this->lang->line('BE_LBL_975'); ?></th> <th><?php echo $this->lang->line('CUST_LBL_253'); ?></th> <th><?php echo $this->lang->line('BE_LBL_1025'); ?></th> <th><?php echo $this->lang->line('BE_LBL_981'); ?></th> <th><?php echo $this->lang->line('BE_LBL_982'); ?></th> <th><?php echo $this->lang->line('BE_LBL_849'); ?></th> <th class="cat_action_list"><?php echo $this->lang->line('CUST_LBL_301'); ?></th> </tr> </thead> <tbody> <?php $i = 0; foreach ($products as $key => $row) { ?> <tr class="item_holder"> <td id="check_box"> <div> <div class="checkbox"> <input type="checkbox" name="post_ids[]" id="checkbox<?php echo $i;?>" value="<?php echo $row->id; ?>" class="post_ids"> <label for="checkbox<?php echo $i;?>"> </label> </div> </div> </td> <td id="category"> <h2 style="font-size: 16px"> <?php if(strlen($row->category_name) > 23){ echo substr(stripslashes($row->category_name), 0, 23).'...'; }else{ echo $row->category_name; } ?> </h2> </td> <td id="title"> <h2> <a href="<?php echo base_url($this->config->item('apanel_name')."/ecomm/products/edit/".$row->id."/".$row->category_id).get_query_string(); ?>" style="text-shadow: 1px 1px 1px #000;font-size: 16px" title="<?=$row->product_title?>"> <?php if(strlen($row->product_title) > 33){ echo substr(stripslashes($row->product_title), 0, 33).'...'; }else{ echo $row->product_title; } ?> </a> </h2> </td> <td id="sku"> <p style="margin-bottom: 0px;font-size: 14px"> <?php echo $row->product_sku;?> </p> </td> <td id="brand"> <p style="margin-bottom: 0px;font-size: 14px"> <?php echo get_brand_info($row->brand_id, 'brand_name')?get_brand_info($row->brand_id, 'brand_name'):'-';?> </p> </td> <td> <div class="row justify-content-center toggle_btn"> <input type="checkbox" id="enable_disable_check_<?=$i?>" data-id="<?=$row->id?>" class="cbx enable_disable" <?php if($row->status==1){ echo 'checked';} ?>> <label for="enable_disable_check_<?=$i?>" class="lbl"></label> </div> </td> <td> <div class="row justify-content-center toggle_btn"> <input type="checkbox" id="is_featured_<?=$i?>" name="is_featured" data-id="<?=$row->id?>" class="cbx enable_disable_is_featured" <?php if($row->is_featured==1) {echo 'checked';} ?>> <label for="is_featured_<?=$i?>" class="lbl" ></label> </div> </td> <td> <div class="row justify-content-center toggle_btn"> <input type="checkbox" id="new_arrival<?=$i?>" name="new_arrival" data-id="<?=$row->id?>" class="cbx enable_disable_newArrival" <?php if($row->new_arrival==1){ echo 'checked';} ?>> <label for="new_arrival<?=$i?>" class="lbl" ></label> </div> </td> <td> <div class="row justify-content-center toggle_btn"> <input type="checkbox" id="show_home<?=$i?>" name="show_home" data-id="<?=$row->id?>" class="cbx enable_disable_showHome" <?php if($row->is_home ==1){ echo 'checked';} ?>> <label for="show_home<?=$i?>" class="lbl" ></label> </div> </td> <td style="display: -webkit-inline-box"> <a class="btn btn-primary btn_edit tooltip-test" href="javascript:void(0)" data-toggle="tooltip" data-original-title="<?=$row->total_views?> Views" title="" data-placement="top" data-tooltip="<?=$row->total_views?> Views"><i class="fa fa-eye"></i></a> <a class="btn btn-warning btn_edit btn_status" href="<?php echo base_url($this->config->item('apanel_name')."/ecomm/products/edit/".$row->id."/".$row->category_id).get_query_string(); ?>" data-toggle="tooltip" data-tooltip="<?=$this->lang->line('edit_lbl')?>"><i class="fa fa-edit"></i></a> <a href="" data-toggle="tooltip" class="btn_delete_a btn btn-danger btn_delete" data-id="<?=$row->id?>" data-tooltip="<?=$this->lang->line('delete_lbl')?>"><i class="fa fa-trash-o"></i></a> <a class="btn btn-warning btn_edit" href="<?php echo base_url($this->config->item('apanel_name')."/ecomm/products/duplicate_product/".$row->product_slug).get_query_string();?>" data-toggle="tooltip" data-tooltip="Make Duplicate" style="width: 39px;height: 36px;z-index: 1;margin-right: 5px"><i class="fa fa-copy"></i></a> <a class="btn btn-primary btn_edit tooltip-test" href="<?php echo base_url($this->config->item('apanel_name')."/ecomm/products/relatedProduct?product-id=".$row->id).get_query_string(); ?>" data-toggle="tooltip" data-original-title="Related products" title="" data-placement="top" data-tooltip="Related products"><i class="fa fa-archive"></i></a> <?php if($row->offer_id!=0){ $offer_percentage = get_single_info(array('id' => $row->offer_id), 'offer_percentage', 'tbl_gf_ecomm_offers'); $offer_flat = get_single_info(array('id' => $row->offer_id), 'offer_fixed_amount', 'tbl_gf_ecomm_offers'); if($offer_percentage != 0) { $offer = $offer_percentage.' % OFF'; } else { $offer = $offer_flat.' FLAT OFF'; } ?> <span class="label label-danger" ><?= $offer ?></span> <?php } ?> </td> </tr> <?php $i++; } ?> <?php if(empty($products)) { ?> <tr> <td colspan="99" align="center"><?php echo $this->lang->line('BE_LBL_968'); ?></td> </tr> <?php } ?> </tbody> </table> </div> </div> </div> <?php if(!empty($links)){ ?> <div class="form-group row"> <div class="col-12"> <div class="pagination_item_block"> <nav> <?php echo $links; ?> </nav> </div> </div> </div> <?php } ?> </div> </div> </div> </div> </div> <script type="text/javascript"> // for multiple action $(".actions").click(function(e){ e.preventDefault(); var _table='tbl_gf_ecomm_product'; var href='<?= base_url($this->config->item('apanel_name').'/ecomm/functions/perform_multipe'); ?>'; var _ids = $.map($('.post_ids:checked'), function(c){return c.value; }); var _action=$(this).data("action"); if(_ids!='') { swal({ title: "Do you really want to perform?", type: "warning", showCancelButton: true, confirmButtonClass: "btn-danger btn_edit", cancelButtonClass: "btn-warning btn_edit", confirmButtonText: "Yes", cancelButtonText: "No", closeOnConfirm: false, closeOnCancel: false, showLoaderOnConfirm: true }, function(isConfirm) { if (isConfirm) { $.ajax({ type:'post', url:href, dataType:'json', data:{ids:_ids,for_action:_action,table:_table}, success:function(res){ console.log(res); if(res.status=='1'){ swal({ title: "Successfully", text: "You have successfully done", type: "success" },function() { location.reload(); }); } } }); }else{ swal.close(); } }); } else{ $('.notifyjs-corner').empty(); $.notify( 'No record selected !', { position:"top center",className: 'danger' } ); } }); $("#checkall").click(function () { $('.post_ids').not(this).prop('checked', this.checked); }); $(".btn_delete_a").click(function(e){ e.preventDefault(); var _id=$(this).data("id"); e.preventDefault(); var href='<?= base_url($this->config->item('apanel_name').'/ecomm/products/delete'); ?>/'+_id; var btn = this; swal({ title: "Are you sure ?", type: "warning", showCancelButton: true, confirmButtonClass: "btn-danger btn_edit", cancelButtonClass: "btn-warning btn_edit", confirmButtonText: "Yes", cancelButtonText: "No", closeOnConfirm: false, closeOnCancel: false, showLoaderOnConfirm: true }, function(isConfirm) { if (isConfirm) { $.ajax({ type:'GET', url:href, success:function(res){ if($.trim(res)=='success'){ swal({ title: "Deleted", text: "Your product has been deleted", type: "success" },function() { $(btn).closest('.item_holder').fadeOut("200"); }); } } }); }else{ swal.close(); } }); }); $(".enable_disable").on("click",function(e){ var href; var btn = this; var _id=$(this).data("id"); var _for=$(this).prop("checked"); if(_for==false){ href='<?= base_url($this->config->item('apanel_name').'/ecomm/products/deactive'); ?>/'+_id; }else{ href='<?= base_url($this->config->item('apanel_name').'/ecomm/products/active'); ?>/'+_id; } $.ajax({ type:'GET', url:href, success:function(res){ $('.notifyjs-corner').empty(); $.notify( res, { position:"top center",className: 'success' } ); } }); }); $(".enable_disable_newArrival").on("click",function(e){ var href; var btn = this; var _id=$(this).data("id"); var _for=$(this).prop("checked"); if(_for==false){ href='<?= base_url($this->config->item('apanel_name').'/ecomm/products/newarrivalDeactive'); ?>/'+_id; }else{ href='<?= base_url($this->config->item('apanel_name').'/ecomm/products/newarrivalActive'); ?>/'+_id; } $.ajax({ type:'GET', url:href, success:function(res){ $('.notifyjs-corner').empty(); $.notify( res, { position:"top center",className: 'success' } ); } }); }); $(".enable_disable_showHome").on("click",function(e){ var href; var btn = this; var _id=$(this).data("id"); var _for=$(this).prop("checked"); if(_for==false){ href='<?= base_url($this->config->item('apanel_name').'/ecomm/products/showHomeDeactive'); ?>/'+_id; }else{ href='<?= base_url($this->config->item('apanel_name').'/ecomm/products/showHomeActive'); ?>/'+_id; } $.ajax({ type:'GET', url:href, success:function(res){ $('.notifyjs-corner').empty(); $.notify( res, { position:"top center",className: 'success' } ); } }); }); $(".enable_disable_is_featured").on("click",function(e){ var href; var btn = this; var _id=$(this).data("id"); var _for=$(this).prop("checked"); if(_for==false){ href='<?= base_url($this->config->item('apanel_name').'/ecomm/products/is_featured_deactive'); ?>/'+_id; }else{ href='<?= base_url($this->config->item('apanel_name').'/ecomm/products/is_featured_active'); ?>/'+_id; } $.ajax({ type:'GET', url:href, success:function(res){ $('.notifyjs-corner').empty(); $.notify( res, { position:"top center",className: 'success' } ); } }); }); $(".btn_today").on("click",function(e){ e.preventDefault(); var href; var btn = this; var _id=$(this).data("id"); var _for=$(this).data("action"); if(_for=='deactive'){ href='<?= base_url($this->config->item('apanel_name').'/ecomm/products/deactive_today'); ?>/'+_id; }else{ href='<?= base_url($this->config->item('apanel_name').'/ecomm/products/active_today'); ?>/'+_id; } $.ajax({ type:'GET', url:href, success:function(res){ location.reload(); } }); }); </script> <script> function formatResult(node) { var level = 0; if(node.element !== undefined){ level = (node.element.className); if(level.trim() !== ''){ level = (parseInt(level.match(/\d+/)[0])); } } var $result = $('<span style="padding-left:' + (20 * level) + 'px;">' + node.text + '</span>'); return $result; }; $(document).ready(function(){ $("select[name='category_id']").select2({ placeholder: 'Select a category', width: "300px", templateResult: formatResult, }); $("select[name='category_id']").on('select2:select', function (e) { var data = e.params.data; var url = '<?php echo preg_replace('/.category_id=(\d+)?/', '', base_url($this->config->item('apanel_name').'/ecomm/products').get_query_string()); ?>'; if(data.id > 0) { var search_value = $('[name="search_value"]').val(); url = '<?php echo preg_replace('/.category_id=(\d+)?/', '', base_url($this->config->item('apanel_name').'/ecomm/products?')); ?>&category_id=' + data.id + (search_value.trim() ? '&search_value='+search_value : ''); } window.location.href = url; }); }) // Show tooltip ahsan $(function() { showTooltip(); function showTooltip() { $(".tooltip-test").each(function() { $(this).tooltip(); }); } }); </script>