<div class="row">
    <!--  table area -->
    <div class="col-sm-12">

        <div class="panel panel-bd">

            <div class="panel-heading" >

                <div class="panel-title">
                    <h4><?php echo display('manage_award') ?></h4>
                </div>

            </div> 

            <div class="panel-body">
                <table width="100%" class="datatable table table-striped table-bordered table-hover">
                    <thead>
                        <tr>
                           <th><?php echo display('cid') ?></th>
                            <th><?php echo "Certificate Name" ?></th>
                            <th><?php echo "Certificate Number" ?></th>
                            <th><?php echo "Description" ?></th>
                            <th><?php echo "Start Date" ?></th>
                            <th><?php echo "End Date" ?></th>
                            <th><?php echo "Comments" ?></th>
                            <th>Employee Name</th>
                           <th><?php echo display('action') ?></th>
                          
                        </tr>
                    </thead>
                    <tbody>
                        <?php if (!empty($mang)) { ?>
                            <?php $sl = 1; ?>
                            <?php foreach ($mang as $row) { ?>
                                <tr class="<?php echo ($sl & 1)?"odd gradeX":"even gradeC" ?>">
                                    <td><?php echo $sl; ?></td>
                               <td><?php echo $row->certificate_name; ?></td>
                               <td><?php echo $row->certificate_number; ?></td>
                                <td><?php   $text=$row->ct_description;
                        $pieces = substr($text, 0, 20);
                        $ps = substr($pieces, 0, 16)."...";
                        $cn=strlen($text);
                        if ($cn>20) {
                          echo $ps;
                        }else
                        {
                        echo $text;
                        }

                                ?></td>
                                <td><?php echo $row->start_date; ?></td>
                                <td><?php echo $row->end_date; ?></td>
                                <td><?php echo $row->certificate_comments; ?></td>
                                <td><?php echo $row->first_name.' '.$row->last_name; ?></td>
                                                           
                                   <td class="center">
                                  
                                    <?php if($this->permission->method('certificate','update')->access()): ?>
                                        <a href="<?php echo base_url("certificate/Certificate_controller/update_certificate_form/$row->certificate_id") ?>" class="btn btn-xs btn-success"><i class="fa fa-pencil"></i></a>
                                        <?php endif; ?>
                                    
                                    <?php if($this->permission->method('award','delete')->access()): ?>  
                                        <a href="<?php echo base_url("certificate/Certificate_controller/delete_certificate/$row->certificate_id") ?>" class="btn btn-xs btn-danger" onclick="return confirm('<?php echo display('are_you_sure') ?>') "><i class="fa fa-close"></i></a>
                                         <?php endif; ?> 
                                    </td>
                                </tr>
                                <?php $sl++; ?>
                            <?php } ?> 
                        <?php } ?> 
                    </tbody>
                </table>  <!-- /.table-responsive -->
            </div>
        </div>
    </div>
</div>
 