Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <script>
- function changePrice(obj) {
- var attrValue = obj.value;
- var attrCheckbox = $("input[name=insurance]", ".jq-checkbox").attr("checked");
- if (attrValue == 'vk_community' && attrCheckbox == true) {price = <? echo $config_extra['default_price_vk_community_insurance']; ?>;}
- if (attrValue == 'vk_community' && attrCheckbox != true) {price = <? echo $user['price_adv_vk_community'] != '0' ? $user['price_adv_vk_community'] : $config_extra['default_price_vk_community']; ?>;}
- if (attrValue == 'vk_share') {price = <? echo $user['price_adv_vk_share'] != '0' ? $user['price_adv_vk_share'] : $config_extra['default_price_vk_share']; ?>;}
- if (attrValue == 'vk_like') {price = <? echo $user['price_adv_vk_like'] != '0' ? $user['price_adv_vk_like'] : $config_extra['default_price_vk_like']; ?>;}
- if (attrValue == 'vk_friends') {price = <? echo $user['price_adv_vk_friends'] != '0' ? $user['price_adv_vk_friends'] : $config_extra['default_price_vk_friends']; ?>;}
- console.log(obj, price);
- $("#budget").text( $("input[name=amount_users_limit]").attr("value") * price );
- $("#price").text( price );
- }
- $(document).ready(function(){
- $.Placeholder.init({ color : "#aaa" });
- changePrice($("input[name=type]:first-child", ".jq-radio")[0]);
- /* Клик по типу задания */
- $("input[name=type]", ".jq-radio").click(function() {
- changePrice(this);
- });
- /* Изменение количества заданий */
- $("input[name=amount_users_limit]").on('input', function() {
- changePrice($("input:radio:checked")[0]);
- });
- /* Клик по страховке */
- $("input[name=insurance]", ".jq-checkbox").click(function() {
- changePrice($("input:radio:checked")[0]);
- });
- });
- </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement