/******************************************************************* Module : /apps/js/sys/printer.js Desc. : JS - Konfigurasi Printer POS Created By : Siau Pheng (siaupheng@3fonia.com). Created Date : August 4th, 2013. Last Modified : November 7th, 2025. (c) 2013 - 2025, 3FONIA Software; WWW.3FONIA.COM. *******************************************************************/ var PrinterJS = { PHP: '', KODE: '', loading: function(){ $('#butUbah').click(function(){this.proses_edit();}.bind(this)); $('#butSimpan').click(function(){this.proses_save();}.bind(this)); this.data_query('form-printer'); }, proses_edit: function(){ this.data_query('form-printer', 'edit'); }, proses_save: function(){ this.data_query('form-printer', 'save'); }, data_query: function(tipe, mode){ if (tipe=='form-printer'){ new Request.JSON({ url: this.PHP, sendParam: ['data=form-printer','mode='+mode,'REG_ID','PRINT_AUTO','PRINT_OPENCD','PRINT_AUTOCUT','PRINT_ROW','TITLE_END'], onSuccess: function(a){ $('#divPrinter').html(a.html); this.update_event(); if (a.sukses) FoniaJS.showInfo('Konfigurasi printer sukses disimpan!'); }.bind(this) }).send(); } }, update_event: function(){ if ($.inArray($('#mode').val(), ['edit']) >= 0) { $('#butUbah').prop('disabled', true); $('#butSimpan').prop('disabled', false); } else { $('#butUbah').prop('disabled', false); $('#butSimpan').prop('disabled', true); } } };