This topic is locked

Filling Fields by ID Number

1/31/2007 9:13:27 PM
PHPRunner General questions
R
run4sbc author

I'm running PHPRunner 3.1 Build 207.
I love the program, it works well, but now I am wanting to add more features to my website.
I have built a system that allows people to register, and fill out and edit athletes entry for a track meet.
When the coaches login it give them a USERID number so they can only see the athletes they enter. It works well right now, but I want to make it even easier for us. I want for the school code and school name fields to be filled out in relation to the USERID.
So if COACHA registers and gets assigned USERID 3, in the tables he enters the athletes in I want the School Code and School Name from the table which holds the login information and USERID number to be inserted into the table with the entries.
If anyone has any ideas, please let me know. If you need a better explaination, just post what you want to know. Thanks!

R
run4sbc author 1/31/2007

I also was wondering if there was a way to make radio buttons the same on the add page. For instance you pick the gender of a team, I was the gender radio button on all of the athletes to react to that button being selected.

Alexey admin 2/1/2007

Hi,
you can use events for this.
Add this code to After successful Loginevent:

$_SESSION["SchoolName"]=$data["SchoolName"];

$_SESSION["SchoolCode"]=$data["SchoolCode"];


then put this to Athletes Before record Addedevent:

$values["SchoolName"]= $_SESSION["SchoolName"];

$values["SchoolCode"] = $_SESSION["SchoolCode"];



where SchoolNameand SchoolCode are your actual field names.
Regarding the radio button question provide a more detailed description of what you need to achieve.

R
run4sbc author 2/1/2007

Alexey,
I have set up a username and password for you. It is your first name for the login and last name for the password. Once logged in view the Relay Entries and then go to Add New. I want the first radio button when changed to change all the rest so they are the same.
the weblink is http://www.trackmeetsonline.com/07IndoorMe...lenge/index.htm
I'll give the other thing a try also, thanks for your help!
Cody

R
run4sbc author 2/2/2007

I tried the code you posted to input the TeamCode and TeamName upon login and it gave me this error.
Technical information

Error type 8

Error description Undefined variable: data

URL www.trackmeetsonline.com/SBCInvite/login.php?

Error file /home/run4sbc/public_html/SBCInvite/include/events.php

Error line 6

SQL query select * from `_protection` where `username`='southernboonehs' and `password`='d0199f51d2728db6011945145a1b607a'

Alexey admin 2/2/2007

Cody,
I'm sorry, here is the corrected code for After successful Loginevent:

global $data;

$_SESSION["SchoolName"]=$data["SchoolName"];

$_SESSION["SchoolCode"]=$data["SchoolCode"];