<!doctype html>
<html lang="en">
<head>
<?php 
$validation =  \Config\Services::validation();
use App\Libraries\MyEncrypt;

$this->db = db_connect();
 $session= \Config\Services::session();
echo view('user/common_style1');?>
</head>
<body>
<?php echo view('user/common_header');?>
 
<link rel="stylesheet" href="<?php echo base_url();?>styles/fonts/Socialico/stylesheet.css">
<link rel="stylesheet" href="<?php echo base_url();?>styles/css/set1.css">
<script src="<?php echo base_url();?>styles/js/modernizr.js"></script>
 <style>
  .contact_one .contact_left_content form input[type="text"]{border:0px;}
  .prfledit label, .prfledit label {
  padding-top: 10px;
}

.help-block {
    color: #eb5055;
    margin: 0em 0em 0em !important;
}
p.frgtpwd {

text-transform: none;
  }
  .profilesub ul li label{
  display: inline;
  color: #eb5055;
}
</style>
        

</head>
<body>
<?php 
 
  // $first_dat=$this->db->query("SELECT * FROM trader"); 
  // $coin_det=$first_dat->getResult();
  // $site_lang_data = $this->common_model->GetSiteSettings('site');
  $token_symbol =$site_lang_data[19]->site_value;
  $session= \Config\Services::session();
  $uusersid=SESSION('uusersid');
?>      

<?php if (isset($_SESSION['error_message'])):?>

  <div class="alert alert-danger alert-border-left alert-dismissible fade show" role="alert">
  <i class="mdi mdi-block-helper me-3 align-middle"></i><strong><?= $_SESSION['error_message']; ?></strong>
 
  <button type="Submit" class="btn-close" data-bs-dismiss="alert" aria-label="Close"></button>
  </div>
<?php endif;?>

  <?php if (isset($_SESSION['success_message'])): ?>
  <div class="alert alert-success alert-border-left alert-dismissible fade show" role="alert">
  <i class="mdi mdi-check-all me-2 align-middle"></i><strong><?= $_SESSION['success_message']; ?></strong>
  <button type="Submit'" class="btn-close" data-bs-dismiss="alert" aria-label="Close"></button>
  </div>
<?php endif;?>
   
<section class="trading-bg">
  <div class="container-fluid">
<?php echo view('user/dashboard_header');?><br/>
         <div class="inner-title pb-3">
                    <div class="row">
                    <div class="col-lg-6">
                    <h6 class="color-2"><img src="<?php echo base_url();?>/assets/images/tether.png" style="height: 30px; width: 30px;">&nbsp;&nbsp; Promotion List</h6>
                  </div>
                      <div class="col-lg-3" style="float: right;">
                        </div>
                         <div class="col-lg-3" style="float: right;">
              <button class="btn btn-success"><a href="<?php echo base_url('circle/promotion_add')?>" id="url" style="color: white;">Add Promotion</a></button>
            </div>
          </div>
                  </div>
                                   <?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 { }?>

      <div class="tab-content trading-mar" id="pills-tabContent">
        <div class="tab-pane fade show active" id="pills-home" role="tabpanel" aria-labelledby="pills-home-tab">
          <div class="trading-table">
            <div class="table-responsive">
            <table class="table-striped">
              <thead>
                <tr>                  
                  <td width="10%"><center>S.No</center></td>
                  <td width="10%"><center>Trader Name</center></td>
                  <!-- <td width="10%"><center>Strategy</center></td> -->
                  <td width="10%"><center>Title</center></td>
                  <td width="10%"><center>Description</center></td>
                  <td width="10%"><center>Status</center></td>
                  <td width="10%"><center>Action</center></td>            
                </tr>
            </thead>
            <tbody>

          <?php
  $trd1=$this->db->query("SELECT * FROM promotion WHERE uusersid='$uusersid'")->getResult();
                 $i = 0;
       if($trd1) { 
               foreach ($trd1 as $row1) 
                {  $i++;
                 ?>
               <?php
              
                  
       $trd=$this->db->query("SELECT * FROM trader WHERE id='".$row1->trader_id."'")->getRow();
        //print_r($trd1);
        // die();
                 
?>
            <tr>                
                <td><center><?php echo $i;?></center></td>
                <td><center><?php echo $trd->trade_mode?></center></td>
                <td><center><?php echo $row1->title ?></center></td>
                <td><center><?php echo $row1->description ?> </center></td>
                <td><center><?php echo $row1->status ? "Approved" : "Pending";?></center></td>
                <td><center>
  <a href="<?php echo base_url().'/promotion_edit/'.$row1->id;?>"><button type="button" style="border-radius:8px;background-color: #f3c356;color:white; margin-right:40px;">Edit</button></a>
  <a href="<?php echo base_url().'/promotion_delete/'.$row1->id;?>"><button type="button" role="tab" aria-controls="pills-home" aria-selected="true" style="border-radius: 15px;background-color: #f3c356;color:white; margin-left:-20px;">Delete</button></a>

 </center></td>
              </tr>
              <?php
               }
              }else{ ?>
                <td colspan="6" class="text-center"> No Copy Records Found</td>
            <?php  }
              ?>
            </tbody>
            </table>
          </div>
        </div>
      </div>
    </div>
  </div>
</section>


</body>

<script src="<?php echo base_url();?>styles/js/jquery-1.12.2.min.js"></script>
<script type="text/javascript" src="<?php echo base_url();?>assets/js/formValidation.js"></script>
<script type="text/javascript" src="<?php echo base_url();?>assets/js/bootstrap.js"></script>
<script src="<?php echo base_url();?>/assets/boots/js/select_min.js"></script>
<link rel="stylesheet" type="text/css" href="<?php echo base_url();?>/assets/boots/css/select2.css">

<?php
  echo view('user/footer1');
  echo view('user/common_script');
?> 
</html>

        
        