If statements and date ranges... Anyone know what to do? (Long Question)

Hi everybody - kinda new here. I was hired at a web design company last year and have recently taken to learning ColdFusion - so I'm not 100% on the syntax. I always need help with if statements, so I'm hoping you guys will be willing to spread some knowledge.
Anyway to put this in context:
What I'm working on is a Calendar that allows you to register to attend an event, such as a corporate dinner, holiday party, or some such nonsense. It also processes ticket purchases through a 3rd party such as PayPal, and would look something like this when put on a web-page.
Here's the code that creates that display.
<table class="registerTablePrices" cellspacing=5>
     <cfloop query="registration_types">
       <cfif registration_types.esl_price gte 0>
       <tr>
         <td class="formlabel" nowrap>#registration_types.estName#:</td>
         <td><cfinput name="regType_#registration_types.estid#"  style="width:30px" value="0"/></td>
         <cfif registration_types.esl_price is 0>
         <td class="formlabel">  X Free</td>
         <cfelse>
         <td class="formlabel" style="width:90px">  X #dollarformat(registration_types.esl_price)#</td>
         </cfif>
         <td class="labelInfo">Enter number of attendees for this type.</td>
       </tr>
       </cfif>
     </cfloop>
  </table>
All the code says at the moment is to display events whose price is positive, or else list them as free.
Here is what I want - I want to make it so that the May 30th Late Registration will automatically be hidden if the date is BEFORE or AFTER May 30th.
I have assigned values to the registration types that I want to restrict by date...
They are registration_types.estStartDate and registration_types.estEndDate
AND the value that designates it as Restricted, registration_types.estRestricted - which would be used like this.
<cfif registration_types.estRestricted is 1>
* Then only show it between registration_types.estStartDate and registration_types.estEndDate
And that's where I run into my problem. I can't make it work with the first code you saw:
<table class="registerTablePrices" cellspacing=5>
     <cfloop query="registration_types">
       <cfif registration_types.esl_price gte 0>
       <tr>
         <td class="formlabel" nowrap>#registration_types.estName#:</td>
         <td><cfinput name="regType_#registration_types.estid#"  style="width:30px" value="0"/></td>
         <cfif registration_types.esl_price is 0>
         <td class="formlabel">  X Free</td>
         <cfelse>
         <td class="formlabel" style="width:90px">  X #dollarformat(registration_types.esl_price)#</td>
         </cfif>
         <td class="labelInfo">Enter number of attendees for this type.</td>
       </tr>
       </cfif>
     </cfloop>
  </table>
I'm going to have at least 4 special conditions going on at once and I lose it there.
If you read all that I'm sorry, it may be hard to fully understand  - I appreciate any help.

I wasn't sure what you wanted to do. Perhaps, this:
<cfif (registration_types.esl_price gte 0)
                    or (registration_types.estRestricted is 1 and ((current_date ge estStartDate) and (current_date le estEndDate)))>
You can also compare the dates using dateCompare().
<cfset current_date = dateFormat(now(), "mm/dd/yyyy") />
<cfloop query="registration_types">
            <cfif (registration_types.esl_price gte 0)
                    or (registration_types.estRestricted is 1 and ((current_date ge estStartDate) and (current_date le estEndDate)))>
                    #registration_types.estName#:
                    <cfinput name="regType_#registration_types.estid#" value="0"/>
                    <cfif registration_types.esl_price is 0>
                              X Free
                    <cfelse>
                              X #dollarformat(registration_types.esl_price)#
                    </cfif>
                    Enter number of attendees for this type.
          </cfif>
</cfloop>

Similar Messages

  • I'm downloading from Itunes and have come across error = 404 and 403. Anyone know what this is? Corrupted file maybe?

    I'm downloading from Itunes and have come across error = 404 and 403. Anyone know what this is? Corrupted file maybe?

    It means that iTunes looked for something on the iTunes Store servers and either it wasn't there(404) or the iTunes Store servers denied access to it(403). These can't be resolved at your end.
    (62039)

  • I have just got an iMac 21" and it continuously freezes when it goes to sleep and also when the internet is trying to load, i have tried three different browsers but it still does it (safari, google chrome and firefox), does anyone know what is wrong?

    I have just got an iMac 21" and it continuously freezes when it goes to sleep and also when the internet is trying to load, i have tried three different browsers but it still does it (safari, google chrome and firefox), does anyone know what is wrong?

    To fix the freezing when sleeping problem go to System Preferences>Energy Saver and set 'Computer Sleep' to 'Never'. It seems there is a problem for some with Bluetooth failing to wake after sleep. This fixes it 100% for me and many others on here, until Apple issue a software update to address it.
    Not sure what to suggest on the internet problem. I assume you are connected and receive and send emails OK.
    Edit: To try to troubleshoot the internet issue maybe try turning the Firewall off: System Preferences>Security & Privacy>Firewall tab.

  • My Mac laptop was running fine till I downloaded the latest itunes version this week, now all the programs are slow, ITUNEs cuts in and out.  Anyone know what I did wrong?

    My Mac laptop was running fine till I downloaded the latest itunes version this week, now all the programs are slow, ITUNEs cuts in and out.  Anyone know what I did wrong?

    Hello Mark Malecki,
    Thanks for the question, and welcome to Apple Support Communities.
    I understand you are having some issues with iTunes on your MacBook. You may want to isolate the issues further by testing to see if they persist in a new user account:
    Isolating an issue by using another user account
    http://support.apple.com/kb/TS4053
    You can also try starting iTunes in safe mode:
    iTunes: Troubleshooting issues with third-party iTunes plug-ins
    http://support.apple.com/kb/TS3430
    Thanks,
    Matt M.

  • My ipod touch 4g has been running really slow, lagging, and a ton of apps are running slow and crashing, does anyone know what's wrong?

    Its not jailbroken, does anyone know whats wrong?

    Did you try to reset the device by holding the sleep and home button for about 10sec, until the Apple logo comes back again? You will not lose data by resetting.
    If this does not work, set it up as new device, explained here:
    How to back up your data and set up as a new device

  • My iPhone 5s does not send texts and calls fail, anyone know what could be wrong?

    The iPhone 5s is about 140 days old, I called apple yesterday before I knew about this problem and send a diagnostic test to which they said was all good, they said the phone ismy blocked in anyway and that I got a great buy And it's second hand but in Christine condition with around 200 days left of warrenty.
    can anyone help or tell my why this would be happening?
    its not in airplane mode.
    it does not have "do not disturb settings on.
    its locked on EE and has a T-Mobile SIM installed and is showing signal bars.
    what could possibly be the problem?

    *the phone is not blocked in anyway

  • I have an iTunes account. My iTunes on my computer shows about 100 songs. However, when I click on about 1/3 of the songs, they will play for about 15 seconds and quit. Anyone know what is going on?

    I have an iTunes account along with an older iPod and a new iPhone. My iTunes account shows about 50 songs on it. When I try to play about half of the songs, they play for 15 seconds and then it quits and goes on to the next song. Anybody have any ideas?

    Hey everyone in Apple world!
    I figured out how to fix the flashing yellow screen problem that I've been having on my MBP!  Yessssss!!!
    I found this super handy website with the golden answer: http://support.apple.com/kb/HT1379
    I followed the instructions on this page and here's what I did:
    Resetting NVRAM / PRAM
    Shut down your Mac.
    Locate the following keys on the keyboard: Command (⌘), Option, P, and R. You will need to hold these keys down simultaneously in step 4.
    Turn on the computer.
    Press and hold the Command-Option-P-R keys before the gray screen appears.
    Hold the keys down until the computer restarts and you hear the startup sound for the second time.
    Release the keys.
    I went through the 6 steps above twice, just to make sure I got rid of whatever stuff was holding up my bootup process.  Since I did that, my MBP boots up just like normal.  No flashing yellow screen anymore!!   
    (Note that I arrived at this solution when I first saw this page: http://support.apple.com/kb/TS2570?viewlocale=en_US)
    Let me know if this works for you!
    Elaine

  • Bought iworks family via download. Apple told me to copy onto usb and then i could transfer to other family members. However, when gragged off usb onto desktop it will not work. Checked system requirments and everything fine. anyone know what the problem

    Hi. Bought iwork family as a download rather than on DVD. Want to transfer to other macs in household. Apple told me to transfer to USB stick and then put on other macs. Doesn't work and get message saying "keynote cannot be opened due to a problem". Same problem for .pages and .numbers. I have reinstallled but same problem. Have checked system requirements and everything seems fine.Any one have any ideas how to solve this. Thanks

    I'm an applications developer and also run a part-time videography business. As such, I require more than 3.12GB of RAM. That is the physical limitation of a 32bit system. Pointless to stay on 32bit if you plan on having more than that much RAM.
    I'm also not about to pay someone to fix my PC when I can do it myself. I was originally hoping for someone who had experienced the problem before to point me in the right direction so I didn't have to spend so much time trying to figure out what the issue was for myself.
    Basically, in the end the problem was caused because right at the point in time when I chose to uninstall, and reinstall; Apple released a new version of iTunes. This version in turn had a requirement of iOS 4.2 to sync with the iPhone. This is a pretty embarrassing for Apple that they would release software reliant on other software before said software was released.
    Had I realised I was downloading a newer version at the initial point of installation, this wouldn't have been an issue. I could've easily have rolled back iTunes to the previous version and gotten on with my life.
    Another issue is that iTunes is not actually a 64 bit application. It masquerades as one to allow installation on the 64 bit platform.

  • The touch sounds for my iPad come and go. Anyone know what is happening and how to fix it?

    I turned on my iPad today... and there was no sound.  Usually every touch generates a tone... but it is gone... i need help to get it back.  Specifically when i put the password in each character sounds a tone, when i type for each letter there is a sound/tone, when i start an app there is a tone/sound.  Please help... thanks, es

    Go to Settings, General, Sounds and ensure Keyboard Clicks are on.
    If so, try a restart with the home and power buttons. Press them for ten seconds until the apple appears.

  • I've recently noticed a blank FAQ window when my MBA and iMac wake - anyone know what it is?

    I've recently noticed that when my MBA and iMac 27" awake, that there is a blank FAQ window.  I can't figure out why it appears.
    Any suggestions?  Both machines are running OS X 10.8.2.
    Mike

    This issue is caused by an App Store product called "Live Wallpaper." Remove it or contact the developer for support.

  • Customer Service line said my order has been received and activated, anyone know what this means?

    Checked my order status on the web for my iPhone 6 preorder, it says order is in process with expected ship date of the 19th. When I call in on the customer service line, it tells me the order was received and activated. Anyone know what this means?

    You are in the same situation as me, and that is everything points to we are golden (or space gray, or silver ) For 19th delivery.   Make sure someone is at home, signature in person likely will be required. 

  • I start my macbook air up and a file comes up with a question mark. When I go to Disk Utility I go to update things or erase everything and my disks don't show up or anything. Anyone know what to do?

    I start my macbook air up and a file comes up with a question mark. When I go to Disk Utility I go to update things or erase everything and my disks don't show up or anything. Anyone know what to do?

    Question (?) Mark, Blinking Folder, or Gray Screen at Startup
    These are related but not identical issues. Their causes are outlined in Intel-based Mac- Startup sequence and error codes, symbols. Solutions may be found in:
    A flashing question mark appears when you start your Mac
    Mac OS X- Gray screen appears during startup
    In most cases the problems may be caused by:
    Problem with the computer's PRAM - See Resetting your Mac's PRAM and NVRAM.
    Boot drive's directory has been corrupted - Repair with Disk Utility.
    Critical system files are damaged or deleted - Reinstall OS X.
    The disk drive is physically non-functional - Replace the hard drive.
    Repair the Hard Drive and Permissions
    Boot from your Snow Leopard Installer disc. After the installer loads select your language and click on the Continue button. When the menu bar appears select Disk Utility from the Utilities menu. After DU loads select your hard drive entry (mfgr.'s ID and drive size) from the the left side list.  In the DU status area you will see an entry for the S.M.A.R.T. status of the hard drive.  If it does not say "Verified" then the hard drive is failing or failed. (SMART status is not reported on external Firewire or USB drives.) If the drive is "Verified" then select your OS X volume from the list on the left (sub-entry below the drive entry,) click on the First Aid tab, then click on the Repair Disk button. If DU reports any errors that have been fixed, then re-run Repair Disk until no errors are reported. If no errors are reported click on the Repair Permissions button. Wait until the operation completes, then quit DU and return to the installer.
    If DU reports errors it cannot fix, then you will need Disk Warrior and/or Tech Tool Pro to repair the drive. If you don't have either of them or if neither of them can fix the drive, then you will need to reformat the drive and reinstall OS X.
    The main difference if you are using Lion or Mountain Lion is that you must first boot from the Recovery HD:
    Boot From The Recovery HD:
    Restart the computer and after the chime press and hold down the COMMAND and R keys until the menu screen appears. Alternatively, restart the computer and after the chime press and hold down the OPTION key until the boot manager screen appears. Select the Recovery HD and click on the downward pointing arrow button.
    Reinstall Snow Leopard Without Erasing The drive
    1. Repair the Hard Drive and Permissions
    Boot from your Snow Leopard Installer disc. After the installer loads select your language and click on the Continue button. When the menu bar appears select Disk Utility from the Utilities menu. After DU loads select your hard drive entry (mfgr.'s ID and drive size) from the the left side list.  In the DU status area you will see an entry for the S.M.A.R.T. status of the hard drive.  If it does not say "Verified" then the hard drive is failing or failed. (SMART status is not reported on external Firewire or USB drives.) If the drive is "Verified" then select your OS X volume from the list on the left (sub-entry below the drive entry,) click on the First Aid tab, then click on the Repair Disk button. If DU reports any errors that have been fixed, then re-run Repair Disk until no errors are reported. If no errors are reported click on the Repair Permissions button. Wait until the operation completes, then quit DU and return to the installer.
    If DU reports errors it cannot fix, then you will need Disk Warrior and/or Tech Tool Pro to repair the drive. If you don't have either of them or if neither of them can fix the drive, then you will need to reformat the drive and reinstall OS X.
    2. Reinstall Snow Leopard
    If the drive is OK then quit DU and return to the installer.  Proceed with reinstalling OS X.  Note that the Snow Leopard installer will not erase your drive or disturb your files.  After installing a fresh copy of OS X the installer will move your Home folder, third-party applications, support items, and network preferences into the newly installed system.
    Download and install Mac OS X 10.6.8 Update Combo v1.1.
    Reinstalling Lion/Mountain Lion Without Erasing The Drive
    Boot to the Recovery HD: Restart the computer and after the chime press and hold down the COMMAND and R keys until the menu screen appears. Alternatively, restart the computer and after the chime press and hold down the OPTION key until the boot manager screen appears. Select the Recovery HD and click on the downward pointing arrow button.
    Repair the Hard Drive and Permissions: Upon startup select Disk Utility from the main menu. Repair the Hard Drive and Permissions as follows.
    When the recovery menu appears select Disk Utility. After DU loads select your hard drive entry (mfgr.'s ID and drive size) from the the left side list.  In the DU status area you will see an entry for the S.M.A.R.T. status of the hard drive.  If it does not say "Verified" then the hard drive is failing or failed. (SMART status is not reported on external Firewire or USB drives.) If the drive is "Verified" then select your OS X volume from the list on the left (sub-entry below the drive entry,) click on the First Aid tab, then click on the Repair Disk button. If DU reports any errors that have been fixed, then re-run Repair Disk until no errors are reported. If no errors are reported click on the Repair Permissions button. Wait until the operation completes, then quit DU and return to the main menu.
    Reinstall Lion/Mountain Lion: Select Reinstall Lion/Mountain Lion and click on the Continue button.
    Note: You will need an active Internet connection. I suggest using Ethernet if possible because it is three times faster than wireless.

  • I'm in cycle mode, and 'merge' is clicked in preferences. However, when I record, my previous track data keeps getting overwritten. Does anyone know what I'm doing wrong. Interestingly, I can still see the data in the region.

    I'm in cycle mode, and 'merge' is clicked in preferences. However, when I record, my previous track data keeps getting overwritten. Does anyone know what I'm doing wrong. Interestingly, I can still see the data in the region.

    jamestait wrote:
    when I record, my previous track data keeps getting overwritten.
    since you didn't specify, are you recording in a single take?
    http://www.bulletsandbones.com/GB/GBFAQ.html#multipassrecording
    (Let the page FULLY load. The link to your answer is at the top of your screen)

  • Is the a way to restore my iPhone 5 when it is no longer activated since i erased all content and data it keeps giving me this window that says my simcard is not recognizable does anyone know what to do?

    is the a way to restore my iPhone 5 when it is no longer activated since i erased all content and data it keeps giving me this window that says my simcard is not recognizable does anyone know what to do?

    Unfortunately yes, though technology would never move on if it kept to older standards and did not strive to do more.
    The app store always gives you the option to use a previous version of the app IF it is available for your device.
    Sorry but you are stuck without new hardware.
    PJRS

  • In using Office Mac 2011 I noticed that there is 3 gigs of data under Documents/Microsoft User data for Message Sources.  Anyone know what this is and if it can be deleted?

    In using Office Mac 2011 I noticed that there is 3 gigs of data under Documents/Microsoft User Data for meassage sorces.  Does anyone know what these files are and can they be deleted?

    Hi SDP1,
    Do you use Outlook or Entourage? If so, that's where all of your emails are stored. If you don't use either of those applications I'd go digging through the folders and see where all the space is tied up. Check the Identifies folders, that's probably where everything is located.

Maybe you are looking for

  • Erasing video downloads

    i have downloaded a tv series and transfered to my ipod video.the memory on my hard drive is full.can i erase the file on my computer and still keep it on my ipod even when it updates and the video is no longer in my library.

  • Isight camera on the blink-ideas?

    My camera keeps shutting off and won't return: then suddenly after a week or two it reappears> How do I turn it on?

  • Basics of SD,Finance,SCM,Operations required in SAP BI implementation

    Hi, Can some one help me in getting some basic material to understand the following modules: SD,Finance,SCM,Operations Many Thanks, Sravani

  • Error 1200323 after long hours of running business rules?

    Hi all, I am experiencing some problems with running business rules.... I got a sequence which includes about 20 business rules to run.... After several hours of running this sequence, it shows the errorcode: 1200323, which said that "Error parsing f

  • ITunes 12 for Mac-- no sidebar

    I just 'upgraded' to Yosemite and got iTunes 12 along with it. Frustrated to find that the Sidebar for iTunes is gone... I searched online and DID find a way to get it back by clicking 'playlists' in the middle top (next to My  Music)... but this is