Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

Reply
Need some quick code help
Old 11-03-2004, 05:53 PM Need some quick code help
Junior Talker

Posts: 3
Trades: 0
I have this code on a page.

/* Thursday Lunch Options */

if($thursday_lunch == 0){
echo "<span class=subheader>You have chosen to attend the Ladies' Luncheon & Auction on Thursday.</span><br>";
$details .= "One ticket to Ladies Luncheon on Thursday\n";
}
elseif($thursday_lunch == 10){
echo "<span class=subheader>You have chosen to attend the Hunter's Bonanza Luncheon and Auction on Thursday.</span><br>\n";
$details .= "One ticket to Bonanza Luncheon on Thursday\n";
}
elseif($thursday_lunch == 20 ){
echo "<span class=subheader>You have chosen 1 ticket to attend the Hunter's Bonanza Luncheon and Auction and one ticket for the Ladies' Luncheon & Auction on Thursday.</span><br>\n";
$details .= "One ticket to Bonanza Luncheon and one ticket to Ladies auction on Thursday \n";
}
elseif($thursday_lunch == 30){
echo "<span class=subheader>You have chosen a pair of tickets to attend the Hunter's Bonanza Luncheon and Auction on Thursday.</span><br>\n";
$details .= "Two tickets to Bonanza Luncheon on Thursday\n";
}

if($fullregistration){
$total = $total + $fullregistration;
if($fullregistration==255){
$account_description="Individual Full Registration";
} else {
$account_description="Couple Full Registration";
}
echo "<TR><TD><span class=text>Registration</span></TD><TD><span class=text>$account_description</span></TD><TD align=right><span class=text>1</span></TD><TD align=right><span class=text>$$fullregistration.00</span></TD><TD align=right><span class=text>$$fullregistration.00</span></TD>";
}

It shows up like this on my page:

You have chosen a full registration package at the rate of $490.
You have chosen 1 ticket to attend the Hunter's Bonanza Luncheon and Auction and one ticket for the Ladies' Luncheon & Auction on Thursday.

Type Details Quantity Cost Subtotal
Registration Couple Full Registration 1 $490.00 $490.00
Total: $490.00

What I'd like it to show up like is:

You have chosen a full registration package at the rate of $490.
You have chosen 1 ticket to attend the Hunter's Bonanza Luncheon and Auction and one ticket for the Ladies' Luncheon & Auction on Thursday.

Type Details Quantity Cost Subtotal
Registration Couple Full Registration (One ticket to Bonanza Luncheon and one ticket to Ladies auction on Thursday) 1 $490.00 $490.00
Total: $490.00

How do I get that part of the $details to show up? I am a real novice at php but can understand it somewhat. Any help would be appreciated.
raup is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 11-03-2004, 06:38 PM
Unknown.

Posts: 1,693
Trades: 0
Just add the $details where you want it to show up...

Theres nothing special you need to do.. If the value has already been set, which it has, you just need to place it where you want it

--James
Dark-Skys99 is offline
Reply With Quote
View Public Profile
 
Old 11-03-2004, 06:42 PM
Junior Talker

Posts: 3
Trades: 0
I did that but it brings back a bunch of other details i don't want. I want the specific details to $thursday_lunch only.
raup is offline
Reply With Quote
View Public Profile
 
Old 11-03-2004, 07:48 PM
Average Talker

Posts: 16
Trades: 0
How about you add a new variable called $details_part to each section to remember what was typed in. Then you can print it later. So, your code would look like this:

/* Thursday Lunch Options */

if($thursday_lunch == 0){
echo "<span class=subheader>You have chosen to attend the Ladies' Luncheon & Auction on Thursday.</span><br>";
$details .= "One ticket to Ladies Luncheon on Thursday\n";
$details_part = "One ticket to Ladies Luncheon on Thursday";
}
elseif($thursday_lunch == 10){
echo "<span class=subheader>You have chosen to attend the Hunter's Bonanza Luncheon and Auction on Thursday.</span><br>\n";
$details .= "One ticket to Bonanza Luncheon on Thursday\n";
$details_part = "One ticket to Bonanza Luncheon on Thursday";
}
elseif($thursday_lunch == 20 ){
echo "<span class=subheader>You have chosen 1 ticket to attend the Hunter's Bonanza Luncheon and Auction and one ticket for the Ladies' Luncheon & Auction on Thursday.</span><br>\n";
$details .= "One ticket to Bonanza Luncheon and one ticket to Ladies auction on Thursday \n";
$details_part = "One ticket to Bonanza Luncheon and one ticket to Ladies auction on Thursday";
}
elseif($thursday_lunch == 30){
echo "<span class=subheader>You have chosen a pair of tickets to attend the Hunter's Bonanza Luncheon and Auction on Thursday.</span><br>\n";
$details .= "Two tickets to Bonanza Luncheon on Thursday\n";
$details_part = "Two tickets to Bonanza Luncheon on Thursday";
}

if($fullregistration){
$total = $total + $fullregistration;
if($fullregistration==255){
$account_description="Individual Full Registration";
} else {
$account_description="Couple Full Registration";
}
echo "<TR><TD><span class=text>Registration</span></TD><TD><span class=text>$account_description ($details_part)</span></TD><TD align=right><span class=text>1</span></TD><TD align=right><span class=text>$$fullregistration.00</span></TD><TD align=right><span class=text>$$fullregistration.00</span></TD>";
}


I hope that's what you meant, and that it helps. If you're trying to find which bits are different, it is only all the lines with $details_part. There are smarter ways of doing it, but this is probably the eastiest.
dcs3jah is offline
Reply With Quote
View Public Profile
 
Old 11-04-2004, 05:33 PM
Junior Talker

Posts: 3
Trades: 0
That did the trick, Thanks!
raup is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to Need some quick code help
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.34917 seconds with 12 queries