def adminAjaxGetGraphData(): appointmentVO = AppointmentVO() appointmentDAO = AppointmentDAO() index_BloodbankId = request.args.get('index_BloodbankId') appointmentVO.appointment_BloodBankId = index_BloodbankId ajaxGraphDataList = appointmentDAO.ajaxGetGraphData(appointmentVO) print("ajaxGraphDataList >>>>>>>>>>>>>>>>>> ", ajaxGraphDataList) graphDict = {} counter = False if len(ajaxGraphDataList) != 0: counter = True dict1 = {} for i in ajaxGraphDataList: dict1[i[0]] = i[1] graphDict.update(dict1) print('graphDict>>>', graphDict) if counter: response = {'responseKey': graphDict} print('response>>>>>>>>', response) else: response = {'responseKey': 'Error'} return jsonify(response)
def bloodbankViewAppointment(): try: if adminLoginSession() == "bloodbank": appointmentVO = AppointmentVO() appointmentDAO = AppointmentDAO() bloodBankDAO = BloodBankDAO() loginId = session['session_loginId'] bloodBankVOList = bloodBankDAO.getBloodBank(loginId) bloodBankDictList = [i.as_dict() for i in bloodBankVOList] appointment_BloodBankId = bloodBankDictList[0]['bloodBankId'] appointmentVO.appointment_BloodBankId = appointment_BloodBankId print(appointment_BloodBankId) appointmentVOList = appointmentDAO.viewAppointmentByBloodBank( appointmentVO) print("11111111111111:", appointmentVOList) return render_template('bloodbank/viewAppointment.html', appointmentVOList=appointmentVOList) else: return adminLogoutSession() except Exception as ex: print(ex)
def adminViewDonationRequest(): try: if adminLoginSession() == "admin": appointmentDAO = AppointmentDAO() appointmentVOList = appointmentDAO.viewAppointmentByAdmin() return render_template('admin/viewAppointment.html', appointmentVOList=appointmentVOList) else: return adminLogoutSession() except Exception as ex: print(ex)
def userViewAppointment(): try: if adminLoginSession() == "user": appointmentVO = AppointmentVO() appointmentDAO = AppointmentDAO() appointmentVO.appointment_LoginId = session['session_loginId'] appointmentVOList = appointmentDAO.viewAppointmentByUser( appointmentVO) return render_template('user/viewAppointment.html', appointmentVOList=appointmentVOList) else: return adminLogoutSession() except Exception as ex: print(ex)
def userLoadDashboard(): try: if adminLoginSession() == 'user': appointmentVO = AppointmentVO() appointmentDAO = AppointmentDAO() loginId = session['session_loginId'] appointmentVO.appointment_LoginId = loginId appointmentVOList = appointmentDAO.getAppointmentDetailsByLoginId(appointmentVO) print('appointmentVOList>>>>>', appointmentVOList) return render_template('user/index.html', appointmentVOList=appointmentVOList) else: return adminLogoutSession() except Exception as ex: print(ex)
def bloodbankLoadDashboard(): try: if adminLoginSession() == 'bloodbank': bloodbankDAO = BloodBankDAO() loginId = session['session_loginId'] bloodBankVOList = bloodbankDAO.getBloodBank(loginId) appointmentVO = AppointmentVO() appointmentDAO = AppointmentDAO() appointmentVO.appointment_BloodBankId = bloodBankVOList[0].bloodBankId appointmentVOList = appointmentDAO.getAppointmentDetailsByBloodBankId(appointmentVO) return render_template('bloodbank/index.html', appointmentVOList=appointmentVOList) else: return adminLogoutSession() except Exception as ex: print(ex)
def bloodbankRejectAppointment(): try: if adminLoginSession() == "bloodbank": appointmentVO = AppointmentVO() appointmentDAO = AppointmentDAO() appointmentId = request.args.get('appointmentId') appointmentStatus = 'Rejected' print("222222222222222222222:", appointmentId) appointmentVO.appointmentId = appointmentId appointmentVO.appointmentStatus = appointmentStatus appointmentDAO.updateAppointment(appointmentVO) return redirect(url_for('bloodbankViewAppointment')) else: return adminLogoutSession() except Exception as ex: print(ex)
def userInsertAppointment(): try: if adminLoginSession() == "user": appointmentType = request.form['appointmentType'] appointment_BloodGroupId = request.form['appointment_BloodGroupId'] print("11111111") appointment_CityId = request.form['appointment_CityId'] appointment_AreaId = request.form['appointment_AreaId'] print("2222222222") appointment_BloodBankId = request.form['appointment_BloodBankId'] appointment_TimeSlotId = request.form['appointment_TimeSlotId'] appointmentDate = request.form['appointmentDate'] appointmentStatus = 'Pending' print("3333333333333") appointmentVO = AppointmentVO() appointmentDAO = AppointmentDAO() print("44444444444444") appointmentVO.appointmentType = appointmentType appointmentVO.appointment_AreaId = appointment_AreaId print("55555555555") appointmentVO.appointment_BloodBankId = appointment_BloodBankId appointmentVO.appointment_BloodGroupId = appointment_BloodGroupId appointmentVO.appointment_CityId = appointment_CityId appointmentVO.appointment_TimeSlotId = appointment_TimeSlotId appointmentVO.appointmentDate = appointmentDate appointmentVO.appointmentStatus = appointmentStatus appointmentVO.appointment_LoginId = session['session_loginId'] print("666666666666666666") appointmentDAO.insertAppointment(appointmentVO) print("7777777777777") return redirect(url_for('userViewAppointment')) else: return adminLogoutSession() except Exception as ex: print(ex)