def tambah(): label_state2_1.grid_remove() label_state2_2.grid_remove() buttonUdah.grid_remove() global v_jumlahBotol v_jumlahBotol = str(int(v_jumlahBotol)+1) global lagi lagi = ttk.Label(frame_label, text='Apakah anda masih ingin', background='white', font=font_button) lagi.grid(column=1,row=0) global jir jir = ttk.Label(frame_label, text='memasukkan sampah botol plastik?', background='white', font=font_button) jir.grid(column=1,row=1) global buttonYa buttonYa = ttk.Button(frame_label, text = "Ya", style='button1.TButton', command= lambda: loopUWU()) buttonYa.grid(column=2,row=2) global buttonGa buttonGa = ttk.Button(frame_label, text = "Tidak", style='button1.TButton' , command= lambda : [Inet.update(Inet.makeId(str(RFID.getId())), "botol kecil"), s3_sudah(), khusus()]) buttonGa.grid(column=0,row=2)
def s3_sudah(): global v_jumlahBotol v_jumlahBotol = "Jumlah Botol yang dimasukan = " + v_jumlahBotol v_jenisBotol = "Jenis Botol = Botol Kecil" v_saldoTambahan = "Saldo Tambahan = " + Inet.liatSaldoTambahan() v_saldoAkhir = "Saldo Akhir = " + Inet.liatSaldoAkhir() global e_banyakBotol e_banyakBotol = ttk.Label(frame_label, text=v_jumlahBotol, background='white', font=font_data) e_banyakBotol.grid(column=0, row=1, pady=pady_button, padx=padx_button) global e_jenisBotol e_jenisBotol = ttk.Label(frame_label, text=v_jenisBotol, background='white', font=font_data) e_jenisBotol.grid(column=0, row=2, pady=pady_button, padx=padx_button) global e_saldoTambahan e_saldoTambahan = ttk.Label(frame_label, text=v_saldoTambahan, background='white', font=font_data) e_saldoTambahan.grid(column=0, row=3, pady=pady_button, padx=padx_button) global e_saldoAkhir e_saldoAkhir = ttk.Label(frame_label, text=v_saldoAkhir, background='white', font=font_data) e_saldoAkhir.grid(column=0, row=4, pady=pady_button, padx=padx_button) global buttonUpdate buttonUpdate = ttk.Button(frame_label, text="Lanjut", style='button1.TButton', command=lambda: makasi()) buttonUpdate.grid(column=2, row=5)
def s1_mulai(): v_id = "Id = " + str(RFID.getId()) global v_namaAja v_namaAja = str(Inet.get(Inet.makeId(str(RFID.getId())))["nama"]) v_nama = "Nama = " + v_namaAja v_saldo = "Saldo = " + str( Inet.get(Inet.makeId(str(RFID.getId())))["saldo"]) button_mulai.grid_remove() e_mulai.grid_remove() logo.grid_remove() judul.grid_remove() #Ilangin bagian atas global putih putih = ttk.Label(frame_awal, image=kosong) putih.grid(column=0, row=0) ##--------Frame Logo---------- global logoLabel logoLabel = ttk.Label(frame_logo, image=logoKecil, background='white') logoLabel.grid(column=0, row=0) global buttonBantuan buttonBantuan = ttk.Button(frame_bantuan, image=iconBantuan, style='button1.TButton', command=lambda: bantu()) buttonBantuan.grid(column=0, row=0) global pinggiran1 pinggiran1 = ttk.Label(frame_logo, image=pinggir) pinggiran1.grid(column=0, row=1) global pinggiran2 pinggiran2 = ttk.Label(frame_bantuan, image=pinggir) pinggiran2.grid(column=0, row=1) ##---------Frame label---------- global e_apakah e_apakah = ttk.Label(frame_label, text="Apakah datanya benar?", font=font_button, background='white') e_apakah.grid(column=1, row=1, pady=pady_button, padx=padx_button) global e_id e_id = ttk.Label(frame_label, text=v_id, background='white', font=font_data) e_id.grid(column=1, row=2, pady=pady_button, padx=padx_button) global e_nama e_nama = ttk.Label(frame_label, text=v_nama, background='white', font=font_data) e_nama.grid(column=1, row=3, pady=pady_button, padx=padx_button) global e_saldo e_saldo = ttk.Label(frame_label, text=v_saldo, background='white', font=font_data) e_saldo.grid(column=1, row=4, pady=pady_button, padx=padx_button) global buttonKembali buttonKembali = ttk.Button( frame_label, text="Salah", style='button1.TButton', command=lambda: [balikKeAwal(), mulai()]) buttonKembali.grid(column=0, row=5) global buttonOk buttonOk = ttk.Button( frame_label, text="Benar", style='button1.TButton', command=lambda: [ Inet.update(Inet.makeId(str(RFID.getId())), "botol kecil"), tambahLagi() ]) buttonOk.grid(column=2, row=5)
import SPRInternet as Inet import SPRRFID as RFID import datetime # get id from RFID tanggal = datetime.datetime.now().strftime('%d/%m/%Y') id = str(RFID.checkId()) print(RFID.getId()) # get firebase id inetId = Inet.makeId(id) # update data in firebase Inet.update(inetId, "botol besar") Inet.updateTanggal(inetId, tanggal) # check result = Inet.get(inetId) print(result)
import SPRInternet as Inet import SPRRFID as RFID # get id from RFID id = str(RFID.checkId()) # get firebase id inetId = Inet.makeId(id) # update data in firebase Inet.update(inetId, "botol besar") # check result = Inet.get(inetId) print (result)