<?php $__env->startSection('content'); ?>
<div class="row">
    <div class="col-md-8">
        <div class="card mb-6">
            <div class="card-header border-bottom d-flex justify-content-between align-items-center">
                <h5 class="mb-0">Informasi Laporan: <span class="text-primary"><?php echo e($ticket->ticket_number); ?></span></h5>
                <span class="badge <?php echo e($ticket->status_badge); ?>"><?php echo e($ticket->status_label); ?></span>
            </div>
            <div class="card-body pt-6">
                <div class="row g-4 mb-6">
                    <div class="col-sm-6">
                        <small class="text-muted text-uppercase fw-bold">Pelapor</small>
                        <p class="mb-0 fw-semibold"><?php echo e($ticket->reporter_name); ?></p>
                        <p class="mb-0 small"><?php echo e($ticket->reporter_phone ?: '-'); ?></p>
                    </div>
                    <div class="col-sm-6">
                        <small class="text-muted text-uppercase fw-bold">Tanggal Lapor</small>
                        <p class="mb-0 fw-semibold"><?php echo e($ticket->created_at->format('d M Y H:i')); ?></p>
                    </div>
                    <div class="col-sm-6">
                        <small class="text-muted text-uppercase fw-bold">Objek Rusak</small>
                        <p class="mb-0 fw-semibold"><?php echo e($ticket->maintainable?->name ?? 'Objek Terhapus'); ?></p>
                        <p class="mb-0 small text-muted"><?php echo e($ticket->maintainable_type == 'App\Models\Item' ? 'Barang Inventaris' : 'Fasilitas Ruangan'); ?></p>
                    </div>
                    <div class="col-sm-6">
                        <small class="text-muted text-uppercase fw-bold">Lokasi</small>
                        <p class="mb-0 fw-semibold"><?php echo e($ticket->maintainable?->location?->name ?? '-'); ?></p>
                    </div>
                </div>

                <div class="mb-6">
                    <small class="text-muted text-uppercase fw-bold">Deskripsi Kerusakan</small>
                    <div class="p-3 bg-lighter border rounded mt-1">
                        <?php echo e($ticket->description); ?>

                    </div>
                </div>

                <hr class="my-6">

                <form action="<?php echo e(route('tickets.update', $ticket)); ?>" method="POST">
                    <?php echo csrf_field(); ?>
                    <?php echo method_field('PUT'); ?>
                    <h6 class="mb-4">Update Progres Perbaikan</h6>
                    
                    <div class="mb-4">
                        <label class="form-label" for="status">Status Progres <span class="text-danger">*</span></label>
                        <select name="status" id="status" class="form-select" required>
                            <option value="pending" <?php echo e($ticket->status == 'pending' ? 'selected' : ''); ?>>Menunggu Pengecekan</option>
                            <option value="checking" <?php echo e($ticket->status == 'checking' ? 'selected' : ''); ?>>Pengecekan Oleh Tim Lapangan</option>
                            <option value="submitted" <?php echo e($ticket->status == 'submitted' ? 'selected' : ''); ?>>Pengajuan Perbaikan Ke Tukang</option>
                            <option value="waiting" <?php echo e($ticket->status == 'waiting' ? 'selected' : ''); ?>>Menunggu Perbaikan Tukang</option>
                            <option value="repairing_technician" <?php echo e($ticket->status == 'repairing_technician' ? 'selected' : ''); ?>>Sedang Diperbaiki Tukang</option>
                            <option value="repairing_team" <?php echo e($ticket->status == 'repairing_team' ? 'selected' : ''); ?>>Sedang Diperbaiki Oleh Tim Lapangan</option>
                            <option value="completed" <?php echo e($ticket->status == 'completed' ? 'selected' : ''); ?>>Selesai</option>
                            <option value="rejected" <?php echo e($ticket->status == 'rejected' ? 'selected' : ''); ?>>Ditolak</option>
                        </select>
                    </div>

                    <div class="mb-4">
                        <label class="form-label" for="admin_notes">Catatan Admin / Feedback ke Pelapor</label>
                        <textarea name="admin_notes" id="admin_notes" class="form-control" rows="3" placeholder="Contoh: Perbaikan akan dilakukan besok pagi oleh tim teknis."><?php echo e(old('admin_notes', $ticket->admin_notes)); ?></textarea>
                    </div>

                    <div class="d-flex justify-content-end gap-2">
                        <a href="<?php echo e(route('tickets.index')); ?>" class="btn btn-label-secondary">Kembali</a>
                        <button type="submit" class="btn btn-primary">Simpan Perubahan</button>
                    </div>
                </form>
            </div>
        </div>
    </div>
</div>
<?php $__env->stopSection(); ?>

<?php echo $__env->make('layouts.app', ['title' => 'Detail Tiket Maintenance', 'heading' => 'Update Status Tiket'], \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH G:\Project\inventaris-pondok\resources\views/admin/tickets/show.blade.php ENDPATH**/ ?>