<%
' Obtain user's logon
If Request.ServerVariables("LOGON_USER") = "" Then
Response.Status = "401 access denied"
Response.End
End If
%>
<html>
<head>
<hta:application navigable=yes />
<script type="text/vbscript">
sub closeWindow()
msgBox "Please close this window now"
end sub
sub missingFields()
msgBox "You are missing some fields. Have you completed the retention Section?"
end sub
'Function goes to previous url
'Executed when 'undo' button is click
'Has effect of returning form to state before last update
sub undo_click()
window.history.go -1
end sub
</script>
<!--Following Code Initialises Database Link-->
<%
'Create Connecction
Set Conn = Server.CreateObject("ADODB.Connection")
Conn.open "Provider=SQLOLEDB.1;Password=;Persist Security Info=True;User ID=WEBUSER;Initial Catalog=RECON;Data Source=EDINBUR-DMSD"
'Get the user's name from the login
strUser = getNameFromLogin(Request.ServerVariables("LOGON_USER"))
'Function takes logon and returns the user's name
function getNameFromLogin(cLogin)
dim cPayNo 'Variable to hold taag or 's' number
dim sSQL 'SQL String
dim rsLogin 'Recordset for SQL return
dim cName 'String to hold agent's name
'get ID
cPayNo = mid(cLogin, instr(cLogin, "\") + 1)
'Create SQL string and execute it
sSQL = "SELECT name FROM tblLogins WHERE login LIKE '" & cPayNo & "';"
set rsLogin = conn.Execute(sSQL)
if rsLogin.BOF and rsLogin.EOF THEN 'No Match is found
cName = cPayNo 'Use the login
else
'get the name from the recordset
cName = rsLogin("name")
end if
'close the recordset
rsLogin.close
'return the name
getNameFromLogin = cName
end function
'SET MANAGER QUERY STRING ACCORDING TO EVENT
if request.querystring("cboManager") <> "" THEN
managerSQL = "SELECT PayNo, ManagerName FROM tblManager WHERE PayNo LIKE '" & request.querystring("cboManager") & "';"
else
managerSQL = "SELECT PayNo, ManagerName FROM tblManager"
end if
'SET DEPARTMENT QUERY STRING ACCORDING TO EVENT
if request.querystring("cboDept") <> "" THEN
deptSQL = "SELECT DEPTID, DESCRIP FROM tblDept WHERE DEPTID LIKE '" & request.querystring("cboDept") & "';"
else
deptSQL = "SELECT DEPTID, DESCRIP FROM tblDept;"
end if
'SET CALLTYPE QUERY STRING ACCORDING TO EVENT
if request.querystring("cboCallType") <> "" THEN
callSQL = "SELECT CALLTYPEID, DESCRIP FROM tblCalltype WHERE CALLTYPEID LIKE '" & request.queryString("cboCalltype") & "';"
else
callSQL = "SELECT CALLTYPEID, DESCRIP FROM tblCalltype;"
end if
'SET RECONTYPE QUERY STRING ACCORDING TO EVENT
if request.querystring("cboReconType") <> "" THEN
reconSQL = "SELECT COMPLAINTTYPEID, DESCRIP FROM tblComplaintType WHERE COMPLAINTTYPEID LIKE '" & Request.QueryString("cboReconType") & "';"
else
reconSQL = "SELECT COMPLAINTTYPEID, DESCRIP FROM tblComplaintType;"
end if
'SET CATEGORY QUERY STRING ACCORDING TO EVENT
if request.querystring("cboCategory") <> "" THEN
categorySQL = "SELECT catid, DESCRIP FROM tblCategory WHERE catid LIKE '" & Request.QueryString("cboCategory") & "';"
else
categorySQL = "SELECT catid, DESCRIP FROM tblCategory WHERE complainttypeid Like '" & Request.QueryString("cboReconType") & "';"
end if
'SET SUBCATEGORY QUERY STRING ACCORDING TO EVENT
if request.querystring("cboSubCat") <> "" THEN
subSQL = "SELECT SUBCATID, SUBCATDESCRIP FROM tblSubCat WHERE SUBCATID LIKE '" & Request.QueryString("cboSubCat") & "';"
else
subSQL = "SELECT SUBCATID, SUBCATDESCRIP FROM tblSubCat WHERE categoryid like '" & Request.QueryString("cboCategory") & "';"
end if
'DETERMINE IF INPUT IS FINISHED
if request.QueryString("bWithdrawing") <> "" then
if request.queryString("bRetained") <> "" then
if request.queryString("bMel") <> "" then
if request.queryString("bCallback") <> "" then
bFinished = "TRUE"
end if
end if
end if
end if
%>
<script language="JavaScript">
<!--
function MM_findObj(n, d) { //v3.0
var p,i,x; if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document); return x;
}
function MM_swapImage() { //v3.0
var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
function MM_swapImgRestore() { //v3.0
var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}
function MM_preloadImages() { //v3.0
var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}
//-->
</script>
<base target="main">
</head>
<!--Setup the form-->
<form action="recon.asp" target="_self" method="GET" name="ReconForm">
<table width="100%" CELLSPACING="0" border="0" cellpadding="0" bgcolor="#808080" height="443" style="border-style: outset; border-color: #BFBFBF">
<tr>
<td bgcolor="#000080" height="64" width="35" bordercolor="#000080" align="center">
</td>
<td colspan="3" height="64" width="687" bgcolor="#000080">
<div align="center"><b><font face="Verdana" color="#FFFFFF"><font size="4">Input required
data below, when you have finished, click 'SUBMIT'</font><font size="5"><br>
<font size="2">If you make a mistake, just use the 'Undo' button below</font> </font></font></b></div>
</td>
</tr>
<tr>
<td width="33" height="21" bordercolor="#808080" style="border-right-style: groove" align="center"><font face="Verdana" size="2"> </font></td>
<td width="298" height="21" ><font face="Verdana" size="2">Agent Name</font></td>
<td width="281" height="21">
<font face="Verdana" size="2">
<%response.write("<B>"&strUser&"</B>")%>
</font>
</td>
<td width="104" height="21" ><font face="Verdana" size="2"> </font></td>
</tr>
<tr>
<td width="33" height="25" bordercolor="#808080" style="border-right-style: groove" align="center" ><b><font face="Verdana" size="2">1</font></b></td>
<td width="298" height="25" ><font face="Verdana" size="2">Manager Name</font></td>
<td width="281" height="25" >
<font face="Verdana" size="2">
<select size="1" name="cboManager" style="width: 100%;">
<%
Set rs = Conn.Execute(managerSQL)
Do while not rs.eof
Response.write "<option value='" & rs("PayNo") & "'>"
Response.write rs("ManagerName")
Response.write "</option>"
rs.MoveNext
Loop
rs.close
set rs=nothing
%>
</select>
</font>
</td>
<td width="104" height="25" ><font face="Verdana" size="2"> </font></td>
</tr>
<tr>
<td width="33" height="25" bordercolor="#808080" style="border-right-style: groove" align="center" ><b><font face="Verdana" size="2">2</font></b></td>
<td width="298" height="25" ><font face="Verdana" size="2">Department</font></td>
<td width="281" height="25" >
<font face="Verdana" size="2">
<select size="1" name="cboDept" width="200" style="width: 100%;">
<%
Set rs = Conn.Execute(deptSQL)
Do while not rs.eof
Response.write "<option value='" & rs("DEPTID") & "'>"
Response.write rs("DESCRIP")
Response.write "</option>"
rs.MoveNext
Loop
rs.close
set rs=nothing
%>
</select>
</font>
</td>
<td width="104" height="25" ><font face="Verdana" size="2"> </font></td>
</tr>
<tr>
<td width="33" height="25" bordercolor="#808080" style="border-right-style: groove" align="center" ><b><font face="Verdana" size="2">3</font></b></td>
<td width="298" height="25" ><font face="Verdana" size="2">Call Type</font></td>
<td width="281" height="25" >
<font face="Verdana" size="2">
<select size="1" name="cboCallType" style="width: 100%;">
<%
Set rs = Conn.Execute(callSQL)
Do while not rs.eof
Response.write "<option value='" & rs("CALLTYPEID") & "'>"
Response.write rs("DESCRIP")
Response.write "</option>"
rs.MoveNext
Loop
rs.close
set rs=nothing
%>
</select>
</font>
</td>
<td width="104" height="25" ><font face="Verdana" size="2"> </font></td>
</tr>
<tr>
<td width="33" height="25" bordercolor="#808080" style="border-right-style: groove" align="center" ><b><font face="Verdana" size="2">4</font></b></td>
<td width="298" height="25" ><font face="Verdana" size="2">Recon Type</font></td>
<td width="281" height="25" >
<font face="Verdana" size="2">
<select size="1" name="cboReconType" style="width: 100%;">
<%
Set rs = Conn.Execute(reconSQL)
Do while not rs.eof
Response.write "<option value='" & rs("COMPLAINTTYPEID") & "'>"
Response.write rs("DESCRIP")
Response.write "</option>"
rs.MoveNext
Loop
rs.close
set rs=nothing
%>
</select>
</font>
</td>
<td width="104" height="25" ><font face="Verdana" size="2"> </font></td>
</tr>
<tr>
<td width="33" height="25" bordercolor="#808080" style="border-right-style: groove" align="center" ><b><font face="Verdana" size="2">5</font></b></td>
<td width="298" height="25" ><font face="Verdana" size="2">Category</font></td>
<td width="281" height="25" >
<font face="Verdana" size="2">
<select size="1" name="cboCategory" style="width: 100%;">
<%
Set rs = Conn.Execute(categorySQL)
Do while not rs.eof
Response.write "<option value='" & rs("catid") & "'>"
Response.write rs("DESCRIP")
Response.write "</option>"
rs.MoveNext
Loop
rs.close
set rs=nothing
%>
</select>
</font>
</td>
<td width="104" bgcolor="#808080" height="25" ><img border="0" src="getCat.gif" onClick="submit()"></td>
</tr>
<tr>
<td width="33" height="26" bordercolor="#808080" style="border-right-style: groove" align="center" ><b><font face="Verdana" size="2">6</font></b></td>
<td width="298" height="26" ><font face="Verdana" size="2">Sub Category</font></td>
<td width="281" height="26" >
<font face="Verdana" size="2">
<select size="1" name="cboSubCat" style="width: 100%;">
<%
if Request.QueryString("cboCategory") <> "" THEN
Set rs = Conn.Execute(subSQL)
Do while not rs.eof
Response.write "<option value='" & rs("SUBCATID") & "'>"
Response.write rs("SUBCATDESCRIP")
Response.write "</option>"
rs.MoveNext
Loop
rs.close
set rs=nothing
end if
%>
</select>
</font>
</td>
<td width="104" height="26" ><img border="0" src="getsubcat.gif" onClick="submit()"></td>
</tr>
<tr>
<td width="33" height="25" bordercolor="#808080" style="border-right-style: groove" align="center" ><b><font face="Verdana" size="2">7</font></b></td>
<td width="298" height="25" ><font face="Verdana" size="2">CRN</font></td>
<td width="281" height="25" >
<font face="Verdana" size="2">
<input type="text" name="txtCRN" maxlength="13" value="<%Response.Write Request.QueryString("txtCRN")%>" size="39">
</font>
</td>
<td width="104" height="25" ><font face="Verdana" size="2"> </font></td>
</tr>
<tr>
<td width="33" height="19" bordercolor="#808080" style="border-right-style: groove" align="center" ><b><font face="Verdana" size="2">8</font></b></td>
<td width="298" height="19" ><font face="Verdana" size="2">Recon Callback
Required?</font></td>
<td width="385" height="19" colspan="2" ><font face="Verdana" size="2">YES
<input type="radio" value="1" name="bCallback"
<% if request.queryString("bCallback") = "1" then response.write "checked" end if%>>
NO
<input type="radio" name="bCallback" value="0"
<% if request.queryString("bCallback") = "0" then response.write "checked" end if%>>
TEL</font> <input type="text" name="cTelNo" size="20">
</td>
</tr>
<tr>
<td width="33" height="19" bordercolor="#808080" style="border-right-style: groove" align="center" ><b><font face="Verdana" size="2">9</font></b></td>
<td width="298" height="19" ><font face="Verdana" size="2">Withdrawal Mentioned</font></td>
<td width="281" height="19" ><font face="Verdana" size="2">YES
<input type="radio" value="1" name="bWithdrawing"
<% if request.queryString("bWithdrawing") = "1" then response.write "checked" end if%>>
NO
<input type="radio" name="bWithDrawing" value="0"
<% if request.queryString("bWithdrawing") = "0" then response.write "checked" end if%>></font>
</td>
<td width="104" height="19" ><font face="Verdana" size="2"> </font></td>
</tr>
<tr>
<td width="33" height="19" bordercolor="#808080" style="border-right-style: groove" align="center" ><b><font face="Verdana" size="2">10</font></b></td>
<td width="298" height="19" ><font face="Verdana" size="2">Mind Changed?</font></td>
<td width="281" height="19" ><font face="Verdana" size="2">YES
<input type="radio" name="bRetained" value="1"
<% if request.queryString("bRetained") = "1" then response.write "checked" end if%>>
NO
<input type="radio" name="bRetained" value="0"
<% if request.queryString("bRetained") = "0" then response.write "checked" end if%>>
</font>
</td>
<td width="104" height="19" ><font face="Verdana" size="2"> </font></td>
</tr>
<tr>
<td width="33" height="19" bordercolor="#808080" style="border-right-style: groove" align="center" ><b><font face="Verdana" size="2">11</font></b></td>
<td width="298" height="19" ><font face="Verdana" size="2">I Have Raised a
MEL </font></td>
<td width="385" height="19" colspan="2" ><font face="Verdana" size="2">YES
<input type="radio" name="bMel" value="1"
<% if request.queryString("bMel") = "1" then response.write "checked" end if%>>
NO
<input type="radio" name="bMel" value="0"
<% if request.queryString("bMel") = "0" then response.write "checked" end if%>></font>
<b><font face="Verdana" size="2" color="#0000FF">(Only if customer
demands a mgr)</font></b>
</td>
</tr>
<tr>
<td width="33" height="78" bordercolor="#808080" style="border-right-style: groove" align="center">
<b><font face="Verdana" size="2">12</font></b>
</td>
<td colspan="3" width="100%" height="78" valign="bottom">
<div align="center">
<hr>
<font face="Verdana" size="2">Comments : <sup><br>
</sup>
<textarea rows="2" name="txtComments" cols="72" value="<%response.Write txtComments%>"></textarea>
</font>
<hr>
</div>
</td>
</tr>
<tr>
<td width="33" height="26" bordercolor="#808080" style="border-right-style: groove" align="center">
<b><font face="Verdana" size="2">13</font></b>
</td>
<td colspan="3" width="687" height="26">
<p align="center">
<input type="submit" value="Submit" name="B1" style="border-style: outset; border-color: #C0C0C0"><input type="button" value="Undo" name="undo" onClick="undo_Click()" style="border-style: outset; border-color: #C0C0C0">
</td>
</tr>
</table>
</form>
<%
if bFinished = "TRUE" THEN 'All necessary items are completed
'Get all info that is to be written to database
managerpayno = request.querystring("cboManager")
crn = request.querystring("txtcrn")
details = request.querystring("txtcomments")
subcatid = request.querystring("cboSubcat")
calltypeid = request.querystring("cboCallType")
complainttypeid = request.querystring("cboReconType")
categoryid = request.querystring("cboCategory")
wantstowd = request.querystring("bWithdrawing")
mindchanged = request.querystring("bRetained")
deptid = request.querystring("cboDept")
melraised = request.querystring("bMel")
lCallBack = request.querystring("bCallBack")
telno = request.querystring("cTelNo")
'Create SQL Query that will update database
strUpdateTable = "INSERT INTO tblRecon (Agent, managerpayno, crn, details, subcatid, calltypeid, complainttypeid, categoryid, wantstowd, mindchanged, deptid, melraised, dateraised, timeraised, callback, telno) VALUES ('" & strUser & "','" & managerpayno & "','" & crn & "','" & details & "','" & subcatid & "','" & calltypeid & "','" & complainttypeid & "','" & categoryid & "','" & wantstowd & "','" & mindchanged & "','" & deptid & "','" & melraised & "','" & date & "','" & FormatDateTime(time, 3) & "','" & lCallback & "','" & telno & "');"
'Execute Query
set rsNew = conn.execute(strUpdateTable)
'Close Window
set rsNew = nothing
set conn = nothing
response.write "<script>call closeWindow()</script>"
else
if request.querystring("cboManager") <>"" then
if request.querystring("txtcrn") <> "" then
if request.querystring("cboSubcat") <> "" then
if request.querystring("cboCategory") <> "" then
response.write "<script>call missingFields()</script>"
end if
end if
end if
end if
end if
%>
<table border="1" width="100%" cellspacing="0" cellpadding="0">
<tr>
<td width="50%"><font face="Verdana"><font size="2">
If you have any difficulties or feedback, please contact:</font><br>
<b><font size="2">Graeme Taylor<br>
Edinburgh Development Team<br>
Whitehouse<BR>
ext 15522</font>
</b>
</font></td>
<td width="50%">
<p align="right"><font size="2" face="Verdana">If you would like to
clarify RECON procedure, contact:</font><br>
<font size="2" face="Verdana"><b>Keith McLachlan<br>
Service Improvement Team <br>
Upper Whitehouse<br>
Ext 1569</b></font></td>
</tr>
</table>