By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
448,493 Members | 1,296 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 448,493 IT Pros & Developers. It's quick & easy.

Script not working

P: n/a
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
Share this Question
Share on Google+
1 Reply


P: n/a
ch*******@yahoo.com (Rob) wrote in message news:<60************************@posting.google.co m>...
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.
...
I'm not an Access guru but I do have a suggestion. After testing your
functions to make sure they are giving you the output you expect for a
given input, temporarily replace the function calls with a sample
return value. Then keep commenting out logical blocks of code until
you isolate the problem. If it was working before and isn't working
now there may be no way for others to discover the problem since it
may involve something that changed in your environment only. So,
"Break it down."

James A. Fortune
Thanks,

Rob

Nov 13 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.