my changes
This commit is contained in:
parent
28301e4312
commit
8dc1f1b048
263 changed files with 36882 additions and 4453 deletions
|
@ -1,57 +1,42 @@
|
|||
<?php namespace App\Http\Controllers;
|
||||
<?php
|
||||
|
||||
use App\Http\Requests;
|
||||
use App\Http\Controllers\Controller;
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use App\Dataset;
|
||||
use App\Book;
|
||||
use App\Category;
|
||||
use App\Shelf;
|
||||
use App\Periode;
|
||||
use App\Student;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\View\View;
|
||||
|
||||
class PagesController extends Controller {
|
||||
class PagesController extends Controller
|
||||
{
|
||||
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
// $this->middleware('auth');
|
||||
}
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
|
||||
$this->middleware('auth');
|
||||
|
||||
|
||||
}
|
||||
|
||||
public function index()
|
||||
{
|
||||
$tglSekarang = time();
|
||||
|
||||
$students = Student::get();
|
||||
|
||||
foreach ($students as $student) {
|
||||
|
||||
$dateDiff = $tglSekarang - $student['registered_at'];
|
||||
$durasi = floor($dateDiff/(60 * 60 * 24));
|
||||
$periode = Periode::first();
|
||||
if($durasi > $periode['days']){
|
||||
$student->update(['status' => 0]);
|
||||
}
|
||||
else{
|
||||
$student->update(['status' => 1]);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return view('lms.index');
|
||||
|
||||
}
|
||||
|
||||
public function books()
|
||||
{
|
||||
|
||||
$books = Book::with('category', 'shelf')->orderByTitle()->get();
|
||||
|
||||
return view('lms.books', compact('books'));
|
||||
|
||||
}
|
||||
public function documents() : View
|
||||
{
|
||||
// $books = Book::with('category', 'shelf')->orderByTitle()->get();
|
||||
$documents = Dataset::orderByType()->get();
|
||||
return view('rdr.document.documents', compact('documents'));
|
||||
}
|
||||
|
||||
/**
|
||||
* Display the specified resource.
|
||||
*
|
||||
* @param int $id
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function show($id): View
|
||||
{
|
||||
$document = Dataset::findOrFail($id);
|
||||
$document->load('titles');
|
||||
$document->load('abstracts');
|
||||
return view('rdr.document.show', compact('document'));
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
editor.link_modal.header
Reference in a new issue