

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

<div class="max-w-6xl mx-auto">

    <!-- HEADER -->
    <div class="mb-8">
        <h2 class="text-3xl font-bold text-white tracking-wide">
            ✏️ Edit CCMS Feeder
        </h2>
        <p class="text-gray-400 text-sm">Update feeder configuration</p>
    </div>

    <!-- FORM CARD -->
    <div class="bg-white/10 backdrop-blur-2xl border border-white/10 rounded-2xl shadow-2xl p-8">

        <form method="POST" action="<?php echo e(url('/ccms_feeders/'.$data->id)); ?>" class="grid grid-cols-1 md:grid-cols-2 gap-6">
        <?php echo csrf_field(); ?>
        <?php echo method_field('PUT'); ?>

        <!-- FEEDER NAME -->
        <div class="input-group">
            <span>⚡</span>
            <input name="name" value="<?php echo e(old('name',$data->name)); ?>" required>
            <label>Feeder Name *</label>
        </div>

        <!-- FEEDER CODE -->
        <div class="input-group">
            <span>#️⃣</span>
            <input name="feeder_code" value="<?php echo e(old('feeder_code',$data->feeder_code)); ?>">
            <label>Feeder Code</label>
        </div>

        <!-- DEVICE -->
        <div class="input-group">
            <span>📡</span>
            <select name="device_id" required>
                <?php $__currentLoopData = $devices; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $d): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                    <option value="<?php echo e($d->id); ?>"
                        <?php echo e($data->device_id == $d->id ? 'selected' : ''); ?>>
                        <?php echo e($d->imei); ?>

                    </option>
                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
            </select>
        </div>

        <!-- TRANSPORTER -->
        <div class="input-group">
            <span>🏢</span>
            <select name="transporter_id" required>
                <?php $__currentLoopData = $transporters; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $t): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                    <option value="<?php echo e($t->id); ?>"
                        <?php echo e($data->transporter_id == $t->id ? 'selected' : ''); ?>>
                        <?php echo e($t->company_name); ?>

                    </option>
                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
            </select>
        </div>

        <!-- PHASE -->
        <div class="input-group">
            <span>🔌</span>
            <select name="phase" required>
                <option value="single" <?php echo e($data->phase=='single'?'selected':''); ?>>Single Phase</option>
                <option value="three" <?php echo e($data->phase=='three'?'selected':''); ?>>Three Phase</option>
            </select>
        </div>

        <!-- STATUS -->
        <div class="input-group">
            <span>⚙️</span>
            <select name="status">
                <option value="OFF" <?php echo e($data->status=='OFF'?'selected':''); ?>>OFF</option>
                <option value="ON" <?php echo e($data->status=='ON'?'selected':''); ?>>ON</option>
            </select>
        </div>

        <!-- IDLE SETTINGS -->
        <div class="col-span-2 section-title">Idle Settings</div>

        <div class="input-group">
            <span>⏱</span>
            <input type="number" name="idle_hour" value="<?php echo e(old('idle_hour',$data->idle_hour)); ?>">
            <label>Idle Hour</label>
        </div>

        <div class="input-group">
            <span>⏱</span>
            <input type="number" name="idle_minute" value="<?php echo e(old('idle_minute',$data->idle_minute)); ?>">
            <label>Idle Minute</label>
        </div>

        <!-- SUBSCRIPTION -->
        <div class="col-span-2 section-title">Subscription</div>

        <div class="input-group">
            <span>📅</span>
            <input type="date" name="subscription_start" value="<?php echo e(old('subscription_start',$data->subscription_start)); ?>">
            <label>Start Date</label>
        </div>

        <div class="input-group">
            <span>📅</span>
            <input type="date" name="subscription_due" value="<?php echo e(old('subscription_due',$data->subscription_due)); ?>">
            <label>Due Date</label>
        </div>

        <!-- REMARK -->
        <div class="input-group col-span-2">
            <span>📝</span>
            <input name="remark" value="<?php echo e(old('remark',$data->remark)); ?>">
            <label>Remark</label>
        </div>

        <!-- SUBMIT -->
        <div class="col-span-2 mt-6">
            <button class="premium-btn">
                💾 Update Feeder
            </button>
        </div>

        </form>

    </div>

</div>

<!-- SAME STYLES -->
<style>

.section-title {
    color: #e5e7eb;
    font-weight: 600;
    border-left: 4px solid #6366f1;
    padding-left: 10px;
    margin-top: 10px;
}

.input-group {
    position: relative;
}

.input-group span {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
}

.input-group input,
.input-group select {
    width: 100%;
    padding: 14px 14px 14px 40px;
    border-radius: 10px;
    border: 1px solid rgba(255,255,255,0.2);
    background: rgba(255,255,255,0.05);
    color: #fff;
    outline: none;
}

.input-group label {
    position: absolute;
    left: 40px;
    top: 50%;
    transform: translateY(-50%);
    color: #9ca3af;
    transition: 0.3s;
}

.input-group input:focus + label,
.input-group input:not(:placeholder-shown) + label {
    top: -8px;
    font-size: 11px;
    background: #111827;
    padding: 0 6px;
}

/* select fix */
.input-group select option {
    color: black;
}

.premium-btn {
    width: 100%;
    padding: 14px;
    border-radius: 12px;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
}

</style>

<?php $__env->stopSection(); ?>
<?php echo $__env->make('layouts.app', array_diff_key(get_defined_vars(), ['__data' => 1, '__path' => 1]))->render(); ?><?php /**PATH /home2/jitrealx/public_html/amccms/resources/views/ccms_feeders/edit.blade.php ENDPATH**/ ?>