<?php
$atts = array(
              'width'      => '600',
              'height'     => '600',
              'scrollbars' => 'yes',
              'status'     => 'no',
              'resizable'  => 'no',
              'screenx'    => '20',
              'screeny'    => '50'
            );
?>

<div class="col-sm-9 col-sm-offset-3 col-md-10 col-md-offset-2 main">
    <div class="panel panel-default">
        <div class="panel panel-heading"><strong><h4>Conference Officers</h4></strong> <?php echo anchor_popup('admin/addOfficer','Add New Officer',array('width'=>'600','height'=>'600','scrollbars' => 'yes','status'=> 'no','resizable'  => 'no','screenx'    => '20','screeny'    => '50','class'=>'btn btn-primary new')); ?></div>
        <div class="panel panel-body">
            
            <?php
            echo form_open('admin/addOfficer');
            ?>
            <div id="addShow" style="display:none">
                <div class="input-group">
                    <span class="input-group-addon">Surname</span>
                    <input type="text" name="surname" class="form-control" required />
                </div>
                <div class="input-group">
                    <span class="input-group-addon">Other Names</span>
                    <input type="text" name="othernames" class="form-control" required />
                </div>
                <div class="input-group">
                    <span class="input-group-addon">Email</span>
                    <input type="email" name="email" class="form-control" required />
                </div>
                <div class="input-group">
                    <span class="input-group-addon">Phone</span>
                    <input type="number" name="phone" class="form-control" required />
                </div>
                <div class="input-group">
                    <span class="input-group-addon">Username</span>
                    <input type="text" name="username" class="form-control" required />
                </div>
                <div class="input-group">
                    <span class="input-group-addon">Password</span>
                    <input type="password" name="password" class="form-control" required />
                </div>
                <div class="input-group">
                    
                    <input type="submit" name="submit" value="Add Officer" class="btn btn-primary" />
                </div>
                <?php echo form_close(); ?>
            </div>
            <?php
            if(!empty($officers)){
                ?>
            <table class="table table-striped">
                <tr><th>S/No</th><th>Name</th><th>Role</th><th>Edit</th></tr>
                <?php
                $sno=0;
                foreach($officers as $row){ $sno++;
                ?>
                <tr><td><?php echo $sno; ?></td><td><?php echo $row['surname']." ".$row['othernames']; ?></td><td><?php echo $row['confroleName']; ?></td><td><?php echo anchor_popup('admin/editOfficer/'.$row['id'],'<i class="fa fa-edit"></i>Edit',$atts); ?></td></tr>
                <?php } ?>
            </table> 
            <?php }else{ echo "<pre><span>No Officer Found</span></pre>"; } ?>
        </div>
        <div class="panel panel-footer"></div>
    </div>
          
          
        </div>
<script>
$(document).ready(function(){
    $(".new").click(function(){
        $("#addShow").toggle(1000);
    })
})
</script>
    