def userEditProfile(): try: if adminLoginSession() == "user": areaDAO = AreaDAO() areaVOList = areaDAO.viewArea() print(areaVOList) cityDAO = CityDAO() cityVOList = cityDAO.viewCity() print(cityVOList) bloodGroupDAO = BloodGroupDAO() bloodGroupVOList = bloodGroupDAO.viewBloodGroup() print(bloodGroupVOList) userDAO = UserDAO() loginId = session['session_loginId'] userVOList = userDAO.getUserData(loginId) userVOAllList = userDAO.getUserAllData(loginId) print("@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@") print(userVOList) return render_template('user/editProfile.html', userVOList=userVOList, userVOAllList=userVOAllList, areaVOList=areaVOList, cityVOList=cityVOList, bloodGroupVOList=bloodGroupVOList) else: return adminLogoutSession() except Exception as ex: print(ex)
def bloodBankEditProfile(): try: if adminLoginSession() == "bloodbank": cityDAO = CityDAO() cityVOList = cityDAO.viewCity() print(cityVOList) areaDAO = AreaDAO() areaVOList = areaDAO.viewArea() loginId = session['session_loginId'] bloodBankDAO = BloodBankDAO() bloodBankVOList = bloodBankDAO.getBloodbankData(loginId) bloodBankVOAllList = bloodBankDAO.getBloodBank(loginId) return render_template('bloodbank/editProfile.html', areaVOList=areaVOList, cityVOList=cityVOList, bloodBankVOList=bloodBankVOList, bloodBankVOAllList=bloodBankVOAllList) else: return adminLogoutSession() except Exception as ex: print(ex)
def adminEditTrafficPoliceStation(): try: if adminLoginSession() == 'admin': trafficPoliceStationVO = TrafficPoliceStationVO() trafficPoliceStationDAO = TrafficPoliceStationDAO() loginVO = LoginVO() loginDAO = LoginDAO() areaDAO = AreaDAO() trafficPoliceStationId = request.args.get('trafficPoliceStationId') trafficPoliceStation_LoginId = request.args.get( 'trafficPoliceStation_LoginId') trafficPoliceStationVO.trafficPoliceStationId = trafficPoliceStationId loginVO.loginId = trafficPoliceStation_LoginId trafficPoliceStationVOList = trafficPoliceStationDAO.editTrafficPoliceStation( trafficPoliceStationVO) loginVOList = loginDAO.editLogin(loginVO) areaVOList = areaDAO.viewArea() return render_template( 'admin/editTrafficPoliceStation.html', trafficPoliceStationVOList=trafficPoliceStationVOList, areaVOList=areaVOList, loginVOList=loginVOList) else: adminLogoutSession() except Exception as ex: print(ex)
def userLoadAppointment(): try: if adminLoginSession() == "user": cityDAO = CityDAO() cityVOList = cityDAO.viewCity() areaDAO = AreaDAO() areaVOList = areaDAO.viewArea() bloodBankDAO = BloodBankDAO() bloodBankVOList = bloodBankDAO.viewAdminBloodBank() bloodGroupDAO = BloodGroupDAO() bloodGroupVOList = bloodGroupDAO.viewBloodGroup() timeSlotDAO = TimeSlotDAO() timeSlotVOList = timeSlotDAO.viewTimeSlot() return render_template('user/addAppointment.html', cityVOList=cityVOList, areaVOList=areaVOList, bloodBankVOList=bloodBankVOList, bloodGroupVOList=bloodGroupVOList, timeSlotVOList=timeSlotVOList) else: return adminLogoutSession() except Exception as ex: print(ex)
def adminEditTrafficPoliceStation(): try: if adminLoginSession() == 'admin': trafficPoliceStationVO = TrafficPoliceStationVO() trafficPoliceStationDAO = TrafficPoliceStationDAO() trafficPoliceStationId = request.args.get('trafficPoliceStationId') trafficPoliceStationVO.trafficPoliceStationId = trafficPoliceStationId trafficPoliceStationVOList = trafficPoliceStationDAO.editTrafficPoliceStation(trafficPoliceStationVO) areaDAO = AreaDAO() areaVOList = areaDAO.viewArea() print("=======trafficPoliceStationVOList=======", trafficPoliceStationVOList) print("=======type of trafficPoliceStationVOList=======", type(trafficPoliceStationVOList)) return render_template('admin/editTrafficPoliceStation.html', trafficPoliceStationVOList=trafficPoliceStationVOList, areaVOList=areaVOList) else: return adminLogoutSession() except Exception as ex: print(ex)
def adminEditCamera(): try: if adminLoginSession() == 'admin': print('in adminEditCamera') cameraVO = CameraVO() cameraDAO = CameraDAO() cameraId = request.args.get('cameraId') cameraVO.cameraId = cameraId cameraVOList = cameraDAO.editCamera(cameraVO) areaDAO = AreaDAO() crossroadDAO = CrossroadDAO() areaVOList = areaDAO.viewArea() crossroadVOList = crossroadDAO.viewCrossroad() print("=======cameraVOList=======", cameraVOList, areaVOList, crossroadVOList) print("=======type of cameraVOList=======", type(cameraVOList)) return render_template('admin/editCamera.html', cameraVOList=cameraVOList, crossroadVOList=crossroadVOList, areaVOList=areaVOList) else: return adminLogoutSession() except Exception as ex: print(ex)
def adminEditCamera(): try: if adminLoginSession() == 'admin': cameraVO = CameraVO() cameraDAO = CameraDAO() # getting data from template cameraId cameraId = request.args.get('cameraId') cameraVO.cameraId = cameraId cameraVOList = cameraDAO.editCamera(cameraVO) # getting data of Area from database areaDAO = AreaDAO() crossroadDAO = CrossroadDAO() areaVOList = areaDAO.viewArea() crossroadVOList = crossroadDAO.viewCrossroad() return render_template('admin/editCamera.html', cameraVOList=cameraVOList, crossroadVOList=crossroadVOList, areaVOList=areaVOList) else: adminLogoutSession() except Exception as ex: print(ex)
def adminLoadDashboard(): try: if adminLoginSession() == 'admin': feedbackDAO = FeedbackDAO() feedbackCount = feedbackDAO.adminFeedbackCount() complainDAO = ComplainDAO() complainCount = complainDAO.adminComplainCount() areaDAO = AreaDAO() areaCount = areaDAO.adminAreaCount() cameraDAO = CameraDAO() camaraCount = cameraDAO.adminCameraCount() trafficPoliceStationDAO = TrafficPoliceStationDAO() trafficPoliceStationVOList = trafficPoliceStationDAO.viewTrafficPoliceStation() print('TPSL >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> ', trafficPoliceStationVOList) return render_template('admin/index.html', trafficPoliceStationVOList=trafficPoliceStationVOList, feedbackCount=feedbackCount,complainCount=complainCount, areaCount=areaCount, camaraCount=camaraCount) else: adminLogoutSession() except Exception as ex: print(ex)
def adminLoadCrossroad(): if adminLoginSession() == 'admin': areaDAO = AreaDAO() areaVOList = areaDAO.viewArea() print(areaVOList) return render_template('admin/addCrossroad.html', areaVOList=areaVOList) else: return adminLogoutSession()
def adminLoadCrossroad(): try: if adminLoginSession() == 'admin': areaDAO = AreaDAO() areaVOList = areaDAO.viewArea() return render_template('admin/addCrossroad.html', areaVOList=areaVOList) # ,registerVOList else: adminLogoutSession() except Exception as ex: print(ex)
def adminLoadRegister(): try: if adminLoginSession() == 'admin': areaDAO = AreaDAO() areaVOList = areaDAO.viewArea() return render_template("admin/addTrafficPoliceStation.html", areaVOList=areaVOList) else: adminLogoutSession() except Exception as ex: print(ex)
def adminViewArea(): try: if adminLoginSession() == 'admin': areaDAO = AreaDAO() areaVOList = areaDAO.viewArea() print("__________________", areaVOList) return render_template('admin/viewArea.html', areaVOList=areaVOList) else: return adminLogoutSession() except Exception as ex: print(ex)
def bloodbankLoadBloodBank(): try: cityDAO = CityDAO() cityVOList = cityDAO.viewCity() print(cityVOList) areaDAO = AreaDAO() areaVOList = areaDAO.viewArea() return render_template('bloodbank/register.html', areaVOList=areaVOList, cityVOList=cityVOList) except Exception as ex: print(ex)
def adminDeleteArea(): try: if adminLoginSession() == "admin": areaDAO = AreaDAO() areaId = request.args.get('areaId') areaDAO.deleteArea(areaId) return redirect(url_for('adminViewArea')) else: return adminLogoutSession() except Exception as ex: print(ex)
def adminViewArea(): try: areaDAO = AreaDAO() areaVOList = areaDAO.viewArea() length = len(areaVOList) print("__________________", areaVOList) return render_template('admin/viewArea.html', areaVOList=areaVOList, data=length) except Exception as ex: print(ex)
def adminLoadCamera(): try: if adminLoginSession() == 'admin': areaDAO = AreaDAO() crossroadDAO = CrossroadDAO() areaVOList = areaDAO.viewArea() crossroadVOList = crossroadDAO.viewCrossroad() return render_template('admin/addCamera.html', crossroadVOList=crossroadVOList, areaVOList=areaVOList) else: adminLogoutSession() except Exception as ex: print(ex)
def adminDeleteArea(): try: areaVO = AreaVO() areaDAO = AreaDAO() areaId = request.args.get('areaId') areaVO.areaId = areaId areaDAO.deleteArea(areaVO) return redirect(url_for('adminViewArea')) except Exception as ex: print(ex)
def adminInsertArea(): try: areaName = request.form['areaName'] areaPincode = request.form['areaPincode'] areaVO = AreaVO() areaDAO = AreaDAO() areaVO.areaName = areaName areaVO.areaPincode = areaPincode areaDAO.insertArea(areaVO) return redirect(url_for('adminViewArea')) except Exception as ex: print(ex)
def userAjaxAreaAppointment(): try: areaVO = AreaVO() areaDAO = AreaDAO() area_CityId = request.args.get('appointment_CityId') print('area_CityId::', area_CityId) areaVO.area_CityId = area_CityId ajaxBloodBankAreaList = areaDAO.ajaxArea(areaVO) ajaxBloodBankAreaJson = [i.as_dict() for i in ajaxBloodBankAreaList] return jsonify(ajaxBloodBankAreaJson) except Exception as ex: print(ex)
def adminInsertArea(): try: if adminLoginSession() == 'admin': areaName = request.form['areaName'] areaPincode = request.form['areaPincode'] areaVO = AreaVO() areaDAO = AreaDAO() areaVO.areaName = areaName areaVO.areaPincode = areaPincode areaDAO.insertArea(areaVO) return redirect(url_for('adminViewArea')) else: return adminLogoutSession() except Exception as ex: print(ex)
def adminEditArea(): try: areaVO = AreaVO() areaDAO = AreaDAO() areaId = request.args.get('areaId') areaVO.areaId = areaId areaVOList = areaDAO.editArea(areaVO) print("=======areaVOList=======", areaVOList) print("=======type of areaVOList=======", type(areaVOList)) return render_template('admin/editArea.html', areaVOList=areaVOList) except Exception as ex: print(ex)
def adminEditArea(): try: if adminLoginSession() == 'admin': areaVO = AreaVO() areaDAO = AreaDAO() areaId = request.args.get('areaId') areaVO.areaId = areaId areaVOList = areaDAO.editArea(areaVO) return render_template('admin/editArea.html', areaVOList=areaVOList) else: adminLogoutSession() except Exception as ex: print(ex)
def userLoadUser(): try: areaDAO = AreaDAO() areaVOList = areaDAO.viewArea() print(areaVOList) cityDAO = CityDAO() cityVOList = cityDAO.viewCity() print(cityVOList) bloodGroupDAO = BloodGroupDAO() bloodGroupVOList = bloodGroupDAO.viewBloodGroup() print(bloodGroupVOList) return render_template('user/register.html', areaVOList=areaVOList, cityVOList=cityVOList, bloodGroupVOList=bloodGroupVOList) except Exception as ex: print(ex)
def userAjaxAreaUser(): try: areaVO = AreaVO() areaDAO = AreaDAO() area_CityId = request.args.get('user_CityId') print('area_CityId::', area_CityId) areaVO.area_CityId = area_CityId ajaxUserAreaList = areaDAO.ajaxArea(areaVO) print('ajaxUserAreaList::', ajaxUserAreaList) ajaxUserAreaJson = [i.as_dict() for i in ajaxUserAreaList] print('ajaxUserAreaJson::', ajaxUserAreaJson) return jsonify(ajaxUserAreaJson) except Exception as ex: print(ex)
def adminEditCrossroad(): if adminLoginSession() == 'admin': crossroadVO = CrossroadVO() crossroadDAO = CrossroadDAO() areaDAO = AreaDAO() crossroadId = request.args.get('crossroadId') crossroadVO.crossroadId = crossroadId crossroadVOList = crossroadDAO.editCrossroad(crossroadVO) areaVOList = areaDAO.viewArea() return render_template('admin/editCrossroad.html', areaVOList=areaVOList, crossroadVOList=crossroadVOList) else: return adminLogoutSession()
def adminUpdateArea(): try: if adminLoginSession() == "admin": areaName = request.form['areaName'] areaPincode = request.form['areaPincode'] area_CityId = request.form['area_CityId'] areaId = request.form['areaId'] areaVO = AreaVO() areaDAO = AreaDAO() areaVO.areaId = areaId areaVO.areaName = areaName areaVO.areaPincode = areaPincode areaVO.area_CityId = area_CityId areaDAO.updateArea(areaVO) return redirect(url_for('adminViewArea')) else: return adminLogoutSession() except Exception as ex: print(ex)
def adminEditArea(): try: if adminLoginSession() == "admin": areaVO = AreaVO() areaDAO = AreaDAO() cityDAO = CityDAO() areaId = request.args.get('areaId') areaVO.areaId = areaId areaVOList = areaDAO.editArea(areaVO) cityVOList = cityDAO.viewCity() return render_template('admin/editArea.html', cityVOList=cityVOList, areaVOList=areaVOList) else: return adminLogoutSession() except Exception as ex: print(ex)