This topic is locked
[SOLVED]

 Display First Name + Last Name List page

1/15/2011 3:14:04 PM
PHPRunner General questions
V
Vienna author

I have five users that will log in separately and see and edit only their records. I have five tables with exactly the same column fields named to correspond to the five users.

The doctors tables are named such things as "doctors_doris, doctors_charlotte,...etc"

These tables of doctors addresses and office information are linked to five tables called "reporting_doris, reporting_charlotte,,,etc..." by a common field in the both the doctors tables and reporting tables called "detailer_id". This numeric value identifies which User from a table called "detailer".
User Doris logs in and see just two tabs...one marked "Doctors_Doris" and one named "Reports_Doris". If she looks at the Doctors records she sees a link on each row that says "Reports"..that link will open up a drop-down horizontal section with however many rows of reports in the "reportingdoris" table that correspond to that relevant doctor that she made a report about. She then can choose to do an ADD/INSERT Report for a horizontal inline add.
Most of the time Doris and other users will be ADDING Reports to their own "reporting
....." tables.
Right now the Doctors tables list First Name and Last Name. But the Reporting tables just contain a column for the "doctor_id" value.

In the LOOKUP WIZARD for the LIST Page of Reports DorisI can use the "doctor_id" number from the matching row in the Doctors_Doris table and then choose to View either the First Name or Last Name. This gives me a dropdown menu in the ADD Record function with just the last names of these doctors. And in the LIST Page Doris will see the last name in the Doctor ID column instead of the actual number value.
However, what I want to do, without creating a Custom view at the beginning of the project, is to simply view BOTH First name and last name doctor table values in this Column with a space between names.
Because the output PHP pages of PHPRUnner rely on so many files with functions and definitions and queries I cannot come across the PHP expression that took the Doctor_ID value and retrieved the Last Name of the doctor for viewing. But I need to do this because some doctors have the same last name or same first name. Just referring to one or the other leaves room for the User to make a mistake and select the wrong doctor to associate a report to.
Essentially I want to be able to modify the LIST Wizard whenever it is useful and instead of having just one text field as an option for display, I would like to Concantenate (on the fly) TWO fields instead of just one. Both fields are contained in the same record defined by the doctor_id.

L
lummis 1/15/2011

If I have understood you correctly, this can be achieved quite easily in Visual Editor. Go to the List Page and, assuming you have headings for First Name and Last Name consecutively, right click and select "merge right". Do the same thing with the two respective fields. You will possibly need to amend the heading to something as simple as Name rather than the original headings.
Hope that this helps.
Brian

Sergey Kornilov admin 1/15/2011

In Lookup wizard setup choose 'Custom expression' in 'Display field' dropdown box and concatenate fields (see examples in the manual):

http://xlinesoft.com/phprunner/docs/lookup_wizard.htm (scroll down to Display field)

V
Vienna author 1/16/2011

Hi Brian, thanks for your kind reply. If I understand you the reason that can not work for me is because the values I need to get the first name AND second name are not in the table that this page is built on.
However, Sergey, your answer was the one that worked for me. Amazingly...the very first Example code was what I needed..good old concat!
By the way is there a tutorial for exposing all the fields that the global values make available?
It would be GREAT if PHPRunner had a feature that showed how to write PHP expressions for enclosing on a page where the session id or a particular value that was already accessed on that particular view or list or edit page would be the key for pulling in other values.
For instance, the user who is logged in and calling up a particular Custom view or table becomes the variable that is needed to pull up records from another table.