VBscript not working

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Rob

    #1

    VBscript not working

    Access Gurus,
    This script was used to view the reports on the web by choosing a
    date on or before the current day.Recently it stopped working and i am
    not able to figure where the problem is.

    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3c.org/TR/1999/REC-html401-19991224/loose.dtd">
    <HTML lang=en xml:lang="en" xmlns="http://www.w3.org/1999/xhtml">
    <HEAD>

    <TITLE>Servic e Quality & Projects_home</TITLE>

    <META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
    <LINK href="http://www.citigroup.n et/" type=text/css
    rel=stylesheet> <!-- netscape 4.x compatible -->
    <STYLE TYPE="text/css">@import
    url(http://www.citigroup.n et/ti);</STYLE><!-- modern browser
    compatible -->
    <LINK href="../css/custom_style.cs s" type=text/css rel=stylesheet> <!--
    your custom styles here -->

    <script LANGUAGE="JavaS cript">
    <!--
    // These are the GLOBAL VARIABLES
    var theMonth= "01";
    var theDay= "01";
    var theYear= "00";
    var rep_name = ".pdf";
    //------------------------------------------------------------
    //This function checks whether it is a leap year
    function CheckLeap(year)
    {
    if ((year % 400) == 0) return 1;
    if ((year % 100) == 0) return 0;
    if ((year % 4) == 0) return 1;
    return 0;
    }
    function CheckDate(year, month, day){
    if ((day == "29") && (month == "02"))
    return CheckLeap(year) ;
    month = month - 1;
    day = day;
    if ((month == "00")||(mon th == "02")||(mon th == "04")||(mon th
    == "06")||(mon th == "07")||(mon th == "09")||(mon th == "11"))
    {if (day <= 31) return 1;
    else return 0;}
    if (month == "01")
    {if (day <= 28) return 1;
    else return 0;}
    else
    {if (day <= 30) return 1;
    else return 0;}
    }
    //This function defines the names for the month
    function nameMonth(month ){
    var monthName;
    if (month == "01"){month Name = "January";}
    if (month == "02"){month Name = "February"; }
    if (month == "03"){month Name = "March";}
    if (month == "04"){month Name = "April";}
    if (month == "05"){month Name = "May";}
    if (month == "06"){month Name = "June";}
    if (month == "07"){month Name = "July";}
    if (month == "08"){month Name = "August";}
    if (month == "09"){month Name = "September" ;}
    if (month == "10"){month Name = "October";}
    if (month == "11"){month Name = "November"; }
    if (month == "12"){month Name = "December"; }
    return monthName;
    }
    //line 81------------------------------------------------------------
    function minError(minYea r, minMonth, minDay)
    {
    var minDate = new Date();
    minDate.setMont h(minMonth-1);
    minDate.setDate (minDay);
    minDate.setYear (minYear);
    document.open() ;
    document.write( "<HTML><BOD Y
    background='ima ges/backer.gif'><LE FT><FONT
    SIZE=4><BR>&nbs p;&nbsp;&nbsp;E rror: Invalid
    Date<BR></FONT></LEFT><CENTER><F ONT SIZE=2><BR>You have selected an
    invalid date. Please select another date.");
    document.close( );
    }
    //------------------------------------------------------------
    function maxError(year, month, day)
    {
    var date = new Date();
    date.setMonth(m onth-1);
    date.setDate(da y);
    date.setYear(ye ar);
    document.open() ;
    document.write( "<HTML><BOD Y
    background='ima ges/backer.gif'><LE FT><FONT
    SIZE=4><BR>&nbs p;&nbsp;&nbsp;E rror: Invalid
    Date<BR></FONT></LEFT><CENTER><F ONT SIZE=2><BR>You have selected an
    invalid date. Please select another date.");
    document.write( "<BR><BR>Yo u have followed a link to a report
    which is either not yet available or does not exist on the site.");
    document.write( "<BR>If you have any questions or problems,
    please e-mail the ");

    document.close( );
    }
    //line 113------------------------------------------------------------
    function LIST(theform)
    {
    var year;
    var t_year;
    var month;
    var t_month;
    var day;
    var t_day;
    var date = new Date();
    var today = new Date();
    var minDay;
    var minMonth;
    var minYear;

    month = theform.Month[theform.Month.s electedIndex].value;
    day = theform.Day[theform.Day.sel ectedIndex].value;
    theYear = theform.YEAR[theform.YEAR.se lectedIndex].value;
    minDay = 01;
    minMonth = 01;
    minYear = 03;

    t_year = today.getYear() ;
    t_day = today.getDate() + 1;
    t_month = today.getMonth( )+ 1;

    if (CheckDate(year , month, day) == 1){
    if ((year < minYear) || ((month < minMonth) && (year == minYear)) ||
    ((day < minDay) && (month == minMonth) && (year == minYear)))
    {
    minError(minYea r, minMonth, minDay);
    }
    else if ((year > t_year) || ((month > t_month) && (year == t_year))
    || ((day >= t_day) && (month == t_month) && (year == t_year))){
    maxError(year, month, day);
    }
    else{
    theMonth = month;
    theDay = day;
    location.href=" http://www.citigroup.n et/remedyreports/" +
    theYear + theMonth + theDay + rep_name;
    location.target = "_top"
    }
    }

    else{
    document.open() ;
    document.write( "<HTML><BOD Y
    background='ima ges/backer.gif'><LE FT><FONT
    SIZE=4><BR>&nbs p;&nbsp;&nbsp;E rror: Invalid
    Date<BR></FONT></LEFT><CENTER><F ONT SIZE=2><BR>You have selected an
    invalid date. Please select another date.");
    document.close( );
    }
    }
    //line 166------------------------------------------------------------
    function LastDay()
    {
    var today = new Date();
    var check, year, Month, lastMonth;

    year = today.getYear() ;
    Month = today.getMonth( );
    if (Month == "00") lastMonth = 12;
    else lastMonth = Month;
    if ((lastMonth == 1)||(lastMonth == 3)||(lastMonth ==
    5)||(lastMonth == 7)||(lastMonth == 8)||(lastMonth == 10)||(lastMonth
    == 12))
    return 31;
    if (lastMonth == 2)
    {
    check = CheckLeap(year) ;
    if (check == 1) return 29;
    else return 28;
    }
    else return 30;
    }
    //line186------------------------------------------------------------
    function SetDate()
    {
    var today = new Date();

    document.thefor m.Day.selectedI ndex = today.getDate() - 1;
    document.thefor m.Month.selecte dIndex = today.getMonth( );

    if (today.getYear( ) < 100)
    document.thefor m.YEAR.selected Index = today.getYear()
    - 99;
    else
    document.thefor m.YEAR.selected Index = today.getYear()
    - 1999;
    // LIST(document.t heform);
    }
    //line 200------------------------------------------------------------

    function MM_findObj(n, d) { //v4.0
    var p,i,x; if(!d) d=document;
    if((p=n.indexOf ("?"))>0&&paren t.frames.length ) {
    d=parent.frames[n.substring(p+1 )].document; n=n.substring(0 ,p);}
    if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.fo rms.length;i++)
    x=d.forms[i][n];
    for(i=0;!x&&d.l ayers&&i<d.laye rs.length;i++)
    x=MM_findObj(n, d.layers[i].document);
    if(!x && document.getEle mentById) x=document.getE lementById(n);
    return x;
    }
    function MM_nbGroup(even t, grpName) { //v3.0
    var i,img,nbArr,arg s=MM_nbGroup.ar guments;
    if (event == "init" && args.length > 2) {
    if ((img = MM_findObj(args[2])) != null && !img.MM_init) {
    img.MM_init = true; img.MM_up = args[3]; img.MM_dn = img.src;
    if ((nbArr = document[grpName]) == null) nbArr =
    document[grpName] = new Array();
    nbArr[nbArr.length] = img;
    for (i=4; i < args.length-1; i+=2) if ((img =
    MM_findObj(args[i])) != null) {
    if (!img.MM_up) img.MM_up = img.src;
    img.src = img.MM_dn = args[i+1];
    nbArr[nbArr.length] = img;
    } }
    } else if (event == "over") {
    document.MM_nbO ver = nbArr = new Array();
    for (i=1; i < args.length-1; i+=3) if ((img = MM_findObj(args[i]))
    != null) {
    if (!img.MM_up) img.MM_up = img.src;
    img.src = (img.MM_dn && args[i+2]) ? args[i+2] : args[i+1];
    nbArr[nbArr.length] = img;
    }
    } else if (event == "out" ) {
    for (i=0; i < document.MM_nbO ver.length; i++) {
    img = document.MM_nbO ver[i]; img.src = (img.MM_dn) ? img.MM_dn :
    img.MM_up; }
    } else if (event == "down") {
    if ((nbArr = document[grpName]) != null)
    for (i=0; i < nbArr.length; i++) { img=nbArr[i]; img.src =
    img.MM_up; img.MM_dn = 0; }
    document[grpName] = nbArr = new Array();
    for (i=2; i < args.length-1; i+=2) if ((img = MM_findObj(args[i]))
    != null) {
    if (!img.MM_up) img.MM_up = img.src;
    img.src = img.MM_dn = args[i+1];
    nbArr[nbArr.length] = img;
    } }
    }
    function MM_swapImgResto re() { //v3.0
    var i,x,a=document. MM_sr;
    for(i=0;a&&i<a. length&&(x=a[i])&&x.oSrc;i++ ) x.src=x.oSrc;
    }
    function MM_preloadImage s() { //v3.0
    var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.leng th,a=MM_preload Images.argument s; for(i=0;
    i<a.length; i++)
    if (a[i].indexOf("#")!= 0){ d.MM_p[j]=new Image;
    d.MM_p[j++].src=a[i];}}
    }
    function MM_swapImage() { //v3.0
    var i,j=0,x,a=MM_sw apImage.argumen ts; document.MM_sr= new Array;
    for(i=0;i<(a.le ngth-2);i+=3)
    if ((x=MM_findObj( a[i]))!=null){docum ent.MM_sr[j++]=x; if(!x.oSrc)
    x.oSrc=x.src; x.src=a[i+2];}
    }
    //-->
    </script>
    </HEAD>

    <BODY>
    <a name="top"></a>
    <script language="JavaS cript" <DIV class=iehackwra p>
    <DIV class=boxwrap>
    <DIV class=boxheader > </DIV>
    <DIV class=boxbody>
    <DIV class=boxleft>
    <DIV id="searchbox" >
    <FORM name="searchfor m" method="get"
    action="http://search.citicorp .com/cgi-bin/query">
    <INPUT TYPE="hidden" NAME="mss" VALUE="citigrou pnetsimp">
    <INPUT TYPE="hidden" NAME="pg" VALUE="q">
    <INPUT TYPE="hidden" NAME="what" VALUE="web">
    <INPUT TYPE="hidden" NAME="fmt" VALUE="d">
    <SPAN ID="ie_input">
    <INPUT NAME=q SIZE=16 MAXLENGTH=200 VALUE="Search TI...">
    </SPAN> <SPAN ID="nn_input">
    <INPUT NAME=q SIZE=8 MAXLENGTH=200 VALUE="Search TI...">
    </SPAN>
    <INPUT type=image
    src="http://www.citigroup.n et/ti/images/search1.gif" border="0"
    alt="search" name="search">
    </form>
    </DIV>
    <!--<DIV class=boxleftne ws>
    <!--TAG GENERATOR: OpenCube - Applet Composer,
    (www.opencube.c om)-->
    <!--OpenCube Copyright Notice Parameter-->
    <!-- <param name="Notice" value="Smooth Scroll Up
    II, Copyright (c) 1999, OpenCube Inc.">
    <!--General / Default Settings-->
    <!-- <param name="bgcolor" value="0,0,102" >
    <!-- <param name="textcolor " value="255,255, 255">
    <!-- <param name="font" value="SansSeri f,Plain,11">
    <!-- <param name="halign" value="Left">
    <!-- <param name="lrmargin" value="5">
    <!-- <param name="hlcolor" value="116,189, 200">
    <!-- <param name="scrolldel ay" value="25">
    <!--Specific Settings-->
    <!-- <param name="desc0" value="Last Updated: ">
    <!-- <param name="delay0" value="2000">
    <!-- <param name="desc1" value=" ">
    <!-- <param name="desc2" value="Your optional new
    here...">
    <!-- <param name="textcolor 2" value="205,227, 253">
    <!-- <param name="font2" value="SansSeri f,Bold,12">
    <!-- <param name="delay2" value="4000">
    <!-- <param name="desc3" value="Your optional news
    here...">
    <!-- <param name="desc4" value=" ">
    <!-- <param name="desc5" value="Your optional news
    here...">
    <!-- <param name="delay5" value="6000">
    <!-- <param name="desc6" value=" ">
    <!-- <param name="desc7" value="Your optional news
    here...">
    <!-- <param name="delay7" value="6000">
    <!-- </applet>
    <!--<pre></pre>
    <!--<img src="http://www.citigroup.n et/ti/images/optional_image. gif"
    width="160" height="176" alt="Branding Graphic">

    </DIV>-->
    <!-- Three lines below are a test. they exist within "nav"
    tag of 2col realworld code -->
    </DIV>
    <DIV class=boxcenter >
    <!-- below is custom content -->
    <p><font size="4" color="#4092BF" ><i><img
    src="images/SiteSpecific/head_performanc e.gif" width="350"
    height="77"></i></font></p>
    <table width="100%" border="0">
    <tr>
    <td colspan="3" height="35" valign="baselin e"
    align="right">
    <blockquote>
    <p align="left"><b ><font size="4"
    color="#006666" >North America
    Data Centers<br>
    </font></b><b><font size="4" color="#006666" >Problem
    Resolution
    Center (PRC)</font></b></p>
    </blockquote>
    </td>
    </tr>
    <tr>
    <td colspan="3" height="180" valign="top"> <left></left>
    <blockquote>
    <p>
    <center>
    <font size="2">The objective of the Remedy Report
    is:<br>
    <br>
    &nbsp;&nbsp; 1) To Provide a daily overview of
    Remedy ticket
    performance for the PRC and some SDTs against
    standard&nbsp;< br>
    &nbsp;&nbsp; 2) To help Problem Resolvers (Queue
    Managers)
    meet the RemedyService Levels<br>
    &nbsp;&nbsp; 3) To serve as a basis for ongoing
    performace
    improvements </font>
    </center>
    </p>
    </blockquote>
    <center>
    <p align="center"> <font size="2"><font size="1">Note:
    See the
    Report Overview on page 1 of the report for a full
    explanation
    of all report fields</font><left></left></font></p>
    <hr>
    <font size="3"><b>Pre view a Report</b></font><br>
    Select the Report Date below<br>
    <form SUBMIT name="theform">
    <font color="#000000" size="2">Date:
    <select size="1" name="Month">
    <option value="01" >January </option>
    <option value="02">Febr uary </option>
    <option value="03">Marc h </option>
    <option value="04">Apri l </option>
    <option value="05" selected>May </option>
    <option value="06">June </option>
    <option value="07">July </option>
    <option value="08">Augu st </option>
    <option value="09">Sept ember </option>
    <option value="10">Octo ber </option>
    <option value="11">Nove mber </option>
    <option value="12">Dece mber </option>
    </select>

    <select size="1" name="Day">
    <option selected value="01"> 1 </option>
    <option value="02"> 2 </option>
    <option value="03"> 3 </option>
    <option value="04"> 4 </option>
    <option value="05"> 5 </option>
    <option value="06"> 6 </option>
    <option value="07"> 7 </option>
    <option value="08"> 8 </option>
    <option value="09"> 9 </option>
    <option value="10"> 10 </option>
    <option value="11"> 11 </option>
    <option value="12"> 12 </option>
    <option value="13"> 13 </option>
    <option value="14"> 14 </option>
    <option value="15"> 15 </option>
    <option value="16"> 16 </option>
    <option value="17"> 17 </option>
    <option value="18"> 18 </option>
    <option value="19"> 19 </option>
    <option value="20"> 20 </option>
    <option value="21"> 21 </option>
    <option value="22"> 22 </option>
    <option value="23"> 23 </option>
    <option value="24"> 24 </option>
    <option value="25"> 25 </option>
    <option value="26"> 26 </option>
    <option value="27"> 27 </option>
    <option value="28"> 28 </option>
    <option value="29"> 29 </option>
    <option value="30"> 30 </option>
    <option value="31"> 31 </option>
    </select>
    &nbsp;
    <select size="1" name="YEAR">
    <option value="03">2003 </option>
    <option value="04" selected>2004</option>
    <option value="05">2005 </option>
    </select>
    <br>
    Please note that the report date selected above is a
    day after
    the &quot;work of&quot; date<br>
    <input type="button" value="Get the Report"
    onClick="LIST(t heform)" name="button">
    </font>
    </form>
    <p><font size="1"> Reports earlier than January 01,
    2003 are not
    available on this site.<br>
    All reports are in Adobe Acrobat format</font></p>
    </center>
    </td>
    </tr>
    </table>
    <p>&nbsp;</p>
    </DIV>
    </DIV>
    </DIV>
    </DIV>
    <blockquote>
    <DIV class=iehackwra p>
    <DIV class=boxwrap>
    <DIV class=boxbody> </DIV>
    </DIV>
    </DIV>
    </blockquote>
    <DIV class=iehackwra p>
    <DIV class=boxwrap>
    <DIV class=boxbody>
    <DIV class=boxcenter >
    <p>
    <script>documen t.write('<BLOCK QUOTE><P id="lastupdate "
    ALIGN=center><I >Last updated on ',
    document.lastMo dified,'.</I></P></BLOCKQUOTE>')</script>
    <!-- Three lines below are a test. they exist within
    "content" tag of 2col realworld code -->
    </p>
    </DIV>
    </DIV>
    <DIV class=boxclear> &nbsp;</DIV>
    <DIV class=boxfooter >
    <P>
    <!-- start footer -->
    <script>footer( 2003)</script>
    <!-- end footer -->
    </P>
    </DIV>
    </DIV>
    </DIV>

    </BODY></HTML>



    Thanks,

    Rob
Working...