

<?php $__env->startSection('title', 'Edit Kontrak - TUNJUK-i'); ?>

<?php $__env->startSection('content'); ?>
<div class="mb-6">
    <div class="flex items-center justify-between">
        <div>
            <h1 class="text-2xl font-bold text-[#0b2b4a] flex items-center gap-2">
                <i class="fas fa-edit text-[#c9a84c]"></i>
                Edit Kontrak
            </h1>
            <p class="text-gray-500 text-sm mt-1"><?php echo e($contract->contract_number); ?></p>
        </div>
        <a href="<?php echo e(route('ppk.contracts.index')); ?>" class="text-gray-600 hover:text-gray-800 transition">
            <i class="fas fa-arrow-left mr-1"></i> Kembali
        </a>
    </div>
</div>

<?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if BLOCK]><![endif]--><?php endif; ?><?php if($errors->any()): ?>
    <div class="bg-red-100 border border-red-400 text-red-700 px-4 py-3 rounded mb-4">
        <ul>
            <?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if BLOCK]><![endif]--><?php \Livewire\Features\SupportCompiledWireKeys\SupportCompiledWireKeys::openLoop(); ?><?php endif; ?><?php $__currentLoopData = $errors->all(); $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $error): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?><?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><?php \Livewire\Features\SupportCompiledWireKeys\SupportCompiledWireKeys::startLoopIteration(); ?><?php endif; ?>
                <li><?php echo e($error); ?></li>
            <?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><?php \Livewire\Features\SupportCompiledWireKeys\SupportCompiledWireKeys::endLoop(); ?><?php endif; ?><?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?><?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if ENDBLOCK]><![endif]--><?php \Livewire\Features\SupportCompiledWireKeys\SupportCompiledWireKeys::closeLoop(); ?><?php endif; ?>
        </ul>
    </div>
<?php endif; ?><?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if ENDBLOCK]><![endif]--><?php endif; ?>

<div class="bg-white rounded-2xl shadow-sm border border-gray-100 p-6">
    <form action="<?php echo e(route('ppk.contracts.update', $contract)); ?>" method="POST">
        <?php echo csrf_field(); ?>
        <?php echo method_field('PUT'); ?>

        <div class="grid grid-cols-1 md:grid-cols-2 gap-6">
            <div>
                <label class="block text-sm font-medium text-gray-700 mb-1">Nilai Kontrak *</label>
                <input type="number" name="value" value="<?php echo e(old('value', $contract->value)); ?>" 
                       class="w-full px-4 py-2 border border-gray-300 rounded-lg focus:ring-[#0b2b4a] focus:border-[#0b2b4a]" required>
            </div>
            <div>
                <label class="block text-sm font-medium text-gray-700 mb-1">Status</label>
                <select name="status" class="w-full px-4 py-2 border border-gray-300 rounded-lg focus:ring-[#0b2b4a] focus:border-[#0b2b4a]">
                    <option value="draft" <?php echo e($contract->status == 'draft' ? 'selected' : ''); ?>>Draft</option>
                    <option value="signed" <?php echo e($contract->status == 'signed' ? 'selected' : ''); ?>>Signed</option>
                    <option value="execution" <?php echo e($contract->status == 'execution' ? 'selected' : ''); ?>>Execution</option>
                    <option value="completed" <?php echo e($contract->status == 'completed' ? 'selected' : ''); ?>>Completed</option>
                    <option value="cancelled" <?php echo e($contract->status == 'cancelled' ? 'selected' : ''); ?>>Cancelled</option>
                </select>
            </div>
            <div>
                <label class="block text-sm font-medium text-gray-700 mb-1">Tanggal Mulai *</label>
                <input type="date" name="start_date" value="<?php echo e(old('start_date', $contract->start_date->format('Y-m-d'))); ?>" 
                       class="w-full px-4 py-2 border border-gray-300 rounded-lg focus:ring-[#0b2b4a] focus:border-[#0b2b4a]" required>
            </div>
            <div>
                <label class="block text-sm font-medium text-gray-700 mb-1">Tanggal Selesai *</label>
                <input type="date" name="end_date" value="<?php echo e(old('end_date', $contract->end_date->format('Y-m-d'))); ?>" 
                       class="w-full px-4 py-2 border border-gray-300 rounded-lg focus:ring-[#0b2b4a] focus:border-[#0b2b4a]" required>
            </div>
            <div class="md:col-span-2">
                <label class="block text-sm font-medium text-gray-700 mb-1">Catatan</label>
                <textarea name="notes" rows="3" class="w-full px-4 py-2 border border-gray-300 rounded-lg focus:ring-[#0b2b4a] focus:border-[#0b2b4a]"><?php echo e(old('notes')); ?></textarea>
            </div>
        </div>

        <div class="mt-6 flex items-center gap-3">
            <button type="submit" class="bg-[#0b2b4a] text-white px-6 py-2 rounded-lg hover:bg-[#1a4a6e] transition">
                <i class="fas fa-save mr-2"></i> Update
            </button>
            <a href="<?php echo e(route('ppk.contracts.index')); ?>" class="text-gray-600 hover:text-gray-800 transition">
                Batal
            </a>
        </div>
    </form>
</div>
<?php $__env->stopSection(); ?>
<?php echo $__env->make('layouts.app', array_diff_key(get_defined_vars(), ['__data' => 1, '__path' => 1]))->render(); ?><?php /**PATH C:\laragon\www\tunjuk-i-backend\resources\views/contracts/edit.blade.php ENDPATH**/ ?>