
<!doctype html>
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0">

<?php 
$validation =  \Config\Services::validation();
use App\Libraries\MyEncrypt;

$this->db = db_connect();
$session= \Config\Services::session();
$uusersid = $session->get('uusersid');
echo view('user/common_style1');?>
</head>
<body>
<?php echo view('user/common_header');

$trader=$this->db->query("SELECT strategy_id as trader_id FROM trade_process WHERE sync_strategy_status='1'AND uusersid='$uusersid' GROUP BY strategy_id ")->getResult();


$i=0;
foreach ($trader as $key => $value) {
   $trader_id[$i]=$value->trader_id;
   $i++; 

 } // print_r($trader);
// print_r($trader_id);
// die(); // die();
 $amp=implode(',',$trader_id);
  // print_r($amp);
 // die();
 $trader=$this->db->query("SELECT trade_mode,id from trader where id in($amp)")->getResult();
 // print_r($trader);
 // die();

?>


<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">
 <style>

  .has-error .help-block, .has-error .control-label, .has-error .radio, .has-error .checkbox, .has-error .radio-inline, .has-error .checkbox-inline, .has-error.radio label, .has-error.checkbox label, .has-error.radio-inline label, .has-error.checkbox-inline label {
    color: #D84315 !important;

/*.contact_one s.contact_left_content form input[type="text"]{border:0px;}
  .prfledit label, .prfledit label {
  padding-top: 10px;*/
}

img {
  border-radius: 60%;
}
.help-block {
    color: #eb5055;
   s margin: 0em 0em 0em !important;
}
p.frgtpwd {
text-transform: none;
}
.profilesub ul li label{
display: inline;
color: #eb5055;
}
.h6
{
  font-size: 17px;
}
.preca-bg {
    padding: 20px 10px 10px 20px;
}
.mont
{
    font-size: 15px;
}
.mont1
{
    font-size: 13px;
}
h6.mont1
{
    font-size: 12px;
}
 .err_msg{
    color: red;
  }
  .error {
    color: red;
    font-size: 1rem;
    display: block;
    margin-top: 5px;
}

input.error, textarea.error {
    border: 1px dashed red;
    font-weight: 500;
    color: red;
}
.error.fail-alert {
border: 2px solid red;
border-radius: 4px;
line-height: 1;
padding: 2px 0 6px 6px;
background: #ffe6eb;
}
li.error {
    color: red;
    font-size: 1rem;
    display: block;
    margin-top: 5px;
}
li.error.fail-alert {
border: 2px solid red;
border-radius: 4px;
line-height: 1;
padding: 2px 0 6px 6px;
background: #ffe6eb;
}


</style>

        

</head>
  <body>
      <?php
        $currency_info = defaultcurrency();

    $session= \Config\Services::session();
 $uusersid=SESSION('uusersid');
      ?>

 <?php
  $this->form_validation =  \Config\Services::validation();
 $list = \Config\Services::validation()->listErrors();
    if($list)
    {
   ?>
 <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><?= $list; ?></strong>
  <input type="Submit" class="btn-close" data-bs-dismiss="alert" aria-label="Close">
  </div>
  <?
    }
?> 
  <?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>
 
  <input type="Submit" class="btn-close" data-bs-dismiss="alert" aria-label="Close">
  </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>
  <input type="Submit" class="btn-close" data-bs-dismiss="alert" aria-label="Close">
  </div>
<?php endif;?>


<section class="trading-bg">
  <div class="container-fluid">
    
    <div class="row">
      <div class="">
        <div class="trading_pairbg bg-white inner-box mt-3 px-3 py-4">
          <div class="inner-title pb-3">
      <center><h4>Circle Promotion</h4></center>
<br>

 
<!-- <div class="container col-lg-8" style="border:3px solid ; ">
 -->        <!-- <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"  style="padding-top:40px;font-size: 15px;">
                <li class="nav-item col-lg-6" role="presentation">
                  <h6 class="mont"><b><?php echo "Strategy Name :";?></b></h6>
                </li>
                <li class="col-lg-6">
                  <span><?php echo $trade->stratgy?></span>
                </li>
              </ul>
            </div>
          </div>
        </div> -->
        <br>
        <br>
<form class="create-user TransactionModel" id="TransactionModel" method="post" action="<?php echo base_url();?>/circle/promotion_add" enctype="multipart/form-data">

            <input type="hidden" name="id" value="<?php echo $id;?>">

<!--  -->



<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" style="font-size: 15px;">
                <li class="nav-item col-lg-6" role="presentation">
                  <h6 class="mont"><b>Trader Name</b></h6>
                </li>
                <li class="nav-item col-lg-6" role="presentation">
               <select name="trade_name" class="form-control">
                <option value=""><?php echo "---Select trade name---"?>
  </option>
                   <?php

                foreach ($trader as $keys) 
                {
                
  
  ?>

 <option value="<?php echo $keys->id;?>" <?php if($qry->trader_id == $keys->id) echo "selected";?>><?php echo $keys->trade_mode;?></option>
 
                <?php
                }
              

                ?>

                
          
                </select>
                 
                </li>
               
                
              </ul>
              

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

    
        <br>
       
        
<br>

        <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" style="font-size: 15px;">
                <li class="nav-item col-lg-6" role="presentation">
                  <h6 class="mont"><b>Promotion Title</b></h6>
                </li>
                <li class="col-lg-6">
                  <input name="title" class="form-control"   id="title"
                  value="<?php echo $qry->title ? $qry->title : '';?>" >
                </li>
              </ul>
              
            </div>
          </div>
        </div>
      
        <br>
        <br>
        
         <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" style="font-size: 15px;">
                <li class="nav-item col-lg-6" role="presentation">
                  <h6 class="mont"><b>Promotion Description</b></h6>
                </li>
                <li class="col-lg-6">
                  <textarea name="description" class="form-control"   id="description"
                  value="<?php echo $qry->description ? $qry->description : '';?>"><?php echo $qry->description ? $qry->description : '';?></textarea>
                 

                </li>
                 

              </ul>

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

        <br>

       
      <br>
<br>
 





      <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" style="font-size: 15px;">
                <li class="nav-item col-lg-6" role="presentation">
                  <h6 class="mont"><b>Attachment 1</b></h6>
                </li>
                <li class="col-lg-6">
                <input type="file"  name="profile" class="form-control" id="profile"
                  value= "<?php echo $qry->profile;?>">
                </li>
              </ul>
              <div class="form-block mb-3">
                      <?php if($qry->profile) { ?>
                      <img src="<?php echo base_url();?>/public/uploads/promotion/<?php echo $qry->profile;?>" width="100" height="100" >
                    <?php } else {  ?>
                    
                    <?php }  ?>
                    </div>
            </div>
          </div>
        </div>
         
              

       
      <br>
      <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" style="font-size: 15px;">
                <li class="nav-item col-lg-6" role="presentation">
                  <h6 class="mont"><b>Attachment 2</b></h6>
                </li>
                <li class="col-lg-6">
                <input type="file"  name="profile1" class="form-control" id="profile1"
                  value="<?php echo $qry->profile1?>">
                  
                </li>
              </ul>
            </div>
             <div class="form-block mb-3">
                      <?php if($qry->profile1) { ?>
                      <img src="<?php echo base_url();?>/public/uploads/trader/<?php echo $qry->profile1;?>" width="100" height="100" >
                    <?php } else {  ?>
                     
                    <?php }  ?>
                    </div>
          </div>
        </div>
      

      <br>

      <!-- </div> -->


         <br>   


 

      <center>
       
          <!--       <button class="btn btn-primary" type="button" role="tab"  data-bs-toggle="modal" data-bs-target="#exampleModal1" data-bs-whatever="@fat" style="margin-top:30px;"><a style="color:white;">Sync Strategy</a> -->

                   
                   <input type="submit" class="btn btn-primary w-md" value="Submit" >

    
      </center>
    </form>

       </div> 
    </div>

  </div>
    </div>
  </div>
</div>
</section>
<br>

</body>
 


<?php
  echo view('user/footer1');
  echo view('user/common_script');
?> 
 <script src="<?php echo base_url();?>/assets/libs/@ckeditor/ckeditor5-build-classic/build/ckeditor.js"></script>
<!-- init js -->
<script src="<?php echo base_url();?>/assets/js/app.js"></script>
<script src="<?php echo base_url();?>/https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
<script src="<?php echo base_url();?>/assets/js/formValidation.js"></script>
<script src="<?php echo base_url();?>/assets/js/bootstrap.js"></script>
<script src="<?php echo base_url();?>/assets/js/jgrowl.min.js"></script>
<script src="<?php echo base_url();?>/assets/js/form/selects/bootstrap_select.min.js"></script>
<script>
  jQuery.noConflict();
    (function( $ ) {
    $(function() {

      $(document).ready(function() {


       $("#TransactionModel").formValidation({
          framework: 'bootstrap',
          excluded: [':disabled'],
            icon: {
                validating: 'glyphicon glyphicon-refresh'
            },

                fields: {
                          trade_name:{
                                validators:{
                                    notEmpty:{

                                        message:'<?php echo lang('language_lang.trade_name_req');?>'
                                    }
                                }

                              },
                            title: {
                             validators: {
                                 notEmpty:{
                                message:'<?php echo lang('language_lang.title_req');?>'
                                }
                                  }
                                      },

                             description: {
                                  validators: {
                                      notEmpty: {
                                          message: '<?php echo lang('language_lang.description_req');?>'
                                      },
                                      
                                  }
                            },
                            
                             profile: {
                                  validators: {
                                      notEmpty: {
                                          message: '<?php echo lang('language_lang.profile_req');?>'
                                      },
                                      
                                  }
                            },
  
                  }
        })
        

      });
        // $("#countries").msDropdown();
    });

    })(jQuery);

</script>

</html>

        
        