<link rel="stylesheet" href="<?php echo base_url();?>assets/css/cust_paginition.css" type="text/css" />
<script src="<?php echo base_url(); ?>assets/library/jquery/jquery.min.js"></script>
<div class="layout-app">
    <div class="container"><div class="row row-app">
            <div class="col-md-12">
                <div class="col-separator col-separator-first col-unscrollable bg-none">
                    <div class="col-table">
                        <div class="row">
                            <div class="col-md-12">
                                <div class="widget">
                                    <?php $this->load->view('admin/flashdata_admin'); ?>
                                    <div class="widget-head">
                                        <h4 class="heading">Comments</h4>

                                    </div>
                                    <form action="<?php echo base_url();?>index.php/subscriber/add_comment_subscriber" method="post" >
                                        <div class="form-group mmar">
                                            <label  class="col-sm-3 control-label text-left">Comment: </label>
                                            <div class="col-sm-9">
                                                <textarea class="form-control" id="message_desc" name="message_desc" required="required"></textarea>
                                            </div>
                                        </div>
                                        <div style="clear: both"></div>
                                        <div class="form-group mmar">
                                            <div class="col-sm-offset-4 col-sm-8">
                                                <input type="hidden" id="system_base_url" value="<?php echo base_url();?>">
                                                <input type="hidden" name="subscriber_enc_id" value="<?php echo $str_given_userId;?>">
                                                <button type="submit" class="btn btn-primary" id="add_comments">Submit</button>
                                            </div><br>
                                            <div style="clear: both">
                                        </div>
                                    </form>
                                    <div class="widget-body">
                                        <div class="widget-head">
                                            <h5 class="heading">Previous Comments</h5>

                                        </div>
                                        <div style="clear: both"></div>
                                        <?php if (count($comments) > 0) { $intCommentCount = 1; ?>
                                            <?php foreach($comments as $comment) { ?>
                                                <div class="form-group mmar">
                                                    <div class="col-sm-9" style="text-align: justify;width: 100%">
                                                        <?php echo $comment['comment']; ?>
                                                    </div>

                                                    <div style="margin-top: 10px !important;" class="custom-table-pro">
                                                        <table style="display: inline-block">
                                                            <colgroup>
                                                                <col width="30%" style="display: table-cell">
                                                                <col width="30%" style="display: table-cell">
                                                                <col width="30%" style="display: table-cell">
                                                            </colgroup>
                                                            <tr>
                                                                <td><small><b>Commented By - </b> <?php echo $users[$comment['comment_by']]; ?></small></td>
                                                                <td><small><b>Commented On - </b> <?php echo date("Y M d H:i:s", $comment['comment_date_time']); ?> </small></td>
                                                                <td><small><b>Category - </b> <?php echo ucfirst($comment['comment_type']); ?> <?php if($comment['comment_type'] == 'transaction') { echo "(id ".$comment['transaction_id'].")"; } ?></small></td>
                                                            </tr>
                                                        </table>
                                                    </div>
                                                    <div style="clear: both"></div>
                                                </div>
                                                <?php if ($intCommentCount < count($comments)) {?>
                                                    <hr>
                                                <?php } ?>
                                            <?php $intCommentCount++; } ?>
                                        <?php } ?>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <script src="<?php echo base_url(); ?>assets/library/jquery/jquery.min.js"></script>
        <script src="<?php echo base_url(); ?>assets/js/subscriber.js"></script>