Commit 3e54aa53 authored by alissonalbuquerque's avatar alissonalbuquerque
Browse files

Add atualizações de projeto

parent bbc48f36
<?php
namespace App\Queries\Tabelas\Pesquisa;
use App\Models\Tabelas\Pesquisa\PesquisaCoordenacao;
use App\Queries\CustomQuery;
class PesquisaCoordenacaoQuery extends CustomQuery
{
public function __construct()
{
$this->query = PesquisaCoordenacao::where([]);
self::$instance = $this;
}
public function whereUserPad($user_pad_id, $operator = '=')
{
$this->query = $this->query->where('user_pad_id', $operator, $user_pad_id);
return self::$instance;
}
}
\ No newline at end of file
<?php
namespace App\Queries\Tabelas\Pesquisa;
use App\Models\Tabelas\Pesquisa\PesquisaLideranca;
use App\Queries\CustomQuery;
class PesquisaLiderancaQuery extends CustomQuery
{
public function __construct()
{
$this->query = PesquisaLideranca::where([]);
self::$instance = $this;
}
public function whereUserPad($user_pad_id, $operator = '=')
{
$this->query = $this->query->where('user_pad_id', $operator, $user_pad_id);
return self::$instance;
}
}
\ No newline at end of file
<?php
namespace App\Queries\Tabelas\Pesquisa;
use App\Models\Tabelas\Pesquisa\PesquisaOrientacao;
use App\Queries\CustomQuery;
class PesquisaOrientacaoQuery extends CustomQuery
{
public function __construct()
{
$this->query = PesquisaOrientacao::where([]);
self::$instance = $this;
}
public function whereUserPad($user_pad_id, $operator = '=')
{
$this->query = $this->query->where('user_pad_id', $operator, $user_pad_id);
return self::$instance;
}
}
\ No newline at end of file
......@@ -4,6 +4,13 @@ namespace App\Queries;
use App\Models\Unidade;
class UnidadeQuery extends Unidade {
class UnidadeQuery extends CustomQuery
{
public function __construct()
{
$this->query = Unidade::where([]);
self::$instance = $this;
}
}
\ No newline at end of file
......@@ -4,7 +4,8 @@ namespace App\Queries;
use App\Models\UserPad;
class UserPadQuery extends CustomQuery {
class UserPadQuery extends CustomQuery
{
public function __construct()
{
......
......@@ -4,13 +4,14 @@ namespace App\Queries;
use App\Models\User;
class UserQuery {
private $query;
class UserQuery extends CustomQuery
{
public function __construct()
{
$this->query = User::where([]);
self::$instance = $this;
}
/**
......@@ -20,7 +21,7 @@ class UserQuery {
public function whereId($id, $expression = '=')
{
$this->query = $this->query->where('id', $expression, $id);
return $this->query;
return self::$instance;
}
/**
......@@ -30,14 +31,7 @@ class UserQuery {
public function whereType($type, $expression = '=')
{
$this->query = $this->query->where('type', $expression, $type);
return $this->query;
return self::$instance;
}
/**
* @return Builder
*/
public function getQuery()
{
return $this->query;
}
}
\ No newline at end of file
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreatePesquisaCoordenacaoTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('pesquisa_coordenacao', function (Blueprint $table) {
$table->id();
$table->tinyInteger('dimensao');
$table->foreignId('user_pad_id')->notNull();
$table->string('cod_atividade')->notNull();
$table->string('titulo_projeto')->notNull();
$table->string('linha_grupo_pesquisa')->notNull();
$table->tinyInteger('funcao')->notNull();
$table->integer('ch_semanal')->notNull();
$table->softDeletes();
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('pesquisa_coordenacao');
}
}
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreatePesquisaLiderancaTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('pesquisa_lideranca', function (Blueprint $table) {
$table->id();
$table->tinyInteger('dimensao');
$table->foreignId('user_pad_id')->notNull();
$table->string('cod_atividade')->notNull();
$table->string('grupo_pesquisa')->notNull();
$table->string('atividade')->notNull();
$table->tinyInteger('funcao')->notNull();
$table->integer('ch_semanal')->notNull();
$table->softDeletes();
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('pesquisa_lideranca');
}
}
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreatePesquisaOrientacaoTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('pesquisa_orientacao', function (Blueprint $table) {
$table->id();
$table->tinyInteger('dimensao');
$table->foreignId('user_pad_id')->notNull();
$table->string('cod_atividade')->notNull();
$table->string('titulo_projeto')->notNull();
$table->string('nome_orientando')->notNull();
$table->tinyInteger('funcao')->notNull();
$table->integer('ch_semanal')->notNull();
$table->softDeletes();
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('pesquisa_orientacao');
}
}
......@@ -22,37 +22,50 @@
<form action="{{ route('campus_store') }}" method="post">
@csrf
@method('POST')
<div class="form-group">
<label for="inputNameCampus">Nome do Campus</label>
<input type="text" name="name" class="form-control" id="inputNameCampus"
placeholder="Insira o nome do Campus" value="{{ old('name') }}">
@error('name')
<span class="text-danger"> {{ $message }} </span>
@enderror
</div>
<div class="form-group">
<label for="selectCampus">Campus</label>
<select class="custom-select" name="unidade_id" id="unidade_id">
<option value="" disabled selected hidden> selecione... </option>
@foreach ($unidades as $unidade)
<option value="{{ $unidade->id }}" {{ old('unidade_id') == $unidade->id ? 'selected' : '' }}>
{{ $unidade->name }} </option>
@endforeach
</select>
@error('unidade_id')
<span class="text-danger"> {{ $message }} </span>
@enderror
</div>
<div class="d-flex justify-content-between">
@include('components.buttons.btn-cancel', [
'route' => route('campus_index'),
])
@include('components.buttons.btn-save', [
'content' => 'Cadastrar',
'btn_class' => 'btn btn-outline-success',
'i_class' => '',
])
<div class='row'>
<div class='mb-3 col-sm-6'>
<div class="form-group">
<label for="name">Nome do Campus</label>
<input type="text" name="name" class="form-control" id="name"
placeholder="Campus" value="{{ old('name') }}">
@error('name')
<span class="text-danger"> {{ $message }} </span>
@enderror
</div>
</div>
<div class='mb-3 col-sm-6'>
<div class="form-group">
<label for="unidade_id">Unidade</label>
<select class="form-select" name="unidade_id" id="unidade_id">
<option value="" disabled selected hidden> selecione... </option>
@foreach ($unidades as $unidade)
<option value="{{ $unidade->id }}" {{ old('unidade_id') == $unidade->id ? 'selected' : '' }}>
{{ $unidade->name }} </option>
@endforeach
</select>
@error('unidade_id')
<span class="text-danger"> {{ $message }} </span>
@enderror
</div>
</div>
<div class='mt-1 text-end'>
@include('components.buttons.btn-cancel', [
'route' => route('campus_index'),
'content' => 'Cancelar'
])
@include('components.buttons.btn-save', [
'content' => 'Cadastrar'
])
</div>
</div>
</form>
</div>
@endsection
\ No newline at end of file
......@@ -17,9 +17,9 @@
<h2 class="">TODOS OS CAMPUS</h2>
@include('components.buttons.btn-create', [
'route' => route('campus_create'),
'class' => '',
'class' => 'btn btn-success',
'content' => 'Novo Campus',
'id' => '',
'id' => 'campus_create',
])
</div>
......@@ -41,11 +41,12 @@
<td>{{ $camp->unidade }}</td>
<td>
@include('components.buttons.btn-edit', [
'btn_class' => 'btn btn-warning',
'route' => route('campus_edit', ['id' => $camp->id]),
])
@include('components.buttons.btn-soft-delete', [
'modal_id' => $camp->id, 'route' => route('campus_delete', ['id' => $camp->id])
@include('components.buttons.btn-delete', [
'id' => $camp->id,
'route' => route('campus_delete', ['id' => $camp->id])
])
</td>
</tr>
......
......@@ -21,37 +21,52 @@
<form action="{{ route('campus_update', $campus->id) }}" method="post">
@csrf
@method('POST')
<div class="form-group">
<label for="inputNameCampus">Nome do Campus</label>
<input type="text" name="name" class="form-control" id="inputNameCampus"
placeholder="Insira o nome do Campus" value="{{ $campus->name }}{{ old('name') }}">
@error('name')
<span class="text-danger"> {{ $message }} </span>
@enderror
</div>
<div class="form-group">
<label for="selectCampus">Campus</label>
<select class="custom-select" name="unidade_id" id="unidade_id">
<option value="" disabled selected hidden> selecione... </option>
@foreach ($unidades as $unidade)
<option value="{{ $unidade->id }}" {{ $campus->unidade->id == $unidade->id ? 'selected' : '' }}>
{{ $unidade->name }} </option>
@endforeach
</select>
@error('unidade_id')
<span class="text-danger"> {{ $message }} </span>
@enderror
</div>
<div class="d-flex justify-content-between">
@include('components.buttons.btn-cancel', [
'route' => route('campus_index'),
])
@include('components.buttons.btn-save', [
'content' => 'Atualizar',
'btn_class' => 'btn btn-outline-success',
'i_class' => '',
])
<div class='row'>
<div class='mb-3 col-sm-6'>
<div class="form-group">
<label for="name">Nome do Campus</label>
<input type="text" id="name" name="name" class="form-control" id="name" placeholder="Campus" value="{{ $campus->name }}{{ old('name') }}">
@error('name')
<span class="text-danger"> {{ $message }} </span>
@enderror
</div>
</div>
<div class='mb-3 col-sm-6'>
<div class="form-group">
<label for="unidade_id">Unidade</label>
<select class="form-select" name="unidade_id" id="unidade_id">
<option value="" disabled selected hidden> selecione... </option>
@foreach ($unidades as $unidade)
@if($campus->unidade_id == $unidade->id)
<option selected value="{{ $unidade->id }}"> {{ $unidade->name }} </option>
@else
<option value="{{ $unidade->id }}"> {{ $unidade->name }} </option>
@endif
@endforeach
</select>
@error('unidade_id')
<span class="text-danger"> {{ $message }} </span>
@enderror
</div>
</div>
<div class='mt-1 text-end'>
@include('components.buttons.btn-cancel', [
'route' => route('campus_index'),
'content' => 'Cancelar'
])
@include('components.buttons.btn-save', [
'content' => 'Atualizar',
])
</div>
</div>
</form>
</div>
@endsection
\ No newline at end of file
<a class="btn btn-secondary" href="{{$route}}">
<i class="bi bi-x-square-fill"></i>
Cancelar
{{--
@include('components.buttons.btn-cancel', [
'route' => '',
'content' => ''
])
--}}
<a class="btn btn-secondary" href="{{ $route }}">
<i class="bi bi-x-circle"></i>
{{ $content }}
</a>
{{--
@include('components.buttons.btn-close_modal')
--}}
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">
<i class="bi bi-x-circle"></i>
Cancelar
</button>
\ No newline at end of file
<a class="btn {{$class}}" href="{{$route}}" id="{{$id}}">
{{--
@include('components.buttons.btn-create', [
'id' => '',
'route' => '',
'content' => ''
])
--}}
<a class="btn btn-success" href="{{$route}}" id="{{$id}}">
<i class="bi bi-plus-circle"></i>
{{$content}}
</a>
{{--
@include('components.buttons.btn-delete', [
'id' => $id,
'route' => route('')
])
--}}
<!-- Button trigger modal -->
<button type="button" class="{{ $btn_class }}" data-bs-toggle="modal" data-bs-target="#modal-delete-{{ $id }}">
<button type="button" class="btn btn-danger" data-bs-toggle="modal" data-bs-target="#modal-delete-{{ $id }}">
<i class="bi bi-trash"></i>
</button>
......@@ -8,7 +17,7 @@
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="$modal-label-title-{{ $id }}">Excluir Item</h5>
<h5 class="modal-title" id="modal-label-title-{{ $id }}">Excluir Item</h5>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
</div>
<div class="modal-body">
......
{{--
@include('components.buttons.btn-edit-task', [
'btn_class' => '',
'btn_id' => ''
])
--}}
<div class="btn-edit-tasks">
<button type="button" class="btn btn-primary {{ $btn_class }}" id="{{ $btn_id }}">
<i class="bi bi-pencil-square"></i>
</button>
</div>
\ No newline at end of file
<a class="{{$btn_class}}" href="{{$route}}"><i class="bi bi-pencil-square"></i></a>
\ No newline at end of file
{{--
@include('components.buttons.btn-edit', [
'route' => ''
])
--}}
<a class="btn btn-warning" href="{{$route}}">
<i class="bi bi-pencil-square"></i>
</a>
\ No newline at end of file
<button class="{{$btn_class}}" type="submit">
<i class="{{$i_class}}"></i>
{{$content}}
{{--
@include('components.buttons.btn-save', [
'id' => '',
'content' => '',
])
--}}
@php
if(!isset($id))
{
$id = '';
}
@endphp
<button class="btn btn-success" id="{{ $id }}" type="submit">
<i class=""></i>
{{ $content }}
</button>
<!-- Button trigger modal -->
<button type="button" class="btn btn-danger" data-toggle="modal" data-target="#modal-delete-{{ $modal_id }}">
<i class="fas fa-trash"></i>
<i class="bi bi-trash"></i>
</button>
<!-- Modal -->
......
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