<?php $__env->startSection('title', trans('user.views.job_services.title', ['id' => $job->id, 'title' => $job->title])); ?>

<?php $__env->startSection('content'); ?>
    <div class="row">
        <div class="col-md-12">
            <div class="page-header">
                <h1>#<?php echo e($job->id); ?> <small><?php echo e($job->title); ?></small></h1>
            </div>

            <?php echo $__env->make('user._partials.navigation', ['_active_navigation' => 'jobs'], array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>

            <hr>

            <div class="row">
                <div class="col-lg-10 col-lg-offset-1">
                    <?php echo Notification::showAll(); ?>

                    <?php if(count($services) > 0): ?>
                        <form method="POST" class="form-horizontal" action="<?php echo e(route('user.job.services.order', $job->id)); ?>">
                            <input type="hidden" name="_token" value="<?php echo e(csrf_token()); ?>">
                            <fieldset>
                                <legend><?php echo e(trans('user.views.job_services.form.legend_services')); ?></legend>
                                <?php foreach($services as $serviceType => $paidServices): ?>
                                    <div class="form-group <?php if($errors->has('service_' . $serviceType)): ?> has-error <?php endif; ?>">
                                        <label class="col-md-4 control-label"><?php echo e(trans('user.views.job_services.form.services.' . $serviceType)); ?></label>
                                        <div class="col-md-6">
                                            <div class="radio">
                                                <label>
                                                    <input name="service_<?php echo e($serviceType); ?>" type="radio" value="" <?php if(old('service_' . $serviceType) == ''): ?> checked <?php endif; ?>>
                                                    <?php echo e(trans('user.views.job_services.form.services.none')); ?>

                                                </label>
                                            </div>
                                            <?php foreach($paidServices as $paidService): ?>
                                                <div class="radio">
                                                    <label>
                                                        <input name="service_<?php echo e($serviceType); ?>" type="radio" value="<?php echo e($paidService->id); ?>" <?php if(old('service_' . $serviceType) == $paidService->id): ?> checked <?php endif; ?>>
                                                        <span class="badge">
                                                            <?php if(!is_null($paidService->price)): ?>
                                                                <?php echo e(format_balance($paidService->price)); ?>

                                                            <?php else: ?>
                                                                <?php echo e(trans('user.views.job_services.form.services.free')); ?>

                                                            <?php endif; ?>
                                                        </span>
                                                        <?php echo e($paidService->title); ?>

                                                        <small class="text-muted"><?php echo e($paidService->description); ?></small>
                                                    </label>
                                                </div>
                                            <?php endforeach; ?>
                                        </div>
                                    </div>
                                <?php endforeach; ?>
                                <hr>
                                <div class="form-group">
                                    <div class="col-md-6 col-md-offset-4">
                                        <button type="submit" class="btn btn-primary">
                                            <?php echo e(trans('user.views.job_services.form.order')); ?>

                                        </button>
                                    </div>
                                </div>
                            </fieldset>
                        </form>
                    <?php else: ?>
                        <div class="alert alert-info"><?php echo e(trans('user.views.job_services.no_services')); ?></div>
                    <?php endif; ?>

                    <hr>

                    <?php if(count($job_services) > 0): ?>
                        <h4><?php echo e(trans('user.views.job.services.header')); ?></h4>
                        <table class="table table-hover no-margin">
                            <thead>
                            <tr>
                                <th><?php echo e(trans('user.views.job_services.services.active')); ?></th>
                                <th><?php echo e(trans('user.views.job_services.services.title')); ?></th>
                                <th><?php echo e(trans('user.views.job_services.services.type')); ?></th>
                                <th><?php echo e(trans('user.views.job_services.services.price')); ?></th>
                                <th><?php echo e(trans('user.views.job_services.services.active_from')); ?></th>
                                <th><?php echo e(trans('user.views.job_services.services.active_to')); ?></th>
                            </tr>
                            </thead>
                            <tbody>
                            <?php foreach($job_services as $job_service): ?>
                                <tr>
                                    <td>
                                        <?php if($job_service->active): ?>
                                            <span class="label label-success"><?php echo e(trans('user.views.job_services.services.active_yes')); ?></span>
                                        <?php else: ?>
                                            <span class="label label-danger"><?php echo e(trans('user.views.job_services.services.active_no')); ?></span>
                                        <?php endif; ?>
                                    </td>
                                    <td><?php echo e($job_service->title); ?></td>
                                    <td><?php echo e(trans('user.views.job_services.services.type_' . $job_service->type)); ?></td>
                                    <td>
                                        <?php if(!is_null($job_service->price)): ?>
                                            <?php echo e(format_balance($job_service->price)); ?>

                                        <?php else: ?>
                                            <span class="label label-default"><?php echo e(trans('user.views.job_services.services.price_free')); ?></span>
                                        <?php endif; ?>
                                    </td>
                                    <td><?php echo e($job_service->active_from); ?></td>
                                    <td><?php echo e($job_service->active_to); ?></td>
                                </tr>
                            <?php endforeach; ?>
                            </tbody>
                        </table>
                    <?php else: ?>
                        <div class="alert alert-info"><?php echo e(trans('user.views.job_services.services.not_ordered')); ?></div>
                    <?php endif; ?>
                </div>
            </div>
        </div>
    </div>
<?php $__env->stopSection(); ?>
<?php echo $__env->make('app', array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>