- 001
- 002
- 003
- 004
- 005
- 006
- 007
- 008
- 009
- 010
- 011
- 012
- 013
- 014
- 015
- 016
- 017
- 018
- 019
- 020
- 021
- 022
- 023
- 024
- 025
- 026
- 027
- 028
- 029
- 030
- 031
- 032
- 033
- 034
- 035
- 036
- 037
- 038
- 039
- 040
- 041
- 042
- 043
- 044
- 045
- 046
- 047
- 048
- 049
- 050
- 051
- 052
- 053
- 054
- 055
- 056
- 057
- 058
- 059
- 060
- 061
- 062
- 063
- 064
- 065
- 066
- 067
- 068
- 069
- 070
- 071
- 072
- 073
- 074
- 075
- 076
- 077
- 078
- 079
- 080
- 081
- 082
- 083
- 084
- 085
- 086
- 087
- 088
- 089
- 090
- 091
- 092
- 093
- 094
- 095
- 096
- 097
- 098
- 099
- 100
$(document).ready(function(){
$('.result_count').hide();
$('.contentLeft li').on('click',function(){
$('.contentLeft li input[type="radio"]').attr('checked',false);
$('li.activebutton input[type="radio"]').attr('checked',true);
});
$('.contentLeftValut li label').on('click',function(){
$('.contentLeftValut li').removeClass('act_li');
$(this).closest('li').addClass('act_li');
$('.contentLeftValut li input[type="radio"]').attr('checked',false);
$('li.act_li input[type="radio"]').attr('checked',true);
});
$('.calculBlock').change(function()
{
$('.error').html('');
var first_array = {"1":1,"2":2,"3":3,"4":4,"5":5,"6":7,"7":10,"8":12,"9":15,"10":17,"11":20,"12":22,"13":25,"14":27,"15":30,"16":32,"17":35,"18":40,"19":45,"20":50,"21":55,"22":60,"23":65,
"24":70,"25":75,"26":80,"27":85,"28":90,"29":95,"30":100}
var two_array = {"1":123.7,"2":154.3,"3":175.4,"4":199.3,"5":212.8,"6":278.3,"7":312.2,
"8":378.5,"9":439.4,"10":472.8,"11":532.8,"12":566.9,"13":621.6,"14":664.3,
"15":739.2,"16":775.1,"17":829.1,"18":929.0,"19":1008.8,"20":1159.3,"21":1260.9,"22":1361.0,"23":1462.7,
"24":1563.4,"25":1674.3,"26":1785.3,"27":1896.2,"28":2007.1,"29":2118.1,"30":2229.0}
var three_array = {"1":20.47,"2":23.66,"3":34.04,"4":37.3,"5":40.57,"6":41.14,"7":56.95,
"8":60.58,"9":66.07,"10":69.73,"11":75.17,"12":79.01,"13":86.63,"14":90.05,
"15":94.93,"16":102.47,"17":109.78,"18":117.89,"19":126.04,"20":134.21,"21":142.31,"22":150.45,"23":158.59,
"24":166.71,"25":238.12,"26":253.02,"27":267.92,"28":282.82,"29":297.72,"30":312.62}
var error = 0;
var ves = 0;
var result = 0;
var firstPlace = Math.ceil($('.firstPlace').val());
if (firstPlace == ""||$.isNumeric(firstPlace)){
$('.error').html('Введите точку отправки');
return;
}
else{
var lastPlace = Math.ceil($('.lastPlace').val());
if ((lastPlace == "" ) || ($.isNumeric(lastPlace))){
$('.error').html('Введите точку доставки');
return;
}
else{
var weight = Math.ceil($('.weight').val());
if ((weight=="" ) || (isNaN(weight))){
$('.error').html('Введите вес груза');
return;
}
else{
var length = Math.ceil($('.length').val());
if ((length=="" ) || (isNaN(length))){
$('.error').html('Введите длину груза');
return;
}
else{
var height = Math.ceil($('.height').val());
if ((height=="" ) || (isNaN(height))){
$('.error').html('Введите высоту груза');
return;
}
else{
var width = Math.ceil($('.width').val());
if ((width=="" ) || (isNaN(width))){
$('.error').html('Введите ширину груза');
return;
}
else{
var price = Math.ceil($('.price').val());
if ((price=="" ) || (isNaN(price))){
$('.error').html('Введите цену груза');
}
else{
var ob_ves = length*height*width/5000;
if(weight > Math.round(ob_ves)){
ves = weight;
}
else{ves = Math.round(ob_ves);
}
if( (($('#p_eks').is(':checked')) && ($('#usa').is(':checked'))) || ( ($('#g_eks').is(':checked')) && ($('#usa').is(':checked'))) ){
for (var i=1;i <= 30;i++){
if (ves <= first_array[i]){
result = two_array[i] + ves*4;
break;
}
}
}
if( (($('#p_eks').is(':checked')) && ($('#euro').is(':checked'))) || ( ($('#g_eks').is(':checked')) && ($('#euro').is(':checked'))) ){
for (var i=1;i <= 30;i++){
if (ves <= first_array[i]){
Ай, блять. Калькулятор.
Lure Of Chaos 14.10.2014 14:43 # 0
istem 14.10.2014 23:46 # +2