<?php $this->load->view("main/drs/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="./set_khadamat_control" method="post">
									<input type="hidden" value="<?php echo count($khadamat)+1; ?>" class="number" name="number">
									<?php $count=1; foreach($khadamat as $value){ ?>
									<div class="col-lg-12">
								<div class="form-group">
									
									
                                                        <label for="exampleInputEmail1">نام خدمات</label>
                                                        <input type="text" name="insurename<?php echo $count; ?>" class="form-control" value="<?php echo $value->khdamat_name; ?>" id="exampleInputEmail3">
                                                    </div>
								</div>
								
									<?php $count++; } ?>
								<div class="col-lg-12">
								<div class="form-group">
									
									
                                                        <label for="exampleInputEmail1">نام خدمات</label>
                                                        <input type="text" name="insurename<?php echo count($khadamat)+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/drs/footer"); ?>
<script>
	$(".btn-defult").click(function(){
		$number = Number($(".number").val())+1;
		$html= '<div class="col-lg-12">';
		$html +='<div class="form-group">';
        $html += '<label for="exampleInputEmail1">نام خدمات</label>';
        $html +=  '<input type="text" name="insurename'+$number+'" class="form-control" id="exampleInputEmail3">';
        $html +=   '</div>';
		$html +=	'</div>';
        $html +=     '</div>';
		$(".content").before($html);
		$(".number").val($number);
		return false;
		});
</script>