Commit c24f98cd by Farendi Giotivano R.P

Fasilitas

parent 3f554084
......@@ -3,10 +3,19 @@
namespace App\Http\Controllers\User;
use App\Http\Controllers\Controller;
use App\Repositories\User\FasilitasRepository;
use Crypt;
use Illuminate\Http\Request;
class FasilitasController extends Controller
{
private $fasilitasRepo;
public function __construct(FasilitasRepository $fasilitasRepo)
{
$this->fasilitasRepo = $fasilitasRepo;
}
/**
* Display a listing of the resource.
*
......@@ -38,6 +47,15 @@ class FasilitasController extends Controller
public function store(Request $request)
{
//
$data = $request->except('_token');
$data['user_id'] = auth()->user()->id;
$fasilitas = $this->fasilitasRepo->store($data);
$data = [
'fasilitas' => $fasilitas->id,
];
return redirect()->route('user.fasilitas.index', $data);
}
/**
......
......@@ -38,6 +38,7 @@ class PenelitiAsingController extends Controller
public function store(Request $request)
{
//
}
/**
......
<?php
namespace App\Models\User;
use App\Traits\UuidTrait;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
class Fasilitas extends Model
{
use UuidTrait;
public $incrementing = false;
protected $table = 'fasilitas_peralatan';
protected $keyType = 'string';
protected $fillable = [
'id', 'namaunit', 'nosk', 'status', 'fasilitas', 'status_aktif', 'userid_created', 'userid_updated', 'created_at', 'updated_at',
];
}
<?php
namespace App\Models\User;
use App\Traits\UuidTrait;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
class PenelitiAsing extends Model
{
use HasFactory;
use UuidTrait;
public $incrementing = false;
protected $table = 'penelitiasing';
protected $keyType = 'string';
protected $fillable = [
'id', 'nama', 'jenis_kelamin', 'institusi', 'negara', 'pendidikan', 'bidang', 'lamatinggal', 'userid_created', 'userid_updated', 'created_at', 'updated_at',
];
}
<?php
namespace App\Repositories\User;
use App\Models\User\Fasilitas;
use App\Repositories\Repository;
class FasilitasRepository extends Repository
{
protected $model;
public function __construct(Fasilitas $model)
{
$this->model = $model;
}
public function get($with = null, $search = null, $id = null)
{
return $this->model->when($with, function ($query) use ($with) {
return $query->with($with);
})
->when($search, function ($query) use ($search) {
return $query->where('search', $search);
})
->when($id, function ($query) use ($id) {
return $query->where('id', $id);
})
->get();
}
public function paginate($with = null, $limit = 10, $idlogkeg = null)
{
return Rekognisi::when($with, function ($query) use ($with) {
return $query->with($with);
})
->when($tahun, function ($query) use ($tahun) {
return $query->where('tahun', $tahun);
})
->when($id_kegiatan, function ($query) use ($id_kegiatan) {
return $query->where('id_kegiatan', $id_kegiatan);
})
->paginate($limit);
}
}
<?php
namespace App\Traits;
use Illuminate\Support\Str;
trait UuidTrait
{
/**
* Boot function from Laravel.
*/
protected static function boot()
{
parent::boot();
static::creating(function ($model) {
$model->incrementing = false;
$model->keyType = 'string';
$model->{$model->getKeyName()} = Str::uuid()->toString();
});
}
}
......@@ -13,7 +13,9 @@
"laravel/jetstream": "^2.3",
"laravel/sanctum": "^2.6",
"laravel/tinker": "^2.5",
"laravelcollective/html": "^6.2",
"livewire/livewire": "^2.0",
"realrashid/sweet-alert": "^3.2",
"spatie/laravel-permission": "^4.0"
},
"require-dev": {
......
......@@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically"
],
"content-hash": "12759071f695910ac3033a9e842faa9a",
"content-hash": "ac6994168026997a099333cc5ceabd5f",
"packages": [
{
"name": "asm89/stack-cors",
......@@ -1522,6 +1522,78 @@
"time": "2021-03-02T16:53:12+00:00"
},
{
"name": "laravelcollective/html",
"version": "v6.2.1",
"source": {
"type": "git",
"url": "https://github.com/LaravelCollective/html.git",
"reference": "ae15b9c4bf918ec3a78f092b8555551dd693fde3"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/LaravelCollective/html/zipball/ae15b9c4bf918ec3a78f092b8555551dd693fde3",
"reference": "ae15b9c4bf918ec3a78f092b8555551dd693fde3",
"shasum": ""
},
"require": {
"illuminate/http": "^6.0|^7.0|^8.0",
"illuminate/routing": "^6.0|^7.0|^8.0",
"illuminate/session": "^6.0|^7.0|^8.0",
"illuminate/support": "^6.0|^7.0|^8.0",
"illuminate/view": "^6.0|^7.0|^8.0",
"php": ">=7.2.5"
},
"require-dev": {
"illuminate/database": "^6.0|^7.0|^8.0",
"mockery/mockery": "~1.0",
"phpunit/phpunit": "~8.5"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "6.x-dev"
},
"laravel": {
"providers": [
"Collective\\Html\\HtmlServiceProvider"
],
"aliases": {
"Form": "Collective\\Html\\FormFacade",
"Html": "Collective\\Html\\HtmlFacade"
}
}
},
"autoload": {
"psr-4": {
"Collective\\Html\\": "src/"
},
"files": [
"src/helpers.php"
]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Adam Engebretson",
"email": "adam@laravelcollective.com"
},
{
"name": "Taylor Otwell",
"email": "taylorotwell@gmail.com"
}
],
"description": "HTML and Form Builders for the Laravel Framework",
"homepage": "https://laravelcollective.com",
"support": {
"issues": "https://github.com/LaravelCollective/html/issues",
"source": "https://github.com/LaravelCollective/html"
},
"time": "2020-12-15T20:20:05+00:00"
},
{
"name": "league/commonmark",
"version": "1.5.8",
"source": {
......@@ -2998,6 +3070,96 @@
"time": "2020-08-18T17:17:46+00:00"
},
{
"name": "realrashid/sweet-alert",
"version": "v3.2.2",
"source": {
"type": "git",
"url": "https://github.com/realrashid/sweet-alert.git",
"reference": "2441267a295833480b2c8e55532f4190d1004d47"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/realrashid/sweet-alert/zipball/2441267a295833480b2c8e55532f4190d1004d47",
"reference": "2441267a295833480b2c8e55532f4190d1004d47",
"shasum": ""
},
"require": {
"laravel/framework": "^5.4|^7.0|^8.0",
"php": "^7.2|^8.0"
},
"require-dev": {
"symfony/thanks": "^1.0"
},
"type": "library",
"extra": {
"laravel": {
"providers": [
"RealRashid\\SweetAlert\\SweetAlertServiceProvider"
],
"aliases": {
"Alert": "RealRashid\\SweetAlert\\Facades\\Alert"
}
}
},
"autoload": {
"psr-4": {
"RealRashid\\SweetAlert\\": "src/"
},
"files": [
"src/functions.php"
]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Rashid Ali",
"email": "realrashid05@gmail.com",
"homepage": "https://realrashid.com",
"role": "Developer"
}
],
"description": "A BEAUTIFUL, RESPONSIVE, CUSTOMIZABLE, ACCESSIBLE (WAI-ARIA) REPLACEMENT FOR JAVASCRIPT'S POPUP BOXES FOR LARAVEL BY RASHID ALI",
"homepage": "https://github.com/realrashid/sweet-alert",
"keywords": [
"alert",
"laravel",
"laravel-package",
"notifier",
"noty",
"sweet-alert",
"sweet-alert2",
"toast"
],
"support": {
"docs": "https://realrashid.github.io/sweet-alert/",
"email": "realrashid05@gmail.com",
"issues": "https://github.com/realrashid/sweet-alert/issues",
"source": "https://github.com/realrashid/sweet-alert"
},
"funding": [
{
"url": "https://ko-fi.com/realrashid",
"type": "custom"
},
{
"url": "https://www.buymeacoffee.com/realrashid",
"type": "custom"
},
{
"url": "https://issuehunt.io/r/realrashid",
"type": "issuehunt"
},
{
"url": "https://tidelift.com/funding/github/packagist/realrashid/sweet-alert",
"type": "tidelift"
}
],
"time": "2021-02-17T18:21:20+00:00"
},
{
"name": "spatie/laravel-permission",
"version": "4.0.1",
"source": {
......
......@@ -21,7 +21,8 @@
<div class="row">
<div class="col-xl-12 col-lg-12 col-md-12 layout-spacing">
<form id="contact" class="section contact">
{{ Form::open(['url' => route('fasilitas.store'), 'method' => 'post', 'class' => 'section general-info', 'id' => 'fasilitas']) }}
<meta name="csrf-token" content="{{ csrf_token() }}">
<div class="info">
<h5 class="">Data Unit Fasilitas dan Peralatan Utama Penelitian</h5>
<div class="row">
......@@ -30,22 +31,22 @@
<div class="col-md-6">
<div class="form-group">
<label>Nama Unit</label>
<input type="text" class="form-control mb-4" id="nama_unit" placeholder="Nama Unit">
<input type="text" class="form-control mb-4" id="namaunit" name="namaunit" placeholder="Nama Unit">
</div>
</div>
<div class="col-md-6">
<div class="form-group">
<label>No. SK Penetapan Pendirian</label>
<input type="text" class="form-control mb-4" id="no_sk" placeholder="No. SK Penetapan Pendirian">
<input type="text" class="form-control mb-4" id="nosk" name="nosk" placeholder="No. SK Penetapan Pendirian">
</div>
</div>
<div class="col-md-4">
<div class="form-group">
<label>Pilih Kategori</label>
<select class="form-control" id="kategori">
<option>Belum Terakreditasi / Tersertifikasi</option>
<option>Terakreditasi</option>
<option>Tersertifikasi</option>
<label>Status</label>
<select class="form-control" id="status" name="status">
<option value="Belum Terakreditasi / Tersertifikasi">Belum Terakreditasi / Tersertifikasi</option>
<option value="Terakreditasi">Terakreditasi</option>
<option value="Tersertifikasi">Tersertifikasi</option>
</select>
</div>
</div>
......@@ -53,16 +54,16 @@
</div>
<div class="col-md-12">
<div class="form-group">
<label>Judul</label>
<textarea class="form-control" id="judul" placeholder="Judul" rows="5"></textarea>
<label>Fasilitas & Peralatan Utama</label>
<textarea class="form-control" id="fasilitas" name="fasilitas" placeholder="Fasilitas & Peralatan Utama" rows="5"></textarea>
</div>
</div>
<div class="col-md-4">
<div class="form-group">
<label>Status Aktif</label>
<select class="form-control" id="kategori">
<option>Aktif</option>
<option>Tidak Aktif</option>
<select class="form-control" id="status_aktif" name="status_aktif">
<option value="1">Aktif</option>
<option value="0">Tidak Aktif</option>
</select>
</div>
</div>
......@@ -70,9 +71,7 @@
</div>
</div>
</div>
</form>
</div>
</div>
</div>
</div>
......@@ -83,6 +82,7 @@
<button id="multiple-messages" class="btn btn-primary">Save Changes</button>
</div>
</div>
{{ Form::close() }}
</div>
@endsection
......
......@@ -18,15 +18,14 @@
<div class="col-xl-12 col-lg-12 col-sm-12 layout-spacing">
<div class="widget-content widget-content-area br-6">
<div class="table-responsive mb-4 mt-4">
<a href="{{ url('fasilitas/create') }}" class="btn btn-primary mb-2"><i data-feather="file-plus"></i> Tambah</a>
<table id="zero-config" class="table table-hover" style="width:100%">
<thead>
<tr>
<th>Name</th>
<th>Position</th>
<th>Office</th>
<th>Age</th>
<th>Start date</th>
<th>Salary</th>
<th>Nama Unit</th>
<th>No SK</th>
<th>Status</th>
<th>Aksi</th>
</tr>
</thead>
<tbody>
......@@ -35,112 +34,6 @@
<td>System Architect</td>
<td>Edinburgh</td>
<td>61</td>
<td>2011/04/25</td>
<td>$320,800</td>
</tr>
<tr>
<td>Garrett Winters</td>
<td>Accountant</td>
<td>Tokyo</td>
<td>63</td>
<td>2011/07/25</td>
<td>$170,750</td>
</tr>
<tr>
<td>Ashton Cox</td>
<td>Junior Technical Author</td>
<td>San Francisco</td>
<td>66</td>
<td>2009/01/12</td>
<td>$86,000</td>
</tr>
<tr>
<td>Cedric Kelly</td>
<td>Senior Javascript Developer</td>
<td>Edinburgh</td>
<td>22</td>
<td>2012/03/29</td>
<td>$433,060</td>
</tr>
<tr>
<td>Airi Satou</td>
<td>Accountant</td>
<td>Tokyo</td>
<td>33</td>
<td>2008/11/28</td>
<td>$162,700</td>
</tr>
<tr>
<td>Brielle Williamson</td>
<td>Integration Specialist</td>
<td>New York</td>
<td>61</td>
<td>2012/12/02</td>
<td>$372,000</td>
</tr>
<tr>
<td>Herrod Chandler</td>
<td>Sales Assistant</td>
<td>San Francisco</td>
<td>59</td>
<td>2012/08/06</td>
<td>$137,500</td>
</tr>
<tr>
<td>Rhona Davidson</td>
<td>Integration Specialist</td>
<td>Tokyo</td>
<td>55</td>
<td>2010/10/14</td>
<td>$327,900</td>
</tr>
<tr>
<td>Colleen Hurst</td>
<td>Javascript Developer</td>
<td>San Francisco</td>
<td>39</td>
<td>2009/09/15</td>
<td>$205,500</td>
</tr>
<tr>
<td>Sonya Frost</td>
<td>Software Engineer</td>
<td>Edinburgh</td>
<td>23</td>
<td>2008/12/13</td>
<td>$103,600</td>
</tr>
<tr>
<td>Jena Gaines</td>
<td>Office Manager</td>
<td>London</td>
<td>30</td>
<td>2008/12/19</td>
<td>$90,560</td>
</tr>
<tr>
<td>Quinn Flynn</td>
<td>Support Lead</td>
<td>Edinburgh</td>
<td>22</td>
<td>2013/03/03</td>
<td>$342,000</td>
</tr>
<tr>
<td>Charde Marshall</td>
<td>Regional Director</td>
<td>San Francisco</td>
<td>36</td>
<td>2008/10/16</td>
<td>$470,600</td>
</tr>
<tr>
<td>Haley Kennedy</td>
<td>Senior Marketing Designer</td>
<td>London</td>
<td>43</td>
<td>2012/12/18</td>
<td>$313,500</td>
</tr>
</tbody>
</table>
......
......@@ -18,6 +18,7 @@
<div class="col-xl-12 col-lg-12 col-sm-12 layout-spacing">
<div class="widget-content widget-content-area br-6">
<div class="table-responsive mb-4 mt-4">
<a href="{{ url('penelitiasing/create') }}" class="btn btn-primary mb-2"><i data-feather="file-plus"></i> Tambah</a>
<table id="zero-config" class="table table-hover" style="width:100%">
<thead>
<tr>
......
......@@ -37,9 +37,10 @@ Route::middleware(['auth:sanctum', 'verified'])->group(function () {
Route::get('/get-biodata', [GetDataController::class, 'getBiodata']);
});
Route::middleware(['auth:sanctum', 'verified'])->get('/dashboard', function () {
return view('dashboard');
})->name('dashboard');
Route::group(['middleware' => ['auth:sanctum', 'verified']], function () {
Route::get('/dashboard', function () {
return view('dashboard');
})->name('dashboard');
Route::resource('/bukuajar', BukuAjarController::class);
Route::resource('/fasilitas', FasilitasController::class);
......@@ -52,3 +53,5 @@ Route::resource('/publikasijurnal', PublikasiJurnalController::class);
Route::resource('/penyelengaraseminar', PenyelenggaraanSeminarController::class);
Route::resource('/stafpendukung', StafPendukungController::class);
Route::resource('/unitbisnis', UnitBisnisController::class);
});
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