<div class="page-header">
	<h3 class="page-title">
		<span class="page-title-icon bg-success text-white mr-2">
			<i class="mdi mdi-briefcase-outline mdi-24px"></i>
		</span>
		Freelance Jobs
	</h3>
</div>

<div class="row justify-content-center">
	<div class="col-12 col-md-12 ">

		<?php
		if ($jobs)
		{
			$works = json_decode($jobs);
			shuffle($works);
			foreach ($works as $key=>$work):
//				print_r($work->skills);
//				exit();
		?>
			<div class="row mt-2" style="padding: 10px 20px; border:1px solid yellow">
				<div class="col-lg-9">
					<h4>Job Title : <?= $work->posts->title ?> </h4>
					<p> <b> Category </b> : <?= $work->category ?></p>
					<p> <b> Skills </b> :
								<?php
									$skills = $work->skills;
									foreach ($skills as $s=>$skill):
									?>
									<small class="bg-success m-1 " style="
    padding: 5px 10px;
    color: #000;
    font-weight: bold;
    font-size: 0.8rem;
    letter-spacing: 1px;
    border-radius: 5px;
"> <?= $skill->name ?></small>
								<?php
									endforeach;
								?>
					</p>
					<p> <b>Shortly Description </b> : <?= substr($work->posts->description,0,200) ?> </p>

				</div>
				<div class="col-lg-3" style="padding: 0">
					<h5 >Deadline : <small class="btn btn-success" style="padding: 5px;"><?= $work->posts->deadline ?> </small> </h5>
					<p  > Budget : <small class="bg-warning" style="padding: 5px 12px;border-radius: 5px;font-size: 1.05rem;margin: 0;"> <?= $work->posts->budget ?> </small> </p>
					<a href="<?= base_url()?>BuyerWorkCtrl/jobView/<?= $work->posts->id ?>" class="btn-warning btn mr-1" target="_blank"> View </a>
					
				</div>
			</div>
		<?php
			endforeach;
		?>

		<?php
		}
		else{
			echo ' <p> no job found. </p> ';
		}

		?>
	</div>
</div>
