<?php $__env->startSection('content'); ?>

<div class="content-area">

    <div class="card">
        <div class="d-sm-flex align-items-center justify-content-between">
        <h5 class=" mb-0 text-gray-800 pl-3"><?php echo e(__('Messages')); ?> <a class="btn btn-primary btn-rounded btn-sm" href="<?php echo e(route('instructor-messages')); ?>"><i class="fas fa-arrow-left"></i> <?php echo e(__('Back')); ?></a></h5>
        <ol class="breadcrumb">
            <li class="breadcrumb-item"><a href="<?php echo e(route('instructor-dashboard')); ?>"><?php echo e(__('Dashboard')); ?></a></li>
            <li class="breadcrumb-item"><a href="javascript:;"><?php echo e(__('Messages')); ?></a></li>
        </ol>
        </div>
    </div>

    <div class="order-table-wrap support-ticket-wrapper ">
        <div class="panel panel-primary">
        <div class="gocover" style="background: url(<?php echo e(asset('assets/images/'.$gs->admin_loader)); ?>) no-repeat scroll center center rgba(45, 45, 45, 0.5);"></div>
        <?php echo $__env->make('includes.admin.form-both', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>
            <div class="panel-body" id="messages">

                <?php $__currentLoopData = $conv->messages; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $message): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                <?php if($message->sent_user != null): ?>

                <div class="single-reply-area admin">
                    <div class="row">
                        <div class="col-lg-12">
                            <div class="reply-area">
                                <div class="left">
                                    <?php if($message->conversation->sent->is_provider == 1 ): ?>
                                    <img class="img-circle" src="<?php echo e($message->conversation->sent->photo != null ? $message->conversation->sent->photo : asset('assets/images/noimage.png')); ?>" alt="">
                                    <?php else: ?>
                                    <img class="img-circle" src="<?php echo e($message->conversation->sent->photo != null ? asset('assets/images/users/'.$message->conversation->sent->photo) : asset('assets/images/noimage.png')); ?>" alt="">
                                    <?php endif; ?>
                                    <p class="ticket-date"><?php echo e($message->conversation->sent->first_name . $message->conversation->sent->last_name); ?></p>
                                </div>
                                <div class="right">
                                    <p><?php echo e($message->message); ?></p>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>


                <br>
                <?php else: ?>

                <div class="single-reply-area user">
                    <div class="row">
                        <div class="col-lg-12">
                            <div class="reply-area">
                                <div class="left">
                                    <p><?php echo e($message->message); ?></p>
                                </div>
                                <div class="right">
                                    <?php if($message->conversation->recieved->is_provider == 1 ): ?>
                                    <img class="img-circle" src="<?php echo e($message->conversation->recieved->photo != null ? $message->conversation->recieved->photo : asset('assets/images/noimage.png')); ?>" alt="">
                                    <?php else: ?>
                                    <img class="img-circle" src="<?php echo e($message->conversation->recieved->photo != null ? asset('assets/images/users/'.$message->conversation->recieved->photo) : asset('assets/images/noimage.png')); ?>" alt="">
                                    <?php endif; ?>
                                    <p class="ticket-date"><?php echo e($message->conversation->recieved->first_name . $message->conversation->recieved->last_name); ?></p>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>



                <br>
                <?php endif; ?>
                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
            </div>
            <div class="panel-footer">
                <form id="messageform" data-href="<?php echo e(route('student-message-load',$conv->id)); ?>" action="<?php echo e(route('student-message-post')); ?>" method="POST">
                    <?php echo e(csrf_field()); ?>

                    <div class="form-group">
                        <input type="hidden" name="conversation_id" value="<?php echo e($conv->id); ?>">
                        <?php if($user->id == $conv->sent_user): ?>
                        <input type="hidden" name="sent_user" value="<?php echo e($conv->sent->id); ?>">
                        <input type="hidden" name="reciever" value="<?php echo e($conv->recieved->id); ?>">
                      <?php else: ?>
                        <input type="hidden" name="reciever" value="<?php echo e($conv->sent->id); ?>">
                        <input type="hidden" name="recieved_user" value="<?php echo e($conv->recieved->id); ?>">
                    <?php endif; ?>

                        <textarea class="form-control" name="message" id="wrong-invoice" rows="5" style="resize: vertical;" required="" placeholder="<?php echo e(__('Message')); ?>"></textarea>
                    </div>
                    <div class="form-group">
                        <button class="btn btn-success">
                            <?php echo e(__('Add Reply')); ?>

                        </button>
                    </div>
                </form>
            </div>
        </div>
    </div>

<?php $__env->stopSection(); ?>

<?php echo $__env->make('layouts.instructor', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH /home/royaldem/public_html/project/resources/views/instructor/message/create.blade.php ENDPATH**/ ?>