<?php $__env->startSection('title', isset($customer) ? 'Edit Customer' : 'Add Customer'); ?>

<?php $__env->startSection('content'); ?>
<h2 class="page-title"><?php echo e(isset($customer) ? 'Edit Customer' : 'Add New Customer'); ?></h2>

<div class="row">
    <div class="col-xl-8 col-lg-10">
        <div class="card border-0 shadow-sm">
            <div class="card-header bg-white border-0 pt-4 pb-0">
                <h5 class="fw-bold mb-0 text-primary">Customer Information</h5>
            </div>
            <div class="card-body p-4">
                <form action="<?php echo e(isset($customer) ? route('customers.update', $customer->id) : route('customers.store')); ?>" method="POST">
                    <?php echo csrf_field(); ?>
                    <?php if(isset($customer)): ?>
                        <?php echo method_field('PUT'); ?>
                    <?php endif; ?>
                    
                    <div class="row g-4 mb-4">
                        <div class="col-md-6">
                            <div class="form-floating">
                                <input type="text" id="customer_name" name="customer_name" class="form-control <?php $__errorArgs = ['customer_name'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?> is-invalid <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>" value="<?php echo e(old('customer_name', $customer->customer_name ?? '')); ?>" placeholder="Customer Name" required>
                                <label for="customer_name">Customer Name <span class="text-danger">*</span></label>
                            </div>
                            <?php $__errorArgs = ['customer_name'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?> <div class="text-danger small mt-1"><?php echo e($message); ?></div> <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>
                        </div>
                        <div class="col-md-6">
                            <div class="form-floating">
                                <input type="text" id="mobile" name="mobile" class="form-control <?php $__errorArgs = ['mobile'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?> is-invalid <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>" value="<?php echo e(old('mobile', $customer->mobile ?? '')); ?>" placeholder="Mobile Number" required>
                                <label for="mobile">Mobile Number <span class="text-danger">*</span></label>
                            </div>
                            <?php $__errorArgs = ['mobile'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?> <div class="text-danger small mt-1"><?php echo e($message); ?></div> <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>
                        </div>
                    </div>

                    <h6 class="fw-bold text-muted mb-3 text-uppercase" style="font-size: 12px; letter-spacing: 1px;">Address Details</h6>

                    <div class="form-floating mb-4">
                        <input type="text" id="address1" name="address1" class="form-control <?php $__errorArgs = ['address1'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?> is-invalid <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>" value="<?php echo e(old('address1', $customer->address1 ?? '')); ?>" placeholder="Address Line 1" required>
                        <label for="address1">Address Line 1 <span class="text-danger">*</span></label>
                        <?php $__errorArgs = ['address1'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?> <div class="text-danger small mt-1"><?php echo e($message); ?></div> <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>
                    </div>

                    <div class="form-floating mb-4">
                        <input type="text" id="address2" name="address2" class="form-control" value="<?php echo e(old('address2', $customer->address2 ?? '')); ?>" placeholder="Address Line 2">
                        <label for="address2">Address Line 2 (Optional)</label>
                    </div>

                    <div class="row g-4 mb-4">
                        <div class="col-md-4">
                            <div class="form-floating">
                                <input type="text" id="city" name="city" class="form-control" value="<?php echo e(old('city', $customer->city ?? '')); ?>" placeholder="City">
                                <label for="city">City</label>
                            </div>
                        </div>
                        <div class="col-md-4">
                            <div class="form-floating">
                                <input type="text" id="state" name="state" class="form-control" value="<?php echo e(old('state', $customer->state ?? '')); ?>" placeholder="State">
                                <label for="state">State</label>
                            </div>
                        </div>
                        <div class="col-md-4">
                            <div class="form-floating">
                                <input type="text" id="pincode" name="pincode" class="form-control" value="<?php echo e(old('pincode', $customer->pincode ?? '')); ?>" placeholder="Pincode">
                                <label for="pincode">Pincode</label>
                            </div>
                        </div>
                    </div>

                    <hr class="my-4" style="border-color: #E2E8F0;">

                    <div class="form-floating mb-4">
                        <input type="text" id="gst_number" name="gst_number" class="form-control" value="<?php echo e(old('gst_number', $customer->gst_number ?? '')); ?>" placeholder="GST Number">
                        <label for="gst_number">GST Number (Optional)</label>
                    </div>

                    <div class="d-flex justify-content-end gap-3 mt-5">
                        <a href="<?php echo e(route('customers.index')); ?>" class="btn btn-secondary px-4">Cancel</a>
                        <button type="submit" class="btn btn-primary px-5"><i class="fas fa-save me-2"></i> Save Customer</button>
                    </div>
                </form>
            </div>
        </div>
    </div>
</div>
<?php $__env->stopSection(); ?>

<?php echo $__env->make('layouts.app', array_diff_key(get_defined_vars(), ['__data' => 1, '__path' => 1]))->render(); ?><?php /**PATH E:\xampp\htdocs\riya\billing\resources\views/customers/create.blade.php ENDPATH**/ ?>