<?php $__env->startSection('title','Import Products'); ?>
<?php $__env->startSection('content'); ?>
<div class="page-head"><div><h1>Import products</h1><p>Bulk-create products from CSV; missing Arabic names can use the local translation dictionary.</p></div><a href="<?php echo e(route('products.import.template')); ?>" class="btn btn-light border">Download template</a></div><form method="POST" enctype="multipart/form-data" action="<?php echo e(route('products.import.process')); ?>" class="card-erp"><?php echo csrf_field(); ?><div class="card-erp-body"><div class="row g-2 align-items-end"><div class="col-md-6"><label class="form-label">CSV file</label><input type="file" name="file" class="form-control" accept=".csv,.txt" required></div><div class="col-md-3 form-check mb-2"><input class="form-check-input" type="checkbox" name="auto_translate" value="1" checked><label class="form-check-label">Translate missing Arabic names</label></div><div class="col-md-3"><button class="btn btn-primary w-100">Validate import</button></div></div></div></form><?php if(isset($valid)): ?><div class="card-erp"><div class="card-erp-header"><span>Validation preview</span><span><?php echo e(count($valid)); ?> valid · <?php echo e(count($importErrors)); ?> error(s)</span></div><div class="card-erp-body"><?php $__currentLoopData = $importErrors; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $importError): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?><div class="text-danger small"><?php echo e($importError); ?></div><?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?> <?php if(count($valid)): ?><form method="POST" action="<?php echo e(route('products.import.process')); ?>" enctype="multipart/form-data" class="mt-2"><p class="text-muted">Re-select the same file and confirm to import validated rows.</p><?php echo csrf_field(); ?><input type="file" name="file" class="form-control mb-2" required><input type="hidden" name="auto_translate" value="1"><input type="hidden" name="confirm" value="1"><button class="btn btn-primary">Confirm import</button></form><?php endif; ?></div></div><?php endif; ?>
<?php $__env->stopSection(); ?>

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