</aside>
<script>
        window.onunload = refreshParent;
        function refreshParent() {
            window.opener.location.reload();
            
        }
    </script>
<div class="col-sm-9 col-sm-offset-3 col-md-10 col-md-offset-2 main">
    <?php
    if(!empty($msg)){ ?>
    <div class="alert alert-success">
        <?php echo $msg; ?>
    </div>
    <?php } ?>
                   <div class="panel panel-primary">
                    <div class="panel panel-heading"><strong>Add Officer</strong></div>
                    <div class="panel panel-body">
                        <div class="col-lg-12">
                            <?php
                            echo form_open('admin/insertOfficer'); ?>
                            <div class="input-group" style="margin-bottom: 10px !important">
                                 <span class="input-group-addon">Title</span>
                                  <select name="title" id="title" class="form-control">
                            <option value="">Select Title/Prefix</option>
                            <option value="Prof."<?php if($row['title']=='Prof'){echo "selected";}?>>Prof.</option>
                            <option value="Dr." <?php if($row['title']=='Dr.'){echo "selected";}?>>Dr.</option>
                            <option value="Mr." <?php if($row['title']=='Mr.'){echo "selected";}?>>Mr.</option>
                            <option value="Mrs." <?php if($row['title']=='Mrs.'){echo "selected";}?>>Mrs.</option>
                            <option value="Miss." <?php if($row['title']=='Miss.'){echo "selected";}?>>Miss.</option>
                            <option value="Engr." <?php if($row['title']=='Engr.'){echo "selected";}?>>Engr.</option>
                        </select>
                        </div>
                            <div class="input-group" style="margin-bottom: 10px !important">
                                 <span class="input-group-addon">Surname</span>
                           <input value="<?php echo $row['surname']; ?>"
                               name="surname"
                               id="surname"
                               class="form-control"
                               placeholder="Enter Surname"
                               required>    
                           <input type="hidden" name="id" value="<?php echo $row['id']; ?>" />
                        </div>
                            <div class="input-group" style="margin-bottom: 10px !important">
                                 <span class="input-group-addon">Other Names</span>
                           <input value="<?php echo $row['othernames']; ?>"
                               name="othernames"
                               id="othernames"
                               class="form-control"
                               placeholder="Enter Other Names"
                               required>       
                        </div>
                            <div class="input-group" style="margin-bottom: 10px !important">
                                 <span class="input-group-addon">Username</span>
                           <input value="<?php echo $row['username']; ?>"
                               name="username"
                               id="surname"
                               class="form-control"
                               placeholder="Enter Username"
                               required>       
                        </div>
                            <div class="input-group" style="margin-bottom: 10px !important">
                                 <span class="input-group-addon">Password</span>
                                 <input type="password"
                               name="password"
                               id="surname"
                               class="form-control"
                               
                               required>       
                        </div>
                               <div class="input-group" style="margin-bottom: 10px !important">
                                 <span class="input-group-addon">Role</span>
                                 <select name="role" class="form-control" required>
                                     <option value="">Select role</option>
                                     <?php
                                     foreach($roles as $r){ ?>
                                     <option value="<?php echo $r['confroleID']; ?>"><?php echo $r['confroleName'];?></option>
                                     <?php } ?>
                                 </select>     
                        </div>
                            <div class="input-group" style="margin-bottom: 10px !important">
                                 <input type="submit" name="submit" class="btn btn-primary" value="Add Officer" />       
                        </div>
                            <?php echo form_close(); ?>
                        </div>
                       
                    </div>
                   </div>
</div>