<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
  <head>

    <?php
      $this->load->view('user/common_style');
      $this->load->view('user/header');
    ?> 

</head>
  <body >
      <?php
        $this->load->view('user/login_header');
        $currency_info = defaultcurrency();
      ?>

     <div class="col-lg-9 col-md-9 col-sm-12 col-xs-12">
      
    <?php if($this->session->flashdata('success_message')) {?>
      <p class="frgtpwd frgtpwd1"><i class="fa fa-thumbs-up"></i><?php echo $this->session->flashdata('success_message');?></p>
      <?php } elseif ($this->session->flashdata('error_message')) { ?>
       <p class="frgtpwd frgtpwd1 frgtpwdred"><i class="fa fa-thumbs-down"></i><?php echo $this->session->flashdata('error_message');?></p>
      <?php } else { }?>
     <div class="table-list clearfix mb-20">

    <h4 class="other-title theme-color">Strategy List</h4>
    
    <div class="table-responsive  main-table">
       
       <table>
          <thead>
            <tr>
            
              <th><?php echo $this->lang->line('lbl_account_name');?></th>
              <th><?php echo $this->lang->line('lbl_Strategy');?></th>
              <th><?php echo $this->lang->line('lbl_Profit');?></th>
              <th><?php echo $this->lang->line('lbl_days');?></th>
               <th><?php echo $this->lang->line('lbl_investors');?></th>
              <th><?php echo $this->lang->line('lbl_invest');?></th>
            </tr>
          </thead>
          <tbody>
          <?php
                  $this->load->library('MyEncrypt');
                  $myencrypt = new MyEncrypt;
            
           $i=1;
  
        foreach ($trader as $key) {

                
                $query =$this->db->query("SELECT COUNT(`strategy_name`) as count  FROM `trade_history` WHERE `strategy_name`='$key->stratgy'")->result();

                //print_r($query);
                foreach ($query as $row) {
                 
                 
                

            ?>
                <tr>
                  
                  <td><?php echo $key->ac_name;?></td>
                  <td><?php echo $key->stratgy;?></td>
                  <td><?php echo $key->profit;?></td> 
                  <td><?php echo $key->duration;?></td>
                  <td><?php echo $row->count;?></td>                              
                  <td>
                     <?php

                        }
                         $id=$key->id;

                       ?>
                  <a class="btn_chat" href="<?php echo base_url().'user/trade/viewtrade/'.$myencrypt->encode($key->id);?>"></i>Invest</a>
                    
                  </td>

                </tr>

                <?php

                  }

          ?>
         
          </tbody>
        </table>

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

<?php
$this->load->view('user/footer');
$this->load->view('user/common_script');
  // $this->load->view('user/result_check');
?>
  </body>
</html>
