473,408 Members | 1,960 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,408 software developers and data experts.

VBscript not working

Rob
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>Service Quality & Projects_home</TITLE>

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

<script LANGUAGE="JavaScript">
<!--
// 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")||(month == "02")||(month == "04")||(month
== "06")||(month == "07")||(month == "09")||(month == "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"){monthName = "January";}
if (month == "02"){monthName = "February";}
if (month == "03"){monthName = "March";}
if (month == "04"){monthName = "April";}
if (month == "05"){monthName = "May";}
if (month == "06"){monthName = "June";}
if (month == "07"){monthName = "July";}
if (month == "08"){monthName = "August";}
if (month == "09"){monthName = "September";}
if (month == "10"){monthName = "October";}
if (month == "11"){monthName = "November";}
if (month == "12"){monthName = "December";}
return monthName;
}
//line 81------------------------------------------------------------
function minError(minYear, minMonth, minDay)
{
var minDate = new Date();
minDate.setMonth(minMonth-1);
minDate.setDate(minDay);
minDate.setYear(minYear);
document.open();
document.write("<HTML><BODY
background='images/backer.gif'><LEFT><FONT
SIZE=4><BR>&nbsp;&nbsp;&nbsp;Error: Invalid
Date<BR></FONT></LEFT><CENTER><FONT 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(month-1);
date.setDate(day);
date.setYear(year);
document.open();
document.write("<HTML><BODY
background='images/backer.gif'><LEFT><FONT
SIZE=4><BR>&nbsp;&nbsp;&nbsp;Error: Invalid
Date<BR></FONT></LEFT><CENTER><FONT SIZE=2><BR>You have selected an
invalid date. Please select another date.");
document.write("<BR><BR>You 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.selectedIndex].value;
day = theform.Day[theform.Day.selectedIndex].value;
theYear = theform.YEAR[theform.YEAR.selectedIndex].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(minYear, 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.net/remedyreports/" +
theYear + theMonth + theDay + rep_name;
location.target = "_top"
}
}

else{
document.open();
document.write("<HTML><BODY
background='images/backer.gif'><LEFT><FONT
SIZE=4><BR>&nbsp;&nbsp;&nbsp;Error: Invalid
Date<BR></FONT></LEFT><CENTER><FONT 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.theform.Day.selectedIndex = today.getDate() - 1;
document.theform.Month.selectedIndex = today.getMonth();

if (today.getYear() < 100)
document.theform.YEAR.selectedIndex = today.getYear()
- 99;
else
document.theform.YEAR.selectedIndex = today.getYear()
- 1999;
// LIST(document.theform);
}
//line 200------------------------------------------------------------

function MM_findObj(n, d) { //v4.0
var p,i,x; if(!d) d=document;
if((p=n.indexOf("?"))>0&&parent.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.forms.length;i++)
x=d.forms[i][n];
for(i=0;!x&&d.layers&&i<d.layers.length;i++)
x=MM_findObj(n,d.layers[i].document);
if(!x && document.getElementById) x=document.getElementById(n);
return x;
}
function MM_nbGroup(event, grpName) { //v3.0
var i,img,nbArr,args=MM_nbGroup.arguments;
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_nbOver = 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_nbOver.length; i++) {
img = document.MM_nbOver[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_swapImgRestore() { //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_preloadImages() { //v3.0
var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
var i,j=d.MM_p.length,a=MM_preloadImages.arguments; 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_swapImage.arguments; document.MM_sr=new Array;
for(i=0;i<(a.length-2);i+=3)
if ((x=MM_findObj(a[i]))!=null){document.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="JavaScript" <DIV class=iehackwrap>
<DIV class=boxwrap>
<DIV class=boxheader> </DIV>
<DIV class=boxbody>
<DIV class=boxleft>
<DIV id="searchbox">
<FORM name="searchform" method="get"
action="http://search.citicorp.com/cgi-bin/query">
<INPUT TYPE="hidden" NAME="mss" VALUE="citigroupnetsimp">
<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.net/ti/images/search1.gif" border="0"
alt="search" name="search">
</form>
</DIV>
<!--<DIV class=boxleftnews>
<!--TAG GENERATOR: OpenCube - Applet Composer,
(www.opencube.com)-->
<!--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="SansSerif,Plain,11">
<!-- <param name="halign" value="Left">
<!-- <param name="lrmargin" value="5">
<!-- <param name="hlcolor" value="116,189,200">
<!-- <param name="scrolldelay" 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="textcolor2" value="205,227,253">
<!-- <param name="font2" value="SansSerif,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.net/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_performance.gif" width="350"
height="77"></i></font></p>
<table width="100%" border="0">
<tr>
<td colspan="3" height="35" valign="baseline"
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>Preview 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">February </option>
<option value="03">March </option>
<option value="04">April </option>
<option value="05" selected>May </option>
<option value="06">June </option>
<option value="07">July </option>
<option value="08">August </option>
<option value="09">September </option>
<option value="10">October </option>
<option value="11">November </option>
<option value="12">December </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(theform)" 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=iehackwrap>
<DIV class=boxwrap>
<DIV class=boxbody> </DIV>
</DIV>
</DIV>
</blockquote>
<DIV class=iehackwrap>
<DIV class=boxwrap>
<DIV class=boxbody>
<DIV class=boxcenter>
<p>
<script>document.write('<BLOCKQUOTE><P id="lastupdate"
ALIGN=center><I>Last updated on ',
document.lastModified,'.</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
Nov 13 '05 #1
0 1600

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: John Davis | last post by:
When I create new documents in Dreamweaver, there are several choices for ASP creation: ASP JavaScript: run at client side?? ASP VBScript: run at server side?? ASP.NET C# ASP.NET VB I don't...
20
by: Harag | last post by:
Hi All. I'm stating out doing some web developing. I was wondering which of the server side languages should I concentrate on and learn. I Know CSS, HTML, T-SQL I can look at the client...
1
by: Ian Sedwell | last post by:
Hi guys Many thanks to all who replied to my original question. Actually, it's dead easy and the way I was doing it was correct the first time. You do indeed simply call the VBScript routine...
3
by: AdamM | last post by:
Hi all, When I run my VbScript, I get the error: "ActiveX component can't create object: 'getobject'. Error 800A01AD". Any ideas what I did wrong? Here's my VBScript: dim o set...
2
by: duncan | last post by:
why does this work :- <HEAD> ...... <SCRIPT LANGUAGE="javascript"> function test() { alert("test 1") } </SCRIPT>
4
by: KevinGPO | last post by:
I am currently developing a website in ASP (VBScript) using MS Visual C#.NET IDE. I just create a new "ASP.NET Web Application" and point to my local webserver (IIS) of my website address. Then I...
6
by: rishabhshrivastava | last post by:
Hello All, I am using ASP.NET 2.0 and I am experiencing a problem using vbscript that is this script on client side is preventing the postback of my controls. I have a dropdownlist which is...
7
by: dkiernan | last post by:
I am stumped. I have several websites running on a 2003 IIS6 box, all running basically the same code (each site has its own home directory and copy of the code). All are running in the same App...
1
by: verthe | last post by:
Hello, I have a python script I picked up from internet but basically I'm working with vbscript on the server side. However vbscript is not good for the task I want to perform (working with large...
0
AHMEDYO
by: AHMEDYO | last post by:
hi all, first its my first time to post question in internet, but vbs really let me crazy. my problem is : ---------------------- i wanna to transfer exe file to machine that i can access by...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.