<?php
foreach ($all_coupon as $coupon_value) {
    $serial++;
    ?>
    <div class="col-sm-12 white" style="padding-top: 10px;padding-bottom: 10px;">
        <div class="col-sm-1"><?php echo $serial; ?></div>
        <div class="col-sm-2"><?php echo $coupon_value->coupon_name; ?></div>
        <div class="col-sm-2"><?php echo $coupon_value->coupon_code; ?></div>
        <div class="col-sm-2"><?php
            if ($coupon_value->coupon_type == 1) {
                echo 'Feature';
            } else if ($coupon_value->coupon_type == 2) {
                echo 'Course';
            } else if ($coupon_value->coupon_type == 3) {
                echo 'Video Course';
            }
            ?></div>
        <div class="col-sm-2"><?php
            if ($coupon_value->coupon_price_type == 1) {
                echo 'Percentage';
            } else if ($coupon_value->coupon_price_type == 2) {
                echo 'Fixed';
            }
            ?></div>
        <div class="col-sm-2"><?php
            if ($coupon_value->coupon_expire_type == 1) {
                echo 'Number';
            } else if ($coupon_value->coupon_expire_type == 2) {
                echo 'Date';
            }
            ?></div>
        <div class="col-sm-1" id="coupon_status_view<?php echo $coupon_value->coupon_id; ?>">
            <?php
            if ($coupon_value->coupon_status == 1) {
                ?>
                <a href="javascript:void(0)"
                   onclick="checkStatus('<?php echo base_url() . 'check-coupon-status' ?>', 'Inactive', '<?php echo $coupon_value->coupon_id; ?>')"
                   ><i class="fa fa-user-times" title="Inacitve"></i></a>
                   <?php
               } else if ($coupon_value->coupon_status == 2) {
                   ?>
                <a href="javascript:void(0)"
                   onclick="checkStatus('<?php echo base_url() . 'check-coupon-status' ?>', 'Active', '<?php echo $coupon_value->coupon_id; ?>')"
                   ><i class="fa fa-user-plus" title="Acitve"></i></a>
                   <?php
               }
               ?>
            <a href="javascript:void(0)"
               onclick="checkStatus('<?php echo base_url() . 'check-coupon-status' ?>', 'Delete', '<?php echo $coupon_value->coupon_id; ?>')"
               ><i class="fa fa-trash-o" title="Delete"></i></a>
            <a href="<?php echo base_url() . 'edit-coupon/' . $coupon_value->coupon_code ?>"><i class="fa fa-edit" title="Edit"></i></a>
        </div>
    </div>
    <div class="col-sm-12"><br></div> 
    <?php
}