Skip to content

Commit

Permalink
Att admin
Browse files Browse the repository at this point in the history
  • Loading branch information
ribshow committed Jun 16, 2024
1 parent e02394c commit 115dd49
Show file tree
Hide file tree
Showing 20 changed files with 2,063 additions and 127 deletions.
72 changes: 68 additions & 4 deletions app/Http/Controllers/AdmController.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,69 @@ public function index()
$dsm1 = Hour::whereIn('id', [8,9,10,11,12,13,14,15,16])->get();
// dsm 2 semestre
$dsm2 = Hour::whereIn('id', [1,2,3,4,5,6,7])->get();

// sn 1 semestre
$sn1 = Hour::whereIn('id', [17,18,19,20,21,22,23,24,25,26,27,28])->get();
// sn 2 semestre
$sn2 = Hour::whereIn('id', [29,30,31,32,33,34,35,36,37,38,39,40])->get();
// sn 3 semestre
$sn3 = Hour::whereIn('id', [41,42,43,44,45,46,47,48,49,50,51,52])->get();
// sn 4 semestre
$sn4 = Hour::whereIn('id', [53,54,55,56,57,58,59,60,61,62,63,64])->get();
// sn 5 semestre
$sn5 = Hour::whereIn('id', [65,66,67,68,69,70,71,72,73,74,75,76])->get();
// sn 6 semestre
$sn6 = Hour::whereIn('id', [77,78,79,80,81,82,83,84,85,86,87,88])->get();
// cn 1 semestre
$cn1 = Hour::whereIn('id', [89,90,91,92,93,94,95,96,97,98,99,100])->get();
// cn 2 semestre
$cn2 = Hour::whereIn('id', [101,102,103,104,105,106,107,108,109,110,111,112])->get();
// cn 3 semestre
$cn3 = Hour::whereIn('id', [113,114,115,116,117,118,119,120,121,122,123,124])->get();
// cn 4 semestre
$cn4 = Hour::whereIn('id', [125,126,127,128,129,130,131,132,133,134,135,136])->get();
// cn 5 semestre
$cn5 = Hour::whereIn('id', [137,138,139,140,141,142,143,144,145,146,147,148])->get();
// cn 6 semestre
$cn6 = Hour::whereIn('id', [149,150,151,152,153,154,155,156,157,158,159,160])->get();
// gpi 1 semestre
$gp1 = Hour::whereIn('id', [161,162,163,164,165,166,167,168,169,170])->get();
// gpi 2 semestre
$gp2 = Hour::whereIn('id', [171,172,173,174,175,176,177,178,179,180])->get();
// gpi 3 semestre
$gp3 = Hour::whereIn('id', [181,182,183,184,185,186,187,188,189,190])->get();
// gpi 4 semestre
$gp4 = Hour::whereIn('id', [191,192,193,194,195,196,197,198,199,200])->get();
// gpi 5 semestre
$gp5 = Hour::whereIn('id', [201,202,203,204,205,206,207,208,209,210])->get();
// gpi 6 semestre
$gp6 = Hour::whereIn('id', [211,212,213,214,215,216,217,218,219,220])->get();
// ma 1 semestre
$ma1 = Hour::whereIn('id', [221,222,223,224,225,226,227,228,229,230,231,232])->get();
// ma 2 semestre
$ma2 = Hour::whereIn('id', [233,234,235,236,237,238,239,240,241,242,243,244,245])->get();
// ma3 semestre
$ma3 = Hour::whereIn('id', [246,247,248,249,250,251,252,253,254,255,256,257])->get();
// ma4 semestre
$ma4 = Hour::whereIn('id', [258,259,260,261,262,263,264,265,266,267,268,269])->get();
// ma5 semestre
$ma5 = Hour::whereIn('id', [270,271,272,273,274,275,276,277,278,279,280,281])->get();
// ma6 semestre
$ma6 = Hour::whereIn('id', [282,283,284,285,286,287,288,289,290,291])->get();
return view('pages.adms.dashboard',
compact(
'posts','users',
// disciplinas
'blocks','rooms','semesters','courses','disciplines',
//dsm1 - dsm2
'dsm1','dsm2',
// sn1 - sn2 - sn3 - sn4 - sn5 - sn6
'sn1','sn2','sn3','sn4','sn5','sn6',
// cn1 - cn2 - cn3 - cn4 - cn5 - cn6
'cn1','cn2','cn3','cn4','cn5','cn6',
// gp1 - gp2 - gp3 - gp4 - gp5 - gp6
'gp1','gp2','gp3','gp4','gp5','gp6',
// ma1 - ma2 - ma3 - ma4 - ma5 - ma6
'ma1','ma2','ma3','ma4','ma5','ma6'
));
}

Expand All @@ -52,11 +107,20 @@ public function delete($id)
return response()->json(['success' => 'Usuário excluído com sucesso!']);
}

public function editUser($id)
{
$user = User::findOrFail($id);
$user->role = 'teacher';
$user->save();

return response()->json(['success' => 'Usuário definido como Professor com sucesso!']);
}

public function editHour($id)
{
$courses = Course::all();
$users = User::all();
$disciplines = Discipline::all();
$users = User::orderBy('name','asc')->get();
$disciplines = Discipline::orderBy('name','asc')->get();
$blocks = Blocks::all();
$rooms = Room::all();
$semesters = Semester::all();
Expand All @@ -68,7 +132,7 @@ public function editHour($id)
compact(
'hour','courses','users','disciplines','blocks','rooms','semesters'));
}

// MÉTODO PARA ATUALIZAR HORÁRIO DE DETERMINADO CURSO
public function store(Request $request, $id)
{
$hour = Hour::findOrFail($id);
Expand Down
5 changes: 3 additions & 2 deletions app/Http/Controllers/IntegraController.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
use App\Models\UserType;
use App\Models\User;
use App\Models\Room;
use App\Models\Blocks;
use App\Models\Post;
use App\Models\Hour;
use Illuminate\Http\Request;
use Illuminate\View\View;
Expand All @@ -19,7 +19,8 @@ class IntegraController extends Controller
*/
public function index(): View
{
return view('pages.index');
$post = Post::find(28);
return view('pages.index', compact('post'));
}

public function grade(Request $request): View
Expand Down
243 changes: 243 additions & 0 deletions public/css/admin_att.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,243 @@
.admin-container {
display: flex;
flex-direction: column;
overflow-y: hidden;
height: 100vh;
}
.admin-left-container {
padding: 20px 35px;
background-color: var(--dsm-bg-color-quinary);
display: flex;
align-items: center;
justify-content: space-between;
height: auto;
}

.my-user-btn {
height: 40px;
display: flex;
align-items: center;
border: none;
font-size: 14px;
color: white;
border-radius: 10px;
background-color: var(--dsm-bg-color-primary);
}

.my-user-btn:hover {
cursor: pointer;
color: black;
}

.welcome-container {
padding: 40px;
flex: 1;
overflow-y: auto;
}
/* input usuario */
.search-user{
width: 50%;
height: 2rem;
}
.admin-right-all-container, .text-wel {
padding: 40px;
display: flex;
flex-direction: column;
height: calc(100vh - 40px); /* Altura total da janela menos o padding */
overflow-y: auto;
}

/* TELA MEUS USUARIOS */

.admin-right-container p {
font-weight: 700;
font-size: 26px;
}

.admin-right-container-cards {
display: flex;
flex-direction: column;
width: 100%;
border-radius: 10px;
margin-top: 1rem;
box-shadow: 0px 0px 10px 3px rgba(0, 0, 0, 0.3);
}

.admin-right-card {
background-color: var(--dsm-bg-color-quaternary);
border-radius: 10px;
padding: 20px;
}

.admin-card-username p:nth-child(1) {
font-size: 26px;
}

.admin-card-username p:nth-child(2) {
font-size: 14px;
color: var(--dsm-font-color-tertiary);
}

.admin-card-btn {
display: flex;
justify-content: center;
align-items: center;
border: 1px solid var(--dsm-border-color-secundary);
color: var(--dsm-font-color-tertiary);
background-color: var(--dsm-bg-color-secondary);
font-weight: bold;
border-radius: 10px;
margin-top: 10px;
padding: 0.5rem;
}

.admin-card-btn:hover {
border: 1px solid var(--dsm-border-color-tertiary);
color: var(--dsm-font-color-quaternary);
}

/* BOTÕES DOS HORÁRIO */
.dsm-s1, .dsm-s2,.sn-s1,.sn-s2, .sn-s3, .sn-s4, .sn-s5, .sn-s6
,.cn-s1,.cn-s2,.cn-s3,.cn-s4,.cn-s5,.cn-s6,.gp-s1,.gp-s2,.gp-s3,
.gp-s4,.gp-s5,.gp-s6,.ma-s1,.ma-s2,.ma-s3,.ma-s4,.ma-s5,.ma-s6{
display: inline-block;
padding: 0.5rem;
border: 1px solid red;
font-size: 12px;
font-weight: bolder;
background-color: crimson;
color: lightcyan;
border-radius: 15px;
margin-right: 0.5rem;
}
.dsm-s1:hover,.dsm-s2:hover,.sn-s1:hover,
.sn-s2:hover,.sn-s3:hover,.sn-s4:hover,.sn-s5:hover,.sn-s6:hover,
.cn-s1:hover,.cn-s2:hover,.cn-s3:hover,.cn-s4:hover,.cn-s5:hover,
.cn-s6:hover,.gp-s1:hover,.gp-s2:hover,.gp-s3:hover,.gp-s4:hover,
.gp-s5:hover,.gp-s6:hover,.ma-s1:hover,.ma-s2:hover,.ma-s3:hover,
.ma-s4:hover,.ma-s5:hover,.ma-s6:hover{
background-color: coral;
}
/* ESTILO HORÁRIOS/ALTERAR */
#my-table{
width: 80%;
border: 1px solid gray;
}
th,td {
padding: 0.5rem;
text-align: center;
border: 1px solid gray;
}
th {
background-color: gray;
color: white;
}
td:hover{
background-color: lightblue;
}
#editar{
background: lightblue;
cursor: pointer;
padding: 1.2;
}
#editar:hover{
width: 2rem;
height: 2rem;
}
.courses{
width: 550px;
padding: 0.5rem;
text-align: center;
}
#botoes{
width: 600px;
}
#my-table{
margin-top: 1rem;
}
#botoes{
margin-top: 1rem;
}
.dsm-s2{
margin-left: 1rem;
}
/* TELA MINHAS PUBLICACOES */

@media(min-width: 576px) {
.admin-container {
flex-direction: row;
justify-content: flex-start;
}

.admin-left-container {
height: auto;
width: 160px;
flex-direction: column;
justify-content: initial;
padding-top: 20px;
}

.my-user-btn {
background-color: initial;
padding: 0;
border-radius: initial;
font-size: 18px;
justify-content: flex-start;
width: auto;
}

.admin-left-card {
border-bottom: 2px solid var(--dsm-bg-color-secondary);
width: 100%;
height: 70px;
display: flex;
align-items: center;
justify-content: center;
}

.admin-left-card a {
width: 100%;
}

.admin-left-card a:hover {
font-weight: bold;
}

.admin-right-container p {
font-size: 32px;
}

.admin-right-all-container {
padding: 40px;
width: 100%;
display: flex;
flex-direction: column;
overflow-y: auto;
}

.admin-right-container {
width: 100%;
}

.admin-right-card {
display: flex;
justify-content: space-between;
}
.admin-card-username p:nth-child(1) {
font-size: 28px;
}

.admin-card-username p:nth-child(2) {
font-size: 16px;
}
}

@media(min-width: 768px) {
.admin-left-container {
width: 200px;
}

.admin-left-card {
width: 280px;
}
}
Loading

0 comments on commit 115dd49

Please sign in to comment.