def userInsertPurchase(): try: if adminLoginSession() == 'user': purchase_LoginId = session.get('session_loginId') purchase_PackageId = request.args.get('packageId') purchaseDate = date.today() print(purchaseDate) purchaseTime = datetime.now().strftime("%H:%M:%S") print(purchaseTime) purchaseVO = PurchaseVO() purchaseDAO = PurchaseDAO() purchaseVO.purchaseDate = purchaseDate purchaseVO.purchaseTime = purchaseTime purchaseVO.purchase_LoginId = purchase_LoginId purchaseVO.purchase_PackageId = purchase_PackageId purchaseDAO.insertPurchase(purchaseVO) return redirect(url_for('userViewPurchase')) else: return redirect(url_for('adminLogoutSession')) except Exception as ex: print(ex)
def userinsertPurchase(): try: if adminLoginSession() == 'user': purchaseVO = PurchaseVO() purchaseDAO = PurchaseDAO() purchase_LoginId = session['session_loginId'] purchaseDate = datetime.date(datetime.now()) purchaseTime = datetime.time(datetime.now()) purchase_PackageId = request.args.get('purchase_PackageId') purchaseVO.purchase_LoginId = purchase_LoginId purchaseVO.purchaseDate = purchaseDate purchaseVO.purchaseTime = purchaseTime purchaseVO.purchase_PackageId = purchase_PackageId purchaseDAO.insertPurchase(purchaseVO) return redirect(url_for('userViewPurchase')) else: return adminLogoutSession() except Exception as ex: print(ex)
def userViewPurchase(): try: purchaseDAO = PurchaseDAO() purchaseVO = PurchaseVO() purchaseVO.purchase_LoginId = session['session_loginId'] purchaseVOList = purchaseDAO.viewUserPurchase(purchaseVO) print("__________________", purchaseVOList) return render_template('user/viewPurchase.html', purchaseVOList=purchaseVOList) except Exception as ex: print(ex)
def userViewPurchase(): try: if adminLoginSession() == 'user': purchaseDAO = PurchaseDAO() purchaseVO = PurchaseVO() purchase_LoginId = session.get('session_loginId') purchaseVO.purchase_LoginId = purchase_LoginId purchaseVOList = purchaseDAO.userViewPurchase(purchaseVO) return render_template('user/viewPurchase.html', purchaseVOList=purchaseVOList) else: return adminLogoutSession() except Exception as ex: print(ex)
def adminViewPurchase(): try: if adminLoginSession() == 'admin': purchaseDAO = PurchaseDAO() purchaseVO = PurchaseVO() loginVO = LoginVO() purchase_LoginId = session['session_loginId'] purchaseVO.purchase_LoginId = purchase_LoginId purchaseVOList = purchaseDAO.viewPurchase_Admin() return render_template('admin/viewPurchase.html', purchaseVOList=purchaseVOList) else: return adminLogoutSession() except Exception as ex: print(ex)
def userViewPurchase(): try: if adminLoginSession() == 'user': purchaseDAO = PurchaseDAO() purchaseVO = PurchaseVO() purchase_PackageId = request.args.get('purchase_PackageId') purchaseVO.purchase_PackageId = purchase_PackageId purchase_LoginId = session['session_loginId'] purchaseVO.purchase_LoginId = purchase_LoginId purchaseVOList = purchaseDAO.viewPurchase_User() return render_template('user/viewPurchase.html', purchaseVOList=purchaseVOList) else: return adminLogoutSession() except Exception as ex: print(ex)
def userInsertpurchase(): try: print(">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>") packageVO = PackageVO() purchaseDate = date.today() purchaseTime = datetime.now().strftime("%H:%M:%S") packageId = request.form['packageId'] print(">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>", packageId) purchaseVO = PurchaseVO() purchaseDAO = PurchaseDAO() purchaseVO.purchaseDate = purchaseDate purchaseVO.purchaseTime = purchaseTime purchaseVO.purchase_PackageId = packageId purchaseVO.purchase_LoginId = session['session_loginId'] purchaseDAO.insertPurchase(purchaseVO) return redirect(url_for('userViewPurchase')) except Exception as ex: print(ex)