<!-- Begin Page Content -->
<div class="container-fluid">
    <div class="row column_title">
        <div class="col-md-12">
            <div class="page_title">
                <h2>All Chat Images</h2>
            </div>
        </div>
    </div>

    <div class="card shadow mb-4">
        <div class="card-header py-3">
            <!-- <h6 class="m-0 font-weight-bold text-primary">DataTables Example</h6> -->
        </div>
        <div class="card-body">
            <div class="table-responsive">
                <table class="table table-bordered" id="songTable" width="100%" cellspacing="0">
                    <thead class="thead-dark">
                        <tr>
                            <th>Sent From</th>
                            <th>Sent To</th>
                            <th>Image</th>
                        </tr>
                    </thead>
                    <tbody>
                        <?php
                        if (!empty($chatImages)) {
                            $count = 1;
                            foreach ($chatImages as $image) {
                        ?>
                        <tr>
                            <td><?php echo trim($image['from'])?$image['from']:'(user deleted)'; ?></td>
                            <td><?php echo trim($image['to'])?$image['to']:'(user deleted)'; ?></td>
                            <td>
                                <a href="<?=$image['image']?>" target="_blank">
                                    <img class="img-thumbnail" width="200" height="200" src="<?php echo $image['image']; ?>">
                                </a>
                            </td>
                        </tr>
                        <?php }
                        } ?>
                    </tbody>
                </table>
            </div>
        </div>
    </div>

</div>
<!-- /.container-fluid -->