<?php $__env->startSection('content'); ?>
    <div class="content-wrapper">
        <div class="container-xxl flex-grow-1 container-p-y">
            <h4 class="fw-bold py-3 mb-4"><span class="text-muted fw-light">Edit /</span> Subscriber </h4>
            <div class="row">
                <!-- Form controls -->
                <div class="col-md-3"></div>
                <div class="col-md-6">
                    <div class="card mb-4">
                        <?php if(session('success')): ?>
                            <div class="alert alert-success">
                                <?php echo e(session('success')); ?>

                            </div>
                        <?php endif; ?>
                        <h5 class="card-header">Edit Subscriber</h5>
                        <div class="card-body">
                            <form action="<?php echo e(route('admin.updatesubscriber', $subscriber->id)); ?>" method="POST" enctype="multipart/form-data">
                                <?php echo csrf_field(); ?>
                                <?php if(Auth::user()->role == 'admin'): ?>
                                    <div class="mb-3">
                                        <label class="form-label">Select Agent</label>
                                        <select class="form-select" name="agent_id" aria-label="Default select example">
                                            <?php $__currentLoopData = $agent; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $a): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                                <option value="<?php echo e($a->id); ?>" <?php echo e($a->id ==$subscriber->agent_id ? 'selected' : ''); ?>><?php echo e($a->name); ?></option>
                                            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                        </select>
                                    </div>
                                <?php endif; ?>

                                <div class="mb-3">
                                    <label class="form-label">Name</label>
                                    <input type="text" class="form-control" name="name" value="<?php echo e(old('name', $subscriber->name)); ?>"
                                        placeholder="Name" />
                                    <?php if($errors->has('name')): ?>
                                        <span class="text-danger"><?php echo e($errors->first('name')); ?></span>
                                    <?php endif; ?>
                                </div>
                                <div class="row mb-3">
                                    <div class="col-md-6">
                                        <label for="exampleFormControlInput1" class="form-label">Email address</label>
                                        <input type="email" class="form-control" name="email"
                                            value="<?php echo e(old('email', $subscriber->email)); ?>" placeholder="Email Address" />
                                        <?php if($errors->has('email')): ?>
                                            <span class="text-danger"><?php echo e($errors->first('email')); ?></span>
                                        <?php endif; ?>
                                    </div>
                                    <div class="col-md-6">
                                        <label class="form-label">Phone</label>
                                        <input type="text" class="form-control" name="phone"
                                            value="<?php echo e(old('phone', $subscriber->phone)); ?>" placeholder="Phone Number" />
                                        <?php if($errors->has('phone')): ?>
                                            <span class="text-danger"><?php echo e($errors->first('phone')); ?></span>
                                        <?php endif; ?>
                                    </div>
                                </div>

                                <div class="mb-3">
                                    <label class="form-label">Address</label>
                                    <input type="text" class="form-control" name="address" value="<?php echo e($subscriber->address); ?>" placeholder="Enter Address" />
                                </div>

                                <div class="row mb-3">
                                    <div class="col-md-6">
                                        <label class="form-label">City</label>
                                        <input type="text" class="form-control" name="city"
                                          value="<?php echo e($subscriber->city); ?>"  placeholder="Enter City" />
                                    </div>
                                    <div class="col-md-6">
                                        <label class="form-label">State</label>
                                        <input type="text" class="form-control" name="state" value="<?php echo e($subscriber->state); ?>"
                                            placeholder="Enter State" />
                                    </div>
                                </div>
                                <div class="mb-3">
                                    <label class="form-label">Country</label>
                                    <input type="text" class="form-control" name="country" value="<?php echo e($subscriber->country); ?>" placeholder="Enter Country" />
                                </div>

                                <button type="submit" class="btn btn-primary">Update</button>
                            </form>
                        </div>

                    </div>
                </div>

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

<?php echo $__env->make('layouts.app', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH /home/netmente/Desktop/Alefi/resources/views/admin/subscriber/edit.blade.php ENDPATH**/ ?>