<?php
/* @var $this yii\web\View */
use yii\helpers\Html;
use yii\widgets\LinkPager;
?>
<div class="row">
<div class="col-md-4">
<h1 class="text-info">Les derniéres offres</h1>
</div>
<div class="col-md-8">
<a href="/yii2_job_website/web/index.php?r=jobs/create" class="btn btn-primary pull-right">Ajouter</a>
</div>
</div>
<hr>
<div class="row">
    <div class="col-md-6 col-md-offset-3">
    <?php if(Yii::$app->session->getFlash('success') != null):?>
         <div class="alert alert-success"><?= Yii::$app->session->getFlash('success'); ?></div>
    <?php endif;?>
        <ul class="list-group">
            <?php foreach($jobs as $job):?>
            <li class="list-group-item"><a href="/yii2_job_website/web/index.php?r=jobs/view&id=<?php echo $job->id;?>" class="btn btn-link"><?php echo $job->title;?></a><span class="label label-success"><?php echo $job->city;?></span> 
              <span class="label label-danger"><?php echo $job->type;?></span>
              <span class="label label-info">
              <?php
                echo  Yii::$app->formatter->asDatetime($job->created_at);
              ?>
              </span></li>
            <?php endforeach;?>
        </ul>
    </div>
    <div class="row">
        <div class="col-md-6 col-md-offset-3">
            <?php echo LinkPager::widget(['pagination'=>$pagination]);?>
        </div>
    </div>
</div>
