This topic is locked

master-detail relationship

11/5/2007 4:19:06 PM
PHPRunner General questions
H
horsey_kim author

I have two tables invoice and product. I have them connected with master-detail relationship.
So when you look at the invoices you can click on a product button and it shows the invoice master record at the top and all the products below from the product table.
Now on this product page - I want to add a button that does this. If the invoice status is open that a button will show that links to a page I am doing for them to pick out products. If the invoice status is close then the button can not show up.
Any ideas or suggestions?
Kim

H
horsey_kim author 11/5/2007

UPDATE:
Using event snippet in the page. In both situations if status is open or closed it generates a button and the button does nothing.
if($showmaster_bluestatus="open")

echo "<SPAN class=buttonborder><input class=button type=button value=Pick Lots onClick = 'window.location = 'pickblue_list.php''>

</span>";

else

echo "";

F
frocco 11/5/2007
H
horsey_kim author 11/5/2007

Thanks but I don't think it is working for me - I will keep trying.

C
chaz 11/6/2007

how do u use the master-slave relationship with 2 Databases???? i dont see that option !!

J
Jane 11/6/2007

Hi,
yuo can't use two or more databases in one PHPRunner project.

H
horsey_kim author 11/7/2007

Sorry Tables not databases.

H
horsey_kim author 11/7/2007

Still Need HELP!! My goal is to have abutton that a person can click to go to another page to update more line items. The condition is this. Note that I used showmaster_bluestatus as the field because that is where the status is that needs to determine on the child page if the button should show up or not. I got this so far from the posting that Frank pointed me to. Thanks Frank <img src='https://asprunner.com/forums/file.php?topicimage=1&fieldname=reply&id=23118&image=1&table=forumreplies' class='bbc_emoticon' alt=':)' /> I am sure that it is some little over sight on my part.
Note: the child page is detail_list
Using an editor I modified my detail_list.php to this. It is right above $rowinfo[ ]=$row:
if($data["showmaster_bluestatus"]=="open")

$row["1editable"]=true;

else

$row["1editable"]=false;
using the code mode of the phprunner editor I added this:
{if $row.1editable}

<SPAN class=buttonborder><input class="button" type="button" value="Select More Lots" onClick = "window.location = 'pickblue_list.php?a=return'">

</span>{/if}
I still get no button on the child page - am I calling something out wrong?

J
Jane 11/8/2007

Hi,
you need to add your code to the List page: After record processed event on the Events tab:

if($data["FieldName"]=="open")

$row["1editable"]=true;

else

$row["1editable"]=false;



where FieldName is your actual field name.

H
horsey_kim author 11/12/2007

Okay I don't know what I am doing wrong but I did it like you said Jane and it does not work. Will not show button
I tried both showmaster_bluestatus and bluestatus as the field name. The field that determines if the button shows up on the CHILD list is bluestatus from the master table.
Why is this being so difficult for me - I thought it be easy. I am obviously missing something. HELP
Kim

J
Jane 11/13/2007

Kim,
Please publish your project on Demo Account and post a URL to your pages here or send it to [email=support@xlinesoft.com]support@xlinesoft.com[/email] along with instructions on reproducing this error.

I'll find what's wrong with your project inspecting it at Demo account site.

H
horsey_kim author 11/13/2007

http://demo.asprunner.net/horsey_kim_yahoo...trade/login.php
I am emailing the info you requested to support@xlinesoft.com
Thanks for any help.
Kim

J
Jane 11/15/2007

answered in your personal email.