

<div id="conteudo">
    <div class="container-fluid">
        <div class="row">
            <div class="col-sm-12">
                <section id="banner-superior">
                    <?php 
                    foreach ($this->banners as  $banner) {
                        ?>
                        <div class="item">
                            <div class="conteudo">
                                <div class="container-fluid">
                                    <div class="row">
                                        <div class="col-sm-6 col-xs-9">
                                            <p><strong><?=$banner->titulo?></strong></p>
                                        </div>
                                    </div>
                                </div>
                            </div>

                            <div class="imagem">
                                <img src="image.php/banners/<?= $banner->arquivo?>*1296*310*C" alt="<?=$banner->titulo?>">
                            </div>
                        </div>
                        <?php
                    }
                    ?>
                </section>
            </div>
        </div>
    </div>

    <section id="lista-noticias">
        <div class="container-fluid">
            <div class="row">
                <div class="col-sm-12">
                    <header>
                        <h2>Notícias</h2>
                    </header>
                </div>
            </div>

            <div class="row grade">
                <?php 
                foreach ($this->noticias as  $noticia) {
                    $url = BASE_URL.'noticias/ver/'.$noticia->id.'-'.Pampa_Util_String::url($noticia->titulo);
                    $data_hora = explode(' ', $noticia->date_ins);
                    $data = explode('-', $data_hora[0]);
                    ?>
                    <div class="col-sm-3">
                        <article class="item noticia">
                            <div class="thumb">
                                <img src="image.php/noticias/<?= $noticia->imagem?>*504*284*C" class="img-responsive" alt="Miniatura da noticia">
                            </div>

                            <header>
                                <time><p><?=$this->DataTexto($data)?></p></time>
                                <h3><a href="<?=$url?>"><?=$noticia->titulo?></a></h3>
                            </header>

                            <div class="meta">
                                <a class="btn btn-orange btn-sm inverse" 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=<?=$noticia->titulo?>&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=<?=$noticia->titulo?>"><img src="assets/images/icone-twitter.svg" alt=""></a>
                                        </li>
                                    </ul>
                                </div>

                            </article>
                        </div>

                        <?php
                    }
                    ?>


                </div>

                <div class="row">
                    <div class="col-sm-12 divisor button text-center">
                        <hr>
                        <a class="btn btn-orange" href="<?php echo BASE_URL ?>noticias" role="button">Mais notícias</a>
                    </div>
                </div>

            </div>
        </section>

        <section id="outros">
            <div class="container-fluid">
                <div class="row">

                    <div class="col-sm-6">
                        <div class="row">
                            <div class="col-sm-12">
                                <header>
                                    <h2>Cursos Ofertados</h2>
                                </header>
                            </div>
                        </div>

                        <div class="row grade">
                            <?php 
                            foreach ($this->cursos 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->fullname);
                                      ?>
                                      <div class="col-sm-6">
                                        <article class="item noticia">
                                            <div class="thumb">
                                                <?php 
                                                    if($curso->ativo == 'S'){
                                            if($dataInicio >= $dataHj):
                                            ?>
                                            <div class="tag small">
                                                <p><strong>inscrições abertas</strong></p>
                                            </div>
                                            <?php 
                                            else:   
                                                ?>
                                                <div class="tag small closed">
                                                <p><strong>inscrições encerradas</strong></p>
                                            </div>
                                                <?php
                                            endif;
                                        }
                                            ?>
                                               
                                                <img src="image.php/cursos/<?= $curso->imagem?>*504*284*C"  class="img-responsive" alt="<?=$curso->fullname?>">
                                            </div>

                                            <header>
                                                <h3><a href="<?=$url?>"><?=$curso->fullname?></a></h3>
                                            </header>

                                            <div class="meta">
                                                <a class="btn btn-orange btn-sm inverse" href="<?=$url?>" role="button">Saiba 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->fullname?>&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->fullname?>"><img src="assets/images/icone-twitter.svg" alt=""></a>
                                                        </li>
                                                    </ul>
                                                </div>

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

                                </div>

                                <div class="row">
                                    <div class="col-sm-12 divisor button text-center">
                                        <hr>
                                        <a class="btn btn-orange" href="<?=BASE_URL?>cursos" role="button">Mais Cursos</a>
                                    </div>
                                </div>

                            </div>

                            <div class="col-sm-6">
                                <div class="row">
                                    <div class="col-sm-12">
                                        <header>
                                            <h2>Agenda</h2>
                                        </header>
                                    </div>
                                </div>

                                <div class="row grade sem-hover agenda">
                                    <?php
                                    foreach ($this->agendas as  $agenda) {
                                     $url = BASE_URL.'eventos/ver/'.$agenda->id.'-'.Pampa_Util_String::url($agenda->titulo);
                                     $data = implode('/', array_reverse(explode('-', $agenda->data)) );
                                     ?>
                                     <div class="col-sm-6">
                                        <article class="item noticia">
                                            <header>
                                                <time class="agenda"><p><?=$data?></p></time>
                                                <h3><a href="<?=$url?>"><?=$agenda->titulo?></a></h3>
                                            </header>

                                            <div class="meta">
                                                <a class="btn btn-orange btn-sm inverse" href="<?=$url?>" role="button">Saiba 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=<?=$agenda->titulo?>&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=<?=$agenda->titulo?>"><img src="assets/images/icone-twitter.svg" alt=""></a>
                                                        </li>
                                                    </ul>
                                                </div>

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



                                </div>

                                <!-- <div class="row">
                                    <div class="col-sm-12 divisor button text-center">
                                        <hr>
                                        <a class="btn btn-orange" href="<?php echo BASE_URL ?>eventos" role="button">Mais Eventos</a>
                                    </div>
                                </div> -->

                            </div>

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


            </div>

