Ejemplo n.º 1
0
def viewUserComplain():

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

    complainDAO = ComplainDAO()
    complainVO = ComplainVO()

    complainVO.complainFrom_LoginId = session['loginId']
    complainDict = complainDAO.searchComplainById(complainVO)

    return render_template('user/viewComplain.html',complainDict=complainDict)
Ejemplo 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 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)
Ejemplo n.º 4
0
def userLoadComplain():
    try:
        if adminLoginSession() == 'user':
            complainDAO = ComplainDAO()
            complainVO = ComplainVO()
            complainVO.complainFrom_LoginId = session['session_LoginId']
            complainVOList = complainDAO.viewUserComplain(complainVO)

            return render_template('user/addComplain.html',
                                   complainVOList=complainVOList)

        else:
            adminLogoutSession()
    except Exception as ex:
        print(ex)
Ejemplo n.º 5
0
def UserInsertComplain():
    try:
        if adminLoginSession() == 'user':
            UPLOAD_FOLDER = 'project/static/adminResources/complain/'
            app.config['UPLOAD_FOLDER'] = UPLOAD_FOLDER

            complainSubject = request.form['complainSubject']
            complainDescription = request.form['complainDescription']
            file = request.files['complainFile']

            now = datetime.now()
            complainDate = now.strftime("%d/%m/%Y")
            complainTime = now.strftime("%H:%M:%S")
            complainStatus = 'Pending'

            complainDAO = ComplainDAO()
            complainVO = ComplainVO()

            print(file)

            complainFileName = secure_filename(file.filename)
            print(complainFileName)

            complainFilePath = os.path.join(app.config['UPLOAD_FOLDER'])
            print(complainFilePath)

            file.save(os.path.join(complainFilePath, complainFileName))

            complainVO.complainSubject = complainSubject
            complainVO.complainDescription = complainDescription
            complainVO.complainDate = complainDate
            complainVO.complainTime = complainTime
            complainVO.complainFileName = complainFileName
            complainVO.complainFilePath = complainFilePath.replace(
                "project", "..")
            complainVO.complainStatus = complainStatus
            complainVO.complainFrom_LoginId = session['session_loginId']

            # print("just before insert")
            complainDAO.insertComplain(complainVO)

            return redirect(url_for('UserViewComplain'))

        else:
            return adminLogoutSession()

    except Exception as ex:
        print(ex)
Ejemplo n.º 6
0
def userInsertComplain():
    try:
        if adminLoginSession() == "user":

            complainVO = ComplainVO()
            complainDAO = ComplainDAO()

            complainSubject = request.form['complainSubject']
            complainDescription = request.form['complainDescription']

            file = request.files['file']
            print(file)

            complainFileName = secure_filename(file.filename)
            print(complainFileName)

            complainFilePath = os.path.join(
                app.config['UPLOAD_FOLDER_USER_COMPLAIN'])
            print(complainFilePath)

            now = datetime.now()
            complainDate = now.strftime("%d/%m/%Y")
            complainTime = now.strftime("%H:%M:%S")

            file.save(os.path.join(complainFilePath, complainFileName))

            complainVO.complainSubject = complainSubject
            complainVO.complainDescription = complainDescription

            complainVO.complainFileName = complainFileName

            complainVO.complainFilePath = complainFilePath.replace(
                "project", "..")

            complainVO.complainDate = complainDate
            complainVO.complainTime = complainTime

            complainVO.complainStatus = 'Pending'

            complainVO.complainFrom_LoginId = session['session_loginId']

            complainDAO.insertComplain(complainVO)

            return redirect(url_for('userLoadComplaint'))
        else:
            return adminLogoutSession()
    except Exception as ex:
        print(ex)
Ejemplo n.º 7
0
def insertComplain():
    if session['loginRole'] != 'user':
        return redirect(url_for('login'))

    complainDAO = ComplainDAO()
    complainVO = ComplainVO()

    complainVO.complainSubject = request.form['complainSubject']
    complainVO.complainDescription = request.form['complainDescription']
    complainVO.complainDate, complainVO.complainTime = str(datetime.now()).split(' ')
    complainVO.complainStatus = 'pending'
    complainVO.complainActiveStatus = 'active'
    complainVO.complainFrom_LoginId = session['loginId']

    complainDAO.insertComplain(complainVO)

    return redirect(url_for('complain'))
def userinsertComplain():
    try:
        if adminLoginSession() == 'user':

            complainVO = ComplainVO()
            complainDAO = ComplainDAO()

            complainSubject = request.form['complainSubject']
            complainDescription = request.form['complainDescription']
            complainFrom_LoginId = session['session_loginId']

            file = request.files['file']
            print(file)

            complainFileName = secure_filename(file.filename)
            print(complainFileName)

            complainFilePath = os.path.join(app.config['UPLOAD_FOLDER_COMPLAIN'])
            print(complainFilePath)

            file.save(os.path.join(complainFilePath, complainFileName))

            complainDate = datetime.date(datetime.now())
            complainTime = datetime.time(datetime.now())
            complainStatus = 'PENDING'

            complainVO.complainSubject = complainSubject
            complainVO.complainDescription = complainDescription
            complainVO.complainDate = complainDate
            complainVO.complainTime = complainTime
            complainVO.complainStatus = complainStatus
            complainVO.complainFileName = complainFileName
            complainVO.complainFilePath = complainFilePath.replace("project", "..")

            complainVO.complainFrom_LoginId = complainFrom_LoginId

            complainDAO.insertComplain(complainVO)

            return redirect(url_for('userviewComplain'))

        else:
            return adminLogoutSession()

    except Exception as ex:
        print(ex)
Ejemplo n.º 9
0
def userLoadComplaint():
    try:
        if adminLoginSession() == "user":
            #_____________________________________________COMPLAIN_________________________________________________
            complainDAO = ComplainDAO()
            complainVO = ComplainVO()

            complainVO.complainFrom_LoginId = session['session_loginId']

            complainVOList = complainDAO.viewComplain(complainVO)
            #_____________________________________________COMPLAIN_REPLY____________________________________________

            return render_template('user/addComplain.html',
                                   complainVOList=complainVOList)
        else:
            return adminLogoutSession()
    except Exception as ex:
        print(ex)
def userViewComplain():
    try:
        if adminLoginSession() == 'user':
            complainVO = ComplainVO()
            complainDAO = ComplainDAO()

            complainVO.complainFrom_LoginId = session['session_loginId']

            complainList = complainDAO.viewComplain(complainVO)

            # print("__________________", complainVOList)

            return render_template('user/viewComplain.html',
                                   complainList=complainList)
        else:
            return redirect('/admin/logoutSession')
    except Exception as ex:
        print(ex)
def userInsertComplain():
    try:
        if adminLoginSession() == 'user':
            complainDAO = ComplainDAO()
            complainVO = ComplainVO()

            complainSubject = request.form['complainSubject']
            complainDescription = request.form['complainDescription']

            complainDate = datetime.today().strftime("%d/%m/%Y")

            complainTime = datetime.now().strftime("%H:%M:%S")

            complainStatus = 'Pending'

            file = request.files['file']

            complainFileName = secure_filename(file.filename)

            complainFilePath = os.path.join(
                app.config['COMPLAIN_UPLOAD_FOLDER'])

            file.save(os.path.join(complainFilePath, complainFileName))

            complainFrom_LoginId = session['session_loginId']

            complainVO.complainSubject = complainSubject
            complainVO.complainDescription = complainDescription
            complainVO.complainDate = complainDate
            complainVO.complainTime = complainTime
            complainVO.complainStatus = complainStatus
            complainVO.complainFileName = complainFileName
            complainVO.complainFilePath = complainFilePath.replace(
                'project', '..')
            complainVO.complainFrom_LoginId = complainFrom_LoginId

            complainDAO.userInsertComplain(complainVO)

            return redirect(url_for('userViewComplain'))
        else:
            return adminLogoutSession()

    except Exception as ex:
        print(ex)
Ejemplo n.º 12
0
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)
Ejemplo n.º 13
0
def userInsertComplain():
    try:
        if adminLoginSession() == 'user':
            complainVO = ComplainVO()
            complainDAO = ComplainDAO()

            complainSubject = request.form['complainSubject']
            complainDescription = request.form['complainDescription']
            complainFile = request.files['complainFile']
            uploadTime = datetime.now().strftime("%H:%M:%S")
            uploadDate = date.today()
            # setting complain attachment folder
            UPLOAD_FOLDER = 'project/static/userResources/complain/'  # setting path of storage data
            app.config[
                'UPLOAD_FOLDER'] = UPLOAD_FOLDER  # update config path of folder
            complainFilename = secure_filename(complainFile.filename)
            complainFilePath = os.path.join(
                app.config['UPLOAD_FOLDER'])  # setting value in variable
            complainFile.save(os.path.join(complainFilePath, complainFilename))
            complainFilePath = complainFilePath.replace("project", "..")

            complainVO.complainSubject = complainSubject
            complainVO.complainDescription = complainDescription
            complainVO.complainFilename = complainFilename
            complainVO.complainFilePath = str(complainFilePath)
            complainVO.complainDate = uploadDate
            complainVO.complainTime = uploadTime
            complainVO.complainStatus = 'pending'
            complainVO.complainFrom_LoginId = session['session_LoginId']
            complainDAO.insertComplain(complainVO)

            return redirect(url_for('userLoadComplain'))
        else:
            adminLogoutSession()
    except Exception as ex:
        print(ex)