<?php 

error_reporting(E_ALL ^ E_NOTICE);
require_once("function.php"); 

if(isset($_GET['urlp'])){

    $urlp   =   $_GET['urlp'];

    $selectprod =   mysql_query("SELECT a.cod, a.titulo, pf.nome, a.texto, pf.segmento, pf.descricao_curta, pf.site, pf.email, pf.telefone, a.imagem AS imgcapa, pf.imagem AS imgperfil FROM tb_album a, tb_profissionais pf WHERE a.status = 1 AND pf.cod = a.cod_profissional AND a.cod = $urlp ORDER BY a.ordem ASC");

    if(mysql_num_rows($selectprod) == 0){

            Header("HTTP/1.1 301 Moved Permanently");
            Header("Location: ../../");

    } else {

    while($sqlprod  =   mysql_fetch_array($selectprod)){
    $nome  =   $sqlprod['nome'];
    $titulo  =   $sqlprod['titulo'];
    $cod        =   $sqlprod['cod'];

    $config["title"] = $sqlprod['titulo']." | ".CLIENTE;
    $config["description"] = "";
    $config["canonical"] = HOST."projetos".$sqlprod['cod'];
    $config["og_title"] = $config["title"];
    $config["og_url"] = $config["canonical"];
    $config["og_imagem"] = "";
    $config["og_desc"] = $config["description"];
    $config["pag"] = "intern";
    pegaTopo($config);

?>
    
   <div class="content-intern">

        <div class="content-align">

            <section id="projeto">

                <div class="topo-projeto" style="background-image: url(../../images/album/<?php echo $sqlprod['imgcapa'] ?>)">

                    <div class="topo-info-projeto">

                        <h1><?php echo $sqlprod['titulo'] ?></h1>

                        <p>Por: <?php echo $sqlprod['nome'] ?></p>

                    </div>

                </div>

                <div class="desc-projeto">

                    <p><?php echo $sqlprod['texto'];  ?></p>

                </div>

                <div class="fotos-projeto">

                    <h2>Fotos do projeto</h2>

                    <div id="fotos-projetos" class="boxes-fotos owl-carousel">

                        <?php
                            $selectfotos    =   mysql_query("SELECT * FROM tb_fotos WHERE album = $cod");
                            while($sqlfotos =   mysql_fetch_array($selectfotos)){
                            ?>
                            <div class="box-img">
                                <a href="<?php echo HOST."images/fotos/".$sqlfotos['imagem']; ?>"  title="<?php echo $sqlprod['titulo'] ?>" data-gallery><img src="<?php echo HOST."images/fotos/miniatura/".$sqlfotos['imagem']; ?>" /></a>
                            </div>
                            <?php } ?>

                    </div>

                    <div id="blueimp-gallery" class="blueimp-gallery blueimp-gallery-controls">
                            <div class="slides"></div>
                            <h3 class="title"></h3>
                            <a class="prev">‹</a>
                            <a class="next">›</a>
                            <a class="close"></a>
                            <a class="play-pause"></a>

                        </div>

                </div>

                <div class="profissional">

                    <h2>Responsável do projeto</h2>

                    <div class="box-img">

                        <img src="<?php echo HOST."images/profissional/".$sqlprod['imgperfil'] ?>" alt="<?php echo $sqlprod['nome'] ?>" />

                    </div>

                    <div class="info-profissional">

                        <p class="pc-segmento"><?php echo $sqlprod['segmento'] ?></p>

                        <p class="pc-nome"><?php echo $sqlprod['nome'] ?></p>

                        <p class="pc-descricao"><?php echo $sqlprod['descricao_curta'] ?></p>

                        <p class="pc-contatos"><a href="mailto:<?php echo $sqlprod['email'] ?>"><?php echo $sqlprod['email'] ?></a> | <?php echo $sqlprod['telefone'] ?></p>

                        <p><a href="<?php echo $sqlprod['site'] ?>" target="_blank" class="pc-site">Visitar site</a></p>

                    </div>

                </div>

            </section>
        </div>
    </div>
<?php pegaFooter(); ?>
<script type="text/javascript" src="<?php echo HOST ?>owl-carousel/owl.carousel.js"></script>
</body>
</html>
<link href="<?php echo HOST ?>owl-carousel/owl.carousel.css" rel="stylesheet">
<link href="<?php echo HOST ?>owl-carousel/owl.theme.css" rel="stylesheet">
<link href="<?php echo HOST ?>owl-carousel/owl.transitions.css" rel="stylesheet">
<link rel="stylesheet" href="<?php echo HOST ?>css/gallery.css">
<?php } } }?>


