

<?php $__env->startSection('content'); ?>
<div class="content-area">
    <div class="mr-breadcrumb">
        <div class="row">
            <div class="col-lg-12">
                <h4 class="heading"><?php echo e(__('Free Consultancy Requests')); ?></h4>
                <ul class="links">
                    <li><a href="<?php echo e(route('admin.dashboard')); ?>"><?php echo e(__('Dashboard')); ?></a></li>
                    <li><a href="javascript:;"><?php echo e(__('Consultancy')); ?></a></li>
                </ul>
            </div>
        </div>
    </div>

    <div class="product-area">
        <div class="row">
            <div class="col-lg-12">
                <div class="mr-table allproduct">
                    
                    
                    <?php if(Session::has('success')): ?>
                        <div class="alert alert-success alert-dismissible fade show" role="alert" style="background: #28a745; color: #fff; border: none;">
                            <strong>সফল!</strong> <?php echo e(Session::get('success')); ?>

                            <button type="button" class="close" data-dismiss="alert" aria-label="Close">
                                <span aria-hidden="true">&times;</span>
                            </button>
                        </div>
                    <?php endif; ?>

                    <div class="table-responsive">
                        <table class="table table-hover" style="width:100%">
                            <thead>
                                <tr style="background: #ff6600; color: #fff;">
                                    <th><?php echo e(__('Name')); ?></th>
                                    <th><?php echo e(__('Phone')); ?></th>
                                    <th><?php echo e(__('Status')); ?></th>
                                    <th><?php echo e(__('Action')); ?></th>
                                </tr>
                            </thead>
                            <tbody>
                                <?php $__empty_1 = true; $__currentLoopData = $data; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $row): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); $__empty_1 = false; ?>
                                <tr>
                                    <td><?php echo e($row->name); ?></td>
                                    <td><?php echo e($row->phone); ?></td>
                                    <td>
                                        <?php if($row->status == 0): ?>
                                            <span class="badge badge-warning" style="background: #ffc107; color: #000; padding: 5px 10px; border-radius: 4px;">Pending</span>
                                        <?php else: ?>
                                            <span class="badge badge-success" style="background: #28a745; color: #fff; padding: 5px 10px; border-radius: 4px;">Completed</span>
                                        <?php endif; ?>
                                    </td>
                                    <td>
                                        <div class="action-list" style="display: flex; gap: 5px;">
                                            
                                            <a href="javascript:;" class="btn btn-info btn-sm text-white" 
                                               data-toggle="modal" data-target="#consultancyModal<?php echo e($row->id); ?>" 
                                               style="background: #17a2b8; border: none; border-radius: 3px;" title="View Details">
                                                <i class="fas fa-eye"></i> View
                                            </a>

                                            <?php if($row->status == 0): ?>
                                            <a href="<?php echo e(route('admin.consultancy.status', [$row->id, 1])); ?>" class="btn btn-success btn-sm" title="Mark as Completed">
                                                <i class="fas fa-check"></i>
                                            </a>
                                            <?php else: ?>
                                            <a href="<?php echo e(route('admin.consultancy.status', [$row->id, 0])); ?>" class="btn btn-warning btn-sm text-white" title="Mark as Pending">
                                                <i class="fas fa-undo"></i>
                                            </a>
                                            <?php endif; ?>
                                            
                                            <a href="<?php echo e(route('admin.consultancy.delete', $row->id)); ?>" onclick="return confirm('আপনি কি নিশ্চিত যে এটি ডিলিট করতে চান?')" class="btn btn-danger btn-sm">
                                                <i class="fas fa-trash-alt"></i>
                                            </a>
                                        </div>
                                    </td>
                                </tr>

                                <div class="modal fade" id="consultancyModal<?php echo e($row->id); ?>" tabindex="-1" role="dialog" aria-hidden="true">
                                    <div class="modal-dialog modal-dialog-centered" role="document">
                                        <div class="modal-content" style="border-radius: 15px; border: none;">
                                            <div class="modal-header" style="background: #ff6600; color: #fff; border-radius: 15px 15px 0 0;">
                                                <h5 class="modal-title fw-bold"><i class="fas fa-info-circle me-2"></i> রিকোয়েস্ট ডিটেইলস</h5>
                                                <button type="button" class="close text-white" data-dismiss="modal" aria-label="Close">
                                                    <span aria-hidden="true">&times;</span>
                                                </button>
                                            </div>
                                            <div class="modal-body p-4">
                                                <div class="mb-3">
                                                    <label class="fw-bold text-muted small text-uppercase">গ্রাহকের নাম:</label>
                                                    <p class="h6 fw-bold" style="color: #1a1a1a;"><?php echo e($row->name); ?></p>
                                                </div>
                                                <div class="row mb-3">
                                                    <div class="col-6">
                                                        <label class="fw-bold text-muted small text-uppercase">ফোন নাম্বার:</label>
                                                        <p class="fw-bold"><?php echo e($row->phone); ?></p>
                                                    </div>
                                                    <div class="col-6">
                                                        <label class="fw-bold text-muted small text-uppercase">ইমেইল:</label>
                                                        <p><?php echo e($row->email ?? 'N/A'); ?></p>
                                                    </div>
                                                </div>
                                                <div class="mb-3">
                                                    <label class="fw-bold text-muted small text-uppercase">আবেদনের সময়:</label>
                                                    <p class="small"><?php echo e($row->created_at ? $row->created_at->format('d M, Y - h:i A') : 'N/A'); ?></p>
                                                </div>
                                                <hr>
                                                <div class="mb-0">
                                                    <label class="fw-bold text-muted small text-uppercase">বার্তা / মেসেজ:</label>
                                                    <div class="p-3 bg-light mt-2" style="border-radius: 10px; border-left: 4px solid #ff6600; font-style: italic;">
                                                        <?php echo e($row->message ?? 'কোনো মেসেজ প্রদান করা হয়নি।'); ?>

                                                    </div>
                                                </div>
                                            </div>
                                            <div class="modal-footer" style="border: none;">
                                                <button type="button" class="btn btn-secondary px-4 shadow-sm" data-dismiss="modal" style="border-radius: 8px;">বন্ধ করুন</button>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); if ($__empty_1): ?>
                                <tr>
                                    <td colspan="4" class="text-center py-5 text-muted">কোনো কনসালটেন্সি রিকোয়েস্ট পাওয়া যায়নি।</td>
                                </tr>
                                <?php endif; ?>
                            </tbody>
                        </table>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>

<style>
    /* টেবিল এবং বাটনের ফিনিশিং */
    .mr-table table th { vertical-align: middle; }
    .mr-table table td { vertical-align: middle; }
    .action-list .btn { display: inline-flex; align-items: center; justify-content: center; }
    .modal-backdrop { opacity: 0.5 !important; }
</style>
<?php $__env->stopSection(); ?>
<?php echo $__env->make('layouts.admin', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH /home/creativedesignbd/public_html/project/resources/views/admin/consultancy/index.blade.php ENDPATH**/ ?>