<? global $lang;?>
<div>
  <div class="mini-buttons" id="buttons">
    <a href="/panel-kandydata/profil" class="btn">
      <?= $lang['moj-profil'];?>
    </a>
    <a href="/panel-kandydata/wyslane-aplikacje" class="btn">
      <?= $lang['wyslane-aplikacje'];?>
    </a>
    <a href="#" class="btn active">
      <?= $lang['obserwowane-oferty-pracy'];?>
    </a>
    <a href="/panel-kandydata/ustawienia-konta" class="btn">
      <?= $lang['ustawienia-konta'];?>
    </a>
  </div>
  <div class="mini-box fluid mb15">
    <div class="title">
      <?= ucfirst( $lang['obserwowane-oferty-pracy'] );?>
    </div>
    <div class="subtitle mb0">
      <?= ucfirst( $lang['obserwowane-oferty-pracy-podtytul'] );?>
    </div>
  </div>
  <? if ( is_array( $this -> adverts ) and count( $this -> adverts ) ):?>
    <? foreach ( $this -> adverts as $advert ):?>
      <div class="advert-entry">
        <div class="row">
          <div class="col-12 col-sm-2">
            <div class="logo">
              <? if ( file_exists( \front\factory\GlobelusFirms::logo_url( $advert['user_id'] ) ) ):?>
                <img src="/logo/<?= $advert['user_id'];?>/<?= \S::get_token();?>">
              <? else:?>
                <img src="/images/no-logo.jpg">
              <? endif;?>
            </div>
            <div class="flag">
              <? if ( file_exists( 'images/flags/' . \S::seo( $advert['country'] ) . '.jpg' ) ):?>
                <img src="/images/flags/<?= \S::seo( $advert['country'] );?>.jpg">
              <? endif;?>
            </div>
          </div>
          <div class="col-12 col-sm-10">
            <div class="row">
              <div class="col-12 col-sm-9">
                <h2>
                  <a href="/oferta/<?= $advert['id'];?>/<?= \S::seo( $advert['title'], true );?>" target="_blank" title="Ogłoszenie: <?= addslashes( $advert['title'] );?>"><?= $advert['title'];?></a>
                </h2>
              </div>
              <div class="col-12 col-sm-3 date-add">
                <?= date( 'Y-m-d', strtotime( $advert['date_add'] ) );?>
              </div>
            </div>
            <div class="info">
              <span class="place"><?= $advert['country'];?> - <?= $advert['city'];?></span> | <span class="firm"><?= $advert['firm_name_profile'];?></span> | <span class="category"><?= $advert['category'];?></span>
            </div>
            <div class="short-text">
              <?= mb_substr( strip_tags( \S::clear_advert_text( $advert['text'] ) ), 0, 150, 'UTF-8' );?>...
            </div>
            <a href="/oferta/<?= $advert['id'];?>/<?= \S::seo( $advert['title'], true );?>" target="_blank" class="btn btn-success"><?= $lang['szczegoly-oferty'];?></a>
          </div>
        </div>
      </div>
    <? endforeach;?>
  <? else:?>
    <div class="alert alert-danger mt20"><?= $lang['panel-kandydata-brak-obserwowanych-ofert-pracy'];?></div>
  <? endif;?>
</div>