📄 customizedanalysis.asp
字号:
<html>
<head>
<title>customized Survey Analysis </title>
<%
dim questionNum
dim options
dim snArray()
function createQuestions()
on error resume next
dim questionsDom, questionsNode, tablesNum, questionId, k, options,questionTitle, m
m = 0
set questionsDom = Server.CreateObject("Microsoft.XMLDOM")
questionsDom.async = false
questionsDom.load(Server.MapPath("../xmls") & "/surveyInfo.xml")
set questionsNode = questionsDom.getElementsByTagName("question")
tablesNum = questionsNode.length
response.write("<span style='font-size:14; font-weight:bold; margin-left:40px; '>Questions Menu</span><div style='width:300px; border:1px solid black; font-family:Verdana, Arial, Helvetica, sans-serif; font-size:12; margin-left:40px; margin-top:10px;'>")
redim snArray(tablesNum)
for k = 0 to tablesNum-1 step 1
questionId = questionsNode.item(k).getAttribute("id")
questionTitle = questionsNode.item(k).childNodes.item(1).childNodes.item(0).Text
thisDataType = questionsNode.item(k).childNodes.item(3).childNodes.item(0).Text
if len(questionTitle)>0 then
snArray(m) = k
m = m + 1
response.write("<div class='clear wide' onmouseover='className=""red wide""' onmouseout='className=""clear wide""' onClick='handleShow(document.getElementById("""&questionId&"Menu""))'>")
response.Write(questionTitle)
response.write("</div>")
end if
next
response.Write("</div>")
createSqlWindow()
questionsDom.close
set questionsDom =nothing
set questionsNode =nothing
for k = 0 to m step 1
generatesubMenu(snArray(k))
next
set QuestionsDom = nothing
set questionsNode = nothing
end function
function generatesubMenu(k)
dim i, m, qType, qId, qTitle, questionsDom, questionsSet, currentQuestion, answersSetanswersNum, answerId, answerTitle, aTitle, qTopic
dim answerArray()
dim titleArray()
set questionsDom = Server.CreateObject("Microsoft.XMLDOM")
questionsDom.async = false
questionsDom.load(Server.MapPath("../xmls") & "/surveyInfo.xml")
set questionsSet = questionsDom.getElementsByTagName("question")
set currentQuestion = questionsSet.item(k)
qId = currentQuestion.getAttribute("id")
isGrid = currentQuestion.childNodes.item(4).childNodes.item(0).getAttribute("isGrid")
qType = currentQuestion.childNodes.item(3).childNodes.item(0).Text
qTitle = currentQuestion.childNodes.item(1).childNodes.item(0).Text
set answersSet = currentQuestion.childNodes.item(4).childNodes
answersNum = answersSet.length-1
redim answerArray(answersNum)
redim titleArray(answersNum)
response.write("<div class='hide' id = '"& qId &"Menu' style='width:300px; border:1px solid black; font-family:Verdana, Arial, Helvetica, sans-serif; font-size:12; margin-left:40px;'>")
m = 0
for i = 1 to answersNum step 1
answerId = answersSet.item(i).getAttribute("id")
answerTitle = answersSet.item(i).childNodes.item(0).Text
if isGrid = "0" then
aTitle = replace(answerTitle, "," , " " )
aTitle = replace(aTitle, "." , " " )
aTitle = replace(aTitle, ":" , " " )
aTitle = replace(aTitle, ";" , " " )
aTitle = replace(aTitle, """" , " " )
aTitle = replace(aTitle, "'" , " " )
aTitle = replace(aTitle, "(" , " " )
aTitle = replace(aTitle, ")" , " " )
aTitle = replace(aTitle, "<" , " " )
aTitle = replace(aTitle, ">" , " " )
qTopic = replace(qTitle, "," , " ")
qTopic = replace(qTopic, ":" , " ")
qTopic = replace(qTopic, ";" , " ")
qTopic = replace(qTopic, """" , " ")
qTopic = replace(qTopic, "'" , " ")
qTopic = replace(qTopic, "(" , " ")
qTopic = replace(qTopic, ")" , " ")
qTopic = replace(qTopic, "<" , " ")
qTopic = replace(qTopic, ">" , " ")
qTopic = replace(qTopic, "." , " ")
response.write("<div class='clear wide' onmouseover='className=""red wide""' onmouseout='className=""clear wide""' ondblClick=""recordSql('"& answerId &"','" &qType &"', '" &isGrid &"', '" &qTopic &"', '" &qId &"', '" & aTitle &"', "& i & ")"">")
response.Write(answerTitle)
response.write("</div>")
end if
if isGrid = "-1" then
answerArray(m) = answerId
titleArray(m) = qTitle & ": \n\t"& answerTitle
m = m + 1
response.write("<div class='clear wide' onmouseover='className=""red wide""' onmouseout='className=""clear wide""' onClick='showAnswerMenu("""&answerId&"Menu"")'>")
response.Write(answerTitle)
response.write("</div>")
end if
next
response.Write("</div>")
for w = 0 to m-1 step 1
generateRankMenu k, answerArray(w), qId, titleArray(w)
next
set questionsSet = nothing
set currentQuestion = nothing
set answersSet = nothing
end function
function generateRankMenu(k, answerId, qId, answerTitle)
dim questionsDom, questionsSet, currentQuestion, aTitle, rankTopic
set questionsDom = Server.CreateObject("Microsoft.XMLDOM")
questionsDom.async = false
questionsDom.load(Server.MapPath("../xmls") & "/surveyInfo.xml")
set questionsSet = questionsDom.getElementsByTagName("question")
set currentQuestion = questionsSet.item(k)
qId = currentQuestion.getAttribute("id")
isGrid = currentQuestion.childNodes.item(4).childNodes.item(0).getAttribute("isGrid")
qType = currentQuestion.childNodes.item(3).childNodes.item(0).Text
qTitle = currentQuestion.childNodes.item(1).childNodes.item(0).Text
set ranksSet = currentQuestion.childNodes.item(4).childNodes.item(0).childNodes.item(0).childNodes
ranksNum = ranksSet.length-1
response.write("<div class='rankHide' id = '"& answerId&"Menu' style='width:300px; border:1px solid black; font-family:Verdana, Arial, Helvetica, sans-serif; font-size:12; margin-left:40px;' >")
for i = 0 to ranksNum step 1
ranksId = currentQuestion.childNodes.item(4).childNodes.item(0).getAttribute("id")
rankTitle = ranksSet.item(i).Text
aTitle = replace(answerTitle, "," , " " )
aTitle = replace(aTitle, "." , " " )
aTitle = replace(aTitle, ":" , " " )
aTitle = replace(aTitle, ";" , " " )
aTitle = replace(aTitle, """" , " " )
aTitle = replace(aTitle, "'" , " " )
aTitle = replace(aTitle, "(" , " " )
aTitle = replace(aTitle, ")" , " " )
aTitle = replace(aTitle, "<" , " " )
aTitle = replace(aTitle, ">" , " " )
rankTopic = replace(rankTitle, "," , " ")
rankTopic = replace(rankTopic, ":" , " ")
rankTopic = replace(rankTopic, ";" , " ")
rankTopic = replace(rankTopic, """" , " ")
rankTopic = replace(rankTopic, "'" , " ")
rankTopic = replace(rankTopic, "(" , " ")
rankTopic = replace(rankTopic, ")" , " ")
rankTopic = replace(rankTopic, "<" , " ")
rankTopic = replace(rankTopic, ">" , " ")
rankTopic = replace(rankTopic, "." , " ")
if trim(rankTitle)<>"" then
response.write("<div class='clear wide' onmouseover=""className='red wide'"" onmouseout=""className='clear wide'"" ondblClick=""recordSql('"& answerId & "rank" & i+1 & "', '" & qType &"', '" &isGrid &"', '" & aTitle &"', '" &qId &"', '" &rankTopic &"', " & i & ");"">")
response.Write("<a id='" & answerId & "rank" & i+1 & "'>"& rankTitle &"</a>")
response.write("</div>")
end if
next
response.Write("</div>")
set questionsSet = nothing
set currentQuestion = nothing
set ranksSet = nothing
end function
function createSqlWindow()
response.write("<table style='margin-top:20px;' onclick='hideAllSubMenu()'><tr><td align='center' style='font-size:14; font-weight:bold;'>Query Condition Generator</td><td align='center' style='font-size:14; font-weight:bold;'>Description</td></tr>")
response.Write("<tr><td><textarea id='sqlContainer' style='height:150px; position:relative; left:35px; top:10px; width:400px; margin-bottom:10px; overflow:hidden; background-color:#ADC4CF; color:#330066;' ></textarea></td>")
response.Write("<td><textarea id='sqlDescription' style='height:150px; position:relative; left:40px; top:10px; width:530px; margin-bottom:10px; background-color:#CDC4CF; color:#330066; font-size:11px;' ></textarea></td></tr>")
response.write("<tr><td align='center'><input type='button' id='customize' value='Generate Report' onClick='startCustomizing()' /></td></tr>")
response.write("<tr><td colSpan = 2 style=""color:#499999; size:2;""><p style='margin-left:40px; font-size:12px'>Note: This program supports valid Access Sql statement without sub query statement<br /> -1 --- true; 0 --- false<br />If this is first time of customized analysis, please configure database according to following procedure:<br />(1) Open Database in directory: "& Server.MapPath("../database")& "/surveyData.mdb in workzone<br />(2) Select 'No' in the popup 'Security Warning' box <br />(3) Select 'Open' in following popup Box<br />(3) In 'Tools' menu select and Open'Security' --> 'User and Group Permissions...'<br />(4) In the right window of the popup form, scrol and select 'MSysObject' <br />(5) Check the below 'Read data' check box <br />(6) press 'Apply' and 'Ok'<br />(7) Starat Customized Analysis</p></td></tr></table>")
end function
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -