$(function(){ $(".item_tab").click(function(){ $(".item_content").fadeOut(); $("#content_"+$(this).attr('id')).fadeIn(); }) }); $arrDM = new Array(); $arrDM['75'] = new Array('1.875', '20'); $arrDM['100'] = new Array('2.5', '20'); $arrDM['125'] = new Array('3.125', '20'); $arrDM['150'] = new Array('3.75', '20'); $arrDM['200'] = new Array('5', '20');
function Cal(){ $chieuDay = $("#select_gach").val(); $dienTich = $("#input_dttuong").val(); if(!isNaN($chieuDay) && $dienTich !=0 && $dienTich !='' && !isNaN($dienTich)){ $dinhMucVuaXay = $arrDM[$chieuDay][0]; $dinhMucVuaTo = $arrDM[$chieuDay][1]; $giaGach = 1350000; $giaVuaXay = 110000; $giaVuaTo = 90000; $m3 = $chieuDay * $dienTich / 1000; $pallet = Math.ceil($m3 / 1.44); $vuaXay = Math.ceil($dinhMucVuaXay * $dienTich/25); $vuaTo = $dinhMucVuaTo * $dienTich/25; $thanhTien =($m3 * $giaGach) + ($vuaXay * $giaVuaXay) + ( $vuaTo * $giaVuaTo); $chiPhi = $thanhTien / $dienTich; $("#m3").text(formatCurrency($m3)); $("#pallet").text(formatCurrency($pallet)); $("#vuaxay").text(formatCurrency($vuaXay)); $("#vuato").text(formatCurrency($vuaTo)); $("#tongchiphi").text(formatCurrency(Math.round($thanhTien))); $("#chiphi").text(formatCurrency(Math.round($chiPhi))); } else{ $("#m3").text("000"); $("#pallet").text("000"); $("#vuaxay").text("000"); $("#vuato").text("000"); $("#tongchiphi").text("000"); $("#chiphi").text("000"); } } function formatCurrency(num) { num = num.toString().replace(/\$|\,/g,''); if(isNaN(num)) num = "0"; sign = (num == (num = Math.abs(num))); num = Math.floor(num*100+0.50000000001); num = Math.floor(num/100).toString(); for (var i = 0; i < Math.floor((num.length-(1+i))/3); i++) num = num.substring(0,num.length-(4*i+3))+','+ num.substring(num.length-(4*i+3)); return (((sign)?'':'-') + num); } function isNumberKey(evt) { var charCode = (evt.which) ? evt.which : event.keyCode if (charCode > 31 && (charCode < 48 || charCode > 57)) return false; return true; }
|
Please select the thickness of the block and enter the number of square meters of the wall needs to be built.Notes:
|