<?php $__env->startSection('title', 'Update Product'); ?>

<?php $__env->startSection('body'); ?>
    <div class="page-header">
        <div>
            <h1 class="page-title">Update Product</h1>
        </div>
        <div class="ms-auto pageheader-btn">
            <ol class="breadcrumb">
                <li class="breadcrumb-item"><a href="javascript:void(0);">Product</a></li>
                <li class="breadcrumb-item active" aria-current="page">Update Product</li>
            </ol>
        </div>
    </div>

    <div class="row">
        <div class=" col-md-12">
            <div class="card">
                <div class="card-header border-bottom">
                    <h3 class="card-title">Update Product Form</h3>
                </div>
                <div class="card-body">
                    <p class="text-muted"><?php echo e(session('message')); ?></p>
                    <form class="form-horizontal" method="post" enctype="multipart/form-data" action="<?php echo e(route('product.update', ['id' => $product->id])); ?>" >
                        <?php echo csrf_field(); ?>
                        <div class="row mb-4">
                            <label for="" class="col-md-3 form-label">Category Name</label>
                            <div class="col-md-9">
                                <select name="category_id" class="form-control">
                                    <option value="">--Select Category Name</option>
                                    <?php $__currentLoopData = $categories; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $category): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                        <option value="<?php echo e($category->id); ?>" <?php if($product->category_id == $category->id): echo 'selected'; endif; ?>><?php echo e($category->name); ?></option>
                                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                </select>
                            </div>
                        </div>
                        <div class="row mb-4">
                            <label for="" class="col-md-3 form-label">Sub Category Name</label>
                            <div class="col-md-9">
                                <select name="subCategory_id" class="form-control">
                                    <option value="">--Select Sub Category Name</option>
                                    <?php $__currentLoopData = $sub_categories; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $subCategory): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                        <option value="<?php echo e($subCategory->id); ?>" <?php if($product->sub_category_id == $subCategory->id): echo 'selected'; endif; ?>><?php echo e($subCategory->name); ?></option>
                                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                </select>
                            </div>
                        </div>
                        <div class="row mb-4">
                            <label for="" class="col-md-3 form-label"> Product Name</label>
                            <div class="col-md-9">
                                <input class="form-control" id="" placeholder="Product Name" type="text" name="name" value="<?php echo e($product->name); ?>">
                            </div>
                        </div>
                        <div class="row mb-4">
                            <label for="" class="col-md-3 form-label">Short Description</label>
                            <div class="col-md-9">
                                <input class="form-control" id="" placeholder="Product Name" type="text" value="<?php echo e($product->short_description); ?>" name="short_description"/>
                            </div>
                        </div>
                        <div class="row mb-4">
                            <label for="" class="col-md-3 form-label">Description</label>
                            <div class="col-md-9">
                                <textarea class="form-control" id="summernote" placeholder="Description" type="text" name="description"> value="{$product->description}"</textarea>
                            </div>
                        </div>
                        <div class="row mb-4">
                            <label for="email" class="col-md-3 form-label">Product Image</label>
                            <div class="col-md-9">
                                <input class="form-control" id="" type="file" name="image">
                                <img src="<?php echo e(asset($product->image)); ?>" alt="" height="70px" width="70pc">
                            </div>
                        </div>
                        <div class="row">
                            <label for="" class="col-md-3 form-label">Published Status</label>
                            <div class="col-md-9">
                                <label><input type="radio" name="status" <?php echo e($subCategory->status == 1 ? 'checked':''); ?> value="1">Published</label>
                                <label><input type="radio" name="status" <?php echo e($subCategory->status == 0 ? 'checked':''); ?> value="2">UnPublished</label>
                            </div>
                        </div>
                        <button class="btn btn-primary" type="submit">Update Product</button>
                    </form>
                </div>
            </div>
        </div>
    </div>

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



<?php echo $__env->make('admin.master', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH D:\primary\resources\views/admin/product/edit.blade.php ENDPATH**/ ?>