Commit df0ed09c authored by alissonalbuquerque's avatar alissonalbuquerque
Browse files

Merge branch 'tabelas-ensino'

parents e575e1c3 3d8096a7
......@@ -4,6 +4,7 @@ namespace App\Http\Controllers;
use App\Models\Campus;
use App\Models\Unidade;
use App\Queries\CampusQuery;
use Illuminate\Http\Request;
class CampusController extends Controller
......@@ -86,4 +87,11 @@ class CampusController extends Controller
{
//
}
public function findByUnidade(int $unidade_id)
{
return CampusQuery::whereUnidadeId($unidade_id)->orderBy('name')->get();
}
}
<?php
namespace App\Http\Controllers;
use App\Queries\UnidadeQuery;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Auth;
class DashboardController extends Controller
{
public function index() {
$user = Auth::user();
if($user->isTypeAdmin())
{
return view('dashboard', ['unidades' => UnidadeQuery::all(), 'unidade_index' => 1]);
}
}
}
......@@ -3,6 +3,7 @@
namespace App\Http\Controllers;
use App\Models\Unidade;
use App\Queries\UnidadeQuery;
use Illuminate\Http\Request;
class UnidadeController extends Controller
......@@ -35,7 +36,9 @@ class UnidadeController extends Controller
*/
public function store(Request $request)
{
// dd($request);
return redirect('/dashboard');
}
/**
......@@ -91,4 +94,12 @@ class UnidadeController extends Controller
return redirect('/unidade/index');
}
/**
* @return array
*/
public function getAll()
{
return UnidadeQuery::all();
}
}
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
class EnsinoAula extends Model
{
use HasFactory;
const NIVEL_GRADUACAO = 1;
const NIVEL_POS_GRADUACAO_LATO_SENSU = 2;
const NIVEL_POS_GRADUACAO_STRICTO_SENSU = 3;
const MODALIDADE_EAD = 1;
const MODALIDADE_PRESENCIAL = 2;
/**
* References table ensino_aulas
*
* @var string
*/
protected $table = 'ensino_aulas';
/**
* The attributes that are mass assignable.
*
* @var array
*/
protected $fillable = ['cod_atividade', 'componente_curricular', 'curso_id', 'nivel', 'modalidade', 'ch_semanal', 'ch_total', 'pad_id'];
private $codesDimensao = ['E-1', 'E-2', 'E-3'];
/**
* @return array|string
*/
public function listNivel($value = null) {
$values = [
self::NIVEL_GRADUACAO => 'Graduação',
self::NIVEL_POS_GRADUACAO_LATO_SENSU => 'Pós-graduação Stricto Sensu',
self::NIVEL_POS_GRADUACAO_STRICTO_SENSU => 'Pós-Graduação Lato Sensu',
];
return $value !== null? $values[$value] : $values;
}
/**
* @return array|string
*/
public function listModalidade($value = null) {
$values = [
self::MODALIDADE_EAD => 'EAD',
self::MODALIDADE_PRESENCIAL => 'Presencial',
];
return $value !== null? $values[$value] : $values;
}
/**
* @return array
*/
public function orientacaoPreenchimento() {
return [
'descricao' => 'Ensino (Aulas em componentes curriculares)',
'componente_curricular' => 'Nome do Componente: Nome do componente curricular como descrito no PPC do curso',
'curso' => 'Curso: Nome do curso ao qual o componente curricular pertence',
'nivel' => 'Nível: Preencher o nível do curso ao qual o componente curricular pertence, sendo as opções: Graduação, Pós-graduação Stricto Sensu, Pós-Graduação Lato Sensu',
'modalidade' => 'Modalidade: Preencher a modalidade que o componente curricular é ofertado, sendo as opções: Presencial e EAD',
'ch_semanal' => 'Carga Horária Semanal: Carga horária total efetiva exercida pelo docente dentro do componente curricular dividida pelo número de semanas que o mesmo ocorre',
'ch_total' => 'Carga Horária Total: Carga horária total efetiva exercida pelo docente dentro do(s) componente(s) curricular (es)',
];
}
/**
* Get PAD with pad.id = ensino_aulas.pad_id
*
* @return PAD
*/
public function pad() {
return $this->belongsTo(PAD::class);
}
/**
* Get Curso with curso.id = ensino_aulas.curso_id
*
* @return Curso
*/
public function curso()
{
return $this->belongsTo(Curso::class);
}
/**
* @return PlanejamentoQuery|Builder
*/
public function getPlanejamentos() {
return PlanejamentoQuery::whereInCodDimensao($this->codesDimensao);
}
}
......@@ -66,6 +66,35 @@ class User extends Authenticatable
return $this->belongsTo(Unidade::class);
}
/**
* @return bool
*/
public function isTypeAdmin() {
return $this->type === self::TYPE_ADMIN;
}
/**
* @return bool
*/
public function isTypeTeacher() {
return $this->type === self::TYPE_TEACHER;
}
/**
* @return bool
*/
public function isTypeMenager() {
return $this->type === self::TYPE_MANAGER;
}
/**
* @return bool
*/
public function isTypeCoordinator() {
return $this->type === self::TYPE_COORDINATOR;
}
/**
* @return string
*/
......
<?php
namespace App\Queries;
use App\Models\Campus;
class CampusQuery extends Campus {
/**
* @param integer $id
* @param string $expression
* @return array|Campus|null
*/
public static function whereUnidadeId(int $id, string $expression = '=')
{
return Campus::where('unidade_id', $expression, $id);
}
}
\ No newline at end of file
<?php
namespace App\Queries;
class Query {
protected $query;
public function getQuery(){
return $this->query;
}
}
<?php
namespace App\Queries\Tabelas\Ensino;
use App\Models\EnsinoAula;
use App\Queries\Query;
class EnsinoAulaQuery extends Query {
public function __construct($init = []) {
$this->query = EnsinoAula::where($init);
}
/**
* @param integer $pad_id
* @param string $expression
* @return Builder
*/
public function wherePadId(int $pad_id, string $expression = '=') {
$this->query->where('pad_id', $expression, $pad_id);
}
}
\ No newline at end of file
<?php
namespace App\Queries;
use App\Models\Unidade;
class UnidadeQuery extends Unidade {
}
\ No newline at end of file
<?php
namespace App\Queries;
use App\Models\User;
class UserQuery extends User {
// public static function whereType
}
\ No newline at end of file
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateEnsinoAulasTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('ensino_aulas', function (Blueprint $table) {
$table->id();
$table->string('cod_atividade')->notNull();
$table->string('componente_curricular')->notNull();
$table->foreignId('curso_id')->notNull();
$table->tinyInteger('nivel')->notNull();
$table->tinyInteger('modalidade')->notNull();
$table->integer('ch_semanal')->notNull();
$table->integer('ch_total')->notNull();
$table->foreignId('pad_id');
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('ensino_aulas');
}
}
......@@ -13,8 +13,8 @@ return [
|
*/
'failed' => 'These credentials do not match our records.',
'password' => 'The provided password is incorrect.',
'throttle' => 'Too many login attempts. Please try again in :seconds seconds.',
'failed' => 'Verifique se o e-mail e a senha estão corretos',
'password' => 'A senha fornecida está incorreta.',
'throttle' => 'Muitas tentativas de login incorretas. Por favor tente de novo em :seconds segundos.',
];
......@@ -10,7 +10,7 @@
<x-auth-session-status class="mb-4" :status="session('status')" />
<!-- Validation Errors -->
<x-auth-validation-errors class="mb-4" :errors="$errors" />
<x-auth-validation-errors class="alert alert-danger mb-2" :errors="$errors" />
<form action="{{ route('login') }}" method="POST" class="signin-form d-md-flex">
@csrf
......
......@@ -3,7 +3,7 @@
@if ($errors->any())
<div {{ $attributes }}>
<div class="font-medium text-red-600">
{{ __('Whoops! Something went wrong.') }}
{{ __('Ops! Algo deu errado.') }}
</div>
<ul class="mt-3 list-disc list-inside text-sm text-red-600">
......
<a class="{{$css}}" href="{{$route}}" id="{{$id}}">
<svg xmlns="http://www.w3.org/2000/svg" width="36" height="36" fill="currentColor" class="bi bi-plus-circle" viewBox="0 0 16 16">
<path d="M8 15A7 7 0 1 1 8 1a7 7 0 0 1 0 14zm0 1A8 8 0 1 0 8 0a8 8 0 0 0 0 16z" />
<path d="M8 4a.5.5 0 0 1 .5.5v3h3a.5.5 0 0 1 0 1h-3v3a.5.5 0 0 1-1 0v-3h-3a.5.5 0 0 1 0-1h3v-3A.5.5 0 0 1 8 4z" />
</svg>
{{$text}}
</a>
\ No newline at end of file
<a class="btn btn-primary" href="{{$route}}"> Create </a>
<table class="{{$css}}" id="{{$id}}">
<thead>
<tr>
</tr>
</thead>
<tbody>
<tr>
</tr>
</tbody>
</table>
<x-app-layout>
<x-slot name="main">
<div class="tab-content">
<div class="tab-pane active" id="home" role="tabpanel" aria-labelledby="home-tab">
<div
class="d-flex justify-content-between flex-wrap flex-md-nowrap align-items-center pt-3 pb-2 mb-3 border-bottom">
<h1 class="h2">Bem Vindo ao PAD</h1>
</div>
<div class="d-flex justify-content-between flex-wrap flex-md-nowrap align-items-center pt-3 pb-2 mb-3">
<h2 class="h3">
<svg xmlns="http://www.w3.org/2000/svg" width="26" height="26" fill="currentColor"
class="bi bi-exclamation-octagon-fill" viewBox="0 0 16 16">
<path
d="M11.46.146A.5.5 0 0 0 11.107 0H4.893a.5.5 0 0 0-.353.146L.146 4.54A.5.5 0 0 0 0 4.893v6.214a.5.5 0 0 0 .146.353l4.394 4.394a.5.5 0 0 0 .353.146h6.214a.5.5 0 0 0 .353-.146l4.394-4.394a.5.5 0 0 0 .146-.353V4.893a.5.5 0 0 0-.146-.353L11.46.146zM8 4c.535 0 .954.462.9.995l-.35 3.507a.552.552 0 0 1-1.1 0L7.1 4.995A.905.905 0 0 1 8 4zm.002 6a1 1 0 1 1 0 2 1 1 0 0 1 0-2z" />
</svg>
Atividades a serem realizdas
</h2>
</div>
<div
class="d-flex justify-content-between flex-wrap flex-md-nowrap align-items-center pt-3 pb-2 mb-3 border-top">
<ul class="inf-list">
<li><a href="" rel="noopener" target="_blank">Cronograma de atividades PAD 2022</a></li>
<li><a href="" rel="noopener" target="_blank">Informações sobre o processo PAD 2022</a></li>
</ul>
</div>
</div>
<div class="tab-pane" id="coordenador" role="tabpanel" aria-labelledby="coordenador-tab">
<div
class="d-flex justify-content-between flex-wrap flex-md-nowrap align-items-center pt-3 pb-2 mb-3 border-bottom">
<h1 class="h2">Gestão de Coordenador</h1>
</div>
@if(Auth::check())
@include('layouts.user-dashboard.update_perfil', ['user' => Auth::user()])
@endif
@if(Auth::user()->isTypeAdmin())
@include('layouts.user-dashboard.dashboard_admin')
@endif
@if(Auth::user()->isTypeTeacher())
@include('layouts.user-dashboard.dashboard_teacher')
@endif
<a class="btn btn-secondary btn-lg" onclick="redirecionamentoCadastroCoordenador()"
data-toggle="tooltip" data-placement="bottom" title="Click para Cadastrar Novo Coordenador">
<svg xmlns="http://www.w3.org/2000/svg" width="36" height="36" fill="currentColor"
class="bi bi-person-plus-fill" viewBox="0 0 16 16">
<path d="M1 14s-1 0-1-1 1-4 6-4 6 3 6 4-1 1-1 1H1zm5-6a3 3 0 1 0 0-6 3 3 0 0 0 0 6z" />
<path fill-rule="evenodd"
d="M13.5 5a.5.5 0 0 1 .5.5V7h1.5a.5.5 0 0 1 0 1H14v1.5a.5.5 0 0 1-1 0V8h-1.5a.5.5 0 0 1 0-1H13V5.5a.5.5 0 0 1 .5-.5z" />
</svg>
Cadastrar Novo Coordenador
</a>
<a class="btn btn-secondary btn-lg" onclick="redirecionamentoListaCoordenador()" data-toggle="tooltip"
data-placement="bottom" title="Click para Listar Coordenador">
<svg xmlns="http://www.w3.org/2000/svg" width="36" height="36" fill="currentColor"
class="bi bi-person-lines-fill" viewBox="0 0 16 16">
<path
d="M6 8a3 3 0 1 0 0-6 3 3 0 0 0 0 6zm-5 6s-1 0-1-1 1-4 6-4 6 3 6 4-1 1-1 1H1zM11 3.5a.5.5 0 0 1 .5-.5h4a.5.5 0 0 1 0 1h-4a.5.5 0 0 1-.5-.5zm.5 2.5a.5.5 0 0 0 0 1h4a.5.5 0 0 0 0-1h-4zm2 3a.5.5 0 0 0 0 1h2a.5.5 0 0 0 0-1h-2zm0 3a.5.5 0 0 0 0 1h2a.5.5 0 0 0 0-1h-2z" />
</svg>
Listar Coordenador
</a>
</div>
<div class="tab-pane" id="campus" role="tabpanel" aria-labelledby="campus-tab">
<div
class="d-flex justify-content-between flex-wrap flex-md-nowrap align-items-center pt-3 pb-2 mb-3 border-bottom">
<h1 class="h2">Gestão de Campus</h1>
</div>
@if(Auth::user()->isTypeMenager())
@include('layouts.user-dashboard.dashboard_menager')
@endif
<a class="btn btn-secondary btn-lg" onclick="redirecionamentoCadastroCampos()" data-toggle="tooltip"
data-placement="bottom" title="Click para Cadastrar Novo Campus">
<svg xmlns="http://www.w3.org/2000/svg" width="36" height="36" fill="currentColor"
class="bi bi-plus-circle" viewBox="0 0 16 16">
<path d="M8 15A7 7 0 1 1 8 1a7 7 0 0 1 0 14zm0 1A8 8 0 1 0 8 0a8 8 0 0 0 0 16z" />
<path
d="M8 4a.5.5 0 0 1 .5.5v3h3a.5.5 0 0 1 0 1h-3v3a.5.5 0 0 1-1 0v-3h-3a.5.5 0 0 1 0-1h3v-3A.5.5 0 0 1 8 4z" />
</svg>
Cadastrar Novo Campus
</a>
<a class="btn btn-secondary btn-lg" onclick="redirecionamentoListaCampos()" data-toggle="tooltip"
data-placement="bottom" title="Click para Listar Campus">
<svg xmlns="http://www.w3.org/2000/svg" width="36" height="36" fill="currentColor"
class="bi bi-list-task" viewBox="0 0 16 16">
<path fill-rule="evenodd"
d="M2 2.5a.5.5 0 0 0-.5.5v1a.5.5 0 0 0 .5.5h1a.5.5 0 0 0 .5-.5V3a.5.5 0 0 0-.5-.5H2zM3 3H2v1h1V3z" />
<path
d="M5 3.5a.5.5 0 0 1 .5-.5h9a.5.5 0 0 1 0 1h-9a.5.5 0 0 1-.5-.5zM5.5 7a.5.5 0 0 0 0 1h9a.5.5 0 0 0 0-1h-9zm0 4a.5.5 0 0 0 0 1h9a.5.5 0 0 0 0-1h-9z" />
<path fill-rule="evenodd"
d="M1.5 7a.5.5 0 0 1 .5-.5h1a.5.5 0 0 1 .5.5v1a.5.5 0 0 1-.5.5H2a.5.5 0 0 1-.5-.5V7zM2 7h1v1H2V7zm0 3.5a.5.5 0 0 0-.5.5v1a.5.5 0 0 0 .5.5h1a.5.5 0 0 0 .5-.5v-1a.5.5 0 0 0-.5-.5H2zm1 .5H2v1h1v-1z" />
</svg>
Listar Campus
</a>
</div>
<div class="tab-pane" id="cursos" role="tabpanel" aria-labelledby="cursos-tab">
<div
class="d-flex justify-content-between flex-wrap flex-md-nowrap align-items-center pt-3 pb-2 mb-3 border-bottom">
<h1 class="h2">Gestão de Cursos</h1>
</div>
<a class="btn btn-secondary btn-lg" onclick="redirecionamentoCadastroCurso()" data-toggle="tooltip"
data-placement="bottom" title="Click para Cadastrar Novo Curso">
<svg xmlns="http://www.w3.org/2000/svg" width="36" height="36" fill="currentColor"
class="bi bi-plus-circle" viewBox="0 0 16 16">
<path d="M8 15A7 7 0 1 1 8 1a7 7 0 0 1 0 14zm0 1A8 8 0 1 0 8 0a8 8 0 0 0 0 16z" />
<path
d="M8 4a.5.5 0 0 1 .5.5v3h3a.5.5 0 0 1 0 1h-3v3a.5.5 0 0 1-1 0v-3h-3a.5.5 0 0 1 0-1h3v-3A.5.5 0 0 1 8 4z" />
</svg>
Cadastrar Novo Curso
</a>
<a class="btn btn-secondary btn-lg" onclick="redirecionamentoListaCurso()" data-toggle="tooltip"
data-placement="bottom" title="Click para Listar Cursos">
<svg xmlns="http://www.w3.org/2000/svg" width="36" height="36" fill="currentColor"
class="bi bi-list-task" viewBox="0 0 16 16">
<path fill-rule="evenodd"
d="M2 2.5a.5.5 0 0 0-.5.5v1a.5.5 0 0 0 .5.5h1a.5.5 0 0 0 .5-.5V3a.5.5 0 0 0-.5-.5H2zM3 3H2v1h1V3z" />
<path
d="M5 3.5a.5.5 0 0 1 .5-.5h9a.5.5 0 0 1 0 1h-9a.5.5 0 0 1-.5-.5zM5.5 7a.5.5 0 0 0 0 1h9a.5.5 0 0 0 0-1h-9zm0 4a.5.5 0 0 0 0 1h9a.5.5 0 0 0 0-1h-9z" />
<path fill-rule="evenodd"
d="M1.5 7a.5.5 0 0 1 .5-.5h1a.5.5 0 0 1 .5.5v1a.5.5 0 0 1-.5.5H2a.5.5 0 0 1-.5-.5V7zM2 7h1v1H2V7zm0 3.5a.5.5 0 0 0-.5.5v1a.5.5 0 0 0 .5.5h1a.5.5 0 0 0 .5-.5v-1a.5.5 0 0 0-.5-.5H2zm1 .5H2v1h1v-1z" />
</svg>
Listar Cursos
</a>
</div>
<div class="tab-pane" id="professor" role="tabpanel" aria-labelledby="professor-tab">
<div
class="d-flex justify-content-between flex-wrap flex-md-nowrap align-items-center pt-3 pb-2 mb-3 border-bottom">
<h1 class="h2">Gestão de Professor</h1>
</div>
@if(Auth::user()->isTypeCoordinator())
@include('layouts.user-dashboard.dashboard_coordinator')
@endif
<a class="btn btn-secondary btn-lg" onclick="redirecionamentoCadastroProfessor()" data-toggle="tooltip"
data-placement="bottom" title="Click para Cadastrar Novo Professor">
<svg xmlns="http://www.w3.org/2000/svg" width="36" height="36" fill="currentColor"
class="bi bi-person-plus-fill" viewBox="0 0 16 16">
<path d="M1 14s-1 0-1-1 1-4 6-4 6 3 6 4-1 1-1 1H1zm5-6a3 3 0 1 0 0-6 3 3 0 0 0 0 6z" />
<path fill-rule="evenodd"
d="M13.5 5a.5.5 0 0 1 .5.5V7h1.5a.5.5 0 0 1 0 1H14v1.5a.5.5 0 0 1-1 0V8h-1.5a.5.5 0 0 1 0-1H13V5.5a.5.5 0 0 1 .5-.5z" />
</svg>
Cadastrar Novo Professor
</a>
<a class="btn btn-secondary btn-lg" onclick="redirecionamentoListaProfessor()" data-toggle="tooltip"
data-placement="bottom" title="Click para Listar Professor">
<svg xmlns="http://www.w3.org/2000/svg" width="36" height="36" fill="currentColor"
class="bi bi-person-lines-fill" viewBox="0 0 16 16">
<path
d="M6 8a3 3 0 1 0 0-6 3 3 0 0 0 0 6zm-5 6s-1 0-1-1 1-4 6-4 6 3 6 4-1 1-1 1H1zM11 3.5a.5.5 0 0 1 .5-.5h4a.5.5 0 0 1 0 1h-4a.5.5 0 0 1-.5-.5zm.5 2.5a.5.5 0 0 0 0 1h4a.5.5 0 0 0 0-1h-4zm2 3a.5.5 0 0 0 0 1h2a.5.5 0 0 0 0-1h-2zm0 3a.5.5 0 0 0 0 1h2a.5.5 0 0 0 0-1h-2z" />
</svg>
Listar Professor
</a>
</div>
<div class="tab-pane" id="pad" role="tabpanel" aria-labelledby="pad-tab">
<div
class="d-flex justify-content-between flex-wrap flex-md-nowrap align-items-center pt-3 pb-2 mb-3 border-bottom">
<h1 class="h2">Listagem PAD</h1>
</div>
</div>
</div>
</x-slot>
</x-app-layout>
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment