Ask a Question related to Coldfusion - Advanced Techniques, Design and Development.

  1. #1

    Default ColdFusion Calendar

    message to forums requesting help about approach to crowbar calendar

    I have been working on a dynamic calendar for a local music venue.
    when i'm finished with it, i want it to be able to display the new content
    while using a preformatted template and css, so that the formatting remains
    consistent with,
    for example, this static page
    [url]http://www.crowbarlivemusic.com/calendarfiles/cal_053005.htm[/url]

    the formatting, i'm pretty sure i can handle, but each unique date displayed
    needs to have an
    absolute URL reference so that one visitor may view a link to, for example the
    may 30th link above,
    while another is viewing July 8th for example-- but that data needs to disply
    w/out any third party user input.
    in other words, i need to be able to send a link (as the static html link
    above) to someone and have them be able to access
    any date of any week via the URL i send them. when they view the URL, they
    will need NOT input data
    in order to see the intended text-- it will already be displayed.

    visitors should also be able to reach the dynamic calendar data also from a
    main calendar page,
    such as this link: [url]http://www.crowbarlivemusic.com/calendar.htm[/url]

    what is the best approach to starting to write this application? how will i
    utilize the unique identifiers
    from my database to organize the data so that the correct info displays on the
    correct date?

    the very beginings of my administrative interface for adding new calendar data
    is here:
    [url]http://www.alleycatmusic.net/coldfusion/eureka.cfm[/url]

    the idea behind this dynamic calendar is to help the venue manager to boost
    his productivity
    when entering new concert events on the calendar.

    thank you very much for your help! please notify me via e-mail or private
    message if you have a suggestion
    for me.

    jsabarese Guest

  2. Similar Questions and Discussions

    1. How to call a coldfusion function defined in other coldfusion file??
      inside a.cfm, it has code fragment: <cfloop> <cfinclude template="b.cfm"> </cfloop> inside b.cfm, it has code fragment: ...
    2. Database driven calendar in DMX and Coldfusion MX 7
      Hi I am currently trying to design a room booking system for a school intranet. I have an input page, database and output page that all work...
    3. help with the calendar tag in coldfusion
      I was wondering if anyone knows how to make a flash form load faster. What I would really like to do is put a limitation on the calendar tag so it...
    4. 2006 calendar needed for photo calendar
      I want to start work on a 2006 calendar featuring my own photographs. In Photoshop there used to be a calendar-creating feature that worked well,...
    5. asp calendar?
      I made this demo in 15 minutes. The images were done in a hurry, just to show that its possible ...
  3. #2

    Default Re: ColdFusion Calendar

    I may be wrong, but couldn't you just have it take the URL.QUERYSTRING and look
    at the database? so it would be calendar.cfm?date=12-22-05

    And then what you could do is throw a little database together and put all the
    information about the concert, like guest name, time, date... etc.

    What I would do is make a database driven calendar system that would have
    event information, have a main page that will display the calendar info and
    then have another page to display the main information with a querystring about
    that particular event.

    Also if you wanted to have a search feature, you could make a page that will
    use a get method to view the date info.

    Dont know if this helped or not, my replys some times don't make that much
    sense when I sleep 14 hours over a 5 day period :)... Feel free to aim me(
    genmud2 ) or pm me for questions.

    genmud Guest

  4. #3

    Default Re: ColdFusion Calendar

    thanks for the reply!
    i'm not sure what you mean by URL.QUERYSTRING, but i'll do some research. i am
    just a beginner.

    the database is already set up, as you can see from
    [url]http://www.alleycatmusic.net/coldfusion/eureka.cfm[/url] -- all of the concert info
    on that test page is being pulled from the db. i can add stuff like ticket
    prices, event time, etc., later. the db currently has columns only matching the
    form fields at the URL in my reply here, and the unique identifier ID column as
    well, which is an MS Access auto-number.

    i guess where i'm getting confused in my conceptualization of it all is that i
    can't think how once the data is in the db, how it will automatically appear on
    a month-view style calendar, and then also automatically create a date-view
    page for the absolute URL links.

    jsabarese Guest

  5. #4

    Default Re: ColdFusion Calendar

    I've added a few columns to the file, and i've encountered some problems which
    i must correct before i move on.

    please take a look here
    [url]http://www.eastcoastbandnetwork.com/cfdocs/eureka_new.cfm[/url]

    i don't understand why i often get a "1" or "0" in the #All Ages# <cfoutput>
    (see all ages in the dynamic text)

    i also need to know how to have CF print "N/A" (as in, "not available") when
    no ticket prices are input in the form. please test by submitting a form so
    that you can see what i mean.

    thanks!!

    jsabarese Guest

  6. #5

    Default Re: ColdFusion Calendar

    >i don't understand why i often get a "1" or "0" in the #All Ages# <cfoutput>
    (see all ages in the dynamic text)
    Check your database. What data is in #all Ages# (BTW Do you really have a
    space between All and ages- not good use _ Spaces will make life wacky) You
    said you added some fields to your database. Maybe that is the problem- you
    are inserting data into the wrong field. (ie: In SQL you must have the
    <cfprocparam> lined up in the same exact order as in the stored procedure)
    >CF print "N/A" (as in, "not available") when no ticket prices are input in
    the form. Is it showing as a blank or as 0.
    You'll need to do an if statement.
    1. Decide a new variable name for your field that you want to output. (Make
    it different than you db one)
    2. Write an cfif statement.
    <cfif queryname.ticketprice is '' or queryname.ticketprice is '0'>
    <cfset newticketprice="N/A">
    <CFELSE>
    <CFSET newticketprice=queryname.ticketprice >
    </CFIF>
    3. Replace the old variable with the new variable name in the output.
    (note: put the cfif in a loop if you are looping through data)
    About the urls to show the data from different dates. Your url link will have
    the database info in it to show the user the correct data. Usually you'd use
    some id.
    For example <a href= "blah.cfm?=BandId=#BandID#>#BandName#</a>

    There are many calendar resources on the exchange. I don't know if there's
    one exactly like you want as yours sound like a formatting thing/ I'd look at
    shopping carts too.
    Hope this helps.





    jmj Guest

  7. #6

    Default Re: ColdFusion Calendar

    It looks like you have the foundation of a system - a database that tracks the
    information, including a date. To display information for a particular date,
    you want a URL that can pass the appropriate parameters in the CGI query
    string. This is the part of a URL that follows the question mark.

    For example, you could have a URL like this:
    [url]http://www.crowbarlivemusic.com/calendar.cfm?yr=2005&mo=5&da=31[/url]

    With those parameters, you can create a date object in ColdFusion:
    CFSET showdate = CreateDate(URL.yr, URL.mo, URL.da)
    This would allow you to query the database for records that match this date.

    Dates can be tricky, so you need to be aware of how you create date values in
    the database and how you query them. Date fields in Access actually contain
    dates and times, but if you don't specify a time it defaults to 00:00:00. I
    usually query for a date by looking for all date values between times 00:00:00
    and 23:59:59 on a particular day.

    As you build your database, you can use different date functions to create
    weekly or monthly calendars in addition to individual days.

    -Paul

    Paul Dempsey
    Dickinson College

    dempster Guest

  8. #7

    Default Re: ColdFusion Calendar

    Thanks! your comments are very helpful!

    i'm not sure if this is what you mean or not, but i have the show time column
    set in access as "medium time" and the date of show set as "short date".

    i feel like the info you've provided will put me on the cusp of a finished
    project-- i only need you to please be a bit more specific about how i should
    organize that data, and if i need to code any special settings in CFML in order
    to reach my desired result. if i read you correctly however, i believe "short
    date" takes care of the time problem.

    any ideas about the no ticket price problem? could i accomplish that w/ a
    <cfif> statement? if so, any suggestions on how to handle that data?

    and what about the "1" , "0" vs yes / no for the all-ages category?

    thank you very much!

    jsabarese Guest

  9. #8

    Default Re: ColdFusion Calendar

    now that i see how many people have apparently tested this page, i'm thinking
    that i need to have ColdFusion process the dates-- so no two Events are allowed
    to be posted on the same date-- to avoid human error... or at least a warning
    message should pop-up in the case that it is necessary to disply two seperate
    events on the same date. suggestions for that?

    jsabarese Guest

  10. #9

    Default Re: ColdFusion Calendar

    Originally posted by: jmj1. Decide a new variable name for your field that you
    want to output. (Make it different than you db one)
    2. Write an cfif statement.
    <cfif queryname.ticketprice is '' or queryname.ticketprice is '0'>
    <cfset newticketprice="N/A">
    <CFELSE>
    <CFSET newticketprice=queryname.ticketprice >
    </CFIF>
    3. Replace the old variable with the new variable name in the output.
    (note: put the cfif in a loop if you are looping through data)
    About the urls to show the data from different dates. Your url link will have
    the database info in it to show the user the correct data. Usually you'd use
    some id.
    For example <a href= "blah.cfm?=BandId=#BandID#>#BandName#</a>


    will this go at the top of the document along w/ the <cfquery...> INSERT into
    tablename</cfquery>? should it be inside of the original query in place of the
    current code:
    <cfif IsDefined("FORM.TIX_ADV") AND #FORM.TIX_ADV# NEQ "">
    #FORM.TIX_ADV#
    <cfelse>
    NULL
    </cfif>

    ?

    jsabarese Guest

  11. #10

    Default Re: ColdFusion Calendar

    Short date and short time are Access input masks. The actual date object in the
    field is a full ODBC date/time. Depending on how you insert a record into the
    database, it may just have the default time of 00:00:00.

    You may need to validate data and check for duplicates before you add a
    record. I tried to submit Feb. 30, 2006 and of course it crashed with an error.
    And as you noted, without checking people can add multiple events for a given
    date.

    You do need to learn more about using dates and times - as I mentioned before,
    it can be pretty complex.

    -Paul

    dempster Guest

  12. #11

    Default Re: ColdFusion Calendar

    the date field in the form looks like this:

    <tr valign="baseline">
    <td nowrap align="right">Date of Show (mm/dd/yy) :</td>
    <td><input type="text" name="DOS" value="03/05/06" size="32"></td>
    </tr>

    and the query looks like this:

    <cfif IsDefined("FORM.DOS") AND #FORM.DOS# NEQ "">
    '#FORM.DOS#'
    <cfelse>
    NULL
    </cfif>

    does that help you to help me? where do i need to look to determine if i'm
    doing it the "right" way?

    jsabarese Guest

  13. #12

    Default Re: ColdFusion Calendar

    If you are going to allow the user to enter a date as a string of text, you can
    use a ColdFusion feature that validates data as a date type. Place this hidden
    field in your form:

    INPUT TYPE="hidden" NAME="DOS_date" VALUE="Enter valid date for show."

    If the user enters an invalid date, ColdFusion will flag this when processing
    the form and will display the error message.

    You can also control date input a little more by using select boxes to display
    months, dates and years. You can use ColdFusion to generate these in your form:

    <SELECT NAME="month">
    <CFLOOP INDEX="mo" FROM="1" TO="12"><OPTION
    VALUE="#mo#">#MonthAsString(mo)#</CFLOOP>
    </SELECT>
    <SELECT NAME="day">
    <CFLOOP INDEX="dd" FROM="1" TO="31"><OPTION VALUE="#dd#">#dd#</CFLOOP>
    </SELECT>

    Then when the form is submitted, use the CreateDate function to put together
    the month, day and year to make a date object.

    You might want to consider making the show date and time a single date field.
    This could be a little more efficient in your database. You would want to add
    time fields to the form and then use CreateDateTime to put it all together
    before adding to the database.

    -Paul


    dempster Guest

  14. #13

    Default Re: ColdFusion Calendar

    i just realized that my form and the corresponding insert query were not setup
    the way i thought i had it. i was overlooking some simple stuff-- typical case
    of looking at the same or similar code for way too long!

    the hyperlinks are now properly generated w/ dynamic data, and the ALL_AGES
    insert now results in the appropriate text instead of ones and zeros.

    i browsed the exchange, but i didn't find what i'm looking for-- perhaps
    because i don't know precisely what to call it. i thought it would be great to
    solve the DOS (show date) problem w/ a pop up java (or otherwise) calendar,
    which would look like a calendar, months could be selected, and it would
    control the data by allowing the user to only submit certain values, and it
    would add a "neat-o" factor as well.

    anyone have code for something like i've described?

    dempster, i copied and pasted your code (from your most recent post above)
    and put it in the bottom left corner of my modified page. it's not submitting
    data as part of my form, but i wanted to see what it looked like.
    is [url]http://www.eastcoastbandnetwork.com/cfdocs/eureka_new.cfm[/url] how it's supposed
    to behave? i very much appreciate all of your help, but i'm confused w/ that
    code.

    thanks again!


    jsabarese Guest

  15. #14

    Default Re: ColdFusion Calendar

    Make sure you enclose the code in CFOUTPUT tags to display the values of the
    variables. I've attached some code that also shows the year field, starting
    with the current year and allowing the user to go forward 3 years. This code
    also pre-selects the current month and day as a starting default.

    -Paul



    <CFSET TDATE=NOW()>
    <CFOUTPUT>
    <SELECT NAME="month">
    <CFLOOP INDEX="mo" FROM="1" TO="12"><OPTION VALUE="#mo#"<CFIF MONTH(TDATE) EQ
    MO> SELECTED</CFIF>>#MonthAsString(mo)#</CFLOOP>
    </SELECT>
    <SELECT NAME="day">
    <CFLOOP INDEX="dd" FROM="1" TO="31"><OPTION VALUE="#dd#"<CFIF DAY(TDATE) EQ
    DD> SELECTED</CFIF>>#dd#</CFLOOP>
    </SELECT>
    <SELECT NAME="year">
    <CFLOOP INDEX="yy" FROM="#Year(tdate)#" TO="#Evaluate(Year(tdate) +
    3)#"><OPTION VALUE="#yy#"<CFIF YEAR(TDATE) EQ YY> SELECTED</CFIF>>#yy#</CFLOOP>
    </SELECT>
    </CFOUTPUT>

    dempster Guest

  16. #15

    Default Re: ColdFusion Calendar

    if you going to usethe pull down, remember to check if the date is valid, IsDate(string)

    jorgepino Guest

  17. #16

    Default Re: ColdFusion Calendar

    forgive me-- i haven't attempted to code for the ability to send absolute URLs,
    in a weekly calendar event newsletter for example.

    i guess i'm intimidated by the available options.
    you've seen my main "admin" data entry page. now that i have IT working the
    way i want, what should be my next page that i need to create? how many
    supplemental pages will i ultimately need?

    i plan to have a template that the dynamic code will use so they all look the
    same, so i guess that's one page-- unless i library item is used, but where do
    i go from there?

    i feel that once i get that part started, the rest will come to me--
    epsecially considering all of the extremely helpful posts in this thread!

    jsabarese Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139