123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232 |
- <?xml version="1.0" encoding="EUC-KR"?>
- <!--
- * Name : SPCIT00200_만족도설문 미리보기
- * Summary : 만족도 설문 미리보기
- * Programmer : 신용준
- * Date Written : 2010.11.11
- * History :
- * Remark :
- -->
- <?xml-stylesheet type="text/css" href="../../../com/commonweb/css/common.css" ?>
- <xhtml:html xmlns:xhtml="http://www.w3.org/1999/xhtml" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://www.w3.org/2002/01/xforms" xmlns:ev="http://www.w3.org/2001/xml-events">
- <xhtml:head>
- <xhtml:title>만족도 설문 미리보기</xhtml:title>
- <model id="model1">
- <instance id="instance1">
- <root xmlns="">
- <codes/>
- <main>
- <qestlist>
- <qestitemgrupseqno/>
- <qestitemgrupnm/>
- <qestitemgrupdesc/>
- <qestuseyn/>
- <colgstinqestyn/>
- <colgstinqestseqno/>
- <qestseqno/>
- <qpaprsortseq/>
- <itemkindcd/>
- <qestitemanswcnt/>
- <qestitemanswchoicolcnt/>
- <qestcnts/>
- <essnanswcnt/>
- <answseqno/>
- <qestitemanswcnts/>
- <divpnt/>
- <answaddcnts/>
- <figrinptyn/>
- <addinptyn/>
- <addflgrinptyn/>
- <essninptyn/>
- <norpaddyn/>
- <nextqestseqno/>
- <descinptyn/>
- </qestlist>
- </main>
- <send>
- <qestseqno/>
- <qestitemgrupseqno/>
- <qestitemlrgcd/>
- <qestitemmdlcd/>
- </send>
- </root>
- </instance>
- <submission id="TRCIT00201" mediatype="application/x-www-form-urlencoded" method="post" ref="/root/send" resultref="/root/main/qestlist"/>
- </model>
- <script type="javascript" src="../../../com/commonweb/js/common.js"/>
- <script type="javascript" src="../../../com/commonweb/js/tfHelper.js"/>
- <script type="javascript" src="../../../crm/cssaweb/js/CSZ001.js"/>
- <script type="javascript" ev:event="xforms-ready">
- <![CDATA[
- // 부모창의 설문지 일련번호를 가져온다.
- var qestseqno = opener.window.javascript.getParameter("qestseqno");
- var qestitemgrupseqno = opener.window.javascript.getParameter("qestitemgrupseqno");
- var qestitemlrgcd = opener.window.javascript.getParameter("qestitemlrgcd");
- var qestitemmdlcd = opener.window.javascript.getParameter("qestitemmdlcd");
-
- model.setValue("/root/send/qestseqno", qestseqno);
- model.setValue("/root/send/qestitemgrupseqno", qestitemgrupseqno);
- model.setValue("/root/send/qestitemlrgcd", qestitemlrgcd);
- model.setValue("/root/send/qestitemmdlcd", qestitemmdlcd);
- var columns = new Array("qestitemgrupseqno", "qestitemgrupnm", "qestitemgrupdesc", "qestuseyn", "colgstinqestyn", "colgstinqestseqno", "qestseqno" , "qpaprsortseq",
- "itemkindcd", "qestitemanswcnt" ,"qestitemanswchoicolcnt" , "qestcnts", "essnanswcnt",
- "answseqno", "qestitemanswcnts", "divpnt", "answaddcnts", "figrinptyn",
- "addinptyn", "addflgrinptyn", "essninptyn", "norpaddyn", "nextqestseqno",
- "descinptyn");
-
- // 설문지 미리보기을 조회 한다.
- if (submit("TRCIT00201")){
- var nodeList = root.selectNodes("/root/main/qestlist");
-
- // 그룹 정보
- var inLeft = 20;
- var inTop = 40;
- var groupContainer = body;
- var groupIndex = 0;
- var buttons = new Array();
- var selectIndex = 0;
-
- // 설문 정보
- var poll;
- var pre_qestseqno = -1;
- var arPreDatas = null;
- var arDatas = new Array();
- var rowIndex = 0;
- var totDataCnt = 0;
- var left = 10;
- var top = 0;
- var isContinuous = false; // 이전 척도연속 여부
- var pollHeight; //맨마지막 Row를 찍을때 시작위치
-
- var grupHeight; //그룹의 크기를 정한다.
- grupHeight = parseInt(groups.attribute("height"), 10);
-
- for (var i = 1; i <= nodeList.length; i ++ ) {
- var xPath = "/root/main/qestlist[" + i + "]";
- var qestitemgrupseqno = model.getValue(xPath + "/qestitemgrupseqno");
- var qestseqno= model.getValue(xPath + "/qestseqno");
- // 처음만 한번 찍는다.
- if (i == 1) {
- var button =makeButton(body, model.getValue(xPath + "/qestitemgrupnm"), 0, 0);
- button.attribute("group") = "answers";
- button.attribute("onclick") = "groups.selectedIndex = " + groupIndex +";";
- button.visible = false;
- var buttonWidth = parseInt(button.attribute("width"), 10);
- if (inLeft + buttonWidth > 800) {
- inTop += 20;
- inLeft = 20;
- } else {
- inLeft += buttonWidth;
- } // end if
- buttons[groupIndex] = button;
- groupContainer = makeCase(groups, "group_" + groupIndex, 0, 0, 800, 1000);
- var explOutput = makeOutput(groupContainer, model.getValue(xPath + "/qestitemgrupdesc"), 10, 20, 760);
- top = 20 + parseInt(explOutput.attribute("height"), 10);
- } // end if
-
- // 설문 문항 출력
- if (qestseqno != pre_qestseqno) {
- if( i != 1) {
- isContinuous = isIdentical(arPreDatas, arDatas);
- if(poll != undefined && poll != null) {
- top += parseInt(poll.attribute("height") ,10);
- if (!isContinuous) {
- top += 10;
- } // end if
- } // end if
- poll = createPoll(groupContainer, arDatas, "/root/value", left, top, !isContinuous);
- // Container 크기를 자동으로 늘리기
- if (top > grupHeight) {
- grupHeight = top;
- }
- }
- arPreDatas = arDatas;
- pre_qestseqno = qestseqno;
- arDatas = new Array();
- rowIndex = 0;
- isContinuous = false;
- totDataCnt++
- } // end i
- if(poll != undefined) {
- pollHeight = parseInt(poll.attribute("height"), 10);
- }
-
- var obj = new Object();
- for(var j = 0; j < columns.length; j ++) {
- obj[columns[j]] = model.getValue(xPath + "/" + columns[j]);
- } // end for
- arDatas[rowIndex] = obj;
- rowIndex ++;
- } // end for
-
- //맨마지막 줄 화면에 출력
- if (totDataCnt == 1 && arDatas.length >0 ) {
- top += 10
- poll = createPoll(groupContainer, arDatas, "/root/value", left, top, true);
- }else if (totDataCnt > 1 && arDatas.length >0 ) {
- top = top + pollHeight;
- var poll = createPoll(groupContainer, arDatas, "/root/value", left, top, false);
- // Container 크기를 자동으로 늘리기
- if (top > grupHeight) {
- grupHeight = top;
- }
- } // end i
-
- buttons[selectIndex].selected = true;
- groups.selectedIndex = selectIndex;
- groups.attribute("top") = inTop + 20;
-
- // Tab버튼 위치 조정
- inLeft = 20;
- var button = buttons[groupIndex];
- var buttonWidth = parseInt(button.attribute("width"), 10);
- if (inLeft + buttonWidth > 800) {
- inTop -= 20;
- inLeft = 20;
- }
- button.attribute("top") = inTop;
- button.attribute("left") = inLeft;
- button.visible = true;
- inLeft += buttonWidth;
-
- if ( grupHeight > parseInt(groups.attribute("height"), 10) ) {
- groups.attribute("height") = grupHeight + 32 + 70; // 마지막으로 Container 크기를 늘린다.
- }
-
- // groups.refresh();
- arDatas = null;
- arPreDatas = null;
- buttons = null;
- }
- model.refresh();
- columns = null;
- ]]>
- </script>
- <script type="javascript" ev:event="xforms-model-construct">
- <![CDATA[
- /*
- */
- ]]>
- </script>
- <script type="javascript">
- <![CDATA[
- // 만족도 설문지화면에 그리는 함수
- ]]>
- </script>
- </xhtml:head>
- <xhtml:body pagewidth="1000" pageheight="800" style="margin-left:8; margin-top:8; margin-right:8; margin-bottom:8; ">
- <switch id="groups" style="left:20px; top:30px; width:875px; height:740px; border-width:1px; border-style:solid; "/>
- <group id="bgroup" style="left:830px; top:0px; width:65px; height:27px; ">
- <button id="button9" class="btn4_letter2" style="left:4px; top:2px; width:56px; height:22px; ">
- <caption>닫기</caption>
- <close ev:event="DOMActivate"/>
- </button>
- </group>
- </xhtml:body>
- </xhtml:html>
|