Exemple #1
0
def userInsertFeedback():
    try:
        if adminLoginSession() == 'user':
            feedbackSubject = request.form['feedbackSubject']
            feedbackDescription = request.form['feedbackDescription']
            feedbackRating = request.form['feedbackRating']
            feedbackDate = date.today()
            feedbackTime = datetime.now().strftime("%H:%M:%S")
            feedbackFrom_LoginId = session['session_loginId']

            feedbackVO = FeedbackVO()
            feedbackDAO = FeedbackDAO()

            feedbackVO.feedbackSubject = feedbackSubject
            feedbackVO.feedbackDescription = feedbackDescription
            feedbackVO.feedbackRating = feedbackRating
            feedbackVO.feedbackDate = feedbackDate
            feedbackVO.feedbackTime = feedbackTime
            feedbackVO.feedbackFrom_LoginId = feedbackFrom_LoginId

            feedbackDAO.insertFeedback(feedbackVO)

            return redirect(url_for('userViewFeedback'))

        else:
            return adminLogoutSession()

    except Exception as ex:
        print(ex)
def userLoadDashboard():
    try:
        if adminLoginSession() == 'user':
            pendingComplainCount = 0
            repliedComplainCount = 0

            loginID = session['session_loginId']
            complainDAO = ComplainDAO()

            complainList = complainDAO.viewComplain(loginID)
            print('complainList>>>>>', complainList)

            for i in complainList:
                if i.complainStatus == 'replied':
                    repliedComplainCount += 1
                elif i.complainStatus == 'Pending':
                    pendingComplainCount += 1

            feedbackVO = FeedbackVO()
            feedbackDAO = FeedbackDAO()
            feedbackVO.feedbackFrom_LoginId = loginID
            feedbackList = feedbackDAO.viewFeedback(feedbackVO)
            feedbackCount = len(feedbackList)

            return render_template('user/index.html',
                                   pendingComplainCount=pendingComplainCount,
                                   repliedComplainCount=repliedComplainCount,
                                   feedbackCount=feedbackCount)
        else:
            return adminLogoutSession()
    except Exception as ex:
        print(ex)
Exemple #3
0
def userInsertFeedback():
    try:

        feedbackSubject = request.form['feedbackSubject']
        feedbackDescription = request.form['feedbackDescription']
        feedbackRating = request.form['feedbackRating']

        feedbackVO = FeedbackVO()
        feedbackDAO = FeedbackDAO()

        todayDate = str(datetime.now().date())
        timeNow = datetime.now().strftime("%H:%M:%S")

        feedbackVO.feedbackFrom_LoginId = session['session_loginId']
        feedbackVO.feedbackSubject = feedbackSubject
        feedbackVO.feedbackDescription = feedbackDescription
        feedbackVO.feedbackRating = feedbackRating
        feedbackVO.feedbackDate = todayDate
        feedbackVO.feedbackTime = timeNow

        feedbackDAO.insertFeedback(feedbackVO)

        return redirect(url_for('userViewFeedback'))

    except Exception as ex:
        print(ex)
Exemple #4
0
def viewUserFeedback():

    if session['loginRole']!= 'user':
        return redirect(url_for('login'))

    feedbackDAO = FeedbackDAO()
    feedbackVO = FeedbackVO()

    feedbackVO.feedbackFrom_LoginId = session['loginId']
    feedbackDict = feedbackDAO.searchFeedbackById(feedbackVO)

    return render_template('user/viewFeedback.html',feedbackDict=feedbackDict)
def userViewFeedback():
    try:
        if adminLoginSession() == "user":
            feedbackDAO = FeedbackDAO()
            feedbackVO = FeedbackVO()
            feedbackFrom_LoginId = session['session_loginId']
            feedbackVO.feedbackFrom_LoginId = feedbackFrom_LoginId
            feedbackVOList = feedbackDAO.userViewFeedback(feedbackVO)
            return render_template('user/viewFeedback.html', feedbackVOList=feedbackVOList)
        else:
            return adminLogoutSession()
    except Exception as ex:
        print(ex)
Exemple #6
0
def userViewFeedback():
    try:
        if adminLoginSession() == 'user':
            feedbackDAO = FeedbackDAO()
            feedbackVO = FeedbackVO()
            feedbackFrom_LoginId = session['session_loginId']
            feedbackVO.feedbackFrom_LoginId = feedbackFrom_LoginId
            feedbackVOList = feedbackDAO.userViewFeedback(feedbackVO)
            print("______________", feedbackVOList)

            return render_template("user/viewFeedback.html", feedbackVOList=feedbackVOList)
        else:
            return redirect(url_for("adminLogoutSession"))
    except Exception as ex:
        print(ex)
def viewFeedback():
    try:
        if session['loginRole'] == 'admin':
            feedbackDAO = FeedbackDAO()
            feedbackDict = feedbackDAO.searchFeedback()
            return render_template('admin/viewFeedback.html',
                                   feedbackDict=feedbackDict)
        else:
            feedbackDAO = FeedbackDAO()
            feedbackVO = FeedbackVO()
            feedbackVO.feedbackFrom_LoginId = session['loginId']
            feedbackDict = feedbackDAO.searchFeedbackById(feedbackVO)
            return render_template('user/viewFeedback.html',
                                   feedbackDict=feedbackDict)
    except:
        return render_template('admin/login.html')
Exemple #8
0
def userViewFeedback():
    try:
        feedbackDAO = FeedbackDAO()
        feedbackVO = FeedbackVO()

        feedbackFrom_LoginId = session['session_loginId']
        print(feedbackFrom_LoginId)
        feedbackVO.feedbackFrom_LoginId = feedbackFrom_LoginId
        print(feedbackVO.feedbackFrom_LoginId)
        feedbackVOList = feedbackDAO.viewFeedback(feedbackVO)
        print("______________", feedbackVOList)

        return render_template('user/viewFeedback.html',
                               feedbackVOList=feedbackVOList)

    except Exception as ex:
        print(ex)
def insertFeedback():
    if session['loginRole'] != 'user':
        return redirect(url_for('login'))

    else:
        feedbackDAO = FeedbackDAO()
        feedbackVO = FeedbackVO()

        feedbackVO.feedbackRating = request.form['feedbackRating']
        feedbackVO.feedbackMessage = request.form['feedbackMessage']
        feedbackVO.feedbackDate, feedbackVO.feedbackTime = str(
            datetime.now()).split(' ')
        feedbackVO.feedbackActiveStatus = 'active'

        feedbackVO.feedbackFrom_LoginId = session['loginId']

        feedbackDAO.insertFeedback(feedbackVO)

        return redirect(url_for('postFeedback'))
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)