%PDF- %PDF-
Direktori : /var/www/html/sljcon/storage/framework/views/ |
Current File : /var/www/html/sljcon/storage/framework/views/8f8bbbded965574e3b647625e1d0350440a0da64.php |
<?php $__env->startSection('content'); ?> <div class="container"> <div class="row"> <div class="col-md-12 m_top_30"> <form class="form-horizontal" method="POST" autocomplete="off" enctype="multipart/form-data" action="<?php echo e(route('admin.project.store', $id)); ?>"> <?php echo e(csrf_field()); ?> <div class="center m_top_30 m_bottom_30"> <h2>Add New Project</h2> </div> <div class="form-group"> <?php if($errors->any()): ?> <div class="alert alert-danger"> <ul> <?php $__currentLoopData = $errors->all(); $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $error): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?> <li><?php echo e($error); ?></li> <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?> </ul> </div> <?php endif; ?> </div> <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($project->name?$project->name:old('name')); ?>" required autofocus> </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($project->slug?$project->slug:old('slug')); ?>" required> </div> </div> <?php if(count($categories) > 0): ?> <div class="form-group<?php echo e($errors->has('category_id') ? ' has-error' : ''); ?>"> <label for="category_id" class="col-md-3 control-label">Category</label> <div class="col-md-6"> <select class="form-control" id="category_id" name="category_id"> <option value="">Category</option> <?php $__currentLoopData = $categories; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $cat): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?> <option value="<?php echo e($cat->id); ?>" <?php echo e($cat->id == $project->category_id ? 'selected' : ''); ?>> <?php echo e($cat->name); ?> </option> <?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('short_description') ? ' has-error' : ''); ?>"> <label for="short_description" class="col-md-3 control-label">Description</label> <div class="col-md-6"> <textarea id="short_description" class="form-control" name="short_description" rows="6" required ><?php echo e($project->short_description?$project->short_description:old('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('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($project->order?$project->order:old('order')); ?>" required> </div> </div> <div class="form-group<?php echo e($errors->has('type') ? ' has-error' : ''); ?>"> <label for="order" class="col-md-3 control-label">Project Type</label> <div class="col-md-6"> <select class="form-control" id="project_type" name="project_type" onchange="projectTypeChange(this)"> <option selected disabled>Choose Type</option> <option value="1">Type 1 (318x318 px)</option> <option value="2">Type 2 (318x640 px)</option> <option value="3">Type 3 (640x318 px)</option> </select> </div> </div> <div class="form-group<?php echo e($errors->has('start_date') ? ' has-error' : ''); ?>"> <label for="start_date" class="col-md-3 control-label">Started Date</label> <div class="col-md-6"> <input id="start_date" type="date" class="form-control" name="start_date" value="<?php echo e($project->start_date?$project->start_date:old('start_date')); ?>" required> </div> </div> <div class="form-group<?php echo e($errors->has('finish_date') ? ' has-error' : ''); ?>"> <label for="finish_date" class="col-md-3 control-label">Finish Date</label> <div class="col-md-6"> <input id="finish_date" type="date" class="form-control" name="finish_date" value="<?php echo e($project->finish_date?$project->finish_date:old('finish_date')); ?>" required> </div> </div> <div class="form-group<?php echo e($errors->has('work_hours') ? ' has-error' : ''); ?>"> <label for="work_hours" class="col-md-3 control-label">Work Hours</label> <div class="col-md-6"> <input id="work_hours" type="number" class="form-control" name="work_hours" value="<?php echo e($project->work_hours?$project->work_hours:old('work_hours')); ?>" required> </div> </div> <div class="form-group<?php echo e($errors->has('staff_number') ? ' has-error' : ''); ?>"> <label for="staff_number" class="col-md-3 control-label">Staff Number</label> <div class="col-md-6"> <input id="staff_number" type="number" class="form-control" name="staff_number" value="<?php echo e($project->staff_number?$project->staff_number:old('staff_number')); ?>" required> </div> </div> <div class="form-group<?php echo e($errors->has('file') ? ' has-error' : ''); ?>"> <label for="file" class="col-md-3 control-label" id='mainImageLabel'>Main Image</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($project->media()->count() > 0): ?> <img class="img img-responsive full-width" id="image-preview-uploaded" src="<?php echo e(env('APP_URL') . 'uploads/' . $project->media()->where('media_type', \App\Models\Media::MEDIA_TYPE_PROJECT_IMAGE)->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]); } } function projectTypeChange(input) { var label = $('#mainImageLabel'); var typeSelected = input.options[input.selectedIndex].text; typeSelected = typeSelected.substring(typeSelected.indexOf("("), typeSelected.indexOf(")") + 1); label.text('Main Image ' + typeSelected); } </script> <?php echo $__env->make('layouts.app', array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>