Milestones Professional ASP Example #4

This example uses Active Server Pages (ASP) to:
   
1     Let the user choose a schedule from a list of several.  Let the user enter a sub-title for the schedule. 
  
2 Add the user-entered title to the schedule and then generate a bitmap for display in the user's browser.
    

About using Milestones with ASP Scripts on your WebServer

Run one of our examples on our server

   
ASP CODE   
   
<%
response.expires = 0
response.expiresabsolute = Now() - 1
response.addHeader "pragma","no-cache"
response.addHeader "cache-control","private"
Response.CacheControl = "no-cache"
%>
<html>

<table border="0" width="100%">
<tr>
<td width="100%"><img border="0" src="/images2000/prologo5.gif" ></td>
</tr>
<tr>
<td width="100%"><font color="#0000FF"><b><font face="Verdana" size="4">Scheduling
A</font></b><b><font face="Verdana" size="4">utomation Demo</font></b></font></td>
</tr>
</table>
<p><a href="automationdemo.html"><span style="background-color: #00FFFF"><b><i><u><font face="Verdana" color="#0000FF" size="2">Back
to automation demo main page</font></u></i></b></span></a></p>

<head><title>Live Milestones Server Demo</title><head>
<body bgcolor=white text=black>
<blockquote>
<H3>Live Milestones Server Demo</H3>

<FORM ACTION="<%=QueryForm%>" METHOD=POST>
<TABLE WIDTH=500>
<TR>
<TD>Choose a schedule, enter a title and press the button:</TD>
</TR>
<TR><TD><br></TD>
</TR>
<TR>
<TD><INPUT TYPE="radio" NAME="TYPE" VALUE="D" CHECKED>Design</TD>
</TR>
<TR>
<TD><INPUT TYPE="radio" NAME="TYPE" VALUE="W">Waterfall</TD>
</TR>
<TD><INPUT TYPE="radio" NAME="TYPE" VALUE="GC">Government Contract</TD>
</TR>
<TD><INPUT TYPE="radio" NAME="TYPE" VALUE="MS">Master Schedule</TD>
</TR>
<TD><INPUT TYPE="radio" NAME="TYPE" VALUE="EV">Earned Value</TD>
</TR>
<TD><INPUT TYPE="radio" NAME="TYPE" VALUE="CD">Condo Project</TD>
</TR>
<TR><TD><br></TD>
</TR>
<TD ALIGN="left"><font face="Verdana" >Enter a title:
<INPUT TYPE="text" NAME="title"></INPUT></TD>
<TR><TD><br></TD>
<TR>
<TD><INPUT TYPE="SUBMIT" NAME="Action" VALUE="Show Schedule"></TD>
</TR>
</TR>
</TABLE>
</FORM>

<%
' Set Initial Conditions

' Did the user press a RUN button to execute the form? If so get the form variables.
if Request.ServerVariables("REQUEST_METHOD") = "POST" then
title = Request.Form("title")
myType = request.form("TYPE")

Select Case ucase(MyType)
case "D"
FileName="c:\miles2000\Design.ml6"
DisplayString="Displaying Design Schedule with your title in Red"
case "W"
FileName="c:\miles2000\Waterfall.ml6"
DisplayString="Displaying Waterfall Schedule with your title in Red"
case "GC"
FileName="c:\miles2000\Contract2.ml6"
DisplayString="Displaying Contract Schedule with your title in Red"
case "MS"
FileName="c:\miles2000\Master.ml6"
DisplayString="Displaying Master Schedule with your title in Red"
case "EV"
FileName="c:\miles2000\EarnedValue.ml6"
DisplayString="Displaying Earned Value Schedule with your title in Red"
case "CD"
FileName="c:\miles2000\Condo4.ml6"
DisplayString="Displaying Condo Project Schedule with your title in Red"
End Select


timestring= Hour(Time) & Minute(Time) & Second(Time)
set oMiles=GetObject(FileName,"Milestones")

oMiles.Activate

oMiles.Refresh

Randomize

ImageName = "test"+CStr(Rnd)+".jpg"

pathname1="/information/programmers/asp/images/"

pathname2="e:\inetpub\kidasawww\information\programmers\asp\images\"

Response.Write DisplayString

FullPathImageName = pathname2+ImageName

WWWPathImageName = pathname1+ImageName

oMiles.SetTitle2 "Your Title"+title

oMiles.Refresh

oMiles.SaveBitmap (FullPathImageName)

oMiles.Close "NoSave"

Response.Write "<p><img src="""+WWWPathImageName+"""></p>"

end if
%>

</blockquote>
</body>
</html>

Click here to visit our main programmer's page.