Browse Source

update export exel

master
Gunawan19621 1 year ago
parent
commit
ce736a470e
  1. 17
      app/Exports/AssetExport.php
  2. 35
      app/Http/Controllers/M_assetController.php
  3. 4
      composer.json
  4. 990
      composer.lock
  5. 4
      config/app.php
  6. 333
      config/excel.php
  7. 84
      resources/views/addons/SettingPlatform/asset_pdf.blade.php
  8. 32
      resources/views/addons/SettingPlatform/manajement_asset.blade.php
  9. 9
      resources/views/dashboard/index.blade.php
  10. 208
      resources/views/landing_page/layouts/main.blade.php
  11. 10
      routes/web.php

17
app/Exports/AssetExport.php

@ -0,0 +1,17 @@
<?php
namespace App\Exports;
use App\Models\m_asset;
use Maatwebsite\Excel\Concerns\FromCollection;
class AssetExport implements FromCollection
{
/**
* @return \Illuminate\Support\Collection
*/
public function collection()
{
return m_asset::all();
}
}

35
app/Http/Controllers/M_assetController.php

@ -2,10 +2,14 @@
namespace App\Http\Controllers;
use App\Exports\AssetExport;
use App\Models\m_asset;
use Barryvdh\DomPDF\PDF;
use Dompdf\Dompdf;
use App\Models\m_warehouse;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Auth;
use Maatwebsite\Excel\Facades\Excel;
class M_assetController extends Controller
{
@ -149,4 +153,35 @@ class M_assetController extends Controller
return redirect()->back()->with('error', 'Data asset gagal dihapus');
}
}
/**
* Cetak PDF.
*/
public function cetakpdf()
{
// dd('oke');
$asset = m_asset::all();
// Buat objek Dompdf
$dompdf = new Dompdf();
// Render tampilan ke PDF
$html = view('addons.SettingPlatform.asset_pdf', compact('asset'))->render();
// Muat HTML ke Dompdf
$dompdf->loadHtml($html);
// Atur ukuran dan orientasi kertas
$dompdf->setPaper('A4', 'portrait');
// Render PDF
$dompdf->render();
// Tampilkan PDF di browser
return $dompdf->stream('Laporan Barang');
}
public function export()
{
return Excel::download(new AssetExport, 'Assets.xlsx');
}
}

4
composer.json

@ -6,10 +6,12 @@
"license": "MIT",
"require": {
"php": "^8.1",
"barryvdh/laravel-dompdf": "^2.0",
"guzzlehttp/guzzle": "^7.2",
"laravel/framework": "^10.10",
"laravel/sanctum": "^3.2",
"laravel/tinker": "^2.8"
"laravel/tinker": "^2.8",
"maatwebsite/excel": "^3.1"
},
"require-dev": {
"fakerphp/faker": "^1.9.1",

990
composer.lock generated

File diff suppressed because it is too large Load Diff

4
config/app.php

@ -168,6 +168,8 @@ return [
// App\Providers\BroadcastServiceProvider::class,
App\Providers\EventServiceProvider::class,
App\Providers\RouteServiceProvider::class,
Barryvdh\DomPDF\ServiceProvider::class,
Maatwebsite\Excel\ExcelServiceProvider::class,
])->toArray(),
/*
@ -183,6 +185,8 @@ return [
'aliases' => Facade::defaultAliases()->merge([
// 'Example' => App\Facades\Example::class,
'PDF' => Barryvdh\DomPDF\Facade::class,
'Excel' => Maatwebsite\Excel\Facades\Excel::class,
])->toArray(),
];

333
config/excel.php

@ -0,0 +1,333 @@
<?php
use Maatwebsite\Excel\Excel;
return [
'exports' => [
/*
|--------------------------------------------------------------------------
| Chunk size
|--------------------------------------------------------------------------
|
| When using FromQuery, the query is automatically chunked.
| Here you can specify how big the chunk should be.
|
*/
'chunk_size' => 1000,
/*
|--------------------------------------------------------------------------
| Pre-calculate formulas during export
|--------------------------------------------------------------------------
*/
'pre_calculate_formulas' => false,
/*
|--------------------------------------------------------------------------
| Enable strict null comparison
|--------------------------------------------------------------------------
|
| When enabling strict null comparison empty cells ('') will
| be added to the sheet.
*/
'strict_null_comparison' => false,
/*
|--------------------------------------------------------------------------
| CSV Settings
|--------------------------------------------------------------------------
|
| Configure e.g. delimiter, enclosure and line ending for CSV exports.
|
*/
'csv' => [
'delimiter' => ',',
'enclosure' => '"',
'line_ending' => PHP_EOL,
'use_bom' => false,
'include_separator_line' => false,
'excel_compatibility' => false,
'output_encoding' => '',
'test_auto_detect' => true,
],
/*
|--------------------------------------------------------------------------
| Worksheet properties
|--------------------------------------------------------------------------
|
| Configure e.g. default title, creator, subject,...
|
*/
'properties' => [
'creator' => '',
'lastModifiedBy' => '',
'title' => '',
'description' => '',
'subject' => '',
'keywords' => '',
'category' => '',
'manager' => '',
'company' => '',
],
],
'imports' => [
/*
|--------------------------------------------------------------------------
| Read Only
|--------------------------------------------------------------------------
|
| When dealing with imports, you might only be interested in the
| data that the sheet exists. By default we ignore all styles,
| however if you want to do some logic based on style data
| you can enable it by setting read_only to false.
|
*/
'read_only' => true,
/*
|--------------------------------------------------------------------------
| Ignore Empty
|--------------------------------------------------------------------------
|
| When dealing with imports, you might be interested in ignoring
| rows that have null values or empty strings. By default rows
| containing empty strings or empty values are not ignored but can be
| ignored by enabling the setting ignore_empty to true.
|
*/
'ignore_empty' => false,
/*
|--------------------------------------------------------------------------
| Heading Row Formatter
|--------------------------------------------------------------------------
|
| Configure the heading row formatter.
| Available options: none|slug|custom
|
*/
'heading_row' => [
'formatter' => 'slug',
],
/*
|--------------------------------------------------------------------------
| CSV Settings
|--------------------------------------------------------------------------
|
| Configure e.g. delimiter, enclosure and line ending for CSV imports.
|
*/
'csv' => [
'delimiter' => null,
'enclosure' => '"',
'escape_character' => '\\',
'contiguous' => false,
'input_encoding' => 'UTF-8',
],
/*
|--------------------------------------------------------------------------
| Worksheet properties
|--------------------------------------------------------------------------
|
| Configure e.g. default title, creator, subject,...
|
*/
'properties' => [
'creator' => '',
'lastModifiedBy' => '',
'title' => '',
'description' => '',
'subject' => '',
'keywords' => '',
'category' => '',
'manager' => '',
'company' => '',
],
],
/*
|--------------------------------------------------------------------------
| Extension detector
|--------------------------------------------------------------------------
|
| Configure here which writer/reader type should be used when the package
| needs to guess the correct type based on the extension alone.
|
*/
'extension_detector' => [
'xlsx' => Excel::XLSX,
'xlsm' => Excel::XLSX,
'xltx' => Excel::XLSX,
'xltm' => Excel::XLSX,
'xls' => Excel::XLS,
'xlt' => Excel::XLS,
'ods' => Excel::ODS,
'ots' => Excel::ODS,
'slk' => Excel::SLK,
'xml' => Excel::XML,
'gnumeric' => Excel::GNUMERIC,
'htm' => Excel::HTML,
'html' => Excel::HTML,
'csv' => Excel::CSV,
'tsv' => Excel::TSV,
/*
|--------------------------------------------------------------------------
| PDF Extension
|--------------------------------------------------------------------------
|
| Configure here which Pdf driver should be used by default.
| Available options: Excel::MPDF | Excel::TCPDF | Excel::DOMPDF
|
*/
'pdf' => Excel::DOMPDF,
],
/*
|--------------------------------------------------------------------------
| Value Binder
|--------------------------------------------------------------------------
|
| PhpSpreadsheet offers a way to hook into the process of a value being
| written to a cell. In there some assumptions are made on how the
| value should be formatted. If you want to change those defaults,
| you can implement your own default value binder.
|
| Possible value binders:
|
| [x] Maatwebsite\Excel\DefaultValueBinder::class
| [x] PhpOffice\PhpSpreadsheet\Cell\StringValueBinder::class
| [x] PhpOffice\PhpSpreadsheet\Cell\AdvancedValueBinder::class
|
*/
'value_binder' => [
'default' => Maatwebsite\Excel\DefaultValueBinder::class,
],
'cache' => [
/*
|--------------------------------------------------------------------------
| Default cell caching driver
|--------------------------------------------------------------------------
|
| By default PhpSpreadsheet keeps all cell values in memory, however when
| dealing with large files, this might result into memory issues. If you
| want to mitigate that, you can configure a cell caching driver here.
| When using the illuminate driver, it will store each value in the
| cache store. This can slow down the process, because it needs to
| store each value. You can use the "batch" store if you want to
| only persist to the store when the memory limit is reached.
|
| Drivers: memory|illuminate|batch
|
*/
'driver' => 'memory',
/*
|--------------------------------------------------------------------------
| Batch memory caching
|--------------------------------------------------------------------------
|
| When dealing with the "batch" caching driver, it will only
| persist to the store when the memory limit is reached.
| Here you can tweak the memory limit to your liking.
|
*/
'batch' => [
'memory_limit' => 60000,
],
/*
|--------------------------------------------------------------------------
| Illuminate cache
|--------------------------------------------------------------------------
|
| When using the "illuminate" caching driver, it will automatically use
| your default cache store. However if you prefer to have the cell
| cache on a separate store, you can configure the store name here.
| You can use any store defined in your cache config. When leaving
| at "null" it will use the default store.
|
*/
'illuminate' => [
'store' => null,
],
],
/*
|--------------------------------------------------------------------------
| Transaction Handler
|--------------------------------------------------------------------------
|
| By default the import is wrapped in a transaction. This is useful
| for when an import may fail and you want to retry it. With the
| transactions, the previous import gets rolled-back.
|
| You can disable the transaction handler by setting this to null.
| Or you can choose a custom made transaction handler here.
|
| Supported handlers: null|db
|
*/
'transactions' => [
'handler' => 'db',
'db' => [
'connection' => null,
],
],
'temporary_files' => [
/*
|--------------------------------------------------------------------------
| Local Temporary Path
|--------------------------------------------------------------------------
|
| When exporting and importing files, we use a temporary file, before
| storing reading or downloading. Here you can customize that path.
|
*/
'local_path' => storage_path('framework/cache/laravel-excel'),
/*
|--------------------------------------------------------------------------
| Remote Temporary Disk
|--------------------------------------------------------------------------
|
| When dealing with a multi server setup with queues in which you
| cannot rely on having a shared local temporary path, you might
| want to store the temporary file on a shared disk. During the
| queue executing, we'll retrieve the temporary file from that
| location instead. When left to null, it will always use
| the local path. This setting only has effect when using
| in conjunction with queued imports and exports.
|
*/
'remote_disk' => null,
'remote_prefix' => null,
/*
|--------------------------------------------------------------------------
| Force Resync
|--------------------------------------------------------------------------
|
| When dealing with a multi server setup as above, it's possible
| for the clean up that occurs after entire queue has been run to only
| cleanup the server that the last AfterImportJob runs on. The rest of the server
| would still have the local temporary file stored on it. In this case your
| local storage limits can be exceeded and future imports won't be processed.
| To mitigate this you can set this config value to be true, so that after every
| queued chunk is processed the local temporary file is deleted on the server that
| processed it.
|
*/
'force_resync_remote' => null,
],
];

84
resources/views/addons/SettingPlatform/asset_pdf.blade.php

@ -0,0 +1,84 @@
<!DOCTYPE html>
<html>
<head>
<style>
#customers {
font-family: Arial, Helvetica, sans-serif;
border-collapse: collapse;
width: 100%;
}
#customers td,
#customers th {
border: 1px solid #ddd;
padding: 8px;
}
#customers tr:nth-child(even) {
background-color: #f2f2f2;
}
#customers tr:hover {
background-color: #ddd;
}
#customers th {
padding-top: 12px;
padding-bottom: 12px;
text-align: left;
background-color: #4aa2dd;
color: white;
}
</style>
</head>
<body>
{{-- <h1>Laporan Keuangan</h1> --}}
<h1 class="text-gray-800">Tabel Asset</h1>
<div class="mb-3">
<p>Our Item Tables are enhanced with the help of the DataTables plugin. This is a powerful tool that allows you
to explore return data in a more interactive and efficient way</p>
</div>
<table id="customers">
<thead>
<tr>
<th>No. Seri</th>
<th>Nama</th>
<th>Deskripsi</th>
<th>Gudang</th>
<th>Tanggal</th>
<th>QR</th>
</tr>
</thead>
<tbody>
@forelse ($asset as $data)
<tr>
<td>{{ $data->seri }}</td>
<td>{{ $data->name }}</td>
<td>{{ $data->description }}</td>
<td>{{ $data->warehouse->name }}</td>
<td>{{ \Carbon\Carbon::parse($data->date)->format('d-m-Y') }}</td>
<td>{{ $data->qr_count }}</td>
</tr>
@empty
<p>Data Kosong</p>
@endforelse
</tbody>
<tfoot>
<tr>
<th>No. Seri</th>
<th>Nama</th>
<th>Deskripsi</th>
<th>Gudang</th>
<th>Tanggal</th>
<th>QR</th>
</tr>
</tfoot>
</table>
</body>
</html>

32
resources/views/addons/SettingPlatform/manajement_asset.blade.php

@ -11,15 +11,33 @@
</a>
</div>
<div class="card shadow mb-4">
{{-- <div class="card-header py-3">
<h6 class="m-0 font-weight-bold text-primary">DataTables Asset</h6>
</div> --}}
<div class="card-header py-3 d-flex justify-content-between align-items-center">
<div class="card-header py-3">
<div class="row">
<div class="col-6">
<h5 class="m-0 font-weight-bold text-primary mt-2">DataTables Asset</h5>
</div>
<div class="col-6 text-right">
<a href="{{ route('assetcetakpdf.cetakpdf') }}" class="btn btn-success btn-icon-split ml-auto"
target="_blank">
<span class="text">Cetak PDF</span>
</a>
<a href="{{ route('assetexport.export') }}" class="btn btn-info btn-icon-split ml-auto"
target="_blank">
<span class="text">Cetak Exel</span>
</a>
</div>
</div>
</div>
{{-- <div class="card-header py-3 d-flex justify-content-between align-items-center">
<h6 class="m-0 font-weight-bold text-primary">DataTables Asset</h6>
<a href="#" class="btn btn-success btn-icon-split ml-auto">
<span class="text">Download Data Barang</span>
<a href="{{ route('assetcetakpdf.cetakpdf') }}" class="btn btn-success btn-icon-split ml-auto"
target="_blank">
<span class="text">CETAK PDF</span>
</a>
</div>
<a href="{{ route('assetexport.export') }}" class="btn btn-info btn-icon-split ml-auto" target="_blank">
<span class="text">CETAK Exel</span>
</a>
</div> --}}
<div class="card-body">
<div class="table-responsive">
<table class="table table-bordered" id="tablebarang" width="100%" cellspacing="0">

9
resources/views/dashboard/index.blade.php

@ -15,7 +15,8 @@
<div class="text-xs font-weight-bold text-primary text-uppercase mb-1" style="font-size: 14px;">
<strong>Pengadaan</strong>
</div>
<div class="h5 mb-0 font-weight-bold text-gray-800" style="font-size: 25px;">44</div>
<div class="h5 mb-0 font-weight-bold text-gray-800" style="font-size: 25px;">{{ $jumlahAsset }}
</div>
</div>
<div class="col-auto">
<i class="fas fa-clipboard-list fa-2x text-gray-300"></i>
@ -34,7 +35,8 @@
<div class="text-xs font-weight-bold text-success text-uppercase mb-1" style="font-size: 14px;">
<strong>Peminjaman</strong>
</div>
<div class="h5 mb-0 font-weight-bold text-gray-800" style="font-size: 25px;">73</div>
<div class="h5 mb-0 font-weight-bold text-gray-800" style="font-size: 25px;">
{{ $jumlahPeminjaman }}</div>
</div>
<div class="col-auto">
<i class="fas fa-dollar-sign fa-2x text-gray-300"></i>
@ -53,7 +55,8 @@
<div class="text-xs font-weight-bold text-info text-uppercase mb-1" style="font-size: 14px;">
<strong>Pengembalian</strong>
</div>
<div class="h5 mb-0 font-weight-bold text-gray-800" style="font-size: 25px;">45</div>
<div class="h5 mb-0 font-weight-bold text-gray-800" style="font-size: 25px;">
{{ $jumlahPengembalian }}</div>
</div>
<div class="col-auto">
<i class="fas fa-calendar fa-2x text-gray-300"></i>

208
resources/views/landing_page/layouts/main.blade.php

@ -5,15 +5,26 @@
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<meta name="author" content="Untree.co">
<link rel="shortcut icon" href="{{ asset('asset_landingpage/favicon.png') }}">
<meta name="description" content="" />
<meta name="keywords" content="bootstrap, bootstrap4" />
@include('landing_page.layouts.link')
<title>Siopas Iventory</title>
<link
href="https://fonts.googleapis.com/css2?family=Display+Playfair:wght@400;700&family=Inter:wght@400;700&display=swap"
rel="stylesheet">
<link rel="shortcut icon" href="{{ asset('asset_landingpage/favicon.png') }}">
<link rel="stylesheet" href="https://unicons.iconscout.com/release/v4.0.0/css/line.css">
<link rel="stylesheet" href="{{ asset('asset_landingpage/css/bootstrap.min.css') }}">
<link rel="stylesheet" href="{{ asset('asset_landingpage/css/animate.min.css') }}">
<link rel="stylesheet" href="{{ asset('asset_landingpage/css/owl.carousel.min.css') }}">
<link rel="stylesheet" href="{{ asset('asset_landingpage/css/owl.theme.default.min.css') }}">
<link rel="stylesheet" href="{{ asset('asset_landingpage/css/jquery.fancybox.min.css') }}">
<link rel="stylesheet" href="{{ asset('asset_landingpage/fonts/icomoon/style.css') }}">
<link rel="stylesheet" href="{{ asset('asset_landingpage/fonts/flaticon/font/flaticon.css') }}">
<link rel="stylesheet" href="{{ asset('asset_landingpage/css/aos.css') }}">
<link rel="stylesheet" href="{{ asset('asset_landingpage/css/style.css') }}">
<title>SIOPAS IVENTORY</title>
</head>
<body>
<div class="site-mobile-menu">
<div class="site-mobile-menu-header">
<div class="site-mobile-menu-close">
@ -26,16 +37,82 @@
<nav class="site-nav mb-5">
@include('landing_page.layouts.head_navbar')
<div class="pb-2 top-bar mb-3">
<div class="container">
<div class="row align-items-center">
<div class="col-6 col-lg-9">
<a href="#" class="small mr-3"><span class="icon-question-circle-o mr-2"></span> <span
class="d-none d-lg-inline-block">Have a questions?</span></a>
<a href="#" class="small mr-3"><span class="icon-phone mr-2"></span> <span
class="d-none d-lg-inline-block">0851 5907 9010</span></a>
<a href="#" class="small mr-3"><span class="icon-envelope mr-2"></span> <span
class="d-none d-lg-inline-block">siopas@gmail.com</span></a>
</div>
<div class="col-6 col-lg-3 text-right">
<a href="{{ route('login') }}" class="small mr-3">
<span class="icon-lock"></span>
Log In
</a>
<a href="{{ route('register') }}" class="small">
<span class="icon-person"></span>
Register
</a>
</div>
</div>
</div>
</div>
<div class="sticky-nav js-sticky-header">
<div class="container position-relative">
<div class="site-navigation text-center">
<a href="index.html" class="logo menu-absolute m-0">SIOPAS<span class="text-primary">.</span></a>
<ul class="js-clone-nav d-none d-lg-inline-block site-menu">
<li class="active"><a href="index.html">Home</a></li>
<li class="has-children">
<a href="#">Dropdown</a>
<ul class="dropdown">
<li><a href="elements.html">Elements</a></li>
<li class="has-children">
<a href="#">Menu Two</a>
<ul class="dropdown">
<li><a href="#">Sub Menu One</a></li>
<li><a href="#">Sub Menu Two</a></li>
<li><a href="#">Sub Menu Three</a></li>
</ul>
</li>
<li><a href="#">Menu Three</a></li>
</ul>
</li>
<li><a href="staff.html">Our Staff</a></li>
<li><a href="news.html">News</a></li>
<li><a href="gallery.html">Gallery</a></li>
<li><a href="about.html">About</a></li>
<li><a href="contact.html">Contact</a></li>
</ul>
<a href="#" class="btn-book btn btn-secondary btn-sm menu-absolute">Enroll Now</a>
<a href="#"
class="burger ml-auto float-right site-menu-toggle js-menu-toggle d-inline-block d-lg-none light"
data-toggle="collapse" data-target="#main-navbar">
<span></span>
</a>
@include('landing_page.layouts.navbar')
</div>
</div>
</div>
</nav>
<div class="untree_co-hero overlay" style="background-image: url('images/hero-img-1-min.jpg');">
<div class="untree_co-hero overlay"
style="background-image: url('{{ asset('asset_landingpage/images/hero-img-1-min.jpg') }}');">
{{-- style="background-image: url('/public/asset_landingpage/images/hero-img-1-min.jpg');"> --}}
{{-- <div class="container">
<div class="container">
<div class="row align-items-center justify-content-center">
<div class="col-12">
@ -59,12 +136,12 @@
</div>
</div> <!-- /.row -->
</div> <!-- /.container --> --}}
</div> <!-- /.container -->
</div> <!-- /.untree_co-hero -->
{{-- <div class="untree_co-section">
<div class="untree_co-section">
<div class="container">
<div class="row justify-content-center mb-3">
<div class="col-lg-7 text-center" data-aos="fade-up" data-aos-delay="0">
@ -198,7 +275,8 @@
</div>
<div class="col-lg-6" data-aos="fade-up" data-aos-delay="0">
<figure class="img-wrap-2">
<img src="images/teacher-min.jpg" alt="Image" class="img-fluid">
<img src="{{ asset('asset_landingpage/images/teacher-min.jpg') }}" alt="Image"
class="img-fluid">
<div class="dotted"></div>
</figure>
@ -286,8 +364,8 @@
<div class="row">
<div class="col-12 col-sm-6 col-md-6 col-lg-4 mb-4 mb-lg-0">
<div class="custom-media">
<a href="#"><img src="images/img-school-1-min.jpg" alt="Image"
class="img-fluid"></a>
<a href="#"><img src="{{ asset('asset_landingpage/images/img-school-1-min.jpg') }}"
alt="Image" class="img-fluid"></a>
<div class="custom-media-body">
<div class="d-flex justify-content-between pb-3">
<div class="text-primary"><span class="uil uil-book-open"></span> <span>43
@ -667,10 +745,99 @@
</div>
</div>
</div>
</div> <!-- /.untree_co-section --> --}}
</div> <!-- /.untree_co-section -->
<div class="site-footer">
@include('landing_page.layouts.footer')
<div class="container">
<div class="row">
<div class="col-lg-3 mr-auto">
<div class="widget">
<h3>About Us<span class="text-primary">.</span> </h3>
<p>Far far away, behind the word mountains, far from the countries Vokalia and Consonantia,
there live the blind texts.</p>
</div> <!-- /.widget -->
<div class="widget">
<h3>Connect</h3>
<ul class="list-unstyled social">
<li><a href="#"><span class="icon-instagram"></span></a></li>
<li><a href="#"><span class="icon-twitter"></span></a></li>
<li><a href="#"><span class="icon-facebook"></span></a></li>
<li><a href="#"><span class="icon-linkedin"></span></a></li>
<li><a href="#"><span class="icon-pinterest"></span></a></li>
<li><a href="#"><span class="icon-dribbble"></span></a></li>
</ul>
</div> <!-- /.widget -->
</div> <!-- /.col-lg-3 -->
<div class="col-lg-2 ml-auto">
<div class="widget">
<h3>Projects</h3>
<ul class="list-unstyled float-left links">
<li><a href="#">Web Design</a></li>
<li><a href="#">HTML5</a></li>
<li><a href="#">CSS3</a></li>
<li><a href="#">jQuery</a></li>
<li><a href="#">Bootstrap</a></li>
</ul>
</div> <!-- /.widget -->
</div> <!-- /.col-lg-3 -->
<div class="col-lg-3">
<div class="widget">
<h3>Gallery</h3>
<ul class="instafeed instagram-gallery list-unstyled">
<li><a class="instagram-item" href="images/gal_1.jpg" data-fancybox="gal"><img
src="images/gal_1.jpg" alt="" width="72" height="72"></a>
</li>
<li><a class="instagram-item" href="images/gal_2.jpg" data-fancybox="gal"><img
src="images/gal_2.jpg" alt="" width="72" height="72"></a>
</li>
<li><a class="instagram-item" href="images/gal_3.jpg" data-fancybox="gal"><img
src="images/gal_3.jpg" alt="" width="72" height="72"></a>
</li>
<li><a class="instagram-item" href="images/gal_4.jpg" data-fancybox="gal"><img
src="images/gal_4.jpg" alt="" width="72" height="72"></a>
</li>
<li><a class="instagram-item" href="images/gal_5.jpg" data-fancybox="gal"><img
src="images/gal_5.jpg" alt="" width="72" height="72"></a>
</li>
<li><a class="instagram-item" href="images/gal_6.jpg" data-fancybox="gal"><img
src="images/gal_6.jpg" alt="" width="72" height="72"></a>
</li>
</ul>
</div> <!-- /.widget -->
</div> <!-- /.col-lg-3 -->
<div class="col-lg-3">
<div class="widget">
<h3>Contact</h3>
<address>43 Raymouth Rd. Baltemoer, London 3910</address>
<ul class="list-unstyled links mb-4">
<li><a href="tel://11234567890">+1(123)-456-7890</a></li>
<li><a href="tel://11234567890">+1(123)-456-7890</a></li>
<li><a href="mailto:info@mydomain.com">info@mydomain.com</a></li>
</ul>
</div> <!-- /.widget -->
</div> <!-- /.col-lg-3 -->
</div> <!-- /.row -->
<div class="row mt-5">
<div class="col-12 text-center">
<p>Copyright &copy;
<script>
document.write(new Date().getFullYear());
</script>. All Rights Reserved. &mdash; Designed with love by <a
href="https://untree.co">Untree.co</a> Distributed By <a
href="https://themewagon.com">ThemeWagon</a>
<!-- License information: https://untree.co/license/ -->
</div>
</div>
</div> <!-- /.container -->
</div> <!-- /.site-footer -->
<div id="overlayer"></div>
@ -680,7 +847,16 @@
</div>
</div>
@include('landing_page.layouts.script')
<script src="{{ asset('asset_landingpage/js/jquery-3.4.1.min.js') }}"></script>
<script src="{{ asset('asset_landingpage/js/popper.min.js') }}"></script>
<script src="{{ asset('asset_landingpage/js/bootstrap.min.js') }}"></script>
<script src="{{ asset('asset_landingpage/js/owl.carousel.min.js') }}"></script>
<script src="{{ asset('asset_landingpage/js/jquery.animateNumber.min.js') }}"></script>
<script src="{{ asset('asset_landingpage/js/jquery.waypoints.min.js') }}"></script>
<script src="{{ asset('asset_landingpage/js/jquery.fancybox.min.js') }}"></script>
<script src="{{ asset('asset_landingpage/js/jquery.sticky.js') }}"></script>
<script src="{{ asset('asset_landingpage/js/aos.js') }}"></script>
<script src="{{ asset('asset_landingpage/js/custom.js') }}"></script>
</body>
</html>

10
routes/web.php

@ -9,6 +9,7 @@ use App\Http\Controllers\ProductController;
use App\Http\Controllers\M_assetController;
use App\Http\Controllers\M_userController;
use App\Http\Controllers\SettingPlatformController;
use App\Models\asset_status;
use App\Models\m_asset;
use Illuminate\Support\Facades\Route;
@ -51,7 +52,11 @@ Route::middleware('auth')->group(function () {
Route::group(['prefix' => 'dashboard'], function () {
//Halaman dashboard
Route::middleware('auth')->get('', function () {
return view('dashboard.index');
$jumlahAsset = m_asset::count();
$jumlahPeminjaman = asset_status::count();
// $jumlahPengembalian = asset_status::count();
$jumlahPengembalian = asset_status::whereNotNull('enter_at')->count();
return view('dashboard.index', compact('jumlahAsset', 'jumlahPeminjaman', 'jumlahPengembalian'));
});
//Halaman Transaksi
@ -70,11 +75,12 @@ Route::group(['prefix' => 'dashboard'], function () {
//Halaman Manajemen Asset
Route::middleware('auth')->resource('/asset', M_assetController::class);
Route::get('/hapusAsset/{id}', [M_assetController::class, 'destroy'])->name('hapusAsset.destroy');
Route::get('/assetcetak_pdf', [M_assetController::class, 'cetakpdf'])->name('assetcetakpdf.cetakpdf');
Route::get('/assetexport', [M_assetController::class, 'export'])->name('assetexport.export');
//Halaman Manajemen User
Route::middleware('auth')->resource('/user', M_userController::class);
Route::get('/hapusUser/{id}', [M_userController::class, 'destroy'])->name('hapusUser.destroy');
// Route::get('/hapusAsset/{id}', [M_assetController::class, 'destroy'])->name('hapusAsset.destroy');
});
require __DIR__ . '/auth.php';

Loading…
Cancel
Save