%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /var/www/html/digiprint/storage/framework/views/
Upload File :
Create Path :
Current File : /var/www/html/digiprint/storage/framework/views/8491aed3deb036a212b86575360964fe4663ca23.php

<?php $__env->startSection('content'); ?>
    <div class="container">
        <div class="row">
            <div class="col-md-12">
                <div class="panel panel-default">
                    <div class="panel-heading">
                        <h1>
                            <span>Categories</span>
                            <span class="pull-right">
                                <?php if($category && $category->id): ?>
                                    <a class="btn btn-default"
                                       href="<?php echo e(route('dashboard.categories.gallery', $category->id)); ?>">
                                        <span>Gallery</span>
                                    </a>
                                <?php endif; ?>
                                <a class="btn btn-success" href="<?php echo e(route('dashboard.categories')); ?>">
                                    <span>Back</span>
                                </a>
                            </span>
                        </h1>
                    </div>
                </div>

                <form class="form-horizontal" method="POST" autocomplete="off" enctype="multipart/form-data"
                      action="<?php echo e(route('dashboard.categories.createOrUpdate', $id)); ?>">
                    <?php echo e(csrf_field()); ?>


                    <div class="form-group<?php echo e($errors->has('name') ? ' has-error' : ''); ?>">
                        <label for="name" class="col-md-3 control-label">Name</label>

                        <div class="col-md-6">
                            <input id="name" type="text" class="form-control" name="name"
                                   value="<?php echo e($category->name); ?>" required autofocus>
                            <?php if($errors->has('name')): ?>
                                <span class="help-block">
                                    <strong><?php echo e($errors->first('name')); ?></strong>
                                </span>
                            <?php endif; ?>
                        </div>
                    </div>

                    <div class="form-group<?php echo e($errors->has('slug') ? ' has-error' : ''); ?>">
                        <label for="slug" class="col-md-3 control-label">Slug</label>

                        <div class="col-md-6">
                            <input id="slug" type="text" class="form-control" name="slug"
                                   value="<?php echo e($category->slug); ?>" required>
                            <?php if($errors->has('slug')): ?>
                                <span class="help-block">
                                    <strong><?php echo e($errors->first('slug')); ?></strong>
                                </span>
                            <?php endif; ?>
                        </div>
                    </div>

                    <div class="form-group<?php echo e($errors->has('order') ? ' has-error' : ''); ?>">
                        <label for="order" class="col-md-3 control-label">Order</label>

                        <div class="col-md-6">
                            <input id="order" type="number" class="form-control" name="order"
                                   value="<?php echo e($category->order); ?>" required>
                            <?php if($errors->has('order')): ?>
                                <span class="help-block">
                                    <strong><?php echo e($errors->first('order')); ?></strong>
                                </span>
                            <?php endif; ?>
                        </div>
                    </div>

                    <div class="form-group<?php echo e($errors->has('short_description') ? ' has-error' : ''); ?>">
                        <label for="short_description" class="col-md-3 control-label">Short Description</label>

                        <div class="col-md-6">
                            <textarea id="short_description" class="form-control" name="short_description" rows="6"
                                      required
                            ><?php echo e($category->short_description); ?></textarea>
                            <?php if($errors->has('short_description')): ?>
                                <span class="help-block">
                                    <strong><?php echo e($errors->first('short_description')); ?></strong>
                                </span>
                            <?php endif; ?>
                        </div>
                    </div>

                    <div class="form-group<?php echo e($errors->has('description') ? ' has-error' : ''); ?>">
                        <label for="description" class="col-md-3 control-label">Description</label>

                        <div class="col-md-6">
                            <textarea id="description" class="form-control" name="description" rows="11" required
                            ><?php echo e($category->description); ?></textarea>
                            <?php if($errors->has('description')): ?>
                                <span class="help-block">
                                    <strong><?php echo e($errors->first('description')); ?></strong>
                                </span>
                            <?php endif; ?>
                        </div>
                    </div>

                    <?php if(($category->id && count($categories) > 1) || (!$category->id && count($categories) > 0)): ?>
                        <div class="form-group<?php echo e($errors->has('parent_id') ? ' has-error' : ''); ?>">
                            <label for="parent_id" class="col-md-3 control-label">Category</label>

                            <div class="col-md-6">
                                <select class="form-control" id="parent_id" name="parent_id">
                                    <option value="">Parent Category</option>
                                    <?php $__currentLoopData = $categories; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $cat): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                        <?php if($cat->id != $category->id): ?>
                                            <option value="<?php echo e($cat->id); ?>"
                                                    <?php echo e($cat->id == $category->parent_id ? 'selected' : ''); ?>>
                                                <?php echo e($cat->name); ?>

                                            </option>
                                        <?php endif; ?>
                                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                </select>
                                <?php if($errors->has('parent_id')): ?>
                                    <span class="help-block">
                                    <strong><?php echo e($errors->first('parent_id')); ?></strong>
                                </span>
                                <?php endif; ?>
                            </div>
                        </div>
                    <?php endif; ?>

                    <div class="form-group<?php echo e($errors->has('file') ? ' has-error' : ''); ?>">
                        <label for="description" class="col-md-3 control-label">Image 400X400px </label>

                        <div class="col-md-6">
                            <input type="file" name="file" id="file" accept="image/*" onchange="fileChanged(this)">
                            <?php if($errors->has('file')): ?>
                                <span class="help-block">
                                    <strong><?php echo e($errors->first('file')); ?></strong>
                                </span>
                            <?php endif; ?>
                        </div>
                    </div>

                    <div class="form-group">
                        <div class="col-md-6 col-md-offset-3">
                            <?php if($category->media()->count() > 0): ?>
                                <img class="img img-responsive full-width" id="image-preview-uploaded"
                                     src="<?php echo e(env('APP_URL') . 'uploads/' . $category->media()->where('media_type', \Digiprint\Models\Media::MEDIA_TYPE_IMAGE_CATEGORY)->first()->file_name); ?>">
                            <?php endif; ?>
                            <img class="img img-responsive full-width" id="image-preview">
                        </div>
                    </div>

                    <div class="form-group">
                        <div class="col-md-8 col-md-offset-3">
                            <button type="submit" class="btn btn-primary">
                                Save
                            </button>
                        </div>
                    </div>
                </form>

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

<script>
  function fileChanged(input) {
    if (input.files && input.files[0]) {
      var reader = new FileReader();

      reader.onload = function (e) {
        $('#image-preview').attr('src', e.target.result);
        $('#image-preview-uploaded').css('display', 'none');
      };

      reader.readAsDataURL(input.files[0]);
    }
  }
</script>
<?php echo $__env->make('dashboard.layouts.app', array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>

Zerion Mini Shell 1.0