<? global $lang;?>
<? if ( is_array( $this -> adverts ) and count( $this -> adverts ) ):?>
  <? foreach ( $this -> adverts as $advert ):?>
    <div class="advert-entry main-page <? if ( $advert['highlight'] ):?>highlight<? endif;?>">
      <div class="row no-gutters">
        <div class="col-12 col-md-9">
          <h2>
            <a href="/oferta/<?= $advert['id'];?>/<?= \S::seo( $advert['title'], true );?>" title="Ogłoszenie: <?= addslashes( $advert['title'] );?>"><?= $advert['title'];?></a>
          </h2>
        </div>
        <div class="col-12 col-md-3 date-add">
          <?= date( 'Y-m-d', strtotime( $advert['date_add'] ) );?>
          <div class="flag">
            <? if ( file_exists( 'upload/filemanager/flags/' . \S::seo( $advert['country'] ) . '.jpg' ) ):?>
              <img src="/upload/filemanager/flags/<?= \S::seo( $advert['country'] );?>.jpg">
            <? endif;?>
          </div>
        </div>
      </div>
      <div class="row">
        <div class="col-12">
          <div class="info">
            <span class="place">
              <a href="/oferty-pracy/<?= \S::seo( $advert['country'], true );?>" title="praca <?= $advert['country'];?>"><?= $advert['country'];?></a> - <?= $advert['city'];?>
            </span> |
            <span class="firm"><?= $advert['firm_name_profile'];?></span> |
            <span class="category">
              <a href="/oferty-pracy/<?= \S::seo( $advert['category'], true );?>" title="praca <?= $advert['category'];?>"><?= $advert['category'];?></a>
            </span>
          </div>
        </div>
      </div>
      <div class="row">
        <div class="col-12 col-sm-1 col-md-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>
        <div class="col-12 col-sm-11 col-md-10">
          <div class="short-text">
            <?= mb_substr( strip_tags( \S::clear_advert_text( $advert['text'] ) ), 0, 100, 'UTF-8' );?>...
          </div>
        </div>
      </div>
    </div>
  <? endforeach;?>
<? endif;?>