<div id="conteudo">

    <div class="container-fluid">
        <div class="row">
            <div class="col-sm-12">
                <header>
                    <div class="row">
                        <div class="col-sm-6">
                            <h1 class="h2">Cursos ofertados</h1>
                        </div>

                               <!--  <div class="col-sm-3 col-xs-5 text-right label-busca">
                                    <p style="margin: 6px 0 4px;">Categoria:</p>
                                </div>

                                <div class="col-sm-3 col-xs-7 select-busca">
                                    <form action="#">
                                        <select name="" id="input" class="form-control" required="required">
                                            <option value="">Selecione</option>
                                            <option value="">Selecione</option>
                                            <option value="">Selecione</option>
                                            <option value="">Selecione</option>
                                        </select>
                                    </form>
                                </div> -->
                            </div>
                        </header>

                        <div class="row grade lg">

                            <div class="col-sm-12">
                                <?php 
                                if($this->items->count() == 0){
                                    echo '<div class="alert alert-info">Nenhum item encontrado</div>';
                                }else{
                                foreach ($this->items as  $curso) {
                                    $dataInicio = $curso->startdate;// strtotime(date('d/m/Y',$curso->startdate));
                                      $dataHj = strtotime(date("Y-m-d"));
                                    $url = BASE_URL.'cursos/ver/'.$curso->id.'-'.Pampa_Util_String::url($curso->shortname);

                                    ?>
                                    <article class="item noticia">

                                        <div class="row alinhamento-vertical">
                                            <div class="col-sm-3">
                                                <div class="thumb">
                                                    <?php 
                                                    if($curso->ativo == 'S'){
                                            if($dataInicio >= $dataHj):
                                            ?>
                                            <div class="tag ">
                                                <p><strong>inscrições abertas</strong></p>
                                            </div>
                                            <?php 
                                            else:   
                                                ?>
                                                <div class="tag closed">
                                                <p><strong>inscrições encerradas</strong></p>
                                            </div>
                                                <?php
                                            endif;
                                        }
                                            ?>
                                                    <img src="<?=BASE_URL.'uploads/cursos/'.$curso->imagem?>"  class="img-responsive" alt="<?=$curso->shortname?>">
                                                </div>
                                            </div>

                                            <div class="col-sm-9">
                                                <header>
                                                    <h3><a href="<?=$url?>"><?=$curso->fullname?></a></h3>
                                                     <p><?= $this->cropText(strip_tags($curso->summary),150,'…')?></p>
                                                </header>

                                                <div class="meta">
                                                    
                                                   

                                                    <a class="btn btn-orange btn-sm inverse hidden-xs" href="<?=$url?>" role="button">Leia mais</a>

                                                    <ul class="social small bw">
                                                       <li class="facebook">
                                                    <a target="_blank" href="https://www.facebook.com/dialog/share?app_id=212441672592866&display=popup&href=<?=$url?>&redirect_uri=<?=$url?>"><img src="assets/images/icone-facebook.svg" alt=""></a>
                                                </li>

                                                <li class="linkedin">
                                                    <a  target="_blank" href="https://www.linkedin.com/shareArticle?mini=true&url=<?=$url?>
&summary=<?=$curso->shortname?>&source=LinkedIn"><img src="assets/images/icone-linkedin.svg" alt=""></a>
                                                </li>

                                                <li class="twitter">
                                                    <a  target="_blank" href="https://twitter.com/share?url=<?=$url?>&via=ceped&related=ceped&hashtags=ceped&text=<?=$curso->shortname?>"><img src="assets/images/icone-twitter.svg" alt=""></a>
                                                </li>
                                                    </ul>
                                                </div>
                                            </div>
                                        </div>

                                    </article>
                                    <?php 
                                }
                                ?>
                                
                            </div>

                        </div>
                        <?php 
                        echo $this->paginationControl($this->items, null, '_paginator.phtml', array("filters" => $this->filters));

                        }
                        ?>

                    </div>
                </div>
            </div>

        </div>
