home *** CD-ROM | disk | FTP | other *** search
/ DOS/V Power Report 2000 March / VPR0003B.ISO / alpha / iimltils.asp < prev    next >
Text File  |  1999-10-14  |  13KB  |  334 lines

  1. <%@ LANGUAGE=VBScript %>
  2. <% Option Explicit %>
  3. <% Response.Expires = 0 %>
  4.  
  5. <% 
  6. Const L_BROWSE_TEXT="参照"
  7. Const L_FILE_TEXT="ファイル"
  8. Const L_URL_TEXT="URL"
  9. Const L_ALLUNASSIGNED_TEXT="未使用の IP アドレスすべて"
  10. Const L_NA_TEXT="N/A"
  11. Const L_SECURE_TEXT="セキュリティ結合"
  12. Const L_SERVER_TEXT="サーバー結合"
  13. %>
  14.  
  15. <HTML>
  16. <HEAD>
  17.     <TITLE></TITLE>
  18.  
  19.     <SCRIPT LANGUAGE="JavaScript">
  20.         function chgStatus(indexnum){
  21.             parent.head.document.hiddenform.index.value=indexnum;
  22.                    parent.head.document.hiddenform.MustDisplayFirstTime.value=1;
  23.             self.location.href="iimltils.asp";
  24.             
  25.         }
  26.  
  27.     function SetUpdated(){
  28.         if (parent.head.listFunc.noupdate){
  29.             parent.head.listFunc.noupdate = false;
  30.         }
  31.         else{
  32.             if (parent.head.document.hiddenform != null){        
  33.             if (parent.head.document.hiddenform.index.value != -1){
  34.                 i=parent.head.document.hiddenform.index.value
  35.             reSort = setVals(parent.head.cachedList[i],"ipaddress",document.listform.editMe);
  36.             reSort = reSort || setVals(parent.head.cachedList[i],"ipport",document.listform.ipport);
  37.             reSort = reSort || setVals(parent.head.cachedList[i],"sslport",document.listform.sslport);
  38.             reSort = reSort || setVals(parent.head.cachedList[i],"host",document.listform.host);
  39.             
  40.             parent.head.cachedList[i].updated=true;
  41.             if (reSort){
  42.                     parent.head.listFunc.reSort();
  43.                 }
  44.             }
  45.         }
  46.         }
  47.     }
  48.     
  49.     
  50.     function setVals(cachedItem, propName, formCntrl){
  51.         if (cachedItem[propName] != formCntrl.value){
  52.             cachedItem[propName] = formCntrl.value;
  53.             return (parent.head.listFunc.sortby == propName);
  54.         }        
  55.         else{
  56.             return false;
  57.         }
  58.     }
  59.     function SetSecure(item,formCntrl,isSecure)
  60.     {
  61.         if (formCntrl.value != "")
  62.         {
  63.             parent.head.cachedList[item].isSecure = isSecure;
  64.         }
  65.     }
  66.     
  67.     </SCRIPT>
  68. </HEAD>
  69.  
  70. <BODY BGCOLOR="#FFFFFF" LEFTMARGIN=0 TOPMARGIN=0>
  71.  
  72. <FORM NAME="listform">
  73.  
  74. <SCRIPT LANGUAGE="JavaScript">
  75.  
  76.     editOK=false;
  77.     writeSecHdr = true;
  78.     writeHdr = true;    
  79.     sel=eval(parent.head.document.hiddenform.index.value);    
  80.     list = writeList();
  81.     writeLine(list);
  82.  
  83. function writeList(){    
  84.     <% if Session("IsIE") then %>
  85.     <% if Session("FONTSIZE") = "LARGE" then %>
  86. //        writestr = "<TABLE WIDTH=580 BORDER=0 CELLPADDING=2 CELLSPACING=0>";
  87.         writestr = "<TABLE WIDTH=600 BORDER=0 CELLPADDING=2 CELLSPACING=0>";
  88.     <% else %>
  89.         writestr = "<TABLE BORDER=0 CELLPADDING=2 CELLSPACING=0>";    
  90.     <% end if %>
  91.     <% else %>
  92.     <% if Session("FONTSIZE") = "LARGE" then %>
  93.         writestr = "<TABLE WIDTH=553 BORDER=0 CELLPADDING=2 CELLSPACING=0>";
  94.     <% else %>
  95.         writestr = "<TABLE WIDTH=444 BORDER=0 CELLPADDING=2 CELLSPACING=0>";
  96.     <% end if %>
  97.     <% end if %>    
  98.     
  99.         //Create a new Array to store the list in a resonable order
  100.         var tmpArray;
  101.         tmpArray = new Array();
  102.         var CurrentPos,PosSeparator;
  103.         CurrentPos=0;
  104.         PosSeparator=0;
  105.         for (var j=0;j < parent.head.cachedList.length; j++) {
  106.             // first of all the ServerBindings
  107.             if (!((parent.head.cachedList[j].ipport  == "") &&
  108.                 (parent.head.cachedList[j].sslport == "") &&
  109.                 (parent.head.cachedList[j].host    == "") &&
  110.                 (parent.head.cachedList[j].deleted == false) &&
  111.                 (parent.head.cachedList[j].newitem == false) ))
  112.             {
  113.                 // ipport BUT NOT sslport
  114.                 if ((parent.head.cachedList[j].ipport  != "") &&
  115.                     (parent.head.cachedList[j].sslport == "")) 
  116.                 { 
  117.                     tmpArray[CurrentPos]=parent.head.cachedList[j];
  118.                     CurrentPos++;
  119.                 }
  120.             } 
  121.         };
  122.         // now aggregate SSL Bindings
  123.         for (var j=0;j < parent.head.cachedList.length; j++) {
  124.             if (!((parent.head.cachedList[j].ipport  == "") &&
  125.                 (parent.head.cachedList[j].sslport == "") &&
  126.                 (parent.head.cachedList[j].host    == "") &&
  127.                 (parent.head.cachedList[j].deleted == false) &&
  128.                 (parent.head.cachedList[j].newitem == false) ))
  129.             {
  130.                 // sllport BUT NOT ipport AND NOT host
  131.                 if ((parent.head.cachedList[j].sllport  != "") &&
  132.                     (parent.head.cachedList[j].ipport   == "") &&
  133.                     (parent.head.cachedList[j].host   == "")) 
  134.                 { 
  135.                     tmpArray[CurrentPos]=parent.head.cachedList[j];
  136.                     CurrentPos++;
  137.                 }
  138.             } 
  139.         };
  140.         // now the most important thing, exchange the arrays
  141.         parent.head.cachedList = tmpArray; 
  142.     
  143.     for (var i=0;i < parent.head.cachedList.length; i++) {
  144.     
  145.         if (parent.head.cachedList[i].sslport != ""){
  146.             if (writeSecHdr){
  147.                 writestr += "<TR>"
  148.                 writestr += writeCol(4,466," ");
  149.                 writestr += "</TR>";                    
  150.                 writestr += "<TR BGCOLOR=#CCCCCC>"
  151.                 writestr += writeCol(4,466,"<B><%= L_SECURE_TEXT %></B>");
  152.                 writestr += "</TR>";
  153.                 writeSecHdr = false;
  154.             }
  155.         }
  156.         else{
  157.             if (writeHdr){        
  158.                 writestr += "<TR BGCOLOR=#CCCCCC>"
  159.                 writestr += writeCol(4,466,"<B><%= L_SERVER_TEXT %></B>");
  160.                 writestr += "</TR>";
  161.                 writeHdr = false;
  162.             }            
  163.         }
  164.  
  165.         if(parent.head.document.hiddenform.MustDisplayFirstTime.value == 0){
  166.                 if (parent.head.cachedList[i].deleted){
  167.                 }
  168.                 else{
  169.             
  170.                     <% if Session("IsIE") then %>
  171.                         <% if Session("FONTSIZE") = "LARGE" then %>
  172.                             writestr += "<TR>"
  173.                             writestr += writeCol(1,150,"<A HREF='javascript:chgStatus("+i+");'>" + displayVal(parent.head.cachedList[i].ipaddress,"<%= L_ALLUNASSIGNED_TEXT %>") + "</A>");
  174.                             writestr += writeCol(1,65,displayVal(parent.head.cachedList[i].ipport,"<%= L_NA_TEXT %>"));
  175.                             writestr += writeCol(1,65,displayVal(parent.head.cachedList[i].sslport,"<%= L_NA_TEXT %>"));                    
  176.                             writestr += writeCol(1,190,parent.head.cachedList[i].host);
  177.                             writestr += "</TR>";
  178.                         <% else %>
  179.                         
  180.                             writestr += "<TR>"
  181.                             writestr += writeCol(1,110,"<A HREF='javascript:chgStatus("+i+");'>" + displayVal(parent.head.cachedList[i].ipaddress,"<%= L_ALLUNASSIGNED_TEXT %>") + "</A>");
  182.                             writestr += writeCol(1,50,displayVal(parent.head.cachedList[i].ipport,"<%= L_NA_TEXT %>"));
  183.                             writestr += writeCol(1,50,displayVal(parent.head.cachedList[i].sslport,"<%= L_NA_TEXT %>"));                    
  184.                             writestr += writeCol(1,140,parent.head.cachedList[i].host);
  185.                             writestr += "</TR>";
  186.                 
  187.                         <% end if %>
  188.                     <% else %>
  189.                         <% if Session("FONTSIZE") = "LARGE" then %>
  190.                             writestr += "<TR>"
  191.                             writestr += writeCol(1,150,"<A HREF='javascript:chgStatus("+i+");'>" + displayVal(parent.head.cachedList[i].ipaddress,"<%= L_ALLUNASSIGNED_TEXT %>") + "</A>");
  192.                             writestr += writeCol(1,60,parent.head.cachedList[i].ipport);
  193.                             writestr += writeCol(1,60,displayVal(parent.head.cachedList[i].sslport,"N/A"));                    
  194.                             writestr += writeCol(1,195,parent.head.cachedList[i].host);
  195.                             writestr += "</TR>";
  196.                         <% else %>
  197.                             writestr += "<TR>"
  198.                             writestr += writeCol(1,116,"<A HREF='javascript:chgStatus("+i+");'>" + displayVal(parent.head.cachedList[i].ipaddress,"<%= L_ALLUNASSIGNED_TEXT %>") + "</A>");
  199.                             writestr += writeCol(1,43,parent.head.cachedList[i].ipport);
  200.                             writestr += writeCol(1,47,displayVal(parent.head.cachedList[i].sslport,"N/A"));                    
  201.                             writestr += writeCol(1,148,parent.head.cachedList[i].host);
  202.                             writestr += "</TR>";
  203.                         <% end if %>
  204.                     <% end if %>
  205.                 }
  206.         } 
  207.         else  // use the old code
  208.         { 
  209.  
  210.         if (parent.head.document.hiddenform.index.value !=i) {
  211.             if (parent.head.cachedList[i].deleted){
  212.             }
  213.             else{
  214.             
  215.                 <% if Session("IsIE") then %>
  216.                     <% if Session("FONTSIZE") = "LARGE" then %>
  217.                         writestr += "<TR>"
  218.                         writestr += writeCol(1,240,"<A HREF='javascript:chgStatus("+i+");'>" + displayVal(parent.head.cachedList[i].ipaddress,"<%= L_ALLUNASSIGNED_TEXT %>") + "</A>");
  219.                         writestr += writeCol(1,80,displayVal(parent.head.cachedList[i].ipport,"<%= L_NA_TEXT %>"));
  220.                         writestr += writeCol(1,80,displayVal(parent.head.cachedList[i].sslport,"<%= L_NA_TEXT %>"));                    
  221.                         writestr += writeCol(1,153,parent.head.cachedList[i].host);
  222.                         writestr += "</TR>";
  223.                     <% else %>
  224.                     
  225.                         writestr += "<TR>"
  226.                         writestr += writeCol(1,240,"<A HREF='javascript:chgStatus("+i+");'>" + displayVal(parent.head.cachedList[i].ipaddress,"<%= L_ALLUNASSIGNED_TEXT %>") + "</A>");
  227.                         writestr += writeCol(1,80,displayVal(parent.head.cachedList[i].ipport,"<%= L_NA_TEXT %>"));
  228.                         writestr += writeCol(1,80,displayVal(parent.head.cachedList[i].sslport,"<%= L_NA_TEXT %>"));                    
  229.                         writestr += writeCol(1,153,parent.head.cachedList[i].host);
  230.                         writestr += "</TR>";
  231.                 
  232.                     <% end if %>
  233.                 <% else %>
  234.                     <% if Session("FONTSIZE") = "LARGE" then %>
  235.                         writestr += "<TR>"
  236.                         writestr += writeCol(1,240,"<A HREF='javascript:chgStatus("+i+");'>" + displayVal(parent.head.cachedList[i].ipaddress,"<%= L_ALLUNASSIGNED_TEXT %>") + "</A>");
  237.                         writestr += writeCol(1,80,parent.head.cachedList[i].ipport);
  238.                         writestr += writeCol(1,80,displayVal(parent.head.cachedList[i].sslport,"N/A"));                    
  239.                         writestr += writeCol(1,153,parent.head.cachedList[i].host);
  240.                         writestr += "</TR>";
  241.                     <% else %>
  242.                         writestr += "<TR>"
  243.                         writestr += writeCol(1,240,"<A HREF='javascript:chgStatus("+i+");'>" + displayVal(parent.head.cachedList[i].ipaddress,"<%= L_ALLUNASSIGNED_TEXT %>") + "</A>");
  244.                         writestr += writeCol(1,80,parent.head.cachedList[i].ipport);
  245.                         writestr += writeCol(1,80,displayVal(parent.head.cachedList[i].sslport,"N/A"));                    
  246.                         writestr += writeCol(1,153,parent.head.cachedList[i].host);
  247.                         writestr += "</TR>";
  248.                     <% end if %>
  249.                 <% end if %>
  250.             }
  251.         }
  252.         else{
  253.             editOK=true;
  254.             <% if Session("IsIE") then %>
  255.             
  256.                 writestr += "<TR>"
  257.                 writestr += writeCol(1,200,"<INPUT NAME='editMe' VALUE='"+parent.head.cachedList[i].ipaddress +"' SIZE=23 onBlur='SetUpdated();'>");
  258.                 writestr += writeCol(1,100,"<INPUT NAME='ipport' VALUE='"+parent.head.cachedList[i].ipport +"' SIZE=5 onBlur='SetUpdated();'>");
  259.                 writestr += writeCol(1,100,"<INPUT NAME='sslport' VALUE='"+parent.head.cachedList[i].sslport +"' SIZE=5 onBlur='SetUpdated();'>");                    
  260.                 writestr += writeCol(1,153,"<INPUT NAME='host' VALUE='"+parent.head.cachedList[i].host +"' SIZE=23 onBlur='SetUpdated();'>");
  261.                 writestr += "</TR>";        
  262.  
  263.             <% else %>
  264.                 <% if Session("FONTSIZE") = "LARGE" then %>
  265.                 
  266.                     writestr += "<TR>"
  267.                     writestr += writeCol(1,100,"<INPUT NAME='editMe' VALUE='"+parent.head.cachedList[i].ipaddress +"' SIZE=13 onBlur='SetUpdated();'>");
  268.                     writestr += writeCol(1,100,"<INPUT NAME='ipport' VALUE='"+parent.head.cachedList[i].ipport +"' SIZE=5 onBlur='SetUpdated();'>");
  269.                     writestr += writeCol(1,100,"<INPUT NAME='sslport' VALUE='"+parent.head.cachedList[i].sslport +"' SIZE=5 onBlur='SetUpdated();'>");                    
  270.                     writestr += writeCol(1,175,"<INPUT NAME='host' VALUE='"+parent.head.cachedList[i].host +"' SIZE=25 onBlur='SetUpdated();'>");
  271.                     writestr += "</TR>";
  272.                 
  273.                 <% else %>
  274.                 
  275.                     writestr += "<TR>"
  276.                     writestr += writeCol(1,100,"<INPUT NAME='editMe' VALUE='"+parent.head.cachedList[i].ipaddress +"' SIZE=15 onBlur='SetUpdated();'>");
  277.                     writestr += writeCol(1,80,"<INPUT NAME='ipport' VALUE='"+parent.head.cachedList[i].ipport +"' SIZE=10 onBlur='SetUpdated();'>");
  278.                     writestr += writeCol(1,80,"<INPUT NAME='sslport' VALUE='"+parent.head.cachedList[i].sslport +"' SIZE=10 onBlur='SetUpdated();'>");                    
  279.                     writestr += writeCol(1,175,"<INPUT NAME='host' VALUE='"+parent.head.cachedList[i].host +"' SIZE=25 onBlur='SetUpdated();'>");
  280.                     writestr += "</TR>";
  281.  
  282.                 <% end if %>
  283.             <% end if %>
  284.         }
  285.         } // end if on testing for displaying the first time
  286.  
  287.  
  288.     }
  289.     writestr += "</TABLE>";
  290.     
  291.     return writestr;
  292. }    
  293.     
  294. function displayVal(dispstr, altstr){
  295.     if (dispstr == ""){
  296.         dispstr = altstr;
  297.     }
  298.     return dispstr;
  299. }
  300.  
  301. function writeCol(colspan,w,str){
  302.         var writestr = "<TD";
  303.         if (colspan != ""){
  304.             writestr += " COLSPAN = " + colspan
  305.         }
  306.         if (w != ""){
  307.             writestr += " WIDTH = " + w;
  308.         }        
  309.         <% if Session("IsIE") then %>
  310.                 writestr += " STYLE = ' font-size: 10pt;'";
  311.         <% end if %>        
  312.         writestr += "><FONT SIZE = 2>" + str + "</FONT></TD>";
  313.  
  314.         return writestr;    
  315. }    
  316.  
  317. function writeLine(str){
  318.     document.write(str);
  319. }
  320. </SCRIPT>
  321.  
  322. <P> 
  323. <P> 
  324. </FORM>
  325. <SCRIPT LANGUAGE="JavaScript">
  326.     if (editOK){
  327.         document.listform.editMe.focus();
  328.         document.listform.editMe.select();
  329.     }
  330. </SCRIPT>
  331. </BODY>
  332. </HTML>
  333.  
  334.