Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Walter Felipe
pad-upe
Commits
28cd190a
Commit
28cd190a
authored
Dec 08, 2022
by
alissonalbuquerque
Browse files
add correções de estilização
parent
fa51f632
Changes
36
Hide whitespace changes
Inline
Side-by-side
app/Http/Controllers/CampusController.php
View file @
28cd190a
...
@@ -4,6 +4,7 @@ namespace App\Http\Controllers;
...
@@ -4,6 +4,7 @@ namespace App\Http\Controllers;
use
App\Models\Campus
;
use
App\Models\Campus
;
use
App\Models\Unidade
;
use
App\Models\Unidade
;
use
App\Models\Util\Menu
;
use
App\Queries\CampusQuery
;
use
App\Queries\CampusQuery
;
use
Illuminate\Http\Request
;
use
Illuminate\Http\Request
;
use
App\Models\Util\MenuItemsAdmin
;
use
App\Models\Util\MenuItemsAdmin
;
...
@@ -22,7 +23,7 @@ class CampusController extends Controller
...
@@ -22,7 +23,7 @@ class CampusController extends Controller
$campus
=
Campus
::
all
();
$campus
=
Campus
::
all
();
return
view
(
'campus.index'
,
[
return
view
(
'campus.index'
,
[
'
index_
menu'
=>
Menu
ItemsAdmin
::
CAMPUS
,
'menu'
=>
Menu
::
CAMPUS
,
'campus'
=>
$campus
'campus'
=>
$campus
]);
]);
}
}
...
@@ -36,7 +37,7 @@ class CampusController extends Controller
...
@@ -36,7 +37,7 @@ class CampusController extends Controller
{
{
return
view
(
'campus.create'
,
[
return
view
(
'campus.create'
,
[
'unidades'
=>
Unidade
::
all
(),
'unidades'
=>
Unidade
::
all
(),
'
index_
menu'
=>
Menu
ItemsAdmin
::
CAMPUS
,
'menu'
=>
Menu
::
CAMPUS
,
]);
]);
}
}
...
@@ -82,7 +83,7 @@ class CampusController extends Controller
...
@@ -82,7 +83,7 @@ class CampusController extends Controller
$campus
=
Campus
::
findOrFail
(
$id
);
$campus
=
Campus
::
findOrFail
(
$id
);
return
view
(
'campus.update'
,
[
return
view
(
'campus.update'
,
[
'unidades'
=>
Unidade
::
all
(),
'unidades'
=>
Unidade
::
all
(),
'
index_
menu'
=>
Menu
ItemsAdmin
::
CAMPUS
,
'menu'
=>
Menu
::
CAMPUS
,
'campus'
=>
$campus
,
'campus'
=>
$campus
,
]);
]);
}
}
...
...
app/Http/Controllers/CursoController.php
View file @
28cd190a
...
@@ -5,6 +5,7 @@ namespace App\Http\Controllers;
...
@@ -5,6 +5,7 @@ namespace App\Http\Controllers;
use
App\Models\Campus
;
use
App\Models\Campus
;
use
App\Models\Curso
;
use
App\Models\Curso
;
use
App\Models\Unidade
;
use
App\Models\Unidade
;
use
App\Models\Util\Menu
;
use
App\Models\Util\MenuItemsAdmin
;
use
App\Models\Util\MenuItemsAdmin
;
use
Illuminate\Http\Request
;
use
Illuminate\Http\Request
;
...
@@ -26,7 +27,7 @@ class CursoController extends Controller
...
@@ -26,7 +27,7 @@ class CursoController extends Controller
return
view
(
'curso.index'
,
[
return
view
(
'curso.index'
,
[
'campusWithCursos'
=>
$campusWithCursos
,
'campusWithCursos'
=>
$campusWithCursos
,
'
index_
menu'
=>
Menu
ItemsAdmin
::
CURSOS
'menu'
=>
Menu
::
CURSOS
]);
]);
}
}
...
@@ -41,7 +42,7 @@ class CursoController extends Controller
...
@@ -41,7 +42,7 @@ class CursoController extends Controller
return
view
(
'curso.create'
,
[
return
view
(
'curso.create'
,
[
'allCampus'
=>
$allCampus
,
'allCampus'
=>
$allCampus
,
'
index_
menu'
=>
Menu
ItemsAdmin
::
CURSOS
'menu'
=>
Menu
::
CURSOS
]);
]);
}
}
...
@@ -87,7 +88,7 @@ class CursoController extends Controller
...
@@ -87,7 +88,7 @@ class CursoController extends Controller
$curso
=
Curso
::
findOrFail
(
$id
);
$curso
=
Curso
::
findOrFail
(
$id
);
return
view
(
'curso.update'
,
[
return
view
(
'curso.update'
,
[
'allCampus'
=>
Campus
::
all
(),
'allCampus'
=>
Campus
::
all
(),
'
index_
menu'
=>
Menu
ItemsAdmin
::
CURSOS
,
'menu'
=>
Menu
::
CURSOS
,
'curso'
=>
$curso
,
'curso'
=>
$curso
,
]);
]);
}
}
...
...
app/Http/Controllers/DashboardController.php
View file @
28cd190a
...
@@ -5,6 +5,7 @@ namespace App\Http\Controllers;
...
@@ -5,6 +5,7 @@ namespace App\Http\Controllers;
use
App\Models\PAD
;
use
App\Models\PAD
;
use
App\Models\Tabelas\Constants
;
use
App\Models\Tabelas\Constants
;
use
App\Models\UserPad
;
use
App\Models\UserPad
;
use
App\Models\Util\Menu
;
use
App\Models\Util\MenuItemsAdmin
;
use
App\Models\Util\MenuItemsAdmin
;
use
App\Models\Util\MenuItemsTeacher
;
use
App\Models\Util\MenuItemsTeacher
;
use
App\Models\Util\Status
;
use
App\Models\Util\Status
;
...
@@ -21,7 +22,7 @@ class DashboardController extends Controller
...
@@ -21,7 +22,7 @@ class DashboardController extends Controller
if
(
$user
->
isTypeAdmin
())
if
(
$user
->
isTypeAdmin
())
{
{
return
view
(
'dashboard'
,[
'menu
_index
'
=>
Menu
ItemsAdmin
::
HOME
]);
return
view
(
'dashboard'
,[
'menu'
=>
Menu
::
HOME
]);
}
}
if
(
$user
->
isTypeTeacher
())
if
(
$user
->
isTypeTeacher
())
...
@@ -32,17 +33,17 @@ class DashboardController extends Controller
...
@@ -32,17 +33,17 @@ class DashboardController extends Controller
->
wherePadStatus
(
Status
::
ATIVO
)
->
wherePadStatus
(
Status
::
ATIVO
)
->
get
();
->
get
();
return
view
(
'dashboard'
,
[
'userPads'
=>
$userPads
,
'menu
_index
'
=>
Menu
ItemsTeacher
::
HOME
]);
return
view
(
'dashboard'
,
[
'userPads'
=>
$userPads
,
'menu'
=>
Menu
::
HOME
]);
}
}
if
(
$user
->
isTypeDirector
())
if
(
$user
->
isTypeDirector
())
{
{
return
view
(
'dashboard'
,
[
'PADs'
=>
PAD
::
all
(),
'menu
_index'
=>
0
]);
return
view
(
'dashboard'
,
[
'PADs'
=>
PAD
::
all
(),
'menu
'
=>
Menu
::
HOME
]);
}
}
if
(
$user
->
isTypeCoordinator
())
if
(
$user
->
isTypeCoordinator
())
{
{
return
view
(
'dashboard'
,
[
'PADs'
=>
PAD
::
all
(),
'menu
_index'
=>
0
]);
return
view
(
'dashboard'
,
[
'PADs'
=>
PAD
::
all
(),
'menu
'
=>
Menu
::
HOME
]);
}
}
if
(
$user
->
isTypeEvaluator
())
if
(
$user
->
isTypeEvaluator
())
...
@@ -53,7 +54,7 @@ class DashboardController extends Controller
...
@@ -53,7 +54,7 @@ class DashboardController extends Controller
->
wherePadStatus
(
Status
::
ATIVO
)
->
wherePadStatus
(
Status
::
ATIVO
)
->
get
();
->
get
();
return
view
(
'dashboard'
,
[
'userPads'
=>
$userPads
,
'menu
_index
'
=>
Menu
ItemsTeacher
::
HOME
]);
return
view
(
'dashboard'
,
[
'userPads'
=>
$userPads
,
'menu'
=>
Menu
::
HOME
]);
}
}
//return redirect()->route('login');
//return redirect()->route('login');
...
...
app/Http/Controllers/PadController.php
View file @
28cd190a
...
@@ -9,6 +9,7 @@ use App\Models\Tabelas\Constants;
...
@@ -9,6 +9,7 @@ use App\Models\Tabelas\Constants;
use
App\Models\User
;
use
App\Models\User
;
use
App\Models\UserPad
;
use
App\Models\UserPad
;
use
App\Models\UserType
;
use
App\Models\UserType
;
use
App\Models\Util\Menu
;
use
App\Models\Util\MenuItemsAdmin
;
use
App\Models\Util\MenuItemsAdmin
;
use
App\Models\Util\MenuItemsTeacher
;
use
App\Models\Util\MenuItemsTeacher
;
use
App\Models\Util\Status
;
use
App\Models\Util\Status
;
...
@@ -27,19 +28,19 @@ class PadController extends Controller
...
@@ -27,19 +28,19 @@ class PadController extends Controller
* @return \Illuminate\View\View
* @return \Illuminate\View\View
*/
*/
public
function
index
()
public
function
index
()
{
{
if
(
Auth
::
user
()
->
isTypeAdmin
())
{
if
(
Auth
::
user
()
->
isTypeAdmin
())
{
$pads
=
Pad
::
all
();
$pads
=
Pad
::
all
();
$
index_
menu
=
Menu
ItemsAdmin
::
PADS
;
$menu
=
Menu
::
PADS
;
return
view
(
'pad.admin.index'
,
[
'
index_
menu'
=>
$
index_
menu
,
'pads'
=>
$pads
]);
return
view
(
'pad.admin.index'
,
[
'menu'
=>
$menu
,
'pads'
=>
$pads
]);
}
}
if
(
Auth
::
user
()
->
isTypeTeacher
())
{
if
(
Auth
::
user
()
->
isTypeTeacher
())
{
$
index_
menu
=
Menu
ItemsTeacher
::
PAD
;
$menu
=
Menu
::
PAD
S
;
$userPads
=
UserPad
::
initQuery
()
->
whereUser
(
Auth
::
user
()
->
id
)
->
get
();
$userPads
=
UserPad
::
initQuery
()
->
whereUser
(
Auth
::
user
()
->
id
)
->
get
();
return
view
(
'pad.teacher.index'
,
[
'
index_
menu'
=>
$
index_
menu
,
'userPads'
=>
$userPads
]);
return
view
(
'pad.teacher.index'
,
[
'menu'
=>
$menu
,
'userPads'
=>
$userPads
]);
}
}
}
}
...
@@ -48,8 +49,8 @@ class PadController extends Controller
...
@@ -48,8 +49,8 @@ class PadController extends Controller
* @return \Illuminate\Http\Response
* @return \Illuminate\Http\Response
*/
*/
public
function
view
(
$id
)
{
public
function
view
(
$id
)
{
$
index_
menu
=
1
;
$menu
=
Menu
::
PADS
;
return
view
(
'pad.teacher.view'
,
[
'user_pad_id'
=>
$id
,
'
index_
menu'
=>
$
index_
menu
]);
return
view
(
'pad.teacher.view'
,
[
'user_pad_id'
=>
$id
,
'menu'
=>
$menu
]);
}
}
/**
/**
...
...
app/Http/Controllers/ProfessorController.php
View file @
28cd190a
...
@@ -4,6 +4,7 @@ namespace App\Http\Controllers;
...
@@ -4,6 +4,7 @@ namespace App\Http\Controllers;
use
App\Models\User
;
use
App\Models\User
;
use
App\Models\Curso
;
use
App\Models\Curso
;
use
App\Models\Util\Menu
;
use
App\Models\Util\MenuItemsAdmin
;
use
App\Models\Util\MenuItemsAdmin
;
use
Illuminate\Http\Request
;
use
Illuminate\Http\Request
;
use
Illuminate\Support\Facades\Hash
;
use
Illuminate\Support\Facades\Hash
;
...
@@ -15,7 +16,7 @@ class ProfessorController extends Controller
...
@@ -15,7 +16,7 @@ class ProfessorController extends Controller
{
{
$professores
=
User
::
where
(
'type'
,
'='
,
User
::
TYPE_TEACHER
)
->
get
();
$professores
=
User
::
where
(
'type'
,
'='
,
User
::
TYPE_TEACHER
)
->
get
();
return
view
(
'professor.index'
,
[
return
view
(
'professor.index'
,
[
'
index_
menu'
=>
Menu
ItemsAdmin
::
PROFESSORE
S
,
'menu'
=>
Menu
::
PAD
S
,
'professores'
=>
$professores
'professores'
=>
$professores
]);
]);
}
}
...
...
app/Http/Controllers/UnidadeController.php
View file @
28cd190a
...
@@ -3,6 +3,7 @@
...
@@ -3,6 +3,7 @@
namespace
App\Http\Controllers
;
namespace
App\Http\Controllers
;
use
App\Models\Unidade
;
use
App\Models\Unidade
;
use
App\Models\Util\Menu
;
use
App\Models\Util\MenuItemsAdmin
;
use
App\Models\Util\MenuItemsAdmin
;
use
App\Queries\UnidadeQuery
;
use
App\Queries\UnidadeQuery
;
use
Illuminate\Http\Request
;
use
Illuminate\Http\Request
;
...
@@ -18,7 +19,7 @@ class UnidadeController extends Controller
...
@@ -18,7 +19,7 @@ class UnidadeController extends Controller
{
{
return
view
(
'unidade.index'
,
[
return
view
(
'unidade.index'
,
[
'unidades'
=>
Unidade
::
all
(),
'unidades'
=>
Unidade
::
all
(),
'
index_
menu'
=>
Menu
ItemsAdmin
::
UNIDADES
'menu'
=>
Menu
::
UNIDADES
,
]);
]);
}
}
...
@@ -31,7 +32,7 @@ class UnidadeController extends Controller
...
@@ -31,7 +32,7 @@ class UnidadeController extends Controller
{
{
return
view
(
'unidade.create'
,
[
return
view
(
'unidade.create'
,
[
'unidades'
=>
Unidade
::
all
(),
'unidades'
=>
Unidade
::
all
(),
'
index_
menu'
=>
Menu
ItemsAdmin
::
UNIDADES
'menu'
=>
Menu
::
UNIDADES
,
]);
]);
}
}
...
@@ -77,7 +78,7 @@ class UnidadeController extends Controller
...
@@ -77,7 +78,7 @@ class UnidadeController extends Controller
$model
=
Unidade
::
find
(
$id
);
$model
=
Unidade
::
find
(
$id
);
return
view
(
'unidade.update'
,
[
return
view
(
'unidade.update'
,
[
'unidade'
=>
$model
,
'unidade'
=>
$model
,
'
index_
menu'
=>
Menu
ItemsAdmin
::
UNIDADES
'menu'
=>
Menu
::
UNIDADES
,
]);
]);
}
}
...
...
app/Http/Controllers/UserController.php
View file @
28cd190a
...
@@ -3,16 +3,16 @@
...
@@ -3,16 +3,16 @@
namespace
App\Http\Controllers
;
namespace
App\Http\Controllers
;
use
App\Models\User
;
use
App\Models\User
;
use
App\Models\Util\Menu
;
use
App\Models\Util\Status
;
use
Illuminate\Http\Request
;
use
Illuminate\Http\Request
;
use
Illuminate\Support\Facades\Auth
;
use
Illuminate\Support\Facades\Auth
;
use
NunoMaduro\Collision\Adapters\Phpunit\State
;
class
UserController
extends
Controller
class
UserController
extends
Controller
{
{
const
MENU_UPDATE_PERFIL
=
0
;
public
function
editPerfil
()
{
public
function
editPerfil
()
{
return
view
(
'user.update_perfil'
,
[
'
index_
menu'
=>
self
::
MENU_UPDATE_PERFIL
]);
return
view
(
'user.update_perfil'
,
[
'menu'
=>
Menu
::
USER
]);
}
}
public
function
updatePerfil
(
Request
$request
)
{
public
function
updatePerfil
(
Request
$request
)
{
...
@@ -46,4 +46,42 @@ class UserController extends Controller
...
@@ -46,4 +46,42 @@ class UserController extends Controller
// return redirect()->route('edit_perfil')->with('success', 'Salvo com sucesso!');
// return redirect()->route('edit_perfil')->with('success', 'Salvo com sucesso!');
}
}
public
function
actionIndex
(
Request
$request
)
{
$users
=
User
::
initQuery
();
$users
=
$users
->
get
();
return
view
(
'users.index'
,
[
'users'
=>
$users
,
'menu'
=>
Menu
::
USERS
,
]);
}
public
function
actionCreate
(
Request
$request
)
{
return
view
(
'users.create'
,
[
'menu'
=>
Menu
::
USERS
,
]);
}
public
function
actionStore
(
Request
$request
)
{
dd
(
$request
->
all
());
}
public
function
actionEdit
(
$id
,
Request
$request
)
{
}
public
function
actionUpdate
(
$id
,
Request
$request
)
{
}
public
function
actionDelete
(
$id
)
{
}
}
}
app/Models/User.php
View file @
28cd190a
...
@@ -22,7 +22,7 @@ class User extends Authenticatable
...
@@ -22,7 +22,7 @@ class User extends Authenticatable
*
*
* @var array<int, string>
* @var array<int, string>
*/
*/
protected
$fillable
=
[
'name'
,
'email'
,
'password'
,
'document'
,
'status'
,
'curso_id'
,
'campus_id'
];
protected
$fillable
=
[
'name'
,
'email'
,
'password'
,
'status'
,
'curso_id'
,
'campus_id'
];
/**
/**
* The attributes that should be hidden for serialization.
* The attributes that should be hidden for serialization.
...
...
app/Models/UserType.php
View file @
28cd190a
...
@@ -2,9 +2,9 @@
...
@@ -2,9 +2,9 @@
namespace
App\Models
;
namespace
App\Models
;
use
App\Models\Pad
;
use
App\Models\Util\Status
;
use
App\Models\Util\Status
;
use
App\Queries\UserTypeQuery
;
use
App\Queries\UserTypeQuery
;
use
Illuminate\Database\Eloquent\Factories\HasFactory
;
use
Illuminate\Database\Eloquent\Model
;
use
Illuminate\Database\Eloquent\Model
;
class
UserType
extends
Model
class
UserType
extends
Model
...
@@ -17,13 +17,18 @@ class UserType extends Model
...
@@ -17,13 +17,18 @@ class UserType extends Model
protected
$table
=
'user_type'
;
protected
$table
=
'user_type'
;
protected
$fillable
=
[
'user_id'
,
'type'
,
'status'
,
'selected'
];
protected
$fillable
=
[
'user_id'
,
'pad_id'
,
'type'
,
'status'
,
'selected'
];
public
function
user
()
public
function
user
()
{
{
return
$this
->
belongsTo
(
User
::
class
);
return
$this
->
belongsTo
(
User
::
class
);
}
}
public
function
pad
()
{
return
$this
->
belongsTo
(
Pad
::
class
);
}
public
function
typeAsString
()
public
function
typeAsString
()
{
{
return
self
::
listType
(
$this
->
type
);
return
self
::
listType
(
$this
->
type
);
...
...
app/Models/Util/Form.php
0 → 100644
View file @
28cd190a
<?php
namespace
App\Models\Util
;
class
Form
{
const
TYPE_CREATE
=
'create'
;
const
TYPE_UPDATE
=
'update'
;
}
\ No newline at end of file
app/Models/Util/Menu.php
0 → 100644
View file @
28cd190a
<?php
namespace
App\Models\Util
;
class
Menu
{
const
USER
=
1
;
const
HOME
=
2
;
const
USERS
=
3
;
const
CAMPUS
=
4
;
const
CURSOS
=
5
;
const
UNIDADES
=
6
;
const
PADS
=
7
;
//Deletar depois
const
DIRETORES
=
4
;
const
COORDENADORES
=
5
;
const
PROFESSORES
=
7
;
}
\ No newline at end of file
app/Queries/UserQuery.php
View file @
28cd190a
...
@@ -24,6 +24,16 @@ class UserQuery extends CustomQuery
...
@@ -24,6 +24,16 @@ class UserQuery extends CustomQuery
return
self
::
$instance
;
return
self
::
$instance
;
}
}
/**
* @param integer $name
* @return UserQuery|Builder
*/
public
function
whereName
(
$name
,
$operator
=
'LIKE'
)
{
$this
->
query
=
$this
->
query
->
where
(
'name'
,
$operator
,
$name
);
return
self
::
$instance
;
}
/**
/**
* @param integer $email
* @param integer $email
* @return UserQuery|Builder
* @return UserQuery|Builder
...
@@ -34,6 +44,36 @@ class UserQuery extends CustomQuery
...
@@ -34,6 +44,36 @@ class UserQuery extends CustomQuery
return
self
::
$instance
;
return
self
::
$instance
;
}
}
/**
* @param integer $status
* @return UserQuery|Builder
*/
public
function
whereStatus
(
$status
,
$operator
=
'='
)
{
$this
->
query
=
$this
->
query
->
where
(
'status'
,
$operator
,
$status
);
return
self
::
$instance
;
}
/**
* @param integer $curso_id
* @return UserQuery|Builder
*/
public
function
whereCurso
(
$curso_id
,
$operator
=
'='
)
{
$this
->
query
=
$this
->
query
->
where
(
'curso_id'
,
$operator
,
$curso_id
);
return
self
::
$instance
;
}
/**
* @param integer $campus_id
* @return UserQuery|Builder
*/
public
function
whereCampus
(
$campus_id
,
$operator
=
'='
)
{
$this
->
query
=
$this
->
query
->
where
(
'campus_id'
,
$operator
,
$campus_id
);
return
self
::
$instance
;
}
/**
/**
* @param integer $type
* @param integer $type
* @return UserQuery|Builder
* @return UserQuery|Builder
...
...
database/migrations/2014_10_12_000000_create_users_table.php
View file @
28cd190a
...
@@ -19,7 +19,6 @@ class CreateUsersTable extends Migration
...
@@ -19,7 +19,6 @@ class CreateUsersTable extends Migration
$table
->
string
(
'email'
)
->
unique
();
$table
->
string
(
'email'
)
->
unique
();
$table
->
timestamp
(
'email_verified_at'
)
->
nullable
();
$table
->
timestamp
(
'email_verified_at'
)
->
nullable
();
$table
->
string
(
'password'
);
$table
->
string
(
'password'
);
$table
->
string
(
'document'
);
$table
->
tinyInteger
(
'status'
);
$table
->
tinyInteger
(
'status'
);
$table
->
foreignId
(
'curso_id'
)
->
nullable
();
$table
->
foreignId
(
'curso_id'
)
->
nullable
();
$table
->
foreignId
(
'campus_id'
)
->
nullable
();
$table
->
foreignId
(
'campus_id'
)
->
nullable
();
...
...
database/migrations/2022_07_22_024613_create_user_type_table.php
View file @
28cd190a
...
@@ -16,6 +16,7 @@ class CreateUserTypeTable extends Migration
...
@@ -16,6 +16,7 @@ class CreateUserTypeTable extends Migration
Schema
::
create
(
'user_type'
,
function
(
Blueprint
$table
)
{
Schema
::
create
(
'user_type'
,
function
(
Blueprint
$table
)
{
$table
->
id
();
$table
->
id
();
$table
->
foreignId
(
'user_id'
);
$table
->
foreignId
(
'user_id'
);
$table
->
foreignId
(
'pad_id'
);
$table
->
tinyInteger
(
'type'
);
$table
->
tinyInteger
(
'type'
);
$table
->
tinyInteger
(
'status'
);
$table
->
tinyInteger
(
'status'
);
$table
->
boolean
(
'selected'
);
$table
->
boolean
(
'selected'
);
...
...
database/seeders/PadSeeder.php
View file @
28cd190a
...
@@ -15,21 +15,6 @@ class PadSeeder extends Seeder
...
@@ -15,21 +15,6 @@ class PadSeeder extends Seeder
* @return void
* @return void
*/
*/
public
function
run
()
public
function
run
()
{
{
PAD
::
create
([
'id'
=>
1
,
'nome'
=>
"2022.1"
,
'data_inicio'
=>
"2022-02-01"
,
'data_fim'
=>
"2022-06-01"
,
'status'
=>
Status
::
ATIVO
,
]);
PAD
::
create
([
'id'
=>
2
,
'nome'
=>
"2022.2"
,
'data_inicio'
=>
"2022-07-01"
,
'data_fim'
=>
"2022-12-01"
,
'status'
=>
Status
::
ATIVO
,
]);
}
}
}
}
database/seeders/UserSeeder.php
View file @
28cd190a
...
@@ -28,7 +28,6 @@ class UserSeeder extends Seeder
...
@@ -28,7 +28,6 @@ class UserSeeder extends Seeder
'email'
=>
"professor
{
$id
}
@upe.br"
,
'email'
=>
"professor
{
$id
}
@upe.br"
,
'email_verified_at'
=>
null
,
'email_verified_at'
=>
null
,
'password'
=>
Hash
::
make
(
'@professor'
),
'password'
=>
Hash
::
make
(
'@professor'
),
'document'
=>
"00000000
{
$id
}
"
,
'status'
=>
Status
::
ATIVO
,
'status'
=>
Status
::
ATIVO
,
'campus_id'
=>
3
,
'campus_id'
=>
3
,
'curso_id'
=>
1
,
'curso_id'
=>
1
,
...
@@ -41,7 +40,6 @@ class UserSeeder extends Seeder
...
@@ -41,7 +40,6 @@ class UserSeeder extends Seeder
'email'
=>
"admin@upe.br"
,
'email'
=>
"admin@upe.br"
,
'email_verified_at'
=>
null
,
'email_verified_at'
=>
null
,
'password'
=>
Hash
::
make
(
'@admin'
),
'password'
=>
Hash
::
make
(
'@admin'
),
'document'
=>
"100000000"
,
'status'
=>
Status
::
ATIVO
,
'status'
=>
Status
::
ATIVO
,
'campus_id'
=>
NULL
,
'campus_id'
=>
NULL
,
'curso_id'
=>
NULL
,
'curso_id'
=>
NULL
,
...
@@ -53,7 +51,6 @@ class UserSeeder extends Seeder
...
@@ -53,7 +51,6 @@ class UserSeeder extends Seeder
'email'
=>
"director@upe.br"
,
'email'
=>
"director@upe.br"
,
'email_verified_at'
=>
null
,
'email_verified_at'
=>
null
,
'password'
=>
Hash
::
make
(
'@director'
),
'password'
=>
Hash
::
make
(
'@director'
),
'document'
=>
"100000000"
,
'status'
=>
Status
::
ATIVO
,
'status'
=>
Status
::
ATIVO
,
'campus_id'
=>
1
,
'campus_id'
=>
1
,
'curso_id'
=>
1
,
'curso_id'
=>
1
,
...
@@ -65,7 +62,6 @@ class UserSeeder extends Seeder
...
@@ -65,7 +62,6 @@ class UserSeeder extends Seeder
'email'
=>
"coordinator@upe.br"
,
'email'
=>
"coordinator@upe.br"
,
'email_verified_at'
=>
null
,
'email_verified_at'
=>
null
,
'password'
=>
Hash
::
make
(
'@coordinator'
),
'password'
=>
Hash
::
make
(
'@coordinator'
),
'document'
=>
"100000000"
,
'status'
=>
Status
::
ATIVO
,
'status'
=>
Status
::
ATIVO
,
'campus_id'
=>
1
,
'campus_id'
=>
1
,
'curso_id'
=>
1
,
'curso_id'
=>
1
,
...
...
resources/views/campus/index.blade.php
View file @
28cd190a
...
@@ -8,50 +8,63 @@
...
@@ -8,50 +8,63 @@
@
endsection
@
endsection
@
section
(
'nav'
)
@
section
(
'nav'
)
@
include
(
'layouts.navigation'
,
[
@
include
(
'layouts.navigation'
,
[
'
index_
menu'
=>
$
index_
menu
,
'menu'
=>
$menu
,
])
])
@
endsection
@
endsection
@
section
(
'body'
)
@
section
(
'body'
)
@
include
(
'components.alerts'
)
<
div
class
=
"d-flex justify-content-between align-items-center border-bottom"
>
<
h2
class
=
""
>
TODOS
OS
CAMPUS
</
h2
>
@
include
(
'components.buttons.btn-create'
,
[
'route'
=>
route
(
'campus_create'
),
'class'
=>
'btn btn-success'
,
'content'
=>
'Novo Campus'
,
'id'
=>
'campus_create'
,
])
</
div
>
<!--
Tabela
-->
<
div
>
<
div
class
=
"table-responsive mt-5"
>
<
table
class
=
"table table-hover table-striped"
>
<
h3
class
=
"h3"
>
Campus
</
h3
>
<
thead
class
=
"thead-dark"
>
<
tr
>
<
div
>
<
th
scope
=
"col"
>
Nome
</
th
>
<
th
scope
=
"col"
>
Unidade
</
th
>
@
include
(
'components.alerts'
)
<
th
scope
=
"col"
>
Ações
</
th
>
</
tr
>
<
div
class
=
"d-flex justify-content-end mb-2"
>
</
thead
>
@
include
(
'components.buttons.btn-create'
,
[
'id'
=>
'campus_create'
,
<
tbody
>
'route'
=>
route
(
'campus_create'
),
@
foreach
(
$campus
as
$camp
)
'content'
=>
'Cadastrar'
,
])
</
div
>
<
div
class
=
"border rounded px-4"
>
<
table
class
=
"table table-hover mt-4"
>
<
thead
class
=
"thead-dark"
>
<
tr
>
<
tr
>
<
td
>
{{
$camp
->
name
}}
</
td
>
<
th
scope
=
"col"
>
Nome
</
th
>
<
td
>
{{
$camp
->
unidade
}}
</
td
>
<
th
scope
=
"col"
>
Unidade
</
th
>
<
td
>
<
th
scope
=
"col"
>
Ações
</
th
>
@
include
(
'components.buttons.btn-edit'
,
[
'route'
=>
route
(
'campus_edit'
,
[
'id'
=>
$camp
->
id
]),
])
@
include
(
'components.buttons.btn-delete'
,
[
'id'
=>
$camp
->
id
,
'route'
=>
route
(
'campus_delete'
,
[
'id'
=>
$camp
->
id
])
])
</
td
>
</
tr
>
</
tr
>
@
endforeach
</
thead
>
</
tbody
>
</
table
>
<
tbody
>
@
foreach
(
$campus
as
$camp
)
<
tr
>
<
td
>
{{
$camp
->
name
}}
</
td
>
<
td
>
{{
$camp
->
unidade
}}
</
td
>
<
td
>
<
div
class
=
"btn-group"
role
=
"group"
>
<
div
class
=
"me-1"
>
@
include
(
'components.buttons.btn-edit'
,
[
'route'
=>
route
(
'campus_edit'
,
[
'id'
=>
$camp
->
id
]),
])
</
div
>
<
div
class
=
"me-1"
>
@
include
(
'components.buttons.btn-delete'
,
[
'id'
=>
$camp
->
id
,
'route'
=>
route
(
'campus_delete'
,
[
'id'
=>
$camp
->
id
])
])
</
div
>
</
div
>
</
td
>
</
tr
>
@
endforeach
</
tbody
>
</
table
>
</
div
>
</
div
>
</
div
>
</
div
>
@
endsection
@
endsection
resources/views/components/buttons/btn-delete.blade.php
View file @
28cd190a
...
@@ -8,7 +8,7 @@
...
@@ -8,7 +8,7 @@
--
}}
--
}}
<!--
Button
trigger
modal
-->
<!--
Button
trigger
modal
-->
<
button
type
=
"button"
class
=
"btn btn-danger"
data
-
bs
-
toggle
=
"modal"
data
-
bs
-
target
=
"#modal-delete-{{
$id
}}"
>
<
button
type
=
"button"
class
=
"btn btn-danger
btn-sm
"
data
-
bs
-
toggle
=
"modal"
data
-
bs
-
target
=
"#modal-delete-{{
$id
}}"
>
<
i
class
=
"bi bi-trash"
></
i
>
<
i
class
=
"bi bi-trash"
></
i
>
</
button
>
</
button
>
...
...
resources/views/components/buttons/btn-edit.blade.php
View file @
28cd190a
...
@@ -3,6 +3,6 @@
...
@@ -3,6 +3,6 @@
'route'
=>
''
'route'
=>
''
])
])
--
}}
--
}}
<
a
class
=
"btn btn-
warning
"
href
=
"
{
{$route}
}
"
>
<
a
class
=
"btn btn-
primary btn-sm
"
href
=
"
{
{$route}
}
"
>
<
i
class
=
"bi bi-pencil-square"
></
i
>
<
i
class
=
"bi bi-pencil-square"
></
i
>
</
a
>
</
a
>
\ No newline at end of file
resources/views/curso/index.blade.php
View file @
28cd190a
@
extends
(
'layouts.main'
)
@
extends
(
'layouts.main'
)
@
section
(
'title'
,
'Cursos'
)
@
section
(
'title'
,
'Cursos'
)
@
section
(
'header'
)
@
section
(
'header'
)
@
include
(
'layouts.header'
,
[
@
include
(
'layouts.header'
,
[
'user'
=>
Auth
::
user
(),
'user'
=>
Auth
::
user
(),
])
])
@
endsection
@
endsection
@
section
(
'nav'
)
@
section
(
'nav'
)
@
include
(
'layouts.navigation'
,
[
@
include
(
'layouts.navigation'
,
[
'
index_
menu'
=>
$
index_
menu
,
'menu'
=>
$menu
,
])
])
@
endsection
@
endsection
@
section
(
'body'
)
@
section
(
'body'
)
@
include
(
'components.alerts'
)
<
div
class
=
"d-flex justify-content-between align-items-center border-bottom"
>
<
div
>
<
h2
class
=
""
>
TODOS
OS
CURSO
</
h2
>
<
h3
class
=
"h3"
>
Cursos
</
h3
>
@
include
(
'components.buttons.btn-create'
,
[
'route'
=>
route
(
'curso_create'
),
<
div
>
'class'
=>
''
,
@
include
(
'components.alerts'
)
'content'
=>
'Novo Curso'
,
'id'
=>
''
,
<
div
class
=
"d-flex justify-content-end mb-2"
>
])
@
include
(
'components.buttons.btn-create'
,
[
</
div
>
'route'
=>
route
(
'curso_create'
),
<!--
Tabela
-->
'content'
=>
'Cadastrar'
,
<
div
class
=
"table-responsive mt-5"
>
'id'
=>
''
,
<
table
class
=
"table table-hover table-striped"
>
'class'
=>
''
,
<
thead
class
=
"thead-dark"
>
])
<
tr
>
</
div
>
<
th
scope
=
"col"
>
Nome
</
th
>
<
th
scope
=
"col"
>
Campus
</
th
>
<
div
class
=
"border rounded px-4"
>
<
th
scope
=
"col"
>
Ações
</
th
>
<
table
class
=
"table table-hover mt-4"
>
</
tr
>
<
thead
class
=
"thead-dark"
>
</
thead
>
<
tr
>
<
tbody
>
<
th
scope
=
"col"
>
Nome
</
th
>
@
foreach
(
$campusWithCursos
as
$campusWithCurso
)
<
th
scope
=
"col"
>
Campus
</
th
>
@
foreach
(
$campusWithCurso
->
cursos
as
$curso
)
<
th
scope
=
"col"
>
Ações
</
th
>
<
tr
>
</
tr
>
<
td
>
{{
$curso
->
name
}}
</
td
>
</
thead
>
<
td
>
{{
$curso
->
campus
}}
</
td
>
<
tbody
>
<
td
>
@
foreach
(
$campusWithCursos
as
$campusWithCurso
)
@
include
(
'components.buttons.btn-edit'
,
[
@
foreach
(
$campusWithCurso
->
cursos
as
$curso
)
'route'
=>
route
(
'curso_edit'
,
[
'id'
=>
$curso
->
id
]),
<
tr
>
])
<
td
>
{{
$curso
->
name
}}
</
td
>
<
td
>
{{
$curso
->
campus
}}
</
td
>
@
include
(
'components.buttons.btn-delete'
,
[
<
td
>
'id'
=>
$curso
->
id
,
<
div
class
=
"btn-group"
role
=
"group"
>
'route'
=>
route
(
'curso_delete'
,
[
'id'
=>
$curso
->
id
]),
<
div
class
=
"me-1"
>
])
@
include
(
'components.buttons.btn-edit'
,
[
</
td
>
'route'
=>
route
(
'curso_edit'
,
[
'id'
=>
$curso
->
id
]),
</
tr
>
])
</
div
>
<
div
class
=
"me-1"
>
@
include
(
'components.buttons.btn-delete'
,
[
'id'
=>
$curso
->
id
,
'route'
=>
route
(
'curso_delete'
,
[
'id'
=>
$curso
->
id
]),
])
</
div
>
</
div
>
</
td
>
</
tr
>
@
endforeach
@
endforeach
@
endforeach
@
endforeach
</
tbody
>
</
t
body
>
</
t
able
>
</
table
>
</
div
>
</
div
>
</
div
>
</
div
>
@
endsection
@
endsection
Prev
1
2
Next
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment