first commit
This commit is contained in:
@@ -0,0 +1,87 @@
|
||||
/*******************************************************************
|
||||
|
||||
PHP Class : /Controller/Display/ConfigController
|
||||
Description : Konfigurasi Display POS
|
||||
Created By : Siau Pheng ([email protected]).
|
||||
Created Date : August 4th, 2013.
|
||||
Last Modified : August 31st, 2026.
|
||||
|
||||
(c) 3FONIA Software; WWW.3FONIA.COM.
|
||||
|
||||
*******************************************************************/
|
||||
|
||||
var DISPConfigJS = {
|
||||
PHP: '',
|
||||
KODE: '',
|
||||
|
||||
index: function(){
|
||||
$('#butBrow').click(() => this.cab_brow());
|
||||
$('#butUbah').click(() => this.proses_edit());
|
||||
$('#butSimpan').click(() => this.proses_save());
|
||||
this.data_query('form-display');
|
||||
},
|
||||
|
||||
cab_brow: function(){
|
||||
var _isi = new String('<div id="divBrowCab"> </div>');
|
||||
this.winBCab = FoniaJS.showWindow('BCab', 'Daftar Cabang', _isi, 'lg', '', () => this.data_query('brow-cabang'));
|
||||
},
|
||||
|
||||
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({
|
||||
url: this.PHP + '/form_display',
|
||||
sendParam: ['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: (ajson) => {
|
||||
$('#divDisplay').html(ajson.html);
|
||||
$('#Nama_Cabang').val(ajson.Nama_Cab);
|
||||
this.update_event();
|
||||
if (ajson.sukses) FoniaJS.showInfo('Konfigurasi display POS sukses disimpan!');
|
||||
}
|
||||
}).send();
|
||||
} else if (tipe=='brow-cabang'){
|
||||
new Request.JSONF({
|
||||
url: this.PHP + '/brow_cabang',
|
||||
}).send();
|
||||
}
|
||||
},
|
||||
|
||||
update_event: function(){
|
||||
if ($.inArray($('#mode').val(), ['edit']) >= 0) {
|
||||
$('#butBrow').prop('disabled', true);
|
||||
$('#butUbah').prop('disabled', true);
|
||||
$('#butSimpan').prop('disabled', false);
|
||||
} else {
|
||||
$('#butBrow').prop('disabled', false);
|
||||
$('#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);
|
||||
});
|
||||
}
|
||||
|
||||
};
|
||||
@@ -0,0 +1,114 @@
|
||||
/*******************************************************************
|
||||
|
||||
PHP Class : /Controller/Display/IklanController
|
||||
Description : Konfigurasi Display Iklan POS
|
||||
Created By : Siau Pheng ([email protected]).
|
||||
Created Date : January 15th, 2015.
|
||||
Last Modified : August 31st, 2026.
|
||||
|
||||
(c) 3FONIA Software; WWW.3FONIA.COM.
|
||||
|
||||
*******************************************************************/
|
||||
|
||||
var DISPIklanJS = {
|
||||
PHP: '',
|
||||
KODE: '',
|
||||
|
||||
index: function(){
|
||||
this.data_query('detail');
|
||||
$('#Cari_Iklan').keydown((e) => {
|
||||
var key = e.keyCode || e.which || 0;
|
||||
if (key==13 && e.target.value!='') this.data_query('detail');
|
||||
});
|
||||
$('#butSearch').click(() => this.data_query('detail'));
|
||||
$('#butAll').click(() => {
|
||||
$('#Cari_Iklan').val('');
|
||||
this.data_query('detail');
|
||||
});
|
||||
FoniaJS.setFocus('#Cari_Iklan');
|
||||
},
|
||||
|
||||
detail_show: function(mode, ID){
|
||||
new Request({
|
||||
url: this.PHP + '/form_iklan',
|
||||
sendParam: ['mode_detail='+mode,'PromoID='+ID],
|
||||
onSuccess: (ajson) => {
|
||||
this.winDetail = FoniaJS.showWindow('Detail', 'Detail Informasi Iklan', ajson.html, 900, [{},{i:'butTutup'},{i:'butWSimpan',v:'Simpan',c:'success'}], () => {
|
||||
$('#winDetail')
|
||||
.find('#butWSimpan').click(() => this.detail_save()).end()
|
||||
.find('#FileGambar').off('change').change(() => {
|
||||
var fd = new FormData(), files = $('#FileGambar')[0].files[0];
|
||||
fd.append('Gambar1', files);
|
||||
fd.append('PromoID', $('#PromoID').val());
|
||||
$.ajax({
|
||||
url: this.PHP + '/upload_picture',
|
||||
type: 'post',
|
||||
data: fd,
|
||||
contentType: false,
|
||||
processData: false,
|
||||
success: (ares) => {
|
||||
if (ares.result != 0){
|
||||
FoniaJS.showInfo('Sukses upload file Gambar !');
|
||||
$('#PromoID').val(ares.PromoID);
|
||||
this.get_picture();
|
||||
} else {
|
||||
FoniaJS.showError(ares.message);
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
this.get_picture();
|
||||
});
|
||||
}
|
||||
}).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> ?', () => {
|
||||
new Request.JSONF({
|
||||
url: this.PHP + '/table_detail',
|
||||
sendParam: ['mode_detail=delete','PromoID='+acell[0],'Cari_Iklan'],
|
||||
onSuccess: () => FoniaJS.showInfo('Proses hapus data sukses!')
|
||||
}).send();
|
||||
}, 'danger');
|
||||
},
|
||||
|
||||
detail_save: function(){
|
||||
new Request.JSONF({
|
||||
url: this.PHP + '/table_detail',
|
||||
sendParam: ['mode_detail','PromoID','CabID','Tanggal','Info','Aktif','Cari_Iklan'],
|
||||
onSuccess: () => {
|
||||
FoniaJS.showInfo('Proses simpan data sukses!');
|
||||
FoniaJS.closeWindow(this.winDetail);
|
||||
}
|
||||
}).send();
|
||||
},
|
||||
|
||||
data_query: function(tipe, mode){
|
||||
if (tipe=="detail"){
|
||||
new Request.JSONF({
|
||||
url: this.PHP + '/table_detail',
|
||||
sendParam: ['Cari_Iklan']
|
||||
}).send();
|
||||
}
|
||||
},
|
||||
|
||||
get_picture: function(){
|
||||
new Request({
|
||||
url: this.PHP + '/get_picture',
|
||||
sendParam: ['PromoID'],
|
||||
onSuccess: (ajson) => {
|
||||
$('#imgPhoto').attr('src', ajson.src);
|
||||
}
|
||||
}).send();
|
||||
}
|
||||
|
||||
};
|
||||
@@ -0,0 +1,114 @@
|
||||
/*******************************************************************
|
||||
|
||||
PHP Class : /Controller/Display/PromoController
|
||||
Description : Konfigurasi Display Promo POS
|
||||
Created By : Siau Pheng ([email protected]).
|
||||
Created Date : January 15th, 2015.
|
||||
Last Modified : August 31st, 2026.
|
||||
|
||||
(c) 3FONIA Software; WWW.3FONIA.COM.
|
||||
|
||||
*******************************************************************/
|
||||
|
||||
var DISPPromoJS = {
|
||||
PHP: '',
|
||||
KODE: '',
|
||||
|
||||
index: function(){
|
||||
this.data_query('detail');
|
||||
$('#Cari_Promo').keydown((e) => {
|
||||
var key = e.keyCode || e.which || 0;
|
||||
if (key==13 && e.target.value!='') this.data_query('detail');
|
||||
});
|
||||
$('#butSearch').click(() => this.data_query('detail'));
|
||||
$('#butAll').click(() => {
|
||||
$('#Cari_Promo').val('');
|
||||
this.data_query('detail');
|
||||
});
|
||||
FoniaJS.setFocus('#Cari_Promo');
|
||||
},
|
||||
|
||||
detail_show: function(mode, ID){
|
||||
new Request({
|
||||
url: this.PHP + '/form_promo',
|
||||
sendParam: ['mode_detail='+mode,'PromoID='+ID],
|
||||
onSuccess: (ajson) => {
|
||||
this.winDetail = FoniaJS.showWindow('Detail', 'Detail Informasi Promo', ajson.html, 900, [{},{i:'butTutup'},{i:'butWSimpan',v:'Simpan',c:'success'}], () => {
|
||||
$('#winDetail')
|
||||
.find('#butWSimpan').click(() => this.detail_save()).end()
|
||||
.find('#FileGambar').off('change').change(() => {
|
||||
var fd = new FormData(), files = $('#FileGambar')[0].files[0];
|
||||
fd.append('Gambar1', files);
|
||||
fd.append('PromoID', $('#PromoID').val());
|
||||
$.ajax({
|
||||
url: this.PHP + '/upload_picture',
|
||||
type: 'post',
|
||||
data: fd,
|
||||
contentType: false,
|
||||
processData: false,
|
||||
success: (ares) => {
|
||||
if (ares.result != 0){
|
||||
FoniaJS.showInfo('Sukses upload file Gambar !');
|
||||
$('#PromoID').val(ares.PromoID);
|
||||
this.get_picture();
|
||||
} else {
|
||||
FoniaJS.showError(ares.message);
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
this.get_picture();
|
||||
});
|
||||
}
|
||||
}).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> ?', () => {
|
||||
new Request.JSONF({
|
||||
url: this.PHP + '/table_detail',
|
||||
sendParam: ['mode_detail=delete','PromoID='+acell[0],'Cari_Promo'],
|
||||
onSuccess: () => FoniaJS.showInfo('Proses hapus data sukses!')
|
||||
}).send();
|
||||
}, 'danger');
|
||||
},
|
||||
|
||||
detail_save: function(){
|
||||
new Request.JSONF({
|
||||
url: this.PHP + '/table_detail',
|
||||
sendParam: ['mode_detail','PromoID','Tanggal','Info','Warna','Font','Aktif','Cari_Promo'],
|
||||
onSuccess: () => {
|
||||
FoniaJS.showInfo('Proses simpan data sukses!');
|
||||
FoniaJS.closeWindow(this.winDetail);
|
||||
}
|
||||
}).send();
|
||||
},
|
||||
|
||||
data_query: function(tipe, mode){
|
||||
if (tipe=="detail"){
|
||||
new Request.JSONF({
|
||||
url: this.PHP + '/table_detail',
|
||||
sendParam: ['Cari_Promo']
|
||||
}).send();
|
||||
}
|
||||
},
|
||||
|
||||
get_picture: function(){
|
||||
new Request({
|
||||
url: this.PHP + '/get_picture',
|
||||
sendParam: ['PromoID'],
|
||||
onSuccess: (ajson) => {
|
||||
$('#imgPhoto').attr('src', ajson.src);
|
||||
}
|
||||
}).send();
|
||||
}
|
||||
|
||||
};
|
||||
Reference in New Issue
Block a user