CodeCharge Studio
search Register Login  

Web Reports

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

YesSoftware Forums -> CodeCharge Studio -> PHP

 Change the link based on field value

Print topic Send  topic

Author Message
rado

Posts: 221
Posted: 06/07/2009, 9:15 AM

Question #1.

So, I have to make a grid that will show all information about properties and one of them is column "room status" which could be:

1. Occupied
2. Reserved
3. Available

What I want to make is to set "room status" field in grid to be link but:

1. If the status is "Occupied" :
1. I would like to change the cell color in grid to "RED" for all records
2. The click on link will redirect user to "Page1"

2. If the status is "Reserved"
1. I would like to change the cell color in grid to"YELLOW" for all records
2. the click on link will redirectuser to "Page2"

3. If the status is "Available"
1. I would like to change the cell color in grid to "GREEN" for all records
2. The click on link will redirect user to "Page3"

===========================================================================================
Additional Question # 2.

I plan to make "room reservation record" that will reserve the room for tenant for some period of time. So, I have the SQL procedure that I would like to run every time before user open ""room reservation record". This SQL procedure is actually going trough all reservation records and if find that status of room is "reserved" and reservation time is expired, it will change the status to "available.
So, again, I need to know where I can put my sql procedure and how to call it in CCS

Thanks a lot
Rado.
View profile  Send private message
melvyn


Posts: 333
Posted: 06/07/2009, 12:59 PM

Create 3 links and hide them all. Then create a beforeshow event and show only one link depending on values. Color and other properties can be enclosed in a class <a href="{XXX}" class='ocupied' ...> or <a href="{XXX}" style="color:green"...>; because they'll hide/show only in certain conditions you don't need to go deep there.

Before show row:
if ($Container->status->GetValue() == 'Occupied'){ $Container->linkstatus->Visible=true}
....

You're qualified to code that.
_________________
Melvyn Perez
Puro Codigo
http://purocodigo.com
View profile  Send private message
melvyn


Posts: 333
Posted: 06/07/2009, 1:01 PM

Quote rado:
Additional Question # 2.
...
So, again, I need to know where I can put my sql procedure and how to call it in CCS

BeforeShow
_________________
Melvyn Perez
Puro Codigo
http://purocodigo.com
View profile  Send private message
rado

Posts: 221
Posted: 06/07/2009, 6:17 PM

Thanks Melvyn,
Which action? Don't tell me "Custom script". I would like to call from CCS already done script with SQL STORE procedure.

Rado
View profile  Send private message

Add new topic Subscribe to topic   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

PHP Reports

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.