<!DOCTYPE html>
<html lang="en">
<head>
	<!-- header -->
		<?php $this->load->view('admin/common_header'); ?>
	<!-- /header -->
	
	<!-- 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/selects/select2.min.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>

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

    <!--<script src="http://www.marghoobsuleman.com/mywork/jcomponents/image-dropdown/samples/js/msdropdown/jquery.dd.min.js"></script>
	<link rel="stylesheet" type="text/css" href="http://www.marghoobsuleman.com/mywork/jcomponents/image-dropdown/samples/css/msdropdown/flags.css" />
	<link rel="stylesheet" type="text/css" href="<?php echo base_url();?>/assets/boots/css/select.css" />-->

	<!-- select box JS files 
	<script type="text/javascript" src="<?php echo base_url();?>assets/js/pages/form_bootstrap_select.js"></script>-->
	<!-- /select box JS files -->
	<script src="<?php echo base_url();?>/assets/boots/js/select_min.js"></script>
	<link rel="stylesheet" type="text/css" href="<?php echo base_url();?>/assets/boots/css/select2.css"/>
	
</head>

<body class="navbar-top-md-md">
	<!-- <div class="pre_loader"></div> -->
	<!-- 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('menu_addr_settings'); ?></span></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['menu_addr_settings']; ?></li><?php } } ?>
				</ul>
			</div>
			<?php $this->load->view('admin/'.$module_name.'_header'); ?>
			
		</div>
	</div>
	<!-- /page header -->


	<!-- Page container -->
	<div class="page-container">

		<!-- Page content -->
		<div class="page-content">

			<!-- Main content -->
			<div class="content-wrapper">

				<!-- Horizontal form -->
				<div class="panel panel-flat">
					<div class="panel-heading">
						<h5 class="panel-title">
						<?php 
							if(isset($addr_data->pid)) { 
								echo $this->lang->line('menu_addr_settings');
							} else {
								echo $this->lang->line('menu_addr_settings');
							}
						?>
						</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 addrsetting" action="<?php echo $action;?>" method="post" enctype="multipart/form-data">
							<?php 
								if(validation_errors()) { 
									$form_err_data = str_replace('<p>', '', validation_errors());
									$form_err_data = str_replace('</p>', '', $form_err_data);
									$form_err_data = str_replace('.', '', $form_err_data);
							?>
									
									<script type="text/javascript">
									
									(function( $ ) {
										$.jGrowl.defaults.closer = false;
								        var from_daa = '<?php $form_err_data;?>';
										$.jGrowl(from_daa, {
								            header: '<?php echo $this->lang->line("error");?>',
								            theme: 'bg-danger'
								        });
								    
									})(jQuery);


									</script>
							<?php
								}
							?>
							<div class="form-group  <?php if(form_error('importtxt')) echo "has-error";?>">
								<label class="control-label col-lg-3 text-semibold"><?php echo $this->lang->line('label_payaddr'); ?> <span class="text-danger">*</span></label>
								<div class="col-lg-4">
									<div class="input-group">
											<input type="file" name="importtxt" class="file-input-extensions1" value="">
										

									</div>
									<br>
											<i style="color:#006dff"><?php echo $this->lang->line('address_note'); ?></i>

									<?php echo form_error('importtxt', '<div class="form-control-feedback"><i class="icon-cancel-circle2"></i></div><span class="help-block">', '</span>'); ?>
								</div>

							</div>

							


							
							

							<?php 
								if(isset($addr_data->pid)) { 
									$addr_status = $addr_data->status;
								} else {
									$addr_status = '';
								}
							?>
						
							<?php 
								if(isset($addr_data->pid)) { 
							?>
							<input type="hidden" name="pid" value="<?php echo $addr_data->pid;?>"/>
							

							
							<?php } ?>
							<input type="hidden" name="payment_name" value="<?php echo 'ETH';?>"/>
							<input type="hidden" name="payid" value="<?php echo '20';?>"/>

							<div class="text-right col-lg-7">
								<button type="submit" class="btn btn-primary"><?php if(isset($addr_data->pid)) {  echo $this->lang->line('button_update'); } else { echo $this->lang->line('button_save'); } ?> <i class="icon-arrow-right14 position-right"></i></button>
							</div>
						</form>
					</div>
				</div>
				<!-- /horizotal form -->

			</div>
			<!-- /main content -->

		</div>
		<!-- /page content -->
		

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

	</div>
	<!-- /page container -->

	<script type="text/javascript">
	jQuery.noConflict();
	(function( $ ) {
	$(function() {

		$(document).ready(function() {

			$.jGrowl.defaults.closer = false;

			<?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 } ?>

            if ($("#simg").length > 0) {
		        function formatFlags(state) {
		            if (!state.id) return state.text;
		            return "<img style='padding-right:10px;' src='<?php echo base_url();?>assets/images/flags/" + state.id.toLowerCase() + ".png'/>" + state.text;
		        }
		        $("#simg").select2({
		            formatResult: formatFlags,
		            formatSelection: formatFlags,
		            escapeMarkup: function(m) {
		                return m;
		            }
		        });
		    }

		    $('.addrsetting').formValidation({
		    	framework: 'bootstrap',
		    	excluded: [':disabled'],
		        icon: {
		            valid: 'glyphicon glyphicon-ok',
		            invalid: 'glyphicon glyphicon-remove',
		            validating: 'glyphicon glyphicon-refresh'
		        },
		        fields: {
		            address: {
		              
		                validators: {
		                    notEmpty: {
		                        message: '<?php echo $this->lang->line("address_required");?>'
		                    },
		                    
		                    
		                }
		            },
		            
		            
		        }
		    })

		});
	    
	 
		$('#icon-bck').on('click',function() {
			window.history.back();
		});
		// $("#countries").msDropdown();
	    $(".switchery").bootstrapSwitch();
	   

	});
	})(jQuery);

	
	</script>

</body>
</html>
