<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($speciality)) ? 'Edit Speciality' : 'Add Speciality' ?>
                </h1>
            </div><!-- /.col -->
            <div class="col-sm-6">
                <ol class="breadcrumb float-sm-right">
                    <li class="breadcrumb-item"><a href="<?= base_url(); ?>/dashboard/specialities">Specialities</a></li>
                    <li class="breadcrumb-item active"><?php echo (isset($speciality)) ? 'Edit Speciality' : 'Add Speciality' ?></li>
                </ol>
            </div><!-- /.col -->
        </div><!-- /.row -->
    </div><!-- /.container-fluid -->
</div>
<!-- Main content -->
<section class="content">
    <div class="container-fluid">
        <?php
            if(isset($speciality)){
                $endPoint = "updatespeciality";
            }else{
                $endPoint = "insertspeciality";
            }
        ?>
        <form method="post" id="customer_add" class="card" action="<?php echo base_url() . "dashboard/".$endPoint; ?>" enctype="multipart/form-data">
            <div class="card-body">

                <div class="row">
                    <input type="hidden" name="id" id="eid" value="<?php echo (isset($speciality)) ? $speciality['id'] : '' ?>">

                    <div class="col-6">
                        <div class="form-group">
                            <label class="form-label">Name / Title</Title></label>
                            <input type="text" required="true" class="form-control" value="<?php echo (isset($speciality)) ? $speciality['name'] : '' ?>" name="name" placeholder="Speciality Name">
                        </div>
                    </div>
                    
                    <div class="col-6">
                        <div class="form-group">
                            <label class="form-label">Category</Title></label>
                            <select class="form-control" name="category" required="true">
                                <option value="" selected>Select Category</option>
                                <?php foreach ($category as $key => $value) {?>
                                   


                                <option value="<?php echo $value['name']; ?>" <?php echo (isset($speciality) && $speciality['category']==$value['name']) ? ' selected' : '' ?>><?php echo $value['name'] ?></option>
                                                                <?php }  ?>

                            </select>
                            <!-- <input type="text" required="true" class="form-control" value="<?php echo (isset($speciality)) ? $speciality['category'] : '' ?>" name="category" placeholder="Category"> -->
                        </div>
                    </div>
                </div>

                <div class="modal-footer">

                    <button type="submit" class="btn btn-primary"> <?php echo (isset($speciality)) ? 'Update Speciality' : 'Add Speciality' ?></button>
                </div>
            </div>
        </form>
    </div>
</section>
<!-- /.content -->