CodeCharge Studio
search Register Login  

Visual Web Reporting

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

YesSoftware Forums -> Archive -> CodeChargeStudio.Discussion

 Alterinbg the query paramters in the beforeshow event of a grid?

Print topic Send  topic

Author Message
Simon Chee
Posted: 06/18/2002, 7:27 AM

CCS 1.0 PHP MySQL

Can you add an sqlparamter at this point?

I'm tring select records based on the UserID.

beforeshow event code.
-------------------------
global $clan_member1,$DBLeague;
if (CCGetSession("GroupID") <> 99 ){
$clan_member1->wp = new clsSQLParameters();
$clan_member1->wp->AddParameter("1", "sesUserID", ccsInteger, "", "",
$clan_member1->Parameters["sesUserID"], "");
$clan_member1->wp->Criterion[1] = $clan_member1->wp->Operation(opEqual,
"Clan_Mid", $clan_member1->wp->GetDBValue("1"),
$DBLeague->ToSQL($clan_member1->wp->GetDBValue("1"), ccsInteger));
$clan_member1->wp->AssembledWhere = $clan_member1->wp->Criterion[1];
$clan_member1->Where = $clan_member1->wp->AssembledWhere;
}

Simon Chee
Posted: 06/18/2002, 1:37 PM

For anyone interested Support have Given me the answer. I lurve support :)

Add code to beforebuildselect event:

Code:
------

global $<Grid Object>;
// 99 Admin group sees all records,other users should only see records
related to them by mid (member id = UserID)
if ( CCGetSession("GroupID") <> 99 ) {
$Grid Object->ds->Where = " Clan_mid = " . CCGetSession("UserID");
}

"Simon Chee" <darkblade@darkblade.fslife.co.uk> wrote in message
news:aeng0m$e1a$1@news.codecharge.com...
> CCS 1.0 PHP MySQL
>
> Can you add an sqlparamter at this point?
>
> I'm tring select records based on the UserID.
>
> beforeshow event code.
> -------------------------
> global $clan_member1,$DBLeague;
> if (CCGetSession("GroupID") <> 99 ){
> $clan_member1->wp = new clsSQLParameters();
> $clan_member1->wp->AddParameter("1", "sesUserID", ccsInteger, "", "",
> $clan_member1->Parameters["sesUserID"], "");
> $clan_member1->wp->Criterion[1] = $clan_member1->wp->Operation(opEqual,
> "Clan_Mid", $clan_member1->wp->GetDBValue("1"),
> $DBLeague->ToSQL($clan_member1->wp->GetDBValue("1"), ccsInteger));
> $clan_member1->wp->AssembledWhere = $clan_member1->wp->Criterion[1];
> $clan_member1->Where = $clan_member1->wp->AssembledWhere;
> }
>
>


   


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.