<!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('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'); ?>  </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'); ?> (<?php echo $coin_info->coin_symbol;?>)  </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>                                                                                                                                                                                                             
                              <div class="col-lg-12">
                                  <button class="btn btn-primary" type="submit"  id="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");?>'
                                      }
                                  }
                            }


                    }
        })
        

      });

   
      // $(".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);

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