home *** CD-ROM | disk | FTP | other *** search
/ Chip 1998 February / CHIP_2_98.iso / software / pelne / optionp / iis4_03.cab / iimltils.asp < prev    next >
Text File  |  1997-11-12  |  8KB  |  231 lines

  1. <%@ LANGUAGE=VBScript %>
  2. <% Option Explicit %>
  3. <% Response.Expires = 0 %>
  4.  
  5. <% 
  6. Const L_BROWSE_TEXT="Browse"
  7. Const L_FILE_TEXT="File"
  8. Const L_URL_TEXT="URL"
  9. Const L_ALLUNASSIGNED_TEXT="All Unassigned"
  10. Const L_NA_TEXT="N/A"
  11. Const L_SECURE_TEXT="Secure Bindings"
  12. Const L_SERVER_TEXT="Server Bindings"
  13. %>
  14. <HTML>
  15. <HEAD>
  16.     <TITLE></TITLE>
  17.  
  18.     <SCRIPT LANGUAGE="JavaScript">
  19.         function chgStatus(indexnum){
  20.             parent.head.document.hiddenform.index.value=indexnum
  21.             self.location.href="iimltils.asp"
  22.             
  23.         }
  24.  
  25.     function SetUpdated(){
  26.  
  27.         if (parent.head.document.hiddenform != null){
  28.         
  29.             i=parent.head.document.hiddenform.index.value
  30.             
  31.             
  32.             reSort = setVals(parent.head.cachedList[i],"ipaddress",document.listform.editMe);
  33.             reSort = reSort || setVals(parent.head.cachedList[i],"ipport",document.listform.ipport);
  34.             reSort = reSort || setVals(parent.head.cachedList[i],"sslport",document.listform.sslport);
  35.             reSort = reSort || setVals(parent.head.cachedList[i],"host",document.listform.host);
  36.             
  37.             parent.head.cachedList[i].updated=true;
  38.             if (reSort){
  39.                 parent.head.listFunc.reSort();
  40.             }
  41.         }
  42.     }
  43.     
  44.     
  45.     function setVals(cachedItem, propName, formCntrl){
  46.         if (cachedItem[propName] != formCntrl.value){
  47.             cachedItem[propName] = formCntrl.value;
  48.             return (parent.head.listFunc.sortby == propName);
  49.         }        
  50.         else{
  51.             return false;
  52.         }
  53.     }
  54.     
  55.     </SCRIPT>
  56. </HEAD>
  57.  
  58. <BODY BGCOLOR="#FFFFFF" LEFTMARGIN=0 TOPMARGIN=0>
  59.  
  60. <FORM NAME="listform">
  61.  
  62. <SCRIPT LANGUAGE="JavaScript">
  63.  
  64.     editOK=false;
  65.     writeSecHdr = true;
  66.     writeHdr = true;    
  67.     sel=eval(parent.head.document.hiddenform.index.value);    
  68.     list = writeList();
  69.     writeLine(list);
  70.  
  71. function writeList(){    
  72.     <% if Session("IsIE") then %>
  73.     <% if Session("FONTSIZE") = "LARGE" then %>
  74.         writestr = "<TABLE WIDTH=470 BORDER=0 CELLPADDING=2 CELLSPACING=0>";
  75.     <% else %>
  76.         writestr = "<TABLE BORDER=0 CELLPADDING=2 CELLSPACING=0>";    
  77.     <% end if %>
  78.     <% else %>
  79.     <% if Session("FONTSIZE") = "LARGE" then %>
  80.         writestr = "<TABLE WIDTH=475 BORDER=0 CELLPADDING=2 CELLSPACING=0>";
  81.     <% else %>
  82.         writestr = "<TABLE WIDTH=344 BORDER=0 CELLPADDING=2 CELLSPACING=0>";
  83.     <% end if %>
  84.     <% end if %>    
  85.     
  86.     
  87.     for (var i=0;i < parent.head.cachedList.length; i++) {
  88.     
  89.         if (parent.head.cachedList[i].sslport != ""){
  90.             if (writeSecHdr){
  91.                 writestr += "<TR>"
  92.                 writestr += writeCol(4,150," ");
  93.                 writestr += "</TR>";                    
  94.                 writestr += "<TR BGCOLOR=#CCCCCC>"
  95.                 writestr += writeCol(4,150,"<B><%= L_SECURE_TEXT %></B>");
  96.                 writestr += "</TR>";
  97.                 writeSecHdr = false;
  98.             }
  99.         }
  100.         else{
  101.             if (writeHdr){        
  102.                 writestr += "<TR BGCOLOR=#CCCCCC>"
  103.                 writestr += writeCol(4,150,"<B><%= L_SERVER_TEXT %></B>");
  104.                 writestr += "</TR>";
  105.                 writeHdr = false;
  106.             }            
  107.         }
  108.  
  109.  
  110.         if (parent.head.document.hiddenform.index.value !=i) {
  111.             if (parent.head.cachedList[i].deleted){
  112.             }
  113.             else{
  114.             
  115.                 <% if Session("IsIE") then %>
  116.                     <% if Session("FONTSIZE") = "LARGE" then %>
  117.                         writestr += "<TR>"
  118.                         writestr += writeCol(1,150,"<A HREF='javascript:chgStatus("+i+");'>" + displayVal(parent.head.cachedList[i].ipaddress,"<%= L_ALLUNASSIGNED_TEXT %>") + "</A>");
  119.                         writestr += writeCol(1,65,displayVal(parent.head.cachedList[i].ipport,"<%= L_NA_TEXT %>"));
  120.                         writestr += writeCol(1,65,displayVal(parent.head.cachedList[i].sslport,"<%= L_NA_TEXT %>"));                    
  121.                         writestr += writeCol(1,190,parent.head.cachedList[i].host);
  122.                         writestr += "</TR>";
  123.                     <% else %>
  124.                     
  125.                         writestr += "<TR>"
  126.                         writestr += writeCol(1,110,"<A HREF='javascript:chgStatus("+i+");'>" + displayVal(parent.head.cachedList[i].ipaddress,"<%= L_ALLUNASSIGNED_TEXT %>") + "</A>");
  127.                         writestr += writeCol(1,50,displayVal(parent.head.cachedList[i].ipport,"<%= L_NA_TEXT %>"));
  128.                         writestr += writeCol(1,50,displayVal(parent.head.cachedList[i].sslport,"<%= L_NA_TEXT %>"));                    
  129.                         writestr += writeCol(1,140,parent.head.cachedList[i].host);
  130.                         writestr += "</TR>";
  131.                 
  132.                     <% end if %>
  133.                 <% else %>
  134.                     <% if Session("FONTSIZE") = "LARGE" then %>
  135.                         writestr += "<TR>"
  136.                         writestr += writeCol(1,150,"<A HREF='javascript:chgStatus("+i+");'>" + displayVal(parent.head.cachedList[i].ipaddress,"<%= L_ALLUNASSIGNED_TEXT %>") + "</A>");
  137.                         writestr += writeCol(1,60,parent.head.cachedList[i].ipport);
  138.                         writestr += writeCol(1,60,displayVal(parent.head.cachedList[i].sslport,"N/A"));                    
  139.                         writestr += writeCol(1,195,parent.head.cachedList[i].host);
  140.                         writestr += "</TR>";
  141.                     <% else %>
  142.                         writestr += "<TR>"
  143.                         writestr += writeCol(1,116,"<A HREF='javascript:chgStatus("+i+");'>" + displayVal(parent.head.cachedList[i].ipaddress,"<%= L_ALLUNASSIGNED_TEXT %>") + "</A>");
  144.                         writestr += writeCol(1,43,parent.head.cachedList[i].ipport);
  145.                         writestr += writeCol(1,47,displayVal(parent.head.cachedList[i].sslport,"N/A"));                    
  146.                         writestr += writeCol(1,148,parent.head.cachedList[i].host);
  147.                         writestr += "</TR>";
  148.                     <% end if %>
  149.                 <% end if %>
  150.             }
  151.         }
  152.         else{
  153.             editOK=true;
  154.             <% if Session("IsIE") then %>
  155.             
  156.                 writestr += "<TR>"
  157.                 writestr += writeCol(1,110,"<INPUT NAME='editMe' VALUE='"+parent.head.cachedList[i].ipaddress +"' SIZE=13 onChange='SetUpdated();'>");
  158.                 writestr += writeCol(1,40,"<INPUT NAME='ipport' VALUE='"+parent.head.cachedList[i].ipport +"' SIZE=5 onChange='SetUpdated();'>");
  159.                 writestr += writeCol(1,40,"<INPUT NAME='sslport' VALUE='"+parent.head.cachedList[i].sslport +"' SIZE=5 onChange='SetUpdated();'>");                    
  160.                 writestr += writeCol(1,140,"<INPUT NAME='host' VALUE='"+parent.head.cachedList[i].host +"' SIZE=15 onChange='SetUpdated();'>");
  161.                 writestr += "</TR>";        
  162.  
  163.             <% else %>
  164.                 <% if Session("FONTSIZE") = "LARGE" then %>
  165.                 
  166.                     writestr += "<TR>"
  167.                     writestr += writeCol(1,150,"<INPUT NAME='editMe' VALUE='"+parent.head.cachedList[i].ipaddress +"' SIZE=13 onChange='SetUpdated();'>");
  168.                     writestr += writeCol(1,60,"<INPUT NAME='ipport' VALUE='"+parent.head.cachedList[i].ipport +"' SIZE=5 onChange='SetUpdated();'>");
  169.                     writestr += writeCol(1,60,"<INPUT NAME='sslport' VALUE='"+parent.head.cachedList[i].sslport +"' SIZE=5 onChange='SetUpdated();'>");                    
  170.                     writestr += writeCol(1,195,"<INPUT NAME='host' VALUE='"+parent.head.cachedList[i].host +"' SIZE=25 onChange='SetUpdated();'>");
  171.                     writestr += "</TR>";
  172.                 
  173.                 <% else %>
  174.                 
  175.                     writestr += "<TR>"
  176.                     writestr += writeCol(1,116,"<INPUT NAME='editMe' VALUE='"+parent.head.cachedList[i].ipaddress +"' SIZE=13 onChange='SetUpdated();'>");
  177.                     writestr += writeCol(1,43,"<INPUT NAME='ipport' VALUE='"+parent.head.cachedList[i].ipport +"' SIZE=5 onChange='SetUpdated();'>");
  178.                     writestr += writeCol(1,47,"<INPUT NAME='sslport' VALUE='"+parent.head.cachedList[i].sslport +"' SIZE=5 onChange='SetUpdated();'>");                    
  179.                     writestr += writeCol(1,148,"<INPUT NAME='host' VALUE='"+parent.head.cachedList[i].host +"' SIZE=25 onChange='SetUpdated();'>");
  180.                     writestr += "</TR>";
  181.  
  182.                 <% end if %>
  183.             <% end if %>
  184.         }
  185.     }
  186.     writestr += "</TABLE>";
  187.     
  188.     return writestr;
  189. }    
  190.     
  191. function displayVal(dispstr, altstr){
  192.     if (dispstr == ""){
  193.         dispstr = altstr;
  194.     }
  195.     return dispstr;
  196. }
  197.  
  198. function writeCol(colspan,w,str){
  199.         var writestr = "<TD";
  200.         if (colspan != ""){
  201.             writestr += " COLSPAN = " + colspan
  202.         }
  203.         if (w != ""){
  204.             writestr += " WIDTH = " + w;
  205.         }        
  206.         <% if Session("IsIE") then %>
  207.                 writestr += " STYLE = 'font-face: Helv; font-size: 8pt;'";
  208.         <% end if %>        
  209.         writestr += "><FONT SIZE = 1 FACE = 'Helv'>" + str + "</FONT></TD>";
  210.  
  211.         return writestr;    
  212. }    
  213.  
  214. function writeLine(str){
  215.     document.write(str);
  216. }
  217. </SCRIPT>
  218.  
  219. <P> 
  220. <P> 
  221. </FORM>
  222. <SCRIPT LANGUAGE="JavaScript">
  223.     if (editOK){
  224.         document.listform.editMe.focus();
  225.         document.listform.editMe.select();
  226.     }
  227. </SCRIPT>
  228. </BODY>
  229. </HTML>
  230.  
  231.