<HTML>
<HEAD>
<LINK href="CSS_Source.css" type=text/css rel=stylesheet>
<Script Language="text/javaScript">
var isOrderDetailSelected = false;
var isNonOrderDetailSelected = false;
var isReportingPeriodSelected = false;
/*************************************************************
This Function validates that the users select the required
parameters to view the crystal reports
**************************************************************/
function ValidateData(f) {
//Check to make sure a report is selected.
// validate myradiobuttons
myOption = -1;
for (i=f.crystalradio.length-1; i > -1; i--) {
if (f.crystalradio[i].checked) {
myOption = i;
if (f.crystalradio[i].value == 'CommissionStatement') {
//alert('crystalradiovalue ' + i + ' ' + f.crystalradio[i].value);
if (f.period_Comm_Pay.value == 'Select') {
alert("Select a Reporting Period");
return false;
}
}
if (f.crystalradio[i].value == 'PaymentReconciliation') {
//alert('crystalradiovalue ' + i + ' ' + f.crystalradio[i].value);
if (f.period_Comm_Pay.value == 'Select') {
alert("Select a Reporting Period");
return false;
}
}
if (f.crystalradio[i].value == 'QuarterlyPerformance-Team') {
//alert('crystalradiovalue ' + i + ' ' + f.crystalradio[i].value);
if (f.period_QPT.value == 'Select') {
alert("Select a Reporting Period");
return false;
}
if (f.Family.value =='SelectFamily') {
alert("Select a Family");
return false;
}
}
if (f.crystalradio[i].value == 'SalesRanking') {
//alert('crystalradiovalue ' + i + ' ' + f.crystalradio[i].value);
if (f.period_SR.value == 'Select') {
alert("Select a Reporting Period");
return false;
}
if (f.ReportType_SR.value =='SelectReport') {
alert("Select a Report");
return false;
}
if (f.Region_SR.value =='SelectRegion') {
alert("Select a Region");
return false;
}
}
if (f.crystalradio[i].value == 'QuarterlyPerformanceReport') {
//alert('crystalradiovalue ' + i + ' ' + f.crystalradio[i].value);
if (f.period_QP.value == 'Select') {
alert("Select a Reporting Period");
return false;
}
if (f.Region_QP.value =='SelectRegion') {
alert("Select a Region");
return false;
}
if (f.Family_QP.value =='SelectFamily') {
alert("Select a Family");
return false;
}
}
if (f.crystalradio[i].value == 'SalesProductivity') {
//alert('crystalradiovalue ' + i + ' ' + f.crystalradio[i].value);
if (f.period_SP.value == 'Select') {
alert("Select a Reporting Period");
return false;
}
if (f.Currency_SP.value =='Currency') {
alert("Select a Currency");
return false;
}
if (f.Report_SP.value =='SelectReport') {
alert("Select a Report");
return false;
}
if (f.Region_SP.value =='SelectRegion') {
alert("Select a Region");
return false;
}
}
if (f.crystalradio[i].value == 'OrderDetailYTD') {
//alert('crystalradiovalue ' + i + ' ' + f.crystalradio[i].value);
if (f.StartDate.value == 'SelectStart') {
alert("Select a Start Date");
return false;
}
if (f.EndDate.value =='SelectEnd') {
alert("Select an End Date");
return false;
}
}
}
}
if (myOption == -1) {
alert("You must select a report to view");
return false;
}
return true;
}
/*****************************************************
This function shows and hides the org structure tree
******************************************************/
function s_Hide(el){
obj = document.getElementById(el).style;
(obj.display == 'none')? obj.display = 'block' : obj.display = 'none';
}
/*******************************************************
This function ensures that the users select a start date which is less than end date
********************************************************/
function ParseDate(dateString)
{
//Date is in the format of mm/dd/yyyy pulled from a dropdown box.
var dateSep = "/";
//firstSep = dateString.indexOf(dateSep);
//lastSep = dateString.lastIndexOf(dateSep);
date = dateString.split(dateSep, 3);
//alert(date[0] + ", " + date[1] + ", " + date[2]);
var date = new Date(date[2], date[0]-1, date[1]);
//alert(date); //parsing is working fine. returns the date object.
return date;
}
function ValidateDate(startDateStr, endDateStr)
{
startDate = ParseDate(startDateStr);
endDate = ParseDate(endDateStr);
//alert(startDate.toString()); //here is the error - when it convert to a string it is returning funny values.
//alert(startDate.getDate());
if (endDate < startDate) {
alert("Start Date should be less than End Date");
}
//else
// alert("Bad");
}
</script>
</HEAD>
<TITLE>View Commissions Reports</TITLE>
<BODY>
<center><html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title></title>
<style type="text/css">
label
{
width: 5em;
float: left;
text-align: right;
margin-right: 0.5em
display: block
}
</style>
</head>
<body>
<table align=center width=100%>
<tr>
<td width=30%><img src="image004.jpg"></img></td>
<td width=40%><b><font face="arial" size=5 color="0033AB">SALES COMPENSATION</font><b></td>
<td align=right width=30%><b><font face="arial" size=2 color="0033AB">
Today's Date: 11/13/2006<BR>Last Updated Date: 11/10/2006
</font><b>
</td>
</tr>
</table>
</body>
</html></center>
<form name="commission" id="commission" method="post" action="ViewReports4.asp" onSubmit="return ValidateData(this);">
<table width="100%">
<tr>
<td class="logon">
Employee:Mgr1(41495)
</td>
</tr>
</table>
<!-------------------------------------------------------------------------------
Display the Org Tree
--------------------------------------------------------------------------------->
<div class="container1">
<div class="caption">Organization</div>
<br><br>
<input type="radio" checked name="empid" id="empid" value="41495">
<a href="#" class="a_style" onclick="s_Hide('862336'); return false;">Mgr1</a href><font size=1>(41495)</font><br>
<span id="862336" style="display: none">
<input type="radio" name="empid" id="empid" value="41475">
Sub1 <font size=1>(41475)</font>
<br>
<input type="radio" name="empid" id="empid" value="41612">
Sub2 <font size=1>(41612)</font>
<br>
<input type="radio" name="empid" id="empid" value="41503">
Sub3 <font size=1>(41503)</font>
<br>
<input type="radio" name="empid" id="empid" value="41502">
Sub4 <font size=1>(41502)</font>
<br>
<input type="radio" name="empid" id="empid" value="41558">
Sub5 <font size=1>(41558)</font>
<br>
</span>
</span>
</div>
<!----------------------------------------------------------------------------------------
'Reports Display Begins
'--------------------------------------------------------------------------------------->
<div class="container2">
<div class="caption">Reports</div>
<br><br>
<font class="body_text">Select Plan (Monthly Reports)</font>
<br>
<!--Include Virtual="/scripts/Padmaja/Testing1/Reports_Display.asp"-->
</div>
<!-----------------------------------------------------------------------------------------
'Reports Display Ends
'------------------------------------------------------------------------------------------>
<div class="container3">
<div class="top_hire">
<font class="body_caption">President's Club</font>
<br>
<html>
<head>
<title>XML Data in TextArea</title>
</head>
<body>
<textarea readonly="readonly" rows=5 cols=30>
</textarea>
</body>
</html>
</div>
<div class="top_hire">
<font class="body_caption">New Hires</font>
<html>
<head></head>
<title>Reports</title>
<body>
<br>
<textarea rows=5 cols=30 readonly>
Hongsuraphan, Monchai
</textarea>
</body>
</html>
</div>
<div class="top_hire">
<font class="body_caption">Other Information</font>
<br><br>
<html>
<head>
<LINK href="CSS_Source.css" type=text/css rel=stylesheet >
</head>
<title></title>
<body>
Please review your statements thoroughly and notify Commissions of any discrepancies.
</body>
</html>
</div>
</div>
</form>
</body>
</html>