def batch_upload(): f = request.form['csvfile'] upload_property(f) user = Login.user_detail(userA[0]) property_list = ViewProperty.view_all() sold_property_list = ViewProperty.view_sold() request_list = ViewRequest.admin() billing_amount = ViewBilling.overview_unpaid() return render_template('dashboard.html', user=user, propertycount=len(property_list), propertysold=len(sold_property_list), requestcount=len(request_list), totalbillingamount=billing_amount)
def dashboard_page(): if len(userA) != 0: user = Login.user_detail(userA[0]) property_list = ViewProperty.view_all() sold_property_list = ViewProperty.view_sold() request_list = ViewRequest.admin() billing_amount = ViewBilling.overview_unpaid() return render_template('dashboard.html', user=user, propertycount=len(property_list), propertysold=len(sold_property_list), requestcount=len(request_list), totalbillingamount=billing_amount) else: return render_template('login.html')
def admin_login(): username = request.form['username'] password = request.form['password'] credential = username, password result = Login.sign_in(credential) token = result[0] msg = result[1] if token: print(msg) user = Login.user_detail(username) userA.append(username) property_list = ViewProperty.view_all() sold_property_list = ViewProperty.view_sold() request_list = ViewRequest.admin() billing_amount = ViewBilling.overview_unpaid() return render_template('dashboard.html', user=user, propertycount=len(property_list), propertysold=len(sold_property_list), requestcount=len(request_list), totalbillingamount=billing_amount) else: print(msg) return render_template('login.html')