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;
> }
>
>
|
|
|
 |
|