- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
- 27
- 28
- 29
- 30
- 31
- 32
- 33
- 34
- 35
- 36
- 37
- 38
- 39
- 40
- 41
- 42
- 43
- 44
- 45
- 46
- 47
- 48
- 49
- 50
- 51
- 52
- 53
- 54
- 55
- 56
- 57
- 58
- 59
- 60
- 61
- 62
- 63
- 64
- 65
- 66
- 67
- 68
- 69
- 70
- 71
- 72
- 73
- 74
function cashBonusCalculator(currentDepositValue, el) {
var $scope = el;
if (!currentDepositValue) {
currentDepositValue = 0;
}
var max_bonus_01 = $scope.find('[name="progr_step_01_max"]'),
max_bonus_02 = $scope.find('[name="progr_step_02_max"]'),
max_bonus_03 = $scope.find('[name="progr_step_03_max"]'),
bonus_start_01 = $scope.find('[name="progr_step_01_start"]'),
bonus_start_02 = $scope.find('[name="progr_step_02_start"]'),
bonus_start_03 = $scope.find('[name="progr_step_03_start"]'),
bonus_amount_01 = $scope.find('[name="progr_step_01_amount"]'),
bonus_amount_02 = $scope.find('[name="progr_step_02_amount"]'),
bonus_amount_03 = $scope.find('[name="progr_step_03_amount"]');
if (cash_bonuses_list[0]) {
max_bonus_01.text('max ' + cash_bonuses_list[0].maxbonus.toMonetaryString());
bonus_start_01.text(cash_bonuses_list[0].f.toMonetaryString());
bonus_amount_01.text(cash_bonuses_list[0].bonus + '%');
main_gift_conditions.text('x' + cash_bonuses_list[0].wager + ' ' + wagerType +'; ' + cash_bonuses_list[0].ttl + _('h'));
gift_progress.addClass('cash_gift_progress_level_01');
}
if (cash_bonuses_list[1]) {
max_bonus_02.text('max ' + cash_bonuses_list[1].maxbonus.toMonetaryString());
bonus_start_02.text(cash_bonuses_list[1].f.toMonetaryString());
bonus_amount_02.text(cash_bonuses_list[1].bonus + '%');
main_gift_conditions.text('x' + cash_bonuses_list[1].wager + ' ' + wagerType + '; ' + cash_bonuses_list[1].ttl + _('h'));
gift_progress.addClass('cash_gift_progress_level_02');
}
if (cash_bonuses_list[2]) {
max_bonus_03.text('max ' + cash_bonuses_list[2].maxbonus.toMonetaryString());
bonus_start_03.text(cash_bonuses_list[2].f.toMonetaryString());
bonus_amount_03.text(cash_bonuses_list[2].bonus + '%');
main_gift_conditions.text('x' + cash_bonuses_list[2].wager + ' ' + wagerType + '; ' + cash_bonuses_list[2].ttl + _('h'));
gift_progress.addClass('cash_gift_progress_level_03');
}
if (window.CASHBONUSES && window.CASHBONUSES.length > 0) {
var progressSteps = 3;
if (cash_bonuses_list[0]) {
progressSteps = 1;
}
if (cash_bonuses_list[1]) {
progressSteps = 2;
}
if (cash_bonuses_list[2]) {
progressSteps = 3;
}
if (cash_bonuses_list[0] && currentDepositValue <= cash_bonuses_list[0].t && currentDepositValue >= cash_bonuses_list[0].f) {
$scope.find('[name="cash_gift_progressbar"]').css({
width: (((main_progress_width / progressSteps) * ( (currentDepositValue - cash_bonuses_list[0].f) / (((cash_bonuses_list[0].t - cash_bonuses_list[0].f) / 100)) * 0.01))) + 'px'
});
main_gift_amount.text(cash_bonuses_list[0].c + ' ' + currentBonusSumm(cash_bonuses_list[0].bonus, cash_bonuses_list[0].maxbonus, fromCashDepositValue));
} else if (!cash_bonuses_list[1] && cash_bonuses_list[0] && currentDepositValue > cash_bonuses_list[0].t && currentDepositValue >= cash_bonuses_list[0].f){
$scope.find('[name="cash_gift_progressbar"]').css({
width: '100%'
});
main_gift_amount.text(cash_bonuses_list[0].c + ' ' + currentBonusSumm(cash_bonuses_list[0].bonus, cash_bonuses_list[0].maxbonus, fromCashDepositValue));
} else if (cash_bonuses_list[1] && currentDepositValue <= cash_bonuses_list[1].t && currentDepositValue >= cash_bonuses_list[1].f) {
$scope.find('[name="cash_gift_progressbar"]').css({
width: (((main_progress_width / progressSteps) * ( (currentDepositValue - cash_bonuses_list[1].f) / (((cash_bonuses_list[1].t - cash_bonuses_list[1].f) / 100)) * 0.01)) + (main_progress_width / progressSteps)) + 'px'
});
main_gift_amount.text(cash_bonuses_list[1].c + ' ' + currentBonusSumm(cash_bonuses_list[1].bonus, cash_bonuses_list[1].maxbonus, fromCashDepositValue));
} else if (!cash_bonuses_list[2] && cash_bonuses_list[1] && currentDepositValue > cash_bonuses_list[1].t && currentDepositValue >= cash_bonuses_list[1].f){
$scope.find('[name="cash_gift_progressbar"]').css({
width: '100%'
});
main_gift_amount.text(cash_bonuses_list[1].c + ' ' + currentBonusSumm(cash_bonuses_list[1].bonus, cash_bonuses_list[1].maxbonus, fromCashDepositValue));
} else if (cash_bonuses_list[2] && currentDepositValue <= cash_bonuses_list[2].maxbonus && currentDepositValue >= cash_bonuses_list[2].f){
$scope.find('[name="cash_gift_progressbar"]').css({
width: (((main_progress_width / progressSteps) * ( (currentDepositValue - cash_bonuses_list[2].f) / (((cash_bonuses_list[2].maxbonus - cash_bonuses_list[2].f) / 100)) * 0.01)) + ((main_progress_width / progressSteps) * 2)) + 'px'
});
tutov2013 01.10.2015 12:36 # +1