<div class="wrapper">
    <div class="container">
        <!-- Page-Title -->
         <div class="row">
            <div class="col-sm-12">
                <div class="btn-group pull-right m-t-15">
                    <form method="post" action="<?php echo base_url(); ?>coupon_controller/add_category">
                        <input type="hidden" name="csrf_test_name" id="coupon_add_csrf" value=""/>
                        <button type="submit" onclick="$('#coupon_add_csrf').val($('#cook').val());" class="btn btn-custom waves-effect waves-light" >Add New Category<span class="m-l-5"><i class="fa fa-plus"></i></span></button>
                    </form>
                </div>
                <h4 class="page-title">Discount Coupon Categories -  (<?php echo $business[0]['business_name'];?>):</h4>
            </div>
        </div>


        <div class="row">
            <div class="col-sm-12">
                <div class="card-box table-responsive">
                    <h4 class="header-title m-t-0 m-b-30">&nbsp;</h4>

                    <table id="tblappointments" class="table table-striped table-bordered table-responsive nowrap" cellspacing="0" width="100%">
                        <thead>
                            <tr>
                                <th>Category ID</th>
                                <th>Coupon Category</th>
                                <th>Prefix</th>
                                <th>Description</th>
                                <th>Type</th>
                                <th>Discount %</th>
                                <th>Created By</th>
                                <th>Created On</th>
                                <th class="text-success">Open</th>
                                <th class="text-primary">Used</th>
                                <th class="text-danger">Cancelled</th>
                                <th>Action</th>

                            </tr>
                        </thead>
                        <tbody>
                            <?php foreach($coupon_category as $category){ ?>
                            <tr>
                                <td><?php echo $category['id_coupon_category']; ?></td>
                                <td><?php echo $category['coupon_category']; ?></td>
                                <td><?php echo $category['coupon_category_prefix']; ?></td>
                                <td><?php echo $category['coupon_category_desc']; ?></td>
                                <td><?php echo $category['coupon_type']; ?></td>
                                <td><?php echo $category['discount_perc']; ?></td>
                                <td><?php echo $category['created_by']; ?></td>
                                <td><?php echo $category['created_on']; ?></td>
                                <td class="text-success" style="font-weight: bold;"><?php echo $category['open']; ?></td>
                                <td class="text-primary"><?php echo $category['used']; ?></td>
                                <td class="text-danger"><?php echo $category['cancelled']; ?></td>
                                
                                <td>
                                    <form method="POST" action="<?php echo base_url();?>coupon_controller/edit_category">
                                        <input type="hidden" name="category_id" value="<?php echo $category['id_coupon_category'];?>"/>
                                        <button type="submit" class="btn btn-pink btn-sm">Edit</button>
                                    </form>
                                </td>
                            </tr>
                            <?php } ?>
                        </tbody>
                    </table>
                </div>
            </div><!-- end col -->
        </div>
        <!-- end row -->
    
      
    </div>


    <script>
        var startdate = '';
        var enddate = '';
        $(document).ready(function () {

            
            $("#visit_service_date").datepicker({
                default: today,
                    autoclose: true,
                    todayHighlight: true,
                    format: 'yyyy-mm-dd'    
            });

        });


   
      
      
    </script>
