📁 PHP Dosya Yöneticisi
/
/
home
/
demodesigncom
/
e-ticaretv11.demodesign.com.tr
/
propanel
/
view
/
stylesheet
/
mm-stock
📝
javascript.js
← Geri Dön
$(document).ready(function(){ // quick edit button in popup function // perform function when popup closed // quick edit button in popup function $("#mmquickedit-order tbody td").dblclick(function (e) { /* if($(this).children('select').attr('name') == "order_status_id"){ return; } */ $clickElement = e.target; $selector = e.target.tagName; // selector select/input return; if($selector=="SELECT"){return;} if($selector=="INPUT"){return;} putOldValueBack(); $colname = $(this).attr('data-col'); $order_id = $(this).attr('rel'); if($colname=="col-action"){return;} // alert($order_id); e.preventDefault(); e.stopImmediatePropagation(); $this = $(this); // if ($this.data('editing')) return; if($colname=="col-quantity"){ getOrderFieldsHtml($colname,$order_id); } }); putOldValueBack = function () { $("#mmquickedit-order .editfield").each(function(){ $colname = $(this).parent().attr('data-col'); $order_id = $(this).parent().attr('rel'); if($colname=="col-quantity"){ $val = $('input[name=\'quantity\'].editfield').val(); updateOrderFieldsHtml($colname,$order_id,$val); } if($colname=="col-customer"){ $val = $('input[name=\'customer_id\'].editfield').val(); updateOrderFieldsHtml($colname,$order_id,$val); } if($colname=="col-first_name"){ $val = $('input[name=\'firstname\'].editfield').val(); updateOrderFieldsHtml($colname,$order_id,$val); } if($colname=="col-last_name"){ $val = $('input[name=\'lastname\'].editfield').val(); updateOrderFieldsHtml($colname,$order_id,$val); } if($colname=="col-email"){ $val = $('input[name=\'email\'].editfield').val(); updateOrderFieldsHtml($colname,$order_id,$val); } if($colname=="col-telephone"){ $val = $('input[name=\'telephone\'].editfield').val(); updateOrderFieldsHtml($colname,$order_id,$val); } if($colname=="col-date_added"){ $val = $('input[name=\'date_added\'].editfield').val(); updateOrderFieldsHtml($colname,$order_id,$val); } if($colname=="col-date_modified"){ $val = $('input[name=\'date_modified\'].editfield').val(); updateOrderFieldsHtml($colname,$order_id,$val); } if($colname=="col-status"){ /* $(this).parent('.col-status').addClass('updatefield'); $value = $("select[name=\'order_status_id\'].editfield option:selected"); $value.text(); $val = $('select[name=\'order_status_id\'].editfield').val(); updateOrderFieldsHtml($colname,$order_id,$val); var td = $this.closest('td.col-status'); td.empty().html($value.text()+' <i class="fa fa-pencil-square fa-qorder-icon" aria-hidden="true"></i>').data('editing', false); return; */ } if($colname=="col-currency"){ $val = $('select[name=\'currency\'].editfield').val(); updateOrderFieldsHtml($colname,$order_id,$val); } if($colname=="col-store"){ $value = $("select[name=\'store_id\'].editfield option:selected"); $value.text(); $val = $('select[name=\'store_id\'].editfield').val(); updateOrderFieldsHtml($colname,$order_id,$val); var td = $this.closest('td'); td.empty().html($value.text()+' <i class="fa fa-pencil-square fa-qorder-icon" aria-hidden="true"></i>').data('editing', false); return; } if($colname=="col-customer_group"){ $value = $("select[name=\'customer_group_id\'].editfield option:selected"); $value.text(); $val = $('select[name=\'customer_group_id\'].editfield').val(); updateOrderFieldsHtml($colname,$order_id,$val); var td = $this.closest('td'); td.empty().html($value.text()).data('editing', false); return; } $this = $(this); var val = $this.val(); $fval = '<span class="label label-info">' + val + '</span>' var td = $this.closest('td'); td.empty().html($fval).data('editing', false); if(val!=0){ $(".well").after('<div class="alert alert-success">Product Quantity is updated and is will moved to Product List</div>'); } }); } $(document).click(function (e) { $clickElement = e.target; $selector = e.target.tagName; // selector select/input return; if($selector=="SELECT"){return;} if($selector=="INPUT"){return;} putOldValueBack(); }); function getOrderFieldsHtml($colname,$order_id){ $.ajax({ url: 'index.php?route=mmstock/product/getColHtml&user_token='+ $user_token+'&order_id=' +$order_id+'&colname=' + $colname, dataType: 'json', success: function(json) { $('.alert-dismissible').remove(); if (json['error']) { // $('#content > .container-fluid').prepend('<div class="alert alert-danger alert-dismissible"><i class="fa fa-exclamation-circle"></i> ' + json['error'] + ' <button type="button" class="close" data-dismiss="alert">×</button></div>'); return false; } if (json['success']) { $this.empty() // $this.data('editing', true); // $('<input type="text" class="editfield">').val(json['success']).appendTo($this); $(json['success']).appendTo($this); $(".editfield").focus(); triggerCustomerautocomplete(); } }, }); } function updateOrderFieldsHtml($colname,$order_id,$val,$attribute){ if($val!="undefined" && $val!=0){ $.ajax({ url: 'index.php?route=mmstock/product/updateColHtml&user_token='+ $user_token+'&order_id=' +$order_id+'&colname=' + $colname+'&val=' + $val+'&attribute=' + $attribute, dataType: 'json', success: function(json) { $('.alert-dismissible').remove(); if (json['error']) { // $('#content > .container-fluid').prepend('<div class="alert alert-danger alert-dismissible"><i class="fa fa-exclamation-circle"></i> ' + json['error'] + ' <button type="button" class="close" data-dismiss="alert">×</button></div>'); return false; } if($colname=="col-status"){ $thiz = $('.col-status.updatefield'); $thiz.closest('td.col-status').css('color',''); $thiz.closest('td.col-status').css('background',''); if(json['clr']!=""){ $thiz.closest('td.col-status').css('color',json['clr']); $thiz.closest('td.col-status').parent('tr.colrowsz').css('color',json['clr']); } if(json['bg']!=""){ $thiz.closest('td.col-status').css('background',json['bg']); $thiz.closest('td.col-status').parent('tr.colrowsz').css('background',json['bg']); } var td = $this.closest('td.col-status'); td.empty().html($value.text()+' <i class="fa fa-pencil-square fa-qorder-icon" aria-hidden="true"></i>').data('editing', false); } setTimeout(function(){ window.location.reload(1); }, 5000); if (json['success']) { // $this.empty() // $this.data('editing', true); /*$('<input type="text" class="editfield">').val(json['success']).appendTo($this);*/ // $(json['success']).appendTo($this); // $(".editfield").focus(); } }, }); } else{ $('.alert-success.alert').remove(); } } // default opencart codes // Customer function triggerCustomerautocomplete(){ $('input[name=\'customer\']').autocomplete({ 'source': function(request, response) { $.ajax({ url: 'index.php?route=customer/customer/autocomplete&user_token='+ $user_token +'&filter_name=' + encodeURIComponent(request), dataType: 'json', success: function(json) { response($.map(json, function(item) { return { label: item['name'], value: item['customer_id'] } })); } }); }, 'select': function(item) { $('input[name=\'customer\']').val(item['label']); $('input[name=\'customer_id\']').val(item['value']); } }); } });
💾 Kaydet
İptal
📝 Yeniden Adlandır
İptal
Kaydet
🔐 Dosya İzinleri (chmod)
İzin Değeri:
Hızlı Seçim:
777
755
644
600
777
= Herkes okur/yazar/çalıştırır
755
= Sahip tam, diğerleri okur/çalıştırır
644
= Sahip okur/yazar, diğerleri okur
600
= Sadece sahip okur/yazar
İptal
Uygula