Commit 8d1ce446 by Aan Choesni Herlingga

front archive

parent 44f6f30d
<?php
namespace App\Http\Controllers\Webprofile\Front;
use App\Http\Controllers\Controller;
use App\Models\Webprofile\Categories;
use App\Models\Webprofile\Design;
use App\Models\Webprofile\Menu;
use App\Models\Webprofile\Posts;
use Session;
class ArchiveController extends Controller
{
public function index()
{
$setting = webprofilesetting();
if (!Session::has('selected_language')) {
session(['selected_language' => 'id']);
}
if (Session::get('selected_language') == 'id') {
$data = $this->getDataId($setting);
return view('webprofile.front.' . $setting['theme'] . '.archive', $data)->withTitle('Arsip');
} else if (Session::get('selected_language') == 'en') {
$data = $this->getDataEn($setting);
return view('webprofile.front.' . $setting['theme'] . '.en.archive', $data)->withTitle('Archive');
}
}
public function getDataId($setting)
{
$setting = webprofilesetting();
$data = $data = Posts::where('post_status', '1')->orderBy('post_date', 'desc')->paginate($setting['post_per_page']);
$resend = Posts::where('post_status', '1')->orderby('post_date', 'desc')->limit('5')->get();
$hot = Posts::where('post_status', '1')->orderby('viewer', 'desc')->limit('5')->get();
$categories = Categories::where('is_active', '1')->get();
$menu = Menu::orderby('urutan', 'asc')->get();
$widget_right = Design::where('name_design', 'widget_right')->orderBy('urutan', 'ASC')->get();
$widget_left = Design::where('name_design', 'widget_left')->orderBy('urutan', 'ASC')->get();
$data = [
'setting' => $setting,
'data' => $data,
'menu' => $menu,
'widget_right' => $widget_right,
'widget_left' => $widget_left,
'resend' => $resend,
'hot' => $hot,
'categories' => $categories,
];
return $data;
}
public function getDataEn($setting)
{
$setting = webprofilesetting();
$data = $data = Posts::where('post_status', '1')->orderBy('post_date', 'desc')->paginate($setting['post_per_page']);
$resend = Posts::with(['rEn'])->where('post_status', '1')->orderby('post_date', 'desc')->limit('5')->get();
$hot = Posts::with(['rEn'])->where('post_status', '1')->orderby('viewer', 'desc')->limit('5')->get();
$categories = Categories::with(['rEn'])->where('is_active', '1')->get();
$menu = Menu::with(['rEn'])->orderby('urutan', 'asc')->get();
$widget_right = Design::where('name_design', 'widget_right')->orderBy('urutan', 'ASC')->get();
$widget_left = Design::where('name_design', 'widget_left')->orderBy('urutan', 'ASC')->get();
$data = [
'setting' => $setting,
'data' => $data,
'menu' => $menu,
'widget_right' => $widget_right,
'widget_left' => $widget_left,
'resend' => $resend,
'hot' => $hot,
'categories' => $categories,
];
return $data;
}
}
@extends('webprofile.front.jollyany.master')
@section('content')
<section class="post-wrapper-top jt-shadow clearfix">
<div class="container">
<div class="col-lg-12">
<h2>{!! $title !!}</h2>
</div>
</div>
</section><!-- end post-wrapper-top -->
<section class="blog-wrapper">
<div class="container">
<div class="row">
<div id="content" class="col-lg-8 col-md-8 col-sm-12 col-xs-12">
<div class="row">
<div class="blog-masonry">
<div class="col-lg-12">
<div class="blog-carousel">
<div class="">
<div class="flexslider">
@foreach($data as $value)
@if ($title != 'Agenda')
<div class="row">
<div class="headline">
<h2><a href="{!! url('post/'.$value->slug) !!}">{!! $value->title !!}</a></h2>
</div>
<div class="news-text">
<div class="col-lg-4">
<a href="{!! url('post/'.str_replace(' ', '-', $value->title)) !!}">
@if($value->thumbnail)
@if ($setting['external_storage'] == 1)
<img src="{{ $setting['url_static'] . '/' . $setting['directory'] . '/thumbnail/' . $value->thumbnail }}" style="max-width:200px" align="left" class="img-responsive">
@else
<img src="{{ url('/storage/thumbnail/' . $value->thumbnail) }}" style="max-width:200px" align="left" class="img-responsive">
@endif
@else
<img style="max-width:200px" align="left" class="img-responsive" src="https://www.unesa.ac.id/assets/switcher/images/logo.png">
@endif
</a>
</div>
<strong>{!! InseoHelper::tglbulanindo2($value->post_date) !!}</strong>
<p>{!! strip_tags(substr(html_entity_decode($value->content,ENT_COMPAT,"UTF-8"),0 , 250)) !!}</p>
<br>
<a class="pull-right" style="padding-right: 20px;" href="{!! url('post/'.$value->slug) !!}">Selengkapnya &raquo;&raquo;</a>
</div>
</div>
@else
<div class="row">
<div class="headline">
<h2><a target="_blank" href="{!! url('info/'.$value->slug) !!}">{!! $value->title !!}</a></h2>
</div>
<div class="news-text">
<strong> {!! InseoHelper::tglbulanindo2($value->event_date) !!}</strong> —
{!! strip_tags(substr(html_entity_decode($value->content,ENT_COMPAT,"UTF-8"),0 , 250)) !!}
<br><a target="_blank" href="{!! url('info/'.$value->slug) !!}">
Selengkapnya »»</a>
</div>
</div>
@endif
@endforeach
</div>
<div class="clearfix"></div>
<hr>
{!! $data->render() !!}
</div><!-- end post-slider -->
</div><!-- end entry -->
</div><!-- end blog-carousel -->
</div><!-- end blog-masonry -->
</div><!-- end widget -->
</div><!-- end left-sidebar -->
@include('webprofile.front.jollyany.widget')
</div>
</div><!-- end container -->
</section><!--end white-wrapper -->
@endsection
@extends('webprofile.front.jollyany.master')
@section('content')
<section class="post-wrapper-top jt-shadow clearfix">
<div class="container">
<div class="col-lg-12">
<h2>{!! $title !!}</h2>
</div>
</div>
</section><!-- end post-wrapper-top -->
<section class="blog-wrapper">
<div class="container">
<div class="row">
<div id="content" class="col-lg-8 col-md-8 col-sm-12 col-xs-12">
<div class="row">
<div class="blog-masonry">
<div class="col-lg-12">
<div class="blog-carousel">
<div class="">
<div class="flexslider">
@foreach($data as $value)
@if ($title != 'Agenda')
<div class="row">
<div class="headline">
<h2><a href="{!! url('post/'.$value->slug) !!}">{!! $value->rEn->title !!}</a></h2>
</div>
<div class="news-text">
<div class="col-lg-4">
<a href="{!! url('post/'.str_replace(' ', '-', $value->title)) !!}">
@if($value->thumbnail)
@if ($setting['external_storage'] == 1)
<img src="{{ $setting['url_static'] . '/' . $setting['directory'] . '/thumbnail/' . $value->thumbnail }}" style="max-width:200px" align="left" class="img-responsive">
@else
<img src="{{ url('/storage/thumbnail/' . $value->thumbnail) }}" style="max-width:200px" align="left" class="img-responsive">
@endif
@else
<img style="max-width:200px" align="left" class="img-responsive" src="https://www.unesa.ac.id/assets/switcher/images/logo.png">
@endif
</a>
</div>
<strong>{!! InseoHelper::tglbulanindo2($value->post_date) !!}</strong>
<p>{!! strip_tags(substr(html_entity_decode($value->rEn->content,ENT_COMPAT,"UTF-8"),0 , 250)) !!}</p>
<br>
<a class="pull-right" style="padding-right: 20px;" href="{!! url('post/'.$value->slug) !!}">Read more &raquo;&raquo;</a>
</div>
</div>
@else
<div class="row">
<div class="headline">
<h2><a target="_blank" href="{!! url('info/'.$value->slug) !!}">{!! $value->rEn->title !!}</a></h2>
</div>
<div class="news-text">
<strong> {!! InseoHelper::tglbulanindo2($value->event_date) !!}</strong> —
{!! strip_tags(substr(html_entity_decode($value->content,ENT_COMPAT,"UTF-8"),0 , 250)) !!}
<br><a target="_blank" href="{!! url('info/'.$value->slug) !!}">
Read more »»</a>
</div>
</div>
@endif
@endforeach
</div>
<div class="clearfix"></div>
<hr>
{!! $data->render() !!}
</div><!-- end post-slider -->
</div><!-- end entry -->
</div><!-- end blog-carousel -->
</div><!-- end blog-masonry -->
</div><!-- end widget -->
</div><!-- end left-sidebar -->
@include('webprofile.front.jollyany.en.widget')
</div>
</div><!-- end container -->
</section><!--end white-wrapper -->
@endsection
......@@ -3,7 +3,7 @@ Route::group(['namespace' => 'Webprofile\Front'], function () {
Route::get('/', 'FrontController@index');
Route::get('page/{id}', 'PageController@index')->name('page');
Route::get('post/{id}', 'PostController@index')->name('post');
Route::get('archive', 'FrontController@archive')->name('archive');
Route::get('archive', 'ArchiveController@index')->name('archive');
Route::get('category/{id}','FrontController@category')->name('category');
Route::get('info/{id}', 'FrontController@info')->name('infomation');
Route::get('agenda', 'FrontController@agenda')->name('agenda');
......
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