close ad
Install the LAtest Updates to Work with CC 2017 and CC 2018
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Search all clients

Thread began 3/24/2010 2:52 pm by mr hankey | Last modified 4/05/2010 5:05 pm by mr hankey | 2114 views | 29 replies |

mr hankey

Search all clients

Hi,

I need to be able to do a search the shows me all clients that do not have a certain product sold to them. The products are in different tables so need to search all the tables.

I assume I would search something like:

where clientid=null in product1table?

what i was wondering is if i should or could use dataassist or any other extension for this or should i just use a custom page? I basically want to have a drop down box 2.

in the first drop down box it would say "sold" or "not sold". then the second drop down list would have a list of all products: "product1", "product2" etc

i need to be able to allow the user to click on the first drop down which determines what search to use, either if the table has the clientid in it or null. then return the results on the page.

hope someone can help me with this one.

thanks

Sign in to reply to this post

Dani Chankhour

This looks that is something that could be done in Dynamic Drop downs instead of the DataAssist Search.

dynamic-dropdowns/

Although this will require that you have your tables in a certain structure which you might already have.

Otherwise to do this in DataAssist Search will require some custom coding. But you can create the first list to be a drop down list , and then have another record set that filters based on the first drop down list. so the user will make a select in the "sold not sold" drop down list and then they click the submit button which will then load the second drop down list.

This could be a lot of information, so let me know if you have any other questions.

Sign in to reply to this post

mr hankey

thanks dani, it then needs to display a recordset(table) on the page based on that criteria.

what if i had it 2 seperate pages, one called "products_sold.php" & "products_not_sold.php"

how could i have a drop down list that when they click on one product name it shows everyone that does not have that product?

what would the recordset queries be for that result?

ideally would like to do it the first way but you can let me know i would appreciate it.

thank you

Sign in to reply to this post

mr hankey

should i have a soldtable and have all the products join to this so it is easier to search?

if so what column would i add to the individual products?

thanks

Sign in to reply to this post

mr hankey

hi,

if someone could help i would appreciate, what i have done now is generated a recordset which shows all the products not sold in a table:

so it reads for example:

ClientName:Joe Bloggs
Address:Any street
Insurance:0

When the insurance is 0 it means they have not been sold which is great it displays. What i want to do then in my table is instead of:

<?php echo $row_rsNotGotGIorProtection['generalInsurance']; ?>

have it show a a RED Cross image i have. so if it is 0 it displays the red cross and if it is 1 then that means it has been sold and i would like it to display the GREEN Tick image i have.

I am sure this could be done using Show Regions but if someone could guide me through it and how to display if 0=red cross and 1=green tick.

Also on the page I have a drop down list with a filter button.

I have then 4 other recordsets on the page which are for the individual product.

So again like the above but this time not every product the individual products so if 0=not sold.

I want to click on the product from the drop down list, say "product1" then click the filter button.

It will then trigger the recordset associated with that product and display that table on the page and not the anything else.

Again if someone could help me through this part as i know roughly the steps now and have got this far i just need step by step on these steps to implement to finish this off.

Many thanks for your help

Sign in to reply to this post

Ray BorduinWebAssist

<img src="imagefolderpath/<?php echo (($row_rsNotGotGIorProtection['generalInsurance']==0)?'redimage.gif':'greenimage.gif'); ?>" >

Sign in to reply to this post

mr hankey

thanks ray, is that the code i need for the show if behavior?

do i still need to add that?

i have a query to show total amount due:

select sum(sub_amt) total_due from ( SELECT sum(AmountGI) sub_amt
FROM generalinsurance
WHERE DatePaidGI is null union select sum(amount)
sub_amt from protection where DatePaid is null
union select sum(amount) sub_amt from buytolet where DatePaid is null
union select sum(amount) sub_amt from mortgage where DatePaid is null
union select sum(Commission) sub_amt from referrals where DatePaidReferral is null
union select sum(Commission) sub_amt from overseas where DatePaidOverseas is null ) a

how can i include the users table to show the user who is due this amount?

thank you ray

Sign in to reply to this post

Ray BorduinWebAssist

You would probably do an INNER JOIN in your sql statement to join in the users table.

Sign in to reply to this post

mr hankey

thanks ray, could you help me impliment that into the query as i am not sure how to do an inner join into a query like this.

many thanks

Sign in to reply to this post

Ray BorduinWebAssist

This query looks pretty odd to me in the first place, so I'm not really sure what you are going after. I doubt you really want to use UNION SELECT... you probably want to use AS to bring in those values as fields and not rows.

Unfortunately there is probably a lot for you to learn, more than I can give in a quick forum post. Do a search on the web for "inner join tutorial" to find out more about using inner joins. This example seems fairly precise and was high on my search results: forumqueue.php

Sign in to reply to this post
loading

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...