Esempio n. 1
0
def viewManageProperty():

    if session['loginRole'] != 'admin':
        return redirect(url_for('login'))

    propertyBasicDetailsVO = PropertyBasicDetailsVO()
    propertyBasicDetailsDAO = PropertyBasicDetailsDAO()

    propertyBasicDetailsVO.propertyId = request.args.get('propertyId')

    propertyDict = propertyBasicDetailsDAO.serachPropertyDetailsById(
        propertyBasicDetailsVO)

    return render_template('admin/viewManageProperty.html',
                           propertyDict=propertyDict,
                           walk=walk,
                           path=path)
def loadPropertyDetails():

    propertyBasicDetailsDAO = PropertyBasicDetailsDAO()
    propertyBasicDetailsVO = PropertyBasicDetailsVO()

    propertyReviewVO = PropertyReviewVO()
    propertyReviewDAO = PropertyReviewDAO()

    propertyBasicDetailsVO.propertyId = propertyReviewVO.propertyReview_PropertyId = request.args.get('propertyId')

    propertyDict = propertyBasicDetailsDAO.serachPropertyDetailsById(propertyBasicDetailsVO)
    propertyReviewDict = propertyReviewDAO.searchPropertyReviewByPropertyId(propertyReviewVO)
    # print propertyDict[0]['propertyCategoryName']
    if propertyDict[0]['propertyCategoryName'] == 'residential':
        return render_template('user/viewPropertyDetailsResidential.html',propertyDict=propertyDict,propertyReviewDict=propertyReviewDict,walk=walk,path=path)
    elif propertyDict[0]['propertyCategoryName'] == 'land':
        return render_template('user/viewPropertyDetailsLand.html', propertyDict=propertyDict,propertyReviewDict=propertyReviewDict,walk=walk,path=path)
    elif propertyDict[0]['propertyCategoryName'] == 'commercial':
        if propertyDict[0]['propertySubcategoryName'] == 'hotel' or propertyDict[0]['propertySubcategoryName'] == 'resort':
            return render_template('user/viewPropertyDetailsHotel.html', propertyDict=propertyDict,propertyReviewDict=propertyReviewDict,walk=walk,path=path)
        else:
            return render_template('user/viewPropertyDetailsCommercial.html', propertyDict=propertyDict,propertyReviewDict=propertyReviewDict,walk=walk,path=path)
    else:
        return redirect(url_for('home'))