def insertPropertyAmenities():
    if session['loginRole']!= 'user':
        return redirect(url_for('login'))

    aminities = ''

    propertyAmenitiesDAO = PropertyAmenitiesDAO()
    propertyAmenitiesVO = PropertyAmenitiesVO()

    propertyBasicDetailsDAO = PropertyBasicDetailsDAO()
    propertyBasicDetailsVO = PropertyBasicDetailsVO()

    propertyAmenitiesVO.propertyAmenities_PropertyId =  request.form['propertyId']
    propertyAmenitiesVO.propertyAmenitiesActiveStatus = 'active'
    propertyAmenitiesVO.propertyAmenitiesDate,propertyAmenitiesVO.propertyAmenitiesTime = str(datetime.now()).split(' ')

    temp = request.form.getlist('propertyAmenityName')

    for i in temp:
        aminities = aminities +' '+i
    propertyAmenitiesVO.propertyAmenities = aminities
    #print "amenities",aminities
    #print "PId",request.form['propertyId']

    propertyAmenitiesDAO.insertPropertyAmenities(propertyAmenitiesVO)

    setStep('complete', request.form['propertyId'])

    propertyBasicDetailsVO.propertyId = request.form['propertyId']
    propertyDict = propertyBasicDetailsDAO.searchPropertyById(propertyBasicDetailsVO)

    return render_template('user/propertySubmited.html',propertyDict=propertyDict)
def insertPropertyBasicDetails():
    if session['loginRole']!= 'user':
        return redirect(url_for('login'))

    propertyBasicDetailsDAO = PropertyBasicDetailsDAO()
    propertyBasicDetailsVO = PropertyBasicDetailsVO()
    propertySubcategoryDAO = PropertySubcategoryDAO()
    propertySubcategoryVO = PropertySubcategoryVO()

    propertyBasicDetailsVO.property_LoginId = session['loginId']
    propertyBasicDetailsVO.propertyOwnerType = request.form['propertyOwnerType']
    propertyBasicDetailsVO.propertyListFor = request.form['propertyListFor']

    propertyBasicDetailsVO.property_PropertySubcategoryId = request.form['property_PropertySubcategoryId']
    propertyBasicDetailsVO.propertyAtStep = '2'
    propertyBasicDetailsVO.propertyStatus = 'pending'
    propertyBasicDetailsVO.propertyActiveStatus = 'active'

    propertySubcategoryVO.propertySubcategoryId = propertyBasicDetailsVO.property_PropertySubcategoryId
    propertySubcategoryDict = propertySubcategoryDAO.editPropertySubcategory(propertySubcategoryVO)
    propertyBasicDetailsVO.propertyDate,propertyBasicDetailsVO.propertyTime = str(datetime.now()).split(' ')
    propertyBasicDetailsVO.property_PropertyCategoryId = propertySubcategoryDict[0]['propertySubcategory_PropertyCategoryId']


    propertyBasicDetailsDAO.insertPropertyBasicDetails(propertyBasicDetailsVO)

    return redirect(url_for('loadPropertyAddress'))
def insertPropertyDetailsCommercial():
    if session['loginRole']!= 'user':
        return redirect(url_for('login'))


    propertyDetailsDAO = PropertyDetailsDAO()
    propertyDetailsVO = PropertyDetailsVO()
    propertyBasicDetailsDAO = PropertyBasicDetailsDAO()
    propertyBasicDetailsVO = PropertyBasicDetailsVO()

    propertyDetailsVO.propertyDetails_PropertyId = request.form['propertyId']
    propertyDetailsVO.propertyName = request.form['propertyName']
    propertyDetailsVO.propertyRERANo = request.form['propertyRERANo']
    propertyDetailsVO.propertyBuildUpArea = request.form['propertyBuildUpArea']
    propertyDetailsVO.propertyBuildUpAreaUnit = request.form['propertyBuildUpAreaUnit']

    propertyDetailsVO.propertyWashrooms = request.form['propertyWashrooms']

    propertyDetailsVO.propertyParking = request.form['propertyParking']
    propertyDetailsVO.propertyDescription = request.form['propertyDescription']
    propertyDetailsVO.propertyDetailsDate, propertyDetailsVO.propertyDetailsTime = str(datetime.now()).split(' ')
    propertyDetailsVO.propertyDetailsActiveStatus = 'active'

    propertyDetailsDAO.insertPropertyDetailsCommercial(propertyDetailsVO)

    setStep('4', request.form['propertyId'])

    propertyBasicDetailsVO.propertyId = request.form['propertyId']
    propertyDict = propertyBasicDetailsDAO.searchPropertyById(propertyBasicDetailsVO)

    return render_template('user/propertyPricing.html',propertyDict=propertyDict)
def insertPropertyPricing():
    if session['loginRole']!= 'user':
        return redirect(url_for('login'))

    propertyPricingVO = PropertyPricingVO()
    propertyPricingDAO = PropertyPricingDAO()

    propertyBasicDetailsDAO = PropertyBasicDetailsDAO()
    propertyBasicDetailsVO = PropertyBasicDetailsVO()

    propertyPricingVO.propertyPricing_PropertyId = request.form['propertyId']
    propertyPricingVO.propertyPricingDate,propertyPricingVO.propertyPricingTime = str(datetime.now()).split(' ')

    propertyPricingVO.propertyPricingActiveStatus = 'active'

    propertyBasicDetailsVO.propertyId = request.form['propertyId']
    propertyDict = propertyBasicDetailsDAO.searchPropertyById(propertyBasicDetailsVO)
    if(propertyDict[0]['propertyListFor']=='sell'):
        propertyPricingVO.propertyPrice = request.form['propertyPrice']
        propertyPricingVO.propertyMonthlyRent = -1
    else:
        propertyPricingVO.propertyMonthlyRent = request.form['propertyMonthlyRent']
        propertyPricingVO.propertyPrice = -1

    propertyPricingDAO.insertPropertyPricing(propertyPricingVO)

    setStep('5', request.form['propertyId'])

    propertyDict = propertyBasicDetailsDAO.searchPropertyById(propertyBasicDetailsVO)

    return render_template('user/propertyGallery.html',propertyDict=propertyDict)
def viewProperies():
    if session['loginRole']!= 'user':
        return redirect(url_for('login'))

    propertyBasicDetailsDAO = PropertyBasicDetailsDAO()

    propertyDict = propertyBasicDetailsDAO.serachProperty()

    return render_template('user/properties-grid.html',propertyDict=propertyDict,walk=walk)
def setStep(atStep,propertyId):

    propertyBasicDetailsDAO = PropertyBasicDetailsDAO()
    propertyBasicDetailsVO = PropertyBasicDetailsVO()

    propertyBasicDetailsVO.propertyAtStep = atStep
    propertyBasicDetailsVO.propertyId = propertyId

    propertyBasicDetailsDAO.updateAtStep(propertyBasicDetailsVO)
Exemplo n.º 7
0
def loadManageProperty():

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

    propertyBasicDetailsDAO = PropertyBasicDetailsDAO()

    propertyDict = propertyBasicDetailsDAO.serachPropertyAll()

    return render_template('admin/manageProperty.html',
                           propertyDict=propertyDict)
def loadPropertyAddress():
    if session['loginRole']!= 'user':
        return redirect(url_for('login'))

    stateDAO = StateDAO()
    cityDAO = CityDAO()
    propertyBasicDetailsDAO = PropertyBasicDetailsDAO()

    stateDict = stateDAO.searchState()
    cityDict = cityDAO.searchCity()
    propertyDict = propertyBasicDetailsDAO.getMaxId()

    return render_template('user/propertyAddress.html',cityDict=cityDict,stateDict=stateDict,propertyDict=propertyDict)
Exemplo n.º 9
0
def home():
    propertyBasicDetailsDAO = PropertyBasicDetailsDAO()
    try:
        if session['loginRole']=='admin':
            next_page = request.args.get('next')
            return redirect(next_page) if next_page else render_template('admin/index.html')
        else:
            propertyDict = propertyBasicDetailsDAO.serachProperty()
            return  render_template('user/index.html',propertyDict=propertyDict,walk=walk,session=session)
    except Exception(e):
        print (str(e))
        propertyDict = propertyBasicDetailsDAO.serachProperty()
        return render_template('user/index.html',propertyDict=propertyDict,walk=walk,session=session)
def insertPropertyAddress():
    if session['loginRole']!= 'user':
        return redirect(url_for('login'))

    propertyAddressDAO = PropertyAddressDAO()
    propertyBasicDetailsDAO = PropertyBasicDetailsDAO()
    propertySubcategoryDAO = PropertySubcategoryDAO()

    propertySubcategoryVO = PropertySubcategoryVO()

    propertyAddressVO = PropertyAddressVO()
    propertyBasicDetailsVO = PropertyBasicDetailsVO()

    propertyDict = {}

    propertyAddressVO.propertyAddress_PropertyId = request.form['propertyId']
    propertyAddressVO.propertyStreet = request.form['propertyStreet']
    propertyAddressVO.propertyLocality = request.form['propertyLocality']
    propertyAddressVO.propertyCityId = request.form['propertyCityId']
    propertyAddressVO.propertyStateId = request.form['propertyStateId']
    propertyAddressVO.propertyPincode = request.form['propertyPincode']

    propertyAddressVO.propertyAddressDate, propertyAddressVO.propertyAddressTime = str(datetime.now()).split(' ')
    propertyAddressVO.propertyAddressActiveStatus = 'active'

    propertyDict['propertyId'] = request.form['propertyId']
    propertyBasicDetailsVO.propertyId = propertyDict['propertyId']
    propertyDict = propertyBasicDetailsDAO.searchPropertyById(propertyBasicDetailsVO)

    propertyAddressDAO.insertPropertyAddress(propertyAddressVO)
    # print "pDict",propertyDict

    propertySubcategoryVO.propertySubcategoryId = propertyDict[0]['property_PropertySubcategoryId']

    propertySubcategoryDict = propertySubcategoryDAO.editPropertySubcategory(propertySubcategoryVO)
    # print "propertySubcategoryDict", propertySubcategoryDict

    setStep('3',request.form['propertyId'])

    if(propertySubcategoryDict[0]['propertyCategoryName']=='land'):
        return render_template('user/propertyDetailsLand.html', propertyDict=propertyDict)
    elif (propertySubcategoryDict[0]['propertyCategoryName'] == 'commercial'):
        if (propertySubcategoryDict[0]['propertySubcategoryName']=='hotel' or propertySubcategoryDict[0]['propertySubcategoryName']=='resort'):
            return render_template('user/propertyDetailsHotel.html', propertyDict=propertyDict)
        else:
            return render_template('user/propertyDetailsCommercial.html', propertyDict=propertyDict)
    else:
        return render_template('user/propertyDetailsResidential.html', propertyDict=propertyDict)
Exemplo n.º 11
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)
Exemplo n.º 12
0
def propertyAdminReply():

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

    if request.form['propertyStatus'] != 'cancel':
        propertyBasicDetailsVO = PropertyBasicDetailsVO()
        propertyBasicDetailsDAO = PropertyBasicDetailsDAO()

        propertyBasicDetailsVO.propertyStatus = request.form['propertyStatus']
        if request.form['propertyReply']:
            propertyBasicDetailsVO.propertyAdminReply = request.form[
                'propertyReply']
        else:
            propertyBasicDetailsVO.propertyAdminReply = 'Thank You'
        propertyBasicDetailsVO.propertyId = request.form['propertyId']

        propertyBasicDetailsDAO.updatePropertyStatus(propertyBasicDetailsVO)

    return redirect(url_for('loadManageProperty'))
Exemplo n.º 13
0
def userProperties():
    if session['loginRole'] != 'user':
        return redirect(url_for('login'))

    loginDAO = LoginDAO()
    loginVO = LoginVO()

    propertyBasicDetailsDAO = PropertyBasicDetailsDAO()
    propertyBasicDetailsVO = PropertyBasicDetailsVO()

    loginVO.loginId = propertyBasicDetailsVO.property_LoginId = session[
        'loginId']
    loginDict = loginDAO.searchLoginDetailsById(loginVO)

    propertyDict = propertyBasicDetailsDAO.serachPropertyDetailsByLoginId(
        propertyBasicDetailsVO)

    return render_template('user/my-properties.html',
                           loginDict=loginDict,
                           propertyDict=propertyDict)
def insertPropertyDetailsResidential():
    if session['loginRole']!= 'user':
        return redirect(url_for('login'))

    otherRooms = ''
    propertyDetailsDAO = PropertyDetailsDAO()
    propertyDetailsVO = PropertyDetailsVO()
    propertyBasicDetailsDAO = PropertyBasicDetailsDAO()
    propertyBasicDetailsVO = PropertyBasicDetailsVO()

    propertyDetailsVO.propertyDetails_PropertyId = request.form['propertyId']
    propertyDetailsVO.propertyName = request.form['propertyName']
    propertyDetailsVO.propertyRERANo = request.form['propertyRERANo']
    propertyDetailsVO.propertyBuildUpArea = request.form['propertyBuildUpArea']
    propertyDetailsVO.propertyBuildUpAreaUnit = request.form['propertyBuildUpAreaUnit']
    propertyDetailsVO.propertyBedrooms = request.form['propertyBedrooms']
    propertyDetailsVO.propertyBathrooms = request.form['propertyBathrooms']
    propertyDetailsVO.propertyBalconies = request.form['propertyBalconies']
    propertyDetailsVO.propertyFurnishing = request.form['propertyFurnishing']
    propertyDetailsVO.propertyOnFloor = request.form['propertyOnFloor']
    propertyDetailsVO.propertyTotalFloors = request.form['propertyTotalFloors']

    temp = request.form.getlist('propertyOtherRooms')

    for i in temp:
        otherRooms = otherRooms + ' ' + i

    propertyDetailsVO.propertyOtherRooms = otherRooms
    propertyDetailsVO.propertyParking = request.form['propertyParking']
    propertyDetailsVO.propertyDescription = request.form['propertyDescription']
    propertyDetailsVO.propertyDetailsDate, propertyDetailsVO.propertyDetailsTime = str(datetime.now()).split(' ')
    propertyDetailsVO.propertyDetailsActiveStatus = 'active'

    propertyDetailsDAO.insertPropertyDetailsResidential(propertyDetailsVO)

    setStep('4', request.form['propertyId'])

    propertyBasicDetailsVO.propertyId = request.form['propertyId']
    propertyDict = propertyBasicDetailsDAO.searchPropertyById(propertyBasicDetailsVO)

    return render_template('user/propertyPricing.html',propertyDict=propertyDict)
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'))