<!DOCTYPE html>
<html lang="en">
<head>
  <!-- Main navbar -->
    <?php
    helper('form');
    $this->session = session();
    $validation = \Config\Services::validation();
     echo view('admin/common_header'); ?>
  <!-- /main navbar -->

<script type="text/javascript" src="<?php echo base_url('assets/js/core/libraries/jquery_ui/interactions.min.js');?>"></script>
  <script type="text/javascript" src="<?php echo base_url('assets/js/core/libraries/jquery_ui/widgets.min.js');?>"></script>
  <script type="text/javascript" src="<?php echo base_url('assets/js/core/libraries/jquery_ui/effects.min.js');?>"></script>
  <script type="text/javascript" src="<?php echo base_url('assets/js/plugins/extensions/mousewheel.min.js');?>"></script>
  <script type="text/javascript" src="<?php echo base_url('assets/js/core/libraries/jquery_ui/globalize/globalize.js');?>"></script>
  
  <!-- Bootsrap form validation JS files -->
  <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 type="text/javascript" src="<?php echo base_url('assets/js/plugins/forms/styling/uniform.min.js');?>"></script>
  <script type="text/javascript" src="<?php echo base_url('assets/js/plugins/notifications/pnotify.min.js');?>"></script>
  <script type="text/javascript" src="<?php echo base_url('assets/js/plugins/forms/selects/bootstrap_multiselect.js');?>"></script>
  
  <!-- Theme JS files -->
  <script type="text/javascript" src="<?php echo base_url('assets/js/core/app.js');?>"></script>
  <!-- /theme JS files -->
  
  <!-- bootsrap switch checkbox JS files -->
    <script src="<?php echo base_url('assets/boots/js/bootstrap-switch.js');?>"></script>

    <!-- file upload JS files -->
  <script type="text/javascript" src="<?php echo base_url('assets/boots/js/fileinput.min.js');?>"></script>

    <!-- notify JS files -->
    <script type="text/javascript" src="<?php echo base_url('assets/js/plugins/notifications/jgrowl.min.js');?>"></script>
    <style type="text/css">

    .kv-file-content img.file-preview-image {
        width: 150px !important;
      }

      .icons-list a[data-action="reload1"]:after {
      content: '\e9fb';
    }
    .btns {
      padding: 5px;
    }
  </style>
</head>
<style>
.icons-list > li {
    display: inline-block;
    font-size: 26px;
    }
    .heading-elements .icons-list {
    margin-top: 5px;
}
</style>
<body class="navbar-top-md-md pace-done">

  <!-- Fixed navbars wrapper -->
  <div class="navbar-fixed-top">

    <!-- Main navbar -->
    <?php echo view('admin/mainnav'); ?>
    <!-- /main navbar -->


    <!-- Second navbar -->
    <?php echo view('admin/secondnav'); ?>
    <!-- /second navbar -->

  </div>
  <!-- /fixed navbars wrapper -->


  <!-- Page header -->
  <div class="page-header">
    <div class="page-header-content">
      <div class="page-title">
        <h4><i id="icon-bck" class="icon-arrow-left52 position-left"></i> <span class="text-semibold"><?php echo lang('language_lang.currency_page_title'); ?></h4>
          <ul class="breadcrumb breadcrumb-caret position-right">
              <?php foreach ($breadcrumbs as $breadcrumb) { if(isset($breadcrumb['href'])){?>
                  <li><a href="<?php echo $breadcrumb['href']; ?>"><?php echo $breadcrumb['text']; ?></a></li>
              <?php } else { ?> <li><?php echo $breadcrumb['text']; ?></li><?php } } ?>
          </ul>
      </div>
    </div>
  </div>
  <!-- /page header -->

      <!-- Page container -->
  <div class="page-container">
    <!-- Page content -->
    <div class="page-content">
      <!-- Main content -->
      <div class="content-wrapper">
        <div class="panel panel-flat">
          <div class="panel-heading">
            <h5 class="panel-title"><?php echo lang('language_lang.add_currency_page_title'); ?></h5>
              <div class="heading-elements">
                  <ul class="icons-list">
                      <li><a data-action="collapse"></a></li>
                      <li><a data-action="close"></a></li>
                  </ul>
              </div>
          </div>
          <div class="panel-body">              
              <form class="form-horizontal change_trpwd" method="post" action="<?=site_url($action);?>" enctype="multipart/form-data">
                        <div class="form-group <?php if($validation->getError('coin')) echo "has-error";?>">
                          <label class="control-label col-lg-3 text-semibold"><?php echo lang('language_lang.lbl_icon_picture');?> <span class="text-danger"> * </span> </label>
                          <div class="col-lg-6">
                              <input type="file"  class="file-input-extensions" name="coin_image" />
                              <span class="help-block"><?php echo lang('language_lang.site_logo_extension');?></span>
                               <?php echo $validation->getError('icon', '<span class="help-block alert-danger">', '</span>'); ?>
                          </div>
                        </div>
                        <?php
                          if(isset($coin_info))
                          {?>
                              <input type="hidden" class="form-control" name="coin_id" id="coin_id" value="<?php echo $coin_info->coid?>"/>
                          <?}
                        ?> 

                               <div class="form-group">
                                <label class="control-label col-lg-3 text-semibold"><?php echo lang('language_lang.lbl_coin_name'); ?> <span class="text-danger"> * </span> </label>
                                  <div class="col-lg-6">
                                    <input type="text" class="form-control" name="coin_name" value="<?php if(isset($coin_info)){ echo $coin_info->coin_name;}else{ echo set_value('coin_name');}?>">
                                    </div>  
                                  </div>

                                     <!-- <div class="messageContainer"></div> -->
                                    <!-- </div>                                -->

                               <div class="form-group">
                                <label class="control-label col-lg-3 text-semibold"><?php echo lang('language_lang.lbl_coin_symbol'); ?> <span class="text-danger"> * </span> </label>
                                  <div class="col-lg-6">
                                      <input type="text" class="form-control" name="coin_symbol" value="<?php if(isset($coin_info)){ echo $coin_info->coin_symbol;}else{ echo  set_value('coin_symbol');}?>">
                                      <div class="messageContainer"></div>
                                     
                                  </div>
                              </div> 

                              <div class="form-group <?php if($validation->getError('coin_contract')) echo "has-error";?>">
                                <label class="control-label col-lg-3 text-semibold"><?php echo lang('language_lang.lbl_coin_contract'); ?> </label>
                                  <div class="col-lg-6">
                                      <input type="text" class="form-control" name="coin_contract" value="<?php if(isset($coin_info)){ echo $coin_info->contract;}else{ echo  set_value('coin_contract');}?>">
                                      <div class="messageContainer"></div>
                                      <?php echo $validation->getError('coin_contract', '<span class="help-block">', '</span>'); ?>
                                  </div>
                              </div>                                                               

                               <div class="form-group <?php if($validation->getError('issue_date')) echo "has-error";?>">
                                <label class="control-label col-lg-3 text-semibold"><?php echo lang('language_lang.lbl_issue_coin'); ?>  </label>
                                  <div class="col-lg-6">
                                      <input type="text" class="form-control datepicker" name="issue_date" id="start_issue" value="<?php if(isset($coin_info)){ echo date('Y-m-d',strtotime($coin_info->issue_date));}else{ echo  set_value('coin_symbol');}?>" placeholder="YYYY-MM-DD" readonly>
                                      <div class="messageContainer"></div>
                                      <?php echo $validation->getError('issue_date', '<span class="help-block">', '</span>'); ?>
                                  </div>
                              </div>                                                                           

                              <div class="form-group <?php if($validation->getError('issue_price')) echo "has-error";?>">
                                <label class="control-label col-lg-3 text-semibold"><?php echo lang('language_lang.lbl_issue_price'); ?>  </label>
                                  <div class="col-lg-6">
                                     <input type="text" class="form-control" name="issue_price" value="<?php if(isset($coin_info)){ echo $coin_info->issue_price;}else{ echo  set_value('issue_price');}?>">
                                      <div class="messageContainer"></div>
                                      <?php echo $validation->getError('issue_price', '<span class="help-block">', '</span>'); ?>
                                  </div>
                              </div>

                              <div class="form-group <?php if($validation->getError('coin_decimal')) echo "has-error";?>">
                                <label class="control-label col-lg-3 text-semibold"><?php echo lang('language_lang.lbl_coin_decimal'); ?> <span class="text-danger"> * </span>  </label>
                                  <div class="col-lg-6">
                                      <input type="text" class="form-control" name="coin_decimal" value="<?php if(isset($coin_info)){ echo $coin_info->coin_decimal;}else{ echo set_value('coin_decimal');}?>">
                                      <div class="messageContainer"></div>
                                      <?php echo $validation->getError('coin_decimal', '<span class="help-block">', '</span>'); ?>
                                  </div>
                              </div>

                              <div class="form-group <?php if($validation->getError('max_supply')) echo "has-error";?>">
                                  <label class="control-label col-lg-3 text-semibold"><?php echo lang('language_lang.lbl_max_supply'); ?>   <span class="text-danger">  </span> </label>
                                  <div class="col-lg-6">
                                      <input type="text" class="form-control" name="max_supply" value="<?php if(isset($coin_info)){ echo $coin_info->max_supply;}else{ echo set_value('max_supply');}?>">
                                      <div class="messageContainer"></div>
                                      <?php echo $validation->getError('max_supply', '<span class="help-block">', '</span>'); ?>
                                  </div>
                              </div>

                              <div class="form-group <?php if($validation->getError('circulate_supply')) echo "has-error";?>">
                                <label class="control-label col-lg-3 text-semibold"><?php echo lang('language_lang.lbl_circulate_supply'); ?> <span class="text-danger">  </span> </label>
                                  <div class="col-lg-6">
                                      <input type="text" class="form-control" name="circulate_supply" value="<?php if(isset($coin_info)){ echo $coin_info->circulate_supply;}else{ echo set_value('circulate_supply');}?>">
                                      <div class="messageContainer"></div>
                                      <?php echo $validation->getError('circulate_supply', '<span class="help-block">', '</span>'); ?>
                                  </div>
                              </div>                                                                                                           

                              <div class="form-group <?php if($validation->getError('website')) echo "has-error";?>">
                                <label class="control-label col-lg-3 text-semibold"><?php echo lang('language_lang.lbl_website'); ?>  </label>
                                  <div class="col-lg-6">
                                      <input type="text" class="form-control" name="website" value="<?php if(isset($coin_info)){ echo $coin_info->website;}else{ echo set_value('website');}?>">
                                      <div class="messageContainer"></div>
                                      <?php echo $validation->getError('website', '<span class="help-block">', '</span>'); ?>
                                  </div>
                              </div>                                                                                                                        

                              <div class="form-group <?php if($validation->getError('explorer')) echo "has-error";?>">
                                <label class="control-label col-lg-3 text-semibold"><?php echo lang('language_lang.lbl_explorer'); ?>  </label>
                                  <div class="col-lg-6">
                                      <input type="text" name="explorer" class="form-control" value="<?php if(isset($coin_info)){ echo $coin_info->explorer;}else{ echo set_value('explorer');}?>">
                                      <div class="messageContainer"></div>
                                      <?php echo $validation->getError('explorer', '<span class="help-block">', '</span>'); ?>
                                  </div>
                              </div>                                                                                                                        
                              <div class="form-group <?php if($validation->getError('whitepaper')) echo "has-error";?>">
                                <label class="control-label col-lg-3 text-semibold"><?php echo lang('language_lang.lbl_whitepaper'); ?>  </label>
                                  <div class="col-lg-6">
                                      <input type="file" id="input-file-now" class="file-input-extensions1" name="whitepaper" value="<?php if(isset($coin_info)){ echo $coin_info->whitepaper;}else{ echo set_value('whitepaper');}?>" />
                                      <div class="messageContainer"></div>
                                      <?php echo $validation->getError('whitepaper', '<span class="help-block">', '</span>'); ?>
                                  </div>
                              </div>                                                                                                                         
                              <div class="form-group <?php if($validation->getError('introduction')) echo "has-error";?>">
                                <label class="control-label col-lg-3 text-semibold"><?php echo lang('language_lang.lbl_introduction'); ?>  </label>
                                  <div class="col-lg-6">
                                      <!--<input type="text"  name="introduction" class="form-control" value="<?php if(isset($coin_info)){ echo $coin_info->introduction;}else{ echo set_value('introduction');}?>" />-->
                                      <textarea name="introduction" class="form-control" rows='12'><?php echo str_replace("<br>","\n",$coininfo->introduction);?></textarea>
                                      <div class="messageContainer"></div>
                                      <?php echo $validation->getError('introduction', '<span class="help-block">', '</span>'); ?>
                                  </div>
                              </div>

                              <div class="form-group <?php if($validation->getError('facebook')) echo "has-error";?>">
                                <label class="control-label col-lg-3 text-semibold"><?php echo lang('language_lang.lbl_facebook'); ?>  </label>
                                  <div class="col-lg-6">
                                        <input type="text" value="<?php if(isset($coin_info)){ echo $coin_info->facebook;}else{ echo set_value('facebook');}?>" name="facebook" class="form-control" />
                                      <div class="messageContainer"></div>
                                      <?php echo $validation->getError('facebook', '<span class="help-block">', '</span>'); ?>
                                  </div>
                              </div>

                              <div class="form-group <?php if($validation->getError('twitter')) echo "has-error";?>">
                                <label class="control-label col-lg-3 text-semibold"><?php echo lang('language_lang.lbl_twitter'); ?>  </label>
                                  <div class="col-lg-6">
                                        <input type="text" value="<?php if(isset($coin_info)){ echo $coin_info->twitter;}else{ echo set_value('twitter');}?>" name="twitter" class="form-control" />
                                      <div class="messageContainer"></div>
                                      <?php echo $validation->getError('twitter', '<span class="help-block">', '</span>'); ?>
                                  </div>
                              </div>

                              <div class="form-group <?php if($validation->getError('github')) echo "has-error";?>">
                                <label class="control-label col-lg-3 text-semibold"><?php echo lang('language_lang.lbl_github'); ?>  </label>
                                  <div class="col-lg-6">
                                        <input type="text" name="github" class="form-control" value="<?php if(isset($coin_info)){ echo $coin_info->github;}else{ echo set_value('github');}?>" />
                                      <div class="messageContainer"></div>
                                      <?php echo $validation->getError('github', '<span class="help-block">', '</span>'); ?>
                                  </div>
                              </div>

                              <div class="form-group <?php if($validation->getError('telegram')) echo "has-error";?>">
                                <label class="control-label col-lg-3 text-semibold"><?php echo lang('language_lang.lbl_telegram'); ?>  </label>
                                  <div class="col-lg-6">
                                        <input type="text" value="<?php if(isset($coin_info)){ echo $coin_info->telegram;}else{ echo set_value('telegram');}?>" name="telegram" class="form-control" />
                                      <div class="messageContainer"></div>
                                      <?php echo $validation->getError('telegram', '<span class="help-block">', '</span>'); ?>
                                  </div>
                              </div>

                              <div class="form-group <?php if($validation->getError('reddit')) echo "has-error";?>">
                                <label class="control-label col-lg-3 text-semibold"><?php echo lang('language_lang.lbl_reddit'); ?>  </label>
                                  <div class="col-lg-6">
                                        <input type="text" value="<?php if(isset($coin_info)){ echo $coin_info->reddit;}else{ echo set_value('reddit');}?>" name="reddit" class="form-control" />
                                      <div class="messageContainer"></div>
                                      <?php echo $validation->getError('reddit', '<span class="help-block">', '</span>'); ?>
                                  </div>
                              </div>

                              <div class="form-group <?php if($validation->getError('trade_fees')) echo "has-error";?>">
                                <label class="control-label col-lg-3 text-semibold"><?php echo lang('language_lang.trade_fees'); ?> (%)  </label>
                                  <div class="col-lg-3">
                                        <input type="text" value="<?php if(isset($coin_info)){ echo $coin_info->trade_fees;}else{ echo set_value('trade_fees');}?>" name="trade_fees" class="form-control" placeholder="<?php echo lang('language_lang.arbit_place');?>" />
                                      <div class="messageContainer"></div>
                                      <?php echo $validation->getError('trade_fees', '<span class="help-block">', '</span>'); ?>
                                  </div>
                              </div>

                                <div class="form-group <?php if($validation->getError('min_withdraw')) echo "has-error";?>">
                                <label class="control-label col-lg-3 text-semibold"><?php echo lang('language_lang.min_withdraw'); ?>  </label>
                                  <div class="col-lg-3">
                                        <input type="text" value="<?php if(isset($coin_info)){ echo $coin_info->min_withdraw;}else{ echo set_value('min_withdraw');}?>" name="min_withdraw" class="form-control" placeholder="<?php echo lang('language_lang.arbit_place');?>" />
                                      <div class="messageContainer"></div>
                                      <?php echo $validation->getError('min_withdraw', '<span class="help-block">', '</span>'); ?>
                                  </div>
                              </div>

                                <div class="form-group <?php if($validation->getError('transfer_fess')) echo "has-error";?>">
                                <label class="control-label col-lg-3 text-semibold"><?php echo lang('language_lang.transfer_fees'); ?> (%)  </label>
                                  <div class="col-lg-3">
                                        <input type="text" value="<?php if(isset($coin_info)){ echo $coin_info->transfer_fees;}else{ echo set_value('transfer_fees');}?>" name="transfer_fees" class="form-control" placeholder="<?php echo lang('language_lang.arbit_place');?>"/>
                                      <div class="messageContainer"></div>
                                      <?php echo $validation->getError('transfer_fees', '<span class="help-block">', '</span>'); ?>
                                  </div>
                              </div>


                              <div class="form-group <?php if($validation->getError('deposit')) echo "has-error";?>">
                                  <label class="control-label col-lg-3 text-semibold"><?php echo lang('language_lang.menu_deposit'); ?> </label>
                                  <div class="col-lg-6">
                                    <div class="checkbox checkbox-switch">
                                      <label>
                                        <input type="checkbox" <?php if($coin_info->deposit=='1'){echo 'checked="checked"';}?> name="deposit" data-on-color="success" data-off-color="danger" data-on-text="<?php echo lang('language_lang.On');?>" data-off-text="<?php echo lang('language_lang.Off');?>" class="switchery">
                                      </label>
                                    </div>
                                    <?php echo $validation->getError('deposit', '<label class="validation-error-label">', '</label>'); ?>
                                  </div>
                              </div>  

                              <div class="form-group <?php if($validation->getError('withdraw')) echo "has-error";?>">
                                  <label class="control-label col-lg-3 text-semibold"><?php echo lang('language_lang.lbl_withdraw_page_title');?></label>
                                  <div class="col-lg-6">
                                    <div class="checkbox checkbox-switch">
                                      <label>
                                        <input type="checkbox" <?php if($coin_info->withdraw=='1'){ echo 'checked="checked"'; } ?> name="withdraw" data-on-color="success" data-off-color="danger" data-on-text="<?php echo lang('language_lang.On');?>" data-off-text="<?php echo lang('language_lang.Off');?>" class="switchery">
                                      </label>
                                    </div>
                                    <?php echo $validation->getError('withdraw', '<label class="validation-error-label">', '</label>'); ?>
                                  </div>
                              </div>    

                              <div class="form-group <?php if($validation->getError('trade')) echo "has-error";?>">
                                  <label class="control-label col-lg-3 text-semibold"><?php echo lang('language_lang.trade');?></label>
                                  <div class="col-lg-6">
                                    <div class="checkbox checkbox-switch">
                                      <label>
                                        <input type="checkbox" <?php if($coin_info->trade=='1'){ echo 'checked="checked"'; } ?> name="trade" data-on-color="success" data-off-color="danger" data-on-text="<?php echo lang('language_lang.On');?>" data-off-text="<?php echo lang('language_lang.Off');?>" class="switchery">
                                      </label>
                                    </div>
                                    <?php echo $validation->getError('trade', '<label class="validation-error-label">', '</label>'); ?>
                                  </div>
                              </div>

                              <?php 
                                if($coin_info)
                                {
                                  if($coin_info->coid < 6)
                                  {
                                    $cls="style=display:none;";
                                    $cls1="style=display:none;";
                                    $cls2="style=display:none;";

                                  }
                                  else
                                  {

                                    if($coin_info->coin_type=='1')
                                    {
                                      $cls="style=display:none;"; 
                                      $cls1="style=display:block;"; 
                                      $cls2="style=display:block;"; 
                                    }
                                    else
                                    {
                                      $cls="";
                                      $cls1="style=display:block;";
                                      $cls2="style=display:none;";
                                    }
                                  }
                              }
                              else
                              {
                                  $cls="style=display:none;"; 
                                  $cls1="style=display:block;"; 
                                  $cls2="style=display:block;"; 

                              }
                              ?>


                              <div class="form-group <?php if($validation->getError('coin_type')) echo "has-error";?>" <?php echo $cls1;?>>
                                  <label class="control-label col-lg-3 text-semibold"><?php echo lang('language_lang.coin_type');?></label>
                                  <div class="col-lg-3">
                                    <div class="checkbox checkbox-switch">
                                    <select class="form-control" name="coin_type" id="coin_type" onchange="live_change(this.value);"> 
                                      <option value="1" <?php if($coin_info->coin_type=='1') echo "selected=='selected'"; ?>>Live coin</option>
                                      <option value="0" <?php if($coin_info->coin_type=='0') echo "selected=='selected'"; ?>>Non Live coin</option>
                                        
                                      </select>
                                    </div>
                                    <?php echo $validation->getError('coin_type', '<label class="validation-error-label">', '</label>'); ?>
                                  </div>
                              </div> 


                               


                                <?php 
                                  if($coin_info->coid > 5 || !$coin_info)
                                  {
                                ?>

                                <div class="form-group <?php if($validation->getError('pay_status')) echo "has-error";?>" <?php echo $cls2;?> id="pay_st">
                                  <label class="control-label col-lg-3 text-semibold"><?php echo lang('language_lang.coin_mode');?></label>
                                  <div class="col-lg-3">
                                    <div class="checkbox checkbox-switch">
                                    <select class="form-control" name="pay_status" id="pay_status"> 
                                        <option value="2" <?php if($coin_info->pay_status=='2') echo "selected=='selected'"; ?>>Ethereum Tokens</option>
                                        <option value="3" <?php if($coin_info->pay_status=='3') echo "selected=='selected'"; ?>>Fiat Currency</option>
                                      </select>
                                    </div>
                                    <?php echo $validation->getError('pay_status', '<label class="validation-error-label">', '</label>'); ?>
                                  </div>
                              </div> 

                               <div class="form-group <?php if($validation->getError('pay_mode')) echo "has-error";?>" <?php echo $cls2;?> id="pay_mt">
                                  <label class="control-label col-lg-3 text-semibold"><?php echo lang('language_lang.fund_transfer_payment');?></label>
                                  <div class="col-lg-3">
                                    <div class="checkbox checkbox-switch">
                                    <select class="form-control" name="pay_mode" id="pay_mode"> 
                                        <option value="2" <?php if($coin_info->pay_mode=='2') echo "selected=='selected'"; ?>>Ethereum</option>
                                        <option value="3" <?php if($coin_info->pay_mode=='3') echo "selected=='selected'"; ?>>Credit Card</option>
                                        <option value="4" <?php if($coin_info->pay_mode=='4') echo "selected=='selected'"; ?>>Wire Transfer</option>
                                        <option value="5" <?php if($coin_info->pay_mode=='5') echo "selected=='selected'"; ?>>Coin Payment</option>
                                        <option value="6" <?php if($coin_info->pay_mode=='6') echo "selected=='selected'"; ?>>Perfect Money</option>
                                    </select>
                                    </div>
                                    <?php echo $validation->getError('pay_mode', '<label class="validation-error-label">', '</label>'); ?>
                                  </div>
                              </div> 

                              <?php 
                              }
                              else
                              {
                                ?>


                                  <div class="form-group <?php if($validation->getError('pay_status')) echo "has-error";?>" <?php echo $cls2;?> id="pay_st">
                                  <label class="control-label col-lg-3 text-semibold"><?php echo lang('language_lang.coin_mode');?></label>
                                  <div class="col-lg-3">
                                    <div class="checkbox checkbox-switch">
                                    <select class="form-control" name="pay_status" id="pay_status"> 
                                       <option value="1" <?php if($coin_info->pay_status=='1') echo "selected=='selected'"; ?>>Crypto Currency</option>
                                        <option value="2" <?php if($coin_info->pay_status=='2') echo "selected=='selected'"; ?>>Ethereum Tokens</option>
                                        <option value="3" <?php if($coin_info->pay_status=='3') echo "selected=='selected'"; ?>>Fiat Currency</option>
                                      </select>
                                    </div>
                                    <?php echo $validation->getError('pay_status', '<label class="validation-error-label">', '</label>'); ?>
                                  </div>
                                  </div> 

                                    <div class="form-group <?php if($validation->getError('pay_mode')) echo "has-error";?>" >
                                  <label class="control-label col-lg-3 text-semibold"><?php echo lang('language_lang.fund_transfer_payment');?></label>
                                  <div class="col-lg-3">
                                    <div class="checkbox checkbox-switch">
                                    <select class="form-control" name="pay_mode" id="pay_mode"> 
                                        <option value="1" <?php if($coin_info->pay_mode=='1') echo "selected=='selected'"; ?>>Crptocurrency API</option>
                                        <option value="5" <?php if($coin_info->pay_mode=='5') echo "selected=='selected'"; ?>>Coin Payment</option>
                                    </select>
                                    </div>
                                    <?php echo $validation->getError('pay_mode', '<label class="validation-error-label">', '</label>'); ?>
                                  </div>
                                  </div> 


                                <?php 
                              }
                            ?>
                              <!-- New Fields Start-->


                              <div class="form-group <?php if($validation->getError('wallet_address')) echo "has-error";?>" <?php echo $cls;?> id="bc"> 
                                <label class="control-label col-lg-3 text-semibold"><?php echo lang('language_lang.wallet_addr'); ?>  </label>
                                  <div class="col-lg-3">
                                        <input type="text" value="<?php if(isset($coin_info)){ echo $coin_info->wallet_address;}else{ echo set_value('wallet_address');}?>" name="wallet_address" class="form-control" />
                                      <div class="messageContainer"></div>
                                      <?php echo $validation->getError('wallet_address', '<span class="help-block">', '</span>'); ?>
                                  </div>
                              </div>


                              <div class="form-group <?php if($validation->getError('coins_per')) echo "has-error";?>" <?php echo $cls;?> id="coins"> 
                                <label class="control-label col-lg-3 text-semibold"><?php echo lang('language_lang.coins_per'); ?>  </label>
                                  <div class="col-lg-3">
                                        <input type="text" value="<?php if(isset($coin_info)){ echo $coin_info->coins_per;}else{ echo set_value('coins_per');}?>" name="coins_per" class="form-control" />
                                      <div class="messageContainer"></div>
                                      <?php echo $validation->getError('coins_per', '<span class="help-block">', '</span>'); ?>
                                  </div>
                              </div>

                             
                              <!-- Buy order count start -->

                                <div class="form-group <?php if($validation->getError('buycount')) echo "has-error";?>" <?php echo $cls;?> id="bc1"> 
                                <label class="control-label col-lg-3 text-semibold"><?php echo lang('language_lang.buycount'); ?>  </label>
                                  <div class="col-lg-3">
                                        <input type="text" value="<?php if(isset($coin_info)){ echo $coin_info->buycount;}else{ echo set_value('buycount');}?>" name="buycount" class="form-control" />
                                      <div class="messageContainer"></div>
                                      <?php echo $validation->getError('buycount', '<span class="help-block">', '</span>'); ?>
                                  </div>
                              </div>
                               <!-- Buy order count end !-->
                               <!-- increase percentage start !-->
                             <div class="form-group <?php if($validation->getError('inc_per')) echo "has-error";?>" <?php echo $cls;?> id="inc">
                                <label class="control-label col-lg-3 text-semibold"><?php echo lang('language_lang.inc_per'); ?> (%)  </label>
                                  <div class="col-lg-3">
                                        <input type="text" value="<?php if(isset($coin_info)){ echo $coin_info->increase_percentage;}else{ echo set_value('inc_per');}?>" name="inc_per" class="form-control" />
                                      <div class="messageContainer"></div>
                                      <?php echo $validation->getError('inc_per', '<span class="help-block">', '</span>'); ?>
                                  </div>
                              </div>
                               <!-- increase percentage end !-->
                               <!-- Sell order count start -->
                              <div class="form-group <?php if($validation->getError('sellcount')) echo "has-error";?>" <?php echo $cls;?> id="sc">
                                <label class="control-label col-lg-3 text-semibold"><?php echo lang('language_lang.sellcount'); ?>  </label>
                                  <div class="col-lg-3">
                                        <input type="text" value="<?php if(isset($coin_info)){ echo $coin_info->sellcount;}else{ echo set_value('sellcount');}?>" name="sellcount" class="form-control" />
                                      <div class="messageContainer"></div>
                                      <?php echo $validation->getError('sellcount', '<span class="help-block">', '</span>'); ?>
                                  </div>
                              </div>
                               <!-- Sell order count end !-->
                               <!-- Decrease percentage start !-->
                               <div class="form-group <?php if($validation->getError('dec_per')) echo "has-error";?>" <?php echo $cls;?> id="dec">
                                <label class="control-label col-lg-3 text-semibold"><?php echo lang('language_lang.dec_per'); ?> (%)  </label>
                                  <div class="col-lg-3">
                                        <input type="text" value="<?php if(isset($coin_info)){ echo $coin_info->decrease_percentage;}else{ echo set_value('dec_per');}?>" name="dec_per" class="form-control" />
                                      <div class="messageContainer"></div>
                                      <?php echo $validation->getError('dec_per', '<span class="help-block">', '</span>'); ?>
                                  </div>
                              </div>




                              <div class="form-group">
                                <label class="control-label col-lg-3 text-semibold"><?php echo lang('language_lang.user_buyback');?></label>
                                 <div class="col-lg-3">
                                <?php 
                                  if(isset($coin_info)){
                                    $buy_status=$coin_info->buyback;
                                  }
                                  else
                                    $buy_status='0';
                                ?>
                                  <select class="form-control" id="buyback" name="buyback">
                                      <option value="0" <?php if($buy_status=='0') echo "selected=='selected'";?>>OFF</option>
                                      <option value="1" <?php if($buy_status=='1') echo "selected=='selected'";?>>ON</option>
                                  </select>

                              </div>
                              </div>
                              <div style="clear:both;"><br></div>

                              <div class="form-group">
                                <label class="control-label col-lg-3 text-semibold"><?php echo lang('language_lang.lbl_buyadmin');?>(%)</label>
                                 
                                 <div class="col-lg-3">
                                        <input type="text" value="<?php if(isset($coin_info)){ echo $coin_info->buy_fees;}else{ echo set_value('buy_fees');}?>" name="buy_fees" class="form-control" placeholder="<?php echo lang('language_lang.arbit_place');?>" />
                                      <div class="messageContainer"></div>
                                      <?php echo $validation->getError('buy_fees', '<span class="help-block">', '</span>'); ?>
                                  </div>
                              </div>

                              <div style="clear:both;"><br></div>

                              <div class="form-group">
                                <label class="control-label col-lg-3 text-semibold"><?php echo lang('language_lang.lbl_buyinvolve');?>(Days)</label>
                                 
                                 <div class="col-lg-3">
                                        <input type="text" value="<?php if(isset($coin_info)){ echo $coin_info->buydays;}else{ echo set_value('buydays');}?>" name="buydays" class="form-control" placeholder="<?php echo lang('language_lang.arbit_place');?>" />
                                      <div class="messageContainer"></div>
                                      <?php echo $validation->getError('buydays', '<span class="help-block">', '</span>'); ?>
                                  </div>
                              </div>

                              <div style="clear:both;"><br></div>
                              
                              <div style="display: none;" class="form-group">
                                <label class="control-label col-lg-3 text-semibold"><?php echo lang('language_lang.arbit_show');?></label>
                                 <div class="col-lg-3">
                                <?php 
                                  if(isset($coin_info)){
                                    $arbit_status=$coin_info->arbit_status;
                                  }
                                  else
                                    $arbit_status='0';
                                ?>
                                  <select class="form-control" id="arbit_status" name="arbit_status">
                                      <option value="0" <?php if($arbit_status=='0') echo "selected=='selected'";?>>OFF</option>
                                      <option value="1" <?php if($arbit_status=='1') echo "selected=='selected'";?>>ON</option>
                                  </select>

                              </div>
                              </div>
                              <div style="clear:both;"><br></div>

                              <div style="display: none;" class="form-group <?php if($validation->getError('min_amt')) echo "has-error";?>" >
                                <label class="control-label col-lg-3 text-semibold"><?php echo lang('language_lang.arbit_min'); ?>   </label>
                                  <div class="col-lg-3">
                                        <input type="text" value="<?php if(isset($coin_info)){ echo $coin_info->min_amt;}else{ echo set_value('min_amt');}?>" name="min_amt" class="form-control" placeholder="<?php echo lang('language_lang.arbit_place');?>" />
                                      <div class="messageContainer"></div>
                                      <?php echo $validation->getError('min_amt', '<span class="help-block">', '</span>'); ?>
                                  </div>
                              </div>


                              <div style="display: none;" class="form-group <?php if($validation->getError('max_amt')) echo "has-error";?>" >
                                <label class="control-label col-lg-3 text-semibold"><?php echo lang('language_lang.arbit_max'); ?>  </label>
                                  <div class="col-lg-3">
                                        <input type="text" value="<?php if(isset($coin_info)){ echo $coin_info->max_amt;}else{ echo set_value('max_amt');}?>" name="max_amt" class="form-control" placeholder="<?php echo lang('language_lang.arbit_place');?>" />
                                      <div class="messageContainer"></div>
                                      <?php echo $validation->getError('max_amt', '<span class="help-block">', '</span>'); ?>
                                  </div>
                              </div>


                              <div style="display: none;" class="form-group <?php if($validation->getError('int_rate')) echo "has-error";?>" >
                                <label class="control-label col-lg-3 text-semibold"><?php echo lang('language_lang.arbit_int'); ?> (%)   </label>
                                  <div class="col-lg-3">
                                        <input type="text" value="<?php if(isset($coin_info)){ echo $coin_info->max_amt;}else{ echo set_value('int_rate');}?>" name="int_rate" class="form-control" placeholder="<?php echo lang('language_lang.arbit_place');?>"/>
                                      <div class="messageContainer"></div>
                                      <?php echo $validation->getError('int_rate', '<span class="help-block">', '</span>'); ?>
                                  </div>
                              </div>


                              <div style="display: none;" class="form-group <?php if($validation->getError('duration')) echo "has-error";?>" >
                                <label class="control-label col-lg-3 text-semibold"><?php echo lang('language_lang.arbit_days'); ?> (Days)  </label>
                                  <div class="col-lg-3">
                                        <input type="text" value="<?php if(isset($coin_info)){ echo $coin_info->duration;}else{ echo set_value('duration');}?>" name="duration" class="form-control" placeholder="<?php echo lang('language_lang.arbit_place');?>"/>
                                      <div class="messageContainer"></div>
                                      <?php echo $validation->getError('duration', '<span class="help-block">', '</span>'); ?>
                                  </div>
                              </div>


                                <div style="display: none;" class="form-group <?php if($validation->getError('payout_period')) echo "has-error";?>">
                                <label class="control-label col-lg-3 text-semibold"><?php echo lang('language_lang.arbit_pdays'); ?> </label>
                                  <div class="col-lg-3">
                                    <?php 
                                  if(isset($coin_info)){
                                    $payout_period=$coin_info->payout_period;
                                  }
                                  else
                                    $payout_period='1';
                                ?>

                                    <select class="form-control" id="payout_period" name="payout_peroid">
                                      <option value="1" <?php if($payout_peroid=='1') echo "selected=='selected'";?>>Hourly</option>
                                      <option value="2" <?php if($payout_peroid=='2') echo "selected=='selected'";?>>Daily</option>
                                      <option value="3" <?php if($payout_peroid=='3') echo "selected=='selected'";?>>Weekly</option>
                                      <option value="4" <?php if($payout_peroid=='4') echo "selected=='selected'";?>>Monthly</option>
                                      <option value="5" <?php if($payout_peroid=='5') echo "selected=='selected'";?>>Yearly</option>
                                    </select>
                                      
                                      <div class="messageContainer"></div>
                                      <?php echo $validation->getError('payout_period', '<span class="help-block">', '</span>'); ?>
                                  </div>
                              </div>
                              <div style="display: none;" class="form-group <?php if($validation->getError('ret_balance')) echo "has-error";?>" >
                                <label class="control-label col-lg-3 text-semibold"><?php echo lang('language_lang.ret_balance'); ?> </label>
                                  <div class="col-lg-3">
                                    <?php 
                                  if(isset($coin_info)){
                                    $ret_balance=$coin_info->ret_balance;
                                  }
                                  else
                                    $ret_balance='0';
                                ?>

                                    <select class="form-control" id="ret_balance" name="ret_balance">
                                      <option value="0" <?php if($ret_balance=='0') echo "selected=='selected'";?>>No</option>
                                      <option value="1" <?php if($ret_balance=='1') echo "selected=='selected'";?>>Yes</option>
                                    </select>
                                      <div class="messageContainer"></div>
                                      <?php echo $validation->getError('ret_balance', '<span class="help-block">', '</span>'); ?>
                                  </div>
                              </div>

                              <input type="hidden" name="chked" id="chked" value="<?php echo $coin_info->arbit_status;?>">
                              <!-- Decrease percentage end !-->
                              <!-- New Fields End -->
                               <div class="col-lg-12">
                                  <button class="btn btn-primary" type="submit" >Create</button>
                              </div>

              </form>
            </div>
                              
            <?php
                // echo view('user/shortlinks');
            ?>
            
        </div>
    </div>
    </div>

    <div class="footer text-muted">
      <?php echo site_footer();?>
    </div>

    </div>
  
<script type="text/javascript">

jQuery.noConflict();
    (function( $ ) {
    $(function() {

      $(document).ready(function() {

        $.jGrowl.defaults.closer = false;

        <?php if(isset($form_err_data)) { ?>
          $.jGrowl('<?php echo trim($form_err_data);?>', {
                  header: '<?php echo lang("language_lang.error");?>',
                  theme: 'bg-danger'
              });
        <?php } ?>


        <?php if($this->session->getFlashData('error_message')) { ?>
          $.jGrowl("<?php echo $this->session->getFlashData('error_message');?>", {
                  header: '<?php echo lang("language_lang.error");?>',
                  theme: 'bg-danger'
              });
              <?php } ?>
                      
              <?php if($this->session->getFlashData('success_message')) { ?>
                  $.jGrowl("<?php echo $this->session->getFlashData('success_message');?>", {
                  header: '<?php echo lang("language_lang.success");?>',
                  theme: 'bg-success'
              });
              <?php } ?>

              $(".datepicker").datepicker({
              format: 'yy-mm-dd',
              maxDate:0
            }).on('change', function(e) {
              $('.change_trpwd').formValidation('revalidateField','issue_date');
            });
            

          $('.change_trpwd').formValidation({
          framework: 'bootstrap',
          excluded: [':disabled'],
            icon: {
                // valid: 'glyphicon glyphicon-ok',
                // invalid: 'glyphicon glyphicon-remove',
                validating: 'glyphicon glyphicon-refresh'
            },
                fields: {
                              
                              coin_name: {
                                  validators: {
                                      notEmpty: {
                                          message: '<?php echo lang("language_lang.user_coin_name_empty");?>'
                                      },
                                      regexp: {
                                          regexp: /^[a-zA-Z0-9 ]+$/i,
                                          message: '<?php echo lang("language_lang.user_coin_name_must");?>'
                                      }
                                  }
                              },
                              coin_symbol: {
                                  validators: {
                                      notEmpty: {
                                          message: '<?php echo lang("language_lang.user_coin_symbol_empty");?>'
                                      }
                                  }
                              },
                              issue_price: {
                                  validators: {
                                      regexp: {
                                          regexp: /^[0-9.]+$/i,
                                          message: '<?php echo lang("language_lang.user_issue_price_check");?>'
                                      }
                                  }
                              },
                              
                            issue_date: {
                                 validators: {
                                     notEmpty: {
                                         message: '<?php echo lang("language_lang.user_issue_date");?>'
                                     }
                                 }
                             },
                             trade_fees: {
                                  validators: {
                                      notEmpty: {
                                          message: '<?php echo lang("language_lang.user_trade_fees_empty");?>'
                                      },
                                      regexp: {
                                          regexp: /^[0-9.]+$/i,
                                          message: '<?php echo lang("language_lang.user_trade_fees_empty");?>'
                                      }
                                  }
                            },
                            min_withdraw: {
                                  validators: {
                                      notEmpty: {
                                          message: '<?php echo lang("language_lang.trade_must");?>'
                                      },
                                      regexp: {
                                          regexp: /^[0-9.]+$/i,
                                          message: '<?php echo lang("language_lang.trade_must_numeric");?>'
                                      }
                                  }
                            },
                            transfer_fees: {
                                 validators: {
                                      notEmpty: {
                                          message: '<?php echo lang("language_lang.trade_must");?>'
                                      },
                                      regexp: {
                                          regexp: /^[0-9.]+$/i,
                                          message: '<?php echo lang("language_lang.trade_must_numeric");?>'
                                      }
                                  
                                  }
                            },

                            buycount:{
                                   validators: {
                                      regexp: {
                                          regexp: /^[0-9.]+$/i,
                                          message: '<?php echo lang("language_lang.trade_must_numeric");?>'
                                      }
                                  }
                            },
                            inc_per:{
                                   validators: {
                                      regexp: {
                                          regexp: /^[0-9.]+$/i,
                                          message: '<?php echo lang("language_lang.trade_must_numeric");?>'
                                      }
                                  }
                            },
                            sellcount:{
                                   validators: {
                                      regexp: {
                                          regexp: /^[0-9.]+$/i,
                                          message: '<?php echo lang("language_lang.trade_must_numeric");?>'
                                      }
                                  }
                            },
                            dec_per:{
                                   validators: {
                                      regexp: {
                                          regexp: /^[0-9.]+$/i,
                                          message: '<?php echo lang("language_lang.trade_must_numeric");?>'
                                      }
                                  }
                            },

                            buy_fees:{

                              validators: {
                                      notEmpty: {
                                          message: '<?php echo lang("language_lang.trade_must_");?>'
                                      },
                                      regexp: {
                                          regexp: /^[0-9.]+$/i,
                                          message: '<?php echo lang("language_lang.trade_must_numeric");?>'
                                      }
                                  }


                            },
                            // min_amt: {
                            //       validators: {
                            //           notEmpty: {
                            //               message: '<?php echo lang("language_lang.trade_must");?>'
                            //           },
                            //           regexp: {
                            //               regexp: /^[0-9.]+$/i,
                            //               message: '<?php echo lang("language_lang.trade_must_numeric");?>'
                            //           }
                            //       }
                            // },

                            // max_amt: {
                            //       validators: {
                            //           notEmpty: {
                            //               message: '<?php echo lang("language_lang.trade_must");?>'
                            //           },
                            //           regexp: {
                            //               regexp: /^[0-9.]+$/i,
                            //               message: '<?php echo lang("language_lang.trade_must_numeric");?>'
                            //           }
                            //       }
                            // },

                            // int_rate: {
                            //       validators: {
                            //           notEmpty: {
                            //               message: '<?php echo lang("language_lang.trade_must");?>'
                            //           },
                            //           regexp: {
                            //               regexp: /^[0-9.]+$/i,
                            //               message: '<?php echo lang("language_lang.trade_must_numeric");?>'
                            //           }
                            //       }
                            // },

                            // duration: {
                            //       validators: {
                            //           notEmpty: {
                            //               message: '<?php echo lang("language_lang.trade_must");?>'
                            //           },
                            //           regexp: {
                            //               regexp: /^[0-9]+$/i,
                            //               message: '<?php echo lang("language_lang.trade_must_numeric");?>'
                            //           }
                            //       }
                            // },


                  }
        })
        

      });

   
      // $(".switch").bootstrapSwitch();
      $(".file-input-extensions").fileinput({
        uploadUrl: "http://localhost/file-upload-single/1", // server upload action
        uploadAsync: false,
        minFileCount: 1,
        maxFileCount: 1,
        overwriteInitial: true,
        showUpload: false,
        <?php if(isset($coin_info->coin_image)) { ?>
          initialPreview: ["<?php echo base_url('uploads/coins/'.$coin_info->coin_image); ?>"],
          initialPreviewAsData: true, // identify if you are sending preview data only and not the raw markup
          initialPreviewFileType: 'image', // image is the default and can be overridden in config below
        <?php } ?>
        allowedFileExtensions: ["jpg", "gif", "png", "jpeg"],
        uploadExtraData: {
            img_key: "1000"
        }
    });

      $(".file-input-extensions1").fileinput({
        uploadUrl: "http://localhost/file-upload-single/1", // server upload action
        uploadAsync: false,
        minFileCount: 1,
        maxFileCount: 1,
        overwriteInitial: true,
        showUpload: false,
        <?php if(isset($coin_info->whitepaper)) { ?>
          initialPreview: ["<?php echo base_url('uploads/'.$coin_info->whitepaper); ?>;"],
          initialPreviewAsData: true, // identify if you are sending preview data only and not the raw markup
          initialPreviewFileType: 'image', // image is the default and can be overridden in config below
        <?php } ?>
        allowedFileExtensions: ["pdf"],
        uploadExtraData: {
            img_key: "1000"
        }
    });

        // $('[name="page_content"]').ckeditor();
      $('#icon-bck').on('click',function() {
        window.history.back();
      });
      
        $(".switchery").bootstrapSwitch();
        // $("#countries").msDropdown();
    });
    })(jQuery);


function live_change(str)
{
   if(str=='1')
   {
      document.getElementById('pay_mt').style.display='block';
      document.getElementById('pay_st').style.display='block';
      document.getElementById('bc').style.display='none';
      document.getElementById('bc1').style.display='none';
      document.getElementById('coins').style.display='none';
      document.getElementById('inc').style.display='none';
      document.getElementById('sc').style.display='none';
      document.getElementById('dec').style.display='none';

   }
   else
   {
      document.getElementById('pay_mt').style.display='none';
      document.getElementById('pay_st').style.display='none';
      document.getElementById('bc').style.display='block';
      document.getElementById('bc1').style.display='block';
      document.getElementById('coins').style.display='block';
      document.getElementById('inc').style.display='block';
      document.getElementById('sc').style.display='block';
      document.getElementById('dec').style.display='block';

   }
}
</script>
</body>
</html>
