This topic is locked

Automatic Order Form

11/20/2006 10:29:59 AM
PHPRunner General questions
L
lawfour author

I have been excited ever since i found this software, now i need to get a problem solved.
I created a registeration form that will list all the needed fields for and order form, basically what I am doing is using the lookup wizard to populate another table. The problem is it will not populate without this code @$_SESSION["OwnerID"]
Two problems I have come across

  1. when a customer fills out the form and it goes to the list page not all the information that was populated is saved to the list page. How do I fix that?
  2. when the save button is hit I have the results emailed to me but instead of the information enter on the form, the username is placed in all of the fields I used the lookup wizard to populate. How do I fix?
    Thanks

    L

L
lawfour author 11/21/2006

Ok, maybe I asked the wrong question. How do I automatically fill a form with the information given when registered.
Thanks

L

J
Jane 11/21/2006

Larry,
you can do it using BeforeRegister event on the Events tab.

You can give me more detailed description of what you need to achieve and I'll try to help you.

L
lawfour author 11/21/2006

Thanks,
What I am trying to do is:

  1. I have a registeration page that people fillin.
  2. Some of the information that is entered in the register page, I would like to automatically fill a order form
    example:
    Name, room, bldg, etc

    . I tried using the lookup wizard but it does not work without this code

    @$_SESSION["OwnerID"] in the default. The problem is it does not submit all the information through email or when it goes to the detail page.
    Through email it looks like this:
    investigator : Abraham

    Requested_By : Abraham

    Customer_Number : Abraham

    email : Abraham

    room : Abraham

    building : Abraham

    cc expires :

    po : Abraham

    po expires : Abraham

    Department : Abraham

    gas type1 : Abraham
    On the details page it would omit some information.
    This code @$_SESSION["OwnerID"] looks like it was generated through the security section because what ever I put in the User Table OwnerID field & the Main Table OwnID field shows up on the form I am using as long as the code is in the default.
    Hope I explained it so u can understand.
    L



J
Jane 11/21/2006

Larry,
what default values you use for your fields on the "Edit as" settings dialog on the Visual Editor tab?
Also please show me exact event code.

L
lawfour author 11/21/2006

The code I put in all of the fields is this @$_SESSION["OwnerID"] with that code all the fields populated with the currect information. But when it is submitted some of the information does not show up on the details page and only the name is filled in on all of the fields when I email.
As for the event code I dont have any event code it's clear. and I don't know how to write any. I seen the samples but I don't think it is what I am looking for.
Do you know where I can get more sample codes or maybe there is a members section, to share event code?
I was up all night trying to figure this out....
Thanks

L

J
Jane 11/22/2006

Larry,
$_SESSION["OwnerID"] variable contains OwnerID value and it isn't dependent on place where you put this variable.
You can send to support@xlinesoft.com a full set of generated PHP files, your database creation script with sample data and detailed description of what you want to achieve.

I'll try fo find a workaround.

L
lawfour author 11/22/2006

Thanks so much I will do that. Here is link to exactly what I am trying to do http://www.jci.tju.edu/~lwilliam/demo.html This was created for my old DB
Currently I have about 50 doctors that I have a DB table, someone told me a couple years ago I could just use one form for all doctors but I was not able to figure it out with the software I was using until I found PHPrunner.
If you go to the link you will see a demo of the new form I would like to use and form design is another question i have but right now I want to solve this problem first.
On the demo form you will see Investigator infomation at the top, since i had a table for each doctor the only thing I had to do is use the default feature and put in the information that represented each doctor.
But using PHPrunner it is different since I will be cutting the forms down from 50 to only 1 form for all investigator and using the username login to show only that users information.
This is what I am trying to accomplish one form 50 or more users. When user logs in only their information is showed with most of the form filled out for them.
How do I get PHPrunner to fill out most of the forms information using another table that has the required info?
Thanks

Larry W.

L
lawfour author 11/23/2006

I was hoping to use
function AfterSuccessfulRegistration()

{

//** Insert data into users fields only ****

global $conn;
but don't know what code to use to put the data in the fields.
L

J
Jane 11/24/2006

Larry,
Here is a sample code for the AfterSuccessfulRegistration event:

function AfterSuccessfulRegistration()

{

global $conn;

$str = "update TableName set Field1=Value1, Field2=Value2 where FieldName='".$_SESSION["UserID"]."'";

db_exec($strSQLInsert,$conn);
}



where FieldName is your actual field name where username is stored.

L
lawfour author 11/26/2006

OK this code did not work.
Let me see if I can explain what I want to do differently.
I am a user logging into a site, when I successfully login I am sent to a order form. To make it easy for me the fields are filled in for me ( not because I filled in the fields before but because it is hardcoded for my username which is the information I filled in at registration).
When someone else logs in his or her information is filled in automatically.
In the visual editor default field on the ADD PAGE what code can I put in so only the user information is filled in.
I know your code woud be different but I want to see if you can give me a code that is general to all users so when they log in their name, room, building, custoNo., etc will be fill in automatically. That's all I need to do.
Example:
Investigator : Default="$Investigator"

Room: Default="$room"

Bldg: Default="$Bldg"

CustNo: Default="$CustNo"
Thanks

Larry <img src='https://asprunner.com/forums/file.php?topicimage=1&fieldname=reply&id=13205&image=1&table=forumreplies' class='bbc_emoticon' alt=':(' />

I was hoping to use

function AfterSuccessfulRegistration()

{

//** Insert data into users fields only ****

global $conn;
but don't know what code to use to put the data in the fields.
L

Alexey admin 11/27/2006

Larry,
I see what you saying.
Put the following into Default boxes for your fields:
Investigator:

@$_SESSION["Investigator"]



Room:

@$_SESSION["Room"]



etc
Then put this code to After successful login event.

global $data;

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

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

...


where Investigator and Room are your actual field names in Users table.

Note that field names are case-sensitive here.

L
lawfour author 11/27/2006

<img src='https://asprunner.com/forums/file.php?topicimage=1&fieldname=reply&id=13239&image=1&table=forumreplies' class='bbc_emoticon' alt=':D' /> THANK YOU, THANK YOU, THANK YOU,
So far the code worked perfectly, being able to us one form will save me alot of time.
So thank you so much.
L