<!DOCTYPE html>
<html lang="en">
<head>
	<!-- header -->
		<?php $this->load->view('admin/common_header'); ?>
	<!-- /header -->

	<!-- file upload JS files 
	<script type="text/javascript" src="<?php echo base_url();?>assets/js/plugins/uploaders/fileinput.min.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>
	

	<!-- Theme JS files -->
	<script type="text/javascript" src="<?php echo base_url();?>assets/js/core/app.js"></script>
	<!-- /theme JS files -->

	<!-- select box theme JS files -->
	<script type="text/javascript" src="<?php echo base_url();?>assets/js/plugins/forms/selects/bootstrap_select.min.js"></script>

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

    <!-- 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 -->
    

</head>

<body class="navbar-top-md-md">

	<!-- 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('level_page_title'); ?></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['text']; ?></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 echo $this->lang->line('level_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 levelsetting" action="<?php echo $action;?>" method="post">
							<?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 ">   
				                <label class="control-label col-lg-3 text-semibold"><?php echo $this->lang->line('plac_levelstatus'); ?></label>
				                <div class="col-lg-6">
					                <div class="checkbox checkbox-switch">
										<label>
										   <input type="checkbox" class="switch" data-on-text="<?php echo $this->lang->line('On'); ?>" data-off-text="<?php echo $this->lang->line('Off'); ?>" data-on-color="primary" data-off-color="default" name="lending_status" <?php if($this->data['lending_status']==='on'){ echo 'checked="checked"'; }   ?>>
										</label>
									</div>
							    </div>
							</div>

	  						<div class="form-group  has-feedback <?php if(form_error('interesttypes')) echo "has-error";?>">
							<label class="control-label col-lg-3 text-semibold"><?php echo $this->lang->line('plac_interesttype'); ?>  </label>
							<div class="col-lg-3">
							<div class="input-group">
						       <input id="interest_type" name="interest_type" type="radio" class="" <?php if($this->data['interest_type']=='amount') echo "checked='checked'"; ?> value="amount" <?php echo $this->form_validation->set_radio('interest_type', 'amount'); ?> /> 
                			<label for="interest_type" class="">Amount </label>&nbsp;&nbsp;
                			  <input id="interest_type" name="interest_type" type="radio" class="" <?php if($this->data['interest_type']=='coin') echo "checked='checked'"; ?> value="coin" <?php echo $this->form_validation->set_radio('interest_type', 'coin'); ?> />
                			<label for="interest_type" class="">Coin </label>&nbsp;&nbsp;
                			  <input id="interest_type" name="interest_type" type="radio" class="" <?php if($this->data['interest_type']=='percentage') echo "checked='checked'"; ?> value="percentage" <?php echo $this->form_validation->set_radio('interest_type', 'percentage'); ?> />
                			<label for="interest_type" class="">Percentage </label>
                            </div>
                            </div>
                            </div>
							  
							 <div class="form-group  has-feedback <?php if(form_error('level1')) echo "has-error";?>">
								<label class="control-label col-lg-3 text-semibold"><?php echo $this->lang->line('plac_level1'); ?>  </label>
							<div class="col-lg-6">
									<div class="input-group">
										<input type="text" name="level1" class="form-control"  placeholder="<?php echo $this->lang->line('plac_level1'); ?>" value="<?php echo set_value('level1',isset($this->data['level1']) ? $this->data['level1'] : ''); ?>">
									</div>
									<?php echo form_error('level1', '<div class="form-control-feedback"><i class="icon-cancel-circle2"></i></div><span class="help-block">', '</span>'); ?>
								</div>
							</div>
							

							<div class="form-group  has-feedback <?php if(form_error('level2')) echo "has-error";?>">
								<label class="control-label col-lg-3 text-semibold"><?php echo $this->lang->line('plac_level2'); ?>  </label>
								<div class="col-lg-3">
									<div class="input-group">
										<input type="text" name="level2" class="form-control"  placeholder="<?php echo $this->lang->line('plac_level2'); ?>" value="<?php echo set_value('level2',isset($this->data['level2']) ? $this->data['level2'] : ''); ?>">
										
									</div>
									<?php echo form_error('level2', '<div class="form-control-feedback"><i class="icon-cancel-circle2"></i></div><span class="help-block">', '</span>'); ?>
								</div>
							</div>

							<div class="form-group  has-feedback <?php if(form_error('level3')) echo "has-error";?>">
								<label class="control-label col-lg-3 text-semibold"><?php echo $this->lang->line('plac_level3'); ?>  </label>
								<div class="col-lg-3">
									<div class="input-group">
										<input type="text" name="level3" class="form-control"  placeholder="<?php echo $this->lang->line('plac_level3'); ?>" value="<?php echo set_value('level3',isset($this->data['level3']) ? $this->data['level3'] : ''); ?>">
										
									</div>
									<?php echo form_error('level3', '<div class="form-control-feedback"><i class="icon-cancel-circle2"></i></div><span class="help-block">', '</span>'); ?>
								</div>
							</div>

							<div class="form-group  has-feedback <?php if(form_error('level4')) echo "has-error";?>">
								<label class="control-label col-lg-3 text-semibold"><?php echo $this->lang->line('plac_level4'); ?>  </label>
								<div class="col-lg-3">
									<div class="input-group">
										<input type="text" name="level4" class="form-control"  placeholder="<?php echo $this->lang->line('plac_level4'); ?>" value="<?php echo set_value('level4',isset($this->data['level4']) ? $this->data['level4'] : ''); ?>">
										
									</div>
									<?php echo form_error('level4', '<div class="form-control-feedback"><i class="icon-cancel-circle2"></i></div><span class="help-block">', '</span>'); ?>
								</div>
							</div>

							<div class="form-group  has-feedback <?php if(form_error('level5')) echo "has-error";?>">
								<label class="control-label col-lg-3 text-semibold"><?php echo $this->lang->line('plac_level5'); ?>  </label>
								<div class="col-lg-3">
									<div class="input-group">
										<input type="text" name="level5" class="form-control"  placeholder="<?php echo $this->lang->line('plac_level5'); ?>" value="<?php echo set_value('level5',isset($this->data['level5']) ? $this->data['level5'] : ''); ?>">
										
									</div>
									<?php echo form_error('level5', '<div class="form-control-feedback"><i class="icon-cancel-circle2"></i></div><span class="help-block">', '</span>'); ?>
								</div>
							</div>
							
							<div class="form-group  has-feedback <?php if(form_error('level6')) echo "has-error";?>">
								<label class="control-label col-lg-3 text-semibold"><?php echo $this->lang->line('plac_level6'); ?>  </label>
								<div class="col-lg-3">
									<div class="input-group">
										<input type="text" name="level6" class="form-control"  placeholder="<?php echo $this->lang->line('plac_level6'); ?>" value="<?php echo set_value('level6',isset($this->data['level6']) ? $this->data['level6'] : ''); ?>">
										
									</div>
									<?php echo form_error('level6', '<div class="form-control-feedback"><i class="icon-cancel-circle2"></i></div><span class="help-block">', '</span>'); ?>
								</div>
							</div>

							<div class="form-group  has-feedback <?php if(form_error('level7')) echo "has-error";?>">
								<label class="control-label col-lg-3 text-semibold"><?php echo $this->lang->line('plac_level7'); ?>  </label>
								<div class="col-lg-3">
									<div class="input-group">
										<input type="text" name="level7" class="form-control"  placeholder="<?php echo $this->lang->line('plac_level7'); ?>" value="<?php echo set_value('level7',isset($this->data['level7']) ? $this->data['level7'] : ''); ?>">
										
									</div>
									<?php echo form_error('level7', '<div class="form-control-feedback"><i class="icon-cancel-circle2"></i></div><span class="help-block">', '</span>'); ?>
								</div>
							</div>

							<div class="form-group  has-feedback <?php if(form_error('level8')) echo "has-error";?>">
								<label class="control-label col-lg-3 text-semibold"><?php echo $this->lang->line('plac_level8'); ?>  </label>
								<div class="col-lg-3">
									<div class="input-group">
										<input type="text" name="level8" class="form-control"  placeholder="<?php echo $this->lang->line('plac_level8'); ?>" value="<?php echo set_value('level8',isset($this->data['level8']) ? $this->data['level8'] : ''); ?>">
										
									</div>
									<?php echo form_error('level8', '<div class="form-control-feedback"><i class="icon-cancel-circle2"></i></div><span class="help-block">', '</span>'); ?>
								</div>
							</div>

							<div class="form-group  has-feedback <?php if(form_error('level9')) echo "has-error";?>">
								<label class="control-label col-lg-3 text-semibold"><?php echo $this->lang->line('plac_level9'); ?>  </label>
								<div class="col-lg-3">
									<div class="input-group">
										<input type="text" name="level9" class="form-control"  placeholder="<?php echo $this->lang->line('plac_level9'); ?>" value="<?php echo set_value('level9',isset($this->data['level9']) ? $this->data['level9'] : ''); ?>">
										
									</div>
									<?php echo form_error('level9', '<div class="form-control-feedback"><i class="icon-cancel-circle2"></i></div><span class="help-block">', '</span>'); ?>
								</div>
							</div>

							<div class="form-group  has-feedback <?php if(form_error('level10')) echo "has-error";?>">
								<label class="control-label col-lg-3 text-semibold"><?php echo $this->lang->line('plac_level10'); ?>  </label>
								<div class="col-lg-3">
									<div class="input-group">
										<input type="text" name="level10" class="form-control"  placeholder="<?php echo $this->lang->line('plac_level10'); ?>" value="<?php echo set_value('level10',isset($this->data['level10']) ? $this->data['level10'] : ''); ?>">
									</div>
									<?php echo form_error('level10', '<div class="form-control-feedback"><i class="icon-cancel-circle2"></i></div><span class="help-block">', '</span>'); ?>
								</div>
							</div>
							
							<div class="text-right col-lg-6">
								<button type="submit" class="btn btn-primary"><?php echo $this->lang->line('button_update'); ?> <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() {

			$(".switchery").bootstrapSwitch();


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

             $('.levelsetting').formValidation({
		    	framework: 'bootstrap',
		    	excluded: [':disabled'],
		        icon: {
		            valid: 'glyphicon glyphicon-ok1',
		            invalid: 'glyphicon glyphicon-remove1',
		            validating: 'glyphicon glyphicon-refresh'
		        },
		        fields: {
		        	level1: {
		                validators: {
		                    regexp: {
		                        regexp: /^[0-9.]+$/,
		                        message: '<?php echo $this->lang->line("level_comm_num_level"); ?>'
		                    }
		                }
		            },
		            level2: {
		                validators: {
		                    regexp: {
		                        regexp: /^[0-9.]+$/,
		                        message: '<?php echo $this->lang->line("level_comm_num_level"); ?>'
		                    }
		                }
		            },
		            level3: {
		                validators: {
		                    regexp: {
		                        regexp: /^[0-9.]+$/,
		                        message: '<?php echo $this->lang->line("level_comm_num_level"); ?>'
		                    }
		                }
		            },
		            level4: {
		                validators: {
		                    regexp: {
		                        regexp: /^[0-9.]+$/,
		                        message: '<?php echo $this->lang->line("level_comm_num_level"); ?>'
		                    }
		                }
		            },
		            level5: {
		                validators: {
		                    regexp: {
		                        regexp: /^[0-9.]+$/,
		                        message: '<?php echo $this->lang->line("level_comm_num_level"); ?>'
		                    }
		                }
		            },
		            level6: {
		                validators: {
		                    regexp: {
		                        regexp: /^[0-9.]+$/,
		                        message: '<?php echo $this->lang->line("level_comm_num_level"); ?>'
		                    }
		                }
		            },
		            level7: {
		                validators: {
		                    regexp: {
		                        regexp: /^[0-9.]+$/,
		                        message: '<?php echo $this->lang->line("level_comm_num_level"); ?>'
		                    }
		                }
		            },
		            level8: {
		                validators: {
		                    regexp: {
		                        regexp: /^[0-9.]+$/,
		                        message: '<?php echo $this->lang->line("level_comm_num_level"); ?>'
		                    }
		                }
		            },
		            level9: {
		                validators: {
		                    regexp: {
		                        regexp: /^[0-9.]+$/,
		                        message: '<?php echo $this->lang->line("level_comm_num_level"); ?>'
		                    }
		                }
		            },
		            level10: {
		                validators: {
		                    regexp: {
		                        regexp: /^[0-9.]+$/,
		                        message: '<?php echo $this->lang->line("level_comm_num_level"); ?>'
		                    }
		                }
		            }
		            
		        }
		    })
			
		});
	    $('#icon-bck').on('click',function() {
			window.history.back();
		});
	     $(".switch").bootstrapSwitch();
	});
	})(jQuery);

	
	</script>

</body>
</html>
