Commit 7d31c89f authored by reyhannaufalh's avatar reyhannaufalh
Browse files

final lagi

parent 4a89850b
Showing with 669 additions and 248 deletions
+669 -248
......@@ -71,12 +71,9 @@ public function index()
}
}
public function show(Post $post)
{
$urlApi = config('api.api_url');
$post_comments = Comment::latest()->where('post_id', $post->id)->whereNull('parent_id')->get();
$client = new Client([
'headers' => [
......@@ -247,11 +244,125 @@ public function showAdmin(Post $post)
// return response()->json($post);
return response()->json($post);
return view('forum.admin.show', [
'post' => $post->posts,
'post_comments' => $post_comments,
'post_comments' => $post->post_comments,
'title' => 'Detail Diskusi'
]);
} else {
return view('errors.500', [
'message' => '500 Internal Server Error'
]);
}
}
public function indexSuperadmin() {
$urlApi = config('api.api_url');
$client = new Client([
'headers' => [
'Authorization' => 'Bearer ' . session('api_token'),
'Accept' => 'application/json',
],
]);
$response = $client->request('GET', $urlApi . 'units');
$statusCode = $response->getStatusCode();
if($statusCode == 200) {
$units = json_decode($response->getBody());
// return response()->json($units);
return view('forum.superadmin.home', [
'units' => $units->units,
'title' => 'Daftar Ticket'
]);
} else {
return view('errors.500', [
'message' => '500 Internal Server Error'
]);
}
}
public function forumSuperAdmin(Unit $unit) {
$urlApi = config('api.api_url');
$client = new Client([
'headers' => [
'Authorization' => 'Bearer ' . session('api_token'),
'Accept' => 'application/json',
],
]);
$search = request('search');
$categorySearch = request('category');
$orderSearch = request('order_by');
$topicSearch = request('topic');
if($search) {
$responsePosts = $client->request('GET', $urlApi . 'posts/unit/'. $unit->slug .'?search=' . $search);
} else if($categorySearch) {
$responsePosts = $client->request('GET', $urlApi . 'posts/unit/'. $unit->slug .'?category=' . $categorySearch);
} else if($orderSearch) {
$responsePosts = $client->request('GET', $urlApi . 'posts/unit/'. $unit->slug .'?order_by=' . $orderSearch);
} else if($topicSearch) {
$responsePosts = $client->request('GET', $urlApi . 'posts/unit/'. $unit->slug .'?topic=' . $topicSearch);
} else {
$responsePosts = $client->request('GET', $urlApi . 'posts/unit/'. $unit->slug);
}
$statusCodeTickets = $responsePosts->getStatusCode();
$responseCategories = $client->request('GET', $urlApi . 'categories');
$statusCodeCategories = $responseCategories->getStatusCode();
$responseTopics = $client->request('GET', $urlApi . 'topics');
$statusCodeTopics = $responseCategories->getStatusCode();
if($statusCodeTickets == 200 && $statusCodeTopics == 200 && $statusCodeCategories == 200) {
$posts = json_decode($responsePosts->getBody());
$post_categories = json_decode($responseCategories->getBody());
$topics = json_decode($responseTopics->getBody());
$postsData = collect($posts->posts)->paginate(6);
return view('forum.admin.index', [
'title' => 'Forum Diskusi',
'topics' => $topics->topics,
'post_categories' => $post_categories->categories,
'posts' => $postsData
]);
} else {
return view('errors.500', [
'message' => '500 Internal Server Error'
]);
}
}
public function showSuperAdmin(Post $post)
{
$urlApi = config('api.api_url');
$client = new Client([
'headers' => [
'Authorization' => 'Bearer ' . session('api_token'),
'Accept' => 'application/json',
],
]);
$responsePosts = $client->request('GET', $urlApi . 'posts/' . $post->slug);
$statusCode1 = $responsePosts->getStatusCode();
if($statusCode1 == 200) {
$post = json_decode($responsePosts->getBody());
return view('forum.admin.show', [
'post' => $post->posts,
'post_comments' => $post->post_comments,
'title' => 'Detail Diskusi'
]);
} else {
......
<?php
namespace App\Http\Controllers;
use App\Models\Ticket;
use Barryvdh\DomPDF\Facade\Pdf;
use Carbon\Carbon;
use GuzzleHttp\Client;
use Illuminate\Http\Request;
class ReportController extends Controller
{
public function index()
{
return view('report.index', [
'title' => 'Laporan Tiket Aduan',
]);
}
public function store(Request $request)
{
$validatedData = $request->validate([
'start_date' => 'required',
'end_date' => 'required',
]);
$urlApi = config('api.api_url');
$client = new Client();
$response = $client->post($urlApi . 'report', [
'headers' => [
'Authorization' => 'Bearer ' . session('api_token'),
'Accept' => 'application/json',
],
'json' => $validatedData
]);
$ticketData = json_decode($response->getBody());
return view('report.table', [
'ticketData' => $ticketData->ticketData,
'startDate' => $request->start_date,
'endDate' => $request->end_date,
'title' => 'Laporan data tiket',
]);
}
public function exportPdf(Request $request)
{
$validatedData = $request->validate([
'start_date' => 'required',
'end_date' => 'required',
]);
$urlApi = config('api.api_url');
$client = new Client();
$response = $client->post($urlApi . 'report', [
'headers' => [
'Authorization' => 'Bearer ' . session('api_token'),
'Accept' => 'application/json',
],
'json' => $validatedData
]);
$ticketData = json_decode($response->getBody());
$pdf = Pdf::loadView('report.pdf', [
'ticketData' => $ticketData->ticketData,
'startDate' => $request->start_date,
'endDate' => $request->end_date,
'title' => 'Laporan data tiket',
]);
return $pdf->download('data_tiket_'. Carbon::now()->timestamp .'.pdf');
}
}
\ No newline at end of file
......@@ -2,8 +2,6 @@
namespace App\Http\Controllers;
use App\Models\Post;
use App\Models\PostCategory;
use App\Models\Topic;
use Illuminate\Http\Request;
use \Cviebrock\EloquentSluggable\Services\SlugService;
......
......@@ -2,14 +2,8 @@
namespace App\Http\Controllers;
use App\Models\Unit;
use App\Models\User;
use App\Models\UserDetail;
use GuzzleHttp\Client;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Hash;
use Illuminate\Support\Str;
use Illuminate\Validation\Rule;
class UserController extends Controller
{
......@@ -79,47 +73,6 @@ public function store(Request $request)
return redirect('/dashboard/users')->with('toast_error', "User gagal dibuat");
}
}
public function edit(User $user)
{
return view('users.admin.edit', [
'title' => 'Edit User',
'user' => $user
]);
}
public function update(Request $request, User $user)
{
$urlApi = config('api.api_url');
$validatedData = $request->validate([
'nip' => 'required',
'name' => 'required|max:255',
'email' => [
'required',
'email:dns',
Rule::unique('users')->ignore($user->id),
],
]);
$client = new Client();
$response = $client->put($urlApi . 'users/' . $user->id, [
'headers' => [
'Authorization' => 'Bearer ' . session('api_token'),
'Accept' => 'application/json',
],
'json' => $validatedData
]);
$statusCode = $response->getStatusCode();
if($statusCode == 200) {
return redirect('/dashboard/users')->with('toast_success', "User berhasil diupdate");
} else {
return redirect('/dashboard/users')->with('toast_error', "User gagal diupdate");
}
}
public function destroy($id)
{
......@@ -142,11 +95,4 @@ public function destroy($id)
return back()->with('toast_error', "User gagal dihapus");
}
}
public function generatePassword(Request $request)
{
$password = Hash::make(Str::random(10));
return response()->json(['password' => $password]);
}
}
\ No newline at end of file
<?php
namespace App\Http\Controllers;
use Illuminate\Http\Request;
class UserDetailController extends Controller
{
//
}
......@@ -16,134 +16,25 @@
class ViewController extends Controller
{
public function chartData()
{
$startDate = Carbon::now()->subDays(6)->startOfDay();
$endDate = Carbon::now()->endOfDay();
$postHistory = Post::whereBetween('created_at', [$startDate, $endDate])
->groupBy('date')
->orderBy('date')
->get([
DB::raw('DATE(created_at) as date'),
DB::raw('COUNT(*) as count')
]);
$ticketHistory = Ticket::whereBetween('created_at', [$startDate, $endDate])
->groupBy('date')
->orderBy('date')
->get([
DB::raw('DATE(created_at) as date'),
DB::raw('COUNT(*) as count')
]);
if(auth()->user()->role_id == 2) {
$postHistory = Post::whereBetween('created_at', [$startDate, $endDate])
->unit()
->groupBy('date')
->orderBy('date')
->get([
DB::raw('DATE(created_at) as date'),
DB::raw('COUNT(*) as count')
]);
$ticketHistory = Ticket::whereBetween('created_at', [$startDate, $endDate])
->unit()
->groupBy('date')
->orderBy('date')
->get([
DB::raw('DATE(created_at) as date'),
DB::raw('COUNT(*) as count')
]);
}
$labels = [];
$postCounts = [];
$ticketCounts = [];
$currentDate = $startDate;
while ($currentDate <= $endDate) {
$formattedDate = $currentDate->format('Y-m-d');
$labels[] = $formattedDate;
$postCount = $postHistory->firstWhere('date', $formattedDate);
$postCounts[] = $postCount ? $postCount->count : 0;
public function chartData() {
$client = new Client([
'headers' => [
'Authorization' => 'Bearer ' . session('api_token'),
'Accept' => 'application/json',
],
]);
$ticketCount = $ticketHistory->firstWhere('date', $formattedDate);
$ticketCounts[] = $ticketCount ? $ticketCount->count : 0;
$urlApi = config('api.api_url');
$currentDate->addDay();
}
$response = $client->request('GET', $urlApi . 'chart-data');
$statusCode = $response->getStatusCode();
$data = [
'labels' => $labels,
'postCounts' => $postCounts,
'ticketCounts' => $ticketCounts
];
$data = json_decode($response->getBody());
return response()->json($data);
}
// public function chartData()
// {
// $startDate = Carbon::now()->subDays(6)->startOfDay();
// $endDate = Carbon::now()->endOfDay();
// $urlApi = config('api.api_url');
// $client = new Client([
// 'headers' => [
// 'Authorization' => 'Bearer ' . session('api_token'),
// 'Accept' => 'application/json',
// ],
// ]);
// $responseTicket = $client->request('GET', $urlApi . 'tickets');
// $ticketData = json_decode($responseTicket->getBody(), true);
// $responsePosts = $client->request('GET', $urlApi . 'posts');
// $postData = json_decode($responsePosts->getBody(), true);
// $ticketHistory = collect($ticketData['tickets']);
// $postHistory = collect($postData['posts']);
// if (auth()->user()->role_id == 2) {
// $responseTicket = $client->request('GET', $urlApi . 'tickets/unit');
// $ticketData = json_decode($responseTicket->getBody(), true);
// $ticketHistory = collect($ticketData['tickets']);
// $responsePosts = $client->request('GET', $urlApi . 'posts/unit');
// $postData = json_decode($responsePosts->getBody(), true);
// $postHistory = collect($postData['posts']);
// }
// $labels = [];
// $postCounts = [];
// $ticketCounts = [];
// $currentDate = $startDate;
// while ($currentDate <= $endDate) {
// $formattedDate = $currentDate->format('Y-m-d');
// $labels[] = $formattedDate;
// $postCount = $postHistory->where('created_at', 'like', $formattedDate . '%')->count();
// $postCounts[] = $postCount;
// $ticketCount = $ticketHistory->where('created_at', 'like', $formattedDate . '%')->count();
// $ticketCounts[] = $ticketCount;
// $currentDate->addDay();
// }
// $data = [
// 'labels' => $labels,
// 'postCounts' => $postCounts,
// 'ticketCounts' => $ticketCounts
// ];
// return response()->json($data);
// }
public function chartView()
{
return view('dashboard.admin.chart');
......@@ -161,8 +52,6 @@ public function landingPage()
if($statusCode == 200) {
$data = json_decode($response->getBody());
// return response()->json($data);
return view('index', [
'data' => $data,
'title' => 'Service Desk'
......@@ -185,7 +74,7 @@ public function dashboardAdmin()
$urlApi = config('api.api_url');
$response = $client->request('GET', $urlApi . 'counted-data');
$response = $client->request('GET', $urlApi . 'chart-data');
$statusCode = $response->getStatusCode();
$responseTickets = $client->request('GET', $urlApi . 'tickets');
......@@ -194,7 +83,7 @@ public function dashboardAdmin()
$responseTopics = $client->request('GET', $urlApi . 'topics');
$statusCode = $responseTopics->getStatusCode();
$response = $client->request('GET', $urlApi . 'users');
$responseUsers = $client->request('GET', $urlApi . 'users');
$statusCode = $response->getStatusCode();
if($statusCode == 200) {
......@@ -202,7 +91,8 @@ public function dashboardAdmin()
$tickets = json_decode($responseTickets->getBody());
$topics = json_decode($responseTopics->getBody());
$posts = json_decode($responsePosts->getBody());
$users = json_decode($response->getBody());
$users = json_decode($responseUsers->getBody());
return view('dashboard.admin.index', [
'data' => $data,
......
......@@ -10,6 +10,7 @@
"require": {
"php": "^8.1",
"anhskohbo/no-captcha": "^3.5",
"barryvdh/laravel-dompdf": "^2.0",
"cviebrock/eloquent-sluggable": "^10.0",
"guzzlehttp/guzzle": "^7.2",
"itsgoingd/clockwork": "^5.1",
......
......@@ -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": "1db171a9fab0b29eda38c2d33e4079a2",
"content-hash": "a1e7f801cdfb35b08000a7df21b07478",
"packages": [
{
"name": "anhskohbo/no-captcha",
......@@ -70,6 +70,83 @@
},
"time": "2023-02-15T16:07:08+00:00"
},
{
"name": "barryvdh/laravel-dompdf",
"version": "v2.0.1",
"source": {
"type": "git",
"url": "https://github.com/barryvdh/laravel-dompdf.git",
"reference": "9843d2be423670fb434f4c978b3c0f4dd92c87a6"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/barryvdh/laravel-dompdf/zipball/9843d2be423670fb434f4c978b3c0f4dd92c87a6",
"reference": "9843d2be423670fb434f4c978b3c0f4dd92c87a6",
"shasum": ""
},
"require": {
"dompdf/dompdf": "^2.0.1",
"illuminate/support": "^6|^7|^8|^9|^10",
"php": "^7.2 || ^8.0"
},
"require-dev": {
"nunomaduro/larastan": "^1|^2",
"orchestra/testbench": "^4|^5|^6|^7|^8",
"phpro/grumphp": "^1",
"squizlabs/php_codesniffer": "^3.5"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "2.0-dev"
},
"laravel": {
"providers": [
"Barryvdh\\DomPDF\\ServiceProvider"
],
"aliases": {
"Pdf": "Barryvdh\\DomPDF\\Facade\\Pdf",
"PDF": "Barryvdh\\DomPDF\\Facade\\Pdf"
}
}
},
"autoload": {
"psr-4": {
"Barryvdh\\DomPDF\\": "src"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Barry vd. Heuvel",
"email": "barryvdh@gmail.com"
}
],
"description": "A DOMPDF Wrapper for Laravel",
"keywords": [
"dompdf",
"laravel",
"pdf"
],
"support": {
"issues": "https://github.com/barryvdh/laravel-dompdf/issues",
"source": "https://github.com/barryvdh/laravel-dompdf/tree/v2.0.1"
},
"funding": [
{
"url": "https://fruitcake.nl",
"type": "custom"
},
{
"url": "https://github.com/barryvdh",
"type": "github"
}
],
"time": "2023-01-12T15:12:49+00:00"
},
{
"name": "brick/math",
"version": "0.11.0",
......@@ -514,6 +591,68 @@
],
"time": "2022-12-15T16:57:16+00:00"
},
{
"name": "dompdf/dompdf",
"version": "v2.0.3",
"source": {
"type": "git",
"url": "https://github.com/dompdf/dompdf.git",
"reference": "e8d2d5e37e8b0b30f0732a011295ab80680d7e85"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/dompdf/dompdf/zipball/e8d2d5e37e8b0b30f0732a011295ab80680d7e85",
"reference": "e8d2d5e37e8b0b30f0732a011295ab80680d7e85",
"shasum": ""
},
"require": {
"ext-dom": "*",
"ext-mbstring": "*",
"masterminds/html5": "^2.0",
"phenx/php-font-lib": ">=0.5.4 <1.0.0",
"phenx/php-svg-lib": ">=0.3.3 <1.0.0",
"php": "^7.1 || ^8.0"
},
"require-dev": {
"ext-json": "*",
"ext-zip": "*",
"mockery/mockery": "^1.3",
"phpunit/phpunit": "^7.5 || ^8 || ^9",
"squizlabs/php_codesniffer": "^3.5"
},
"suggest": {
"ext-gd": "Needed to process images",
"ext-gmagick": "Improves image processing performance",
"ext-imagick": "Improves image processing performance",
"ext-zlib": "Needed for pdf stream compression"
},
"type": "library",
"autoload": {
"psr-4": {
"Dompdf\\": "src/"
},
"classmap": [
"lib/"
]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"LGPL-2.1"
],
"authors": [
{
"name": "The Dompdf Community",
"homepage": "https://github.com/dompdf/dompdf/blob/master/AUTHORS.md"
}
],
"description": "DOMPDF is a CSS 2.1 compliant HTML to PDF converter",
"homepage": "https://github.com/dompdf/dompdf",
"support": {
"issues": "https://github.com/dompdf/dompdf/issues",
"source": "https://github.com/dompdf/dompdf/tree/v2.0.3"
},
"time": "2023-02-07T12:51:48+00:00"
},
{
"name": "dragonmantank/cron-expression",
"version": "v3.3.2",
......@@ -2038,6 +2177,73 @@
],
"time": "2022-04-17T13:12:02+00:00"
},
{
"name": "masterminds/html5",
"version": "2.8.0",
"source": {
"type": "git",
"url": "https://github.com/Masterminds/html5-php.git",
"reference": "3c5d5a56d56f48a1ca08a0670f0f80c1dad368f3"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/Masterminds/html5-php/zipball/3c5d5a56d56f48a1ca08a0670f0f80c1dad368f3",
"reference": "3c5d5a56d56f48a1ca08a0670f0f80c1dad368f3",
"shasum": ""
},
"require": {
"ext-dom": "*",
"php": ">=5.3.0"
},
"require-dev": {
"phpunit/phpunit": "^4.8.35 || ^5.7.21 || ^6 || ^7 || ^8"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "2.7-dev"
}
},
"autoload": {
"psr-4": {
"Masterminds\\": "src"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Matt Butcher",
"email": "technosophos@gmail.com"
},
{
"name": "Matt Farina",
"email": "matt@mattfarina.com"
},
{
"name": "Asmir Mustafic",
"email": "goetas@gmail.com"
}
],
"description": "An HTML5 parser and serializer.",
"homepage": "http://masterminds.github.io/html5-php",
"keywords": [
"HTML5",
"dom",
"html",
"parser",
"querypath",
"serializer",
"xml"
],
"support": {
"issues": "https://github.com/Masterminds/html5-php/issues",
"source": "https://github.com/Masterminds/html5-php/tree/2.8.0"
},
"time": "2023-04-26T07:27:39+00:00"
},
{
"name": "monolog/monolog",
"version": "3.3.1",
......@@ -2532,6 +2738,96 @@
],
"time": "2023-02-08T01:06:31+00:00"
},
{
"name": "phenx/php-font-lib",
"version": "0.5.4",
"source": {
"type": "git",
"url": "https://github.com/dompdf/php-font-lib.git",
"reference": "dd448ad1ce34c63d09baccd05415e361300c35b4"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/dompdf/php-font-lib/zipball/dd448ad1ce34c63d09baccd05415e361300c35b4",
"reference": "dd448ad1ce34c63d09baccd05415e361300c35b4",
"shasum": ""
},
"require": {
"ext-mbstring": "*"
},
"require-dev": {
"symfony/phpunit-bridge": "^3 || ^4 || ^5"
},
"type": "library",
"autoload": {
"psr-4": {
"FontLib\\": "src/FontLib"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"LGPL-3.0"
],
"authors": [
{
"name": "Fabien Ménager",
"email": "fabien.menager@gmail.com"
}
],
"description": "A library to read, parse, export and make subsets of different types of font files.",
"homepage": "https://github.com/PhenX/php-font-lib",
"support": {
"issues": "https://github.com/dompdf/php-font-lib/issues",
"source": "https://github.com/dompdf/php-font-lib/tree/0.5.4"
},
"time": "2021-12-17T19:44:54+00:00"
},
{
"name": "phenx/php-svg-lib",
"version": "0.5.0",
"source": {
"type": "git",
"url": "https://github.com/dompdf/php-svg-lib.git",
"reference": "76876c6cf3080bcb6f249d7d59705108166a6685"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/dompdf/php-svg-lib/zipball/76876c6cf3080bcb6f249d7d59705108166a6685",
"reference": "76876c6cf3080bcb6f249d7d59705108166a6685",
"shasum": ""
},
"require": {
"ext-mbstring": "*",
"php": "^7.1 || ^8.0",
"sabberworm/php-css-parser": "^8.4"
},
"require-dev": {
"phpunit/phpunit": "^7.5 || ^8.5 || ^9.5"
},
"type": "library",
"autoload": {
"psr-4": {
"Svg\\": "src/Svg"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"LGPL-3.0"
],
"authors": [
{
"name": "Fabien Ménager",
"email": "fabien.menager@gmail.com"
}
],
"description": "A library to read, parse and export to PDF SVG files.",
"homepage": "https://github.com/PhenX/php-svg-lib",
"support": {
"issues": "https://github.com/dompdf/php-svg-lib/issues",
"source": "https://github.com/dompdf/php-svg-lib/tree/0.5.0"
},
"time": "2022-09-06T12:16:56+00:00"
},
{
"name": "phpoption/phpoption",
"version": "1.9.1",
......@@ -3362,6 +3658,59 @@
],
"time": "2023-02-15T07:13:11+00:00"
},
{
"name": "sabberworm/php-css-parser",
"version": "8.4.0",
"source": {
"type": "git",
"url": "https://github.com/sabberworm/PHP-CSS-Parser.git",
"reference": "e41d2140031d533348b2192a83f02d8dd8a71d30"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/sabberworm/PHP-CSS-Parser/zipball/e41d2140031d533348b2192a83f02d8dd8a71d30",
"reference": "e41d2140031d533348b2192a83f02d8dd8a71d30",
"shasum": ""
},
"require": {
"ext-iconv": "*",
"php": ">=5.6.20"
},
"require-dev": {
"codacy/coverage": "^1.4",
"phpunit/phpunit": "^4.8.36"
},
"suggest": {
"ext-mbstring": "for parsing UTF-8 CSS"
},
"type": "library",
"autoload": {
"psr-4": {
"Sabberworm\\CSS\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Raphael Schweikert"
}
],
"description": "Parser for CSS Files written in PHP",
"homepage": "https://www.sabberworm.com/blog/2010/6/10/php-css-parser",
"keywords": [
"css",
"parser",
"stylesheet"
],
"support": {
"issues": "https://github.com/sabberworm/PHP-CSS-Parser/issues",
"source": "https://github.com/sabberworm/PHP-CSS-Parser/tree/8.4.0"
},
"time": "2021-12-11T13:40:54+00:00"
},
{
"name": "spatie/laravel-collection-macros",
"version": "7.12.5",
......
public/ticket-img/07f5a665-855b-4661-bdf2-719bb62ba150.png

380 KB

public/ticket-img/a7c3cc7d-1b86-4316-ad37-2f55de6b1280.png

380 KB

......@@ -44,7 +44,7 @@ class="block p-2.5 w-full text-sm text-gray-900 bg-gray-50 rounded-lg border bor
@enderror
<input type="text" class="" id="slug" name="slug" required
value="{{ $faq->slug }}">
value="{{ $faq->slug }}" hidden>
<div class="w-full flex justify-end mt-6">
......
......@@ -35,7 +35,7 @@
</div>
<!-- END TABS -->
<div class="col-span-12 lg:col-span-9">
@if ($posts)
@if (count($posts))
@include('layouts.components.forum.post')
@else
<div class="flex flex-col justify-center items-center mt-16">
......
......@@ -74,7 +74,7 @@ class="bg-green-100 text-green-800 text-xs md:text-sm font-medium px-3 py-2 md:p
<!-- END COMMENT INPUT -->
@if ($post_comments->count())
@if (count($post_comments))
@include('layouts.components.comments.forum.comment')
@else
<div class="flex place-content-center py-10">
......
@extends('layouts.dashboard')
@section('container')
<div class="p-4 sm:ml-64">
<div class="mt-16">
<div class="grid grid-cols-12 gap-4">
<div class="col-span-12 lg:col-span-8">
@include('layouts.components.breadcumb')
<h2 class="mb-7 text-3xl font-bold leading-none tracking-tight text-gray-900 md:text-4xl ">
Forum Diskusi
</h2>
<div class="relative overflow-x-auto shadow-md sm:rounded-lg">
<table class="w-full text-sm text-left text-gray-500 " id="table">
<thead class="text-xs text-gray-700 uppercase bg-gray-50 ">
<tr>
<th scope="col" class="px-6 py-3">No.</th>
<th scope="col" class="px-6 py-3">Judul</th>
<th scope="col" class="px-6 py-3 text-center">Jumlah aduan (Tiket)</th>
<th scope="col" class="px-6 py-3 text-center">Action</th>
</tr>
</thead>
<tbody>
@foreach ($units as $unit)
<tr class="bg-white border-b">
<th scope="row" class="px-6 py-4 font-medium text-gray-900 whitespace-nowrap ">
{{ $loop->index + 1 }}
</th>
<td class="px-6 py-4">{{ $unit->name }}</td>
<td class="px-6 py-4 text-center">{{ count($unit->posts) ?? '-' }}</td>
<td><a href="/dashboard/superadmin/forum/{{ $unit->slug }}"
class="btn-link mx-6">Pratinjau</a>
</td>
</tr>
@endforeach
</tbody>
</table>
</div>
</div>
<div class="flex col-span-4 items-end justify-center rounded bg-transparent h-96">
</div>
</div>
</div>
</div>
@endsection
......@@ -75,7 +75,7 @@ class="btn-gradient-blue w-full" type="button">
</p>
<!-- POST -->
@if ($posts)
@if (count($posts))
@include('layouts.components.forum.post')
@else
<div class="flex flex-col justify-center items-center mt-16">
......
......@@ -35,7 +35,7 @@ class="px-3 py-2 bg-gray-50 border-b border-gray-200 rounded-t-lg dark:border-gr
class="hidden md:block bg-blue-100 h-fit text-blue-800 text-xs font-medium mr-2 px-2.5 py-1 rounded">Jawaban
Super Admin</span>
<button data-popover-target="popover-default" type="button"
class="text-white bg-blue-700 hover:bg-blue-800 focus:ring-4 focus:outline-none focus:ring-blue-300 rounded-full flex-center w-8 h-8"><i
class="md:hidden text-white bg-blue-700 hover:bg-blue-800 focus:ring-4 focus:outline-none focus:ring-blue-300 rounded-full flex-center w-8 h-8"><i
class="fa-solid fa-star text-xs"></i></button>
<div data-popover id="popover-default" role="tooltip"
class="absolute z-10 invisible inline-block w-fit text-sm text-gray-500 transition-opacity duration-300 bg-white border border-gray-200 rounded-lg shadow-sm opacity-0 dark:text-gray-400 dark:border-gray-600 dark:bg-gray-800">
......
......@@ -37,7 +37,7 @@ class="px-3 py-2 bg-gray-50 border-b border-gray-200 rounded-t-lg dark:border-gr
class="hidden md:block bg-blue-100 h-fit text-blue-800 text-xs font-medium mr-2 px-2.5 py-1 rounded">Jawaban
Super Admin</span>
<button data-popover-target="popover-default" type="button"
class="text-white bg-blue-700 hover:bg-blue-800 focus:ring-4 focus:outline-none focus:ring-blue-300 rounded-full flex-center w-8 h-8"><i
class="md:hidden text-white bg-blue-700 hover:bg-blue-800 focus:ring-4 focus:outline-none focus:ring-blue-300 rounded-full flex-center w-8 h-8"><i
class="fa-solid fa-star text-xs"></i></button>
<div data-popover id="popover-default" role="tooltip"
class="absolute z-10 invisible inline-block w-fit text-sm text-gray-500 transition-opacity duration-300 bg-white border border-gray-200 rounded-lg shadow-sm opacity-0 dark:text-gray-400 dark:border-gray-600 dark:bg-gray-800">
......
......@@ -5,7 +5,7 @@ class="inline-block py-4 px-2 border-b-2 rounded-t-lg {{ !Request::get('category
@foreach ($post_categories as $category)
<li class="mr-2">
<a href="{{ Request::url() }}?category={{ $category->slug }}"
class="inline-block p-4 border-b-2 hover:text-gray-600 hover:border-gray-300 {{ Request::get('category') == $category->slug ? 'text-orange-500 border-orange-500' : '' }} rounded-t-lg ">{{ $category->name }}
class="inline-block min-w-max p-4 border-b-2 hover:text-gray-600 hover:border-gray-300 {{ Request::get('category') == $category->slug ? 'text-orange-500 border-orange-500' : '' }} rounded-t-lg ">{{ $category->name }}
</a>
</li>
@endforeach
......@@ -12,54 +12,61 @@ class="block p-6 bg-white border border-gray-200 rounded-lg shadow hover:bg-gray
class="block p-6 bg-white border border-gray-200 rounded-lg shadow hover:bg-gray-100">
@endcan
<div class="header flex gap-2 align-middle justify-between">
<div class="flex gap-4 mb-6">
<div>
<p class="text-sm font-semibold h-fit text-secondary-700">
{{ $post->user->name }}
</p>
<p class="font-normal text-xs text-secondary-400">
{{ $post->created_at }}
</p>
@can('superadmin')
<a href="/dashboard/superadmin/forum/show/{{ $post->slug }}"
class="block p-6 bg-white border border-gray-200 rounded-lg shadow hover:bg-gray-100">
@endcan
<div class="header flex gap-2 align-middle justify-between">
<div class="flex gap-4 mb-6">
<div>
<p class="text-sm font-semibold h-fit text-secondary-700">
{{ $post->user->name }}
</p>
<p class="font-normal text-xs text-secondary-400">
{{ $post->created_at }}
</p>
</div>
</div>
</div>
<div class="flex items-center gap-2 h-fit">
<div class="hidden md:block">
@if ($post->is_finished)
<span class="bg-green-100 text-green-800 text-sm font-medium px-3 py-1 rounded h-fit">
Selesai</span>
@else
<span class="bg-red-100 text-red-800 text-sm font-medium px-3 py-1 rounded h-fit">Belum
Selesai</span>
@endif
<div class="flex items-center gap-2 h-fit">
<div class="hidden md:block">
@if ($post->is_finished)
<span
class="bg-green-100 text-green-800 text-sm font-medium px-3 py-1 rounded h-fit">
Selesai</span>
@else
<span
class="bg-red-100 text-red-800 text-sm font-medium px-3 py-1 rounded h-fit">Belum
Selesai</span>
@endif
</div>
</div>
</div>
</div>
<h5 class="mb-2 text-xl font-bold tracking-tight text-gray-900">
{{ $post->title }}
</h5>
<p class="font-normal text-gray-700">
{{ $post->excerpt }}
</p>
<h5 class="mb-2 text-xl font-bold tracking-tight text-gray-900">
{{ $post->title }}
</h5>
<p class="font-normal text-gray-700">
{{ $post->excerpt }}
</p>
<!-- FOOTER -->
<div class="flex flex-col sm:flex-row gap-2 mt-6">
<span
class="w-fit flex items-center text-xs font-normal bg-orange-500 text-white px-3 py-1 rounded-lg">{{ $post->category->name }}</span>
<span
class="w-fit flex items-center text-xs font-normal bg-purple-600 text-white px-3 py-1 rounded-lg">{{ $post->topic->title }}</span>
</div>
<div class="block mt-5 md:hidden">
@if ($post->is_finished)
<span class="bg-green-100 text-green-800 text-sm font-medium px-3 py-1 rounded h-fit">
Selesai</span>
@else
<span class="bg-red-100 text-red-800 text-sm font-medium px-3 py-1 rounded h-fit">Belum
Selesai</span>
@endif
</div>
</a>
<!-- FOOTER -->
<div class="flex flex-col sm:flex-row gap-2 mt-6">
<span
class="w-fit flex items-center text-xs font-normal bg-orange-500 text-white px-3 py-1 rounded-lg">{{ $post->category->name }}</span>
<span
class="w-fit flex items-center text-xs font-normal bg-purple-600 text-white px-3 py-1 rounded-lg">{{ $post->topic->title }}</span>
</div>
<div class="block mt-5 md:hidden">
@if ($post->is_finished)
<span class="bg-green-100 text-green-800 text-sm font-medium px-3 py-1 rounded h-fit">
Selesai</span>
@else
<span class="bg-red-100 text-red-800 text-sm font-medium px-3 py-1 rounded h-fit">Belum
Selesai</span>
@endif
</div>
</a>
@endforeach
{{-- @else
<p class="text-center fs-4 mt-5">Belum ada diskusi.</p>
......
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