diff options
Diffstat (limited to 'phpfspot.js')
-rw-r--r-- | phpfspot.js | 28 |
1 files changed, 11 insertions, 17 deletions
diff --git a/phpfspot.js b/phpfspot.js index 555e8ff..57345ab 100644 --- a/phpfspot.js +++ b/phpfspot.js @@ -265,15 +265,13 @@ function setCheckedValue(condition, value) { */ function startSearch() { - from_year = document.getElementById('fromyear').value; - from_month = document.getElementById('frommonth').value; - from_day = document.getElementById('fromday').value; - from = from_year +"-"+ from_month +"-"+ from_day; - to_year = document.getElementById('toyear').value; - to_month = document.getElementById('tomonth').value; - to_day = document.getElementById('today').value; - to = to_year +"-"+ to_month +"-"+ to_day; - + if(document.getElementById('date_from').value != undefined) { + date_from = document.getElementById('date_from').value; + } + if(document.getElementById('date_to').value != undefined) { + date_to = document.getElementById('date_to').value; + } + var objTemp = new Object(); objTemp['action'] = 'search'; @@ -287,8 +285,8 @@ function startSearch() } if(document.getElementsByName('consider_date')[0] != undefined && document.getElementsByName('consider_date')[0].checked == true) { - objTemp['from'] = from; - objTemp['to'] = to; + objTemp['date_from'] = date_from; + objTemp['date_to'] = date_to; } if(document.getElementsByName('consider_rate')[0] != undefined && document.getElementsByName('consider_rate')[0].checked == true) { @@ -322,12 +320,8 @@ function datesearch() mode = false; } - document.getElementById('fromyear').disabled = mode; - document.getElementById('frommonth').disabled = mode; - document.getElementById('fromday').disabled = mode; - document.getElementById('toyear').disabled = mode; - document.getElementById('tomonth').disabled = mode; - document.getElementById('today').disabled = mode; + document.getElementById('date_from').disabled = mode; + document.getElementById('date_to').disabled = mode; } // datesearch() |