<?php $job = App\Job::where('id', $a_accepted_job->job_id)->get()->first(); $freelancer = App\User::where('id', $job['freelancer_info_id'])->get()->first(); echo $freelancer['name']; ?> </td> <td> <?php $seeker = App\User::where('id', $a_accepted_job->seeker_id)->get()->first(); echo $seeker['name']; ?> </td> <td>{{ $a_accepted_job->job_id }}</td> <td> <?php $jobName = App\Job::where('id', $a_accepted_job->job_id)->get()->first(); echo $jobName['judul']; ?> </td> <td> <?php $time = $a_accepted_job->waktu_mulai; $arrayTime = explode(' ', $time, 2); echo $arrayTime[0]; ?> </td> <td> <?php echo $arrayTime[1]; ?>
<div> <?php $users = App\User::where('id', $job->freelancer_info_id)->get()->first(); $picture = $users['id'] . '.jpg'; ?> @if (file_exists(public_path('/upload/'.$picture))) <img src="{{url('/upload/'.$picture)}}" class="img-circle" style="height: 200px; width: 200px;"> @else <img src="{{url('/assets/pictures/profile-default-icon.png')}}" class="img-circle" style="height: 200px; width: 200px;"> @endif </div> <br> <div> <?php $user = App\User::where('id', $job->freelancer_info_id)->get()->first(); $joblist = App\Job::where('freelancer_info_id', $user['id'])->get()->first(); $accJob = App\AcceptedJob::where('job_id', $joblist['id'])->get()->first(); if ($accJob['rating'] > 0) { for ($i = 0; $i < $accJob['rating']; $i++) { echo '<i class="fa fa-star-o fa-2x" style="color: orange;"></i>'; } } else { echo 'Not rated yet'; } ?> </div> <br> <div> <a href="{{url('/job/'.$job->id)}}" class="btn btn-default" style="background-color: #F26151; color: white; height: 35px;"> <div class="col-md-1"> <i class="fa fa-check" aria-hidden="true"></i> <strong>Hire</strong>
function getJobId($id) { $job = App\Job::where('id', $id)->get()->first(); //ambil baris pertama dari tabel Job return $job['id']; }