Exemplo n.º 1
0
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)
Exemplo n.º 2
0
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)
Exemplo n.º 3
0
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)
Exemplo n.º 4
0
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 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)
Exemplo n.º 6
0
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)
Exemplo n.º 7
0
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)
Exemplo n.º 8
0
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)
Exemplo n.º 9
0
def adminLoadCrossroad():
    if adminLoginSession() == 'admin':

        areaDAO = AreaDAO()
        areaVOList = areaDAO.viewArea()
        print(areaVOList)
        return render_template('admin/addCrossroad.html',
                               areaVOList=areaVOList)
    else:
        return adminLogoutSession()
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)
Exemplo n.º 11
0
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)
Exemplo n.º 12
0
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 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)
Exemplo n.º 14
0
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)
Exemplo n.º 15
0
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)
Exemplo n.º 16
0
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()