home *** CD-ROM | disk | FTP | other *** search
/ Australian Personal Computer 1999 April / APC443.iso / features / grpware / coldfus / coldfusi.exe / data1.cab / Examples / publish / admin / createinstance4.cfm < prev    next >
Encoding:
Text File  |  1998-10-08  |  5.1 KB  |  157 lines

  1. <!--- This template will fetch all the other instances that coincide with this
  2.     one and allow the user to set a priority accordingly --->
  3.  
  4. <!--- First let's do something with these scheduling variables --->
  5.  
  6. <CFIF StartType IS 0>
  7.     <CFSET StartDateTime = "">
  8. <CFELSE>
  9.     <!--- This CFIF block is just to covert to 24hr format --->
  10.     <CFIF StartAMPM IS "PM">
  11.         <CFSET TempHour = StartHour + 12>
  12.     <CFELSE>
  13.         <CFSET TempHour = StartHour>
  14.     </CFIF>
  15.     <CFSET StartDateTime = CreateDateTime(StartYear, StartMonth, StartDay, TempHour, StartMinute, 0)>
  16. </CFIF>
  17.  
  18. <CFIF EndType IS 0>
  19.     <CFSET EndDateTime = "">
  20. <CFELSE>
  21.     <!--- This CFIF block is just to covert to 24hr format --->
  22.     <CFIF EndAMPM IS "PM">
  23.         <CFSET TempHour = EndHour + 12>
  24.     <CFELSE>
  25.         <CFSET TempHour = EndHour>
  26.     </CFIF>
  27.     <CFSET EndDateTime = CreateDateTime(EndYear, EndMonth, EndDay, TempHour, EndMinute, 0)>
  28. </CFIF>
  29.  
  30. <!--- Find all the instances that would ever appear with this one --->
  31. <CFQUERY DATASOURCE="CFexamples" NAME="GetRelevantInstances">
  32. SELECT * FROM PubInstances, PubContent
  33. WHERE PubInstances.ObjectID = PubContent.ObjectID
  34.     AND PubContent.TypeID = 1
  35.     AND PageID = #PageID#
  36.     AND Location = #Location#
  37.     <CFIF NOT StartDateTime IS "">
  38.         AND (EndTime >= #StartDateTime# OR EndTime = Null)
  39.     </CFIF>
  40.     <CFIF NOT EndDateTime IS "">
  41.         AND (StartTime <= #EndDateTime# OR StartTime = Null)
  42.     </CFIF>
  43. ORDER BY Priority DESC
  44. </CFQUERY>
  45.  
  46. <CFIF GetRelevantInstances.RecordCount NEQ 0>
  47.     <!--- Find out what Content Type 1 is called --->
  48.     <CFQUERY DATASOURCE="CFexamples" NAME="GetTypeName">
  49.     SELECT * FROM PubContentTypes
  50.     WHERE TypeID = 1
  51.     </CFQUERY>
  52. </CFIF>
  53.  
  54. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
  55.  
  56. <HTML>
  57. <HEAD>
  58.     <TITLE>Add Instance</TITLE>
  59. <STYLE TYPE="text/css">
  60. <!-- A {text-decoration: none} -->
  61. </STYLE>
  62. </HEAD>
  63.  
  64. <BODY BGCOLOR="#660000" TEXT="#FFFFFF" LINK="#FFFF00" VLINK="#FFFF00">
  65.  
  66. <TABLE ALIGN="RIGHT" CELLPADDING="0" CELLSPACING="0">
  67. <TR>
  68.     <TD ALIGN="RIGHT">
  69.     <FONT FACE="MS Sans Serif, Helvetica" SIZE="-2">
  70.         <A HREF="index.cfm">Administrator Home</A><BR>
  71.         <CFOUTPUT><A HREF="properties.cfm?ObjectID=#ObjectID#">Return to Object #ObjectID#</A></CFOUTPUT>
  72.     </FONT>
  73.     </TD>
  74. </TR>
  75. </TABLE>
  76.  
  77. <P><IMG SRC="images/createinstance.gif" WIDTH=131 HEIGHT=20 BORDER=0 ALT="Create Instance"></P>
  78.  
  79. <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>
  80.  
  81. <BR>
  82.  
  83. <FORM ACTION="createinstance5.cfm" METHOD="POST">
  84.  
  85. <CFOUTPUT>
  86.     <INPUT TYPE="HIDDEN" NAME="ObjectID" VALUE="#ObjectID#">
  87.     <INPUT TYPE="HIDDEN" NAME="PageID" VALUE="#PageID#">
  88.     <INPUT TYPE="HIDDEN" NAME="Location" VALUE="#Location#">
  89.     <INPUT TYPE="HIDDEN" NAME="StartTime" VALUE="#StartDateTime#">
  90.     <INPUT TYPE="HIDDEN" NAME="EndTime" VALUE="#EndDateTime#">
  91. </CFOUTPUT>
  92.  
  93. <P><FONT FACE="MS Sans Serif, Helvetica" SIZE="-2"><B>Priority:</B></FONT><BR>
  94. <INPUT TYPE="TEXT" NAME="Priority" SIZE="4" VALUE="100">
  95. </P>
  96.  
  97. <P><INPUT TYPE="SUBMIT" VALUE="Continue"></P>
  98.  
  99. <CFIF GetRelevantInstances.RecordCount IS 0>
  100.  
  101.     <TABLE BORDER="1" CELLPADDING="5" CELLSPACING="2">
  102.     <TR>
  103.         <TD>
  104.         <P><FONT FACE="MS Sans Serif, Helvetica" SIZE="-2">
  105.         No other objects are scheduled to appear on this page, in this<BR>
  106.         location, at the same time as this object. You may assign the<BR>
  107.         priority of this instance to any value.</FONT></P>
  108.         </TD>
  109.     </TR>
  110.     </TABLE>
  111.  
  112. <CFELSE>
  113.  
  114.     <P><FONT FACE="MS Sans Serif, Helvetica" SIZE="-2">
  115.     <CFOUTPUT>Listed below are object(s) which are scheduled to appear on<BR>
  116.     page <B>#TemplatePath#</B> in location <B>#Location#</B> at the same time as the<BR>
  117.     instance you are scheduling.</CFOUTPUT>
  118.     </FONT></P>
  119.  
  120.     <P><FONT FACE="MS Sans Serif, Helvetica" SIZE="-2">
  121.     Please set this instance's priority to determine the order in<BR>
  122.     which they should appear (higher numbers will appear first).
  123.     </FONT></P>
  124.  
  125.     <TABLE BORDER="1" CELLPADDING="5" CELLSPACING="2">
  126.     <TR>
  127.         <TD><FONT FACE="MS Sans Serif, Helvetica" SIZE="-2"><B>ObjectID</B></FONT></TD>
  128.         <TD><FONT FACE="MS Sans Serif, Helvetica" SIZE="-2"><B>Start Time</B></FONT></TD>
  129.         <TD><FONT FACE="MS Sans Serif, Helvetica" SIZE="-2"><B>End Time</B></FONT></TD>
  130.         <TD><FONT FACE="MS Sans Serif, Helvetica" SIZE="-2"><B><CFOUTPUT>#GetTypeName.TypeName#</CFOUTPUT></B></FONT></TD>
  131.         <TD><FONT FACE="MS Sans Serif, Helvetica" SIZE="-2"><B>Priority</B></FONT></TD>
  132.     </TR>
  133.     <CFOUTPUT QUERY="GetRelevantInstances">
  134.     <TR>
  135.         <TD><FONT FACE="MS Sans Serif, Helvetica" SIZE="-2">#ObjectID#</FONT></TD>
  136.         <TD><FONT FACE="MS Sans Serif, Helvetica" SIZE="-2">
  137.             <CFIF StartTime IS "">Beginning of time
  138.             <CFELSE>#StartTime#</CFIF>
  139.             </FONT></TD>
  140.         <TD><FONT FACE="MS Sans Serif, Helvetica" SIZE="-2">
  141.             <CFIF EndTime IS "">End of time
  142.             <CFELSE>#EndTime#</CFIF>
  143.             </FONT></TD>
  144.         <TD><FONT FACE="MS Sans Serif, Helvetica" SIZE="-2">#Data#</FONT></TD>
  145.         <TD><FONT FACE="MS Sans Serif, Helvetica" SIZE="-2">#Priority#</FONT></TD>
  146.     </TR>
  147.     </CFOUTPUT>
  148.     </TABLE>
  149.     
  150. </CFIF>
  151.  
  152. </FORM>
  153.  
  154. </BODY>
  155. </HTML>
  156.  
  157. <CFHEADER NAME="Expires" VALUE="#Now()#">