home *** CD-ROM | disk | FTP | other *** search
- <%
- #include </utility/security.fts>
- #include </utility/global.fts>
- #include </utility/theme.fts>
- #include </utility/ftgate.fts>
- #include </utility/asperrors.fts>
-
- var s = new server.smartpop
- var sched = new server.schedule
-
- session.system.error = 0
-
- if (form.config=="1")
- {
- s.id=form.id
-
- if (form.command==1)
- {
- var names=string(form.names)
- var start=0
- var pos=names.indexof(",",0)
- while (pos!=-1)
- {
- s.schedule.add(names.slice(start, pos))
- start=pos+1
- pos=names.indexof(",",start)
- }
- }
- else if (form.command==2)
- {
- var names=string(form.names)
- var start=0
- var pos=names.indexof(",",0)
- while (pos!=-1)
- {
- s.schedule.remove(names.slice(start, pos))
- start=pos+1
- pos=names.indexof(",",start)
- }
- }
-
- if (form.redirect!="")
- output.redirect(form.redirect+"?id="+s.id)
- }
- else if (form.config=="2")
- {
- if (form.redirect!="")
- output.redirect(form.redirect+"?id="+form.id)
- }
- else
- {
- s.id=request.id
- }
- %>
- <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd">
- <HTML>
- <HEAD>
- <LINK REL=STYLESHEET HREF="/utility/main<%=nn4%>.css" TYPE="text/css">
- <META name="GENERATOR" content="Microsoft Developer Studio">
- <META http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
- <TITLE>SmartPops -- Assigned Schedules</TITLE>
-
- <SCRIPT LANGUAGE="JavaScript1.2" TYPE="text/javascript">
- <!--
- var dir="<%=buttons%>";
- var pro=<%=build()==FTGATE_PRO%>;
-
- if (!document.images) {}
- else {
- create0 = new Image();
- create0.src = dir+"next.gif";
- create1 = new Image();
- create1.src = dir+"nexton.gif";
- delete0 = new Image();
- delete0.src = dir+"prev.gif";
- delete1 = new Image();
- delete1.src = dir+"prevon.gif";
- clear0 = new Image();
- clear0.src = dir+"deleteall.gif";
- clear1 = new Image();
- clear1.src = dir+"deleteallon.gif";
- }
-
- <%
- if (netscape)
- {
- %>
- document.captureEvents(Event.KEYPRESS);
- document.onkeypress = keypress;
-
- function keypress(event)
- {
- if (event.which==13)
- {
- if (document.activeElement==document.ftgate.available)
- onAddSchedule();
- else if (document.activeElement==document.ftgate.schedules)
- onDelete();
-
- return false;
- }
-
- return true;
- }
- <%
- }
- else
- {
- %>
- function keypress()
- {
- if (event.keyCode==13)
- {
- if (document.activeElement==document.ftgate.available)
- onAddSchedule();
- else if (document.activeElement==document.ftgate.schedules)
- onDelete();
-
- event.returnValue=null;
- }
- }
- <%
- }
- %>
-
- function onLoad()
- {
- setPage(6, "SmartPops");
- <%
- if (session.system.error!=0)
- {
- %>
- window.alert(aspError(<%=session.system.error%>)+" (<%=s.name%>)");
- <%
- }
- %>
-
- var list = document.ftgate.available
- if (document.ftgate.available.length)
- document.ftgate.available.focus();
- else
- document.ftgate.schedules.focus();
- }
-
- function onAddSchedule()
- {
- change('addA', 'create', 0);
-
- var list = document.ftgate.available;
- var names = "";
-
- if (list.selectedIndex!=-1)
- {
- var i;
-
- for (i=0; i<list.length; i++)
- {
- if (list.options[i].selected)
- {
- names+=list.options[i].text;
- names+=",";
- }
- }
-
- document.ftgate.names.value=names;
- document.ftgate.command.value="1"
- document.ftgate.submit();
- }
- }
-
- function isOK()
- {
- return true;
- }
-
- function onDelete()
- {
-
- change("deleteA", "delete", 0);
-
- var list = document.ftgate.schedules
- var names = "";
- var count = 0;
-
- if (list.selectedIndex!=-1)
- {
- var i;
-
- for (i=0; i<list.length; i++)
- {
- if (list.options[i].selected)
- {
- names+=list.options[i].text;
- names+=",";
- count++;
- }
- }
-
- if (count==list.length)
- {
- alert("You cannot remove all of the assigned schedules. At least one schedule must remain in the list.");
- return;
- }
-
- document.ftgate.names.value=names;
- document.ftgate.command.value="2"
- document.ftgate.submit();
- }
-
- }
-
- //-->
- </SCRIPT>
- <SCRIPT LANGUAGE="JavaScript1.2" SRC="/utility/cookies.js" TYPE="text/javascript"></SCRIPT>
- <SCRIPT LANGUAGE="JavaScript1.2" SRC="/utility/core.js" TYPE="text/javascript"></SCRIPT>
- <SCRIPT LANGUAGE="JavaScript1.2" SRC="/utility/spin.js" TYPE="text/javascript"></SCRIPT>
- <SCRIPT LANGUAGE="JavaScript1.2" SRC="/utility/time.js" TYPE="text/javascript"></SCRIPT>
- <SCRIPT LANGUAGE="JavaScript1.2" SRC="/utility/dialog.js" TYPE="text/javascript"></SCRIPT>
- <SCRIPT LANGUAGE="JavaScript1.2" SRC="/utility/asperrors.js" TYPE="text/javascript"></SCRIPT>
- </HEAD>
-
- <BODY BGCOLOR="white" onLoad="onLoad()" MARGINHEIGHT="0" MARGINWIDTH="0" onkeypress="keypress()">
-
- <TABLE BORDER="0" BGCOLOR="<%=border%>" WIDTH="<%=bodywidth%>" HEIGHT="<%=bodyheight%>" CELLPADDING="0" CELLSPACING="0"><TR><TD> </TD><TD VALIGN="TOP">
-
- <A HREF="index.fts"><SPAN ID="top">SmartPops</SPAN></A><SPAN ID="top"> /</SPAN>
- <SPAN ID="topsel"><%=s.name%></SPAN>
-
- <FORM NAME="ftgate" METHOD="POST" onSubmit="return isOK(this)" ACTION="schedules.fts">
- <!-- hidden variables -->
- <INPUT TYPE="HIDDEN" NAME="name" VALUE="<%=s.name%>">
- <INPUT TYPE="HIDDEN" NAME="config" VALUE="1">
- <INPUT TYPE="HIDDEN" NAME="command" VALUE="0">
- <INPUT TYPE="HIDDEN" NAME="id" VALUE="<%=s.id%>">
- <INPUT TYPE="HIDDEN" NAME="assigned" VALUE="">
- <INPUT TYPE="HIDDEN" NAME="names" VALUE="">
- <INPUT TYPE="HIDDEN" NAME="redirect" VALUE="">
-
- <!-- start of the tabs -->
- <TABLE BORDER="0" WIDTH="100%" CELLSPACING="0" CELLPADDING="0">
- <TR>
- <TD WIDTH="5" HEIGHT="18"><IMG SRC="/images/left.gif" VSPACE="0" BORDER="0" WIDTH="5" HEIGHT="18"></TD>
- <TD CLASS="navoff" WIDTH="50" HEIGHT="18" ALIGN="CENTER"><A HREF="javascript:onLaunch('smartpop.fts')" CLASS="navoff">General</A></TD>
- <TD BGCOLOR="black" WIDTH="1" HEIGHT="18" ALIGN="CENTER"><IMG SRC="/images/1pixel.gif" WIDTH="1" HEIGHT="18"></TD>
- <TD CLASS="navoff" WIDTH="55" HEIGHT="18" ALIGN="CENTER"><A HREF="javascript:onLaunch('settings.fts')" CLASS="navoff">Settings</A></TD>
- <TD BGCOLOR="black" WIDTH="1" HEIGHT="18" ALIGN="CENTER"><IMG SRC="/images/1pixel.gif" WIDTH="1" HEIGHT="18"></TD>
- <TD CLASS="navon" WIDTH="55" HEIGHT="18" ALIGN="CENTER"><A HREF="javascript:onLaunch('schedules.fts')" CLASS="navon">Schedules</A></TD>
- <TD BGCOLOR="black" WIDTH="1" HEIGHT="18" ALIGN="CENTER"><IMG SRC="/images/1pixel.gif" WIDTH="1" HEIGHT="18"></TD>
- <TD CLASS="navoff" WIDTH="50" HEIGHT="18"ALIGN="CENTER"><A HREF="javascript:onLaunch('rules.fts')" CLASS="navoff">Rules</A></TD>
- <TD WIDTH="5" HEIGHT="18"><IMG SRC="/images/right.gif" VSPACE="0" BORDER="0" WIDTH="5" HEIGHT="18"></TD>
- <TD WIDTH="<%=bodywidth-223%>" HEIGHT="18"> </TD>
- </TR>
- </TABLE>
- <!-- end of the tabs -->
-
- <!-- start of the tab body -->
- <TABLE BORDER="0" BGCOLOR="<%=border%>" WIDTH="100%" CELLPADDING="0" CELLSPACING="0"><TR><TD>
- <TABLE <%=table%> CELLPADDING="0" CELLSPACING="0">
- <!-- start of block -->
- <TR>
- <TD VALIGN="TOP">
- <TABLE BORDER="0" WIDTH="100%">
- <!-- sub table goes here -->
- <TR>
- <TD>
- <TABLE CLASS="box" WIDTH="100%">
- <TR>
- <TD>
- <TABLE BORDER="0" WIDTH="100%">
- <TR>
- <TH>Available schedules</TH>
- <TD> </TD>
- <TH>Assigned schedules</TH>
- </TR>
- <TR>
- <TD NOWRAP VALIGN="TOP">
- <SELECT SIZE="10" NAME="available" MULTIPLE CLASS="SEL100">
- <%
- var avail = false
-
- var ok=sched.first()
- while (ok)
- {
- var found = false
- var ok2=s.schedule.first()
- while (ok2)
- {
- if (sched.name==s.schedule.name)
- found = true
-
- ok2=s.schedule.next()
- }
-
- if (!found)
- {
- avail=true
- %>
- <OPTION VALUE="<%=sched.name%>"><%=sched.name%></OPTION>
- <%
- }
- ok=sched.next()
- }
- %>
- </SELECT>
- </TD>
- <TD VALIGN="TOP" ALIGN="CENTER">
- <%
- if (avail)
- {
- %>
- <A onMouseDown="change('addA','create',1)" onMouseOut="change('addA','create',0)" HREF="javascript:onAddSchedule()">
- <IMG SRC="<%=buttons%>next.gif" WIDTH="40" HEIGHT="20" BORDER="0" NAME="addA" ALT="Assign schedule"></A><P>
- <%
- }
- else
- {
- %>
- <IMG SRC="<%=buttons%>nextoff.gif" WIDTH="40" HEIGHT="20" BORDER="0" NAME="addA" ALT="Assign schedule"><P>
- <%
- }
- if (s.schedule.first())
- {
- %>
- <A onMouseDown="change('deleteA','delete',1)" onMouseOut="change('deleteA','delete',0)"
- HREF="javascript:onDelete()"><IMG SRC="<%=buttons%>prev.gif" WIDTH="40" HEIGHT="20" BORDER="0" NAME="deleteA" ALT="Remove schedule"></A>
- <%
- }
- else
- {
- %>
- <IMG SRC="<%=buttons%>prevoff.gif" WIDTH="40" HEIGHT="20" BORDER="0" NAME="deleteA" ALT="Remove schedule"></A>
- <%
- }
- %>
- </TD>
- <TD>
- <SELECT NAME="schedules" SIZE="10" MULTIPLE CLASS="SEL100">
- <%
- ok=s.schedule.first()
- while (ok)
- {
- %>
- <OPTION VALUE="<%=s.schedule.name%>"><%=s.schedule.name%></OPTION>
- <%
- ok=s.schedule.next()
- }
- %>
- </SELECT>
- </TD>
- </TR>
- </TABLE>
- </TD>
- </TR>
- </TABLE>
- </TD>
- </TR>
- <!-- sub table ends here -->
- <!-- sub table goes here -->
- <TR>
- <TD ALIGN="RIGHT">
- <A HREF="javascript:onClose()"
- onMouseDown="change('closeA', 'ok', 1)"
- onMouseOut="change('closeA', 'ok', 0)"><IMG SRC="<%=buttons%>ok.gif" NAME="closeA" BORDER="0" WIDTH="50" HEIGHT="20" ALT="Apply changes and close" HSPACE="5"></A>
- </TD>
- </TR>
- <!-- sub table ends here -->
- </TABLE>
- </TD>
- </TR>
- <!-- end of block -->
- </TABLE>
- <!-- end of the tab body -->
- </TD></TR></TABLE>
-
- <!-- footer starts here -->
- <SCRIPT LANGUAGE="JavaScript1.2" TYPE="text/javascript">
- <!--
- var href="/smartpop/schedules.fts?id=<%=s.id%>";
- var bodywidth=<%=bodywidth%>;
- //-->
- </SCRIPT>
- <SCRIPT LANGUAGE="JavaScript1.2" SRC="/utility/footer.js" TYPE="text/javascript"></SCRIPT>
- <!-- footer ends here -->
- </FORM>
- </TD><TD WIDTH="10"> </TD></TR></TABLE>
- </BODY>
- </HTML>
-