Not sure from this thread how familiar or otherwise you are with Cake, so not 
sure where to pitch the answers.

Can you post a bit of code? Can you also post the SQL structure of the table 
that stores the company records?

Jeremy Burns
Class Outfit

[email protected]
http://www.classoutfit.com

On 28 Mar 2011, at 03:04, Ryan Schmidt wrote:

> 
> On Mar 26, 2011, at 13:20, John Mills wrote:
> 
>> Hi guys. Outsourced a document management system to a CakePHP
>> developer who has now disappeared, without doing the final touches,
>> leaving me high and dry. Project is due Monday the 28th, I'm freaking!
>> I sat for 2 days, but couldn't solve these issues. The main thing is
>> the member login form at dms.domain.com.
>> 
>> It works perfectly and redirects to http://dms.domain.com/dir/dir but
>> members actually need to log in via the login form I created on the
>> homepage www.domain.com
>> 
>> I had a look at the source of the login form on the dms.domain.com
>> which looks really simple, much like standard <form> code, however I
>> tried searching for the form elements in the source code of the entire
>> site, but no luck. This leads me to believe that everything's called
>> from the database, but hopefully not because that's out of my league.
>> 
>> Surely if I can find the form code used on dms.domain.com I can just
>> reuse it on the home page?
> 
> Is www.domain.com also part of the CakePHP app? If not, this may pose a 
> problem. Certainly, a usual CakePHP login form would be able to handle 
> incorrect logins by displaying a friendly error message to the user. But it 
> can do this because it is in charge of displaying the form, and the error 
> messages, if any. If www.domain.com is a separate site, unrelated to the 
> CakePHP app, this won't be possible. In this case, consider using an iframe. 
> Wherever you want the login box, use an iframe with a URL pointing to a 
> controller and action on dms.domain.com that displays only the login form, 
> and handles login errors if any. Once a successful login occurs, you can use 
> JavaScript to break out of the frame. (There might be a non-JavaScript way to 
> do so as well, if that's important.)
> 
> 
>> The second thing is, once logged in, the list of companies is sorted
>> via date created it seems? but I want it sorted via company,
>> alphabetically. Again I searched the source for code like "asc" but I
>> realized Cake doesn't use standard sql queries. I did however find,
>> 'sortorder' => 'desc', 'sortname' => 'id', and changed 'id' to
>> 'company' but no luck. Below is what I currently see when log in.
>> Thanks John
>> 
>> Id   Company
>> 1    Focu
>> 21   Mamas
>> 20   Clove
>> 25   Orm
>> 24   Colors
> 
> Developers *can* use raw SQL queries in a CakePHP app, but it's not 
> recommended. It's recommended to let CakePHP generate the SQL for you. One 
> way this happens is with the paginate method, which is what's usually used in 
> a controller action to prepare a list of paginated entries to be handed to 
> the view.
> 
> http://book.cakephp.org/view/164/pagination
> 
> In your case, however, I'm not sure where you found these "sortorder" and 
> "sortname" keys; those aren't the standard key names CakePHP uses for this 
> purpose. So it may be a custom method your developer wrote, which you'll have 
> to look for, read and understand.
> 
> 
> 
> -- 
> Our newest site for the community: CakePHP Video Tutorials 
> http://tv.cakephp.org 
> Check out the new CakePHP Questions site http://ask.cakephp.org and help 
> others with their CakePHP related questions.
> 
> 
> To unsubscribe from this group, send email to
> [email protected] For more options, visit this group at 
> http://groups.google.com/group/cake-php

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
[email protected] For more options, visit this group at 
http://groups.google.com/group/cake-php

Reply via email to