<div class="content-header">
    <div class="container-fluid">
        <div class="row mb-2">
            <div class="col-sm-6">
                <h1 class="m-0 text-dark"><?php echo (isset($plan)) ? 'Edit Subscription Plan' : 'Add Subscription Plan' ?>
                </h1>
            </div><!-- /.col -->
            <div class="col-sm-6">
                <ol class="breadcrumb float-sm-right">
                    <li class="breadcrumb-item"><a href="<?= base_url(); ?>dashboard/plans">Subscription Plans</a></li>
                    <li class="breadcrumb-item active"><?php echo (isset($plan)) ? 'Edit Subscription Plan' : 'Add Subscription Plan' ?></li>
                </ol>
            </div><!-- /.col -->
        </div><!-- /.row -->
    </div><!-- /.container-fluid -->
</div>
<!-- Main content -->
<?php
      if(isset($plan)){
        $endpoint = 'updateplan';
      }else{
        $endpoint = 'insertplan';
      }
    ?>
<section class="content">
    <div class="container-fluid">
        <form method="post" id="customer_add" class="card" action="<?php echo base_url() . "dashboard/".$endpoint; ?>">
            <div class="card-body">

                <div class="row">
                    <input type="hidden" name="id" id="id" value="<?=$id?>">

                    <div class="col-sm-6 col-md-6">
                        <label class="form-label">Title<span class="form-required">*</span></label>
                        <div class="form-group">
                            <input type="text" name="title" id="title" class="form-control" placeholder="Title" value="<?php echo $plan['title'];?>">
                        </div>
                    </div>
                    <div class="col-sm-6 col-md-6">
                        <label class="form-label">Type<span class="form-required">*</span></label>
                        <div class="form-group">
                            <input type="text" name="type" id="type" class="form-control" placeholder="Type (monthly, yearly)" value="<?php echo $plan['type'];?>">
                        </div>
                    </div>
                    <div class="col-sm-6 col-md-6">
                        <label class="form-label">Title<span class="form-required">*</span></label>
                        <div class="form-group">
                            <input type="number" name="price" id="price" class="form-control" placeholder="Price" value="<?php echo $plan['price'];?>">
                        </div>
                    </div>

                </div>

                <div class="modal-footer">

                    <button type="submit" class="btn btn-primary"> <?php echo (isset($plan)) ? 'Update Subscription Plan' : 'Add Subscription Plan' ?></button>
                </div>
            </div>
        </form>
    </div>
</section>