
<div class="twrap"><table class="tbl lines" id="<?php echo e($id); ?>" data-lines>
<thead><tr><?php $__currentLoopData = $cols; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $c): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?><th style="<?php echo e(!empty($c['w'])?'width:'.$c['w']:''); ?>"><?php echo e($c['l']); ?></th><?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?><th class="no-print" style="width:44px"></th></tr></thead>
<tbody>
<?php $ri = 0; ?>
<?php $__currentLoopData = (count($rows ?? []) ? $rows : [null]); $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $row): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
<tr data-row>
<?php $__currentLoopData = $cols; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $c): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
<?php $fname = "lines[$ri][{$c['f']}]"; $val = $row ? data_get($row, $c['f']) : null; $role = !empty($c['role']) ? 'data-'.$c['role'] : ''; ?>
<td>
<?php if(($c['t'] ?? 'text')==='select'): ?>
<select name="<?php echo e($fname); ?>" <?php echo e($role); ?> <?php echo e(!empty($c['req'])?'required':''); ?>><option value="">—</option><?php $__currentLoopData = ($c['o'] ?? []); $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $ov=>$ol): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?><option value="<?php echo e($ov); ?>" <?php echo e((string)$val===(string)$ov?'selected':''); ?>><?php echo e($ol); ?></option><?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?></select>
<?php elseif(($c['t'] ?? '')==='static'): ?><b><?php echo e($c['v'] ?? $val); ?></b>
<?php elseif(($c['t'] ?? '')==='check'): ?><input type="checkbox" name="<?php echo e($fname); ?>" value="1" <?php echo e($val?'checked':''); ?> style="width:18px;height:18px">
<?php else: ?><input type="<?php echo e($c['t'] ?? 'text'); ?>" name="<?php echo e($fname); ?>" value="<?php echo e($val); ?>" <?php echo e($role); ?> step="any" <?php echo e(!empty($c['req'])?'required':''); ?> <?php echo e(!empty($c['ro'])?'readonly tabindex="-1" style="background:#f1f3f5"':''); ?> placeholder="<?php echo e($c['p'] ?? ''); ?>">
<?php endif; ?>
</td>
<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
<td class="no-print"><button type="button" class="btn btn-sm btn-danger" data-del-line title="Remove">✕</button></td>
</tr>
<?php $ri++; ?>
<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
</tbody>
<template>
<?php $__currentLoopData = $cols; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $c): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
<?php $role = !empty($c['role']) ? 'data-'.$c['role'] : ''; ?>
<td>
<?php if(($c['t'] ?? 'text')==='select'): ?>
<select name="lines[__I__][<?php echo e($c['f']); ?>]" <?php echo e($role); ?> <?php echo e(!empty($c['req'])?'required':''); ?>><option value="">—</option><?php $__currentLoopData = ($c['o'] ?? []); $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $ov=>$ol): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?><option value="<?php echo e($ov); ?>"><?php echo e($ol); ?></option><?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?></select>
<?php elseif(($c['t'] ?? '')==='static'): ?><b><?php echo e($c['v'] ?? ''); ?></b>
<?php elseif(($c['t'] ?? '')==='check'): ?><input type="checkbox" name="lines[__I__][<?php echo e($c['f']); ?>]" value="1" style="width:18px;height:18px">
<?php else: ?><input type="<?php echo e($c['t'] ?? 'text'); ?>" name="lines[__I__][<?php echo e($c['f']); ?>]" value="" <?php echo e($role); ?> step="any" <?php echo e(!empty($c['req'])?'required':''); ?> <?php echo e(!empty($c['ro'])?'readonly tabindex="-1" style="background:#f1f3f5"':''); ?> placeholder="<?php echo e($c['p'] ?? ''); ?>">
<?php endif; ?>
</td>
<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
<td class="no-print"><button type="button" class="btn btn-sm btn-danger" data-del-line title="Remove">✕</button></td>
</template>
</table></div>
<button type="button" class="btn btn-sm btn-ghost no-print" data-add-line="#<?php echo e($id); ?>" style="margin-top:8px">+ Add line</button>
<?php /**PATH /home/user/nowills-sqc-erp/resources/views/docs/_lines.blade.php ENDPATH**/ ?>