Beispiel #1
0
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)
Beispiel #2
0
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')
Beispiel #3
0
def manage_property_page():
    if len(userA) != 0:
        username = userA[0]
        user = Login.user_detail(username)
        property_list = ViewProperty.admin()
        return render_template('manageProperty.html', user=user, propertylist=property_list)
    else:
        return render_template('login.html')
Beispiel #4
0
def redirect_property_details():
    if len(userA) != 0:
        username = userA[0]
        user = Login.user_detail(username)
        PropertyID = request.form['PropertyID']
        property_detail = ViewProperty.view_details(PropertyID)
        return render_template('viewDetails.html', property_detail=property_detail, user=user)
    else:
        return render_template('login.html')
Beispiel #5
0
def redirect_view_request():
    if len(userA) != 0:
        username = userA[0]
        user = Login.user_detail(username)
        request_list = admin_request()
        requestuser = Login.user_detail(username)
        property_detail = ViewProperty.view_details(request_list[0]['PropertyID'])
        return render_template('viewAllRequest.html', user=user, request_list=request_list, requestuser=requestuser, property_detail=property_detail)
    else:
        return render_template('login.html')
Beispiel #6
0
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')
Beispiel #7
0
def request_approve():
    if len(userA) != 0:
        RequestID = request.form['RequestID']
        value = 'Approve', RequestID
        respond_request(value)
        username = userA[0]
        user = Login.user_detail(username)
        request_list = admin_request()
        requestuser = Login.user_detail(username)
        property_detail = ViewProperty.view_details(request_list[0]['PropertyID'])
        return render_template('viewAllRequest.html', user=user, request_list=request_list, requestuser=requestuser,
                               property_detail=property_detail)
    else:
        return render_template('login.html')
Beispiel #8
0
def admin_property():
    return ViewProperty.admin()
Beispiel #9
0
def my_property(user_id):
    return ViewProperty.self(user_id=user_id)
Beispiel #10
0
def property_for_sale():
    return ViewProperty.sale()
Beispiel #11
0
def property_for_rent():
    return ViewProperty.rent()