"Bootstrap Loan Calculator"
Bootstrap 3.1.0 Snippet by bydbest

<link href="//netdna.bootstrapcdn.com/bootstrap/3.1.0/css/bootstrap.min.css" rel="stylesheet" id="bootstrap-css"> <script src="//netdna.bootstrapcdn.com/bootstrap/3.1.0/js/bootstrap.min.js"></script> <script src="//code.jquery.com/jquery-1.11.1.min.js"></script> <!------ Include the above in your HEAD tag ----------> <div class="container"> <div class="price-box"> <div class="row"> <div class="col-sm-6"> <form class="form-horizontal form-pricing" role="form" action="https://www.paypal.com/cgi-bin/webscr" method="post" target="_top"> <input type="hidden" name="cmd" value="_xclick-subscriptions"> <input type="hidden" name="business" value="rstbiet@gmail.com"> <input type="hidden" name="lc" value="US"> <input type="hidden" name="invoice_id" value="1"> <input type="hidden" name="no_shipping" value="2"> <input type="hidden" name="rm" value="1"> <input type="hidden" name="return" value="http://way2enjoy.com/compress-jpeg"> <input type="hidden" name="cancel_return" value="http://way2enjoy.com/compress-jpeg"> <input type="hidden" name="currency_code" value="USD"> <input type="hidden" name="src" value="1"> <input type="hidden" name="custom" value="var1='.$emaills.'&var2=60000&var3=5&var4=1"> <input type="hidden" name="bn" value="PP-SubscriptionsBF:btn_subscribe_LG.gif:NonHosted"> <input type="hidden" name="notify_url" value="http://way2enjoy.com/modules/compress-jpeg/ipn.php"> <img alt="" border="0" src="https://www.paypalobjects.com/en_US/i/scr/pixel.gif" width="1" height="1"> <div class="price-slider"> <h4 class="great">Images</h4> <span>Minimum 5$ is required</span> <div class="col-sm-12"> <div id="slider_amirol"></div> </div> </div> <div class="price-slider"> <h4 class="great">Discount</h4> <span>Applied for bydbest@gmaiil.com</span> <input name="sliderVal" type="hidden" id="sliderVal" value='0' readonly="readonly" /> <input name="month" type="hidden" id="month" value='24month' readonly="readonly" /> <input name="term" type="hidden" id="term" value='yearly' readonly="readonly" /> </div> </div> <div class="col-sm-6"> <div class="price-form"> <div class="form-group"> <div class="row"> <div class="col-sm-6"> <label for="amount_amirol" class="control-label"><input type="checkbox" name="colorCheckbox" value="red">Monthly ($): </label> <span class="help-text">Amount that you need to pay</span> </div> <div class="col-sm-6"> <input type="hidden" id="amount_amirol" class="form-control"> <!-- <p class="price lead" id="total12"></p> --> <input class="price lead" name="totalprice12" type="text" id="total12" disabled="disabled" style="" /> </div> </div> </div> <div class="form-group"> <div class="row"> <div class="col-sm-6"> <label for="amount_amirol" class="control-label"><input type="checkbox" name="colorCheckbox" value="green">Annually ($): </label> <span class="help-text">Amount that you need to pay</span> </div> <div class="col-sm-6"> <input type="hidden" id="amount_amirol" class="form-control"> <!-- <p class="price lead" id="total"></p> --> <input class="price lead" name="totalprice" type="text" id="total" disabled="disabled" style="" /> </div> </div> </div> <div class="form-group"> <div class="row"> <div class="col-sm-6"> <label for="amount_amirol" class="control-label"><input type="checkbox" name="colorCheckbox" value="blue">One Time ($): </label> <span class="help-text">Amount that you need to pay</span> </div> <div class="col-sm-6"> <input type="hidden" id="amount_amirol" class="form-control"> <!-- <p class="price lead" id="total52"></p> --> <input class="price lead" name="totalprice52" type="text" id="total52" disabled="disabled" style="" /> </div> </div> </div> <div style="margin-top:30px"></div> <hr class="style"> <div class="form-group"> <div class="red col-sm-11"> <input type="hidden" name="a3" id="total129"> <input type="hidden" name="custom" id="datamonthly"> <input type="hidden" name="p3" value="1"> <input type="hidden" name="t3" value="M"> <button type="submit" class="btn btn-primary btn-lg btn-block">Pay with Paypal <span class="glyphicon glyphicon-chevron-right"></span> </button> </div> <div class="green col-sm-11"> <input type="hidden" name="a3" id="total9"> <input type="hidden" name="custom" id="datayearly"> <input type="hidden" name="p3" value="1"> <input type="hidden" name="t3" value="Y"> <button type="submit" class="btn btn-primary btn-lg btn-block">Pay with Paypal <span class="glyphicon glyphicon-chevron-right"></span></button> </div> <div class="blue col-sm-11"> <input type="hidden" name="a3" id="total529"> <input type="hidden" name="custom" id="dataonetime"> <input type="hidden" name="p3" value="3"> <input type="hidden" name="t3" value="Y"> <button type="submit" class="btn btn-primary btn-lg btn-block">Pay with Paypal <span class="glyphicon glyphicon-chevron-right"></span></button> </div> </div> <div class="form-group"> <div class="col-sm-12"> <img src="https://github.com/AmirolAhmad/Bootstrap-Calculator/blob/master/images/payment.png?raw=true" class="img-responsive payment" /> </div> </div> </div> </form> </div> <p class="text-center" style="padding-top:10px;font-size:12px;color:#2c3e50;font-style:italic;">Created by <a href="https://twitter.com/AmirolAhmad" target="_blank">AmirolAhmad</a></p> </div> </div> </div> <script src="https://code.jquery.com/ui/1.10.4/jquery-ui.min.js"></script> <script type="text/javascript"> $(document).ready(function(){ $('input[type="checkbox"]').click(function(){ var inputValue = $(this).attr("value"); $("." + inputValue).toggle(); }); }); </script>
body { padding-top: 60px; } .price-box { margin: 0 auto; background: #E9E9E9; border-radius: 10px; padding: 40px 15px; /*width: 500px;*/ } .ui-widget-content { border: 1px solid #bdc3c7; background: #e1e1e1; color: #222222; margin-top: 4px; } .ui-slider .ui-slider-handle { position: absolute; z-index: 2; width: 7.2em; height: 2.7em; cursor: default; margin: 0 -40px auto !important; text-align: center; line-height: 30px; color: #FFFFFF; font-size: 12px; } .ui-slider .ui-slider-handle .glyphicon { color: #FFFFFF; margin: 0 1px; font-size: 11px; opacity: 0.7; } .ui-corner-all { border-radius: 20px; } .ui-slider-horizontal .ui-slider-handle { top: -.9em; } .ui-state-default, .ui-widget-content .ui-state-default { border: 1px solid #f9f9f9; background: #3498db; } .ui-slider-horizontal .ui-slider-handle { margin-left: -0.5em; } .ui-slider .ui-slider-handle { cursor: pointer; } .ui-slider a, .ui-slider a:focus { cursor: pointer; outline: none; } .price, .lead p { font-weight: 600; font-size: 32px; display: inline-block; line-height: 60px; border:0; width: 245px; } h4.great { background: #00ac98; margin: 0 0 25px -60px; padding: 7px 15px; color: #ffffff; font-size: 18px; font-weight: 600; border-radius: 5px; display: inline-block; -moz-box-shadow: 2px 4px 5px 0 #ccc; -webkit-box-shadow: 2px 4px 5px 0 #ccc; box-shadow: 2px 4px 5px 0 #ccc; } .total { border-bottom: 1px solid #7f8c8d; /*display: inline; padding: 10px 5px;*/ position: relative; padding-bottom: 20px; } .total:before { content: ""; display: inline; position: absolute; left: 0; bottom: 5px; width: 100%; height: 3px; background: #7f8c8d; opacity: 0.5; } .price-slider { margin-bottom: 70px; } .price-slider span { font-weight: 200; display: inline-block; color: #7f8c8d; font-size: 13px; } .form-pricing { background: #ffffff; padding: 20px; border-radius: 4px; } .price-form { background: #ffffff; margin-bottom: 10px; padding: 20px; border: 1px solid #eeeeee; min-height: 520px; border-radius: 4px; /*-moz-box-shadow: 0 5px 5px 0 #ccc; -webkit-box-shadow: 0 5px 5px 0 #ccc; box-shadow: 0 5px 5px 0 #ccc;*/ } .form-group { margin-bottom: 0; } .form-group span.price { font-weight: 200; display: inline-block; color: #7f8c8d; font-size: 14px; } .help-text { display: block; margin-top: -10px; margin-bottom: 10px; color: #737373; /*position: absolute;*/ /*margin-left: 20px;*/ font-weight: 200; /*text-align: right;*/ width: 188px; } .price-form label { font-weight: 200; font-size: 21px; } img.payment { display: block; margin-left: auto; margin-right: auto } .ui-slider-range-min { background: #2980b9; } .active-month, .active-term { background: #3276b1; } /* HR */ .style { margin-top: 0; border: 0; border-bottom: 1px dashed #ccc; background: #999; } .col-sm-11 { display:none; }
// JavaScript Document var p = { 0: "1000", 1: "1500", 2: "2000", 3: "2500", 4: "3000", 5: "4000", 6: "5000", 7: "6000", 8: "7000", 9: "8000", 10: "9000", 11: "10K", 12: "12K", 13: "15K", 14: "20K", 15: "25K", 16: "30K", 17: "40K", 18: "50K", 19: "75K", 20: "100K", 21: "150K", 22: "200K", 23: "300K", 24: "400K", 25: "500K", 26: "800K", 27: "1M", 28: "2M", 29: "5M", }; var t = { 0: "1000", 1: "1500", 2: "2000", 3: "2500", 4: "3000", 5: "4000", 6: "5000", 7: "6000", 8: "7000", 9: "8000", 10: "9000", 11: "10000", 12: "12000", 13: "15000", 14: "20000", 15: "25000", 16: "30000", 17: "40000", 18: "50000", 19: "75000", 20: "100000", 21: "150000", 22: "200000", 23: "300000", 24: "400000", 25: "500000", 26: "800000", 27: "1000000", 28: "2000000", 29: "5000000", } var obj = { '24month' : { 'yearly' : '0.04', 'monthly' : '1.28', 'onetime' : '1.2' }, '18month' : { 'yearly' : '1.38', 'monthly' : '1.25', 'onetime' : '1.8' }, '12month' : { 'yearly' : '1.35', 'monthly' : '1.225', 'onetime' : '1.15' } }; $(document).ready(function() { $("#total").val("10000"); $("#slider_amirol").slider({ range: "min", animate: true, min: 0, max: 29, step: 1, slide: function(event, ui) { update(1,ui.value); //changed calcualtePrice(ui.value); } }); $('.month').on('click',function(event) { var id = $(this).attr('id'); $('.month').removeClass('selected-month'); $(this).addClass('selected-month'); $(".month").removeClass("active-month"); $(this).addClass("active-month"); $('#month').val(id); calcualtePrice() }); $('.term').on('click',function(event) { var id = $(this).attr('id'); $('.term').removeClass('selected-term'); $(this).addClass('selected-term'); $(".term").removeClass("active-term"); $(this).addClass("active-term"); $('#term').val(id); calcualtePrice() }); update(); calcualtePrice(); }); function update(slider,val) { if(undefined === val) val = 0; var amount = p[val]; $('#sliderVal').val(val); $('#slider_amirol a').html('<label><span class="glyphicon glyphicon-chevron-left"></span> '+amount+' <span class="glyphicon glyphicon-chevron-right"></span></label>'); } function calcualtePrice(val){ if(undefined === val) val = $('#sliderVal').val(); var month = $('#month').val(); var term = obj[month][$('#term').val()]; if(val <= 11) { term1=term; var totalPrice = t[val]*term1; var finalpricewithdiscountyearly=totalPrice*(1-0.6); //var finalpricewithdiscountmonthly=totalPrice*(1-0.5); //var finalpricewithdiscountonetime=totalPrice*(1-0.5); } else { term1=0.01; var prev=t[val]-10000; totalPrice = 10000*term+prev*term1; //var finalpricewithdiscountyearly=totalPrice*(1-0.93); var finalpricewithdiscountyearly=totalPrice*(1-0.6); //var finalpricewithdiscountmonthly=totalPrice*(1-0.83); //var finalpricewithdiscountonetime=totalPrice*(1-0.90); } //var finalpricewithdiscountyearly=totalPrice*(1-0.93); //var finalpricewithdiscountmonthly=totalPrice*(1-0.83); // var finalpricewithdiscountonetime=totalPrice*(1-0.90); // var totalPrice = t[val]*term1; // var totalPrice = term; $("#total").val(finalpricewithdiscountyearly.toFixed(1)); $("#total12").val(Math.round((finalpricewithdiscountyearly)*.12).toFixed(1)); $("#total52").val(Math.round((finalpricewithdiscountyearly)*.18).toFixed(1)); $("#total9").val(finalpricewithdiscountyearly.toFixed(1)); $("#total129").val(Math.round((finalpricewithdiscountyearly)*.12).toFixed(1)); $("#total529").val(Math.round((finalpricewithdiscountyearly)*.18).toFixed(1)); //next variable starts here var url=window.location.href; var arr = url.substring(url.lastIndexOf("?") + 1); $("#datamonthly").val("var1="+arr+"&var2="+t[val]+"&var3="+val+"&var4=1"); $("#datayearly").val("var1="+arr+"&var2="+t[val]+"&var3="+val+"&var4=2"); $("#dataonetime").val("var1="+arr+"&var2="+t[val]+"&var3="+val+"&var4=3"); // next variables ends here // $("#total12").val(Math.round((finalpricewithdiscountyearly)*(1-0.83)).toFixed(1)); // $("#total52").val(Math.round((finalpricewithdiscountyearly)*(1-0.90)).toFixed(1)); }

Related: See More


Questions / Comments: