This topic is locked

Nice way to show data from master table on detail table add/edit page

4/5/2011 10:02:51 PM
PHPRunner General questions
C
caz author

Hi Guys,
I Have 2 related tables,
patient (master)

visit (detail).
On the detail view of the visit add/edit page, i would like a cool way to display data from the master table.(maybe one of Runners pop up windows)
I have managed this somewhat with the following code,

----------------
global $dal, $strTableName;

echo "patient Info
";

if ($_SESSION[$strTableName."_masterkey1"])

{

$tblpatient = $dal->Table("patient");

$rs = $tblpatient->Query("patientID=".$_SESSION[$strTableName.

"_masterkey1"],"");

if ($data = db_fetch_array($rs))

{

echo "patientdate of birth: ".$data["patientdob"]."
";

echo "patient phone num: ".$data["patientphone"]."
";

}

}
------------------------

However the echo command has limited display abilities and i would love a slicker/ nicer looking way to display some related data, from the master table.

I'm open to any suggestions, and would love to know any other ways i could accomplish this.
Thanks for your time and support,

Kindest regards Caz :-)

Sergey Kornilov admin 4/6/2011

Not really sure why echo command is limited as you can output any HTML code with it. I guess you need to explain what "slicker/ nicer looking way to display some related data" means to you.

C
caz author 4/6/2011

Thanks Sergey, for explaining about the HTML formatting capabilities of the Echo command. I have spent the last few hours learning different formatting techniques using the Echo command and i must say i'm very impressed so cheers!!
Have you got any suggestions what would be the best way to show the master tables related fields on the detail tables add/edit/view page.
Here are the options I've come up with so far:-

  1. Use the code mentioned above and format the Echo HTML output to display the required fields.
  2. Create a view of both tables
  3. Add corresponding fields to the details table and make them Read only with the default value set to that of the corresponding fields in the master table.
  4. Or could it be possible to have a popup similar to a text area ( truncate large text fields more... link)? ( this would be my favorite option)!!.
    Thanks once again for your time

    kind regards

    Caz :-)

Sergey Kornilov admin 4/7/2011

caz,
I'm not sure if you need more help at this point.
If you do, it would make sense to see what you have implemented already to understand how it can be improved. In this case I recommend to post your application to Demo Account and open a ticket at http://support.xlinesoft.com sending your Demo Account URL. 'Demo Account' button can be found on the last screen in the program.