CodeCharge Studio
search Register Login  

Visual PHP Web Development

Visually Create Internationalized Web Applications, Web Reports, Calendars, and more.
CodeCharge.com

YesSoftware Forums -> Archive -> CodeChargeStudio.Discussion

 Some help please

Print topic Send  topic

Author Message
RonB
Posted: 06/01/2002, 8:10 AM

Hi,

I want the content of the field link_name to be dependent on the outcome of
a query .If result is <> 1 image 1 is displayed if result is 1 image 2 is
displayed. In CCS my code looks like :

function links3_link_name_BeforeShow() { //links3_link_name_BeforeShow
@34-DD558853

//Custom Code @38-2A29BDB7
// -------------------------
global $links3;
global $DBintranet;
$my_result=CCDLookUp("sys_net","sys_opgelost","sys_opgelost<>1",$DBintranet)
;
if ($my_result != '')
{
$links3->link_name->setvalue('<a href="./systeembeheer/netstatus.php"><img
src=./images/red.gif></a>');
}
else
{
$links3->link_name->setvalue('<a href="./systeembeheer/netstatus.php"><img
src=./images/green1.gif></a>');
}
// -------------------------
//End Custom Code

} //Close links3_link_name_BeforeShow @34-FCB6E20C


I get this error:

Fatal error: Call to a member function on a non-object in c:\program
files\apache group\apache\htdocs\intranet\Common.php on line 336





If anybody could help?

Ron




Alexey Alexapolsky
Posted: 06/03/2002, 2:41 AM

Try to declare global $this
and use $this->link_name->setvalue

--
Alex
CodeCharge Developer


"RonB" <r.borkent@123chello.nl> wrote in message
news:adao57$g31$1@news.codecharge.com...
> Hi,
>
> I want the content of the field link_name to be dependent on the outcome
of
> a query .If result is <> 1 image 1 is displayed if result is 1 image 2 is
> displayed. In CCS my code looks like :
>
> function links3_link_name_BeforeShow()
file://links3_link_name_BeforeShow
> @34-DD558853
>
> file://Custom Code @38-2A29BDB7
> // -------------------------
> global $links3;
> global $DBintranet;
>
$my_result=CCDLookUp("sys_net","sys_opgelost","sys_opgelost<>1",$DBintranet)
> ;
> if ($my_result != '')
> {
> $links3->link_name->setvalue('<a href="./systeembeheer/netstatus.php"><img
> src=./images/red.gif></a>');
> }
> else
> {
> $links3->link_name->setvalue('<a href="./systeembeheer/netstatus.php"><img
> src=./images/green1.gif></a>');
> }
> // -------------------------
> file://End Custom Code
>
> } file://Close links3_link_name_BeforeShow @34-FCB6E20C
>
>
> I get this error:
>
> Fatal error: Call to a member function on a non-object in c:\program
> files\apache group\apache\htdocs\intranet\Common.php on line 336
>
>
>
>
>
> If anybody could help?
>
> Ron
>
>
>
>
>

RonB
Posted: 06/03/2002, 4:31 AM


"Alexey Alexapolsky" <alexa@codecharge.com> schreef in bericht
news:adfdkg$gp6$2@news.codecharge.com...
> Try to declare global $this
> and use $this->link_name->setvalue
>
> --
> Alex
> CodeCharge Developer

Hi Alex,

Tried your sugestion wich resulted in this code:


global $links3;
global $DBintranet;
global $this;

$my_result=CCDLookUp("sys_net","sys_opgelost","sys_opgelost<>1",$DBintranet)
;

if ($my_result != '')
{
$this->link_name->setvalue('<a href="./systeembeheer/netstatus.php"><img
src=./images/red.gif></a>');
}
else
{
$this->link_name->setvalue('<a href="./systeembeheer/netstatus.php"><img
src=./images/green1.gif></a>');
}

Still get the same error: Fatal error: Call to a member function on a
non-object in c:\program files\apache
group\apache\htdocs\intranet\Common.php on line 336

Line 336 is part of the GetDBValue function, more specific:
333 //CCGetDBValue @0-417763E3
334 function CCGetDBValue($sql, $db)
335 {
336 $db->query($sql);
337 if($db->next_record())
338 return $db->f(0);
339 else
340 return "";
341 }
342 //End CCGetDBValue

I'm new to this object orientated stuf so your help is greatly appreciated.

Ron


   


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

Web Database

Join thousands of Web developers who build Web applications with minimal coding.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


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