def addSchedule():
	ms2T = Template()
	ms2S = Schedule()

	return render_template('addNewSchedule.html', listKodeReportS = ms2T.listKodeReportAddNewSchedule(),
		listPIC = ms2S.namaPIC(), listPen = ms2S.namaPenerima(), 
		)
Example #2
0
def formEditSchedule():

    ms2T = Template()
    ms2S = Schedule()

    if request.method == 'POST':

        kode_laporan = request.form['valKode']

        ms2T = Template()
        ms2S = Schedule()
        ms2S.listMaker(kode_laporan)

        # print(kode_laporan)
        return render_template(
            'editSchedule2.html',
            kode_laporan=kode_laporan,
            detailSchedule=ms2S.showDetailSchedule(kode_laporan),
            listPIC=ms2S.namaPIC(),
            listPen=ms2S.namaPenerima())
        ##return render_template('editSchedule.html', detailSchedule = ms2S.showDetailSchedule(kode_laporan))
        #return redirect (url_for('editSchedule', kode_laporan=kode_laporan,
        # detailSchedule = ms2S.showDetailSchedule()))

    return render_template('editSchedule.html',
                           listKodeLap=ms2T.listKodeReportEditSchedule())
Example #3
0
def formEditSchedule():
	
	ms2T = Template()
	ms2S = Schedule()

	if request.method == 'POST':

		# kode_laporan = request.form['valKode']

		# ms2T = Template()
		# ms2S = Schedule()

		# print(kode_laporan)
		return render_template('editSchedule.html', detailSchedule = ms2S.showDetailSchedule(kode_laporan))
		#return redirect (url_for('editSchedule', kode_laporan=kode_laporan,
							# detailSchedule = ms2S.showDetailSchedule()))

	
	return render_template('editSchedule.html', listKodeReport = ms2T.listKodeReport())	
Example #4
0
def start():
	print( "===============/prosesViewEditSchedule===============")
	ms2T = Template()
	ms2S = Schedule()
	
	if request.method == 'POST':
		
		kode_laporan = request.form['valKode']
		
		ms2T = Template()
		ms2S = Schedule()
		ms2S.listMaker(kode_laporan)

		#return redirect (url_for('formEditSchedule', kode_laporan=kode_laporan))
		# return redirect (url_for('editSchedule', kode_laporan=kode_laporan,
		# 					detailSchedule = ms2S.showDetailSchedule(kode_laporan)))
		return render_template('editSchedule.html', kode_laporan=kode_laporan,
							detailSchedule = ms2S.showDetailSchedule(kode_laporan),
							listPIC = ms2S.namaPIC(), listPen = ms2S.namaPenerima())
Example #5
0
def prosesSimpanEditSchedule():
    print("===============/prosesSimpanEditSchedule===============")
    ms2S = Schedule()

    if request.method == 'POST':
        kode_laporan = request.form['kodLap2']
        header = request.form['header']
        keterangan = request.form['keterangan']
        note = request.form['note']
        grouping = request.form['grouping']
        reportPIC = ''
        reportPenerima = ''
        jadwalBln = ''
        jadwalHari = ''
        jadwalTgl = ''
        aktifYN = ''
        lastUpdate = datetime.datetime.now()

        for checkHari in [
                'senin', 'selasa', 'rabu', 'kamis', 'jumat', 'sabtu', 'minggu'
        ]:
            if request.form.get(checkHari) is not None:
                if jadwalHari == '':
                    jadwalHari += request.form.get(checkHari)
                else:
                    jadwalHari += ", " + request.form.get(checkHari)
        print("Hari ", jadwalHari)

        for checkBulan in [
                'Jan', 'Feb', 'Mar', 'Apr', 'Mei', 'Jun', 'Jul', 'Agu', 'Sep',
                'Okt', 'Nov', 'Des'
        ]:
            if request.form.get(checkBulan) is not None:
                if jadwalBln == '':
                    jadwalBln += request.form.get(checkBulan)
                else:
                    jadwalBln += ", " + request.form.get(checkBulan)
        print("Bulan ", jadwalBln)

        for checkTgl in [
                't1', 't2', 't3', 't4', 't5', 't6', 't7', 't8', 't9', 't10',
                't11', 't12', 't13', 't14', 't15', 't16', 't17', 't18', 't19',
                't20', 't21', 't22', 't23', 't24', 't25', 't26', 't27', 't28',
                't29', 't30', 't31'
        ]:
            if request.form.get(checkTgl) is not None:
                if jadwalTgl == '':
                    jadwalTgl += request.form.get(checkTgl)
                else:
                    jadwalTgl += ", " + request.form.get(checkTgl)
        print("Tanggal ", jadwalTgl)

        for checkPIC in ms2S.namaPIC():
            #print(checkPIC[0])
            if request.form.get(checkPIC[0]) is not None:
                if reportPIC == '':
                    reportPIC += checkPIC[2]
                else:
                    reportPIC += ", " + checkPIC[2]
        print("PIC ", reportPIC)

        for checkPen in ms2S.namaPenerima():
            #print(checkPen[2])
            if request.form.get(checkPen[2]) is not None:
                if reportPenerima == '':
                    reportPenerima += checkPen[2]
                else:
                    reportPenerima += ", " + checkPen[2]
        print("Penerima ", reportPenerima)

        ms2S.editSchedule(kode_laporan, header, keterangan, note, jadwalBln,
                          jadwalHari, jadwalTgl, reportPIC, reportPenerima,
                          lastUpdate, aktifYN)
        return redirect(url_for('menu'))