def userViewComplain():
    try:
        if adminLoginSession() == "user":
            complainDAO = ComplainDAO()
            complainVO = ComplainVO()
            complainFrom_LoginId = session['session_loginId']
            complainVO.complainFrom_LoginId = complainFrom_LoginId
            complainVOList = complainDAO.userViewComplain(complainVO)
            return render_template('user/viewComplain.html',
                                   complainVOList=complainVOList)
        else:
            return adminLogoutSession()
    except Exception as ex:
        print(ex)
Exemplo n.º 2
0
def UserViewComplain():
    try:
        if adminLoginSession() == 'user':
            complainDAO = ComplainDAO()
            complainVO = ComplainVO()
            complainVO.complainFrom_LoginId = session['session_loginId']
            complainVOlist = complainDAO.userViewComplain(complainVO)
            return render_template('user/viewComplain.html',
                                   complainVOlist=complainVOlist)

        elif adminLoginSession() == 'admin':
            pass
    except Exception as ex:
        print(ex)
def userLoadDashboard():
    try:
        if adminLoginSession() == 'user':
            complainVO = ComplainVO()
            complainDAO = ComplainDAO()

            feedbackVO = FeedbackVO()
            feedbackDAO = FeedbackDAO()

            pendingComplainCount = 0
            repliedComplainCount = 0
            totalFeedbackCount = 0
            reviewFeedbackCount = 0

            loginId = session['session_loginId']
            complainVO.complainFrom_LoginId = loginId

            complainVOList = complainDAO.userViewComplain(complainVO)

            for i in complainVOList:
                if i.complainStatus == 'Pending':
                    pendingComplainCount += 1
                elif i.complainStatus == 'Replied':
                    repliedComplainCount += 1

            feedbackVO.feedbackFrom_LoginId = loginId
            feedbackVOList = feedbackDAO.userViewFeedback(feedbackVO)

            for i in feedbackVOList:
                if i.feedbackTo_LoginId is not None:
                    reviewFeedbackCount += 1
                totalFeedbackCount += 1

            return render_template('user/Index.html',
                                   pendingComplainCount=pendingComplainCount,
                                   repliedComplainCount=repliedComplainCount,
                                   totalFeedbackCount=totalFeedbackCount,
                                   reviewFeedbackCount=reviewFeedbackCount)
        else:
            return adminLogoutSession()
    except Exception as ex:
        print(ex)