    <div class="content-header">
        <div class="container-fluid">
            <div class="row mb-2">
                <div class="col-sm-6">
                    <div class="img-profile ml-3">

                    </div>
                    <h1 class="m-0 text-dark"><?php echo (isset($news)) ? 'Edit News' : 'Add News' ?>
                    </h1>

                </div><!-- /.col -->
                <div class="col-sm-6">
                    <ol class="breadcrumb float-sm-right">
                        <li class="breadcrumb-item"><a href="<?= base_url(); ?>/news">News</a></li>
                        <li class="breadcrumb-item active"><?php echo (isset($news)) ? 'Edit News' : 'Add News' ?></li>
                    </ol>
                </div><!-- /.col -->
            </div><!-- /.row -->
        </div><!-- /.container-fluid -->
    </div>
    <?php
      if(isset($news)){
        $endpoint = 'updatenews';
      }else{
        $endpoint = 'insertnews';
      }
    ?>
    <form method="post" id="add_news" class="card" action="<?php echo base_url() . "news/".$endpoint; ?>" enctype="multipart/form-data">
        <!-- Main content -->
        <section class="content">
            <div class="container-fluid">
                <div class="card-body">

                    <div class="row">
                        <input type="hidden" name="newsId" id="newsId" value="<?=isset($news['newsId']) ? $news['newsId'] : ''?>">

                        <div class="col-sm-12 col-md-12">
                            <label class="form-label">News Title<span class="form-required">*</span></label>
                            <div class="form-group">
                                <input type="text" name="title" id="title" class="form-control" placeholder="Enter news title" value="<?=isset($news['title']) ? $news['title'] : ''?>" required>
                            </div>
                        </div>

                        <div class="col-sm-12 col-md-12">
                            <div class="form-group">
                                <label class="form-label">Description<span class="form-required">*</span></label>
                                <textarea name="description" id="description" class="form-control" rows="5" placeholder="Enter news description" required><?=isset($news['description']) ? $news['description'] : ''?></textarea>
                            </div>
                        </div>

                        <div class="col-sm-6 col-md-6">
                            <div class="form-group">
                                <label class="form-label">News Date<span class="form-required">*</span></label>
                                <input type="date" name="newsDate" id="newsDate" class="form-control" value="<?=isset($news['newsDate']) ? date('Y-m-d', $news['newsDate'] / 1000) : ''?>" required>
                            </div>
                        </div>

                        <div class="col-sm-6 col-md-6">
                            <div class="form-group">
                                <label class="form-label">Status</label>
                                <select name="isActive" id="isActive" class="form-control">
                                    <option value="true" <?=isset($news['isActive']) && $news['isActive'] == true ? 'selected' : ''?>>Active</option>
                                    <option value="false" <?=isset($news['isActive']) && $news['isActive'] == false ? 'selected' : ''?>>Inactive</option>
                                </select>
                            </div>
                        </div>
                    </div>

                </div>

            </div>
        </section>
        <!-- /.content -->

        <!-- Main content -->
        <section class="content">
            <div class="container-fluid">

                <div class="card-footer text-right">
                    <button type="submit" class="btn btn-primary"> <?php echo (isset($news)) ? 'Update News' : 'Add News' ?></button>
                </div>
            </div>
        </section>
        <!-- /.content -->
    </form>
