This topic is locked
[SOLVED]

 Iframe with session ID

11/13/2012 4:32:33 AM
PHPRunner General questions
A
Athlon author

Hi guys can some one please help me out.
I have an edit page, id = xyz and record = abc
I want to put an iframe on this page displaying for example the view page for the same record /user.
How would I pass the record / session id to the iframe.
Thank you.
Mike.

C
cgphp 11/13/2012

You can avoid iframe. In the "Before dispaly" event of the Edit page, you can access field values with the $values array: http://xlinesoft.com/phprunner/docs/before_display_view_edit.htm

A
Athlon author 11/13/2012



You can avoid iframe. In the "Before dispaly" event of the Edit page, you can access field values with the $values array: http://xlinesoft.com/phprunner/docs/before_display_view_edit.htm


Thanks but I do not think that is what I want. I have an custom edit page with editable fields. The master table has all records.

I want to display in an Iframe a report of all the fields on the custom edit form.. hope that make sense.
I have used a where clause on the report but can only filter it by logged in user which is what I need.

However, this user has access to for example 5 different records on the report.
I don't seem to be able to filter the report by the record ID of the edit page so only the relevant record is displayed within the Iframe.

Is there an easier way to do this? or a simple fix I can not see.
Thxs for the help as always.

Admin 11/14/2012

Sorry, it's not really clear. Could you make your question more specific?

A
Athlon author 11/14/2012



Sorry, it's not really clear. Could you make your question more specific?


i Have a custom edit page with editable fields on it.
I want to put an iframe with a view page of the same table filtered by logged in user and record ID
I can filter by logged in user but not by record ID.

I only want the view page of the record being edited visible not all records in the iframe.
Hope that makes more sense.
Thanks for your time.
Mike.

Admin 11/14/2012

Okay, as far as I understand on the Edit page you need to display an iframe with List page of the same table with certain search condition applied.
As first step perform a search on the list page using hardcoded values of UserID and RecordID. Once you have figured out the format you can build your iframe code on the Edit page. To access the ID of the record being edited you can use $_GET["editid1"]

A
Athlon author 11/16/2012



Okay, as far as I understand on the Edit page you need to display an iframe with List page of the same table with certain search condition applied.
As first step perform a search on the list page using hardcoded values of UserID and RecordID. Once you have figured out the format you can build your iframe code on the Edit page. To access the ID of the record being edited you can use $_GET["editid1"]


No not exactly.. i want to display a view page of the same record within an iframe on the open edit record.
I have given up trying to do this via php as the recordid is not created until the page opens for edit.
Have discovered by adding the iframe dynamically to the edit page I can access both the parent and child variables..or I thought I could...
I am not good and learning both javascript and php.. so far I have this which is almost there.. you can see what I am trying to do from this.
var edit = Runner.getControl(pageid, 'inductID');

//var edit = 10051;

var newIframe = document.createElement('iframe');

newIframe.width = '600';newIframe.height = '600';

newIframe.src = 'Manager_Induction_View_view.php?editid1=' + edit;

document.body.appendChild(newIframe);
Problem I still have is var edit seems to be empty? I guess because technically it has not been generated at this point and not accessible. Can you think of an easy way around it. Works fine if assign it a value. Can I for example run this javascript after the page has loaded -- iframe will load with correct variables then.
Currently running it Javascript onLoad
TY
Mike.

P
procheck 11/16/2012

Do you want to display two list pages in an iframe? If yes then what I did was deleted the left menu in visual editor and called them as show below:
<table width="900" border="0" cellpadding="0" cellspacing="0">

<tr>

<td height="425" align="left" valign="top">

<iframe name="Name1" src="table1_list.php" width="900" height="400" frameborder="0">

Your Browser does not support Inline Frames. Please upgrade to a newer version.

</iframe>

</td>

</tr>

<tr>

<td height="400" align="left" valign="top">

<iframe name="Name2" src="table2_list.php" width="900" height="400" frameborder="0">

Your Browser does not support Inline Frames. Please upgrade to a newer version.

</iframe>

</td>

</tr>

</table>
Al

Admin 11/16/2012

It's getting really confusing. How and why can you "filter" the View page? Filtering only makes sense on the List page where you have multiple records.

A
Athlon author 11/16/2012

smiles - Am always confused ..
on the edit page ( this is custom view on the induction table ) Managers induction.
I simply want to place the view page on the edit page in an Iframe. If i put it in without the reordID it defaults to list page...
So i need to pass the current recordID on the edit page to the iframe so the view url has the same recordid...
Does that make it clearer?
Reason for doing it - client wants it. The manager edit page ( custom view ) has boxes to add feed back based on the info available in the iframe view of the current record. The view page has everything needed. The list page is already used for an other display and not what I want to use.
TY for the help, I know its a weird way of doing it but its what they want... Customer always right and all that :-)

Admin 11/16/2012

As I mentioned earlier you can access record ID from PHP code as $_GET["editid1"]

A
Athlon author 11/16/2012



As I mentioned earlier you can access record ID from PHP code as $_GET["editid1"]


Not sure you understand.. however, I have fixed the issue and can display any runner page in an iframe on another page filtered by a where clause and recordiD
for every ones benefit i did it using the proxy.mysrc; stumbled across it in the help !
This allowed me to collect the php variable before page load and use the variable in my javascript and apply it to the iframe using docment.write etc.. on teh edit page after it opened..
Well happy with the result :-)
Thank you again.
Mike.