|
FoxWeb Support Team support@foxweb.com email |
FoxWeb Support Team support@foxweb.com email |
*** Script File FedEx.fwx
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head>
import progress.css
import progress.js
</head>
<head>
<FORM METHOD="post" ACTION="FedEx.fwx" name="FedExRateFetch">
Get information to calculate rate...
</form>
<%
IF Request.FormCount("Submit") > 0
***PROGRSS BAR M.StartTime = SECONDS() response.write("<div id='progressOuterDiv'></div>") ***Initialize and show the toolbar response.write("<script language='JavaScript'>") response.write("var progressBar = new cProgressBar();") response.write("progressBar.init();") response.write("progressBar.show(true);") response.write("</script>")
for x = 1 to m.nRowTotal
M.TotalSteps = m.nRowTotal
XML To Send FedEx Rate Request...
XML Fetch Rate Response
Send Rates To Screen
response.write("<script
language='JavaScript'>UpdateProgressBar(x / M.TotalSteps * 100,
'Completed step ' + Server.ToString(x) + ' of ' +
Server.ToString(M.TotalSteps))</script>")
WAIT '' TIMEOUT .5
endfor && loop through all services
endif
%>
<!-- Now hide the toolbar -->
<script language="JavaScript">progressBar.show(false);</script> </body> </html>
<%
************************************************************************************************** PROCEDURE UpdateProgressBar * Generates JavaScript code, which calls progressBar.update() method to update * the progress bar, for example: * <script language="JavaScript">progressBar.update(47, 'Completed 47% of the process');</script> ************************************************************************************************** LPARAMETERS PercentComplete, StatusText * First of all extend the script timeout by 10 seconds if it will expire in less than 5 seconds IF (SECONDS() - StartTime) + 5 >= Server.ScriptTimeout Server.AddScriptTimeout(10) ENDIF IF TYPE('M.StatusText') <> 'C' * No status text was specified -- Let ProgressBar code generate the status text Response.Write([<script language="JavaScript">progressBar.update(] + Server.ToString(M.PercentComplete) + [);</script>] + CRLF) ELSE Response.Write([<script language="JavaScript">progressBar.update(] + Server.ToString(M.PercentComplete) + [, '] + M.StatusText + [');</script>] + CRLF) ENDIF * Force output to be sent to browser Response.Flush ENDPROC %> |