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; ...@@ -4,6 +4,13 @@ namespace App\Queries;
use App\Models\Unidade; 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; ...@@ -4,7 +4,8 @@ namespace App\Queries;
use App\Models\UserPad; use App\Models\UserPad;
class UserPadQuery extends CustomQuery { class UserPadQuery extends CustomQuery
{
public function __construct() public function __construct()
{ {
......
...@@ -4,13 +4,14 @@ namespace App\Queries; ...@@ -4,13 +4,14 @@ namespace App\Queries;
use App\Models\User; use App\Models\User;
class UserQuery { class UserQuery extends CustomQuery
{
private $query;
public function __construct() public function __construct()
{ {
$this->query = User::where([]); $this->query = User::where([]);
self::$instance = $this;
} }
/** /**
...@@ -20,7 +21,7 @@ class UserQuery { ...@@ -20,7 +21,7 @@ class UserQuery {
public function whereId($id, $expression = '=') public function whereId($id, $expression = '=')
{ {
$this->query = $this->query->where('id', $expression, $id); $this->query = $this->query->where('id', $expression, $id);
return $this->query; return self::$instance;
} }
/** /**
...@@ -30,14 +31,7 @@ class UserQuery { ...@@ -30,14 +31,7 @@ class UserQuery {
public function whereType($type, $expression = '=') public function whereType($type, $expression = '=')
{ {
$this->query = $this->query->where('type', $expression, $type); $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 @@ ...@@ -22,37 +22,50 @@
<form action="{{ route('campus_store') }}" method="post"> <form action="{{ route('campus_store') }}" method="post">
@csrf @csrf
@method('POST') @method('POST')
<div class="form-group">
<label for="inputNameCampus">Nome do Campus</label> <div class='row'>
<input type="text" name="name" class="form-control" id="inputNameCampus"
placeholder="Insira o nome do Campus" value="{{ old('name') }}"> <div class='mb-3 col-sm-6'>
@error('name') <div class="form-group">
<span class="text-danger"> {{ $message }} </span> <label for="name">Nome do Campus</label>
@enderror <input type="text" name="name" class="form-control" id="name"
</div> placeholder="Campus" value="{{ old('name') }}">
<div class="form-group"> @error('name')
<label for="selectCampus">Campus</label> <span class="text-danger"> {{ $message }} </span>
<select class="custom-select" name="unidade_id" id="unidade_id"> @enderror
<option value="" disabled selected hidden> selecione... </option> </div>
@foreach ($unidades as $unidade) </div>
<option value="{{ $unidade->id }}" {{ old('unidade_id') == $unidade->id ? 'selected' : '' }}>
{{ $unidade->name }} </option> <div class='mb-3 col-sm-6'>
@endforeach <div class="form-group">
</select> <label for="unidade_id">Unidade</label>
@error('unidade_id') <select class="form-select" name="unidade_id" id="unidade_id">
<span class="text-danger"> {{ $message }} </span> <option value="" disabled selected hidden> selecione... </option>
@enderror @foreach ($unidades as $unidade)
</div> <option value="{{ $unidade->id }}" {{ old('unidade_id') == $unidade->id ? 'selected' : '' }}>
<div class="d-flex justify-content-between"> {{ $unidade->name }} </option>
@include('components.buttons.btn-cancel', [ @endforeach
'route' => route('campus_index'), </select>
]) @error('unidade_id')
@include('components.buttons.btn-save', [ <span class="text-danger"> {{ $message }} </span>
'content' => 'Cadastrar', @enderror
'btn_class' => 'btn btn-outline-success', </div>
'i_class' => '', </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> </div>
</form> </form>
</div> </div>
@endsection @endsection
\ No newline at end of file
...@@ -17,9 +17,9 @@ ...@@ -17,9 +17,9 @@
<h2 class="">TODOS OS CAMPUS</h2> <h2 class="">TODOS OS CAMPUS</h2>
@include('components.buttons.btn-create', [ @include('components.buttons.btn-create', [
'route' => route('campus_create'), 'route' => route('campus_create'),
'class' => '', 'class' => 'btn btn-success',
'content' => 'Novo Campus', 'content' => 'Novo Campus',
'id' => '', 'id' => 'campus_create',
]) ])
</div> </div>
...@@ -41,11 +41,12 @@ ...@@ -41,11 +41,12 @@
<td>{{ $camp->unidade }}</td> <td>{{ $camp->unidade }}</td>
<td> <td>
@include('components.buttons.btn-edit', [ @include('components.buttons.btn-edit', [
'btn_class' => 'btn btn-warning',
'route' => route('campus_edit', ['id' => $camp->id]), '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> </td>
</tr> </tr>
......
...@@ -21,37 +21,52 @@ ...@@ -21,37 +21,52 @@
<form action="{{ route('campus_update', $campus->id) }}" method="post"> <form action="{{ route('campus_update', $campus->id) }}" method="post">
@csrf @csrf
@method('POST') @method('POST')
<div class="form-group">
<label for="inputNameCampus">Nome do Campus</label> <div class='row'>
<input type="text" name="name" class="form-control" id="inputNameCampus"
placeholder="Insira o nome do Campus" value="{{ $campus->name }}{{ old('name') }}"> <div class='mb-3 col-sm-6'>
@error('name') <div class="form-group">
<span class="text-danger"> {{ $message }} </span> <label for="name">Nome do Campus</label>
@enderror <input type="text" id="name" name="name" class="form-control" id="name" placeholder="Campus" value="{{ $campus->name }}{{ old('name') }}">
</div> @error('name')
<div class="form-group"> <span class="text-danger"> {{ $message }} </span>
<label for="selectCampus">Campus</label> @enderror
<select class="custom-select" name="unidade_id" id="unidade_id"> </div>
<option value="" disabled selected hidden> selecione... </option> </div>
@foreach ($unidades as $unidade)
<option value="{{ $unidade->id }}" {{ $campus->unidade->id == $unidade->id ? 'selected' : '' }}> <div class='mb-3 col-sm-6'>
{{ $unidade->name }} </option> <div class="form-group">
@endforeach <label for="unidade_id">Unidade</label>
</select> <select class="form-select" name="unidade_id" id="unidade_id">
@error('unidade_id') <option value="" disabled selected hidden> selecione... </option>
<span class="text-danger"> {{ $message }} </span> @foreach ($unidades as $unidade)
@enderror @if($campus->unidade_id == $unidade->id)
</div> <option selected value="{{ $unidade->id }}"> {{ $unidade->name }} </option>
<div class="d-flex justify-content-between"> @else
@include('components.buttons.btn-cancel', [ <option value="{{ $unidade->id }}"> {{ $unidade->name }} </option>
'route' => route('campus_index'), @endif
])
@include('components.buttons.btn-save', [ @endforeach
'content' => 'Atualizar', </select>
'btn_class' => 'btn btn-outline-success', @error('unidade_id')
'i_class' => '', <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> </div>
</form> </form>
</div> </div>
@endsection @endsection
\ No newline at end of file
<a class="btn btn-secondary" href="{{$route}}"> {{--
<i class="bi bi-x-square-fill"></i> @include('components.buttons.btn-cancel', [
Cancelar 'route' => '',
'content' => ''
])
--}}
<a class="btn btn-secondary" href="{{ $route }}">
<i class="bi bi-x-circle"></i>
{{ $content }}
</a> </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> <i class="bi bi-plus-circle"></i>
{{$content}} {{$content}}
</a> </a>
{{--
@include('components.buttons.btn-delete', [
'id' => $id,
'route' => route('')
])
--}}
<!-- Button trigger modal --> <!-- 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> <i class="bi bi-trash"></i>
</button> </button>
...@@ -8,7 +17,7 @@ ...@@ -8,7 +17,7 @@
<div class="modal-dialog"> <div class="modal-dialog">
<div class="modal-content"> <div class="modal-content">
<div class="modal-header"> <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> <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
</div> </div>
<div class="modal-body"> <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> @include('components.buttons.btn-save', [
{{$content}} 'id' => '',
'content' => '',
])
--}}
@php
if(!isset($id))
{
$id = '';
}
@endphp
<button class="btn btn-success" id="{{ $id }}" type="submit">
<i class=""></i>
{{ $content }}
</button> </button>
<!-- Button trigger modal --> <!-- Button trigger modal -->
<button type="button" class="btn btn-danger" data-toggle="modal" data-target="#modal-delete-{{ $modal_id }}"> <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> </button>
<!-- Modal --> <!-- 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