<div class="content-header">
    <div class="container-fluid">
        <div class="row column_title">
            <div class="col-md-12">
                <div class="page_title">
                    <h2><?php echo (isset($admin)) ? 'Edit Admin User' : 'Add Admin User' ?></h2>
                </div>
            </div>
        </div>
    </div>
</div>
<section class="content">
    <div class="container-fluid">
        <?php
        if(isset($admin)) {
          $action = 'updateadmin';
        }else{
          $action = 'insertadmin';
        }
      ?>
        <form method="post" id="customer_add" class="card" action="<?php echo base_url() . "admin/".$action; ?>">
            <div class="card-body">

                <div class="row">
                    <input type="hidden" name="id" id="id" value="<?=$id?>">
                    <div class="col-sm-6 col-md-6">
                        <div class="form-group">
                            <label class="form-label">Role<span class="form-required">*</span></label>
                            <select name="role" class="form-control" required="true" id="role">
                                <option value="" selected disabled>Select Role</option>
                                <option value="admin" <?php if($admin['role'] == "admin") { ?> selected<?php } ?>>Admin</option>
                                <option value="superadmin" <?php if($admin['role'] == "superadmin") { ?> selected<?php } ?>>Super Admin</option>
                            </select>
                        </div>
                    </div>
                    <div class="col-sm-6 col-md-6">
                        <div class="form-group">
                            <label class="form-label">Full Name<span class="form-required">*</span></label>
                            <input type="text" required="true" class="form-control" value="<?php echo (isset($admin)) ? $admin['name'] : '' ?>" id="c_name" name="name" placeholder="Full Name">
                        </div>
                    </div>

                    <div class="col-sm-6 col-md-6">
                        <div class="form-group">
                            <label class="form-label">Email<span class="form-required">*</span></label>
                            <input type="text" required="true" class="form-control" value="<?php echo (isset($admin)) ? $admin['email'] : '' ?>" id="email" name="email" placeholder="Email">

                        </div>
                    </div>

                    <div class="col-sm-6 col-md-6">
                        <div class="form-group">
                            <label class="form-label">Password<span class="form-required">*</span></label>
                            <input class="form-control" required="true" id="password" autocomplete="off" type="password" placeholder="Password" name="password" value="<?php echo (isset($admin)) ? $admin['password'] : '' ?>">
                        </div>
                    </div>

                    <!-- <div class="col-sm-6 col-md-6 pt-5">
                        <div class="form-check">
                            <input type="checkbox" class="form-check-input" value="true" id="sendReports" name="sendReports" <?=$admin['sendReports']===true ? 'checked' : '';?>>
                            <label class="form-check-label" for="exampleCheck1">Send this user Report Emails</label>
                        </div>
                    </div> -->
                </div>
                <?php if(!isset($admin)) { ?>
                <input type="hidden" id="createdDate" name="createdDate" value="<?php echo date('Y-m-d h:i:s'); ?>">
                <?php } ?>
                <div class="modal-footer">

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