Samdan

Untitled

May 5th, 2018
376
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 37.12 KB | None | 0 0
  1. <!DOCTYPE html>
  2. <html class="no-js" lang="en">
  3.     <head>
  4.         <?php
  5.             $this->load->view('user/common_style');
  6.         ?>
  7.     </head>
  8.     <link id="bsdp-css" href="<?php echo base_url();?>assets/css/bootstrap-datepicker3.min.css" rel="stylesheet">
  9.         <style>
  10.         .project_area figure {
  11.             display: inherit !important; float:left
  12.         }
  13.        
  14.         .modal-dialog {
  15.             width: 300px;
  16.         }
  17.         .modal-content {
  18.             background: rgba(34, 49, 63, 0.9) url("../img/choose_us_area_bg.png") no-repeat scroll 0 0 / cover ;
  19.             border: 1px solid #22313f;
  20.             border-radius: 70px 0;
  21.             box-shadow: 5px 0 14px 1px rgba(0, 0, 0, 0.63) inset;
  22.         }
  23.         .modal-body {
  24.             color: #f5ab35;
  25.         }
  26.         .modal-header {
  27.             color: #fff;
  28.         }
  29.         .dynamic {
  30.             color: #fff;
  31.             font-weight: bold;
  32.         }
  33.         .close span {
  34.             color: #fff;
  35.         }
  36.         input[type="text"] {
  37.             background: rgba(255, 255, 255, 0.9) none repeat scroll 0 0;
  38.             border: 0 none;
  39.             border-radius: 100px;
  40.             color: #22313f;
  41.             font-weight: 600;
  42.             padding: 0 10px;
  43.         }
  44.         </style>
  45.     <style>
  46.         .input-group-addon {background:none !important;border:0px !important}
  47.         small.help-block, .has-error label {text-align: center;color: #EF3328;}
  48.         label.validation-error-label, #bal_error {color: #ef3328; font-size: 14px; font-weight: 100; padding-top: 4px; text-align: center !important;}
  49.  
  50.  
  51.     </style>
  52.     <body>
  53.            
  54.         <?php
  55.             $this->load->view('user/header');
  56.         ?>
  57.            
  58.         <?php
  59.             $this->load->view('user/login_header');
  60.             $currency_info = defaultcurrency();
  61.  
  62.  
  63.   /*  echo $url2="https://free.currencyconverterapi.com/api/v5/convert?q=USD_MNT&compact=y";
  64.  
  65.     $ch2 = curl_init();  
  66.     curl_setopt($ch2,CURLOPT_URL,$url2);
  67.     curl_setopt($ch2,CURLOPT_RETURNTRANSFER,true);
  68.     $output2=curl_exec($ch2);
  69.     curl_close($ch2);
  70.  
  71.     $discogsJSON2 = json_decode($output2);
  72.  
  73.     print_r($discogsJSON2);*/
  74.  
  75.  
  76.         ?>
  77.  
  78.         <?php if($user_make_deposit == 'on') { ?>
  79.        
  80.         <form method="post" class="make-deposit" action="<?php echo $action;?>">
  81.             <!-- <section class="dmain">
  82.                 <div class="container">
  83.                     <div class="col-lg-12">  
  84.                         <h2 class="section_hedings1"><?php echo $this->lang->line('lbl_our');?> <span><?php echo $this->lang->line('lbl_investment_plans');?></span></h2>
  85.                     </div>
  86.                 </div>
  87.             </section> -->
  88.      
  89. <!--             <section class="dmain makeadeposit">
  90.                 <div class="container">
  91.                    
  92.  
  93.                     <?php
  94.                         $i = 1;
  95.                         foreach ($packages as $package) {
  96.                             $max_rate = $this->packages_model->GetMaxrate($package->packageid);
  97.                         ?>
  98.  
  99.                         <?php if($i%4 == 0) { ?>
  100.                         <div class="row">
  101.                         <?php } ?>
  102.                        
  103.                             <div class="col-xs-12 col-sm-6 col-md-3 col-lg-3">
  104.                                
  105.                                 <div class="panel price panel-white gry1 <?php if($i=='1') { echo 'active';}?>">
  106.                                     <input type="hidden" name="packageid" value="<?php echo $package->packageid;?>">
  107.                                    
  108.                                     <div class="panel-heading arrow_box text-center">
  109.                                         <h3> <span><?php echo ucfirst($package->package_name);?></span></h3>
  110.                                     </div>
  111.                                     <div class="panel-body text-center">
  112.                                         <p class="lead" style="font-size:40px"><strong><?php echo $max_rate->rate;?>% / <br /><?php echo $package->periord_name;?></strong></p>
  113.                                     </div>
  114.                                     <ul class="list-group list-group-flush text-center">
  115.                                     <?php
  116.                                         $plans = $this->packages_model->GetPlans($package->packageid);
  117.                                         foreach ($plans as $plan) {
  118.                                     ?>
  119.                                             <li class="list-group-item"><i class="icon-ok text-success"></i><?php echo $currency_info->currency_symbol."".number_format($plan->min_amount, $currency_info->deimal_point, '.', '')." - ".$currency_info->currency_symbol."".number_format($plan->max_amount, $currency_info->deimal_point, '.', ''). " - ".$plan->rate." %";?></li>
  120.                                     <?php
  121.                                         }
  122.                                     ?>
  123.                                     </ul>
  124.                                     <div class="panel-footer">
  125.                                         <a href="#" data-id="<?php echo $package->packageid;?>" class="btn btn-lg btn-block accrodion_top_btn" data-toggle="modal" data-target="#calcModal"><?php echo strtoupper($this->lang->line('lbl_calculate'));?></a>
  126.                                     </div>
  127.                                     <?php if($i=='1') {?>
  128.                                         <input type="hidden" name="select_package" value="<?php echo $package->packageid;?>">
  129.                                     <?php } ?>
  130.                                  
  131.                                 </div>
  132.                                
  133.                             </div>
  134.  
  135.                         <?php if($i%4 == 0) { ?>
  136.                         </div>
  137.                         <?php } ?>
  138.  
  139.                     <?php
  140.                             $i++;
  141.                         }
  142.                     ?>
  143.  
  144.                     </div>
  145.                 </div>
  146.             </section> -->
  147.  
  148.             <div class="modal fade" id="calcModal" tabindex="-1" role="dialog" aria-labelledby="calcModalLabel" aria-hidden="true">
  149.                 <div class="modal-dialog" role="document">
  150.                     <div class="modal-content">
  151.                    
  152.                     </div>
  153.                 </div>
  154.             </div>
  155.  
  156.             <input type="hidden" name="select_package" value="1">
  157.             <section class="dmain  clearfix">
  158.                 <div class="container">
  159.                     <h2 class="section_hedings"><?php echo strtoupper($this->lang->line('lbl_deposit'));?><span> <?php echo strtoupper($this->lang->line('lbl_options'));?></span></h2>
  160.                
  161.                     <div class="makeadepositpymnt clearfix">
  162.                         <div class=" col-md-12 col-lg-3 ">
  163.                             <div class="mkdheading">
  164.                               <?php
  165.  
  166.  
  167.                                $condition="icoid = '1'";
  168.                                $coin = $this->common_model->GetRow('icoset',$condition);
  169.                          
  170.  
  171.             ?>
  172.                                 <!-- <span style="margin-top:20px;"><?php echo strtoupper($this->lang->line('lbl_value_per_token'));?> :</span> $<?php echo $coin->valuetoken; ?> -->
  173.                             </div>
  174.                         </div>
  175.                         <div class="col-md-12 col-lg-7 col-lg-offset-2">
  176.                             <div class="">
  177.                                
  178.                                 <div class="dorange" style="margin:0;">
  179.                                     <div class="col-md-6">
  180.                                         <h2><?php echo strtoupper($this->lang->line('lbl_select_currency'));?></h2>
  181.                                         <div class="nren">
  182.                                             <select class="form-control" name="payment" id="payment" style="width:100%;" onchange="currency_change(this.value);">
  183.                                                 <!--<option value='1'>USD</option>
  184.                                                 <option value='2'>BTC</option>
  185.                                                 <option value='3'>ETH</option>-->
  186.                                                 <option value="">select</option>
  187.                                                 <?php
  188.                                                  $currency_det=$this->db->query("select * from payment_currency where currency_status='1'");
  189.                                                  $currency_dat=$currency_det->result();
  190.                                                  foreach($currency_dat as $row)
  191.                                                  {
  192.                                                 ?>
  193.                                                 <option value="<?php echo $row->currency_id;?>"><?php echo strtoupper($row->currency_unit);?></option>
  194.                                                 <?php
  195.  
  196.                                                  }  
  197.                                                 ?>
  198.                                         </select>                  
  199.                                                    
  200.                                                
  201.                                             <div class="messageContainer"></div>
  202.                                         </div>
  203.                                     </div>
  204.  
  205.                                     <div class="col-md-6">
  206.                                         <h2><?php echo strtoupper($this->lang->line('lbl_payment_amount'));?></h2>
  207.                                         <div class="nren">
  208.                                             <div class="input-group">
  209.                                                     <input style="border-radius:100px;" id="deposit_ammount" name="amount" class="form-control" placeholder="0.00" value="" type="text">
  210.                                                 <span class="input-group-addon" id="cur_up"><?php echo strtoupper($currency_info->currency_unit);?></span>
  211.                                             </div>
  212.                                             <div class="messageContainer"></div>
  213.                                         </div>
  214.                                     </div>
  215.                                     <!--<div class="col-md-4" id="compound_rate">
  216.                                        
  217.                                     </div>-->
  218.                                 </div>
  219.                                 <div id="u_id">
  220.                                 <div class="dorange">
  221.                                     <h2><?php echo strtoupper($this->lang->line('lbl_select_payment'));?></h2>
  222.                                     <?php
  223.                                         $i = '1';
  224.                                         foreach ($payment_list as $payment)
  225.                                         {
  226.                                             if($payment->payment_id!='2' && $payment->payment_id!='20' && $payment->payment_id!='12' )
  227.                                             {
  228.                                     ?>
  229.                                             <img src="styles/img/<?php echo $payment->payment_name;?>.png"  alt="<?php echo $payment->payment_id;?>" class=""/>
  230.                                            
  231.                                     <?php
  232.                                             $i++;
  233.                                             }
  234.                                     }
  235.                                     ?>
  236.                                     <!-- <div class="messageContainer"></div> -->
  237.                                     </div>
  238.                                     <span id='pay_val'></span>
  239.                                 </div>
  240.  
  241.                                 <div id="b_id" style='display:none;'>
  242.                                 <div class="dorange">
  243.                                     <h2><?php echo strtoupper($this->lang->line('lbl_select_payment'));?></h2>
  244.                                     <?php
  245.                                         $i = '1';
  246.                                         foreach ($payment_list as $payment) {
  247.                                             if($payment->payment_id=='2')
  248.                                             {
  249.                                     ?>
  250.                                            
  251.                                             <img src="styles/img/<?php echo $payment->payment_name;?>.png"  alt="<?php echo $payment->payment_id;?>" class=""/>
  252.                                            
  253.                                     <?php
  254.                                         $i++;
  255.                                         }
  256.                                     }
  257.                                     ?>
  258.                                     <!-- <div class="messageContainer"></div> -->
  259.                                     </div>
  260.                                 </div>
  261.                                  <div id="m_id" style='display:none;'>
  262.                                 <div class="dorange">
  263.                                     <h2><?php echo strtoupper($this->lang->line('lbl_select_payment'));?></h2>
  264.                                     <?php
  265.                                         $i = '1';
  266.                                         foreach ($payment_list as $payment) {
  267.                                             if($payment->payment_id=='12')
  268.                                             {
  269.                                     ?>
  270.                                            
  271.                                             <img src="styles/img/<?php echo $payment->payment_name;?>.png"  alt="<?php echo $payment->payment_id;?>" class=""/>
  272.                                            
  273.                                     <?php
  274.                                         $i++;
  275.                                         }
  276.                                     }
  277.                                     ?>
  278.                                     <!-- <div class="messageContainer"></div> -->
  279.                                     </div>
  280.                                 </div>
  281.  
  282.                                 <div class="col-md-12">
  283.                                 <div id="e_id" style='display:none;'>
  284.                                 <div class="dorange">
  285.                                     <h2><?php echo strtoupper($this->lang->line('lbl_select_payment'));?></h2>
  286.                                     <?php
  287.                                         $i = '1';
  288.                                         foreach ($payment_list as $payment)
  289.                                         {
  290.                                             if($payment->payment_id=='20')
  291.                                             {
  292.  
  293.                                     ?>
  294.                                             <img src="styles/img/<?php echo $payment->payment_name;?>.png"  alt="<?php echo $payment->payment_id;?>" class=""/>
  295.                                            
  296.                                     <?php
  297.                                            $i++;
  298.                                         }
  299.                                     }
  300.                                     ?>
  301.                                     <!-- <div class="messageContainer"></div> -->
  302.                                     </div>
  303.                                 </div>
  304.                                 <input type="hidden" id="select_payment" name="select_payment" value=''>
  305.                                 <div class="dred">
  306.                                     <input type="hidden" id="uuser_raw_balance" name="user_bal" value="0.00" />
  307.                                     <h2><?php echo strtoupper($this->lang->line('lbl_you_have_selected'));?> : </h2>
  308.                                     <input type="text" style="background:none;font-size:19px;" name="pay_name" id="pay_name" value=''>
  309.                                  
  310.                                     <label id="bal_error"></label>
  311.                                     <button type="submit" style="width:60%;background:#F5AB35" id="submit" name="submit" ><?php echo strtoupper($this->lang->line('lbl_submit'));?></button>
  312.                                     </div>
  313.                                 </div>
  314.                                 <div>
  315.                                
  316.                             </div>
  317.                         </div>
  318.                     </div>
  319.                 </div>
  320.             </section>
  321.         </form>
  322.         <?php }  else { ?>
  323.  
  324.         <section class="dmain">
  325.             <div class="container">
  326.                 <div class="row section_padding_50">
  327.                     <div class="col-lg-12">
  328.                         <div class="gry clearfix">
  329.                             <div class="profilesub">
  330.                                 <h2><?php echo $this->lang->line('warning_msg_lbl'); ?></h2>
  331.                             </div>
  332.                             <div class="col-lg-6" >
  333.                                 <p style="color:white;" class="frgtpwd frgtpwd1 frgtpwdred"><i class="fa fa-thumbs-down"></i><?php echo $this->lang->line('makedeposit_option_disabled'); ?> !</p>
  334.                             </div>
  335.                         </div>
  336.                     </div>
  337.                 </div>
  338.             </div>
  339.         </section>
  340.  
  341.         <?php } ?>
  342.  
  343.         <div class="clearfix"></div>
  344.            
  345.             <?php
  346.                 $this->load->view('user/footer');
  347.             ?>
  348.        
  349.             <?php
  350.                 $this->load->view('user/common_script');
  351.             ?>
  352.             <!-- Bootsrap form validation JS files
  353.             <script type="text/javascript" src="<?php echo base_url();?>assets/js/formValidation.js"></script>
  354.             <script type="text/javascript" src="<?php echo base_url();?>assets/js/bootstrap.js"></script>-->
  355.  
  356.             <script type="text/javascript" src="<?php echo base_url();?>assets/js/plugins/forms/validation/validate.min.js"></script>
  357.             <script src="<?php echo base_url();?>assets/js/bootstrap-datepicker.min.js"></script>
  358.         <script type="text/javascript">
  359.  
  360.             jQuery.noConflict();
  361.             (function( $ ) {
  362.                 $(function() {
  363.                    
  364.                     $('#deposit_ammount').keyup(function() {
  365.                         $('#submit').removeAttr('disabled');
  366.                        
  367.  
  368.                     })
  369.                     $('#deposit_ammount').change(function() {
  370.                         $('#submit').removeAttr('disabled');
  371.                         var packageid = jQuery('[name="select_package"]').val();
  372.                        
  373.                         $.ajax({
  374.                             method : 'POST',
  375.                             url   : '<?php echo base_url();?>user/deposit/checkearnings',
  376.                             data : {'packageid':packageid,'amount':$('#deposit_ammount').val()},
  377.                             dataType: 'json',
  378.                             success : function(json)
  379.                             {
  380.                                
  381.                                 $('.mkdheading').html('<input type="hidden" value="'+json['totalcoinamnt']+'" name="tokenamt">')
  382.                             }
  383.                         })
  384.  
  385.                     })
  386.  
  387.                     $.validator.addMethod("price", function(value, element) {
  388.                       return this.optional(element) || /^[0-9.]+$/.test(value);
  389.                     }, "The deposit amount is invalid");
  390.  
  391.                     $(".make-deposit").validate({
  392.                         ignore: 'input[type=hidden]', // ignore hidden fields
  393.                         errorClass: 'validation-error-label',
  394.                         successClass: 'validation-valid-label',
  395.                         highlight: function(element, errorClass) {
  396.                             $(element).removeClass(errorClass);
  397.                             $(element).parent().addClass('has-error');
  398.                             $(element).parent().removeClass('has-success');
  399.                         },
  400.                         unhighlight: function(element, errorClass) {
  401.                             $(element).removeClass(errorClass);
  402.                             $(element).parent().addClass('has-success');
  403.                             $(element).parent().removeClass('has-error');
  404.                         },
  405.                         // Different components require proper error label placement
  406.                         errorPlacement: function(error, element) {
  407.  
  408.                             // Styled checkboxes, radios, bootstrap switch
  409.                             if (element.parents('div').hasClass("checker") || element.parents('div').hasClass("choice") || element.parent().hasClass('bootstrap-switch-container') ) {
  410.                                 if(element.parents('label').hasClass('checkbox-inline') || element.parents('label').hasClass('radio-inline')) {
  411.                                     error.appendTo( element.parent().parent().parent().parent() );
  412.                                 }
  413.                                  else {
  414.                                     error.appendTo( element.parent().parent().parent().parent().parent() );
  415.                                 }
  416.                             }
  417.  
  418.                             // Unstyled checkboxes, radios
  419.                             else if (element.parents('div').hasClass('checkbox') || element.parents('div').hasClass('radio')) {
  420.                                 error.appendTo( element.parent().parent().parent() );
  421.                             }
  422.  
  423.                             // Input with icons and Select2
  424.                             else if (element.parents('div').hasClass('has-feedback') || element.hasClass('select2-hidden-accessible')) {
  425.                                 error.appendTo( element.parent() );
  426.                             }
  427.  
  428.                             // Inline checkboxes, radios
  429.                             else if (element.parents('label').hasClass('checkbox-inline') || element.parents('label').hasClass('radio-inline')) {
  430.                                 error.appendTo( element.parent().parent() );
  431.                             }
  432.  
  433.                             // Input group, styled file input
  434.                             else if (element.parent().hasClass('uploader') || element.parents().hasClass('input-group')) {
  435.                                 error.appendTo( element.parent().parent() );
  436.                             }
  437.  
  438.                             else {
  439.                                 error.insertAfter(element);
  440.                             }
  441.                         },
  442.                         validClass: "validation-valid-label",
  443.                         success: function(label) {
  444.                             label.parent().addClass('has-success');
  445.                             // label.addClass("validation-valid-label").text("Success")
  446.                         },
  447.                         rules: {
  448.  
  449.                             payment: {
  450.                                 required: true,
  451.                             },
  452.                             amount: {
  453.                                 required: true,
  454.                                 price: true
  455.                                
  456.                             },
  457.                             compound_rate: {
  458.                                 required: true,
  459.                             },
  460.                             pay_name:{
  461.                                 required:true,
  462.                             }
  463.                         },
  464.                         messages: {
  465.                             payment: {
  466.                                  required: "Please Select currency",
  467.                             },
  468.                             amount: {
  469.                                 required: "<?php echo strtoupper($this->lang->line('lbl_deposit_amount_required'));?>",
  470.                                 price: "<?php echo strtoupper($this->lang->line('lbl_deposit_amtount_invalid'));?>",
  471.                                 remote: "<?php echo strtoupper($this->lang->line('lbl_deposit_amount_must'));?>"
  472.                             },
  473.                             compound_rate: {
  474.                                 required: "<?php echo strtoupper($this->lang->line('lbl_compound_rate_required'));?>",
  475.                             },
  476.                             pay_name: {
  477.                                 required: "Please Select Payment",
  478.                             }
  479.                         }
  480.                        
  481.                        
  482.                     });
  483.                     $("#owl-example").owlCarousel({
  484.                         nav:true,
  485.                         items : 8,
  486.                         itemsCustom : false,
  487.                         itemsDesktop : [1199,8],
  488.                         itemsDesktopSmall : [980,5],
  489.                         itemsTablet: [768,5],
  490.                         itemsTabletSmall: [768,4],
  491.                         itemsMobile : [479,2],
  492.                         singleItem : false,
  493.                         itemsScaleUp : true,
  494.                         navigation : true,
  495.                         navigationText : ["",""],
  496.                         rewindNav : true,
  497.                         scrollPerPage : false,
  498.                     });
  499.                 });
  500.  
  501.                 $(".makeadeposit .gry1 ").click(function () {
  502.                     var isActive = ($(this).hasClass('active')) ? true : false;
  503.                     // console.log("isActive: " + isActive);
  504.                    
  505.                     if (!isActive) {
  506.                         $('.makeadeposit .gry1 ').removeClass('active');
  507.                         $('.makeadeposit').find('[name="select_package"]').remove();
  508.                         var packageid = $(this).children('[name="packageid"]').val();
  509.  
  510.                         $.ajax({
  511.                             type: 'post',
  512.                             dataType: 'json',
  513.                             url:'<?php echo base_url();?>user/deposit/checkpackage/'+packageid,
  514.                             success : function(resp)
  515.                             {
  516.                                 $('#compound_rate').html(resp['compound']);
  517.                                 if(resp['reinvest']) {
  518.                                     $('.reinvet_status').show();
  519.                                 } else {
  520.                                     $('.reinvet_status').hide();
  521.                                 }
  522.                             }
  523.                         });
  524.  
  525.                        
  526.                        
  527.                         $(this).addClass('active');
  528.                         $('.makeadeposit').find('.active .panel-footer').after('<input type="hidden" name="select_package" value="'+packageid+'">');
  529.                         if($('[name="amount"]').val()){
  530.                             // checkvalidamt();
  531.                             var amount = $('#deposit_ammount').val();
  532.                             $.ajax({
  533.                                 type: 'post',
  534.                                 url : '<?php echo base_url();?>user/deposit/validamount',
  535.                                 data : {'packageid':packageid,'amount':amount},
  536.                                 dataType: 'json',
  537.                                 success : function(json)
  538.                                 {
  539.                                     // var json = JSON.parse(json);
  540.                                     console.log(json['valid']);
  541.                                     if(json['valid']) {
  542.                                         $('#deposit_ammount').parent().removeClass('has-error');
  543.                                         $('#deposit_ammount').parent().addClass('has-success');
  544.                                         $('#deposit_ammount-error').html('');
  545.                                         $('#submit').removeAttr('disabled');
  546.                                         return true;
  547.                                     } else {
  548.                                         $('#deposit_ammount').parent().removeClass('has-success');
  549.                                         $('#deposit_ammount').parent().addClass('has-error');
  550.                                         $('#deposit_ammount-error').html('This amount must be above selected plan amount');
  551.                                         $('#deposit_ammount').attr('aria-required','true');
  552.                                         $('#deposit_ammount').attr('aria-invalid','true');
  553.                                         $('#submit').attr('disabled','disabled');
  554.                                         return false;
  555.                                     }
  556.                                 }
  557.                             });
  558.  
  559.                            
  560.                         }
  561.                     }
  562.                 });
  563.                 if($('.select_payment').val()){
  564.                     // var payment_id = $('.select_payment').val();
  565.                     // var user_id = '3';
  566.                     $.ajax({
  567.                         type: 'post',
  568.                         url : '<?php echo base_url();?>user/deposit/checkbalance',
  569.                         // data : {'user_id':user_id,'payment_id':payment_id},
  570.                         // data : {'user_id':user_id},
  571.                         dataType: 'json',
  572.                         success : function(resp)
  573.                         {
  574.                             if(resp['success']) {
  575.                                 $('#pay_name').html(resp['payment']);
  576.                                 $('#user_balance').html(resp['balance']);
  577.                                 $('#uuser_raw_balance').val(resp['raw_balance']);
  578.                                
  579.                             } else {
  580.                                 $('#pay_name').html(resp['payment']);
  581.                                 $('#user_balance').html(resp['balance']);
  582.                                 $('#uuser_raw_balance').val(resp['raw_balance']);
  583.                                
  584.                             }
  585.                         }
  586.                     });
  587.                 }
  588.  
  589.  
  590.  
  591.                 $(".dorange img").click(function () {
  592.                     var isActive = ($(this).hasClass('active')) ? true : false;
  593.  
  594.  
  595.                     // console.log("isActive: " + isActive);
  596.                    
  597.                     if (!isActive) {
  598.                         $('.dorange img').removeClass('active');
  599.                         $(this).addClass('active');
  600.                         var payment_id = $(this).attr('alt');
  601.                         var payname = $(this).attr('src');
  602.                         var res = payname.replace("styles/img/","");
  603.                         var res = res.replace(".png","");
  604.                         var res = res.replace(".jpg","");
  605.                         $('#pay_name').val(res);
  606.                         $('#select_payment').val(payment_id);
  607.                         // var user_id = '3';
  608.                         $('.select_payment').val(payment_id);
  609.                        
  610.                     }
  611.                 });
  612.  
  613.                 $(".reinvest").click(function(){
  614.                     if($(".reinvest").is(':checked')) {
  615.                         checkreinvest();
  616.  
  617.                     } else {
  618.                         console.log('unchecked');
  619.                     }
  620.                 })
  621.  
  622.                
  623.  
  624.                
  625.                 $('#calcModal').on('show.bs.modal', function (event) {
  626.                     var button = $(event.relatedTarget)
  627.                     var id = button.data('id')
  628.                     var modal = $(this)
  629.                    
  630.                     if(id) {
  631.                         $.ajax({
  632.                             'method': 'POST',
  633.                             'url': '<?php echo base_url();?>user/user/viewcalc/'+id,
  634.                             success:function(resp) {
  635.                                 modal.find('.modal-body input').val(id)
  636.                                 modal.find('.modal-content').html(resp)
  637.                                 modal.find('#to-date').datepicker({startDate: '-0d', autoclose: 'true'}).on('change', function(e) {
  638.                                     CalculatorFunc();
  639.                                 })
  640.                                 modal.find('#amount').on('change', function(e){
  641.                                     CalculatorFunc();
  642.                                 })
  643.                             }
  644.                         })
  645.                     }
  646.                 })
  647.  
  648.                 $('#amount').on('change', function(e){
  649.                     CalculatorFunc();
  650.                 })
  651.  
  652.                 $('.calcbutton').on('click', function(e){
  653.                     CalculatorFunc();
  654.                 })
  655.                    
  656.                
  657.  
  658.             })(jQuery);
  659.  
  660.             function checkreinvest() {
  661.                 if(jQuery(".reinvest").is(':checked')) {
  662.                     var payment_id = jQuery('.select_payment').val();
  663.                     var user_id = '3';
  664.                     var amount = jQuery('#deposit_ammount').val();
  665.                     var balance = jQuery('#uuser_raw_balance').val();
  666.                     if(parseFloat(amount) > parseFloat(balance)) {
  667.                         jQuery(".reinvest").removeAttr('checked');
  668.                         jQuery('#bal_error').html('Insufficent Balance you can pay through online gateway');
  669.                         console.log('insufficentbalance');
  670.                        
  671.                     } else {
  672.                         jQuery('#bal_error').html('');
  673.                     }
  674.                 } else {
  675.                     jQuery('#bal_error').html('');
  676.                     console.log('unchecked');
  677.                 }
  678.             }
  679.  
  680.            
  681.                
  682.             function currency_change(str)
  683.             {
  684.                 var cr="USD";
  685.                 if(str=='2')
  686.                     cr="BTC";
  687.                 else if(str=='3')
  688.                     cr="ETH";
  689.                  else if(str=='4')
  690.                     cr="MNT";
  691.  
  692.                 if(str=='1')
  693.                 {
  694.                     document.getElementById("u_id").style.display='block';
  695.                     document.getElementById("b_id").style.display='none';
  696.                     document.getElementById("e_id").style.display='none';
  697.                     document.getElementById("m_id").style.display='none';
  698.                    
  699.  
  700.                 }
  701.  
  702.                 if(str=='2')
  703.                 {
  704.                     document.getElementById("u_id").style.display='none';
  705.                     document.getElementById("b_id").style.display='block';
  706.                     document.getElementById("e_id").style.display='none';
  707.                     document.getElementById("m_id").style.display='none';
  708.                    
  709.                 }
  710.  
  711.                 if(str=='3')
  712.                 {
  713.                     document.getElementById("u_id").style.display='none';
  714.                     document.getElementById("b_id").style.display='none';
  715.                     document.getElementById("e_id").style.display='block';
  716.                     document.getElementById("m_id").style.display='none';
  717.                    
  718.                 }  
  719.                 if(str=='4')
  720.                 {
  721.                     document.getElementById("u_id").style.display='none';
  722.                     document.getElementById("b_id").style.display='none';
  723.                     document.getElementById("e_id").style.display='none';
  724.                     document.getElementById("m_id").style.display='block';
  725.                    
  726.                 }  
  727.                 document.getElementById("cur_up").innerHTML=cr;
  728.                 document.getElementById("pay_name").value="";
  729.                 document.getElementById("select_payment").value="";
  730.                
  731.  
  732.             }
  733.    
  734.         </script>
  735.        
  736.         <script type="text/javascript">
  737.        
  738.         function CalculatorFunc() {
  739.             var to_date = jQuery('#to-date').val();
  740.             var amount = jQuery('#amount').val();
  741.             if(jQuery('#compound').val()) {
  742.                 var compound = jQuery('#compound').val();
  743.             } else {
  744.                 var compound = '';
  745.             }
  746.            
  747.             if(to_date && amount) {
  748.                 jQuery.ajax({
  749.                     method: 'POST',
  750.                     dataType: 'json',
  751.                     // data: jQuery('#calc_form').serialize(),
  752.                     data: {'to_date':jQuery('#to-date').val(),'amount':jQuery('#amount').val(), 'packageid':jQuery('#packageid').val(),'compound':compound},
  753.                     url: '<?php echo base_url();?>user/user/calculator/',
  754.                     success:function(resp) {
  755.                         jQuery('#cal-resp').html(resp)
  756.                         jQuery('#days').html(resp['total_days'])
  757.                         jQuery('#percent').html(resp['percent'])
  758.                         jQuery('#profit').html(resp['profit'])
  759.                         jQuery('#deposit_amt').html(resp['amount'])
  760.                     }
  761.                 })
  762.             } else {
  763.                 jQuery('#cal-resp').html("<?php echo $this->lang->line('lbl_calc_error');?>");
  764.             }
  765.         }
  766.         // jQuery('#to-date').datepicker();
  767.         </script>
  768.        
  769.        
  770.        
  771.     </body>
  772. </html>
Advertisement
Add Comment
Please, Sign In to add comment