<?php  $this->load->view('master/common/header.php',$data);
$base_name = $data['base_name'];
?>

    <div class="content">
        
        <!-- Start Content-->
        <div class="container-fluid">
            
            <!-- start page title -->
            <div class="row">
                <div class="col-12">
                    <div class="page-title-box">
                        <div class="page-title-right">
                            <ol class="breadcrumb m-0">
                                <li class="breadcrumb-item"><a href="javascript: void(0);"><?= $base_name;?></a></li>
                                <li class="breadcrumb-item active text-capitalize"><?= $page;?></li>
                            </ol>
                        </div>
                        <h4 class="page-title text-uppercase"><?= $page;?></h4>
                    </div>
                </div>
            </div>     
            <!-- end page title --> 

            <div class="row">
                <div class="col-md-12 col-xl-12">
                    <div class="card-box">
                        <div class="row">
                            <div class="col-sm-12">
                                <form class="form-horizontal" action="<?= base_url('master/coupon/edit_content/'.$coupon['coupon_id']);?>" method="post" enctype="multipart/form-data">
                                    <input type="hidden" name="table" value="tbl_coupon" />
                                    <input type="hidden" name="page" value="coupon/edit/<?=$coupon['coupon_id'];?>" />
                                    <input type="hidden" name="column" value="coupon_id" />
                                    
                                    <h4 class="header-title mb-4">Coupon</h4>
                                    <div class="row">
                                        <div class="col-sm-6">
            					            <div class="form-group">
                    							<label for="" class="control-label">Coupon Title <span>*</span></label>
                    							<div class="col-sm-12">
                    								<input type="text" class="form-control" name="title" value="<?=$coupon['title'];?>" required>
                    							</div>
                    						</div>
            					        </div>
            					        <div class="col-sm-6">
            					            <div class="form-group">
                    							<label for="" class="control-label">Coupon Code <span>*</span></label>
                    							<div class="col-sm-12">
                    								<input type="text" class="form-control" name="code" value="<?=$coupon['code'];?>" required>
                    							</div>
                    						</div>
            					        </div>
            					        <div class="col-sm-6">
            					            <div class="form-group">
                    							<label for="" class="control-label">Coupon Discount (in %) <span>*</span></label>
                    							<div class="col-sm-12">
                    								<input type="number" class="form-control" max="99" min="1" step="1" value="<?=$coupon['percentage'];?>" name="percentage"required>
                    							</div>
                    						</div>
            					        </div>
            					        <div class="col-sm-6">
            					            <div class="form-group">
                    							<label for="" class="control-label">Minimum Amount When Apply Coupon<span>*</span></label>
                    							<div class="col-sm-12">
                    								<input type="number" class="form-control" max="999" min="1" step="1" value="<?=$coupon['min_amt'];?>" name="min_amt"required>
                    							</div>
                    						</div>
            					        </div>
            					        <div class="col-sm-6">
            					            <div class="form-group">
                    							<label for="" class="control-label">Coupon Validity Start <span>*</span></label>
                    							<div class="col-sm-12">
                    								<input type="date" class="form-control" name="start_date" value="<?=$coupon['start_date'];?>" readonly required>
                    							</div>
                    						</div>
            					        </div>
            					        <div class="col-sm-6">
            					            <div class="form-group">
                    							<label for="" class="control-label">Coupon Validity End <span>*</span></label>
                    							<div class="col-sm-12">
                    								<input type="date" class="form-control" name="end_date" min="<?=$coupon['start_date'];?>" value="<?=$coupon['end_date'];?>" required>
                    							</div>
                    						</div>
            					        </div>
            					        
            					        <div class="col-sm-12"><label for="" class="control-label">Status <span>*</span></label></div>
            					        <div class="col-sm-6">
                                            <div class="form-group">
                                                <div class="custom-control custom-radio float-left">
                									<input class="custom-control-input" value="1" type="radio" id="statusActive" name="status"  <?php echo ($coupon['status'] == 1) ? 'checked' : '';?>>
                									<label for="statusActive" class="custom-control-label">Active</label>
                								</div>
                								<div class="custom-control custom-radio float-left ml-3">
                									<input class="custom-control-input" value="0" type="radio" id="statusBlock" name="status" <?php echo ($coupon['status'] == 0) ? 'checked' : '';?>>
                									<label for="statusBlock" class="custom-control-label">Block</label>
                								</div>
                                            </div>
            					        </div>
        					        </div>
                                    <div class="form-group">
                                        <button type="submit" class="btn btn-success float-right m-2">Submit</button>
                                        <a href="<?php echo base_url().'master/coupon/'?>" class="btn float-right m-2 btn-secondary" title="">Back</a>
                                    </div>
                                
                                </form>
				            </div>
					    </div>
					</div>
				</div>
				<!-- /.col-md-6 -->
			</div>
			<!-- /.row -->
		</div>
		<!-- /.container-fluid -->
	</div>
	<!-- /.content -->
</div>
<!-- /.content-wrapper -->
<?php $this->load->view('master/common/footer.php'); ?>
