<?php $__env->startSection('title'); ?>
Productcategory Edit Page
<?php $__env->stopSection(); ?>
<?php $__env->startSection('css'); ?>

<?php $__env->stopSection(); ?>
<!-- page content -->
<?php $__env->startSection('content'); ?>
<div class="right_col" role="main">
    <div class="">
        <div class="clearfix"></div>
        <?php if(Session::has('success_message')): ?>
        <div class="alert alert-success">
            <?php echo e(Session::get('success_message')); ?>

        </div>
        <?php endif; ?>
        <?php if(Session::has('error_message')): ?>
        <div class="alert alert-danger">
            <?php echo e(Session::get('error_message')); ?>

        </div>
        <?php endif; ?>
        <div class="row">
            <div class="col-md-12 col-sm-12 col-xs-12">
                <div class="x_panel">
                    <div class="x_title">
                        <h2>
                        <a href="<?php echo e(route('productcategory.list')); ?>" class="btn btn-xs btn-primary">Category List</a>
                        Edit Productcategory</h2>
                        <ul class="nav navbar-right panel_toolbox">
                            <li><a class="collapse-link"><i class="fa fa-chevron-up"></i></a>
                            </li>
                            <li class="dropdown">
                                <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false"><i class="fa fa-wrench"></i></a>
                                <ul class="dropdown-menu" role="menu">
                                    <li><a href="#">Settings 1</a>
                                    </li>
                                    <li><a href="#">Settings 2</a>
                                    </li>
                                </ul>
                            </li>
                            <li><a class="close-link"><i class="fa fa-close"></i></a>
                            </li>
                        </ul>
                        <div class="clearfix"></div>
                    </div>
                    <div class="x_content">
                        <div class="row">
                            <div class="col-sm-3"></div>
                            <div class="col-sm-6">
                                <form action="<?php echo e(route('productcategory.update',$pc->id)); ?>" method="post">
                                    <?php echo e(csrf_field()); ?>

                                    <div class="form-group">
                                        <label for="type">Type Name <span class="required" >*</span></label>
                                        <select class="select2 form-control" name="type" >
                                            <option value="" > -- Select-- </option>
                                            <?php $__currentLoopData = $types; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $ty): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                                <option value="<?php echo e($ty->id); ?>" <?php echo e(old('type_id') ?? $pc->type_id == $ty->id ? 'selected' : ''); ?> ><?php echo e($ty->name); ?></option>
                                            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                        </select>
                                        <span class="error"><b><?php if($errors->has('type')): ?><?php echo e($errors->first('type')); ?><?php endif; ?></b></span>
                                    </div>
                                    <div class="form-group">
                                        <label for="name">Name*</label>
                                        <input type="text" class="form-control" id="name" value="<?php echo e($pc->name); ?>" name="name" placeholder="Enter name">
                                        <span class="error"><b>
                                                <?php if($errors->has('name')): ?>
                                                <?php echo e($errors->first('name')); ?>

                                                <?php endif; ?></b>
                                        </span>
                                    </div>
                                    <div class="form-group">
                                        <label for="slug">Slug*</label>
                                        <input type="text" class="form-control" value="<?php echo e($pc->slug); ?>" id="slug" name="slug" placeholder="Enter slug">
                                        <span class="error"><b>
                                                <?php if($errors->has('slug')): ?>
                                                <?php echo e($errors->first('slug')); ?>

                                                <?php endif; ?></b>
                                        </span>
                                    </div>
                                    <div class="form-group">
                                        <label>Status</label>
                                        <?php if($pc->status == 1): ?>
                                        <input type="radio" name="status" value="1" id="Active" checked=""><label for="Active"> Active</label>
                                        <input type="radio" name="status" id="deactive" value="0"><label for="deactive">De
                                            Active</label>
                                        <?php else: ?>
                                        <input type="radio" name="status" value="1" id="Active"><label for="Active"> Active</label>
                                        <input type="radio" name="status" id="deactive" value="0" checked=""><label for="deactive">De
                                            Active</label>
                                        <?php endif; ?>
                                    </div>
                                    <!-- /.box-body -->
                                    <div class="box-footer">
                                        <button type="submit" name="btnCreate" class="btn btn-primary">Update Productcategory</button>
                                    </div>
                                </form>
                            </div>
                            <div class="col-sm-3"></div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
<!-- /page content -->
<?php $__env->stopSection(); ?>

<?php $__env->startSection('script'); ?>
<script type="text/javascript">
    $(function() {
        var $foo = $('#name');
        var $bar = $('#slug');

        function onChange() {
            $bar.val($foo.val().replace(/\s+/g, '-').toLowerCase());
        };
        $('#name')
            .change(onChange)
            .keyup(onChange);
    });
</script>
<?php $__env->stopSection(); ?>
<?php echo $__env->make('backend.layouts.master', array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>