<section class="content">
    <div class="box box-primary">
            <div class="box-body">
                <div class="row">
                    <?php if(!auth()->user()->branche_id): ?>
                        <div class="col-md-12">
                            <div class="form-group">
                                <label for="">الفرع</label>
                                <select name="branche_id" class="form-control select2" required="required">
                                    <?php $__currentLoopData = \App\Models\Branche::get(); $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $s): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                        <option <?php echo e(isset($product) && $product->branche_id==$s->id?'selected':''); ?>  value="<?php echo e($s->id); ?>"><?php echo e($s->name); ?></option>
                                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                </select>
                            </div>
                        </div>
                    <?php endif; ?>
                    <div class="col-md-4">
                        <div class="form-group">
                            <label>النوع</label>
                            <?php
                                $typeList = ['قطع غيار','خدمه'];
                            ?>
                            <select class="form-control" name="type">
                                <?php $__currentLoopData = $typeList; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $type): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                    <option <?php echo e($product->type == $type?'selected':''); ?> value="<?php echo e($type); ?>"><?php echo e($type); ?></option>
                                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                            </select>
                        </div>
                    </div>
                    <div class="col-md-4">
                        <div class="form-group">
                            <label>الاسم</label>
                            <input required value="<?php echo e($product->name); ?>" required name="name" type="text" class="form-control">
                        </div>
                    </div>
                    <div class="col-md-4">
                        <div class="form-group">
                            <label>الكود</label>
                            <input value="<?php echo e($product->code??0); ?>" name="code" type="text" class="form-control">
                        </div>
                    </div>
                    <div class="col-md-4">
                        <div class="form-group">
                            <label>الكمية</label>
                            <input type="hidden" value="<?php echo e(auth()->user()->branche_id); ?>" name="branche[branche_id]"/>
                            <input value="<?php echo e(isset($b)?$b->pivot->qty:0); ?>" name="branche[qty]" type="number" class="form-control">
                        </div>
                    </div>
                    <div class="col-md-4">
                        <div class="form-group">
                            <label>سعر التكلفة</label>
                            <input required value="<?php echo e($product->cost??0); ?>" name="cost" type="number" class="form-control">
                        </div>
                    </div>
                    <div class="col-md-4">
                        <div class="form-group">
                            <label>سعر البيع</label>
                            <input required value="<?php echo e($product->price??0); ?>" name="price" type="number" class="form-control">
                        </div>
                    </div>
                    <div class="col-md-6">
                        <div class="form-group">
                            <label>رقم الرف</label>
                            <input value="<?php echo e(isset($b)?$b->pivot->location:''); ?>" name="branche[location]" type="text" class="form-control">
                        </div>
                    </div>
                    <div class="col-md-6">
                        <div class="form-group">
                            <label>حد التنبيه</label>
                            <input value="<?php echo e($product->notify_limit??0); ?>" name="notify_limit" type="text" class="form-control">
                        </div>
                    </div>
                    <div class="col-md-6">
                        <div class="form-group">
                            <label>الماركه</label>
                            <input value="<?php echo e($product->model??''); ?>" name="model" type="text" class="form-control">
                        </div>
                    </div>
                    <div class="col-md-6">
                        <div class="form-group">
                            <label>الضريبه</label>
                            <input value="<?php echo e($product->tax??''); ?>" name="tax" type="number" class="form-control">
                        </div>
                    </div>
                    <div class="col-md-12">
                        <div class="form-group">
                            <label>الوصف</label>
                            <input value="<?php echo e($product->description??''); ?>" name="description" type="text" class="form-control">
                        </div>
                    </div>
                </div>
                <!-- /.row -->
            </div>
            <!-- /.box-body -->
            <div class="box-footer">
                <button type="submit" class="btn btn-primary">حفظ</button>
            </div>
        </div>
</section>
<script>
    $('form').validator();
</script>
<?php /**PATH /home/mwarsha2023/public_html/test4.mwarsha.com/resources/views/products/_form.blade.php ENDPATH**/ ?>