saseow
Posts: 744
|
| Posted: 02/24/2005, 5:27 AM |
|
I can't find a solution to this either in the news group or the manual so I am hoping that someone has solved this before.
I have a button on a page that when clicked, will check whether 100 records in a table have been flagged as completed. If less than 100 have been completed, I want to notify the user. I would like a javascript alert but I am not sure if it is possible to generate one from server-side php.
If anyone has any ideas as to how I can get a message to the user, please let me know.
Thanks,
Trevor
|
 |
 |
RonB
Posts: 228
|
| Posted: 02/28/2005, 12:51 PM |
|
you could open a new window (window.open()) and load a page wich executes a query to check the records. In the before show event you could use the set tag action to decide what message should be displayed.
global $Tpl;
$db1= new clsDBConnection1();
$my_check=CCGetDBValue("select count * from table where flag=1",$db1);
if($my_check < 100)
{
$Tpl->SetVar("my_message", "not complete");
} else $Tpl->SetVar("my_message", "complete");
unset($db1);
All you have to do is place {my_message} on the page you open with window.open()
Hope this helps,
Ron
|
 |
 |
saseow
Posts: 744
|
| Posted: 02/28/2005, 8:18 PM |
|
Hi Ron,
This really does help!! I expected that it had to be something like this but since this is my first attempt at CCS I was a touch lost.
Thank you so much for the help!
Kindest regards,
Trevor
|
 |
 |
|