stuartambient
Posts: 3
|
| Posted: 09/23/2004, 12:39 PM |
|
I'm having way too much trouble setting up a grid to process a search form. Some of it is due to my own lack of php / programming knowledge.
Maybe someone has done this.
Here is the scenario :
Search form has 6 fields total, 3 are multis, 2 are text and 1 is a pulldown. The search form itself works, multi's are set up correctly.
DataSource is SQL because there are numerous joins 5 or 6 I think .
So after alot of digging around and asking, I finally know what kind of condition I need. It needs to be a dynamic where condition that is set by the user input.
Translated - The user can choose, 1 , 2 or all 6 fields. As they add more choices from fields, the results become more refined.
Example. (job board)
3 Multiselects [industries] [states] [taxtype]
If user only choose from industries , say "clerical"
then all clerical jobs get returned regardless of states and taxtype
if user chooses clerical and Massachusetts, database returns all clerical jobs in massachusetts and all taxtypes
if user choose clerical, massachusetts and contract to full time,
all clerical jobs in massachusetts that are a contract to full time will be returned.
In other words, the AND statements are added dynamically to the where condition if the user has chosen a value from the field.
Now I've been working with support on this issue , but I don't think they are understanding what I'm talking about.
Surely someone must have done something like this ?
Any help, ideas would be greatly appreciated.
Stuart
|
 |
 |
klw
|
| Posted: 09/23/2004, 1:47 PM |
|
You can dynamically build the SQL statements within
the 'Before Build Select' event for the grid which will
display the results from the search filter.
|
|
|
 |
Lagartija
|
| Posted: 09/23/2004, 2:11 PM |
|
Quote klw:
You can dynamically build the SQL statements within
the 'Before Build Select' event for the grid which will
display the results from the search filter.
That much I know :). Not sure how to go about coding it was the issue.
I should probably wait for support.
|
|
|
 |
Walter Kempees
|
| Posted: 09/23/2004, 2:57 PM |
|
Please email the project at least the search + grid, export the database
tables that relate to the SQL, zip it all.
Do it before the weekend and I will have a peek at it.
No guaranties, but it can be done !
kempe819 [at] planet [dot] nl
"stuartambient" <stuartambient@forum.codecharge> schreef in bericht
news:54153267ca7348@news.codecharge.com...
> I'm having way too much trouble setting up a grid to process a search
form.
> Some of it is due to my own lack of php / programming knowledge.
>
> Maybe someone has done this.
> Here is the scenario :
> Search form has 6 fields total, 3 are multis, 2 are text and 1 is a
pulldown.
> The search form itself works, multi's are set up correctly.
> DataSource is SQL because there are numerous joins 5 or 6 I think .
>
> So after alot of digging around and asking, I finally know what kind of
> condition I need. It needs to be a dynamic where condition that is set by
the
> user input.
>
> Translated - The user can choose, 1 , 2 or all 6 fields. As they add more
> choices from fields, the results become more refined.
> Example. (job board)
> 3 Multiselects [industries] [states] [taxtype]
> If user only choose from industries , say "clerical"
> then all clerical jobs get returned regardless of states and taxtype
>
> if user chooses clerical and Massachusetts, database returns all clerical
jobs
> in massachusetts and all taxtypes
>
> if user choose clerical, massachusetts and contract to full time,
> all clerical jobs in massachusetts that are a contract to full time will
be
> returned.
>
> In other words, the AND statements are added dynamically to the where
condition
> if the user has chosen a value from the field.
>
> Now I've been working with support on this issue , but I don't think they
are
> understanding what I'm talking about.
>
> Surely someone must have done something like this ?
>
> Any help, ideas would be greatly appreciated.
>
> Stuart
> ---------------------------------------
> Sent from YesSoftware forum
> http://forums.codecharge.com/
>
|
|
|
 |
klwillis
Posts: 428
|
| Posted: 09/23/2004, 8:03 PM |
|
If your grids name is $DataGrid, you can modify the 'where Clause'
to filter the records you want by setting this value:
$DataGrid->ds->Where;
Try something simple with one field within the 'Before Build Select' event.
Once you get that working, build on it until you get the query you need. 
Quote Lagartija:
Quote klw:
You can dynamically build the SQL statements within
the 'Before Build Select' event for the grid which will
display the results from the search filter.
That much I know :). Not sure how to go about coding it was the issue.
I should probably wait for support.
_________________
Kevin Willis, VP/CIO
HealthCare Information Technology Specialist
http://www.nexushealthcare.com
"Fast - Convenient - Quality-Care"
Medical Software Consulting Services
Email : klwillis@nexushealthcare.com
Skype : klwillis2006 |
 |
 |
stuartambient
Posts: 3
|
| Posted: 09/24/2004, 2:08 PM |
|
Walter, and all,
The search form has now been correctly set up . I couldn't use the
datagrid-ds-where, because of the sql i needed in the grid. Joins, etc.
Suppport was great here and had much patience with me.
Stuart
|
 |
 |
|