<!DOCTYPE html>
<html lang="en">
<head>
  <!-- Main navbar -->
    <?php $this->load->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 $this->load->view('admin/mainnav'); ?>
    <!-- /main navbar -->


    <!-- Second navbar -->
    <?php $this->load->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 $this->lang->line('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 $this->lang->line('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="<?php echo $action;?>" enctype="multipart/form-data">
                        <div class="form-group <?php if(form_error('coin')) echo "has-error";?>">
                          <label class="control-label col-lg-3 text-semibold"><?php echo $this->lang->line('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 $this->lang->line('site_logo_extension');?></span>
                               <?php echo form_error('icon', '<span class="help-block">', '</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 <?php if(form_error('coin_name')) echo "has-error";?>">
                                <label class="control-label col-lg-3 text-semibold"><?php echo $this->lang->line('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>  
                                    <?php echo form_error('coin_name', '<span class="help-block">', '</span>'); ?>
                                  </div>

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

                               <div class="form-group <?php if(form_error('coin_symbol')) echo "has-error";?>">
                                <label class="control-label col-lg-3 text-semibold"><?php echo $this->lang->line('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>
                                      <?php echo form_error('coin_symbol', '<span class="help-block">', '</span>'); ?>
                                  </div>
                              </div> 

                              <div class="form-group <?php if(form_error('coin_contract')) echo "has-error";?>">
                                <label class="control-label col-lg-3 text-semibold"><?php echo $this->lang->line('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 form_error('coin_contract', '<span class="help-block">', '</span>'); ?>
                                  </div>
                              </div>                                                               

                               <div class="form-group <?php if(form_error('issue_date')) echo "has-error";?>">
                                <label class="control-label col-lg-3 text-semibold"><?php echo $this->lang->line('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 form_error('issue_date', '<span class="help-block">', '</span>'); ?>
                                  </div>
                              </div>                                                                           

                              <div class="form-group <?php if(form_error('issue_price')) echo "has-error";?>">
                                <label class="control-label col-lg-3 text-semibold"><?php echo $this->lang->line('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 form_error('issue_price', '<span class="help-block">', '</span>'); ?>
                                  </div>
                              </div>

                              <div class="form-group <?php if(form_error('coin_decimal')) echo "has-error";?>">
                                <label class="control-label col-lg-3 text-semibold"><?php echo $this->lang->line('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 form_error('coin_decimal', '<span class="help-block">', '</span>'); ?>
                                  </div>
                              </div>

                              <div class="form-group <?php if(form_error('max_supply')) echo "has-error";?>">
                                  <label class="control-label col-lg-3 text-semibold"><?php echo $this->lang->line('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 form_error('max_supply', '<span class="help-block">', '</span>'); ?>
                                  </div>
                              </div>

                              <div class="form-group <?php if(form_error('circulate_supply')) echo "has-error";?>">
                                <label class="control-label col-lg-3 text-semibold"><?php echo $this->lang->line('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 form_error('circulate_supply', '<span class="help-block">', '</span>'); ?>
                                  </div>
                              </div>                                                                                                           

                              <div class="form-group <?php if(form_error('website')) echo "has-error";?>">
                                <label class="control-label col-lg-3 text-semibold"><?php echo $this->lang->line('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 form_error('website', '<span class="help-block">', '</span>'); ?>
                                  </div>
                              </div>                                                                                                                        

                              <div class="form-group <?php if(form_error('explorer')) echo "has-error";?>">
                                <label class="control-label col-lg-3 text-semibold"><?php echo $this->lang->line('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 form_error('explorer', '<span class="help-block">', '</span>'); ?>
                                  </div>
                              </div>                                                                                                                        
                              <div class="form-group <?php if(form_error('whitepaper')) echo "has-error";?>">
                                <label class="control-label col-lg-3 text-semibold"><?php echo $this->lang->line('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 form_error('whitepaper', '<span class="help-block">', '</span>'); ?>
                                  </div>
                              </div>                                                                                                                         
                              <div class="form-group <?php if(form_error('introduction')) echo "has-error";?>">
                                <label class="control-label col-lg-3 text-semibold"><?php echo $this->lang->line('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 form_error('introduction', '<span class="help-block">', '</span>'); ?>
                                  </div>
                              </div>

                              <div class="form-group <?php if(form_error('facebook')) echo "has-error";?>">
                                <label class="control-label col-lg-3 text-semibold"><?php echo $this->lang->line('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 form_error('facebook', '<span class="help-block">', '</span>'); ?>
                                  </div>
                              </div>

                              <div class="form-group <?php if(form_error('twitter')) echo "has-error";?>">
                                <label class="control-label col-lg-3 text-semibold"><?php echo $this->lang->line('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 form_error('twitter', '<span class="help-block">', '</span>'); ?>
                                  </div>
                              </div>

                              <div class="form-group <?php if(form_error('github')) echo "has-error";?>">
                                <label class="control-label col-lg-3 text-semibold"><?php echo $this->lang->line('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 form_error('github', '<span class="help-block">', '</span>'); ?>
                                  </div>
                              </div>

                              <div class="form-group <?php if(form_error('telegram')) echo "has-error";?>">
                                <label class="control-label col-lg-3 text-semibold"><?php echo $this->lang->line('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 form_error('telegram', '<span class="help-block">', '</span>'); ?>
                                  </div>
                              </div>

                              <div class="form-group <?php if(form_error('reddit')) echo "has-error";?>">
                                <label class="control-label col-lg-3 text-semibold"><?php echo $this->lang->line('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 form_error('reddit', '<span class="help-block">', '</span>'); ?>
                                  </div>
                              </div>

                              <div class="form-group <?php if(form_error('trade_fees')) echo "has-error";?>">
                                <label class="control-label col-lg-3 text-semibold"><?php echo $this->lang->line('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" />
                                      <div class="messageContainer"></div>
                                      <?php echo form_error('trade_fees', '<span class="help-block">', '</span>'); ?>
                                  </div>
                              </div>

                                <div class="form-group <?php if(form_error('min_withdraw')) echo "has-error";?>">
                                <label class="control-label col-lg-3 text-semibold"><?php echo $this->lang->line('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" />
                                      <div class="messageContainer"></div>
                                      <?php echo form_error('min_withdraw', '<span class="help-block">', '</span>'); ?>
                                  </div>
                              </div>

                                <div class="form-group <?php if(form_error('transfer_fess')) echo "has-error";?>">
                                <label class="control-label col-lg-3 text-semibold"><?php echo $this->lang->line('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" />
                                      <div class="messageContainer"></div>
                                      <?php echo form_error('transfer_fees', '<span class="help-block">', '</span>'); ?>
                                  </div>
                              </div>


                              <div class="form-group <?php if(form_error('deposit')) echo "has-error";?>">
                                  <label class="control-label col-lg-3 text-semibold"><?php echo $this->lang->line('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 $this->lang->line('On');?>" data-off-text="<?php echo $this->lang->line('Off');?>" class="switchery">
                                      </label>
                                    </div>
                                    <?php echo form_error('deposit', '<label class="validation-error-label">', '</label>'); ?>
                                  </div>
                              </div>  

                              <div class="form-group <?php if(form_error('withdraw')) echo "has-error";?>">
                                  <label class="control-label col-lg-3 text-semibold"><?php echo $this->lang->line('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 $this->lang->line('On');?>" data-off-text="<?php echo $this->lang->line('Off');?>" class="switchery">
                                      </label>
                                    </div>
                                    <?php echo form_error('withdraw', '<label class="validation-error-label">', '</label>'); ?>
                                  </div>
                              </div>    

                              <div class="form-group <?php if(form_error('trade')) echo "has-error";?>">
                                  <label class="control-label col-lg-3 text-semibold"><?php echo $this->lang->line('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 $this->lang->line('On');?>" data-off-text="<?php echo $this->lang->line('Off');?>" class="switchery">
                                      </label>
                                    </div>
                                    <?php echo form_error('trade', '<label class="validation-error-label">', '</label>'); ?>
                                  </div>
                              </div>

                              <?php 
                                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;";
                                  }
                                }
                                
                              ?>

                              <div class="form-group <?php if(form_error('coin_type')) echo "has-error";?>" <?php echo $cls1;?>>
                                  <label class="control-label col-lg-3 text-semibold"><?php echo $this->lang->line('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 form_error('coin_type', '<label class="validation-error-label">', '</label>'); ?>
                                  </div>
                              </div> 


                               


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

                                <div class="form-group <?php if(form_error('pay_status')) echo "has-error";?>" <?php echo $cls2;?> id="pay_st">
                                  <label class="control-label col-lg-3 text-semibold"><?php echo $this->lang->line('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 form_error('pay_status', '<label class="validation-error-label">', '</label>'); ?>
                                  </div>
                              </div> 

                               <div class="form-group <?php if(form_error('pay_mode')) echo "has-error";?>" <?php echo $cls2;?> id="pay_mt">
                                  <label class="control-label col-lg-3 text-semibold"><?php echo $this->lang->line('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 form_error('pay_mode', '<label class="validation-error-label">', '</label>'); ?>
                                  </div>
                              </div> 

                              <?php 
                              }
                              else
                              {
                                ?>


                                  <div class="form-group <?php if(form_error('pay_status')) echo "has-error";?>" <?php echo $cls2;?> id="pay_st">
                                  <label class="control-label col-lg-3 text-semibold"><?php echo $this->lang->line('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 form_error('pay_status', '<label class="validation-error-label">', '</label>'); ?>
                                  </div>
                                  </div> 

                                    <div class="form-group <?php if(form_error('pay_mode')) echo "has-error";?>" >
                                  <label class="control-label col-lg-3 text-semibold"><?php echo $this->lang->line('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 form_error('pay_mode', '<label class="validation-error-label">', '</label>'); ?>
                                  </div>
                                  </div> 


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


                              <div class="form-group <?php if(form_error('wallet_address')) echo "has-error";?>" <?php echo $cls;?> id="bc"> 
                                <label class="control-label col-lg-3 text-semibold"><?php echo $this->lang->line('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 form_error('wallet_address', '<span class="help-block">', '</span>'); ?>
                                  </div>
                              </div>


                              <div class="form-group <?php if(form_error('coins_per')) echo "has-error";?>" <?php echo $cls;?> id="coins"> 
                                <label class="control-label col-lg-3 text-semibold"><?php echo $this->lang->line('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 form_error('coins_per', '<span class="help-block">', '</span>'); ?>
                                  </div>
                              </div>

                             
                              <!-- Buy order count start -->

                                <div class="form-group <?php if(form_error('buycount')) echo "has-error";?>" <?php echo $cls;?> id="bc1"> 
                                <label class="control-label col-lg-3 text-semibold"><?php echo $this->lang->line('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 form_error('buycount', '<span class="help-block">', '</span>'); ?>
                                  </div>
                              </div>
                               <!-- Buy order count end !-->
                               <!-- increase percentage start !-->
                             <div class="form-group <?php if(form_error('inc_per')) echo "has-error";?>" <?php echo $cls;?> id="inc">
                                <label class="control-label col-lg-3 text-semibold"><?php echo $this->lang->line('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 form_error('inc_per', '<span class="help-block">', '</span>'); ?>
                                  </div>
                              </div>
                               <!-- increase percentage end !-->
                               <!-- Sell order count start -->
                              <div class="form-group <?php if(form_error('sellcount')) echo "has-error";?>" <?php echo $cls;?> id="sc">
                                <label class="control-label col-lg-3 text-semibold"><?php echo $this->lang->line('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 form_error('sellcount', '<span class="help-block">', '</span>'); ?>
                                  </div>
                              </div>
                               <!-- Sell order count end !-->
                               <!-- Decrease percentage start !-->
                               <div class="form-group <?php if(form_error('dec_per')) echo "has-error";?>" <?php echo $cls;?> id="dec">
                                <label class="control-label col-lg-3 text-semibold"><?php echo $this->lang->line('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 form_error('dec_per', '<span class="help-block">', '</span>'); ?>
                                  </div>
                              </div>
                               <!-- Decrease percentage end !-->
                              <!-- New Fields End -->
                               <div class="col-lg-12">
                                  <button class="btn btn-primary" type="submit" >Create</button>
                              </div>

              </form>
            </div>
                              
            <?php
                // $this->load->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 $this->lang->line("error");?>',
                  theme: 'bg-danger'
              });
        <?php } ?>


        <?php if($this->session->flashdata('error_message')) { ?>
          $.jGrowl("<?php echo $this->session->flashdata('error_message');?>", {
                  header: '<?php echo $this->lang->line("error");?>',
                  theme: 'bg-danger'
              });
              <?php } ?>
                      
              <?php if($this->session->flashdata('success_message')) { ?>
                  $.jGrowl("<?php echo $this->session->flashdata('success_message');?>", {
                  header: '<?php echo $this->lang->line("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 $this->lang->line("user_coin_name_empty");?>'
                                      },
                                      regexp: {
                                          regexp: /^[a-zA-Z0-9 ]+$/i,
                                          message: '<?php echo $this->lang->line("user_coin_name_must");?>'
                                      }
                                  }
                              },
                              coin_symbol: {
                                  validators: {
                                      notEmpty: {
                                          message: '<?php echo $this->lang->line("user_coin_symbol_empty");?>'
                                      },
                                      regexp: {
                                          regexp: /^[a-zA-Z0-9]+$/i,
                                          message: '<?php echo $this->lang->line("user_coin_symbol_must");?>'
                                      }
                                  }
                              },
                              issue_price: {
                                  validators: {
                                      regexp: {
                                          regexp: /^[0-9.]+$/i,
                                          message: '<?php echo $this->lang->line("user_issue_price_check");?>'
                                      }
                                  }
                              },
                              /*max_supply: {
                                  validators: {
                                      notEmpty: {
                                          message: '<?php echo $this->lang->line("user_coin_max_supply_empty");?>'
                                      },
                                      regexp: {
                                          regexp: /^[0-9.]+$/i,
                                          message: '<?php echo $this->lang->line("user_coin_max_supply_must");?>'
                                      }
                                  }
                              },                            
                              circulate_supply: {
                                  validators: {
                                      notEmpty: {
                                          message: '<?php echo $this->lang->line("user_coin_circulate_supply_empty");?>'
                                      },
                                      regexp: {
                                          regexp: /^[0-9.]+$/i,
                                          message: '<?php echo $this->lang->line("user_coin_circulate_supply_must");?>'
                                      }
                                  }
                              },*/
                             
                             issue_date: {
                                 validators: {
                                     notEmpty: {
                                         message: '<?php echo $this->lang->line("user_issue_date");?>'
                                     }
                                 }
                             },
                             trade_fees: {
                                  validators: {
                                      notEmpty: {
                                          message: '<?php echo $this->lang->line("user_trade_fees_empty");?>'
                                      },
                                      regexp: {
                                          regexp: /^[0-9.]+$/i,
                                          message: '<?php echo $this->lang->line("user_trade_fees_empty");?>'
                                      }
                                  }
                            },
                            min_withdraw: {
                                  validators: {
                                      notEmpty: {
                                          message: '<?php echo $this->lang->line("user_trade_fees_empty");?>'
                                      },
                                      regexp: {
                                          regexp: /^[0-9.]+$/i,
                                          message: '<?php echo $this->lang->line("user_trade_fees_empty");?>'
                                      }
                                  }
                            },
                            transfer_fees: {
                                  validators: {
                                      notEmpty: {
                                          message: '<?php echo $this->lang->line("user_trade_fees_empty");?>'
                                      },
                                      regexp: {
                                          regexp: /^[0-9.]+$/i,
                                          message: '<?php echo $this->lang->line("user_trade_fees_empty");?>'
                                      }
                                  }
                            },
                            buycount:{
                                   validators: {
                                      regexp: {
                                          regexp: /^[0-9.]+$/i,
                                          message: '<?php echo $this->lang->line("trade_must_numeric");?>'
                                      }
                                  }
                            },
                            inc_per:{
                                   validators: {
                                      regexp: {
                                          regexp: /^[0-9.]+$/i,
                                          message: '<?php echo $this->lang->line("trade_must_numeric");?>'
                                      }
                                  }
                            },
                            sellcount:{
                                   validators: {
                                      regexp: {
                                          regexp: /^[0-9.]+$/i,
                                          message: '<?php echo $this->lang->line("trade_must_numeric");?>'
                                      }
                                  }
                            },
                            dec_per:{
                                   validators: {
                                      regexp: {
                                          regexp: /^[0-9.]+$/i,
                                          message: '<?php echo $this->lang->line("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/<?php echo $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/<?php echo $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>
