<?php $this->load->view("main/admin/header"); ?>
<style>
	.col-lg-12, .col-lg-6{
		float: right;
	}
</style>
<div class="col-lg-12">
<section class="panel">
        <header class="panel-heading">شرکا</header>
                            <div class="panel-body">
								<form action="<?php echo base_url(); ?>admin/set_sharik" method="post">
									<input type="hidden" value="<?php echo count($shoraka)+1; ?>" class="number" name="number">
									<?php $count=1; foreach($shoraka as $value){ ?>
									<div class="col-lg-6">
								<div class="form-group">
									
									
                                                        <label for="exampleInputEmail1">نام شریک</label>
                                                        <input type="text" name="sharikname<?php echo $count; ?>" class="form-control" value="<?php echo $value->name; ?>" id="exampleInputEmail3">
                                                    </div>
								</div>
								<div class="col-lg-6">
								<div class="form-group">
                                                        <label for="exampleInputEmail1">درصد سهم</label>
                                                        <input type="text" name="sahmpercent<?php echo $count; ?>" class="form-control" value="<?php echo $value->percent; ?>" id="exampleInputEmail3">
                                                    </div>
								</div>
									<?php $count++; } ?>
								<div class="col-lg-6">
								<div class="form-group">
									
									
                                                        <label for="exampleInputEmail1">نام شریک</label>
                                                        <input type="text" name="sharikname<?php echo count($shoraka)+1; ?>" class="form-control" id="exampleInputEmail3">
                                                    </div>
								</div>
								<div class="col-lg-6">
								<div class="form-group">
                                                        <label for="exampleInputEmail1">درصد سهم</label>
                                                        <input type="text" name="sahmpercent<?php echo count($shoraka)+1; ?>" class="form-control" id="exampleInputEmail3">
                                                    </div>
								</div>
								<div class="col-lg-12 content">
									<button class="btn btn-defult">بیشتر</button>
									<input type="submit" class="btn btn-info" value="ذخیره">
								</div>
								</form>
							</div>
</section>
</div>
<?php $this->load->view("main/admin/footer"); ?>
<script>
	$(".btn-defult").click(function(){
		$number = Number($(".number").val())+1;
		$html= '<div class="col-lg-6">';
		$html +='<div class="form-group">';
        $html += '<label for="exampleInputEmail1">نام شریک</label>';
        $html +=  '<input type="text" name="sharikname'+$number+'" class="form-control" id="exampleInputEmail3">';
        $html +=   '</div>';
		$html +=	'</div>';
		$html +=	'<div class="col-lg-6">';
		$html +=	'<div class="form-group">';
        $html +=     '<label for="exampleInputEmail1">درصد سهم</label>';
        $html +=     '<input type="text" name="sahmpercent'+$number+'" class="form-control" id="exampleInputEmail3">';
        $html +=     '</div></div>';
		$(".content").before($html);
		$(".number").val($number);
		return false;
		});
</script>