def adminViewPurchase(): try: if adminLoginSession() == 'admin': purchaseDAO = PurchaseDAO() purchaseVOList = purchaseDAO.viewPurchase() print("__________________", purchaseVOList) loginVO = LoginVO() loginDAO = LoginDAO() packageVO = PackageVO() packageDAO = PackageDAO() purchaseDictList = [i.as_dict() for i in purchaseVOList] print('$$$$$$$$$$$$$$$$', purchaseDictList) loginVO.loginId = purchaseDictList[0]['purchase_loginId'] packageVO.packageId = purchaseDictList[0]['purchase_packageId'] packageVOList = packageDAO.viewUserPackage(packageVO) loginVOList = loginDAO.registerLogin(loginVO) print('ok') return render_template('admin/viewPurchase.html', purchaseVOList=purchaseVOList, packageVOList=packageVOList, loginVOList=loginVOList) else: adminLogoutSession() except Exception as ex: print(ex)
def adminEditPackage(): try: if adminLoginSession() == 'admin': packageVO = PackageVO() packageDAO = PackageDAO() packageId = request.args.get('packageId') packageVO.packageId = packageId packageVOList = packageDAO.editPackage(packageVO) print("=======packageVOList=======", packageVOList) print("=======type of packageVOList=======", type(packageVOList)) return render_template('admin/editPackage.html', packageVOList=packageVOList) else: return adminLogoutSession() except Exception as ex: print(ex)
def adminUpdatePackage(): try: if adminLoginSession() == 'admin': packageId = request.form['packageId'] packageName = request.form['packageName'] packageDuration = request.form['packageDuration'] packagePrice = request.form['packagePrice'] packageVO = PackageVO() packageDAO = PackageDAO() packageVO.packageId = packageId packageVO.packageName = packageName packageVO.packageDuration = packageDuration packageVO.packagePrice = packagePrice packageDAO.updatePackage(packageVO) return redirect(url_for('adminViewPackage')) else: return adminLogoutSession() except Exception as ex: print(ex)
def userViewPackage(): try: packageDAO = PackageDAO() packageVOList = packageDAO.viewPackage() print("__________________", packageVOList) return render_template('user/viewPackage.html', packageVOList=packageVOList) except Exception as ex: print(ex)
def userViewPackage(): try: if adminLoginSession() == 'user': packageDAO = PackageDAO() packageVOList = packageDAO.viewPackage() return render_template('user/viewPackage.html', packageVOList=packageVOList) else: return redirect(url_for('adminLogoutSession')) except Exception as ex: print(ex)
def adminViewPackage(): try: if adminLoginSession() == 'admin': packageDAO = PackageDAO() packageVOList = packageDAO.viewPackage() return render_template('admin/viewPackage.html', packageVOList=packageVOList) else: adminLogoutSession() except Exception as ex: print(ex)
def userLoadPurchase(): try: if adminLoginSession() == 'user': packageDAO = PackageDAO() packageVOList = packageDAO.viewPackage() return render_template('user/addPurchase.html', packageVOList=packageVOList) else: adminLogoutSession() except Exception as ex: print(ex)
def adminDeletePackage(): try: if adminLoginSession() == 'admin': packageVO = PackageVO() packageDAO = PackageDAO() packageId = request.args.get('packageId') packageVO.packageId = packageId packageDAO.deletePackage(packageVO) return redirect(url_for('adminViewPackage')) else: adminLogoutSession() except Exception as ex: print(ex)
def userViewPurchase(): try: if adminLoginSession() == 'user': purchaseDAO = PurchaseDAO() purchaseVO = PurchaseVO() packageVO = PackageVO() packageDAO = PackageDAO() purchaseVO.purchase_loginId = session['session_LoginId'] purchaseVOList = purchaseDAO.viewUserPurchase(purchaseVO) print("__________________", purchaseVOList) purchaseDictList = [i.as_dict() for i in purchaseVOList] print(purchaseDictList) packageVO.packageId = purchaseDictList[0]['purchase_packageId'] packageVOList = packageDAO.viewUserPackage(packageVO) print("__________________", packageVOList) return render_template('user/viewPurchase.html', purchaseVOList=purchaseVOList, packageVOList=packageVOList) else: adminLogoutSession() except Exception as ex: print(ex)