<div class="table-responsive">
    <table class="table table-striped" id="datatbl1">
        <thead>
            <tr>
                <th style="text-align: center;" class="align-middle">Message</th>
                <th style="text-align: left;" class="align-middle">Msg User</th>
                <th style="text-align: left;" class="align-middle">User By</th>
                <th style="text-align: left;" class="align-middle">Notes</th>
        </thead>
        <tbody>
            <?php $i = 0 ?>
            <?php $__currentLoopData = $flags; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $flag): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
            <tr>
                <?php 
                $i = $i + 1;
                $msg=$flag->msg;
                $userBy=$flag->userBy;
                $msgUser=$flag->msgUser;
                ?>
                <td style="text-align: center;" class="align-middle">
                    <audio controls src="<?php echo e($msg->msg); ?>"></audio>
                </td>
                <td style="text-align: left;" class="align-middle">
                    <p class="mb-0"><?php echo $msgUser->fname; ?></p><small><?php echo e($msgUser->unique_id); ?></small>
                </td>
                <td style="text-align: left;" class="align-middle">
                    <p class="mb-0"><?php echo $userBy->fname; ?></p><small><?php echo e($userBy->unique_id); ?></small>
                    <a href="javascript:void(0);" class="msgToUserBy" data-msgflag="<?php echo e($flag->mf_id); ?>" 
                       data-userBy="<?php echo e($userBy->fname); ?>">
                        <i class="fa fa-bell ml-2"></i></a>
                </td>
                <td style="text-align: left;" class="align-middle">
                    <a href="javascript:void(0)" title="<?php echo e($flag->notes); ?>" class="text-black">
                        <?php echo e(strlen($flag->notes)>50?substr($flag->notes,0,49).'...':$flag->notes); ?></a>
                </td>
            </tr>
            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
        </tbody>
    </table>
</div>
<div class="modal fade" id="flagMsgModal" tabindex="-1" aria-hidden="true">
    <div class="modal-dialog">
        <form action="<?php echo e(route('flags.userNotify')); ?>" method="post">
            <?php echo csrf_field(); ?>
        <div class="modal-content">
           <div class="modal-header">
               <h5 class="modal-title">Notify to <b><span id="userName"></span></b></h5>
           </div>
           <div class="modal-body">
               <input type="hidden" name="mf_id" id="msgFlagId">
               <textarea class="form-control" name="notify_msg" id="msgFlagNotes" placeholder="Enter notify message"></textarea>
           </div>
           <div class="modal-footer">
               <button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
               <button type="submit" class="btn btn-primary">Send</button>
           </div>
        </div>
        </form>
    </div>
</div>
<?php $__env->startPush('page_scripts'); ?>
    <script>
        $(document).on('click', '.msgToUserBy', function (){
            $('#msgFlagId').val($(this).attr('data-msgflag'))
            $('#userName').html($(this).attr('data-userBy'))
            $('#msgFlagNotes').val('')
            $('#flagMsgModal').modal('show')
        })
    </script>
<?php $__env->stopPush(); ?>

<?php /**PATH /var/www/html/voice_buddies/resources/views/admin/flags/table.blade.php ENDPATH**/ ?>