Real Estate Web Application

Hi there,

Real estate now is online: http://www.mallorcacolonia.com/

Finally I got the owner of the site to finalize with its requirements (he got rid of lots of sections, but there you go, you can now check live)

Project description and Backend Gallery here: http://www.ramirezcobos.com/2010/12/10/real-estate-colonia-san-pedro/

Front Page

1042

Captura de pantalla 2010-12-10 a las 14.49.35.png

Backend [some - follow above link for more screenshots]

1043

Captura de pantalla 2010-12-10 a las 13.15.00.png

very nice design !! great job !

Looks really good, well done, Antonio!

BTW can you offer discounts for long time yii forum members …?

The backend is really nice, do you also do the images and css/html?

Awesome! :D

I really like the back-end especially. Nice work.

It’s hard to create a decent administration interface.

Slightly Off-Topic:

I can’t help to notice the contradiction between your signature and real estate…:P

¿How long would it take for you to understand that you own nothing in this world?

Man… If any of you dares to come here ‘mi casa es su casa’, the problem will be that we will Yii discuss the whole day… :)

I just build websites jacmoe, I dont expect everbody to understand my philosophy… my two kids need to eat somehow :)

I tend to find templates for that and I then create widgets, extensions, components, modify the scripts, css and HTML and I convert the template into an application that is ‘nearly’ a plug and play backend. Then when I have a project I just need to put all those resources together (is like a library) and voilá a backend in less than 3 days.

Mind sharing some of your cool stuff with the beginners? j/k

Btw you blog has some really nice stuff, i’m already using the autocomplete code :)

If you have seen my blog, you already know that I do not mind sharing (not a j/k :) ) but I still wondering what is the best way to nicely dress up what I have. It could be great that style of CMS or any be implemented as a plug-and-play from top to bottom (even Javascript) and developers just concentrating on certain markup tags on the views, that is, no Javascript code on views at all.

Pursuing this I have analyzing some possibilities out there, one of them was jquery tokenizer plugin but I don’t like the fact that overwrites the ajax request from jquery and that only allows XML responses from server, in a pure AJAX scenario is ok but…

I am currently developing a new CMS for a project I always had in mind, and I am experimenting with something I call ‘live-buttons’. These buttons hold commands data information in their HTML and the library I am writing intelligently knows what to do by simply parsing those commands.

Once finished and ‘polished’ it may be good time to write some extensions that implement this system and also automatically inserts the correct class names to all HTML tags implied on Forms to the views. Once that is created, writing plug-and-play CMS systems will be a piece of cake. Programmers would just need to learn the command system of the parser, which is very simple, and then some HTML to know how to create the proper views.

Due to the nature of Yii, I can envision an environment where a programmer has created a CMS where you say on your view:

ExtendedCHtml::gallery(‘id’,$model->pictures,array(‘uploader’=>ExtendedCHtml::SWFUPLOAD,‘uploadUrl’=>’/upload/files/here’));

and bang! Your beautifuly gallery maker is ready for your CMS and specially written for that specific CMS, no need to worry about buttons as ‘live-buttons’ will take care of that. Simply nice isn’t it? We will see…

Antonio, have you used one of these extensions: advancedar and save relations ar ?

If not, how was you working with AR’s related records, i.e. saving/creating/deleting models which have Many-Many, Has-Many relations?

Nope, I didnt use any of them.

It always depends on how you design your forms. Let me explain by example:

  1. having one Gallery model that has many Picture models

  2. On create I just put the details of the Gallery

  3. On update I allow the addition of the pictures as I can obviously include the ID of the Gallery. I could that if I upload many pictures at once and before saving them I saved the Gallery to the DB but, as I normally use the SWFUpload extension then…

  4. On delete I make sure that I write the onBeforeDelete and check the pictures relationships and I delete the models, this will fire the picture onBeforeDelete and there I check the if it exists on the disk and I delete the picture and then continue with deletion of the model.


On a many_many relationships I work with transactions (must have InnoDB engine in DB and tables). Same goes for the other many_many object.

For example:

User has many rights and many rights has many users

  1. On the form I include a list box that is filled with data from rights model

  2. On create I start a transaction, get the attributes of the model, save it, I receive the parameters of the list

and insert the relations accordingly to the middle table. At the end, I commit the transaction.

  1. On update I start a transaction, remove records related to updated object in the middle table, insert the new relations, and commit transaction.

Yeah, sounds a bit complex but it is not, thanks for pointing me to those extensions. I have a look at them.

Best

Thanks for explanations. I’m facing this problem and invented my own wheel, similar to yours. Probably I will continue using my solution. I hope Yii will have better alternatives to this problem in the near future. You can look how Ruby on Rails deals with it - http://guides.rubyonrails.org/association_basics.html

Excuse me: what problem?

I am using has_many using composite primary keys with AR just fine… :)

Show us how please :)

Please, give me some feedback to this. Do you think could be useful as a button extension? 1) is the first step of what I said on latest post.

livebuttons:

http://www.ramirezcobos.com/2010/12/15/jquery-livebuttons-plugin/

<hi-jack>

In the model:


    	public function primaryKey()

    	{

        	return array('commenter_id', 'post_id');

    	}



And that’s pretty much it. :)

</hi-jack>

<hi-jack2>

Also check the green info box in this section of the guide:

http://www.yiiframew…ng-relationship

</hi-jack2>