Example #1
0
            break;
        case 'delete':
            $postUpdate->ExeDelete($postAction);
            WSErro('O membro ' . $postUpdate->getError()[0], $postUpdate->getError()[1]);
            break;
        default:
            WSErro("Ação não foi identificada pelo sistema, favor utilize os botões", WS_ERROR);
            break;
    }
}
$posti = 0;
$getPage = filter_input(INPUT_GET, 'page', FILTER_VALIDATE_INT);
$Pager = new Pager("painel.php?exe=membros/index&page=");
$Pager->ExePager($getPage, 5);
$Read = new Controle();
$Read->FullRead("SELECT * FROM ws_posts WHERE post_type = 'membros' ORDER by post_status ASC, post_date DESC LIMIT :limit OFFSET :offset", "limit={$Pager->getLimit()}&offset={$Pager->getOffset()}", true);
if (!$Read->getResult()) {
    $Pager->ReturnPage();
    WSErro("Desculpa, ainda não temos membros cadastrados", WS_INFOR);
} else {
    foreach ($Read->getResult() as $post) {
        $posti++;
        extract((array) $post);
        $status = !$post_status ? 'style="background: #fffed8"' : '';
        ?>
                <article<?php 
        if ($posti % 2 == 0) {
            echo ' class="right" ';
        }
        ?>
 <?php 
Example #2
0
            break;
        case 'delete':
            $postUpdate->ExeDelete($postAction);
            WSErro('O Tipo <b>' . $postUpdate->getError()[0] . "</b>, foi deletado com sucesso!", $postUpdate->getError()[1]);
            break;
        default:
            WSErro("Ação não foi identificada pelo sistema, favor utilize os botões", WS_ERROR);
            break;
    }
}
$posti = 0;
$getPage = filter_input(INPUT_GET, 'page', FILTER_VALIDATE_INT);
$Pager = new Pager("painel.php?exe=setor_type/index&page=");
$Pager->ExePager($getPage, 6);
$Read = new Controle();
$Read->FullRead("SELECT * FROM ws_setor_type ORDER by type_status ASC, type_content DESC LIMIT :limit OFFSET :offset", "limit={$Pager->getLimit()}&offset={$Pager->getOffset()}", true);
if (!$Read->getResult()) {
    $Pager->ReturnPage();
    WSErro("Desculpa, ainda não temos tipos cadastrados", WS_INFOR);
} else {
    foreach ($Read->getResult() as $tipo) {
        $posti++;
        extract((array) $tipo);
        $status = !$type_status ? 'style="background: #fffed8"' : '';
        ?>
                <article<?php 
        if ($posti % 2 == 0) {
            echo ' class="right" ';
        }
        ?>
 <?php 
                <input type="text" placeholder="Rua Nome da Rua / 123" name="empresa_endereco" value="<?php 
if (isset($data['empresa_endereco'])) {
    echo $data['empresa_endereco'];
}
?>
" />
            </label>

            <div class="label_line">
                <label class="label_small">
                    <span class="field">Estado UF:</span>
                    <select class="j_loadstate" name="empresa_uf">
                        <option value="" disabled selected> Selecione o estado </option>
                        <?php 
$readState = new Controle();
$readState->FullRead("SELECT * FROM app_estados ORDER BY estado_nome ASC", null);
foreach ($readState->getResult() as $estado) {
    extract((array) $estado);
    echo "<option value=\"{$estado_id}\" ";
    if (isset($data['empresa_uf']) && $data['empresa_uf'] == $estado_id) {
        echo 'selected';
    }
    echo "> {$estado_uf} / {$estado_nome} </option>";
}
?>
                        
                    </select>
                </label>

                <label class="label_small">
                    <span class="field">Cidade:</span>
$tpl_g = $View->Load('article_g');
$tpl_m = $View->Load('article_m');
$tpl_p = $View->Load('article_p');
$tpl_empresa = $View->Load('empresa_p');
?>
<!--HOME SLIDER-->
<section class="main-slider">
    <h3>Últimas Atualizações:</h3>
    <div class="container">
        
        <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>
Example #5
0
<div class="content home">

    <aside>
        <h1 class="boxtitle">Estatísticas de Acesso:</h1>

        <article class="sitecontent boxaside">
            <h1 class="boxsubtitle">Conteúdo:</h1>

            <?php 
//Objeto READ
$read = new Controle();
//VISITAS DO SITE
$read->FullRead("SELECT SUM(siteviews_views) AS views FROM ws_siteviews");
$Views = $read->getResult()[0]->views;
//USUÁRIOS
$read->FullRead("SELECT SUM(siteviews_users) AS users FROM ws_siteviews");
$Users = $read->getResult()[0]->users;
//MÉDIA DE PAGEVIEWS
$read->FullRead("SELECT SUM(siteviews_pages) AS pages FROM ws_siteviews");
$ResPages = $read->getResult()[0]->pages;
$Pages = substr($ResPages / ($Users == 0 ? 1 : $Users), 0, 5);
//POSTS
$read->setTable("ws_posts");
$read->findAll();
$Posts = $read->getRowCount();
//            //EMPRESAS
//            $read->setTable("app_empresas");
//            $read->findAll();
//            $Empresas = $read->getRowCount();
?>
            
<?php

$Read = new Controle('ws_perfil_has_ws_acesso');
switch ($method) {
    case "GET":
        //retorna todos os itens
        if ($id) {
            $sql = "SELECT * FROM ws_perfil_has_ws_acesso pa " . "JOIN ws_perfil p ON(p.perfil_id = pa.perfil_id) " . "JOIN ws_acesso a ON(a.acesso_id = pa.acesso_id) " . "WHERE pa.perfil_id = :perfil_id";
            $Read->FullRead($sql, "perfil_id={$id}", true);
            Check::JsonReturn($Read->getResult(), 'Perfil sem acessos cadastrados', 204);
        } else {
            $Read->findAll();
            Check::JsonReturn($Read->getResult(), 'Nenhum perfil cadastrado!', 204);
        }
        break;
    case "POST":
        if ($request->id) {
            $message = ['message' => 'Salvo com sucesso!', 'status' => 200];
            //deleta todos os dados deste pefil
            $Read->delete("perfil_id={$request->id}");
            foreach ($request->list as $value) {
                $Read->insert("perfil_id={$request->id}&acesso_id={$value->acesso_id}");
            }
            echo json_encode($message);
        }
        break;
    case "DELETE":
        //deleta arquivo
        break;
    default:
        break;
Example #7
0
            break;
        case 'delete':
            $perfilUpdate->ExeDelete($perfilAction);
            WSErro('O perfil ' . $perfilUpdate->getError()[0], $perfilUpdate->getError()[1]);
            break;
        default:
            WSErro("Ação não foi identificada pelo sistema, favor utilize os botões", WS_ERROR);
            break;
    }
}
$posti = 0;
$getPage = filter_input(INPUT_GET, 'page', FILTER_VALIDATE_INT);
$Pager = new Pager("painel.php?exe=perfil/index&page=");
$Pager->ExePager($getPage, 6);
$Read = new Controle();
$Read->FullRead("SELECT * FROM ws_perfil ORDER by perfil_status ASC, perfil_date DESC LIMIT :limit OFFSET :offset", "limit={$Pager->getLimit()}&offset={$Pager->getOffset()}", true);
if (!$Read->getResult()) {
    $Pager->ReturnPage();
    WSErro("Desculpa, ainda não temos perfis cadastrados", WS_INFOR);
} else {
    foreach ($Read->getResult() as $post) {
        $posti++;
        extract((array) $post);
        $status = !$perfil_status ? 'style="background: #fffed8"' : '';
        ?>
                <article<?php 
        if ($posti % 2 == 0) {
            echo ' class="right" ';
        }
        ?>
 <?php 
            WSErro("O status da empresa foi atualizado para <b>inativo</b>. Empresa agora é um rascunho!", WS_ALERT);
            break;
        case 'delete':
            $empUpdate->ExeDelete($empAction);
            WSErro($empUpdate->getError()[0], $empUpdate->getError()[1]);
            break;
        default:
            WSErro("Ação não foi identifica pelo sistema, favor utilize os botões!", WS_ALERT);
    }
}
$empi = 0;
$getPage = filter_input(INPUT_GET, 'page', FILTER_VALIDATE_INT);
$Pager = new Pager('painel.php?exe=empresas/index&page=');
$Pager->ExePager($getPage, 10);
$readEmp = new Controle();
$readEmp->FullRead("SELECT * FROM app_empresas ORDER BY empresa_status ASC, empresa_title ASC LIMIT :limit OFFSET :offset", "limit={$Pager->getLimit()}&offset={$Pager->getOffset()}", true);
if ($readEmp->getResult()) {
    foreach ($readEmp->getResult() as $emp) {
        $empi++;
        extract((array) $emp);
        $status = !$empresa_status ? 'style="background: #fffed8"' : '';
        $stateObj = new Controle('app_estados');
        $stateObj->Query("estado_id = :est", "est={$empresa_uf}");
        $state = $stateObj->getResult() ? $stateObj->getResult()[0]->estado_uf : 'NULL';
        $cityObj = new Controle('app_cidades');
        $cityObj->Query("cidade_id = :city", "city={$empresa_cidade}");
        $city = $cityObj->getResult() ? $cityObj->getResult()[0]->cidade_nome : 'NULL';
        ?>
                <article<?php 
        if ($empi % 2 == 0) {
            echo ' class="right"';
Example #9
0
            break;
        case 'delete':
            $tubeUpdate->ExeDelete($tubeAction);
            WSErro($tubeUpdate->getError()[0], $tubeUpdate->getError()[1]);
            break;
        default:
            WSErro("Ação não foi identificada pelo sistema, favor utilize os botões", WS_ERROR);
            break;
    }
}
$posti = 0;
$getPage = filter_input(INPUT_GET, 'page', FILTER_VALIDATE_INT);
$Pager = new Pager("painel.php?exe=youtube/index&page=");
$Pager->ExePager($getPage, 6);
$Read = new Controle();
$Read->FullRead("SELECT * FROM app_youtube ORDER by youtube_status ASC, youtube_date DESC LIMIT :limit OFFSET :offset", "limit={$Pager->getLimit()}&offset={$Pager->getOffset()}", true);
if ($Read->getResult()) {
    foreach ($Read->getResult() as $post) {
        $posti++;
        extract((array) $post);
        $status = !$youtube_status ? 'style="background: #fffed8"' : '';
        ?>
                <article<?php 
        if ($posti % 2 == 0) {
            echo ' class="right" ';
        }
        ?>
 <?php 
        echo $status;
        ?>
>
Example #10
0
            break;
        case 'delete':
            $postUpdate->ExeDelete($postAction);
            WSErro($postUpdate->getError()[0], $postUpdate->getError()[1]);
            break;
        default:
            WSErro("Ação não foi identificada pelo sistema, favor utilize os botões", WS_ERROR);
            break;
    }
}
$posti = 0;
$getPage = filter_input(INPUT_GET, 'page', FILTER_VALIDATE_INT);
$Pager = new Pager("painel.php?exe=area_trabalho/index&page=");
$Pager->ExePager($getPage, 6);
$Read = new Controle();
$Read->FullRead("SELECT * FROM ws_area_trabalho ORDER by area_status ASC, area_date DESC LIMIT :limit OFFSET :offset", "limit={$Pager->getLimit()}&offset={$Pager->getOffset()}", true);
if (!$Read->getResult()) {
    $Pager->ReturnPage();
    WSErro("Desculpa, ainda não temos áreas cadastrados", WS_INFOR);
} else {
    foreach ($Read->getResult() as $setor) {
        $posti++;
        extract((array) $setor);
        $status = !$area_status ? 'style="background: #fffed8"' : '';
        ?>
                <article<?php 
        if ($posti % 2 == 0) {
            echo ' class="right" ';
        }
        ?>
 <?php 
<?php

include '../../_app/Config.inc.php';
$Read = new Controle();
//Grafico de colunas Numero de paradas por equipamento
$Read->FullRead("SELECT count(e.ws_users) as 'cont' , u.* FROM fe_exames e " . "JOIN ws_users u ON(u.user_id = e.ws_users) " . "GROUP BY e.ws_users;");
$dataarray[] = ['Usuario', 'Total Exames'];
foreach ($Read->getResult() as $value) {
    $dataarray[] = [$value->user_name, (int) $value->cont];
}
echo json_encode($dataarray);