2011-04-07 01:52:01 -07:00
|
|
|
$(function() {
|
|
|
|
|
|
2011-09-26 20:47:36 -07:00
|
|
|
var model = $("#modelString").val();
|
2011-04-07 01:52:01 -07:00
|
|
|
|
2011-05-12 19:52:53 -07:00
|
|
|
$(".month").live('click',function(event) {
|
|
|
|
|
event.preventDefault();
|
|
|
|
|
|
|
|
|
|
var target = $(this).children('a').attr('href');
|
|
|
|
|
|
|
|
|
|
var targetString = '/jobs/viewReport/'+target;
|
|
|
|
|
|
2011-05-15 23:13:21 -07:00
|
|
|
$("#reports").fadeOut('fast');
|
|
|
|
|
|
2011-05-12 19:52:53 -07:00
|
|
|
$.get(targetString, function(data) {
|
|
|
|
|
$("#reports").html(data);
|
2011-05-15 23:13:21 -07:00
|
|
|
$("#reports").fadeIn('fast');
|
2011-05-12 19:52:53 -07:00
|
|
|
});
|
|
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
2011-04-07 01:52:01 -07:00
|
|
|
$(".year").click(function() {
|
2011-05-11 23:39:39 -07:00
|
|
|
var thisYear = $(this).attr('id');
|
2011-05-12 19:52:53 -07:00
|
|
|
|
2011-05-15 23:13:21 -07:00
|
|
|
if(thisYear != 0) {
|
2011-05-12 19:52:53 -07:00
|
|
|
|
2011-05-15 23:13:21 -07:00
|
|
|
var lastYear = parseInt(thisYear) - 1;
|
|
|
|
|
var yearString = lastYear+'-'+thisYear;
|
|
|
|
|
$(".whichYear").html(yearString);
|
2011-05-12 19:52:53 -07:00
|
|
|
|
2011-05-15 23:13:21 -07:00
|
|
|
$(".months").html(getMonthsFY(thisYear));
|
2011-05-12 19:52:53 -07:00
|
|
|
|
|
|
|
|
|
2011-05-15 23:13:21 -07:00
|
|
|
}
|
2011-05-12 19:52:53 -07:00
|
|
|
|
2011-04-07 01:52:01 -07:00
|
|
|
$.get('/jobs/viewReport/'+thisYear, function(data) {
|
|
|
|
|
$("#reports").html(data);
|
|
|
|
|
});
|
2011-05-11 23:39:39 -07:00
|
|
|
|
2011-04-07 01:52:01 -07:00
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
2011-05-12 19:52:53 -07:00
|
|
|
|
|
|
|
|
function getMonthsFY(year) {
|
|
|
|
|
var months = new Object();
|
|
|
|
|
|
|
|
|
|
lastYear = parseInt(year) - 1;
|
|
|
|
|
|
|
|
|
|
months['July'] = lastYear+'/07';
|
|
|
|
|
months['August'] = lastYear+'/08';
|
|
|
|
|
months['September'] = lastYear+'/09';
|
|
|
|
|
months['October'] = lastYear+'/10';
|
|
|
|
|
months['November'] = lastYear+'/11';
|
|
|
|
|
months['December'] = lastYear+'/12';
|
|
|
|
|
months['January'] = year+'/01';
|
|
|
|
|
months['February'] = year+'/02';
|
|
|
|
|
months['March'] = year+'/03';
|
|
|
|
|
months['April'] = year+'/04';
|
|
|
|
|
months['May'] = year+'/05';
|
|
|
|
|
months['June'] = year+'/06';
|
|
|
|
|
|
|
|
|
|
var monthList = '';
|
|
|
|
|
|
|
|
|
|
for(var i in months) {
|
|
|
|
|
//alert(i +' is'+months[i] );
|
|
|
|
|
monthList += '<li class="month"><a href="'+months[i]+'">'+i+'</a>';
|
|
|
|
|
}
|
|
|
|
|
return monthList;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*$(".month").click(function() {
|
2011-04-07 01:52:01 -07:00
|
|
|
var thisMonth = $(this).html();
|
|
|
|
|
var thisYear = $(this).parents('.monthList').attr('id');
|
|
|
|
|
|
|
|
|
|
$.get('/jobs/viewReport/'+thisYear+'/'+thisMonth, function(data) {
|
|
|
|
|
$("#reports").html(data);
|
|
|
|
|
});
|
|
|
|
|
|
2011-05-12 19:52:53 -07:00
|
|
|
});*/
|
2011-04-07 01:52:01 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|