Advertisement
davidjmorin

Untitled

Dec 5th, 2019
137
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <html>
  2. <head>
  3. <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.0/css/bootstrap.min.css">
  4. <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
  5. <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.0/js/bootstrap.min.js"></script>
  6. </head>
  7. <body>
  8.  
  9. <input type="radio" id='smartphone' name="type" value="smartphone"> Smartphone
  10. <input type="radio" id='basic' name="type" value="basic"> Basic
  11. <input type="radio" id='connected' name="type" value="connected"> Connected
  12. <input type="radio" id='watch'name="type" value="watch" > Watch
  13.  
  14. <input id='dpMax' type="text" class="form-control formBlock" placeholder="DP Max..." required/>
  15.  
  16. <input id='cost' type="text" class="form-control formBlock"   placeholder="Cost..." required/>
  17.  
  18. <input id='fee' type="hidden" class="form-control formBlock"  placeholder="5% Fee... (DP Max x .05)" required/>
  19.  
  20. <input id='rqComm' type="hidden" class="form-control formBlock"  value="130"  placeholder="RQ Commisson..." required/>
  21. <br />
  22. Total GP: <span id="total_gp" style="color:red;font-weight:bold"></span>
  23.  
  24.  
  25.  
  26. </body>
  27.  
  28. <script>
  29.  
  30.  
  31.  
  32. $('input').keyup(function(){
  33. var dpMax  = Number($('#dpMax').val());  
  34. var cost = Number($('#cost').val());
  35. var fee  = Number($('#fee').val());
  36. var rqComm = Number($('#rqComm').val());
  37. var rqConnComm = 90;
  38. var rqBasicComm = 60;
  39. var rqWatchComm = 40;
  40.  
  41.     // Smartphones //
  42.  
  43. if ( $("#smartphone").is(':checked') == true ) {
  44.  
  45.     if ((dpMax * '.05')>=50){
  46.  
  47. $('#total_gp').html(dpMax - cost - '50.00' + rqComm);
  48.  
  49. }
  50.  
  51. else{
  52. $('#total_gp').html(dpMax - cost - (dpMax * '.05') + rqComm);
  53. }
  54.    }
  55.    
  56.    
  57.    // Connected //
  58.    
  59. else if ( $("#connected").is(':checked') == true ) {
  60.  
  61.     if ((dpMax * '.05')>=50){
  62.  
  63. $('#total_gp').html(dpMax - cost - '50.00' + rqConnComm);
  64.  
  65. }
  66.  
  67. else{
  68. $('#total_gp').html(dpMax - cost - (dpMax * '.05') + rqConnComm);
  69. }
  70.    }
  71.    
  72.    
  73.    
  74.    // Watches //
  75.    
  76.    
  77. else if ( $("#watch").is(':checked') == true ) {
  78.  
  79.     if ((dpMax * '.05')>=50){
  80.  
  81. $('#total_gp').html(dpMax - cost - '50.00' + rqWatchComm);
  82.  
  83. }
  84.  
  85. else{
  86. $('#total_gp').html(dpMax - cost - (dpMax * '.05') + rqWatchComm);
  87. }
  88.    }
  89.    
  90.    
  91.    
  92.    // basic //
  93.    
  94.    
  95. else if ( $("#basic").is(':checked') == true ) {
  96.  
  97.     if ((dpMax * '.05')>=50){
  98.  
  99. $('#total_gp').html(dpMax - cost - '50.00' + rqBasicComm);
  100.  
  101. }
  102.  
  103. else{
  104. $('#total_gp').html(dpMax - cost - (dpMax * '.05') + rqBasicComm);
  105. }
  106.    }
  107.    
  108.  
  109.  
  110.  
  111.  
  112. });
  113.  
  114. </script>
  115. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement