|
| |
|
|
styrochem
Posts: 212 Joined: 5/11/2004 Status: offline
|
Missing Usernames - 7/13/2004 9:12:20
I have a series of web pages that keep losing their usernames when flowing between pages. At first I thought it was related to the system opening a new window for each section but when I made it all operate from the same window I still had the same complications. The PO Menu page contains the original username and then passes it to the submission form which then flows to the confirmation page. The username is lost after a single record is submitted on the submission page and the only way to recover it is by logging back into the system all over again. Is there something I can do to correct this? Here is the pages code PO MENU ORIGINATING PAGE OF USERNAME----
<%
'If the session variable is False or does not exsist then redirect the user to the unauthorised user page
If Session("blnIsUserGood") = False or IsNull(Session("blnIsUserGood")) = True then
'Redirect to unathorised user page
Response.Redirect"unauthorised_user_page.htm"
End If
%>
<html>
<%
'Dimension Variables
Dim strUserName 'Holds the name of the user
'Get the users name passed from the previous page
strUserName = Request.QueryString("name")
Session("EnteredBy")=strUserName
%>
<head>
<meta http-equiv="Content-Language" content="en-us">
<meta name="GENERATOR" content="Microsoft FrontPage 5.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>Purchase Order Menu</title>
</head>
<body>
<p align="center"><font color="#000066" size="5">Virtual Campus Purchase Order System</font></p>
<p align="left"><i><font color="#000066" size="4"><b>Hello <% =strUserName %>, Welcome to the Purchase Order System
</b></font></i></p>
<p><font color="#000066"><b>Each PO step has been provided to assist you in data
entry.</b></font></p>
<p><b><span style="background-color: #99CCFF"><font size="5">STEP 1 - INITIATE A
NEW PO NUMBER</font></span></b></p>
<table border="0" style="border-collapse: collapse" bordercolor="#111111" width="78%" id="AutoNumber1">
<tr>
<td width="100%" colspan="3" bgcolor="#000000">
<p align="center"><font color="#FFFFFF"><b>Request A Purchase Order Number -
Allows users to request a new PO number</b></font></td>
</tr>
<tr>
<td width="33%" align="center">
<a style="text-decoration: none" target="_blank" href="../Purchase_Orders_interface/tblPurchaseOrders_Minton_PO/submission_form.asp">
<font color="#000080">Minton</font></a></td>
<td width="33%" align="center">
<a style="text-decoration: none" target="_blank" href="../Purchase_Orders_interface/tblPurchaseOrders_Peden_PO/submission_form.asp">
<font color="#000080">Peden</font></a></td>
<td width="34%" align="center">
<a style="text-decoration: none" target="_blank" href="../Purchase_Orders_interface/tblPurchaseOrders_Sylvania_PO/submission_form.asp">
<font color="#000080">Sylvania</font></a></td>
</tr>
<tr>
<td width="33%" align="center">
</td>
<td width="33%" align="center">
</td>
<td width="34%" align="center"> </td>
</tr>
<tr>
<td width="33%" align="center">
<a style="text-decoration: none" target="_blank" href="../Purchase_Orders_interface/tblPurchaseOrders_TD/submission_form.asp">
<font color="#000080">T&D</font></a></td>
<td width="33%" align="center">
<a style="text-decoration: none" target="_blank" href="../Purchase_Orders_interface/tblPurchaseOrders_Whrse_Capital_PO/submission_form.asp">
<font color="#000080">Warehouse/Capital</font></a></td>
<td width="34%" align="center"> </td>
</tr>
</table>
<hr>
<p><b><font size="5"><span style="background-color: #99CCFF">STEP 2 - RECORD PO
IN MANMAN</span></font></b> </p>
<p><u><b><font size="2" color="#000080">BE SURE THIS INFORMATION IS COMPLETED
COINCIDING TO YOUR MANMAN ENTRIES...NO MORE THAN </font><font color="#FF0000">24</font><font size="2" color="#000080">
HOURS MAY PASS BETWEEN REQUESTING A PO AND ENTERING IT INTO MANMAN AND BOTH
SYSTEMS MUST MATCH.</font></b></u></p>
<p align="center">
<a target="_blank" style="text-decoration: none; background-color: #008080" href="../Purchase_Orders_interface/TRIALS/ManMan_Entries/database_editor.asp">
<font color="#FFFF00" size="5">CLICK HERE TO RECORD MANMAN ENTRIES</font></a></p>
<p align="center">
</p>
<hr>
<p align="left"> </p>
<p align="left"><b><font size="5"><span style="background-color: #99CCFF">STEP 3
- CLOSE PO</span></font></b></p>
<p align="left"><u><b><font size="2" color="#000080">BE SURE THIS INFORMATION IS
COMPLETED COINCIDING TO YOUR MANMAN ENTRIES...NO MORE THAN </font>
<font color="#FF0000">72</font><font size="2" color="#000080"> HOURS MAY PASS
BETWEEN RECEIVING AN ITEM CLOSING IT INTO MANMAN. BOTH SYSTEMS MUST MATCH.</font></b></u></p>
<p align="center"><u>
<a target="_blank" style="text-decoration: none; background-color: #008080" href="../Purchase_Orders_interface/TRIALS/PO_Closure/database_editor.asp">
<font color="#FFFF00" size="5">CLICK HERE TO CLOSE YOUR PO</font></a></u></p>
<p align="center"> </p>
<hr>
<p align="left"> </p>
<p align="left"><span style="font-weight: 700; background-color: #99CCFF">
<font size="5">OPTIONAL - CLICK BELOW TO MAKE CHANGES</font></span></p>
<table border="0" cellpadding="2" cellspacing="1" style="border-collapse: collapse" bordercolor="#111111" width="78%" id="AutoNumber1">
<tr>
<td width="100%" colspan="3" bgcolor="#111111">
<p align="center"><font color="#FFFFFF"><b>Update A Purchase Order Number -
Allows users to close a PO number</b></font></td>
</tr>
<tr>
<td width="33%" align="center">
<a style="text-decoration: none" target="_self" href="../Purchase_Orders_interface/tblPurchaseOrders_Minton_PO/editor/database_editor.asp">
<font color="#000080">Minton</font></a></td>
<td width="33%" align="center">
<a style="text-decoration: none" target="_self" href="../Purchase_Orders_interface/tblPurchaseOrders_Peden_PO/editor/database_editor.asp">
<font color="#000080">Peden</font></a></td>
<td width="34%" align="center">
<a style="text-decoration: none" target="_self" href="../Purchase_Orders_interface/tblPurchaseOrders_Sylvania_PO/editor/database_editor.asp">
<font color="#000080">Sylvania</font></a></td>
</tr>
<tr>
<td width="33%" align="center">
</td>
<td width="33%" align="center">
</td>
<td width="34%" align="center"> </td>
</tr>
<tr>
<td width="33%" align="center">
<a style="text-decoration: none" target="_self" href="../Purchase_Orders_interface/tblPurchaseOrders_TD/editor/database_editor.asp">
<font color="#000080">T&D</font></a></td>
<td width="33%" align="center">
<a style="text-decoration: none" target="_self" href="../Purchase_Orders_interface/tblPurchaseOrders_Whrse_Capital_PO/editor/database_editor.asp">
<font color="#000080">Warehouse/Capital</font></a></td>
<td width="34%" align="center"> </td>
</tr>
</table>
<hr>
<p> </p>
<p><font size="5"><span style="font-weight: 700; background-color: #99CCFF">
REPORTS - CLICK BELOW TO VIEW OPEN/CLOSED PURCHASE ORDER NUMBERS</span></font></p>
<table border="0" cellpadding="2" cellspacing="1" style="border-collapse: collapse" bordercolor="#111111" width="79%" id="AutoNumber2" height="168">
<tr>
<td width="100%" align="center" bgcolor="#000000" colspan="2" height="19">
<font color="#FFFFFF"><b>View A Purchase Order Numbers Report - View Open
and Closed PO numbers</b></font></td>
</tr>
<tr>
<td width="50%" align="center" bgcolor="#000000" height="19"><font color="#FFFFFF"><b>
Open PO Numbers</b></font></td>
<td width="50%" align="center" bgcolor="#000000" height="19"><font color="#FFFFFF"><b>
Closed PO Numbers</b></font></td>
</tr>
<tr>
<td width="50%" align="center" height="19">
<a target="_blank" href="../Purchase_Orders_interface/tblPurchaseOrders_Minton_PO/purchaseorderstatus_open.asp" style="text-decoration: none">
<font color="#000080">Minton</font></a></td>
<td width="50%" align="center" height="19">
<a target="_blank" href="../Purchase_Orders_interface/tblPurchaseOrders_Minton_PO/purchaseorderstatus_closed.asp" style="text-decoration: none">
<font color="#000080">Minton</font></a></td>
</tr>
<tr>
<td width="50%" align="center" height="19">
</td>
<td width="50%" align="center" height="19">
</td>
</tr>
<tr>
<td width="50%" align="center" height="19">
<a target="_blank" href="../Purchase_Orders_interface/tblPurchaseOrders_Peden_PO/purchaseorderstatus_open.asp" style="text-decoration: none">
<font color="#000080">Peden</font></a></td>
<td width="50%" align="center" height="19">
<a target="_blank" href="../Purchase_Orders_interface/tblPurchaseOrders_Peden_PO/purchaseorderstatus_closed.asp" style="text-decoration: none">
<font color="#000080">Peden</font></a></td>
</tr>
<tr>
<td width="50%" align="center" height="19">
</td>
<td width="50%" align="center" height="19">
</td>
</tr>
<tr>
<td width="50%" align="center" height="19">
<a target="_blank" href="../Purchase_Orders_interface/tblPurchaseOrders_Sylvania_PO/purchaseorderstatus_open.asp" style="text-decoration: none">
<font color="#000080">Sylvania</font></a></td>
<td width="50%" align="center" height="19">
<a target="_blank" href="../Purchase_Orders_interface/tblPurchaseOrders_Sylvania_PO/purchaseorderstatus_closed.asp" style="text-decoration: none">
<font color="#000080">Sylvania</font></a></td>
</tr>
<tr>
<td width="50%" align="center" height="19">
</td>
<td width="50%" align="center" height="19">
</td>
</tr>
<tr>
<td width="50%" align="center" height="19">
<a target="_blank" href="../Purchase_Orders_interface/tblPurchaseOrders_TD/purchaseorderstatus_open.asp" style="text-decoration: none">
<font color="#000080">T&D</font></a></td>
<td width="50%" align="center" height="19">
<a target="_blank" href="../Purchase_Orders_interface/tblPurchaseOrders_TD/purchaseorderstatus_closed.asp" style="text-decoration: none">
<font color="#000080">T&D</font></a></td>
</tr>
<tr>
<td width="50%" align="center" height="19">
</td>
<td width="50%" align="center" height="19">
</td>
</tr>
<tr>
<td width="50%" align="center" height="19">
<a target="_blank" style="text-decoration: none" href="../Purchase_Orders_interface/tblPurchaseOrders_Whrse_Capital_PO/purchaseorderstatus_open.asp">
<font color="#000080">Capital/Warehouse</font></a></td>
<td width="50%" align="center" height="19">
<a target="_blank" style="text-decoration: none" href="../Purchase_Orders_interface/tblPurchaseOrders_Whrse_Capital_PO/purchaseorderstatus_closed.asp">
<font color="#000080">Capital/Warehouse</font></a></td>
</tr>
</table>
<p> </p>
<p><b><font size="5"><span style="background-color: #99CCFF">TECHNICAL
ISSUES/SUGGESTIONS</span></font></b></p>
<p><font color="#000080"><b>Please report technical issues and suggestions into
the Comments.</b></font></p>
<table border="0" style="border-collapse: collapse" bordercolor="#111111" width="80%" id="AutoNumber3">
<tr>
<td width="100%" bgcolor="#000000">
<p align="center"><b><font color="#FFFFFF">Purchase Order Administrators
Options</font></b></td>
</tr>
<tr>
<td width="50%" bgcolor="#FFFFFF">
<p align="center">
<a target="_blank" href="../Purchase_Orders_interface/tblVendors_PO/editor/database_editor.asp" style="text-decoration: none"><font color="#000080">View Frequently Used Vendors</font></a></td>
</tr>
<tr>
<td width="50%" bgcolor="#FFFFFF">
<p align="center"><font color="#000080">
<a target="_blank" href="../Purchase_Orders_interface/PO_Comments/submission_form.asp" style="text-decoration: none">
<font color="#000080">Comments and Improvement Submissions</font></a></font></td>
</tr>
<tr>
<td width="50%" bgcolor="#FFFFFF">
</td>
</tr>
<tr>
<td width="50%" bgcolor="#FFFFFF">
</td>
</tr>
</table>
</body>
</html>
SUBMISSION FORM -- THIS PAGE ONLY ALLOWS ONE SUBMISSION AND THEN LOSES THE USERNAME AFTER ONLY ONE USE--
PAGE CODE--
<%
'If the session variable is False or does not exsist then redirect the user to the unauthorized user page
If Session("blnIsUserGood") = False or IsNull(Session("blnIsUserGood")) = True then
'Redirect to unathorized user page
Response.Redirect"/protected/unauthorized_user_page.htm"
End If
%>
<%
strErrorUrl = ""
If Request.ServerVariables("REQUEST_METHOD") = "POST" Then
If Request.Form("VTI-GROUP") = "0" Then
Err.Clear
Set fp_conn = Server.CreateObject("ADODB.Connection")
FP_DumpError strErrorUrl, "Cannot create connection"
Set fp_rs = Server.CreateObject("ADODB.Recordset")
FP_DumpError strErrorUrl, "Cannot create record set"
fp_conn.Open Application("Purchase_Orders_ConnectionString")
FP_DumpError strErrorUrl, "Cannot open database"
fp_rs.Open "tblPurchaseOrders_Minton_PO", fp_conn, 1, 3, 2 ' adOpenKeySet, adLockOptimistic, adCmdTable
FP_DumpError strErrorUrl, "Cannot open record set"
fp_rs.AddNew
FP_DumpError strErrorUrl, "Cannot add new record set to the database"
Dim arFormFields0(10)
Dim arFormDBFields0(10)
Dim arFormValues0(10)
arFormFields0(0) = "ClassificationType"
arFormDBFields0(0) = "ClassificationType"
arFormValues0(0) = Request("ClassificationType")
arFormFields0(1) = "Requestor"
arFormDBFields0(1) = "Requestor"
arFormValues0(1) = Request("Requestor")
arFormFields0(2) = "Vendor"
arFormDBFields0(2) = "Vendor"
arFormValues0(2) = Request("Vendor")
arFormFields0(3) = "Created"
arFormDBFields0(3) = "Created"
arFormValues0(3) = Request("Created")
arFormFields0(4) = "NotToExceed"
arFormDBFields0(4) = "NotToExceed"
arFormValues0(4) = Request("NotToExceed")
arFormFields0(5) = "EnteredBy"
arFormDBFields0(5) = "EnteredBy"
arFormValues0(5) = Request("EnteredBy")
arFormFields0(6) = "EnteredIntoManMan"
arFormDBFields0(6) = "EnteredIntoManMan"
arFormValues0(6) = Request("EnteredIntoManMan")
arFormFields0(7) = "POStatus"
arFormDBFields0(7) = "POStatus"
arFormValues0(7) = Request("POStatus")
arFormFields0(8) = "ConfirmedSignedPurchaseReq"
arFormDBFields0(8) = "ConfirmedSignedPurchaseReq"
arFormValues0(8) = Request("ConfirmedSignedPurchaseReq")
arFormFields0(9) = "Comments"
arFormDBFields0(9) = "Comments"
arFormValues0(9) = Request("Comments")
FP_SaveFormFields fp_rs, arFormFields0, arFormDBFields0
fp_rs.Update
PurchaseOrder = fp_rs(0)
FP_DumpError strErrorUrl, "Cannot update the database"
fp_rs.Close
fp_conn.Close
Response.Redirect "confirmation.asp?ID="&PurchaseOrder
End If
End If
%>
<% Response.Buffer = True %>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>tblPurchaseOrders_Minton_PO -- New</title>
<meta name="GENERATOR" content="Microsoft FrontPage 5.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
</head>
<body bgcolor="#FFFFFF">
<table width="100%" align=left>
<tr>
<td width="69%">
<b><font size=+3 color="#000080">Minton
Purchase Order Request </font></b>
</td>
<td width="31%" align=right>
<table align="left">
<tr>
<td align="center">
<p align="left"><b><a href="../../protected/po_menu.asp">Return to PO
Menu</a></b></td>
</tr>
</table>
</td>
</tr>
</table>
<p>
<br clear="all">
<hr>
<p>
<!--webbot BOT="GeneratedScript" PREVIEW=" " startspan --><script Language="JavaScript" Type="text/javascript"><!--
function FrontPage_Form1_Validator(theForm)
{
if (theForm.requestor.value == "")
{
alert("Please enter a value for the \"requestor\" field.");
theForm.requestor.focus();
return (false);
}
if (theForm.requestor.value.length < 5)
{
alert("Please enter at least 5 characters in the \"requestor\" field.");
theForm.requestor.focus();
return (false);
}
if (theForm.vendor.value == "")
{
alert("Please enter a value for the \"vendor\" field.");
theForm.vendor.focus();
return (false);
}
if (theForm.vendor.value.length < 3)
{
alert("Please enter at least 3 characters in the \"vendor\" field.");
theForm.vendor.focus();
return (false);
}
if (theForm.NotToExceed.value == "")
{
alert("Please enter a value for the \"not to exceed\" field.");
theForm.NotToExceed.focus();
return (false);
}
if (theForm.NotToExceed.value.length < 3)
{
alert("Please enter at least 3 characters in the \"not to exceed\" field.");
theForm.NotToExceed.focus();
return (false);
}
if (theForm.NotToExceed.value.length > 50)
{
alert("Please enter at most 50 characters in the \"not to exceed\" field.");
theForm.NotToExceed.focus();
return (false);
}
var chkVal = theForm.NotToExceed.value;
var prsVal = chkVal;
if (chkVal != "" && !(prsVal > "1.00"))
{
alert("Please enter a value greater than \"1.00\" in the \"not to exceed\" field.");
theForm.NotToExceed.focus();
return (false);
}
if (theForm.ConfirmedSignedPurchaseReq.selectedIndex < 0)
{
alert("Please select one of the \"Confirmed\" options.");
theForm.ConfirmedSignedPurchaseReq.focus();
return (false);
}
if (theForm.ConfirmedSignedPurchaseReq.selectedIndex == 0)
{
alert("The first \"Confirmed\" option is not a valid selection. Please choose one of the other options.");
theForm.ConfirmedSignedPurchaseReq.focus();
return (false);
}
return (true);
}
//--></script><!--webbot BOT="GeneratedScript" endspan --><form METHOD="POST" action="submission_form.asp" onsubmit="return FrontPage_Form1_Validator(this)" language="JavaScript" name="FrontPage_Form1" webbot-action="--WEBBOT-SELF--">
<input TYPE="hidden" NAME="VTI-GROUP" VALUE="0"><!--#include file="../../_fpclass/fpdbform.inc"-->
<table border="0" cellpadding="2" style="border-collapse: collapse" bordercolor="#111111" width="95%" id="AutoNumber1" cellspacing="5">
<tr>
<td width="68%" align="justify"><b>Requestor <font color="#FF0000">
(REQUIRED FIELD)</font> - Who is requesting this PO Number? (Be sure and utilize
the requestors complete name. Avoid entering only a first name or initials.)</b></td>
<td width="37%">
<!--webbot bot="Validation" s-display-name="requestor" b-value-required="TRUE" i-minimum-length="5" --><input type="text" name="requestor" size="20"></td>
</tr>
<tr>
<td width="68%" align="justify" bgcolor="#99CCFF"><b>Vendor <font color="#FF0000">(REQUIRED
FIELD)</font> - Who is this PO for?</b></td>
<td width="37%" bgcolor="#99CCFF">
<!--webbot bot="Validation" s-display-name="vendor" b-value-required="TRUE" i-minimum-length="3" --><input type="text" name="vendor" size="20"></td>
</tr>
<tr>
<td width="68%" align="justify"><b>Not To Exceed <font color="#FF0000">
(REQUIRED FIELD)</font> - Max Amount to Spend - (Enter with
decimal and zero's IE: 2.00 and no dollar signs)</b></td>
<td width="37%">
<!--webbot bot="Validation" s-display-name="not to exceed" b-value-required="TRUE" i-minimum-length="3" i-maximum-length="50" s-validation-constraint="Greater than" s-validation-value="1.00" --><input name="NotToExceed" size="19" value="" maxlength="50"></td>
</tr>
<tr>
<td width="68%" align="justify" bgcolor="#99CCFF"><b>Have you received an signed purchase
requisition? <font color="#FF0000">(REQUIRED FIELD)</font> (It is required that
you have an signed and authorized purchase requisition prior to providing an
purchase order number. Only in the event of an emergency may this be
bypassed.)</b></td>
<td width="37%" bgcolor="#99CCFF">
<p align="left">
<!--webbot bot="Validation" s-display-name="Confirmed" b-value-required="TRUE" b-disallow-first-item="TRUE" --><select size="1" name="ConfirmedSignedPurchaseReq">
<option selected>Select One</option>
<option value="Yes">Yes</option>
<option value="Emergency">Emergency</option>
</td>
</tr>
<tr>
<td width="68%">
<p align="justify"><b>Comments (OPTIONAL)</b></td>
<td width="37%"><textarea rows="2" name="Comments" cols="25"></textarea></td>
</tr>
</table>
<p><font color="#006666"><b>Click Request PO when Finished or click Reset to start over.
Be sure all information is correct prior to clicking request PO.</b></font></p>
<p><font color="#006666"><b></b></font><br>
</p>
<p><input type="submit" value="Request PO"><input type="reset" value=" Reset "></p>
<input type="hidden" name="Created" value="<%=Date()%>">
<input type="hidden" name="EnteredIntoManMan" value="No">
<input type="hidden" name="POStatus" value="Open">
<input type="hidden" name="EnteredBy" value="<%=Session("EnteredBy")%>">
</form>
<p><font color="#000080"><i>Virtual Campus 2004.ASP</i></font></p>
</body>
</html>
CONFIRMATION PAGE--- PROVIDES A PO NUMBER--THIS PAGE DOES RECORD ALL INFORMATION BUT DOES NOT RECEIVE A USERNAME AND WILL NOT FORWARD ONE BACK TO THE FIRST PAGE.
PAGE CODE---
<html>
<%
'If the session variable is False or does not exsist then redirect the user to the unauthorized user page
If Session("blnIsUserGood") = False or IsNull(Session("blnIsUserGood")) = True then
'Redirect to unathorized user page
Response.Redirect"/protected/unauthorized_user_page.htm"
End If
%>
<head>
<meta http-equiv="Content-Language" content="en-us">
<meta name="GENERATOR" content="Microsoft FrontPage 5.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252"> <title>Purchase Order Confirmation</title> </head>
<body>
<%
'Dimension Variables
Dim strUserName 'Holds the name of the user
'Get the users name passed from the previous page
strUserName = Request.QueryString("name")
Session("EnteredBy")=strUserName
%>
<p align="center"><b><font size="4" color="#000080">Virtual Campus - Purchase
Order System</font></b></p>
<p><font color="#000080"><b>Purchase Order Confirmation</b></font></p>
<p><i><font size="4">Thank you
<!--webbot bot="ConfirmationField" S-Field="Username" startspan --><%
Dim FP_SavedFields
FP_InitFormConfirmation
Sub FP_InitFormConfirmation
On Error Resume Next
Session("FP_OldCodePage") = Session.CodePage
Session("FP_OldLCID") = Session.LCID
Session.CodePage = 1252
Session.LCID = 1033
set FP_SavedFields = Server.CreateObject("Scripting.Dictionary")
if IsArray(Session("FP_SavedFields")) and IsArray(Session("FP_SavedValues")) then
Dim FP_arFields
Dim FP_arValues
Dim FP_idx
FP_arFields = Session("FP_SavedFields")
FP_arValues = Session("FP_SavedValues")
for FP_idx = 0 to UBound(FP_arFields)
FP_SavedFields.Item(FP_arFields(FP_idx)) = FP_arValues(FP_idx)
next
Session("FP_SavedFields") = ""
Session("FP_SavedValues") = ""
end if
Session.CodePage = Session("FP_OldCodePage")
Session.LCID = Session("FP_OldLCID")
End Sub
Sub FP_ConfirmField(sField)
On Error Resume Next
Session("FP_OldCodePage") = Session.CodePage
Session("FP_OldLCID") = Session.LCID
Session.CodePage = 1252
Session.LCID = 1033
sOut = FP_SavedFields(sField)
sOut = Replace(sOut,"&","^^@^^")
sOut = Server.HTMLEncode(sOut)
sOut = Replace(sOut,"^^@^^","&")
Response.Write sOut
Session.CodePage = Session("FP_OldCodePage")
Session.LCID = Session("FP_OldLCID")
End Sub
%><%FP_ConfirmField("Username")%><!--webbot bot="ConfirmationField" i-checksum="45505" endspan --> for your PO request.</font></i></p> <p>
<b>Your Purchase Order Number is: <%=Request.QueryString("ID")%><%=Server.HTMLEncode(FP_SavedFields("Purchaseorder"))%> </b>
<p align="center"> </p>
<p align="center"> </p>
<p align="center"><b>Close Window When Finished</b></p>
|
|
|
|
styrochem
Posts: 212 Joined: 5/11/2004 Status: offline
|
RE: Missing Usernames - 7/15/2004 11:44:24
They were setup as subwebs.
|
|
|
|
styrochem
Posts: 212 Joined: 5/11/2004 Status: offline
|
RE: Missing Usernames - 7/16/2004 7:41:01
You didn't see anything out of place on the code above? Just wanted to make sure.
|
|
|
|
styrochem
Posts: 212 Joined: 5/11/2004 Status: offline
|
RE: Missing Usernames - 7/21/2004 8:40:24
Problem unresolved....I recreated everything with subfolders instead of subwebs and the same problem is still occurring.
|
|
|
|
BeTheBall
Posts: 6355 Joined: 6/21/2002 From: West Point Utah USA Status: offline
|
RE: Missing Usernames - 7/21/2004 20:52:09
So there are three pages involved here, right? One where a user enters some data, then some sort of menu page and third a submission form? I say that because the code gets the user name from the querystring of the previous page. Well, when a user goes to use the submission form a second time, does he first go to the first page you show above? If so, the query string is now empty and so this code: strUserName = Request.QueryString("name") Session("EnteredBy")=strUserName would create an empty value for the session. if my above assumptions are correct, try changing this: strUserName = Request.QueryString("name") Session("EnteredBy")=strUserName To: strUserName = Request.QueryString("name") If Session("EnteredBy")<>"" Then Session("EnteredBy") = Session("EnteredBy") Else Session("EnteredBy")=strUserName End If I think that should work.
_____________________________
Duane Some people are like Slinkies . . . Not really good for anything . . . . . But they still bring a smile to your face when you push them down a flight of stairs.
|
|
|
|
styrochem
Posts: 212 Joined: 5/11/2004 Status: offline
|
RE: Missing Usernames - 7/22/2004 7:54:47
Do I modify the code on all pages, the submission page, confirmation page or menu?
|
|
|
|
BeTheBall
Posts: 6355 Joined: 6/21/2002 From: West Point Utah USA Status: offline
|
RE: Missing Usernames - 7/22/2004 9:59:58
quote:
ORIGINAL: styrochem Do I modify the code on all pages, the submission page, confirmation page or menu? The page that begins with: PO MENU ORIGINATING PAGE OF USERNAME----
_____________________________
Duane Some people are like Slinkies . . . Not really good for anything . . . . . But they still bring a smile to your face when you push them down a flight of stairs.
|
|
|
|
styrochem
Posts: 212 Joined: 5/11/2004 Status: offline
|
RE: Missing Usernames - 7/22/2004 13:16:34
Ok... When I made the change on the PO Menu page it made the page quit retrieving the username from the login. I could see it in the address bar but not referenced on the page. Still not working... :(
|
|
|
|
BeTheBall
Posts: 6355 Joined: 6/21/2002 From: West Point Utah USA Status: offline
|
RE: Missing Usernames - 7/22/2004 13:42:28
Post the code you tried on the PO Menu page.
_____________________________
Duane Some people are like Slinkies . . . Not really good for anything . . . . . But they still bring a smile to your face when you push them down a flight of stairs.
|
|
|
|
styrochem
Posts: 212 Joined: 5/11/2004 Status: offline
|
RE: Missing Usernames - 7/22/2004 14:30:49
<%
'If the session variable is False or does not exsist then redirect the user to the unauthorised user page
If Session("blnIsUserGood") = False or IsNull(Session("blnIsUserGood")) = True then
'Redirect to unathorised user page
Response.Redirect"unauthorised_user_page.htm"
End If
%>
<html>
<%
'Dimension Variables
Dim strUserName 'Holds the name of the user
'Get the users name passed from the previous page
strUserName = Request.QueryString("name")
If Session("EnteredBy")<>"" Then
Session("EnteredBy") = Session("EnteredBy")
Else
Session("EnteredBy")=strUserName
End If
%>
<head>
<meta http-equiv="Content-Language" content="en-us">
<meta name="GENERATOR" content="Microsoft FrontPage 5.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>Purchase Order Menu</title>
</head>
<body>
|
|
|
|
BeTheBall
Posts: 6355 Joined: 6/21/2002 From: West Point Utah USA Status: offline
|
RE: Missing Usernames - 7/22/2004 14:39:11
So if you enter this in the body: <%=strUserName%> Is the user name written to the page? What if you enter: <%=Session("EnteredBy")%> What, if anything, is written?
_____________________________
Duane Some people are like Slinkies . . . Not really good for anything . . . . . But they still bring a smile to your face when you push them down a flight of stairs.
|
|
|
|
styrochem
Posts: 212 Joined: 5/11/2004 Status: offline
|
RE: Missing Usernames - 7/22/2004 14:47:27
<% =strUserName %> does post the name to the page.
|
|
|
|
BeTheBall
Posts: 6355 Joined: 6/21/2002 From: West Point Utah USA Status: offline
|
RE: Missing Usernames - 7/22/2004 15:33:07
What does the login page look like?
_____________________________
Duane Some people are like Slinkies . . . Not really good for anything . . . . . But they still bring a smile to your face when you push them down a flight of stairs.
|
|
|
|
styrochem
Posts: 212 Joined: 5/11/2004 Status: offline
|
RE: Missing Usernames - 7/26/2004 9:53:10
Here are all of the pages involved. The username is lost between the submission form and confirmation. LOGIN PAGE
<html>
<head>
<title>Login</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<!-- The Web Wiz Guide Login Script is written by Bruce Corkhill ©2001
If you want your own Login Script then goto http://www.webwizguide.info -->
</head>
<body bgcolor="#FFFFFF" text="#000000">
<table width="518" border="0" cellspacing="0" cellpadding="0" align="center">
<tr>
<td align="center">
<h1><font color="#000066" size="5">Virtual Campus Purchase Order System</font></h1>
</td>
</tr>
</table>
<br>
<br>
<br>
<br>
<form name="Login" method="post" action="check_user.asp">
<table width="273" border="0" align="center" cellspacing="0" cellpadding="0" bgcolor="#CCCCCC">
<tr>
<td align="right" height="47" valign="bottom" width="94" bgcolor="#000080">
<b><font color="#FFFFFF" size="4">User name: </font></b> </td>
<td height="47" valign="bottom" width="172" bgcolor="#000080">
<input type="text" name="txtUserName" size="20">
</td>
</tr>
<tr>
<td align="right" width="94" bgcolor="#000080"><b>
<font color="#FFFFFF" size="4">Password</font></b>: </td>
<td width="172" bgcolor="#000080">
<input type="password" name="txtUserPass" size="20">
</td>
</tr>
<tr>
<td align="right" height="44" width="94" bgcolor="#000080"> </td>
<td height="44" width="172" bgcolor="#000080">
<input type="submit" name="Submit" value="Enter">
<input type="reset" name="Submit2" value="Reset">
</td>
</tr>
</table>
</form>
<br>
<center>
Session Cookies must be enabled<br>
<br>
<font color="#000080" size="4"><b>Virtual Campus 2004.ASP </b></font>
</center>
</body>
</html>
PO MENU PAGE
<%
'If the session variable is False or does not exsist then redirect the user to the unauthorised user page
If Session("blnIsUserGood") = False or IsNull(Session("blnIsUserGood")) = True then
'Redirect to unathorised user page
Response.Redirect"unauthorised_user_page.htm"
End If
%>
<html>
<%
'Dimension Variables
Dim strUserName 'Holds the name of the user
'Get the users name passed from the previous page
strUserName = Request.QueryString("name")
Session("EnteredBy")=strUserName
%>
<head>
<meta http-equiv="Content-Language" content="en-us">
<meta name="GENERATOR" content="Microsoft FrontPage 5.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>Purchase Order Menu</title>
</head>
<body>
<p align="center"><font color="#000066" size="5">Virtual Campus Purchase Order System</font></p>
<p align="left"><i><font color="#000066" size="4"><b>Hello <% =strUserName %>, Welcome to the Purchase Order System
</b></font></i></p>
<p><font color="#000066"><b>Each PO step has been provided to assist you in data
entry.</b></font></p>
<p><b><span style="background-color: #99CCFF"><font size="5">STEP 1 - INITIATE A
NEW PO NUMBER</font></span></b></p>
<table border="0" style="border-collapse: collapse" bordercolor="#111111" width="78%" id="AutoNumber1">
<tr>
<td width="100%" colspan="3" bgcolor="#000000">
<p align="center"><font color="#FFFFFF"><b>Request A Purchase Order Number -
Allows users to request a new PO number</b></font></td>
</tr>
<tr>
<td width="33%" align="center">
<a style="text-decoration: none" target="_blank" href="../Purchase_Orders_interface/tblPurchaseOrders_Minton_PO/submission_form.asp">
<font color="#000080">Minton</font></a></td>
<td width="33%" align="center">
<a style="text-decoration: none" target="_blank" href="../Purchase_Orders_interface/tblPurchaseOrders_Peden_PO/submission_form.asp">
<font color="#000080">Peden</font></a></td>
<td width="34%" align="center">
<a style="text-decoration: none" target="_blank" href="../Purchase_Orders_interface/tblPurchaseOrders_Sylvania_PO/submission_form.asp">
<font color="#000080">Sylvania</font></a></td>
</tr>
<tr>
<td width="33%" align="center">
</td>
<td width="33%" align="center">
</td>
<td width="34%" align="center"> </td>
</tr>
<tr>
<td width="33%" align="center">
<a style="text-decoration: none" target="_blank" href="../Purchase_Orders_interface/tblPurchaseOrders_TD/submission_form.asp">
<font color="#000080">T&D</font></a></td>
<td width="33%" align="center">
<a style="text-decoration: none" target="_blank" href="../Purchase_Orders_interface/tblPurchaseOrders_Whrse_Capital_PO/submission_form.asp">
<font color="#000080">Warehouse/Capital</font></a></td>
<td width="34%" align="center"> </td>
</tr>
</table>
<hr>
<p><b><font size="5"><span style="background-color: #99CCFF">STEP 2 - RECORD PO
IN MANMAN</span></font></b> </p>
<p><u><b><font size="2" color="#000080">BE SURE THIS INFORMATION IS COMPLETED
COINCIDING TO YOUR MANMAN ENTRIES...NO MORE THAN </font><font color="#FF0000">24</font><font size="2" color="#000080">
HOURS MAY PASS BETWEEN REQUESTING A PO AND ENTERING IT INTO MANMAN AND BOTH
SYSTEMS MUST MATCH.</font></b></u></p>
<p align="center">
<a target="_blank" href="../Purchase_Orders_interface/TRIALS/ManMan_Entries/database_editor.asp">
<font color="#000080" size="5">CLICK HERE TO RECORD MANMAN ENTRIES</font></a></p>
<p align="center">
</p>
<hr>
<p align="left"> </p>
<p align="left"><b><font size="5"><span style="background-color: #99CCFF">STEP 3
- CLOSE PO </span></font></b></p>
<p align="left"><u><b><font size="2" color="#000080">BE SURE THIS INFORMATION IS
COMPLETED COINCIDING TO YOUR MANMAN ENTRIES...NO MORE THAN </font>
<font color="#FF0000">72</font><font size="2" color="#000080"> HOURS MAY PASS
BETWEEN RECEIVING AN ITEM CLOSING IT INTO MANMAN. BOTH SYSTEMS MUST MATCH.</font></b></u></p>
<p align="center"><u>
<font color="#FFFF00" size="5">
<a target="_blank" href="../Purchase_Orders_interface/TRIALS/PO_Closure/database_editor.asp">
<font color="#000080">CLICK HERE TO CLOSE YOUR PO</font></a></font></u></p>
<p align="center"> </p>
<hr>
<p align="left"> </p>
<p align="left"><span style="font-weight: 700; background-color: #99CCFF">
<font size="5">OPTIONAL - CLICK BELOW TO MAKE CHANGES</font></span></p>
<table border="0" cellpadding="2" cellspacing="1" style="border-collapse: collapse" bordercolor="#111111" width="78%" id="AutoNumber1">
<tr>
<td width="100%" colspan="3" bgcolor="#111111">
<p align="center"><font color="#FFFFFF"><b>Update A Purchase Order Number -
Allows users to close a PO number</b></font></td>
</tr>
<tr>
<td width="33%" align="center">
<a style="text-decoration: none" target="_self" href="../Purchase_Orders_interface/tblPurchaseOrders_Minton_PO/editor/database_editor.asp">
<font color="#000080">Minton</font></a></td>
<td width="33%" align="center">
<a style="text-decoration: none" target="_self" href="../Purchase_Orders_interface/tblPurchaseOrders_Peden_PO/editor/database_editor.asp">
<font color="#000080">Peden</font></a></td>
<td width="34%" align="center">
<a style="text-decoration: none" target="_self" href="../Purchase_Orders_interface/tblPurchaseOrders_Sylvania_PO/editor/database_editor.asp">
<font color="#000080">Sylvania</font></a></td>
</tr>
<tr>
<td width="33%" align="center">
</td>
<td width="33%" align="center">
</td>
<td width="34%" align="center"> </td>
</tr>
<tr>
<td width="33%" align="center">
<a style="text-decoration: none" target="_self" href="../Purchase_Orders_interface/tblPurchaseOrders_TD/editor/database_editor.asp">
<font color="#000080">T&D</font></a></td>
<td width="33%" align="center">
<a style="text-decoration: none" target="_self" href="../Purchase_Orders_interface/tblPurchaseOrders_Whrse_Capital_PO/editor/database_editor.asp">
<font color="#000080">Warehouse/Capital</font></a></td>
<td width="34%" align="center"> </td>
</tr>
</table>
<hr>
<p> </p>
<p><font size="5"><span style="font-weight: 700; background-color: #99CCFF">
REPORTS - CLICK BELOW TO VIEW OPEN/CLOSED PURCHASE ORDER NUMBERS</span></font></p>
<table border="0" cellpadding="2" cellspacing="1" style="border-collapse: collapse" bordercolor="#111111" width="79%" id="AutoNumber2" height="168">
<tr>
<td width="100%" align="center" bgcolor="#000000" colspan="2" height="19">
<font color="#FFFFFF"><b>View A Purchase Order Numbers Report - View Open
and Closed PO numbers</b></font></td>
</tr>
<tr>
<td width="50%" align="center" bgcolor="#000000" height="19"><font color="#FFFFFF"><b>
Open PO Numbers</b></font></td>
<td width="50%" align="center" bgcolor="#000000" height="19"><font color="#FFFFFF"><b>
Closed PO Numbers</b></font></td>
</tr>
<tr>
<td width="50%" align="center" height="19">
<a target="_blank" href="../Purchase_Orders_interface/tblPurchaseOrders_Minton_PO/purchaseorderstatus_open.asp" style="text-decoration: none">
<font color="#000080">Minton</font></a></td>
<td width="50%" align="center" height="19">
<a target="_blank" href="../Purchase_Orders_interface/tblPurchaseOrders_Minton_PO/purchaseorderstatus_closed.asp" style="text-decoration: none">
<font color="#000080">Minton</font></a></td>
</tr>
<tr>
<td width="50%" align="center" height="19">
</td>
<td width="50%" align="center" height="19">
</td>
</tr>
<tr>
<td width="50%" align="center" height="19">
<a target="_blank" href="../Purchase_Orders_interface/tblPurchaseOrders_Peden_PO/purchaseorderstatus_open.asp" style="text-decoration: none">
<font color="#000080">Peden</font></a></td>
<td width="50%" align="center" height="19">
<a target="_blank" href="../Purchase_Orders_interface/tblPurchaseOrders_Peden_PO/purchaseorderstatus_closed.asp" style="text-decoration: none">
<font color="#000080">Peden</font></a></td>
</tr>
<tr>
<td width="50%" align="center" height="19">
</td>
<td width="50%" align="center" height="19">
</td>
</tr>
<tr>
<td width="50%" align="center" height="19">
<a target="_blank" href="../Purchase_Orders_interface/tblPurchaseOrders_Sylvania_PO/purchaseorderstatus_open.asp" style="text-decoration: none">
<font color="#000080">Sylvania</font></a></td>
<td width="50%" align="center" height="19">
<a target="_blank" href="../Purchase_Orders_interface/tblPurchaseOrders_Sylvania_PO/purchaseorderstatus_closed.asp" style="text-decoration: none">
<font color="#000080">Sylvania</font></a></td>
</tr>
<tr>
<td width="50%" align="center" height="19">
</td>
<td width="50%" align="center" height="19">
</td>
</tr>
<tr>
<td width="50%" align="center" height="19">
<a target="_blank" href="../Purchase_Orders_interface/tblPurchaseOrders_TD/purchaseorderstatus_open.asp" style="text-decoration: none">
<font color="#000080">T&D</font></a></td>
<td width="50%" align="center" height="19">
<a target="_blank" href="../Purchase_Orders_interface/tblPurchaseOrders_TD/purchaseorderstatus_closed.asp" style="text-decoration: none">
<font color="#000080">T&D</font></a></td>
</tr>
<tr>
<td width="50%" align="center" height="19">
</td>
<td width="50%" align="center" height="19">
</td>
</tr>
<tr>
<td width="50%" align="center" height="19">
<a target="_blank" style="text-decoration: none" href="../Purchase_Orders_interface/tblPurchaseOrders_Whrse_Capital_PO/purchaseorderstatus_open.asp">
<font color="#000080">Capital/Warehouse</font></a></td>
<td width="50%" align="center" height="19">
<a target="_blank" style="text-decoration: none" href="../Purchase_Orders_interface/tblPurchaseOrders_Whrse_Capital_PO/purchaseorderstatus_closed.asp">
<font color="#000080">Capital/Warehouse</font></a></td>
</tr>
</table>
<p> </p>
<p><b><font size="5"><span style="background-color: #99CCFF">TECHNICAL
ISSUES/SUGGESTIONS</span></font></b></p>
<p><font color="#000080"><b>Please report technical issues and suggestions into
the Comments.</b></font></p>
<table border="0" style="border-collapse: collapse" bordercolor="#111111" width="80%" id="AutoNumber3">
<tr>
<td width="100%" bgcolor="#000000">
<p align="center"><b><font color="#FFFFFF">Purchase Order Administrators
Options</font></b></td>
</tr>
<tr>
<td width="50%" bgcolor="#FFFFFF">
<p align="center">
<a target="_blank" href="../Purchase_Orders_interface/tblVendors_PO/editor/database_editor.asp" style="text-decoration: none"><font color="#000080">View Frequently Used Vendors</font></a></td>
</tr>
<tr>
<td width="50%" bgcolor="#FFFFFF">
<p align="center"><font color="#000080">
<a target="_blank" href="../Purchase_Orders_interface/PO_Comments/submission_form.asp" style="text-decoration: none">
<font color="#000080">Comments and Improvement Submissions</font></a></font></td>
</tr>
<tr>
<td width="50%" bgcolor="#FFFFFF">
</td>
</tr>
<tr>
<td width="50%" bgcolor="#FFFFFF">
</td>
</tr>
</table>
</body>
</html>
SUBMISSION FORM - MINTON
<%
'If the session variable is False or does not exsist then redirect the user to the unauthorized user page
If Session("blnIsUserGood") = False or IsNull(Session("blnIsUserGood")) = True then
'Redirect to unathorized user page
Response.Redirect"/protected/unauthorized_user_page.htm"
End If
%>
<%
strErrorUrl = ""
If Request.ServerVariables("REQUEST_METHOD") = "POST" Then
If Request.Form("VTI-GROUP") = "0" Then
Err.Clear
Set fp_conn = Server.CreateObject("ADODB.Connection")
FP_DumpError strErrorUrl, "Cannot create connection"
Set fp_rs = Server.CreateObject("ADODB.Recordset")
FP_DumpError strErrorUrl, "Cannot create record set"
fp_conn.Open Application("Purchase_Orders_ConnectionString")
FP_DumpError strErrorUrl, "Cannot open database"
fp_rs.Open "tblPurchaseOrders_Minton_PO", fp_conn, 1, 3, 2 ' adOpenKeySet, adLockOptimistic, adCmdTable
FP_DumpError strErrorUrl, "Cannot open record set"
fp_rs.AddNew
FP_DumpError strErrorUrl, "Cannot add new record set to the database"
Dim arFormFields0(10)
Dim arFormDBFields0(10)
Dim arFormValues0(10)
arFormFields0(0) = "ClassificationType"
arFormDBFields0(0) = "ClassificationType"
arFormValues0(0) = Request("ClassificationType")
arFormFields0(1) = "Requestor"
arFormDBFields0(1) = "Requestor"
arFormValues0(1) = Request("Requestor")
arFormFields0(2) = "Vendor"
arFormDBFields0(2) = "Vendor"
arFormValues0(2) = Request("Vendor")
arFormFields0(3) = "Created"
arFormDBFields0(3) = "Created"
arFormValues0(3) = Request("Created")
arFormFields0(4) = "NotToExceed"
arFormDBFields0(4) = "NotToExceed"
arFormValues0(4) = Request("NotToExceed")
arFormFields0(5) = "EnteredBy"
arFormDBFields0(5) = "EnteredBy"
arFormValues0(5) = Request("EnteredBy")
arFormFields0(6) = "EnteredIntoManMan"
arFormDBFields0(6) = "EnteredIntoManMan"
arFormValues0(6) = Request("EnteredIntoManMan")
arFormFields0(7) = "POStatus"
arFormDBFields0(7) = "POStatus"
arFormValues0(7) = Request("POStatus")
arFormFields0(8) = "ConfirmedSignedPurchaseReq"
arFormDBFields0(8) = "ConfirmedSignedPurchaseReq"
arFormValues0(8) = Request("ConfirmedSignedPurchaseReq")
arFormFields0(9) = "Comments"
arFormDBFields0(9) = "Comments"
arFormValues0(9) = Request("Comments")
FP_SaveFormFields fp_rs, arFormFields0, arFormDBFields0
fp_rs.Update
PurchaseOrder = fp_rs(0)
FP_DumpError strErrorUrl, "Cannot update the database"
fp_rs.Close
fp_conn.Close
Response.Redirect "confirmation.asp?ID="&PurchaseOrder
End If
End If
%>
<% Response.Buffer = True %>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>tblPurchaseOrders_Minton_PO -- New</title>
<meta name="GENERATOR" content="Microsoft FrontPage 5.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
</head>
<body bgcolor="#FFFFFF">
<table width="100%" align=left>
<tr>
<td width="69%">
<b><font size=+3 color="#000080">Minton
Purchase Order Request </font></b>
</td>
<td width="31%" align=right>
<table align="left">
<tr>
<td align="center">
<p align="left"><b><a href="../../protected/po_menu.asp">Return to PO
Menu</a></b></td>
</tr>
</table>
</td>
</tr>
</table>
<p>
<br clear="all">
<hr>
<p>
<!--webbot BOT="GeneratedScript" PREVIEW=" " startspan --><script Language="JavaScript" Type="text/javascript"><!--
function FrontPage_Form1_Validator(theForm)
{
if (theForm.requestor.value == "")
{
alert("Please enter a value for the \"requestor\" field.");
theForm.requestor.focus();
return (false);
}
if (theForm.requestor.value.length < 5)
{
alert("Please enter at least 5 characters in the \"requestor\" field.");
theForm.requestor.focus();
return (false);
}
if (theForm.vendor.value == "")
{
alert("Please enter a value for the \"vendor\" field.");
theForm.vendor.focus();
return (false);
}
if (theForm.vendor.value.length < 3)
{
alert("Please enter at least 3 characters in the \"vendor\" field.");
theForm.vendor.focus();
return (false);
}
if (theForm.NotToExceed.value == "")
{
alert("Please enter a value for the \"not to exceed\" field.");
theForm.NotToExceed.focus();
return (false);
}
if (theForm.NotToExceed.value.length < 3)
{
alert("Please enter at least 3 characters in the \"not to exceed\" field.");
theForm.NotToExceed.focus();
return (false);
}
if (theForm.NotToExceed.value.length > 50)
{
alert("Please enter at most 50 characters in the \"not to exceed\" field.");
theForm.NotToExceed.focus();
return (false);
}
var chkVal = theForm.NotToExceed.value;
var prsVal = chkVal;
if (chkVal != "" && !(prsVal > "1.00"))
{
alert("Please enter a value greater than \"1.00\" in the \"not to exceed\" field.");
theForm.NotToExceed.focus();
return (false);
}
if (theForm.ConfirmedSignedPurchaseReq.selectedIndex < 0)
{
alert("Please select one of the \"Confirmed\" options.");
theForm.ConfirmedSignedPurchaseReq.focus();
return (false);
}
if (theForm.ConfirmedSignedPurchaseReq.selectedIndex == 0)
{
alert("The first \"Confirmed\" option is not a valid selection. Please choose one of the other options.");
theForm.ConfirmedSignedPurchaseReq.focus();
return (false);
}
return (true);
}
//--></script><!--webbot BOT="GeneratedScript" endspan --><form METHOD="POST" action="submission_form.asp" onsubmit="return FrontPage_Form1_Validator(this)" language="JavaScript" name="FrontPage_Form1" webbot-action="--WEBBOT-SELF--">
<input TYPE="hidden" NAME="VTI-GROUP" VALUE="0"><!--#include file="../../_fpclass/fpdbform.inc"-->
<table border="0" cellpadding="2" style="border-collapse: collapse" bordercolor="#111111" width="95%" id="AutoNumber1" cellspacing="5">
<tr>
<td width="68%" align="justify"><b>Requestor <font color="#FF0000">
(REQUIRED FIELD)</font> - Who is requesting this PO Number? (Be sure and utilize
the requestors complete name. Avoid entering only a first name or initials.)</b></td>
<td width="37%">
<!--webbot bot="Validation" s-display-name="requestor" b-value-required="TRUE" i-minimum-length="5" --><input type="text" name="requestor" size="20"></td>
</tr>
<tr>
<td width="68%" align="justify" bgcolor="#99CCFF"><b>Vendor <font color="#FF0000">(REQUIRED
FIELD)</font> - Who is this PO for?</b></td>
<td width="37%" bgcolor="#99CCFF">
<!--webbot bot="Validation" s-display-name="vendor" b-value-required="TRUE" i-minimum-length="3" --><input type="text" name="vendor" size="20"></td>
</tr>
<tr>
<td width="68%" align="justify"><b>Not To Exceed <font color="#FF0000">
(REQUIRED FIELD)</font> - Max Amount to Spend - (Enter with
decimal and zero's IE: 2.00 and no dollar signs)</b></td>
<td width="37%">
<!--webbot bot="Validation" s-display-name="not to exceed" b-value-required="TRUE" i-minimum-length="3" i-maximum-length="50" s-validation-constraint="Greater than" s-validation-value="1.00" --><input name="NotToExceed" size="19" value="" maxlength="50"></td>
</tr>
<tr>
<td width="68%" align="justify" bgcolor="#99CCFF"><b>Have you received an signed purchase
requisition? <font color="#FF0000">(REQUIRED FIELD)</font> (It is required that
you have an signed and authorized purchase requisition prior to providing an
purchase order number. Only in the event of an emergency may this be
bypassed.)</b></td>
<td width="37%" bgcolor="#99CCFF">
<p align="left">
<!--webbot bot="Validation" s-display-name="Confirmed" b-value-required="TRUE" b-disallow-first-item="TRUE" --><select size="1" name="ConfirmedSignedPurchaseReq">
<option selected>Select One</option>
<option value="Yes">Yes</option>
<option value="Emergency">Emergency</option>
</td>
</tr>
<tr>
<td width="68%">
<p align="justify"><b>Comments (OPTIONAL)</b></td>
<td width="37%"><textarea rows="2" name="Comments" cols="25"></textarea></td>
</tr>
</table>
<p><font color="#006666"><b>Click Request PO when Finished or click Reset to start over.
Be sure all information is correct prior to clicking request PO.</b></font></p>
<p><font color="#006666"><b></b></font><br>
</p>
<p><input type="submit" value="Request PO"><input type="reset" value=" Reset "></p>
<input type="hidden" name="Created" value="<%=Date()%>">
<input type="hidden" name="EnteredIntoManMan" value="No">
<input type="hidden" name="POStatus" value="Open">
<input type="hidden" name="EnteredBy" value="<%=Session("EnteredBy")%>">
</form>
<p><font color="#000080"><i>Virtual Campus 2004.ASP</i></font></p>
</body>
</html>
CONFIRMATION PAGE
<html>
<%
'If the session variable is False or does not exsist then redirect the user to the unauthorized user page
If Session("blnIsUserGood") = False or IsNull(Session("blnIsUserGood")) = True then
'Redirect to unathorized user page
Response.Redirect"/protected/unauthorized_user_page.htm"
End If
%>
<head>
<meta http-equiv="Content-Language" content="en-us">
<meta name="GENERATOR" content="Microsoft FrontPage 5.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252"> <title>Purchase Order Confirmation</title> </head>
<body>
<%
'Dimension Variables
Dim strUserName 'Holds the name of the user
'Get the users name passed from the previous page
strUserName = Request.QueryString("name")
Session("EnteredBy")=strUserName
%>
<p align="center"><b><font size="4" color="#000080">Virtual Campus - Purchase
Order System</font></b></p>
<p><font color="#000080"><b>Purchase Order Confirmation</b></font></p>
<p><i><font size="4">Thank you
<!--webbot bot="ConfirmationField" S-Field="Username" startspan --><%
Dim FP_SavedFields
FP_InitFormConfirmation
Sub FP_InitFormConfirmation
On Error Resume Next
Session("FP_OldCodePage") = Session.CodePage
Session("FP_OldLCID") = Session.LCID
Session.CodePage = 1252
Session.LCID = 1033
set FP_SavedFields = Server.CreateObject("Scripting.Dictionary")
if IsArray(Session("FP_SavedFields")) and IsArray(Session("FP_SavedValues")) then
Dim FP_arFields
Dim FP_arValues
Dim FP_idx
FP_arFields = Session("FP_SavedFields")
FP_arValues = Session("FP_SavedValues")
for FP_idx = 0 to UBound(FP_arFields)
FP_SavedFields.Item(FP_arFields(FP_idx)) = FP_arValues(FP_idx)
next
Session("FP_SavedFields") = ""
Session("FP_SavedValues") = ""
end if
Session.CodePage = Session("FP_OldCodePage")
Session.LCID = Session("FP_OldLCID")
End Sub
Sub FP_ConfirmField(sField)
On Error Resume Next
Session("FP_OldCodePage") = Session.CodePage
Session("FP_OldLCID") = Session.LCID
Session.CodePage = 1252
Session.LCID = 1033
sOut = FP_SavedFields(sField)
sOut = Replace(sOut,"&","^^@^^")
sOut = Server.HTMLEncode(sOut)
sOut = Replace(sOut,"^^@^^","&")
Response.Write sOut
Session.CodePage = Session("FP_OldCodePage")
Session.LCID = Session("FP_OldLCID")
End Sub
%><%FP_ConfirmField("Username")%><!--webbot bot="ConfirmationField" i-checksum="45505" endspan --> for your PO request.</font></i></p> <p>
<b>Your Purchase Order Number is: <%=Request.QueryString("ID")%><%=Server.HTMLEncode(FP_SavedFields("Purchaseorder"))%> </b>
<p align="center"> </p>
<p align="center"> </p>
<p align="center"><b>Close Window When Finished</b></p>
|
|
|
|
BeTheBall
Posts: 6355 Joined: 6/21/2002 From: West Point Utah USA Status: offline
|
RE: Missing Usernames - 7/26/2004 10:45:41
What about check_user.asp? What does that look like?
_____________________________
Duane Some people are like Slinkies . . . Not really good for anything . . . . . But they still bring a smile to your face when you push them down a flight of stairs.
|
|
|
|
styrochem
Posts: 212 Joined: 5/11/2004 Status: offline
|
RE: Missing Usernames - 7/26/2004 11:30:21
Sorry....here is the check user script. <%
'Dimension variables
Dim adoCon 'Database Connection Variable
Dim strCon 'Holds the Database driver and the path and name of the database
Dim rsCheckUser 'Database Recordset Variable
Dim strAccessDB 'Holds the Access Database Name
Dim strSQL 'Database query sring
Dim strUserName 'Holds the user name
'Initalise the strUserName variable
strUserName = Request.Form("txtUserName")
'Check the database to see if user exsits and read in there password
'Initialise the strAccessDB variable with the name of the Access Database
strAccessDB = "users"
'Create a connection odject
Set adoCon = Server.CreateObject("ADODB.Connection")
'Database connection info and driver
strCon = "DRIVER={Microsoft Access Driver (*.mdb)};uid=;pwd=letmein; DBQ=" & Server.MapPath(strAccessDB)
'Set an active connection to the Connection object
adoCon.Open strCon
'Create a recordset object
Set rsCheckUser = Server.CreateObject("ADODB.Recordset")
'Initalise the strSQL variable with an SQL statement to query the database
strSQL = "SELECT tblUsers.Password FROM tblUsers WHERE tblUsers.UserID ='" & strUserName & "'"
'Query the database
rsCheckUser.Open strSQL, strCon
'If the recordset finds a record for the username entered then read in the password for the user
If NOT rsCheckUser.EOF Then
'Read in the password for the user from the database
If (Request.Form("txtUserPass")) = rsCheckUser("Password") Then
'If the password is correct then set the session variable to True
Session("blnIsUserGood") = True
'Close Objects before redirecting
Set adoCon = Nothing
Set strCon = Nothing
Set rsCheckUser = Nothing
'Redirect to the authorized user page and send the users name
Response.Redirect"po_menu.asp?name=" & strUserName
End If
End If
'Close Objects
Set adoCon = Nothing
Set strCon = Nothing
Set rsCheckUser = Nothing
'If the script is still running then the user must not be authorized
Session("blnIsUserGood") = False
'Redirect to the unautorised user page
Response.Redirect"unauthorized_user_page.htm"
%>
|
|
|
|
BeTheBall
Posts: 6355 Joined: 6/21/2002 From: West Point Utah USA Status: offline
|
RE: Missing Usernames - 7/26/2004 11:42:02
To me, it would seem most logical to create the session variable in check_user.asp. Something like: 'If the recordset finds a record for the username entered then read in the password for the user If NOT rsCheckUser.EOF Then 'Read in the password for the user from the database If (Request.Form("txtUserPass")) = rsCheckUser("Password") Then 'If the password is correct then set the session variable to True Session("blnIsUserGood") = True Session("EnteredBy") = strUserName 'Close Objects before redirecting Set adoCon = Nothing Set strCon = Nothing Set rsCheckUser = Nothing 'Redirect to the authorized user page and send the users name Response.Redirect"po_menu.asp?name=" & strUserName End If End If
_____________________________
Duane Some people are like Slinkies . . . Not really good for anything . . . . . But they still bring a smile to your face when you push them down a flight of stairs.
|
|
|
|
styrochem
Posts: 212 Joined: 5/11/2004 Status: offline
|
RE: Missing Usernames - 7/27/2004 7:28:43
Duane: This page is working fine though. Its where the submission and confirmation page that the username is lost. All of the other pages have no problems like this. Could I some how script the submission form and confirmation page to retrieve the username from the check_user.asp or the session file it creates?
|
|
|
|
BeTheBall
Posts: 6355 Joined: 6/21/2002 From: West Point Utah USA Status: offline
|
RE: Missing Usernames - 7/27/2004 8:40:44
If you use a session variable, then the user name should remain available as long as the user keeps the browser open. I think what is happening now, is that when a user returns to the PO Menu page, the user name is lost because the user name originally comes from the querystring in the redirect that appears in checkuser.asp. Well, since the next time the user goes to the PO Menu page, they bypass checkuser.asp, the query string is empty and thus the user name becomes empty. Normally, when using a login system, you would create any session variables on the same page that verifies the user. That is why I would make the change to check_user.asp I suggested above. Then, in the PO Menu page, you should change: <% 'Dimension Variables Dim strUserName 'Holds the name of the user 'Get the users name passed from the previous page strUserName = Request.QueryString("name") Session("EnteredBy")=strUserName %> to: <% 'Dimension Variables Dim strUserName 'Holds the name of the user 'Get the users name passed from the previous page strUserName = Session("EnteredBy") %> Now, it may be there are other problems going on here, such as the issue with subwebs Spooky mentioned earlier. However, I do know that if your users were making multiple visits to the PO Menu page, the username would be lost after the first visit due to an empty querystring. Hope this makes sense.
< Message edited by BeTheBall -- 7/27/2004 9:29:30 >
_____________________________
Duane Some people are like Slinkies . . . Not really good for anything . . . . . But they still bring a smile to your face when you push them down a flight of stairs.
|
|
|
|
styrochem
Posts: 212 Joined: 5/11/2004 Status: offline
|
RE: Missing Usernames - 7/27/2004 9:19:55
Ok...I implemented the above changes and it is the confirmation page that is the problem. After the confirmation page provides the PO number and you click to return to PO Menu, the username is missing at the top of the PO Menu page. What can I do to correct this?
|
|
|
|
BeTheBall
Posts: 6355 Joined: 6/21/2002 From: West Point Utah USA Status: offline
|
RE: Missing Usernames - 7/27/2004 10:04:13
With the changes we have made, you should not need this code on the confirmation page: <% 'Dimension Variables Dim strUserName 'Holds the name of the user 'Get the users name passed from the previous page strUserName = Request.QueryString("name") Session("EnteredBy")=strUserName %> Again, because there is no query string, the session is being reset to nothing.
_____________________________
Duane Some people are like Slinkies . . . Not really good for anything . . . . . But they still bring a smile to your face when you push them down a flight of stairs.
|
|
New Messages |
No New Messages |
Hot Topic w/ New Messages |
Hot Topic w/o New Messages |
Locked w/ New Messages |
Locked w/o New Messages |
| |