Re: Ticket Ordering Question
This WebDNA talk-list message is from 2003
It keeps the original formatting.
numero = 54980
interpreted = N
texte = When I have several conditions that may qualify or disqualify a chunk of code (as you do, since you need to handle it differently on the first sale day than on later days), I usually perform the tests and set a flag variable indicating whether or not to show the chunk, then do a simple test of the flag variable around the chunk. Something like this:[text]showlink=F[/text][if {[onsaledate]}<{[date]}][then][text]showlink=T[/text][/then][else][if ({[onsaledate]}={[date]}) & ({[onsaletime]}<{[time]})][then][text]showlink=T[/text][/then][/if][/else][/if][if "[showlink]"="T"][then]show the link[/then][else]announce when tickets will be available[/else][/if]Also, it hasn't been brought up lately on the list, so I'll mention that most experienced DNA'ers store their dates and times as numerical values (e.g. store the [math]{[date]}[/math] value instead of the [date] value) in their databases whenever they can. This makes searches, sorts and comparisons much easier and faster, and you can format the value for display in any way you wish using the [format days_to_date ...] context.- brianOn Dec 15, 2003, at 8:38 AM, Patrick J. wrote:> Hi, everyone ->> My customer sells event tickets for their venue. Currently, we > display the event information, and based on the "on sale date" of the > tickets for that event, we display an "Order" link.>> So my current code looks like this:>> [if {[onsaledate]}<{[math date]{[date]}+{00/01/0000}[/math]]> [then]> Here's the ordering link (if several other hideifs and showifs for > various exceptions are met)> [/then]> [else] Single tickets will be available online beginning [onsaledate]> [/else]> [/if]>> This works great.>> However, because there are places other than the website at which > tickets can be ordered, the client has recently requested that we add > an "on sale TIME" field. This way, people hitting the website at > midnight can't get a jump on everyone else, who has to wait until, > say, 10 AM, to order at the box office or other outlet.>> I can't figure out the logic on this. If I were to add a [hideif > [time]<[onsaletime]] exception, then it would run that EVERY DAY, > between midnight and 10 AM. I just really need it to disallow ticket > sales between midnight and 10 am ONLY the first day the tickets go on > sale. After that, they should be available 24 hours a day.>> I'm not very familiar with the [format days_to_date] device, and I'm > not really sure that's even what needs to be used. Does someone have > an idea (or a code snippet) to address this concern that they could > share with me?>> Thanks in advance,> -----> Patrick Junkroski> http://www.vsm.net>-- Brian Fries, BrainScan Software -- http://www.brainscansoftware.com ---------------------------------------------------------------This message is sent to you because you are subscribed to the mailing list
.To unsubscribe, E-mail to: To switch to the DIGEST mode, E-mail to Web Archive of this list is at: http://webdna.smithmicro.com/
Associated Messages, from the most recent to the oldest:
When I have several conditions that may qualify or disqualify a chunk of code (as you do, since you need to handle it differently on the first sale day than on later days), I usually perform the tests and set a flag variable indicating whether or not to show the chunk, then do a simple test of the flag variable around the chunk. Something like this:[text]showlink=F[/text][if {[onsaledate]}<{[date]}][then][text]showlink=T[/text][/then][else][if ({[onsaledate]}={[date]}) & ({[onsaletime]}<{[time]})][then][text]showlink=T[/text][/then][/if][/else][/if][if "[showlink]"="T"][then]show the link[/then][else]announce when tickets will be available[/else][/if]Also, it hasn't been brought up lately on the list, so I'll mention that most experienced DNA'ers store their dates and times as numerical values (e.g. store the [math]{[date]}[/math] value instead of the [date] value) in their databases whenever they can. This makes searches, sorts and comparisons much easier and faster, and you can format the value for display in any way you wish using the [format days_to_date ...] context.- brianOn Dec 15, 2003, at 8:38 AM, Patrick J. wrote:> Hi, everyone ->> My customer sells event tickets for their venue. Currently, we > display the event information, and based on the "on sale date" of the > tickets for that event, we display an "Order" link.>> So my current code looks like this:>> [if {[onsaledate]}<{[math date]{[date]}+{00/01/0000}[/math]]> [then]> Here's the ordering link (if several other hideifs and showifs for > various exceptions are met)> [/then]> [else] Single tickets will be available online beginning [onsaledate]> [/else]> [/if]>> This works great.>> However, because there are places other than the website at which > tickets can be ordered, the client has recently requested that we add > an "on sale TIME" field. This way, people hitting the website at > midnight can't get a jump on everyone else, who has to wait until, > say, 10 AM, to order at the box office or other outlet.>> I can't figure out the logic on this. If I were to add a [hideif > [time]<[onsaletime]] exception, then it would run that EVERY DAY, > between midnight and 10 AM. I just really need it to disallow ticket > sales between midnight and 10 am ONLY the first day the tickets go on > sale. After that, they should be available 24 hours a day.>> I'm not very familiar with the [format days_to_date] device, and I'm > not really sure that's even what needs to be used. Does someone have > an idea (or a code snippet) to address this concern that they could > share with me?>> Thanks in advance,> -----> Patrick Junkroski> http://www.vsm.net>-- Brian Fries, BrainScan Software -- http://www.brainscansoftware.com ---------------------------------------------------------------This message is sent to you because you are subscribed to the mailing list .To unsubscribe, E-mail to: To switch to the DIGEST mode, E-mail to Web Archive of this list is at: http://webdna.smithmicro.com/
Brian Fries
DOWNLOAD WEBDNA NOW!
Top Articles:
Talk List
The WebDNA community talk-list is the best place to get some help: several hundred extremely proficient programmers with an excellent knowledge of WebDNA and an excellent spirit will deliver all the tips and tricks you can imagine...
Related Readings:
sort without the or a (1998)
Converting characters to numbers ... (1997)
select multiple (1997)
Sending E-mail (1997)
Hiding HTML and page breaks (1997)
Rhapsody? (1997)
Test (2003)
Snake Bites (1997)
& in grep (2003)
PIXO (1997)
[cart]'s ever get recycled? (2000)
2.0 Beta (1997)
TaxRate and ShipCost Problem (1998)
no global [username] or [password] displayed ... (1997)
Webten + Webcat running smooth (1998)
syntax question, not in online refernce (1997)
Searching an Email database (1997)
stumped on simple sort (1999)
Redirect frame targets (1998)
webcat pro (1998)