<?php
/**
  * Ahead WebSoft Technologies Pvt Ltd.
  * @copyright  Copyright 2006-2026 Ahead WebSoft Technologies Pvt Ltd.
  * @license    https://www.socialengine.com/policies
*/
?>

<script type="text/javascript">
    en4.core.runonce.add(function() {
        // Enable links
        scriptJquery('.employments_browse_info_blurb').enableLinks();
    });
</script>

<?php if( $this->paginator->getTotalItemCount() > 0 ): ?>
  <ul class="employments_browse">
    <?php foreach( $this->paginator as $item ): ?>
      <li class="employments_browse_item">
        <div class='employments_browse_info'>
          <div class='employments_browse_info_title'>
            <h3>
              <?php echo $this->htmlLink($item->getHref(), $item->getTitle()) ?>
              <?php if( $item->closed ): ?>
                <i class="icon_closed" data-bs-toggle="tooltip" title="<?php echo $this->translate("Closed")?>"></i>
              <?php endif;?>
            </h3>
          </div>
          <div class='employments_browse_info_des'>
            <?php echo $this->string()->truncate($this->string()->stripTags($item->body), 120) ?>
          </div>
          <div class='employments_browse_info_blurb'>
            <?php $fieldStructure = Engine_Api::_()->fields()->getFieldsStructurePartial($item)?>
            <?php echo $this->fieldValueLoop($item, $fieldStructure) ?>
          </div>
        </div>
        <div class="employments_browse_footer">
          <div class="employments_browse_footer_info">
            <span><i class="far fa-user"></i><?php echo $this->translate('Posted by');?> <?php echo $this->htmlLink($item->getOwner()->getHref(), $item->getOwner()->getTitle()) ?></span>
            <span><i class="far fa-clock"></i><?php echo $this->timestamp(strtotime($item->creation_date)) ?></span>
          </div>
        </div>
      </li>
    <?php endforeach; ?>
  </ul>
<?php else:?>
	<div class="no_result_tip">
		<i><img src="application/modules/Core/externals/images/no-results.png" height="100" width="100" alt="<?php echo $this->translate("No Result")?>"></i>
    <p><?php echo $this->translate('Nobody has posted a employment listing yet.');?></p>
  </div>
<?php endif; ?>
<?php echo $this->paginationControl($this->paginator, null, null, array('pageAsQuery' => true,'query' => $this->formValues)); ?>
