Database Forum
Web Database Register Members List Calendar FAQ

 
Go Back   Database Forum > Database Management > PHP & MySQL
User Name
Password

Reply
 
Thread Tools Search this Thread Display Modes
Cool child_info_view.php accessed from parent detail view
11-18-2010, 08:59 PM #1  

dbthomason
Junior Member

 
Status: Offline
Posts: 6
Join Date: Aug 2010

I have id key relationship between a workout table (parent) and a sets table (child) -- workoutID is the common id.

I need to modify code (incCommon.php table list I think) so that the sets table does not display on the main menu/ index page.

Instead, I want to be able to access sets_info_view.php from a button on the detail view within workout_info_view.php using the common id.

I am really having trouble tracing the variables from one php file to the next to do this. I have created the button and have it showing on the detail view (see attached workout_info_view.png).
Attached Images
 
Reply With Quote

Default
11-19-2010, 04:09 PM #2  

Lana
Senior Member

 
Status: Offline
Posts: 110
Join Date: Oct 2007

Did you edit the button link to go to sets_info_view.php page?
Reply With Quote

Exclamation
11-20-2010, 11:23 PM #3  

dbthomason
Junior Member

 
Status: Offline
Posts: 6
Join Date: Aug 2010

If the answer is to add an onclick event, how would that look? I tried...

$templateCode=str_replace('<%%WORKOUTSETS_BUTTON%% >', "<input type=image src=workoutsets.gif vspace=1 name=workoutsets alt='" . $Translation['workout sets'] . "' onClick=\"location.href='sets_info_view.php' ;\">", $templateCode);

..for the new button, but it does not work.

BTW -Where is the code that sets the url that we see in the status bar when we hover over the buttons in a detail view? I don't see an onclick set for anything but the delete row warning.

Last edited by dbthomason; 11-21-2010 at 09:40 PM..
Reply With Quote

Default
11-24-2010, 04:32 PM #4  

Kayla
Senior Member

 
Status: Offline
Posts: 302
Join Date: Mar 2005
Location: USA

You may want to take a look at your generated *tablename*DV.html file.
Reply With Quote

Default
11-24-2010, 06:02 PM #5  

dbthomason
Junior Member

 
Status: Offline
Posts: 6
Join Date: Aug 2010

I have tried Firefox Firebug to trace the code for the detail view buttons. I am guessing, but...

...it looks like form action starts in datalist.php and refers to constructor variable "ScriptFileName" which is set in ~view.php. Also the functions for each button are in ~dml.php in insert, delete, deselect. So maybe I want to make a function that will override the form action to activate to the ~child_view.php rather that the ~parent_view.php.

Can someone give me any hints for where to start.

Last edited by dbthomason; 11-30-2010 at 09:14 PM..
Reply With Quote

Default Found a way to make it work...
06-20-2011, 02:06 PM #6  

lisae3
Junior Member

 
Status: Offline
Posts: 5
Join Date: Dec 2009

It can work, but it has to be coded as a link..

$templateCode=str_replace('<%%RES_LIST%%>', "<a href=\"page_nave_view_list.php\" target=\"_blank\"> <img src=\"image-name.gif\" border=\"0\" alt=\"Txt on hover\" /> </a>" , $templateCode);

Draw back is that if you have to send a variable, it has to be sent via get - since I could not get the <input type=image to work. Even with a window.open...
Reply With Quote

Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump



All times are GMT -5. The time now is 06:19 AM.

Powered by: vBulletin Version 3.7.4
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Database Forums

Help support our forum assistants and product development ->

go to top go to top