This topic is locked

Populating Detail Field from Master Record/Login

9/22/2005 19:29:57
PHPRunner General questions
M
mphaynes author

I have built a fairly simple database application that is basically a call center logging program. It is based on three tables:

  1. client_info (master) - includes: ID, name, address, phone, assigned to, etc. "assigned to" is a lookup that is validated against the "users" table below.
  2. call_detail (detail) - includes: ID, call date, who took call, notes. It is linked to "client_info" record based on foreign key ID
  3. users (includes: login name, password, etc. - used for security in login screen and "assigned to" field in "client_info" table)
    Simple real-world example:
    Call center has 2 reps:

    rep1

    rep2
    A call comes in and rep1 answers the phone. It is client "A" on the other end.

    rep1 is already logged into the system with their user ID and password found in "Users" table.

    rep1 finds the "Client_Info" record for client "A" and clicks on "Call_Detail" link and clicks to add a new "call_detail" record.
    2 questions:
  4. I'd like to have the "Call Date" in "call_detail" default to today and not be editable (either during the "Add" or via "Edit" later on). I can't seem to figure out the right sequence of settings to make this happen and still be able to see the date in the "View".
  5. I'd also like to have the "who took call" field in "call_detail" default to the currently logged in user. Is this possible?
    Thanks so much for any guidance. PHPRunner ROCKS! It is already saving me a butt-load of time!
    ~Mike.

Sergey Kornilov admin 9/23/2005

Hi,

  1. proceed to Formattingtab in PHPRunner and set Edit as - Hiddentype for "Call Date" field. Click Change... and enter default value now()
  2. set Edit as - Hidden type for "who took call" field. Click Change...and enter default value $_SESSION["UserID"]

M
mphaynes author 9/24/2005

Wow. That was certainly easy. Thank you so much for taking the time to answer my questions! Works like a charm.