This topic is locked

Is it possible to copy content from one listpage to another?

5/1/2010 4:13:00 AM
PHPRunner General questions
S
snuffi01 author

Hi
I tried to copy the content from one listpage in the visual editor page to another listpage (like you can do with graphs).

It seems that its not possible (its possible but the resulting site doesnt show the content), witch make sence since the sql doesnt content

the table from the listpage witch i tried to copy.
So i have tried to make an more complex query for one of the listpage.

My table looks like this:
SELECT

inquiry_id,

to_whom,

entered_when,

source,

queue_id,

from_whom

FROM dbo.cc_inquiry
and
SELECT

user_id,

pre_process_time,

post_process_time,

state,

flags

FROM dbo.cc_agent
from this two tables i want to, on one page show this:

Calls today witch i gets from this code:
SELECT

COUNT(convert(varchar, entered_when, 102)) AS Antal_idag

FROM dbo.cc_inquiry

WHERE (convert(varchar, entered_when, 102) =convert(varchar, getdate(), 102))
and underneath i want another list Logged on agents from this code:
SELECT

dbo.cc_agent.[state],

dbo.cc_agent.user_id

FROM dbo.cc_agent

WHERE (dbo.cc_agent.[state] =2)
Since UNION isnt supported, is there any way to make one query from this?

Or is there any other way in PHPRunner to achieve this? maybe with php code snippet?
Best regards: Kristian

J
Jane 5/4/2010

Kristian,
by copying list page you only copy the page layout while all underlying server code is not copied.
I recommend you to use custom event (Insert PHP code snippet option on the Visual Editor tab) to select value from another table. Here is just a sample:

$rstmp = CustomQuery("SELECT

COUNT(convert(varchar, entered_when, 102)) AS Antal_idag

FROM dbo.cc_inquiry

WHERE (convert(varchar, entered_when, 102) =convert(varchar, getdate(), 102))");

if ($datatmp = db_fetch_array($rstmp))

echo "Calls today: ".$datatmp["Antal_idag"];