Beispiel #1
0
if (!empty($ClienteData['user_birthday'])) {
    echo date('d/m/Y', strtotime($ClienteData['user_birthday']));
}
?>
" title="Informe sua data de nascimento" required />
                </label>
            </div>

            <div class="label_line">
                <label class="label_medium">
                    <span class="field">Setor de trabalho:</span>
                    <select name = "area_id" title = "Selecione o nível de usuário" required >
                        <option value = "">Selecione o Nível</option>
                        <?php 
$WsAreaTrabalho = new WsAreaTrabalho();
$WsAreaTrabalho->Execute()->findAll();
foreach ($WsAreaTrabalho->Execute()->getResult() as $setor) {
    $select = isset($ClienteData['area_id']) && $ClienteData['area_id'] == $setor->area_id ? "selected='selected'" : '';
    echo "\n<option value='{$setor->area_id}' {$select}>{$setor->area_title}</option>";
}
?>
                    </select>
                </label>

                <label class="label_medium">
                    <span class="field">Perfil de acesso:</span>
                    <select name="perfil_id" title="Selecione o nível de usuário" required >
                        <option value="">Selecione o Nível</option>
                        <?php 
unset($select);
$WsPerfil = new WsPerfil();
Beispiel #2
0
                        </ul>
                    </header>

                    <h2>Sub categorias:</h2>

                    <?php 
        $ReadSes->setCategory_parent($category_id);
        $ReadSes->Execute()->Query("#category_parent#");
        if (!$ReadSes->Execute()->getResult()) {
        } else {
            $a = 0;
            foreach ($ReadSes->Execute()->getResult() as $sub) {
                $a++;
                $ReadCatPosts = new WsAreaTrabalho();
                $ReadCatPosts->setCategory_id($sub->category_id);
                $ReadCatPosts->Execute()->Query("#category_id#");
                $ContCatPost = $ReadCatPosts->Execute()->getRowCount();
                ?>
                            <article<?php 
                if ($a % 3 == 0) {
                    echo ' class="right"';
                }
                ?>
>
                                <h1><a target="_blank" href="../categoria/<?php 
                echo $sub->category_name;
                ?>
" title="Ver Categoria"><?php 
                echo $sub->category_title;
                ?>
</a>  ( <?php 
 public static function AreaById($area_id)
 {
     $WsAreaTrabalho = new WsAreaTrabalho();
     $WsAreaTrabalho->setArea_id($area_id);
     $WsAreaTrabalho->Execute()->find();
     return $WsAreaTrabalho->Execute()->getResult();
 }
Beispiel #4
0
        </header>

        <?php 
require '_models/AdminArea.class.php';
$data = filter_input_array(INPUT_POST, FILTER_DEFAULT);
$areaId = filter_input(INPUT_GET, 'areaId', FILTER_VALIDATE_INT);
if (!empty($data['SendPostForm'])) {
    unset($data['SendPostForm']);
    $data['area_id'] = $areaId;
    $cadastra = new AdminArea();
    $cadastra->ExeUpdate($data);
    WSErro($cadastra->getError()[0], $cadastra->getError()[1]);
} else {
    $Read = new WsAreaTrabalho();
    $Read->setArea_id($areaId);
    $Read->Execute()->Query("#area_id#");
    if (!$Read->Execute()->getResult()) {
        header("Location: painel.php?exe=area_trabalho/index&empty=true");
    } else {
        $data = (array) $Read->Execute()->getResult()[0];
    }
}
$checkCreate = filter_input(INPUT_GET, 'create', FILTER_VALIDATE_BOOLEAN);
if ($checkCreate && empty($cadastra)) {
    WSErro("O Área <b>{$data['area_title']}</b> foi cadastrado com sucesso no sistema! Continue atualizando o mesmo!", WS_ACCEPT);
}
?>

        <form name="PostForm" action="" method="post" enctype="multipart/form-data">
            <label class="label">
                <span class="field">Titulo:</span>
Beispiel #5
0
<?php

$Read = new WsAreaTrabalho();
switch ($method) {
    case "GET":
        //retorna todos os itens
        if (isset($id)) {
            $Read->setArea_id($id);
            $Read->Execute()->find();
            Check::JsonReturn($Read->Execute()->getResult(), 'Área não encontrada!', '404');
        } else {
            $Read->Execute()->findAll();
            Check::JsonReturn($Read->Execute()->getResult(), 'Nenhuma área cadastrado!', '204');
        }
        break;
    case "POST":
        if (!empty($request->area_id)) {
            //update
            $Read->setThis($request);
            $Read->Execute()->update(NULL, 'area_id');
            echo json_encode($request);
        } else {
            //salvar
            $request->area_status = 1;
            $Read->setThis($request);
            $insert = $Read->Execute()->insert();
            if ($insert) {
                $request->area_id = (int) $Read->Execute()->MaxFild("area_id");
            }
            echo json_encode($request);
        }
 private function checkArea()
 {
     $readArea = new WsAreaTrabalho();
     $readArea->setCategory_id($this->CatId);
     $readArea->Execute()->find();
     if (!empty($readArea->Execute()->getResult())) {
         return false;
     } else {
         return true;
     }
 }
 private function getAreaTrabalho($area_id)
 {
     $Read = new WsAreaTrabalho();
     $Read->setArea_id($area_id);
     $query = $Read->Execute()->Query("#area_id#");
     if ($Read->Execute()->getResult()) {
         return $query[0];
     } else {
         WSErro("A área não foi encontrado!", WS_ERROR);
         return null;
     }
 }
Beispiel #8
0
$type = Check::AreaTypeByName("trabalho");
?>
            <div class="col-md-12 well">
                <label class="col-md-4">
                    Setor:
                    <div class="input-group">
                        <span class="input-group-addon glyphicon glyphicon-map-marker"></span>

                        <select class="form-control" name="area_id">
                            <option value="">Selecione uma area de trabalho</option>
                            <?php 
if (!empty($type)) {
    $WsSetor = new WsAreaTrabalho();
    $WsSetor->setCategory_id($type);
    $WsSetor->setCategory_parent($type);
    $WsSetor->Execute()->FullRead("SELECT * FROM ws_area_trabalho WHERE (category_id = :category_id OR category_parent = :category_parent) AND area_status = 1");
    foreach ($WsSetor->Execute()->getResult() as $setor) {
        $select = isset($area_id) && $area_id == $setor->area_id ? "selected='selected'" : '';
        echo "\n<option value='{$setor->area_id}' {$select}>{$setor->area_title}</option>";
    }
}
?>
                        </select>
                    </div>
                </label>

                <label class="col-md-4">
                    User:
                    <div class="input-group">
                        <span class="input-group-addon glyphicon glyphicon-user"></span>
                        <input type="text" name="user_nickname" value="<?php