Help with some PHP?

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
davedirt
Forum Newbie
Posts: 2
Joined: Sun Dec 19, 2010 4:31 pm

Help with some PHP?

Post by davedirt »

I guess I will preface this by saying I don't know anything about PHP. I do websites for used car dealers and I utilize a 3rd party PHP script to manage the inventory for each dealer.

One example can be seen here: http://mobilecarsonline.com/inventory2/

The problem is the inventory sorts the vehicles by make, but nothing else. All of the Chevrolets are together, all the Fords, etc. I need the inventory to be sorted by make, model, & year. Like this:

2000 Buick LeSabre
2004 Buick LeSabre
2005 Buick Rendevous
1999 Chevrolet Silverado
2001 Chevrolet Silverado
2005 Chevrolet Silverado
2004 Chevrolet Tahoe
2005 Chevrolet Tahoe
2006 Chevrolet Trailblazer
2007 Chevrolet Trailblazer


When I explained this to the software company, they told me this was not option I could change on my end. That I would have to get someone who knew PHP to help me. They pointed me to this line of code as the one to need some adjustments:

Code: Select all

$vars = (object)array(
"make" => InputHelper::get($_REQUEST, "make"),
"model" => InputHelper::get($_REQUEST, "model"),
"minPrice" => InputHelper::get($_REQUEST, "minPrice"),
"maxPrice" => InputHelper::get($_REQUEST, "maxPrice"),
"minYear" => InputHelper::get($_REQUEST, "minYear"),
"maxYear" => InputHelper::get($_REQUEST, "maxYear"),
"keyword" => InputHelper::get($_REQUEST, "keyword"),
"stockType" => InputHelper::get($_REQUEST, "stockType"),
"miles" => InputHelper::get($_REQUEST, "miles"),
"zipCode" => InputHelper::get($_REQUEST, "zipcode"),
"feat" => InputHelper::get($_REQUEST, "feat"),
"spec" => InputHelper::get($_REQUEST, "spec"),
"classCode" => InputHelper::get($_REQUEST, "classCode"),
"sortBy" => InputHelper::get($_REQUEST, "sortBy", "make"),
"sortType" => InputHelper::get($_REQUEST, "sortType", "asc"),
"display" => InputHelper::get($_REQUEST, "disp", "L"),
"page" => InputHelper::get($_REQUEST, "p", "1"),
"dealerId" => InputHelper::get($_REQUEST, "dealer", "")
);
I don't know how to add the parameters I need. Any help from you guys would be much appreciated!
User avatar
requinix
Spammer :|
Posts: 6617
Joined: Wed Oct 15, 2008 2:35 am
Location: WA, USA

Re: Help with some PHP?

Post by requinix »

Code: Select all

"sortBy" => InputHelper::get($_REQUEST, "sortBy", "make"),
"sortType" => InputHelper::get($_REQUEST, "sortType", "asc"),
Looks relevant, doesn't it?

Problem is that I don't know if you can sort on multiple fields or what the syntax would be. It might use an array, or a numbered list, or a comma-separated list, or one of a variety of possibilities. This is the time when you should look for documentation...
davedirt
Forum Newbie
Posts: 2
Joined: Sun Dec 19, 2010 4:31 pm

Re: Help with some PHP?

Post by davedirt »

This is the time when you should look for documentation...
Yeah no docs and no help from the author...
User avatar
requinix
Spammer :|
Posts: 6617
Joined: Wed Oct 15, 2008 2:35 am
Location: WA, USA

Re: Help with some PHP?

Post by requinix »

Then there isn't much we can do for you. Haven't mentioned what the script is (if it even has a name), what it does, how it works...

It's not like we can just press a button and have an answer for you. We need to know stuff, and if you don't know it then how are we supposed to?
Post Reply