<div class="page-content-wrapper">
                <div class="page-content">
                    <div class="page-bar">
                        <div class="page-title-breadcrumb">
                            <div class=" pull-left">
                                <div class="page-title"><?php echo 'Add Coupon'; ?></div>
                            </div>
                            <ol class="breadcrumb page-breadcrumb pull-right">
                                <li><i class="fa fa-home"></i>&nbsp;<a class="parent-item" href="index.php?page=home">Home</a>&nbsp;<i class="fa fa-angle-right"></i>
                                </li>
                                <li><a class="parent-item" href="ndex.php?page=manage_coupons">Coupons</a>&nbsp;<i class="fa fa-angle-right"></i></li><li class="active">Add Coupon</li>
                            </ol>
                        </div>
                    </div>
<div class="row">
                        <div class="col-md-12 col-sm-12">
                            <div class="card card-box">
                                <div class="card-head">
                                    <header><?php echo 'Add Coupon'; ?></header>                                    
                                </div>
                                <div class="card-body" id="bar-parent1">
                                	<?php if(isset($error) && $error!='') { ?> 
                                	<div class="alert alert-danger"><?php echo $error; ?></div>
                                	<?php } else if(isset($success) && $success!=''){ ?>                                		
                                		<div class="alert alert-success"><?php echo $success; ?></div>
                                	<?php } else if(isset($_REQUEST['success'])){ ?>                                		
                                		<div class="alert alert-success"><?php echo urldecode($_REQUEST['success']); ?></div>
                                	<?php } ?>
                                    <form action="" id="form_staff_add" class="form-horizontal" method="post">
                                        <div class="form-body">
                                        	<div class="form-group row">
                                                <label class="control-label col-md-3">Coupon Code</label>
                                                <div class="col-md-4">                                                    
                                                    <input class="form-control" type="text" name="code" id="code" value="<?php if(isset($_POST['code']) && $_POST['code']!=''){ echo $_POST['code']; } else if(isset($editRec['code']) && $editRec['code']!='') { echo $editRec['code']; }?>">
                                                </div>                                                  
                                            </div>
                                            <div class="form-group row">
                                                <label class="control-label col-md-3">Discount Type</label>
                                                <div class="col-md-2">                                               	                                                 
                                                    <input type="radio" style="width:10px;float:left; margin-right:5px" class="form-control" name="discount_type" id="discount_type_percentage" value="percentage" <?php if(isset($_POST['discount_type']) && $_POST['discount_type']=='percentage'){ echo 'checked'; } else if(isset($editRec['discount_type']) && $editRec['discount_type']=='percentage') { echo 'checked'; }?> > Percentage
                                                </div>    
                                                <div class="col-md-2">                         
                                                    <input type="radio" style="width:10px;float:left; margin-right:5px" class="form-control" name="discount_type" id="coupon_type_flat" value="flat" <?php if(isset($_POST['discount_type']) && $_POST['discount_type']=='flat'){ echo 'checked'; } else if(isset($editRec['discount_type']) && $editRec['discount_type']=='flat') { echo 'checked'; }?> > Flat
                                                </div>                                              
                                            </div>
                                            <div id="disc_per" <?php if(isset($_POST['discount_type']) && $_POST['discount_type']=='percentage'){ /*show*/ } else if(isset($editRec['discount_type']) && $editRec['discount_type']=='percentage'){ /*show*/ } else { echo 'style="display:none;"'; }?> class="form-group row">
                                                <label class="control-label col-md-3">Discount (%)</label>
                                                <div class="col-md-4">                                                    
                                                    <input class="form-control" type="text" name="discount" id="discount" value="<?php if(isset($_POST['discount']) && $_POST['discount']!=''){ echo $_POST['discount']; } else if(isset($editRec['discount']) && $editRec['discount']!='') { echo $editRec['discount']; }?>">
                                                </div>                                                  
                                            </div>  
                                            <div id="disc_amt" <?php if(isset($_POST['discount_type']) && $_POST['discount_type']=='flat'){ /*show*/ } else if(isset($editRec['discount_type']) && $editRec['discount_type']=='flat'){ /*show*/ } else { echo 'style="display:none;"'; }?> class="form-group row">
                                                <label class="control-label col-md-3">Discount Amount</label>
                                                <div class="col-md-4">                                                    
                                                    <input class="form-control" type="text" name="discount_amount" id="discount_amount" value="<?php if(isset($_POST['discount_amount']) && $_POST['discount_amount']!=''){ echo $_POST['discount_amount']; } else if(isset($editRec['discount_amount']) && $editRec['discount_amount']!='') { echo $editRec['discount_amount']; }?>">
                                                </div>                                                  
                                            </div>  
                                            <div class="form-group row">
                                                <label class="control-label col-md-3">Coupon Type</label>
                                                <div class="col-md-2">                                               	                                                 
                                                    <input type="radio" style="width:10px;float:left; margin-right:5px" class="form-control" name="coupon_type" id="coupon_type_one_time" value="one_time" <?php if(isset($_POST['coupon_type']) && $_POST['coupon_type']=='one_time'){ echo 'checked'; } else if(isset($editRec['coupon_type']) && $editRec['coupon_type']=='one_time') { echo 'checked'; }?> > One Time
                                                </div>    
                                                <div class="col-md-2">                         
                                                    <input type="radio" style="width:10px;float:left; margin-right:5px" class="form-control" name="coupon_type" id="coupon_type_multiple" value="multiple" <?php if(isset($_POST['coupon_type']) && $_POST['coupon_type']=='multiple'){ echo 'checked'; } else if(isset($editRec['coupon_type']) && $editRec['coupon_type']=='multiple') { echo 'checked'; }?> > Multiple
                                                </div>                                              
                                            </div> 
                                            <div class="form-group row">
	                                            <label class="col-md-3 control-label">Expire Date</label>	                                            
	                                            <div class="input-group date form_date col-md-4" data-date="<?php if(isset($_POST['expiry'])){ echo $_POST['expiry']; } else if(isset($editRec['end_date'])){ echo getFormattedDate($editRec['end_date']); }?>" data-date-format="dd-mm-yyyy" data-link-field="dtp_input2" data-link-format="yyyy-mm-dd">
	                                                <input class="form-control" size="16" value="<?php if(isset($_POST['expiry'])){ echo $_POST['expiry']; } else if(isset($editRec['end_date'])){ echo getFormattedDate($editRec['end_date']); }?>" type="text">
	                                                <span class="input-group-addon"><span class="fa fa-remove"></span></span>
	                                                <span class="input-group-addon"><span class="fa fa-calendar"></span></span>
	                                            </div>
	                                            <input name="expiry" id="dtp_input2" value="<?php if(isset($_POST['expiry'])){ echo $_POST['expiry']; } else if(isset($editRec['end_date'])){ echo getFormattedDate($editRec['end_date']); }?>" type="hidden">
	                                            <br>
	                                        </div>                                        
                                                                               
                                            
                                        </div>
                                      <div class="form-group">
                                            <div class="offset-md-3 col-md-9">
                                            	<?php if(isset($editId)){ ?>
                                            		<button type="submit" name="update" class="btn btn-info">Update</button>
                                            	<?php } else { ?>
                                            		<button type="submit" name="add" class="btn btn-info">Add</button>
                                            	<?php } ?>                                                                                               
                                            </div>
                                        </div>
                                    </form>
                                </div>
                            </div>
                        </div>
                    </div>
	</div>
</div>

