home *** CD-ROM | disk | FTP | other *** search
Wrap
<!--- This template will fetch all the other instances that coincide with this one and allow the user to set a priority accordingly ---> <!--- First let's do something with these scheduling variables ---> <CFIF StartType IS 0> <CFSET StartDateTime = ""> <CFELSE> <!--- This CFIF block is just to covert to 24hr format ---> <CFIF StartAMPM IS "PM"> <CFSET TempHour = StartHour + 12> <CFELSE> <CFSET TempHour = StartHour> </CFIF> <CFSET StartDateTime = CreateDateTime(StartYear, StartMonth, StartDay, TempHour, StartMinute, 0)> </CFIF> <CFIF EndType IS 0> <CFSET EndDateTime = ""> <CFELSE> <!--- This CFIF block is just to covert to 24hr format ---> <CFIF EndAMPM IS "PM"> <CFSET TempHour = EndHour + 12> <CFELSE> <CFSET TempHour = EndHour> </CFIF> <CFSET EndDateTime = CreateDateTime(EndYear, EndMonth, EndDay, TempHour, EndMinute, 0)> </CFIF> <!--- Find all the instances that would ever appear with this one ---> <CFQUERY DATASOURCE="CFexamples" NAME="GetRelevantInstances"> SELECT * FROM PubInstances, PubContent WHERE PubInstances.ObjectID = PubContent.ObjectID AND PubContent.TypeID = 1 AND PageID = #PageID# AND Location = #Location# <CFIF NOT StartDateTime IS ""> AND (EndTime >= #StartDateTime# OR EndTime = Null) </CFIF> <CFIF NOT EndDateTime IS ""> AND (StartTime <= #EndDateTime# OR StartTime = Null) </CFIF> ORDER BY Priority DESC </CFQUERY> <CFIF GetRelevantInstances.RecordCount NEQ 0> <!--- Find out what Content Type 1 is called ---> <CFQUERY DATASOURCE="CFexamples" NAME="GetTypeName"> SELECT * FROM PubContentTypes WHERE TypeID = 1 </CFQUERY> </CFIF> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN"> <HTML> <HEAD> <TITLE>Add Instance</TITLE> <STYLE TYPE="text/css"> <!-- A {text-decoration: none} --> </STYLE> </HEAD> <BODY BGCOLOR="#660000" TEXT="#FFFFFF" LINK="#FFFF00" VLINK="#FFFF00"> <TABLE ALIGN="RIGHT" CELLPADDING="0" CELLSPACING="0"> <TR> <TD ALIGN="RIGHT"> <FONT FACE="MS Sans Serif, Helvetica" SIZE="-2"> <A HREF="index.cfm">Administrator Home</A><BR> <CFOUTPUT><A HREF="properties.cfm?ObjectID=#ObjectID#">Return to Object #ObjectID#</A></CFOUTPUT> </FONT> </TD> </TR> </TABLE> <P><IMG SRC="images/createinstance.gif" WIDTH=131 HEIGHT=20 BORDER=0 ALT="Create Instance"></P> <P><FONT FACE="MS Sans Serif, Helvetica" SIZE="-1"><CFOUTPUT>Creating an instance for <B>Object #ObjectID#</B> on <B>#TemplatePath#</B>, in <B>Location #Location#</B>...</CFOUTPUT></P> <BR> <FORM ACTION="createinstance5.cfm" METHOD="POST"> <CFOUTPUT> <INPUT TYPE="HIDDEN" NAME="ObjectID" VALUE="#ObjectID#"> <INPUT TYPE="HIDDEN" NAME="PageID" VALUE="#PageID#"> <INPUT TYPE="HIDDEN" NAME="Location" VALUE="#Location#"> <INPUT TYPE="HIDDEN" NAME="StartTime" VALUE="#StartDateTime#"> <INPUT TYPE="HIDDEN" NAME="EndTime" VALUE="#EndDateTime#"> </CFOUTPUT> <P><FONT FACE="MS Sans Serif, Helvetica" SIZE="-2"><B>Priority:</B></FONT><BR> <INPUT TYPE="TEXT" NAME="Priority" SIZE="4" VALUE="100"> </P> <P><INPUT TYPE="SUBMIT" VALUE="Continue"></P> <CFIF GetRelevantInstances.RecordCount IS 0> <TABLE BORDER="1" CELLPADDING="5" CELLSPACING="2"> <TR> <TD> <P><FONT FACE="MS Sans Serif, Helvetica" SIZE="-2"> No other objects are scheduled to appear on this page, in this<BR> location, at the same time as this object. You may assign the<BR> priority of this instance to any value.</FONT></P> </TD> </TR> </TABLE> <CFELSE> <P><FONT FACE="MS Sans Serif, Helvetica" SIZE="-2"> <CFOUTPUT>Listed below are object(s) which are scheduled to appear on<BR> page <B>#TemplatePath#</B> in location <B>#Location#</B> at the same time as the<BR> instance you are scheduling.</CFOUTPUT> </FONT></P> <P><FONT FACE="MS Sans Serif, Helvetica" SIZE="-2"> Please set this instance's priority to determine the order in<BR> which they should appear (higher numbers will appear first). </FONT></P> <TABLE BORDER="1" CELLPADDING="5" CELLSPACING="2"> <TR> <TD><FONT FACE="MS Sans Serif, Helvetica" SIZE="-2"><B>ObjectID</B></FONT></TD> <TD><FONT FACE="MS Sans Serif, Helvetica" SIZE="-2"><B>Start Time</B></FONT></TD> <TD><FONT FACE="MS Sans Serif, Helvetica" SIZE="-2"><B>End Time</B></FONT></TD> <TD><FONT FACE="MS Sans Serif, Helvetica" SIZE="-2"><B><CFOUTPUT>#GetTypeName.TypeName#</CFOUTPUT></B></FONT></TD> <TD><FONT FACE="MS Sans Serif, Helvetica" SIZE="-2"><B>Priority</B></FONT></TD> </TR> <CFOUTPUT QUERY="GetRelevantInstances"> <TR> <TD><FONT FACE="MS Sans Serif, Helvetica" SIZE="-2">#ObjectID#</FONT></TD> <TD><FONT FACE="MS Sans Serif, Helvetica" SIZE="-2"> <CFIF StartTime IS "">Beginning of time <CFELSE>#StartTime#</CFIF> </FONT></TD> <TD><FONT FACE="MS Sans Serif, Helvetica" SIZE="-2"> <CFIF EndTime IS "">End of time <CFELSE>#EndTime#</CFIF> </FONT></TD> <TD><FONT FACE="MS Sans Serif, Helvetica" SIZE="-2">#Data#</FONT></TD> <TD><FONT FACE="MS Sans Serif, Helvetica" SIZE="-2">#Priority#</FONT></TD> </TR> </CFOUTPUT> </TABLE> </CFIF> </FORM> </BODY> </HTML> <CFHEADER NAME="Expires" VALUE="#Now()#">