Exemplo n.º 1
0
function asd()
{
    $newClass = new test();
    $rows = $newClass->traerAlgoDesdeLaDb();
    $viewData = array("id" => 5, "datos" => $rows);
    View::Show($viewData);
}
 public static function home($args = array())
 {
     if (isset($_SESSION['user_id']) && $_SESSION['user_id']) {
         $uri = explode('/', $_SERVER['REQUEST_URI']);
         $URL = $uri[0] . '/madeo/user/profile';
         header('Location:' . $URL);
     }
     $token = md5(uniqid(time(), true));
     $_SESSION['token'] = $token;
     return View::Show('home', ['token' => $token]);
 }
Exemplo n.º 3
0
            if (!$bar->post_url) {
                $bar->post_url = "#HOME#/plugin/{$bar->post_name}";
            }
            $View->Show((array) $bar, $siderbar);
        }
    }
    if (isset($fixo)) {
        $Read->Execute()->Query("post_status = 1 AND (post_category = :cat OR post_cat_parent = :cat) ORDER BY post_date LIMIT 3", "cat={$fixo}", true);
        if (!$Read->Execute()->getResult()) {
            WSErro("Opps! Não temos artigos para a barra lateral", WS_INFOR);
        } else {
            $View = new View();
            $siderbar = $View->Load("article_siderbar_fixo");
            foreach ($Read->Execute()->getResult() as $bar) {
                $bar->datetime = date('Y-m-d', strtotime($bar->post_date));
                $bar->pubdate = date("d/m/Y H:i", strtotime($bar->post_date));
                $bar->post_content = Check::Words($bar->post_content, 6);
                if (!$bar->post_url) {
                    $bar->post_url = "#HOME#/plugin/{$bar->post_name}";
                }
                $View->Show((array) $bar, $siderbar);
            }
        }
    }
    ?>
        </div>

    </aside>

    <?php 
}
Exemplo n.º 4
0
function test()
{
    View::Show(false);
}
Exemplo n.º 5
0
$Pager = new Pager(HOME . '/categoria/' . $category_name . '/');
$Pager->ExePager($getPage, 3);
$readCat = new WsPosts();
$readCat->Execute()->Query("post_status = 1 AND (post_category = :cat OR post_cat_parent = :cat) ORDER BY post_date DESC LIMIT :limit OFFSET :offset", "cat={$category_id}&limit={$Pager->getLimit()}&offset={$Pager->getOffset()}", true);
if (!$readCat->Execute()->getResult()) {
    $Pager->ReturnPage();
    WSErro("Desculpe, a categoria <b>{$category_title}</b> ainda não tem artigos publicados, favor volte mais tarde!", WS_INFOR);
} else {
    $cc = 1;
    $View = new View();
    $tpl_m = $View->Load('article_m');
    foreach ($readCat->Execute()->getResult() as $cat) {
        echo "\n<div class='col-md-4'>\n";
        $class = $cc % 3 == 0 ? ' class="right"' : null;
        $cat->post_title = Check::Words($cat->post_title, 8);
        $cat->post_content = Check::Words($cat->post_content, 20);
        $cat->datetime = date('Y-m-d', strtotime($cat->post_date));
        $cat->pubdate = date('d/m/Y H:i', strtotime($cat->post_date));
        $View->Show((array) $cat, $tpl_m);
        $cc++;
        echo "\n</div>\n";
    }
}
$Pager->ExePaginator("ws_posts", "post_status = 1 AND (post_category = :cat OR post_cat_parent = :cat)", "cat={$category_id}");
?>
    </div><!--/ site container -->

    <?php 
echo $Pager->getPaginator();
?>
</section>
Exemplo n.º 6
0
    WSErro("Desculpe, ainda não existem empresas cadastradas {$Cat}, favor volte depois", WS_INFOR);
} else {
    $View = new View();
    $tpl = $View->Load('empresa_list');
    foreach ($readEmp->getResult() as $emp) {
        //encontra cidade
        $readEmp->setTable('app_cidades');
        $readEmp->find("cidade_id={$emp->empresa_cidade}");
        $cidade = $readEmp->getResult()->cidade_nome;
        $emp->empresa_cidade = $cidade;
        //encontra estado
        $readEmp->setTable('app_estados');
        $readEmp->find("estado_id={$emp->empresa_uf}");
        $estado = $readEmp->getResult()->estado_uf;
        $emp->empresa_uf = $estado;
        $View->Show((array) $emp, $tpl);
    }
    //barra de navegação
    echo '<footer>';
    echo '<nav class="paginator">';
    echo '<h2>Mais resultados para NOME DA CATEGORIA</h2>';
    $Pager->ExePaginator("app_empresas", "empresa_status = 1 AND empresa_categoria = :cat", "cat={$EmpLink}");
    echo $Pager->getPaginator();
    echo '</nav>';
    echo '</footer>';
}
?>

    </section>

    <!--SIDEBAR-->
Exemplo n.º 7
0
$readMode = new Controle();
$readMode->setTable("ws_posts");
$readMode->Query("post_status = 1 AND post_id != :post_id AND #post_category# ORDER BY rand() LIMIT 2", "post_id={$post_id}&post_category={$post_category}");
if ($readMode->getResult()) {
    $View = new View();
    $tpl_m = $View->Load('article_m');
    ?>
                <footer>
                    <nav>
                        <h3>Veja também:</h3>
                        <?php 
    foreach ($readMode->getResult() as $more) {
        $more->datetime = date('Y-m-d', strtotime($more->post_date));
        $more->pubdate = date('d/m/Y H:i', strtotime($more->post_date));
        $more->post_content = Check::Words($more->post_content, 20);
        $View->Show((array) $more, $tpl_m);
    }
    ?>
                    </nav>
                    <div class="clear"></div>
                </footer>
                <?php 
}
?>

            <!--Comentários aqui-->

        </div><!--art content-->

        <!--SIDEBAR-->
        <?php 
        <meta charset="UTF-8">
        <title></title>
    </head>
    <body>
        <?php 
require './_app/Config.inc.php';
$sessao = new Session();
//        View::Load('_mvc/category');
//
//        $read = new Read();
//        $read->ExeRead('ws_categories');
//
//        foreach ($read->getResult() as $cat):
//            View::Show($cat);
//        endforeach;
//
//        echo '<h1>Request</h1>';
//
//        foreach ($read->getResult() as $cat):
//            View::Request('_mvc/category', $cat);
//        endforeach;
$read = new Read();
$read->ExeRead('ws_siteviews_agent');
View::Load('_mvc/navegador');
foreach ($read->getResult() as $nav) {
    View::Show($nav);
}
?>
    </body>
</html>
Exemplo n.º 9
0
            <div class="clear"></div>
        </div>

        <!--RELACIONADOS-->
        <footer>
            <nav>
                <h3>Veja também:</h3>
                <?php 
$readMais = new Controle('app_empresas');
$readMais->Query("empresa_status = 1 ORDER BY rand() LIMIT 4");
if ($readMais->getResult()) {
    $View = new View();
    $tpl = $View->Load('empresa_p');
    foreach ($readMais->getResult() as $mais) {
        $View->Show((array) $mais, $tpl);
    }
}
?>
            </nav>
            <div class="clear"></div>
        </footer>

        <!--Comentários aqui-->
    </article>
    <!--SIDEBAR-->

    <?php 
require REQUIRE_PATH . '/inc/sidebar.inc.php';
?>
Exemplo n.º 10
0
$readArt = new WsPosts();
$readArt->Execute()->Query("post_status = 1 AND (post_title LIKE '%' :link '%' OR post_content LIKE '%' :link '%') ORDER BY post_date DESC LIMIT :limit OFFSET :offset", "link={$search}&limit={$Pager->getLimit()}&offset={$Pager->getOffset()}", true);
if (!$readArt->Execute()->getResult()) {
    $Pager->ReturnPage();
    WSErro("Desculpe, sua pesquisa não encontrou posts. Você pode resulmir sua pesquisa ou tentar outros termos!", WS_INFOR);
} else {
    $cc = 0;
    echo "<div class='row'>\n";
    foreach ($readArt->Execute()->getResult() as $cat) {
        $cat->post_title = Check::Words($cat->post_title, 8);
        $cat->post_content = Check::Words($cat->post_content, 20);
        $cat->datetime = date('Y-m-d', strtotime($cat->post_date));
        $cat->pubdate = date('d/m/Y H:i', strtotime($cat->post_date));
        echo $cc % 4 == 0 ? "<div class='row'>\n</div>\n" : "";
        echo "<div class='col-md-3'>";
        $View->Show((array) $cat, $tpl_cat);
        echo "</div>\n";
        $cc++;
    }
    echo "</div>\n";
}
/**
 * Agenda
 */
$readAge = new AgendaContatos();
$readAge->Execute()->FullRead("SELECT * FROM agenda_contatos a " . "JOIN ws_setor s ON(s.setor_id = a.setor_id) " . "JOIN agenda_endereco e ON(e.endereco_id = a.endereco_id) " . "JOIN app_cidades c ON(c.cidade_id = e.app_cidade) " . "WHERE a.contato_descricao LIKE '%' :link '%' OR s.setor_content LIKE '%' :link '%'" . "ORDER BY contato_descricao LIMIT :limit OFFSET :offset", "link={$search}&limit={$Pager->getLimit()}&offset={$Pager->getOffset()}", true);
?>

        <hr>
        <section class="section">
            <header>
Exemplo n.º 11
0
$Read->Execute()->Query("post_status = 1 AND (post_category = :cat OR post_cat_parent = :cat) ORDER BY post_views DESC LIMIT :limit OFFSET :offset", "cat={$category_id}&limit={$Pager->getLimit()}&offset={$Pager->getOffset()}", true);
if (!$Read->Execute()->getResult()) {
    $Pager->ReturnPage();
    WSErro("Desculpe, ainda não temos artigos cadastrado nesta categoria!", WS_INFOR);
} else {
    ?>
                    <div class="row">
                        <?php 
    $View = new View();
    $grupo_p = $View->Load('grupo_p');
    $i = 0;
    foreach ($Read->Execute()->getResult() as $item) {
        $item->post_title = Check::Words($item->post_title, 4);
        $item->datetime = date('Y-m-d', strtotime($item->post_date));
        $item->pubdate = date("d/m/Y H:i", strtotime($item->post_date));
        $View->Show((array) $item, $grupo_p);
        $i++;
    }
}
?>
                </div>

            </div>
            <?php 
$Pager->ExePaginator("ws_posts", "post_status = 1 AND (post_category = :cat OR post_cat_parent = :cat) ORDER BY post_views", "cat={$category_id}");
echo $Pager->getPaginator();
?>
        </div>

    </div>
</section>
Exemplo n.º 12
0
$Pager->ExePaginator("ws_posts", "post_status = 1 AND post_type = 'membros' AND (post_category = :cat OR post_cat_parent = :cat)", "cat={$category_id}", true);
$Read = new WsPosts();
$Read->Execute()->Query("post_status = 1 AND post_type = 'membros' AND (post_category = :cat OR post_cat_parent = :cat) ORDER BY post_date DESC LIMIT :limit OFFSET :offset", "cat={$category_id}&limit={$Pager->getLimit()}&offset={$Pager->getOffset()}", true);
if (!$Read->Execute()->getResult()) {
    $Pager->ReturnPage();
    WSErro("Desculpe, a categoria <b>{$category_title}</b> ainda não tem artigos publicados, favor volte mais tarde!", WS_INFOR);
} else {
    $View = new View();
    $membro = $View->Load("article_membro");
    $i = 0;
    echo "\n<!--membros-->\n";
    echo "\n<div class='row'>\n";
    foreach ($Read->Execute()->getResult() as $item) {
        if ($i % 2 == 0 && $i != 0) {
            echo "</div>\n";
            echo "<div class='row'>\n";
        }
        $item->post_title = Check::Words($item->post_title, 4);
        $item->post_content = Check::Words($item->post_content, 10);
        $item->datetime = date('Y-m-d', strtotime($item->post_date));
        $item->pubdate = date("d/m/Y H:i", strtotime($item->post_date));
        $View->Show((array) $item, $membro);
        $i++;
    }
    echo "</div>\n";
    echo "<!--membros end-->\n\n";
}
echo $Pager->getPaginator();
?>
    </div>
</section>
Exemplo n.º 13
0
 static function profile($args = null)
 {
     if (isset($_SESSION['user_login']) && time() - $_SESSION['user_login'] > 60) {
         UserController::logout();
     }
     if (isset($_SESSION['user_id']) && $_SESSION['user_id']) {
         return View::Show('msg', ["name" => $_SESSION['user_name']]);
     } else {
         UserController::logout();
     }
 }
Exemplo n.º 14
0
function login()
{
    Header::setTitle("login");
    View::Show();
}
Exemplo n.º 15
0
$readArt->Execute()->Query("post_status = 1 AND (post_title LIKE '%' :link '%' OR post_content LIKE '%' :link '%') ORDER BY post_date DESC LIMIT :limit OFFSET :offset", "link={$search}&limit={$Pager->getLimit()}&offset={$Pager->getOffset()}", true);
if (!$readArt->Execute()->getResult()) {
    $Pager->ReturnPage();
    WSErro("Desculpe, sua pesquisa não retornou resultados. Você pode resulmir sua pesquisa ou tentar outros termos!", WS_INFOR);
} else {
    $cc = 0;
    foreach ($readArt->Execute()->getResult() as $cat) {
        $cc++;
        $View = new View();
        $tpl_cat = $View->Load('article_m');
        $class = $cc % 3 == 0 ? ' class="right"' : null;
        echo "<span{$class}>";
        $cat->post_title = Check::Words($cat->post_title, 8);
        $cat->post_content = Check::Words($cat->post_content, 20);
        $cat->datetime = date('Y-m-d', strtotime($cat->post_date));
        $cat->pubdate = date('d/m/Y H:i', strtotime($cat->post_date));
        $View->Show((array) $cat, $tpl_cat);
        echo "</span>";
    }
}
$Pager->ExePaginator("ws_posts", "post_status = 1 AND (post_title LIKE '%' :link '%' OR post_content LIKE '%' :link '%')", "link={$search}");
echo '<nav class="paginator">';
echo '<h2>Mais resultados para NOME DA CATEGORIA</h2>';
echo $Pager->getPaginator();
echo '</nav>';
?>

    </section>

    <div class="clear"></div>
</div><!--/ site container -->
Exemplo n.º 16
0
        <?php 
$cat = Check::CatByName($Categoria);
$Offset = !empty($Offset) ? "OFFSET {$Offset}" : "";
$c = 0;
$Read = new WsPosts();
$Read->setPost_category($cat);
$Read->Execute()->Query("post_status = 1 AND (post_category = :cat OR post_cat_parent = :cat) ORDER BY {$Ordem} DESC LIMIT 3 {$Offset}", "cat={$cat}", true);
$Offset = null;
if (!$Read->Execute()->getResult()) {
    WSErro("Opps! Não temos artigos em destaques!", WS_INFOR);
} else {
    $View = new View();
    $new = $View->Load("noticias_m_clean");
    foreach ($Read->Execute()->getResult() as $bar) {
        $bar->datetime = date('Y-m-d', strtotime($bar->post_date));
        $bar->pubdate = date("d/m/Y H:i", strtotime($bar->post_date));
        $bar->post_content = Check::Words($bar->post_content, 30);
        $bar->class = $c == 0 ? "item active" : "item";
        if (!$bar->post_url) {
            $bar->post_url = "#HOME#/artigo/{$bar->post_name}";
        }
        $View->Show((array) $bar, $new);
        $c++;
    }
    ?>
        <?php 
}
?>
    </div>
</section>
Exemplo n.º 17
0
                                <th colspan="4" class="info text-center">
                        <h1>Aniversáriantes do mês</h1>
                        </th>
                        </tr>
                        <tr>
                            <th>#</th>
                            <th>Nome</th>
                            <th>Setor</th>
                            <th>Data</th>
                        </tr>
                        </thead>
                        <tbody>
                            <?php 
    $i = 1;
    foreach ($AppNiver->Execute()->getResult() as $niver) {
        $niver->id = $i;
        $niver->niver_data = date('d/m/Y', strtotime($niver->niver_data));
        $View->Show((array) $niver, $tpl);
        $i++;
    }
    ?>
                        </tbody>
                    </table>
                <?php 
}
?>
            </div>
        </div>
        <div style="display:none;" class="print">&copy; Adriano Reis - Todos os direitos reservados.</div>
    </div>
</section>
Exemplo n.º 18
0
        
        <div class="slidecount">
            <?php 
$cat = Check::CatByName('noticias');
$post = new Controle();
$post->setTable('ws_posts');
$post->FullRead("SELECT * FROM ws_posts WHERE post_status = 1 AND (post_cat_parent = :cat OR post_category = :cat) ORDER BY post_date DESC LIMIT :limit OFFSET :offset", "cat={$cat}&limit=3&offset=0", true);
if (!$post->getResult()) {
    WSErro('Desculpe, ainda não existem notícias cadastradas. Favor volte mais tarde!', WS_INFOR);
} else {
    foreach ($post->getResult() as $slide) {
        $slide->post_title = Check::Words($slide->post_title, 12);
        $slide->post_content = Check::Words($slide->post_content, 38);
        $slide->datetime = date('Y-m-d', strtotime($slide->post_date));
        $slide->pubdate = date('d/m/Y H:i', strtotime($slide->post_date));
        $View->Show((array) $slide, $tpl_g);
    }
}
?>
                
        </div>

        <div class="slidenav"></div>   
    </div><!-- Container Slide -->

</section><!-- /slider -->


<!--HOME CONTENT-->
<div class="site-container">
            <h1 style="margin-top: 0;"><a href="<?php 
    echo HOME . '/grupo/noticias';
    ?>
" title="<?php 
    echo $Titulo;
    ?>
 da intranet" alt="<?php 
    echo $Titulo;
    ?>
"><?php 
    echo $Titulo;
    ?>
</a></h1>
            <?php 
    $View = new View();
    $noticias = $View->Load("noticias_p");
    $cont = 0;
    foreach ($Read->Execute()->getResult() as $not) {
        $not->post_title = Check::Words($not->post_title, 3);
        $not->post_content = Check::Words($not->post_content, 12);
        if ($cont <= 1) {
            $View->Show((array) $not, $noticias);
        }
        $cont++;
    }
    ?>
        </article>
    </div>

<?php 
}
?>
/_tmp/banner_large.png" alt="UPINSIDE TEINAMENTOS" title="UPINSIDE TEINAMENTOS" />
            </a>
        </header>
    </article>

    <section class="widget art-list last-publish">
        <h2 class="line_title"><span class="oliva">Últimas Atualizações:</span></h2>
        <?php 
$side->setTable('ws_posts');
$side->Query("post_status = 1 AND post_id != :side ORDER BY post_date DESC LIMIT 3", "side={$post_id}");
if ($side->getResult()) {
    foreach ($side->getResult() as $last) {
        $last->datetime = date('Y-m-d', strtotime($last->post_date));
        $last->pubdate = date('d/m/Y H:i', strtotime($last->post_date));
        $View->Show((array) $last, $tpl_p);
    }
}
?>
    </section>

    <section class="widget art-list most-view">
        <h2 class="line_title"><span class="vermelho">Destaques:</span></h2>
        <?php 
$side->setTable('ws_posts');
$side->Query("post_status = 1 AND post_id != :side ORDER BY post_views DESC LIMIT 3", "side={$post_id}");
if ($side->getResult()) {
    foreach ($side->getResult() as $most) {
        $most->datetime = date('Y-m-d', strtotime($most->post_date));
        $most->pubdate = date('d/m/Y H:i', strtotime($most->post_date));
        $View->Show((array) $most, $tpl_p);
Exemplo n.º 21
0
                    <?php 
    }
    ?>


                    <!--itens-->
                    <div class="carousel-inner">
                        <?php 
    $i = 0;
    foreach ($Read->Execute()->getResult() as $item) {
        $item->post_title = Check::Words($item->post_title, 12);
        $item->post_content = Check::Words($item->post_content, 38);
        $item->datetime = date('Y-m-d', strtotime($item->post_date));
        $item->pubdate = date("d/m/Y H:i", strtotime($item->post_date));
        $item->class = $i == 0 ? "item active" : "item";
        $View->Show((array) $item, $carousel);
        $i++;
    }
    ?>
                    </div>


                    <?php 
    if ($Read->Execute()->getRowCount() > 1) {
        echo "<a class='left carousel-control' href='#fullcarousel-example' data-slide='prev'><i class='icon-prev fa fa-angle-left'></i></a>" . "\n";
        echo "<a class='right carousel-control' href='#fullcarousel-example' data-slide='next'><i class='icon-next fa fa-angle-right'></i></a>" . "\n";
    }
}
?>

            </div>