def insertfeedback(): if session['loginDictrole'] == 'seller': feedbackDAO = FeedbackDAO() feedbackVO = FeedbackVO() feedbackVO.feedbackSubject = str(request.form["feedbackSubject"]) feedbackVO.feedbackDescription = str( request.form["feedbackDescription"]) feedbackVO.feedbackRating = str(request.form["feedbackRating"]) datetime = time.ctime().split(" ") feedbackVO.feedbackTime = datetime[-2] feedbackVO.feedbackDate = " ".join( [datetime[1], datetime[2], datetime[4]]) feedbackVO.feedbackActivestatus = "active" feedbackVO.feedbackFrom_loginId = str(session['loginDictId']) #feedbackVO.feedback_loginId = str(session['loginDictId']) #print feedbackVO.feedback_loginId feedbackDAO.insertFeedback(feedbackVO) return "vffd"
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)
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)
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 deleteFeedback(): if session['loginRole'] == 'admin': return redirect(url_for('login')) else: feedbackVO = FeedbackVO() feedbackDAO = FeedbackDAO() feedbackVO.feedbackId = request.args.get('feedbackId') feedbackVO.feedbackActiveStatus = 'deactive' feedbackDAO.deleteFeedback(feedbackVO) return redirect(url_for('viewFeedback'))
def viewFeedback(): if session['loginDictrole'] == 'admin': feedbackDAO = FeedbackDAO() feedbackVO = FeedbackVO() feedbackVO.feedbackActiveStatus = 'activate' feedbackDict = feedbackDAO.searchFeedback(feedbackVO) return render_template('admin/viewfeedback.html', data2=feedbackDict) return render_template('admin/signin.html')
def updateFeedback(): if session['loginRole'] != 'admin': return redirect(url_for('login')) else: feedbackDAO = FeedbackDAO() feedbackVO = FeedbackVO() feedbackVO.feedbackId = request.args.get('feedbackId') feedbackVO.feedbackTo_LoginId = session['loginId'] feedbackDAO.updateFeedback(feedbackVO) return redirect(url_for('viewFeedback'))
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 adminViewFeedback(): try: if adminLoginSession() == 'admin': feedbackDAO = FeedbackDAO() feedbackVO = FeedbackVO() feedbackVOList = feedbackDAO.adminViewFeedback() return render_template('admin/viewFeedback.html', feedbackVOList=feedbackVOList) else: adminLogoutSession() except Exception as ex: print(ex)
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)
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 userDeleteFeedback(): try: feedbackVO = FeedbackVO() feedbackDAO = FeedbackDAO() feedbackId = request.args.get("feedbackId") feedbackVO.feedbackId = feedbackId feedbackDAO.deleteFeedback(feedbackVO) return redirect(url_for('userViewFeedback')) except Exception as ex: print(ex)
def userDeleteFeedback(): try: if adminLoginSession() == 'user': feedbackVO = FeedbackVO() feedbackDAO = FeedbackDAO() feedbackId = request.args.get('feedbackId') feedbackVO.feedbackId = feedbackId feedbackDAO.deleteFeedback(feedbackVO) return redirect(url_for('userViewFeedback')) else: return adminLogoutSession() except Exception as ex: print(ex)
def deleteFeedback(): if session['loginDictrole'] == 'seller': feedbackDAO = FeedbackDAO() feedbackVO = FeedbackVO() feedbackVO.feedbackActiveStatus = 'deactivate' feedbackVO.feedbackId = request.args.get('feedbackId') feedbackDAO.deleteFeedback(feedbackVO) return redirect('/viewuserFeedback') else: return render_template('admin/login.html', loginerrorDict='Please login first')
def adminReviewFeedback(): try: feedbackVO = FeedbackVO() feedbackDAO = FeedbackDAO() feedbackId = request.args.get("feedbackId") feedbackTo_LoginId = session['session_loginId'] feedbackVO.feedbackId = feedbackId feedbackVO.feedbackTo_LoginId = feedbackTo_LoginId feedbackDAO.adminReviewFeedback(feedbackVO) return redirect(url_for('adminViewFeedback')) 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')
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 adminUpdateFeedback(): try: if adminLoginSession() == 'admin': feedbackId = request.args.get('feedbackId') feedbackTo_LoginId = session['session_loginId'] feedbackVO = FeedbackVO() feedbackDAO = FeedbackDAO() feedbackVO.feedbackId = feedbackId feedbackVO.feedbackTo_LoginId = feedbackTo_LoginId feedbackDAO.adminUpdateFeedback(feedbackVO) return redirect(url_for('adminViewFeedback')) else: return adminLogoutSession() except Exception as ex: print(ex)
def insertFeedback(): try: if session['sessionloginDict']['loginRole'] == 'user': feedbackDAO = FeedbackDAO() feedbackVO = FeedbackVO() feedbackDescription = request.form['feedbackDescription'] feedbackRating = request.form['feedbackRating'] feedbackVO.feedbackDescription = feedbackDescription feedbackVO.feedbackRating = feedbackRating feedbackVO.feedbackActiveStatus = 'active' return render_template('admin/addFeedback.html') else: flash('Plese Login First !', 'danger') return redirect(url_for('loadLogin')) except: flash('Plese Login First !', 'danger') return redirect(url_for('loadLogin'))
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)
def ViewFeedbackReview(): try: if adminLoginSession() == "bloodbank": feedbackId = request.args.get('feedbackId') feedbackTo_LoginId = session['session_loginId'] print(feedbackId) feedbackVO = FeedbackVO() feedbackDAO = FeedbackDAO() print("####################@@@@@@@@@@@@@@@@@@@@@@@@@") feedbackVO.feedbackId = feedbackId feedbackVO.feedbackTo_LoginId = feedbackTo_LoginId print("@@@@@@@@@@@@@@@@@@@@$$$$$$$$$$$$$$$$$$$$$$$$$") feedbackDAO.viewBloodbankFeedbackReview(feedbackVO) print("^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^") return redirect(url_for('bloodbankViewUserFeedback')) else: return adminLogoutSession() except Exception as ex: print(ex)
def adminViewFeedbackReview(): try: if adminLoginSession() == "admin": feedbackId = request.args.get('feedbackId') feedbackTo_LoginId = session['session_loginId'] print(feedbackId) feedbackVO = FeedbackVO() feedbackDAO = FeedbackDAO() feedbackVO.feedbackId = feedbackId feedbackVO.feedbackTo_LoginId = feedbackTo_LoginId feedbackDAO.viewAdminFeedbackReview(feedbackVO) return redirect(url_for('adminViewFeedback')) else: return adminLogoutSession() except Exception as ex: print(ex)