This topic is locked

listpage with link to master/detail table with bottons

9/28/2010 10:41:43 AM
PHPRunner General questions
S
sepp author

Hi, I need help with some lines of code. (phpr 5,2)
I have master/detail tables:
Master: User.Userid

and

Detail: Photo.pic_userid
User

Userid (int, primary key, auto inc.)

Name

Password
Photo

Photoid (int, primary key, auto inc.)

user_userid (detail link)

photo
question:

I now have a nice underlined Link in Usertable to detail Phototable. ( but I need to have a button instead of the link)

Of course I also can add a button with a link to Photo_xxx.php but then the master/detail information is lost.

Is there a way to do it ? (with loged in user session id i did a work around filling in the id as readonly/default but sometimes there is no user id field available)

Thx in advance for your help...

Andreas

A
ann 9/29/2010

Andreas,
to create this button proceed to the HTML mode of the Visual Editor tab:

<input type=button value=button1 onclick="window.location.href='Child_list.php?mastertable=Master&masterkey1={$custom_link}';">



where Child, Master are your actual table names.
Then proceed to the After record processed event on the Events tab and add the code:

$record["custom_link"]=$data["MasterLink"];



where MasterLink is a link field from the master table to the details table.

S
sepp author 10/6/2010

Thanks, works perfect.
Is it possible to change the color of the button? it is always grey.
By hand or CSS... would be fine
thx

Andreas

A
ann 10/7/2010

Andreas,
redefine the style of the input (add the code in the HTML mode on the Visual Editor tab just before the </style> tag).

.INPUT {COLOR: red;}