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

  1. <%@ LANGUAGE=VBScript %>
  2. <% Option Explicit %>
  3. <% Response.Expires = 0 %>
  4.  
  5. <% if Session("FONTSIZE") = "" then %>
  6.     <!--#include file="iito.inc"-->
  7. <% else %>
  8.  
  9. <% 
  10. Const L_PREVBACKUPS_TEXT = "Previous Backups"
  11. Const L_BACKUPNAME_TEXT = "Name"
  12. Const L_BACKUPDATE_TEXT = "Date"
  13. Const L_NUM_TEXT = "#"
  14. Const L_SAMPLEBACKUP_TEXT = "MyBackup"
  15. Const L_GETNAME_TEXT = "Configuration Backup Name"
  16. Const L_SELECTITEM_TEXT = "Please select a backup to remove."
  17.  
  18. On Error Resume Next
  19.  
  20.  
  21. function heading(width,thestring)
  22.     Dim i
  23.     width=width - len(thestring)
  24.     for i=width to 0 step -1
  25.         thestring=thestring & " "
  26.     Next
  27.     heading=thestring
  28. end function
  29. %>
  30.  
  31. <HTML>
  32. <HEAD>
  33.     <TITLE></TITLE>
  34. </HEAD>
  35.  
  36. <BODY BGCOLOR="#CCCCCC" LINK="#000000" VLINK="#000000" TOPMARGIN=10 TEXT="#000000" onLoad="setList();loadHelp();">
  37. <FORM NAME="userform">
  38.  
  39. <TABLE WIDTH=490 BORDER=0>
  40.     <TR>
  41.         <TD COLSPAN=3 STYLE="font-face: Helv,Arial; font-size:10pt;">
  42.             <FONT SIZE=1 FACE="Helv,ARIAL">
  43.                 <%= L_PREVBACKUPS_TEXT %>
  44.                 <BR> 
  45.             </FONT>
  46.         </TD>
  47.     </TR>
  48. </TABLE>
  49.  
  50. <TABLE BORDER=1 BORDERCOLORDARK="#CCCCCC" BORDERCOLORLIGHT="#CCCCCC" CELLSPACING=0 CELLPADDING=2>
  51. <TR>
  52. <TD BORDERCOLOR="#CCCCCC" BORDERCOLORDARK="#FFFFFF" BORDERCOLORLIGHT="#000000" STYLE="font-face: Helv,Arial; font-size:10pt;"><FONT SIZE=1 FACE="HELV,ARIAL">
  53.     <A HREF="javascript:sortList('blocation','str');">
  54.     <% if Session("FONTSIZE")="LARGE" then %>
  55.         <%= heading(40,L_BACKUPNAME_TEXT) %>
  56.     <% else %>
  57.         <%= heading(49,L_BACKUPNAME_TEXT) %>    
  58.     <% end if %>
  59.     </A>
  60.     </FONT>
  61. </TD>
  62. <TD BORDERCOLOR="#CCCCCC" BORDERCOLORDARK="#FFFFFF" BORDERCOLORLIGHT="#000000" STYLE="font-face: Helv,Arial; font-size:10pt;"><FONT SIZE=1 FACE="HELV,ARIAL">
  63.     <A HREF="javascript:sortList('bversion','str');">
  64.     <% if Session("FONTSIZE")="LARGE" then %>
  65.         <%= heading(1,L_NUM_TEXT) %>
  66.     <% else %>
  67.         <%= heading(1,L_NUM_TEXT) %>    
  68.     <% end if %>
  69.     </A>
  70.     </FONT>
  71. </TD>
  72. <TD  BORDERCOLOR="#CCCCCC" BORDERCOLORDARK="#FFFFFF" BORDERCOLORLIGHT="#000000" STYLE="font-face: Helv,Arial; font-size:10pt;"><FONT SIZE=1 FACE="Helv,ARIAL">
  73.     <A HREF="javascript:sortList('bdate','str');">
  74.     <% if Session("FONTSIZE")="LARGE" then %>
  75.         <%= heading(25,L_BACKUPDATE_TEXT) %>
  76.     <% else %>
  77.         <%= heading(38,L_BACKUPDATE_TEXT) %>    
  78.     <% end if %>        
  79.     </A>
  80.     </FONT>
  81. </TD>
  82. </TR>
  83. </TABLE>
  84.  
  85. </FORM>
  86.  
  87. <FORM name="hiddenform">
  88.     <INPUT TYPE="hidden" NAME="index" VALUE=-1>
  89. </FORM>
  90. </BODY>
  91. <SCRIPT LANGUAGE="JavaScript">
  92.  
  93.     function loadHelp(){
  94.         top.title.Global.helpFileName="iipx_1";
  95.     }
  96.  
  97.     function setList(){
  98.         parent.list.location.href="iibkupls.asp?text=Loading...";
  99.         top.hlist.location.href = "iibkupset.asp";
  100.     }
  101.  
  102.     function loadList(){
  103.         parent.list.location.href="iibkupls.asp";
  104.     }
  105.  
  106.     function addItem(){
  107.         i=cachedList.length
  108.         blocation = prompt("<%= L_GETNAME_TEXT %>","<%= L_SAMPLEBACKUP_TEXT %>");
  109.         
  110.             if ((blocation != "") && (blocation != null)){    
  111.                 top.hlist.location.href = "iiaction.asp?a=Backup&bkupName=" + escape(blocation);        
  112.                 listFunc.id =i;
  113.         }
  114.  
  115.     }
  116.  
  117.     function delItem(){
  118.         if (listFunc.id  >= 0){
  119.             i=eval(listFunc.id );            
  120.             blocation = escape(cachedList[i].blocation);
  121.             bversion = escape(cachedList[i].bversion);        
  122.             top.hlist.location.href = "iiaction.asp?a=BackupRmv&bkupName=" + blocation + "&bkupVer=" + bversion;        
  123.         }
  124.         else{
  125.             alert("<%= L_SELECTITEM_TEXT %>");
  126.         }
  127.  
  128.     }
  129.     function setLastSel(id){
  130.         for (var i=0; i < cachedList.length; i++) {
  131.             if (cachedList[i].id == id){
  132.                 listFunc.id = i;
  133.                 return;
  134.             }
  135.         }
  136.         
  137.     }
  138.     
  139.     function sortList(sortby,sorttype)
  140.         {
  141.         i=eval(listFunc.id);
  142.  
  143.         if (i != -1)
  144.         {
  145.             lastsel = cachedList[i].id;
  146.         }
  147.         
  148.         if (sortby != listFunc.sortby)
  149.             {
  150.             listFunc.sortby = sortby;
  151.             listFunc.sortAsc = true;
  152.             }
  153.         else
  154.             {
  155.             listFunc.sortAsc = !listFunc.sortAsc;
  156.             }
  157.  
  158.         if (sorttype == "str")
  159.             {
  160.             cachedList.sort(sortOrder);
  161.             }
  162.         else
  163.             { 
  164.             cachedList.sort(numOrder);
  165.             }
  166.                         
  167.         if (!listFunc.sortAsc)
  168.             {
  169.             cachedList.reverse();
  170.             }
  171.             
  172.         if (i != -1)
  173.         {
  174.             setLastSel(lastsel);            
  175.         }
  176.         loadList();
  177.         }
  178.  
  179.     function sortOrder(a,b)
  180.         {
  181.         if (a[listFunc.sortby] < b[listFunc.sortby])
  182.             {
  183.             return -1;
  184.             }
  185.         else
  186.             {
  187.             if (a[listFunc.sortby] > b[listFunc.sortby])
  188.                 {
  189.                 return 1;
  190.                 }
  191.             else
  192.                 {
  193.                 return 0;
  194.                 }
  195.             }
  196.         }
  197.  
  198.  
  199.     function buildListForm(){
  200.         numrows=0;
  201.         for (var i=0; i < cachedList.length; i++) {
  202.             numrows=numrows + 1;
  203.         }
  204.         qstr="numrows="+numrows;
  205.         qstr=qstr+"&cols=ServerBindings&cols=SecureBindings"
  206.  
  207.         top.hlist.location.href="iihdn.asp?"+qstr;
  208.         <% 'the list values will be grabbed by the hiddenlistform script... %>
  209.     }
  210.  
  211.     function SetListVals(){
  212.  
  213.     }
  214.     
  215.  
  216.     function SetLocale(datestr){
  217.  
  218.         thisdate = new Date(datestr);
  219.         
  220.         tzdiff=thisdate.getTimezoneOffset()
  221.         hrsdiff=parseInt(tzdiff/60)
  222.         mindiff=tzdiff%(hrsdiff*60)
  223.         thisdate.setHours(thisdate.getHours() - hrsdiff);
  224.         thisdate.setMinutes(thisdate.getMinutes() - mindiff);
  225.     
  226.         return thisdate.toLocaleString(); 
  227.     }    
  228.  
  229.     function listFuncs(){
  230.         this.id = -1;
  231.         this.addItem=addItem;
  232.         this.delItem=delItem;
  233.         this.loadList=loadList;
  234.         this.writeList=buildListForm;
  235.         this.SetListVals=SetListVals;
  236.         this.mainframe = top.opener.top;        
  237.     }
  238.  
  239.     function listObj(i,d,l,v){
  240.         this.id = i;
  241.         this.blocation=l;
  242.         this.bversion=v;        
  243.         this.bdate=SetLocale(d);
  244.         this.deleted=false;
  245.         this.newitem=false;
  246.         this.updated=false;
  247.     }
  248.  
  249.     cachedList=new Array()
  250.  
  251.     listFunc=new listFuncs();
  252.  
  253. </SCRIPT>
  254.  
  255. </HTML>
  256.  
  257. <% end if %>