first commit

This commit is contained in:
2026-01-22 11:06:19 +07:00
commit c877faf5a0
168 changed files with 19843 additions and 0 deletions
+88
View File
@@ -0,0 +1,88 @@
/*******************************************************************
Module : /apps/js/disp/config.js
Desc. : JS - Konfigurasi Display POS
Created By : Siau Pheng ([email protected]).
Created Date : August 4th, 2013.
Last Modified : December 7th, 2025.
(c) 2013 - 2025, 3FONIA Software; WWW.3FONIA.COM.
*******************************************************************/
var DISPConfigJS = {
PHP: '',
KODE: '',
loading: function(){
$('#butBrow').click(function(){this.cab_brow();}.bind(this));
$('#butUbah').click(function(){this.proses_edit();}.bind(this));
$('#butSimpan').click(function(){this.proses_save();}.bind(this));
this.data_query('form-display');
},
cab_brow: function(){
var _isi = new String('<div id="divBrowCab">&nbsp;</div>');
this.winBCab = FoniaJS.showWindow('BCab', 'Daftar Cabang', _isi, 'lg', '', function(){
this.data_query('brow-cabang');
}.bind(this));
},
cab_select: function(acell){
FoniaJS.closeWindow(this.winBCab);
$('#REG_ID').val(acell[0]);
this.data_query('form-display', 'view');
},
proses_edit: function(){
this.data_query('form-display', 'edit');
this.load_port();
},
proses_save: function(){
this.data_query('form-display', 'save');
},
data_query: function(tipe, mode){
if (tipe=='form-display'){
new Request.JSON({
url: this.PHP,
sendParam: ['data=form-display','mode='+mode,'REG_ID','MON_ENABLE','Text_Run','Warna','Font','Promo_Idle','Promo_Durasi','POLE_ENABLE','POLE_PORT','POLE_START1','POLE_START2','POLE_END1','POLE_END2'],
onSuccess: function(a){
$('#divDisplay').html(a.html);
$('#Nama_Cabang').val(a.Nama_Cabang);
this.update_event();
if (a.sukses) FoniaJS.showInfo('Konfigurasi display POS sukses disimpan!');
}.bind(this)
}).send();
} else if (tipe=='brow-cabang'){
new Request.JSONF({
url: this.PHP,
sendParam: ['data=brow-cabang']
}).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);
}
},
load_port: function(){
var parent = this;
qz.serial.findPorts().then(function(data){
var _selport = $('#POLE_PORT').val();
$('#POLE_PORT').empty();
for (var i = 0; i < data.length; i++){
$('<option/>', {value: data[i]}).text(data[i]).appendTo('#POLE_PORT');
};
$('#POLE_PORT').val(_selport);
});
}
};
+107
View File
@@ -0,0 +1,107 @@
/*******************************************************************
Module : /apps/js/disp/iklan.js
Desc. : JS - Konfigurasi Display Iklan POS
Created By : Siau Pheng ([email protected]).
Created Date : January 15th, 2015.
Last Modified : December 8th, 2025.
(c) 2015 - 2025, 3FONIA Software; WWW.3FONIA.COM.
*******************************************************************/
var DISPIklanJS = {
PHP: '',
KODE: '',
loading: function(){
this.data_query('detail');
$('#Cari_Iklan').keydown(function(e){
var key = e.keyCode || e.which || 0;
if (key==13 && e.target.value!='') this.data_query('detail');
}.bind(this));
$('#butSearch').click(function(e){
this.data_query('detail');
}.bind(this));
$('#butAll').click(function(){
$('#Cari_Iklan').val('');
this.data_query('detail');
}.bind(this));
FoniaJS.setFocus('#Cari_Iklan');
},
detail_show: function(mode, ID){
new Request.JSON({
url: this.PHP,
sendParam: ['data=promo-detail','mode_detail='+mode,'PromoID='+ID],
onSuccess: function(ajson){
this.winDetail = FoniaJS.showWindow('Detail', 'Detail Informasi Iklan', ajson.html, 900, [{},{i:'butTutup'},{i:'butWSimpan',v:'Simpan',c:'success'}], function(){
$('#winDetail')
.find('#butWSimpan').click(function(){this.detail_save();}.bind(this)).end()
.find('#FileGambar').off('change').change(function(){
var fd = new FormData(), files = $('#FileGambar')[0].files[0];
fd.append('Gambar1', files);
$.ajax({
url: this.PHP+'?'+(FoniaJS.RequestParam(['data=upload-gambar','PromoID']).join('&')),
type: 'post',
data: fd,
contentType: false,
processData: false,
success: function(ares){
if (ares.result != 0){
FoniaJS.showInfo('Sukses upload file Gambar !');
$('#PromoID').val(ares.PromoID);
$('#imgPhoto').attr('src', this.PHP + '?data=image&PromoID=' + ares.PromoID + '&cq=' + $.now());
} else {
FoniaJS.showError(ares.message);
}
}.bind(this)
});
}.bind(this));
$('#imgPhoto').attr('src', this.PHP + '?data=image&PromoID=' + $('#PromoID').val() + '&cq=' + $.now());
}.bind(this));
}.bind(this)
}).send();
},
detail_tambah: function(){
this.detail_show('insert', 0);
},
detail_ubah: function(acell){
this.detail_show('update', acell[0]);
},
detail_hapus: function(acell){
FoniaJS.showConfirm('Konfirmasi', 'Yakin akan hapus <b>"'+acell[2]+'"</b> ?', function(){
new Request.JSONF({
url: this.PHP,
sendParam: ['data=detail','mode_detail=delete','PromoID='+acell[0],'Cari_Iklan'],
onSuccess: function(){
FoniaJS.showInfo('Proses hapus data sukses!');
}.bind(this)
}).send();
}.bind(this), 'danger');
},
detail_save: function(){
new Request.JSONF({
url: this.PHP,
sendParam: ['data=detail','mode_detail','PromoID','CabID','Tanggal','Info','Aktif','Cari_Iklan'],
onSuccess: function(){
FoniaJS.showInfo('Proses simpan data sukses!');
FoniaJS.closeWindow(this.winDetail);
}.bind(this)
}).send();
},
data_query: function(tipe, mode){
if (tipe=="detail"){
new Request.JSONF({
url: this.PHP,
sendParam: ['data=detail','Cari_Iklan']
}).send();
}
}
};
+107
View File
@@ -0,0 +1,107 @@
/*******************************************************************
Module : /apps/js/disp/promo.js
Desc. : JS - Konfigurasi Display Promo POS
Created By : Siau Pheng ([email protected]).
Created Date : January 15th, 2015.
Last Modified : December 8th, 2025.
(c) 2015 - 2025, 3FONIA Software; WWW.3FONIA.COM.
*******************************************************************/
var DISPPromoJS = {
PHP: '',
KODE: '',
loading: function(){
this.data_query('detail');
$('#Cari_Promo').keydown(function(e){
var key = e.keyCode || e.which || 0;
if (key==13 && e.target.value!='') this.data_query('detail');
}.bind(this));
$('#butSearch').click(function(e){
this.data_query('detail');
}.bind(this));
$('#butAll').click(function(){
$('#Cari_Promo').val('');
this.data_query('detail');
}.bind(this));
FoniaJS.setFocus('#Cari_Promo');
},
detail_show: function(mode, ID){
new Request.JSON({
url: this.PHP,
sendParam: ['data=promo-detail','mode_detail='+mode,'PromoID='+ID],
onSuccess: function(ajson){
this.winDetail = FoniaJS.showWindow('Detail', 'Detail Informasi Promo', ajson.html, 900, [{},{i:'butTutup'},{i:'butWSimpan',v:'Simpan',c:'success'}], function(){
$('#winDetail')
.find('#butWSimpan').click(function(){this.detail_save();}.bind(this)).end()
.find('#FileGambar').off('change').change(function(){
var fd = new FormData(), files = $('#FileGambar')[0].files[0];
fd.append('Gambar1', files);
$.ajax({
url: this.PHP+'?'+(FoniaJS.RequestParam(['data=upload-gambar','PromoID']).join('&')),
type: 'post',
data: fd,
contentType: false,
processData: false,
success: function(ares){
if (ares.result != 0){
FoniaJS.showInfo('Sukses upload file Gambar !');
$('#PromoID').val(ares.PromoID);
$('#imgPhoto').attr('src', this.PHP + '?data=image&PromoID=' + ares.PromoID + '&cq=' + $.now());
} else {
FoniaJS.showError(ares.message);
}
}.bind(this)
});
}.bind(this));
$('#imgPhoto').attr('src', this.PHP + '?data=image&PromoID=' + $('#PromoID').val() + '&cq=' + $.now());
}.bind(this));
}.bind(this)
}).send();
},
detail_tambah: function(){
this.detail_show('insert', 0);
},
detail_ubah: function(acell){
this.detail_show('update', acell[0]);
},
detail_hapus: function(acell){
FoniaJS.showConfirm('Konfirmasi', 'Yakin akan hapus <b>"'+acell[2]+'"</b> ?', function(){
new Request.JSONF({
url: this.PHP,
sendParam: ['data=detail','mode_detail=delete','PromoID='+acell[0],'Cari_Promo'],
onSuccess: function(){
FoniaJS.showInfo('Proses hapus data sukses!');
}.bind(this)
}).send();
}.bind(this), 'danger');
},
detail_save: function(){
new Request.JSONF({
url: this.PHP,
sendParam: ['data=detail','mode_detail','PromoID','Tanggal','Info','Warna','Font','Aktif','Cari_Promo'],
onSuccess: function(){
FoniaJS.showInfo('Proses simpan data sukses!');
FoniaJS.closeWindow(this.winDetail);
}.bind(this)
}).send();
},
data_query: function(tipe, mode){
if (tipe=="detail"){
new Request.JSONF({
url: this.PHP,
sendParam: ['data=detail','Cari_Promo']
}).send();
}
}
};