<?php
$router = service('router'); 
if($router->controllerName()!='user' && $router->controllerName()!='cms' && $router->controllerName()!='faq' && $router->controllerName()!='news' && $router->controllerName()!='contact')
{
  $flag='0';
}
else
{
 $flag='1';
}
  $uri = service('uri');
    $segments = $uri->getSegments();
// if($segments[0] == "dashboard"){
//   $hide = 1;
// }
use App\Helpers\site_helper;
$db = db_connect();
$this->db = db_connect();
$this->common_model = model('CommonModel');
$date_chk=$db->query("select * from currency_market order by date desc limit 1");
$date=$date_chk->getResult();
$dats=$date[0]->date;
$res=$db->query("select * from currency_market where date='$dats' order by rand() limit 10");
$coin_det=$res->getResult();
$session = session();
$userid = $session->get('uusersid');
if($userid){
  $url = base_url().'/user/dashboard';
}else{
  $url = base_url('/');
}
if($userid){
$trade_profit_query = $this->db->table('history')->selectSum('amount')->where('uusersid',$userid)->where('type','commission')->orderBy('historyid','DESC')->get()->getRow();
    $trade_profit = $trade_profit_query->amount;
    $circle_profit_query = $this->db->table('history')->selectSum('amount')->where('uusersid',$userid)->where('type','circle_profit')->orderBy('historyid','DESC')->get()->getRow();
    
    $circle_profit = $circle_profit_query->amount;
    
    $total_profit = $trade_profit + $circle_profit;

    if ($total_profit <= 0) {
      $total_profit = '0.00';
    }
  }
    $res1=$db->query("select * from adminsettings");
  $admin_sett=$res1->getRow();
  $confirm = $db->table('history')->where('uusersid',$userid)->where('type','activation')->where('status',1)->get()->getRow();
?>

<style type="text/css">
  .selects {
    text-transform: none;
    background: none;
    border: none;
    font-size: 800;
    font-weight: 800;
    font-size: 16px;
    color: #fff;
    background: transparent;
}

.navigations a {
  text-decoration: none;
}

.navigations ul {
  /*background: darkorange;*/
  list-style: none;
  margin: 0;
  padding-left: 0;
  margin-top: -10px
}

.navigations li {
  color: black;
  background: transparent;
  display: block;
  float: left;
  padding: 1rem;
  position: relative;
  text-decoration: none;
  transition-duration: 0.5s;
}
  
.navigations li a {
  color: black;
}

.navigations li:hover,
li:focus-within {
  cursor: pointer;
}

.navigations li:focus-within a {
  outline: none;
}

.navigations ul li ul {
  width: 170px !important;
  background: #fff;
  visibility: hidden;
  opacity: 0;
  min-width: 9rem;
  position: absolute;
  transition: all 0.5s ease;
  margin-top: 1rem;
  left: 0;
  display: none;
}

.navigations ul li:hover > ul,
ul li:focus-within > ul,
ul li ul:hover,
ul li ul:focus {
  visibility: visible;
  opacity: 1;
  display: block
}

.navigations ul li ul li {
  clear: both;
  width: 100%;
}
.sub_span
{
  font-size: 15px !important;
  font-weight: 900 !important;
}
.parsley-errors-list li
{
list-style: none;
text-align: start;
font-size: 13px;
color: red;
margin-left: -28px;
margin-bottom: 13px;
}
</style>
<?php
$this->db = db_connect();
$session= \Config\Services::session();
  $buy_bal=curbalance($session->get('uusersid'),$coinid);
?>
<header class="bg-primary form-head">
  <div class="container">
    <nav id="navbar_top" class="navbar navbar-expand-lg    navbar-togglable   navbar-light" aria-label="navbar">
      <div class="header-logo  wow fadeInUp  align-items-center " data-wow-delay="0.5s">

<?php 
      $logo_img = site_info('site_logo');
      if($logo_img) {
      ?>
      <a  href="<?php echo base_url();?>"  class="text-dark text-decoration-none"><img src="<?php echo base_url();?>/content/site/<?php echo site_info('site_logo');?>" alt="<?php echo site_info('site_logo');?>" class="img-fluid" style="max-width: 166px;"></a> 
      <?php } else { ?>
       <a href="<?php echo base_url();?>" class="text-dark text-decoration-none"> <img src="<?php echo base_url();?>/styles/new_style/images/logo.png" alt="logo" class="img-fluid"></a>
<?php
}
?>
        <button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#mainnavigation" aria-controls="mainnavigation" aria-expanded="false" aria-label="Toggle navigation"> <span class="navbar-toggler-icon"></span> </button>
      </div>
      <div class="collapse navbar-collapse   justify-content-end " id="mainnavigation">
        <ul class="navbar-nav  wow fadeInUp ">
   <li class="nav-item"><a class="nav-link" href="<?php echo $url;?>">Home</a></li>

<?php
if(session()->get('uusersid')=='')
{ ?>
<li class="nav-item"> <a class="nav-link" href="<?php echo base_url();?>/register"><?php echo lang('language_lang.menu_signup');?></a></li>
<li class="nav-item"><a class="nav-link" href="<?php echo base_url();?>/login"><?php echo lang('language_lang.menu_login');?></a></li>
</div></li>
<?php
}
else
{ 
if($flag!='0')
{ ?>
<li class="nav-item"><a class="nav-link" href="<?php echo base_url();?>/user/dashboard"><?php echo lang('language_lang.menu_dashboard');?></a></li>
<li class="nav-item"><a class="nav-link" href="<?php echo base_url('logout');?>"><?php echo lang('language_lang.menu_logout');?></a></li>
<?php }
else
{ 
$condition = "uusersid = '".session()->get('uusersid')."'";
$a = $this->common_model->GetRow('uusers',$condition);
?>
<li class="nav-item"> <a class="nav-link active" aria-current="page" href="<?php echo base_url();?>/user/dashboard">Trading Pair List
</a> </li>
<li class="nav-item"> <a class="nav-link  " href="<?php echo base_url();?>/apikeylist">API binding </a> </li>
<li class="nav-item"> <a class="nav-link " href="<?php echo base_url();?>/orders">Trading Records</a> </li>
<li class="nav-item"> <a class="nav-link" href="<?php echo base_url();?>/balance"> Billing Details </a> </li>
<div class="navigations">
<ul>
<li ><a style="color:white;font-size: 16px;font-weight: 800;" href="javascript:void(0)">Payments<i class="bi bi-chevron-double-down" style="margin-left: 2px;font-size: 12px;"></i></a>
<ul class="dropdown" style="font-weight: 900;line-height: 1px;">
<li style="font-weight: bold;">Methods:</li>
<li><a href="<?php echo base_url();?>/user/deposit">Deposit</a></li>
<li><a href="<?php echo base_url();?>/transfer">Transfer</a></li>
<li><a href="<?php echo base_url();?>/withdrawfund">Withdraw</a></li>

</ul>
</li>
</ul>
</div>

<div class="navigations">
<ul>

<li ><a style="color:white;font-size: 16px;font-weight: 800;" href="javascript:void(0)"><?php echo $a->fullname;?><i class="bi bi-chevron-double-down" style="margin-left: 2px;font-size: 12px;"></i></a>
<ul class="dropdown" style="font-weight: 900;line-height: 1px;">

<li><a href=""  data-bs-toggle="modal" data-bs-target="#Poolinvesment" data-bs-whatever="@fat">Pool Investment</a></li>

<li><a href="<?php echo base_url('UserSettings/pool_trade_list');?>">Deposit List</a></li>

<li><a href=""  data-bs-toggle="modal" data-bs-target="#ActivationModel" data-bs-whatever="@fat">Activation</a></li>
<!-- <li><a href=""  data-bs-toggle="modal" data-bs-target="#FuelModel" data-bs-whatever="@fat">Fuel</a></li> -->
<li><a href="<?php echo base_url();?>/settings">Settings</a></li>


<?php
 $session= \Config\Services::session();
 $uusersid=SESSION('uusersid');
 $chk=$this->db->query("SELECT * FROM trader_activation WHERE uusersid='$uusersid'")->getResult();
 
if($chk)
{
?>
<!--<li><a href="<?php echo base_url();?>/user/mycircle">MY Circle</a></li>-->

<?php
}
?>

<?php
 $session= \Config\Services::session();
 $uusersid=SESSION('uusersid');
 $jk =$this->db->query("SELECT * FROM trade_process WHERE uusersid='$uusersid' AND sync_strategy_status='1'")->getRow();
 // print_r($jk);
 // die();
if($jk) {
?>
 <li><a href="<?php echo base_url();?>/circle_promotion">Promotion</a></li> 
<?php
}
?>
<?php if($confirm) { ?>
<li><a href="<?php echo base_url();?>/myreferral">My Referral</a></li>
<?php } ?>

<li><a href="<?php echo base_url();?>/network">Network</a></li>
<li><a href="<?php echo base_url();?>/ordermessage">News</a></li>
<!-- <?php if(!$hide) { ?> -->
<li><a href="<?php echo base_url();?>/informations">System Info</a></li>
<li><a href="<?php echo base_url();?>/tickets">Tickets</a></li>
<!-- <?php  }  ?> -->
<li><a href="<?php echo base_url();?>/logout">Logout</a></li>

</ul>
</li>
</ul>
</div>
<?php }
?>  
<?php } ?>   

        </ul>
      </div>
    </nav>
  </div>
</header>

<!-- popup model 5 -->

<div class="modal fade" id="ActivationModel" tabindex="-1" aria-labelledby="exampleModalLabel" aria-hidden="true">
<div class="modal-dialog modal-lg">
<div class="modal-content" style="padding: 15px; width: 100%;">
<div class="modal-header">
 <h4 class="other-title theme-color"><img src="<?php echo base_url('assets/images/bot.png');?>" height="50" width="50" style="margin-top: -11px;" id="bot-act"></i>Activation</h4>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
</div>
<div class="modal-body">
<div class="row">
<br>
<div class="row">
<div class="col-lg-12">

<div class="col-lg-12">
  <div class="row">
<div class="col-lg-12"  style="text-align: center;">
  <?php
$this->db = db_connect();
$uusersid = $session->get('uusersid');
$condition = array (
        'uusersid' => $uusersid,
         'type' => 'activation'
      );
$get_status = $this->db->table('history')->where($condition)->get()->getRow();
$data = array('status' => 0);
if(time() > strtotime($get_status->date)){
    $this->db->table('history')->where('uusersid',$uusersid)->where('type','activation')->update($data);
}
if($get_status->status == 1){
  $content = "Bot is Activated";
}else{
  $content = "Active annual fee";
}
?>
<h4 class="other-title theme-color"><?php echo $content;?></h4>
<!-- <button class="btn btn-primary" id="annual_fee">Active annual fee</button> -->
</div>
<!-- <div class="col-lg-6">
<button class="btn btn-primary" id="annual_code">Active Code</button>
</div> -->
</div>
</div>


<div class="profilesub clearfix profilesub2">
<?php if($session->getFlashData('success_message')) 
{?>
<div class="row"><div class="col-lg-12 ">
<p class="frgtpwd frgtpwd1"><i class="fa fa-thumbs-up"></i><?php echo $session->getFlashData('success_message');?></p></div></div>
<?php } 
elseif ($session->getFlashData('error_message')) 
{ ?>
<div class="row"><div class="col-lg-12">  <p class="frgtpwd frgtpwd1 frgtpwdred"><i class="fa fa-thumbs-down"></i><?php echo $session->getFlashData('error_message');?></p></div></div>
<?php } 
else { }?>



<?php 
$coun=$this->db->query("SELECT * FROM  country");
$countries=$coun->getResult();
?>
<?php
$amt=$this->db->query("SELECT * FROM  adminsettings WHERE id=1 ")->getResult();
$amnt=$amt[0];
?>

<div class="col-lg-8 offset-lg-1">
<div class="pair-tab">
<div class="trading-tab">
<ul class="nav nav-pills " id="pills-tab" role="tablist">
<li class="nav-item col-lg-4" role="presentation">
</li>
<li class="col-lg-4" >
</li>
</ul>
</div>
</div>
</div> 

<div class="row" id="annual_fee_model">
<?php
if($get_status->status != 1) { ?>
<form id="bot_activate" class="steps-validation activation offset-lg-1" style="margin-left: 0px;margin-top: 33px" method="post" action="<?php echo base_url();?>/user/activation" >
 <input type="text" style="display: none;" value="<?php echo $amnt->activation_cost;?>" name="stratgy" class="form-control"readonly/> 
<div class="col-lg-12" style="text-align: center; word-spacing: 3px;">


<div class="col-lg-12">
<div class="row">
<span class="sub_span col-lg-3">
</span>
<span class="sub_span col-lg-3">Total : </span>
<span class="sub_span col-lg-3">
<?php echo $amnt->activation_cost;?> USDT
</span>
</div>
</div>


<div class="col-lg-12 mt-3">
<div class="row">
<span class="sub_span col-lg-3">
</span>
<span class="sub_span col-lg-3">Duration : </span>
<span class="sub_span col-lg-3"> 1 Year</span>
</div>
</div>

<div class="form-group has-feedback has-feedback-left agree mt-3">
<span style="padding-top:13px" class="">
<input name="agree" class="" type="checkbox" id="" required="" data/>
<label class="" for="agree">
<span class="sub_span"><a href="<?php echo base_url();?>/cms/terms"><?php echo lang('language_lang.lbl_agree_terms'); ?></a></span>
</label>
</span>
</div>
</div>


<div class="modal-footer" style="justify-content: center;">
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Close</button>
<button class="btn btn-primary" type="button" id="submit_activate" >CLICK TO PAY
</button>
</div>
</form>
<?php } else { ?>

  <div class="row">
<div class="col-lg-12"  style="text-align: center;">
<h4 class="other-title theme-color"><img src="<?php echo base_url('assets/images/bot.png');?>" height="50" width="50" style="margin-top: -11px;" id="bot-act">Your Bot will be expired on <span style="color: red;"><?php echo $get_status->date;?></span></h4>
<!-- <button class="btn btn-primary" id="annual_fee">Active annual fee</button> -->
</div>
</div>
<?php } ?>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>


<!-- popup model 6 -->

<div class="modal fade" id="Poolinvesment" tabindex="-1" aria-labelledby="exampleModalLabel" aria-hidden="true">
<div class="modal-dialog modal-lg">
<div class="modal-content" style="padding: 15px; width: 100%;">
<div class="modal-header">
 <h4 class="other-title theme-color">
  <img src="<?php echo base_url('assets/images/bot.png');?>" height="50" width="50" style="margin-top: -11px;" id="bot-act"/>Pool Trading Investment 
 </h4>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
</div>
<div class="modal-body" style="padding:10px !important;">
<?php
$this->db = db_connect();
$uusersid = $session->get('uusersid');
// $condition = array (
// 'uusersid' => $uusersid,
// 'type' => 'activation'
// );
// $get_status = $this->db->table('history')->where($condition)->get()->getRow();
// $data = array('status' => 0);
// if(time() > strtotime($get_status->date)){
//     $this->db->table('history')->where('uusersid',$uusersid)->where('type','activation')->update($data);
// }
 $invest_pool_pack = $this->db->table('package_settings')->where('status','on')->get()->getResult();
?>



<div class="row">
<div class="col-lg-12"> 
<p class="frgtpwd frgtpwd1 frgtpwdred" id="frgtpwdred" style="display: none;">
  <i class="fa fa-thumbs-down"></i> 
</p> 
<br>
<p class="frgtpwd frgtpwd1" id="frgtpwd1" style="display: none;">
<i class="fa fa-thumbs-up"></i>
 </p>
</div>
</div>

<div class="row offset-md-2 col-md-8" id="annual_fee_models">

<div class="col-lg-12">
  <div class="row">


  </div>
</div>
<form id="pool_invest_activate" class="steps-validation activation offset-lg-1" style="margin-left: 0px;margin-top: 33px" method="post" action="<?php echo base_url();?>/user/pool_invest"   novalidate data-parsley-validate>
 
<div class="col-lg-12 row" style="text-align: center; word-spacing: 3px;">


<div class="col-lg-12">
<div class=" text-center ">
<div class="form-block mb-3 position-relative">
<select class="form-select" id="pool_invest_pack" required name="pool_invest_pack" style="width: 100% !important;height:45px;" data-parsley-trigger="change" 
data-parsley-required-message="Please Select Package"
data-parsley-errors-container=".first_name_error" >
  <option value="">-- Select Package --</option>
  
  <?php if($invest_pool_pack){ foreach($invest_pool_pack as $pool_pack) { ?>

<option value="<?php echo $pool_pack->id; ?>"> <?php echo $pool_pack->package_name."  ( ".number_format($pool_pack->min_amt,2)." USDT  - ".number_format($pool_pack->max_amt,2)." USDT ) "; ?> </option>

  <?php } } ?>

</select>
</div>
</div>
<span class="first_name_error"></span>
</div>


<div class="col-lg-12">
<div class=" text-center ">
<div class="form-block mb-3 position-relative">
<input type="text" class="form-control" name="pool_invest_amount" id="pool_invest_amount" required value="" placeholder="Enter Amount ( USDT ) "  data-parsley-required-message="Please Enter Amount" data-parsley-type="digits" data-parsley-trigger="change"
data-parsley-errors-container=".phone_error" style="width: 100% !important;">
</div>
</div>
<span class="phone_error"></span>

<div class="col-lg-12">
<div class=" text-start mb-3">
<span id="error_dis" style="font-size:13px; color:red;"></span>
</div>
</div>
</div>

<?php
$buy_bal = curbalance($uusersid);
$balance = str_replace(",","", $buy_bal);

$check_tradepool_fee = $this->db->table('site_controls')->where('settings_name','pool_invest')->where('site_key', 'robot_fee')->get()->getRow();

$check_tradepool_fee_format = $this->db->table('site_controls')->where('settings_name','pool_invest')->where('site_key', 'robot_fee_format')->get()->getRow();

$invest_pool_pack_count = $this->db->table('history')->where('type','pool_invest')->where('uusersid', $uusersid)->get()->getNumRows();

if($check_tradepool_fee_format->site_value=='on')
{   

if($invest_pool_pack_count <= 0)
{
 $pack_amounts = $check_tradepool_fee->site_value;

 $pack_content = "Add  Robot Fee For Your First Pool Trade Investment";

}
else
{
 $pack_amounts = 0;
}

}
else
{
 $pack_amounts = $check_tradepool_fee->site_value;

  $pack_content = "Add  Robot Fee For Your Pool Trade Investment";
}

?>

<?php if($pack_amounts > 0) { ?>

<div class="col-lg-12 mb-1">
<div class=" text-center ">
<div class="form-block mb-3 position-relative text-start">
<sapn class="text-default sub_span" style="font-size: 10px!important;"> <span class="text-danger"> Notes : </span>  <?php echo $pack_content; ?> <span id="pool_invest_fee"> <?php echo $pack_amounts; ?> </span> USDT </sapn>
</div>
</div>
</div>

<?php } ?>

<div class="col-lg-12 mb-2">
<div class=" text-center ">
<div class="form-block mb-3 position-relative text-start">
<sapn class="text-default sub_span" style="font-size: 12px !important;color: black !important;"> <span class="text-primary"> <?php echo lang('language_lang.lbl_available_balance'); ?>  : <small id="balance_check" class="sub_span" style="color:black;"> <?php echo number_format($balance,2);?> </small> USDT </span> </sapn>
</div>
</div>
</div>
<!-- <div class="col-lg-12">
<span class="sub_span col-lg-6">Duration : </span>
<span class="sub_span col-lg-6"> 1 Year</span>
</div> -->


<div class="col-lg-12 mb-2">
<div class="text-start"> 
<input name="agree" class="" id="agree1" type="checkbox" data-parsley-required-message="Please Check Terms" required="" data/>
<label class="" for="agree">
<span class="sub_span"><a  href="<?php echo base_url();?>/cms/terms"><?php echo lang('language_lang.lbl_agree_terms'); ?></a></span>
</label>
</div>
</div>


</div>


<div class="mb-3"  style="justify-content: center;margin-top: 10px;">
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Close</button>
<button class="btn btn-primary" type="submit" id="pool_submit" >CLICK TO INVEST </button>
</div>

</form>

</div>
</div>
</div>
</div>
</div>

<div class="modal fade" id="FuelModel" tabindex="-1" aria-labelledby="exampleModalLabel" aria-hidden="true">
<div class="modal-dialog modal-lg">
<div class="modal-content" style="padding: 15px; width: 100%;">
<div class="modal-header">
 <h4 class="other-title theme-color"><i class="fab fa-bitcoin"></i> Deposit</h4>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
</div>
<div class="modal-body">
<div class="row">
<br>
<div class="row">
<div class="col-lg-12">

<div class="col-lg-12">
  <div class="row">
<div class="col-lg-12"  style="text-align: center;">
<h4 class="other-title theme-color"><i class="fab fa-bitcoin"></i> Deposit To Wallet</h4>
</div>
</div>
</div>


<div class="profilesub clearfix profilesub2">
<?php if($session->getFlashData('success_message')) 
{?>
<div class="row"><div class="col-lg-12 ">
<p class="frgtpwd frgtpwd1"><i class="fa fa-thumbs-up"></i><?php echo $session->getFlashData('success_message');?></p></div></div>
<?php } 
elseif ($session->getFlashData('error_message')) 
{ ?>
<div class="row"><div class="col-lg-12">  <p class="frgtpwd frgtpwd1 frgtpwdred"><i class="fa fa-thumbs-down"></i><?php echo $session->getFlashData('error_message');?></p></div></div>
<?php } 
else { }?>
<?php 
$coun=$this->db->query("SELECT * FROM  country");
$countries=$coun->getResult();
?>
<?php
$amt=$this->db->query("SELECT * FROM  adminsettings WHERE id=1 ")->getResult();
$amnt=$amt[0];
?>

<div class="col-lg-8 offset-lg-1">
<div class="pair-tab">
<div class="trading-tab">
<ul class="nav nav-pills " id="pills-tab" role="tablist">
<li class="nav-item col-lg-4" role="presentation">
</li>
<li class="col-lg-4" >
</li>
</ul>
</div>
</div>
</div> 
</div>

<div class="row" id="annual_fee_model">

<form class="steps-validation activation offset-lg-1" style="margin-left: 0px;margin-top: 33px" method="post" action="<?php echo base_url();?>/user/deposit">
<div class="col-lg-12" style="text-align: center; word-spacing: 3px;">


<div class="col-lg-12">
<div class="row">
<span class="sub_span col-lg-2">
</span>
<span class="sub_span col-lg-2" style="margin-top: 10px;">Total : </span>
<span class="sub_span col-lg-6">
<div class="form-block mb-6">
<input type="text" class="form-control" id="fuel" name="fuel" required="required" placeholder="Enter Amount in USDT"/>
</div> 
</span>
</div>
</div>


<div class="form-group has-feedback has-feedback-left agree mt-3">
<span style="padding-top:13px" class="">
<input name="agree" class="" type="checkbox" id="terms1" required="" data/>
<label class="" for="agree">
<span class="sub_span"><a href="<?php echo base_url();?>/cms/terms"><?php echo lang('language_lang.lbl_agree_terms'); ?></a></span>
</label>
</span>
</div>
</div>
</div>
</div>  
</div>
</div>
</div>

<div class="modal-footer" style="justify-content: center;">
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Close</button>
<button class="btn btn-primary" type="submit" id="submits" >CLICK TO PAY
</button>
<span id="err" style="text-align: center;"></span>
</form>
</div>

</div>
</div>
</div>
</div>

<script src="<?php echo base_url()?>/styles/new_style/js/notify.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/parsley.js/2.9.2/parsley.min.js" integrity="sha512-eyHL1atYNycXNXZMDndxrDhNAegH2BDWt1TmkXJPoGf1WLlNYt08CSjkqF5lnCRmdm3IrkHid8s2jOUY4NIZVQ==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>


<script type="text/javascript">
  

$(document).ready(function(){


$('#pool_invest_amount').on('change',function(){

var pool_amt  =  $(this).val();
var pool_pack  =  $('#pool_invest_pack').val();

  $.ajax({
  type: 'post',
  url : '<?php echo base_url();?>/UserSettings/check_pack',
  data : {'pool_pack':pool_pack,'pool_amt':pool_amt},
  dataType:'json',
  success : function(msg)
  {
      if(msg.valid==true)
      {
          $('#error_dis').html("");
          $(':input[type="submit"]').prop('disabled', false);
      }
      else
      {
          document.getElementById("pool_submit").disabled = true;
         $('#error_dis').html(msg.message);
      }
  }
  })

});


$("#pool_invest_activate").on("submit", function (e) {
e.preventDefault();


var pool_amt  =  $('#pool_invest_amount').val();
var pool_pack  =  $('#pool_invest_pack').val();
var agree = $('#agree1').val();

if(pool_amt > 0 && pool_pack > 0 && agree!="")
{
    $.ajax({
    type: 'post',
    url : '<?php echo base_url();?>/UserSettings/pool_trading_invest',
    data : $(this).serialize(),
    dataType:'json',
    success : function(msg)
    {

      if(msg.result=='ok')
      {

      $('#pool_invest_activate')[0].reset();
      $('#frgtpwdred').css('display','none');
      $('#frgtpwd1').css('display','block');
      $('#frgtpwd1').html(msg.message+'<a href="<?php echo base_url('UserSettings/pool_trade_list');?>">Check Transaction</a>');
      $('#balance_check').html(msg.balance);

      }
      if(msg.result=='notok')
      {

      $('#frgtpwd1').css('display','none');
      $('#frgtpwdred').css('display','block');
      $('#frgtpwdred').html(msg.message);

      }


    }
    });

}

});


$('#annual_code').on('click',function(){

$('#annual_fee_code').css('display','block');
$('#annual_fee_model').css('display','none');

})

$('#submit_activate').on('click',function(){
var balance = <?php echo str_replace(',', '', $buy_bal);?>;
var activation = <?php echo $amnt->activation_cost;?>;
if(balance < activation){
/*$.notify('Please recharge your asset above '+activation+' USDT to activate your bot', 'danger');
$('#err').html('Please recharge your asset above '+activation);*/

$('#err').html('Please recharge your asset above '+activation);

}else{
$('#err').html();
$('#bot_activate').submit();
}
});


$('#annual_fee').on('click',function(){

  $('#annual_fee_code').css('display','none');
  $('#annual_fee_model').css('display','block');

})

  })


$("#fuel").keypress(function (e) {
if (String.fromCharCode(e.keyCode).match(/[^0-9]/g)) return false;
});


</script>
