运输类别 - 网上能源消耗基準工具 /* Disabled btn look */ .block_submit input[disabled], .block_submit input[disabled="disabled"]{ background-color: #c0c0c0; } .warning_error_total, .warning_error_total7, .warning_error_total8 { font-size: 16px; font-weight:bold; color: #FF0000; } .warning_error_total_bk { font-size: 16px; font-weight:bold; color: #000000; } .oneTbl {background-color:#00B0F0; color:#FFFFFF;} #secondTable tr > td:nth-child(12)+ td { color: #077985; text-decoration: underline;} select { width: 180px !important; } .block label { font-size: 1.2em; } 请选择您的车辆之主组别: var editor_1; // use a global for the submit and return data rendering in the examples var table_1; var table_2; var table_3; jQuery(document).ready(function () { //jQuery("#block1").css("visibility","visible"); editor_1 = new jQuery.fn.dataTable.Editor({ ajax: "/modules/mod_aa_sector_three_cn/php/sec.php", table: "#firstTable", fields: [{ label: "PID:", name: "gp_parent_id" }, { label: "group_code:", name: "group_code" }, { label: "Name (EN):", name: "name_cn" } ] }); // Apply the search var seBxKey = "" var table_1 = jQuery('#firstTable').DataTable({ dom: "t", "table": "#firstTable", ajax: { url: "/modules/mod_aa_sector_three_cn/php/sec.php", type: "POST" }, "order": [[2, 'ASC']], "responsive": true, "searchHighlight": true, "saveStatus": true, "search": { "search": "" }, "serverSide": true, "processing": true, "select": true, columns: [ {data: "ecib_bm_group.id"}, {data: "ecib_bm_group.group_code"}, {data: "ecib_bm_group.name_cn"} ], select: true, buttons: [] }); jQuery("#firstTable tbody").on("click", 'td', function () { // jQuery("#block1").css("visibility","hidden"); jQuery("#block2").css("visibility", "visible"); jQuery("#firstForm").css("visibility", "hidden"); // jQuery(".display").css("display","none"); // table data to form input from object var data = table_1.row(jQuery(this).closest('tr')).data(); var pid = data.ecib_bm_group.id; var ppid = data.ecib_bm_group.gp_parent_id; table_2.ajax.url('/modules/mod_aa_sector_three_cn/php/sec2.php?pid=' + pid).load(); table_2.draw(); if (ppid != 3) { jQuery("#block2").css("visibility", "hidden"); // (1) alert('no pid'); } }); var table_2 = jQuery('#secondTable').DataTable({ dom: "t", "table": "#secondTable", "ajax": { url: '/modules/mod_aa_sector_three_cn/php/sec2.php', type: 'POST'}, "order": [[1, 'ASC']], "responsive": true, "searchHighlight": true, "saveStatus": true, "search": { "search": "" }, "serverSide": true, "processing": true, "select": true, columns: [ {data: "ecib_bm_group.gp_parent_id"}, {data: "ecib_bm_group.group_code"}, {data: "ecib_bm_group.name_cn"}, {data: "ecib_bm_group.query_ids"} ], select: true, buttons: [] }); jQuery("#secondTable tbody").on("click", 'td', function () { // jQuery("#block1").css("visibility","hidden"); // jQuery("#block2").css("visibility","hidden"); // jQuery(".display").css("display","none"); // jQuery(".display2").css("display","none"); jQuery("#block3").css("visibility", "visible"); jQuery("#firstForm").css("visibility", "visible"); // table data to form input from object var data2 = table_2.row(jQuery(this).closest('tr')).data(); var pid2 = data2.ecib_bm_group.id; var ppid2 = data2.ecib_bm_group.gp_parent_id; //alert(pid2); //var a = $que_records->count(); //var_dump(a) }); }) jQuery("#startBtn").on('click', function () { alert("startBtn press"); }); #cus2 { margin-top:5px; width:160px; height:70px; margin-right:0px; font-weight:normal; vertical-align: top; -moz-box-shadow:inset 0px 1px 0px 0px #54a3f7; -webkit-box-shadow:inset 0px 1px 0px 0px #54a3f7; box-shadow:inset 0px 1px 0px 0px #54a3f7; background-color:transparent; -moz-border-radius:3px; -webkit-border-radius:3px; border-radius:3px; border:1px solid #19a3ff; display:inline-block; cursor:pointer; color:#134dc2; font-family:Arial; font-size:14px; padding:5px 5px; text-decoration:none; /*text-shadow:0px 1px 0px #0f7bff; */ } #cus2:hover, #cus2:focus { color: #134dc2; text-shadow: 1px 2px #FFFFFF; background: rgba(212,228,239,1); background: -moz-linear-gradient(top, rgba(212,228,239,1) 0%, rgba(134,174,204,1) 100%); background: -webkit-gradient(left top, left bottom, color-stop(0%, rgba(212,228,239,1)), color-stop(100%, rgba(134,174,204,1))); background: -webkit-linear-gradient(top, rgba(212,228,239,1) 0%, rgba(134,174,204,1) 100%); background: -o-linear-gradient(top, rgba(212,228,239,1) 0%, rgba(134,174,204,1) 100%); background: -ms-linear-gradient(top, rgba(212,228,239,1) 0%, rgba(134,174,204,1) 100%); background: linear-gradient(to bottom, rgba(212,228,239,1) 0%, rgba(134,174,204,1) 100%); filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#d4e4ef', endColorstr='#86aecc', GradientType=0 ); } #cus2:active { position:relative; top:1px; } button {border solid 2px transparent !important;} /* button, #cus1 { width:160px; height:70px; margin-top:5px; margin-right:4px; font-weight:bolder; vertical-align: top; -moz-box-shadow:inset 0px 1px 0px 0px #3dc21b; -webkit-box-shadow:inset 0px 1px 0px 0px #3dc21b; box-shadow:inset 0px 1px 0px 0px #3dc21b; background-color:transparent; -moz-border-radius:3px; -webkit-border-radius:3px; border-radius:3px; border:1px solid #18ab29; display:inline-block; cursor:pointer; color:#288005; font-family:Arial; font-size:13px; padding:5px 5px; text-decoration:none; text-shadow:0px 1px 0px #2f6627; } button, #cus1:hover { background-color:transparent; } button, #cus1:active { position:relative; top:1px; } */ #levelone {border: 1px solid #61bf76; } #leveltwo {border: 2px solid #61bf76; width:160px: height: 60px; font-size: 80%;} .arrowSeperator { display: block; text-align: center; border: 1px solid #ddd; width: 100%; height: 0; position: relative; margin-top: 20px; margin-bottom: 30px; } .arrowSeperator:before { content: ""; width: 0; height: 0; border-left: 15px solid transparent; border-right: 15px solid transparent; border-top: 15px solid #ddd; position: absolute; top: 100%; /* left: 20%; right: 20%; */ /* margin: 0 -15px; */ z-index: 1; } var ym_list = null; var ym_first_year = null; var ym_first_month = null; var ym_last_year = null; var ym_last_month = null; jQuery.ajax( { dataType:"json", type:"POST", data:{ ajax_task:'getAllValidYearMonth', }, url:jQuery(location).attr("href") } ).always(function(e){ var re = /(.*)/; var result = re.exec(e.responseText); if( result ){ if( result[1] != "" ){ ym_list = JSON.parse(result[1]); ym_first_year = ym_list.years.replace( /()/, '' ); ym_last_year = ym_list.years.replace( /()(?!.*())/, '' ); ym_first_month = ym_list.months[ym_list.years_name[0]].replace( /()/, '' ); ym_last_month = ym_list.months[ym_list.years_name[ym_list.years_name.length - 1]].replace( /()(?!.*())/, '' ); // ym_first_year = ym_list.years; // ym_last_year = ym_list.years; // ym_first_month = ym_list.months[ym_list.years_name[0]]; // ym_last_month = ym_list.months[ym_list.years_name[ym_list.years_name.length - 1]]; } } }); jQuery(document).ready(function () { //$.get(URL,callback); var a = jQuery.get("/modules/mod_aa_sector_three_cn/php/sec.php", function (data, status) { var strBuilder = []; for (key in a) { if (a.hasOwnProperty(key)) { strBuilder.push("Key is " + key + ", value is " + a[key] + "\n"); } } // (2) alert(strBuilder.join("")); //alert(a[key]); // display "OK" // (3) alert(data); // Fion add alert here // data = $.parseJSON(data); data = JSON.parse(data); jQuery.each(data, function (i, v) { console.log(i, v); }); jQuery("button").click(function () { // jQuery("#block2").load("/modules/mod_aa_sector_three_cn/php/sec.php"); // alert(a); }); }); /*jQuery("#btn5").click(function(){ alert("btn555 clicked...."); if slider : min, mean, max add textField : input_val, xi_value (sec3.php) , cal_value });*/ jQuery(".group_btn_custom").click(function () { var group_id = jQuery(this).attr('data-group-id') console.log("group_id:"+group_id); // (4) alert('Group Id: ' + group_id + ' Clicked'); //hide block 1 Matthew me = jQuery(this)[0]; console.log(me); jQuery("#block1").html(me.outerHTML); jQuery("#arrow1").show(); group_data = jQuery(this).attr('data-all'); //alert(group_data); var block2BtnsHtml = ''; jQuery.ajax({ dataType: "json", type: "GET", data: {'pid': group_id}, url: '/modules/mod_aa_sector_three_cn/php/sec2.php', success: function (response) { // (5) alert(JSON.stringify(response.data)); console.log(response.data); if (response.data === undefined || response.data.length == 0) { // (6) alert('Loading Questions on null with : ' + group_id); showBlock3(group_id); } else { jQuery("#arrow3").show(); jQuery("#block4").hide(); jQuery(".block_submit").hide(); response.data.forEach(function (value, key) /* { block2BtnsHtml += '' + value.ecib_bm_group.group_code + '' + value.ecib_bm_group.name_cn + '' + value.ecib_bm_group.id + ' / ' + value.ecib_bm_group.gp_parent_id + ''; } */ { block2BtnsHtml += '' +''+ ''+ value.ecib_bm_group.name_cn + ' (' + value.ecib_bm_group.group_code +') '+ ' '; } ); jQuery('html, body').animate({ scrollTop: jQuery( "#arrow1" ).offset().top-100 }, 500); } jQuery('#block2Btns').html(block2BtnsHtml); if (response.data == '') { jQuery('#block3').css('visibility', 'visible'); } } }); }); }); //end function showBlock3(_pid) { //hide block 2 Matthew try{ me = jQuery("button[data-pid=" + _pid + "]")[0]; console.log(me); jQuery("#block2").html(me.outerHTML); jQuery("#arrow2").show(); } catch (e) {} jQuery("#block4").show(); jQuery('html, body').animate({ scrollTop: jQuery( "#qTitle" ).offset().top }, 500); jQuery(".block_submit").show(); var cal_title = ""; if( jQuery("[data-group-id="+_pid+"]").length > 0 ){ cal_title = '能源消耗基準 ' + jQuery("[data-group-id="+_pid+"] span").html().trim().replace(/(\r\n|\n|\r||)/gm, "").replace(/\s\s+/g," "); }else if( jQuery("[data-pid="+_pid+"]").length > 0 ){ cal_title = '能源消耗基準 ' + jQuery("[data-pid="+_pid+"] span").html().trim().replace(/(\r\n|\n|\r||)/gm, "").replace(/\s\s+/g," "); } // (8) alert('Clicked with : ' + _pid); console.log("_pid:"+_pid); jQuery('#block3').css('visibility', 'visible'); jQuery.ajax({ dataType: "json", type: "GET", data: {'pid': _pid}, url: '/modules/mod_aa_sector_three_cn/php/sec3.php', success: function (response) { var is_xi_flag0 = is_xi_flag1 = is_xi_flag2 = is_xi_flag27 = is_xi_flag28 = is_xi_flag3 = is_xi_flag4 = is_xi_flag5 = ''; // (9) alert(JSON.stringify(response.data)); console.log(response.data); var question_counter = 1; response.data.forEach(function (value, key) { var _value = value; var _html = ''; /* Fion */ var question_no = false; if( _value.ecib_bm_group_xi.xi_id != 1 && _value.ecib_bm_xi_value.is_child != 1) question_no = true; if (_value.ecib_bm_xi_value.is_xi_flag == 0) { _html += ' '; // _html += ''; // comment this line to show Intercept _html += ''; // comment this line to hide Intercept _html += ' ' + _value.ecib_bm_xi_value.que_cn + ''; //if is_parent == 1, skip the input box, leave just the label if( _value.ecib_bm_group_xi.is_parent != 1 ){ _html += ''; _html += ' '; _html += ''; _html += ' '; var onkeyup_string = ""; var preCalVal = _value.ecib_bm_group_xi.input_val * _value.ecib_bm_group_xi.xi_value; _html += ' ' + _value.ecib_bm_xi_value.unit_cn + ' '; _html += ' '; _html += ' '; _html += ''; _html += ''; _html += ''; _html += 'jQuery(function ()'; _html += '{'; _html += 'jQuery("#slider-range-min' + _value.ecib_bm_group_xi.xi_id + '").slider({'; _html += 'range: "min",'; _html += 'value: ' + _value.ecib_bm_group_xi.input_val + ','; _html += 'min: ' + _value.ecib_bm_group_xi.min + ','; _html += 'max: ' + _value.ecib_bm_group_xi.max + ','; _html += 'step: ' + ( parseInt(_value.ecib_bm_group_xi.step) 0 ){ // var sum = 0; // jQuery(".warning_hundred").each(function () // { // if (parseFloat(jQuery(this).val().trim().replace(/\s*,\s*|\s+,/g, '')) != 0) // { // sum = sum + parseFloat(jQuery(this).val().trim().replace(/\s*,\s*|\s+,/g, '')); // } // }); // if (isNaN(sum) == false) // { // jQuery('.warning_error_total').html('合共 ' + sum.toFixed(2) + '%'); // } // else // { // jQuery('.warning_error_total_bk').html('合共 0.00%'); // } // if (sum < 100 || sum > 100) // { // jQuery('.warning_error').html('(以上输入的百分比总和应为100%。)'); // } // else // { // jQuery('.warning_error').html(''); // } // ck_can_submit(); // } ck_hundred_total(); jQuery("label[add-question-no]").each( function( i, val ){ var org_html = jQuery(val).html(); jQuery(val).html( "Q" + (i+1) + ". " + org_html ); }); }); jQuery(".datePickSelect").on("change", function(e){ var xiid = jQuery(this).attr('xiid'); var dtype = jQuery(this).attr('dtype'); var stype = jQuery(this).attr('stype'); if( dtype == "year" ){ var selYear = jQuery(this).val(); jQuery("#"+stype+"Month"+xiid).html(ym_list.months[selYear]); } validateDate( xiid ); }); function validateDate ( xiid ){ var selStYear = jQuery("#startYear"+xiid).val(); var selStMonth = jQuery("#startMonth"+xiid).val(); var selEdYear = jQuery("#lastYear"+xiid).val(); var selEdMonth = jQuery("#lastMonth"+xiid).val(); if( selStYear > selEdYear ){ jQuery("#lastYear"+xiid).val( selStYear ); selEdYear = selStYear; jQuery("#lastMonth"+xiid).html(ym_list.months[selStYear]).val( selStMonth ); selEdMonth = selStMonth; }else if( selStYear == selEdYear && selStMonth > selEdMonth ){ jQuery("#lastMonth"+xiid).html(ym_list.months[selStYear]).val(selStMonth); selEdMonth = selStMonth; } var stMon = selStYear + "-" + selStMonth; var edMon = selEdYear + "-" + selEdMonth; date_ajax_call( stMon, edMon, xiid ); } jQuery(".warning_hundred .warning_hundred7 .warning_hundred8 ").on("keypress keyup blur", function (event) { //this.value = this.value.replace(/[^0-9\.]/g,''); jQuery(this).val(jQuery(this).val().replace(/[^0-9\.]/g, '')); if ((event.which != 46 || jQuery(this).val().indexOf('.') != -1) && (event.which < 48 || event.which > 57)) { event.preventDefault(); } // if (jQuery(this).val() == "" || jQuery(this).val() == null) // { // jQuery(this).val(0); // } }); jQuery('.warning_hundred').on( 'keypress keyup blur', function (event) { ck_hundred_total(); }); jQuery('.warning_hundred7').on( 'keypress keyup blur', function (event) { ck_hundred_total7(); }); jQuery('.warning_hundred8').on( 'keypress keyup blur', function (event) { ck_hundred_total8(); }); // Trigger ck_can_submit function whenever disclaimer box is clicked jQuery("#agree").on("change", function(){ ck_can_submit(); }); jQuery(".xi_flag_5_radio_btn").on( 'change', function(){ var cked_xiid = jQuery(this).attr('xiid'); var par_xiid = jQuery(this).attr('par_xiid'); jQuery( '.radio_btn_block' + par_xiid ).each( function(){ var dummy_xiid = jQuery(this).find('.xi_flag_5_radio_btn').attr('xiid'); var cked_opt = ( dummy_xiid == cked_xiid ? true : false ); jQuery(this).attr('valid', 1); jQuery(this).find('.input_val').val( ( cked_opt ? 1 : 0 ) ); jQuery(this).find('.tran_val').val( ( cked_opt ? 1 : 0 ) ); jQuery(this).find('.cal_val').val( ( cked_opt ? jQuery(this).find('.xi_val').val() : 0 ) ); }); ck_can_submit(); } ); // xi_flag_5_radio_btn from 1096 // jQuery('.date-picker').datepicker({ // changeMonth: true, // changeYear: true, // showButtonPanel: true, // dateFormat: 'yy-mm', // // onClose: function (dateText, inst) // // { // // console.log( inst ); // // // console.log( jQuery(this) ); // // jQuery(this).datepicker('setDate', new Date(inst.selectedYear, inst.selectedMonth, 1)); // // } // onChangeMonthYear: function( year, month, inst ) // { // var xi_id = jQuery(this).attr('xi_id'); // // jQuery("#input_val"+xi_id).attr( "cFlag", 1 ); // }, // onClose: function( dateText, inst ) // { // var xi_id = jQuery(this).attr('xi_id'); // // var changeFlag = jQuery("#input_val"+xi_id).attr( "cFlag" ); // // if( changeFlag == 1 ){ // jQuery(this).datepicker('setDate', new Date(inst.selectedYear, inst.selectedMonth, 1)); // date_ajax_call( xi_id ); // } // // jQuery("#input_val"+xi_id).attr( "cFlag", 0 ); // } // }); //date-picker ck_can_submit(); } }); } function onSliderSetInputChange( input_val, xiid, xi_val, min, max, is_xi_flag, needLog, from_slider ){ if( is_xi_flag == 2 && is_xi_flag == 7 && is_xi_flag == 8 && !from_slider && input_val.match(/\d.\d{2}\d+/) ){ input_val = parseFloat(input_val).toFixed(2); } jQuery( '#input_val' + xiid ).val( input_val ); var tranVal = ( needLog ? Math.log( input_val ) : input_val ); jQuery( '#tran_val' + xiid ).val( tranVal ); var floatCalVal = tranVal * xi_val; var stringCalVal = floatCalVal.toString(); var fixedCalPattern = /(-*\d+\.\d*[^0])000[0]*[1-9]$/; var matches = stringCalVal.match(fixedCalPattern); if( matches ){ if( matches[1] ){ floatCalVal = matches[1]; } } if( !from_slider ){ jQuery("#slider-range-min" + xiid).slider("value",input_val); } jQuery( '#cal_val' + xiid ).val( floatCalVal ); check_box_valid( xiid, min, max ); // wrong by if( is_xi_flag == 2 && is_end == 1 ) if( is_xi_flag == 2){ ck_hundred_total(); } else { ck_hundred_total7(); } if( is_xi_flag == 7){ ck_hundred_total7(); } else { ck_hundred_total8(); } if( is_xi_flag == 8){ ck_hundred_total8(); } else { ck_hundred_total(); } } function formatNumber(num) { return num.toString().replace(/(\d)(?=(\d{3})+(?!\d))/g, '$1,') } function check_box_valid( xi_id, min_val, max_val ){ if( !min_val ){ min_val = 0; } if( !max_val ){ max_val = false; } if( xi_id == 1 ) return; var input_val = jQuery("#input_val"+xi_id).val(); // warning msg for inputting non-numeric character e.g. alphabetic character if( isNaN( input_val ) ){ jQuery("#warning_box"+xi_id).html('请输入数字'); jQuery("#warning_box"+xi_id).show(); jQuery("#input_val"+xi_id).attr('valid', 0); ck_can_submit(); return; } if( min_val !== false || max_val !== false ){ // warning msg for input value exceeds the given range if( input_val < min_val || input_val > max_val ){ jQuery("#warning_box"+xi_id).html('可接受的输入范围为 ' + min_val + ' 至 ' + formatNumber(max_val) + ' '); jQuery("#warning_box"+xi_id).show(); jQuery("#input_val"+xi_id).attr('valid', 0); ck_can_submit(); return; } } jQuery("#warning_box"+xi_id).hide(); jQuery("#input_val"+xi_id).attr('valid', 1); ck_can_submit(); } function ck_can_submit(){ var can_submit = true; jQuery("input[valid]").each( function(i, val){ if( jQuery(val).attr("valid") != 1 ){ can_submit = false; return false; } }); if( jQuery('wXiFlagTwo').length > 0 ){ if( jQuery('.warning_error').html() != '' ){ can_submit = false; } } if( jQuery('wXiFlagTwoSteven').length > 0 ){ if( jQuery('.warning_error7').html() != '' ){ can_submit = false; } } if( jQuery('wXiFlagTwoEight').length > 0 ){ if( jQuery('.warning_error8').html() != '' ){ can_submit = false; } } if( jQuery("#agree").is(":not(:checked)") ){ can_submit = false; } jQuery(".radio_btn_block[valid]").each( function(i, val){ if( jQuery(val).attr("valid") != 1 ){ can_submit = false; return false; }else{ jQuery("#arrow4").hide(); jQuery("#arrow5").hide(); } }); jQuery(".datePickSelect").each( function(){ if( !jQuery(this).val() ){ can_submit = false; return false; } }); if( can_submit ){ jQuery('#createRpt').removeAttr("disabled"); }else{ jQuery("#createRpt").attr("disabled", "disabled"); } // console.log("checked ck submit"); } function ck_hundred_total(){ if( jQuery('wXiFlagTwo').length > 0 ){ var sum = 0; jQuery('.warning_hundred').each(function () { $input_val = parseFloat(jQuery(this).val().trim().replace(/\s*,\s*|\s+,/g, '')); $input_val = isNaN($input_val) ? 0 : $input_val; sum = sum + $input_val; }); if (isNaN(sum) == false) { jQuery('.warning_error_total').html('合共 ' + sum.toFixed(2) + '%'); } else { jQuery('.warning_error_total').html('合共 0.00%'); } if (sum < 100 || sum > 100) { jQuery('.warning_error').html('(以上输入的百分比总和应为100%。)'); } else { jQuery('.warning_error').html(''); } ck_can_submit(); } } function ck_hundred_total7(){ if( jQuery('wXiFlagTwoSteven').length > 0 ){ var sum = 0; jQuery('.warning_hundred7').each(function () { $input_val = parseFloat(jQuery(this).val().trim().replace(/\s*,\s*|\s+,/g, '')); $input_val = isNaN($input_val) ? 0 : $input_val; sum = sum + $input_val; }); if (isNaN(sum) == false) { jQuery('.warning_error_total7').html('合共 ' + sum.toFixed(2) + '%'); } else { jQuery('.warning_error_total7').html('合共 0.00%'); } if (sum < 100 || sum > 100) { jQuery('.warning_error7').html('(以上输入的百分比总和应为100%。)'); } else { jQuery('.warning_error7').html(''); } ck_can_submit(); } } function ck_hundred_total8(){ if( jQuery('wXiFlagTwoEight').length > 0 ){ var sum = 0; jQuery('.warning_hundred8').each(function () { $input_val = parseFloat(jQuery(this).val().trim().replace(/\s*,\s*|\s+,/g, '')); $input_val = isNaN($input_val) ? 0 : $input_val; sum = sum + $input_val; }); if (isNaN(sum) == false) { jQuery('.warning_error_total8').html('合共 ' + sum.toFixed(2) + '%'); } else { jQuery('.warning_error_total8').html('合共 0.00%'); } if (sum < 100 || sum > 100) { jQuery('.warning_error8').html('(以上输入的百分比总和应为100%。)'); } else { jQuery('.warning_error8').html(''); } ck_can_submit(); } } function date_ajax_call( stMon, ltMon, xi_id ){ // var stMon = jQuery('#startMonth'+xi_id).val(); // var ltMon = jQuery('#lastMonth'+xi_id).val(); if( stMon && ltMon ){ jQuery.ajax( { dataType:"json", type:"POST", data:{ ajax_task:'getMthAvg', startMonth: stMon, lastMonth: ltMon }, url:jQuery(location).attr("href") } ).always(function(e){ var re = /(.*)/; var result = re.exec(e.responseText); if( result ){ if( result[1] != "" ){ console.log(result[1]); var avg_temp_obj = JSON.parse(result[1]); var avg_temp = avg_temp_obj[0].avgTemp !== null ? parseFloat(avg_temp_obj[0].avgTemp) : 0; // add condition to ln avg_temp base on xi_id // e.g // if( xi_id == 12 ){ avg_temp = Math.log( avg_temp ); } jQuery('#input_val'+xi_id).val( avg_temp ); jQuery('#cal_val'+xi_id).val( avg_temp * parseFloat( jQuery('#xi_value'+xi_id).val() ) ); jQuery('#tran_val'+xi_id).val( avg_temp ); jQuery('#remark'+xi_id).val( 'Between ' + stMon + ' to ' + ltMon ); } } ck_can_submit(); }); } } 电单车 (汽油) (V1) 私家车 (V2) 私家巴士 (柴油) (V3) 公共巴士 (柴油) (V4) 私家小巴 (V5) 公共小巴 (V6) 出租车 (石油气) (V7) 轻型货车 (汽油) (V8) 轻型货车 (柴油) (V9) 中型货车 (柴油) (V10) 重型货车 (柴油) (V11) 请选择您的车辆之次组别: 重 置 #demo-frame > div.demo { padding: 10px !important; }; .ui-datepicker-calendar { display: none; } 我已阅读免责声明并接受条款。 免责声明 - 资料的收集 经本线上基準评核工具所输入的用户数据,仅用作个别用户基準评核分析。我们致力持续监察和改善线上基準评核工具,网站将自动存储用户输入的数据、基準评核结果。 中华人民共和国香港特别行政区政府 (下称"政府") 或会记录本网站的到访人数及使用情况,但不会收集个人资料。 政府所收集有关本网站浏览的资料,将会用作改善网站、编製统计报告及分析电脑系统问题。政府不会将存储的数据转移至任何外部人士。