$(document).ready(function() {
$.datepicker.setDefaults({
dateFormat: 'yy-mm-dd'
});
$(function() {
$("#ReportFrom").datepicker();
$("#ReportTo").datepicker();
$("#ReportFrom2").datepicker();
$("#ReportTo2").datepicker();
$("#MetaPaymentFrom").datepicker();
$("#MetaPaymentTo").datepicker();
});
// ---------initialize
set_addr($('#AddrCountry'));
set_dates();
var date_from_e = $('#ReportFrom');
var date_from = date_from_e.val();
var date_to_e = $('#ReportTo');
var date_to = date_to_e.val();
var date_from_e2 = $('#ReportFrom2');
var date_from2 = date_from_e2.val();
var date_to_e2 = $('#ReportTo2');
var date_to2 = date_to_e2.val();
var report_format = '';
$('a.report').click(function() {
var url = $(this).attr('href');
var format_e = $('#report_format');
date_from = date_from_e.val();
var date_to = date_to_e.val();
// check if date values are present
if (!date_from) {
alert('Please enter a start date for the report.');
date_from_e.focus();
return false;
}
if (!date_to) {
alert('Please enter a end date for the report.');
date_to_e.focus();
return false;
}
if ($('#report_format input:checked').length < 1 && !$('#report_format').val()) {
alert('Please select a format for the report output.');
return false;
} else {
if ($('#report_format input:checked').length > 0) {
report_format = $('#report_format input:checked').val();
} else {
report_format = $('#report_format').val();
}
}
// we're ready to get the data
url += '/date_from:'+date_from+'/date_to:'+date_to+'/format:'+report_format;
window.location = url;
return false;
});
// checkboxes
$('tr.title input').click(function() {
var checked_status = $(this).attr('checked');
var row_class = $(this).parent().parent().attr('class');
var sub_row_class = 'tr.'+row_class.replace(/title /,'listing.')+' input';
$(sub_row_class).attr('checked',checked_status);
});
// set...
Please Whitelist JSFiddle in your content blocker.
Help keep JSFiddle free for always by one of two ways:
Whitelist JSFiddle in your content blocker (two clicks)
Go PRO and get access to additional PRO features →
Join the 4+ million users, and keep the JSFiddle dream alive.
Ad-free
All ads in the editor and listing pages are turned completely off.
Use pre-released features
You get to try and use features (like the Palette Color Generator) months before everyone else.
Fiddle collections
Sort and categorize your Fiddles into multiple collections.
Private collections and fiddles
You can make as many Private Fiddles, and Private Collections as you wish!
Console
Debug your Fiddle with a minimal built-in JavaScript console.