Skip to content

Commit

Permalink
criando pagina do parceirto e do administrador
Browse files Browse the repository at this point in the history
  • Loading branch information
Luizhtanaka committed Sep 13, 2023
1 parent 7199153 commit 3be88a4
Show file tree
Hide file tree
Showing 1,894 changed files with 201,792 additions and 240 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,4 @@ yarn-error.log
/.fleet
/.idea
/.vscode
/views/startbootstrap-sb-admin-2/*
24 changes: 21 additions & 3 deletions app/Http/Controllers/CustomAuthController.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php
namespace App\Http\Controllers;

use App\Models\Lead;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Hash;
use Illuminate\Support\Facades\Session;
Expand All @@ -12,7 +14,7 @@ public function index()
if(Auth::check()){
$user = Auth::user();

return view('dashboard',compact("user"));
return view('site.dashboard',compact("user"));
}

return view('auth.login');
Expand Down Expand Up @@ -54,7 +56,7 @@ public function customRegistration(Request $request)
$data = $request->all();
$check = $this->create($data);

return redirect("dashboard")->withSuccess('You have signed-in');
return redirect("site.dashboard")->withSuccess('You have signed-in');
}

public function create(array $data)
Expand All @@ -74,9 +76,25 @@ public function dashboard(Request $request)
$Count_user = User::all()
->where('access_level','=', 'user')
->count();

$list_users = User::all()
->where('access_level','=', 'user');

$Count_leads = Lead::all()
->where('user_id','=', $user->id)
->count();

$list_leads = Lead::all()
->where('user_id','=', $user->id);

//return view('dashboard',compact("user"));
return view('dashboard',(["user" => $user,"quantidade"=>$Count_user]));
return view('site.dashboard',([
"user" => $user
,"quantidade_user"=>$Count_user
,"list_user" => $list_users
,"quantidade_lead" => $Count_leads
,"list_lead" => $list_leads
]));
}

return redirect("login")->withSuccess('You are not allowed to access');
Expand Down
1 change: 1 addition & 0 deletions database/.gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
*.sqlite*
views/startbootstrap-sb-admin-2/*
21 changes: 21 additions & 0 deletions database/seeders/UserSeeder.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,27 @@ public function run(): void
'email' => '[email protected]',
'password' => Hash::make('123456'),
'created_at' => date("Y-m-d H:i:s")
],
[
'codigo' => 'Daniel',
'name' => 'Daniel Torres',
'email' => '[email protected]',
'password' => Hash::make('123456'),
'created_at' => date("Y-m-d H:i:s")
],
[
'codigo' => 'Tozzi',
'name' => 'Marcos Tozzi',
'email' => '[email protected]',
'password' => Hash::make('123456'),
'created_at' => date("Y-m-d H:i:s")
],
[
'codigo' => 'Victor',
'name' => 'Victor',
'email' => '[email protected]',
'password' => Hash::make('123456'),
'created_at' => date("Y-m-d H:i:s")
]
]);
}
Expand Down
8 changes: 8 additions & 0 deletions resources/views/site/dashboard.blade.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
@extends('site.layout.master-dashboard')


@section('content')
@include('site.layout.lista-usuarios')

@include('site.layout.lista-leads')
@endsection
4 changes: 1 addition & 3 deletions resources/views/site/home.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,9 @@
@section('content')
<!-- Banner -->

@include('site.layout.banner')

<!-- Section -->
@include('site.layout.servicos')

<!-- Section -->
@include('site.layout.blog')

@endsection
38 changes: 0 additions & 38 deletions resources/views/site/layout/banner.blade.php

This file was deleted.

55 changes: 0 additions & 55 deletions resources/views/site/layout/blog.blade.php

This file was deleted.

10 changes: 0 additions & 10 deletions resources/views/site/layout/header.blade.php

This file was deleted.

67 changes: 67 additions & 0 deletions resources/views/site/layout/lista-leads.blade.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
<div class="row">
<!-- Earnings (Monthly) Card Example -->
<div class="col-xl-3 col-md-6 mb-4">
<div class="card border-left-primary shadow h-100 py-2">
<div class="card-body">
<div class="row no-gutters align-items-center">
<div class="col mr-2">
<div class="text-xs font-weight-bold text-primary text-uppercase mb-1">
Parceiros Cadastrados (Mês)</div>
<div class="h5 mb-0 font-weight-bold text-gray-800">{{ $quantidade_lead }}</div>
</div>
<div class="col-auto">
<i class="fas fa-calendar fa-2x text-gray-300"></i>
</div>
</div>
</div>
</div>
</div>

<!-- Earnings (Monthly) Card Example -->
<div class="col-xl-3 col-md-6 mb-4">
<div class="card border-left-success shadow h-100 py-2">
<div class="card-body">
<div class="row no-gutters align-items-center">
<div class="col mr-2">
<div class="text-xs font-weight-bold text-success text-uppercase mb-1">
Link de Divulgação
</div>
<div>
<a class="btn btn-primary h5 mb-0 font-weight-bold text-white-800" href="{{ route('site.home') }}">{{ route('site.home') }}?resource={{$user->codigo}}</a>
</div>
</div>
<div class="col-auto">
<i class="fas fa-dollar-sign fa-2x text-gray-300"></i>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="card shadow mb-4">
<div class="card-header py-3">
<h6 class="m-0 font-weight-bold text-primary">Leads do Parceiro</h6>
</div>
<div class="card-body">
<div class="table-responsive">
<table class="table table-bordered" id="dataTable" width="100%" cellspacing="0">
<thead>
<tr>
<th>Nome</th>
<th>Email</th>
<th>Data Cadastro</th>
</tr>
</thead>
@foreach ($list_lead as $lead)
<tbody>
<tr>
<td>{{ $lead->Nome }}</td>
<td>{{ $lead->email }}</td>
<td>{{ $lead->created_at }}</td>
</tr>
</tbody>
@endforeach
</table>
</div>
</div>
</div>
27 changes: 27 additions & 0 deletions resources/views/site/layout/lista-usuarios.blade.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<div class="card shadow mb-4">
<div class="card-header py-3">
<h6 class="m-0 font-weight-bold text-primary">Parceiros Comercias Cadastrados</h6>
</div>
<div class="card-body">
<div class="table-responsive">
<table class="table table-bordered" id="dataTable" width="100%" cellspacing="0">
<thead>
<tr>
<th>Código</th>
<th>Nome</th>
<th>Email</th>
</tr>
</thead>
@foreach ($list_user as $user)
<tbody>
<tr>
<td>{{ $user->codigo }}</td>
<td>{{ $user->name }}</td>
<td>{{ $user->email }}</td>
</tr>
</tbody>
@endforeach
</table>
</div>
</div>
</div>
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<meta name="description" content="">
<meta name="author" content="">

<title>SB Admin 2 - Dashboard</title>
<title>Universo Canopus</title>

<!-- Custom fonts for this template-->
<link href="vendor/fontawesome-free/css/all.min.css" rel="stylesheet" type="text/css">
Expand All @@ -31,7 +31,7 @@
<ul class="navbar-nav bg-gradient-primary sidebar sidebar-dark accordion" id="accordionSidebar">

<!-- Sidebar - Brand -->
<a class="sidebar-brand d-flex align-items-center justify-content-center" href="index.html">
<a class="sidebar-brand d-flex align-items-center justify-content-center" href="{{ route('site.dashboard') }}">
<div class="sidebar-brand-icon rotate-n-15">
<i class="fas fa-laugh-wink"></i>
</div>
Expand Down Expand Up @@ -232,12 +232,18 @@
<div class="d-sm-flex align-items-center justify-content-between mb-4">
<h1 class="h3 mb-0 text-gray-800">Dashboard</h1>
</div>

<!-- Earnings (Monthly) Card Example -->


@include('site.layout.lista-leads')

<!-- Content Row -->
<!-- Controle de acesso - admin -->
@can('access')

<div class="row">

<!-- Earnings (Monthly) Card Example -->
<div class="col-xl-3 col-md-6 mb-4">
<div class="card border-left-primary shadow h-100 py-2">
Expand All @@ -246,7 +252,7 @@
<div class="col mr-2">
<div class="text-xs font-weight-bold text-primary text-uppercase mb-1">
Parceiros Cadastrados (Mês)</div>
<div class="h5 mb-0 font-weight-bold text-gray-800">{{ $quantidade }}</div>
<div class="h5 mb-0 font-weight-bold text-gray-800">{{ $quantidade_user }}</div>
</div>
<div class="col-auto">
<i class="fas fa-calendar fa-2x text-gray-300"></i>
Expand Down Expand Up @@ -321,7 +327,7 @@
</div>
</div>
</div>

@include('site.layout.lista-usuarios')
<!-- Content Row -->

<div class="row">
Expand Down
Loading

0 comments on commit 3be88a4

Please sign in to comment.