feat: media order
This commit is contained in:
parent
52dd954e54
commit
382c066c2f
@ -66,7 +66,7 @@ public function accept(Request $request, $id){
|
||||
// dd($mediaCooperation->pivot);
|
||||
|
||||
// Pastikan data yang ingin diperbarui ada dan statusnya belum '3'
|
||||
if ($mediaCooperation->pivot->status != '3') {
|
||||
if ($mediaCooperation->pivot->status == '0') {
|
||||
$affectedRows = $cooperation->media()->updateExistingPivot($mediaCooperation->id, [
|
||||
'status' => '1',
|
||||
]);
|
||||
@ -74,7 +74,7 @@ public function accept(Request $request, $id){
|
||||
if ($affectedRows > 0) {
|
||||
return redirect()->back()->with('success-status', 'Berhasil menerima kerjasama.');
|
||||
} else {
|
||||
return redirect()->back()->with('failed-status', 'Gagal menerima kerjasama');
|
||||
return redirect()->back()->with('failed-status', 'Gagal menerima kerjasama.');
|
||||
}
|
||||
} else {
|
||||
return redirect()->back()->with('failed-status', 'Kerjasama sudah diterima sebelumnya.');
|
||||
@ -82,14 +82,14 @@ public function accept(Request $request, $id){
|
||||
|
||||
}
|
||||
|
||||
public function proposal($id){
|
||||
public function createProposal($id){
|
||||
$cooperation = Cooperation::with(['media'])->findOrFail(decrypt_id($id));
|
||||
|
||||
$mediaCooperationPivot = $cooperation->media()
|
||||
->where('media.id', Auth::user()->company->media->id)
|
||||
->first()->pivot;
|
||||
|
||||
return view('dashboard.cooperation-requests.proposal', [
|
||||
return view('dashboard.cooperation-requests.create-proposal', [
|
||||
'title' => 'Ajukan Kerjasama',
|
||||
'user' => Auth::user(),
|
||||
'cooperation' => $cooperation,
|
||||
@ -97,7 +97,7 @@ public function proposal($id){
|
||||
]);
|
||||
}
|
||||
|
||||
public function proposalAction(JournalistCooperationProposalRequest $request, $id){
|
||||
public function storeProposal(JournalistCooperationProposalRequest $request, $id){
|
||||
$validatedData = $request->validated();
|
||||
$validatedData['cooperation_id'] = decrypt_id($id);
|
||||
$validatedData['media_id'] = Auth::user()->company->media->id;
|
||||
|
||||
@ -16,7 +16,9 @@
|
||||
use App\Models\Location;
|
||||
use App\Models\Media;
|
||||
use App\Models\MediaMonitoring;
|
||||
use App\Models\MediaOrder;
|
||||
use App\Models\News;
|
||||
use App\Models\Order;
|
||||
use App\Models\Role;
|
||||
use App\Models\SubClassification;
|
||||
use App\Models\SubLocation;
|
||||
@ -812,7 +814,16 @@ public function journalist(Request $request){
|
||||
public function cooperation(Request $request){
|
||||
if ($request->ajax()) {
|
||||
|
||||
$data = Cooperation::with(['media'])->get();
|
||||
if(is_role(['1'])){
|
||||
$data = Cooperation::with(['media', 'mediaOrder'])->get();
|
||||
}else if(is_role(['3'])){
|
||||
$mediaId = Auth::user()->company->media->id;
|
||||
$media = Media::findOrFail($mediaId);
|
||||
$data = $media->cooperations->filter(function ($cooperation) use ($mediaId){
|
||||
// Filter cooperation berdasarkan status proposal yang 1
|
||||
return $cooperation->proposals->where('status', 1)->where('media_id', $mediaId)->isNotEmpty();
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
return DataTables::of($data)
|
||||
@ -820,18 +831,33 @@ public function cooperation(Request $request){
|
||||
->addColumn('name', function ($data) {
|
||||
return '<div style="width: 100%;word-wrap: break-word; white-space: normal;">' . $data->name . '</div>';
|
||||
})
|
||||
->addColumn('start_date', function ($data) {
|
||||
return idn_date($data->start_date, 'l, d F Y');
|
||||
})
|
||||
->addColumn('end_date', function ($data) {
|
||||
return idn_date($data->end_date, 'l, d F Y');
|
||||
})
|
||||
// ->addColumn('start_date', function ($data) {
|
||||
// return idn_date($data->start_date, 'l, d F Y');
|
||||
// })
|
||||
// ->addColumn('end_date', function ($data) {
|
||||
// return idn_date($data->end_date, 'l, d F Y');
|
||||
// })
|
||||
->addColumn('posted_at', function ($data) {
|
||||
return idn_date($data->created_at, 'l, d F Y');
|
||||
})
|
||||
->addColumn('status', function ($data) {
|
||||
$isHaveMediaOrder = !is_null($data->mediaOrder);
|
||||
if ($isHaveMediaOrder) {
|
||||
return '<span class="badge bg-info" style="display:inline-block;font-size:0.8rem;">Media Order</span> <br> <span class="badge bg-primary" style="display:inline-block;font-size:0.8rem;">Sudah Media Order</span>';
|
||||
}else{
|
||||
return '<span class="badge bg-info" style="display:inline-block;font-size:0.8rem;">Pengajuan Kerjasama</span> <br> <span class="badge bg-warning" style="display:inline-block;font-size:0.8rem;">Belum Media Order</span>';
|
||||
}
|
||||
})
|
||||
->addColumn('action', function ($data) {
|
||||
|
||||
$isHaveMediaOrder = $data->mediaorder;
|
||||
|
||||
$showUrl = route('dashboard.cooperations.show', ['id' => encrypt_id($data->id)]);
|
||||
|
||||
$processUrl = route('dashboard.cooperations.process', ['id' => encrypt_id($data->id), 'process' => 'cooperation']);
|
||||
|
||||
$createMediaOrderUrl = route('dashboard.media.orders.create', ['id' => encrypt_id($data->id)]);
|
||||
|
||||
$proposalsUrl = route('dashboard.cooperations.media.proposal', ['id' => encrypt_id($data->id)]);
|
||||
|
||||
$editUrl = route('dashboard.cooperations.edit', ['id' => encrypt_id($data->id)]);
|
||||
@ -844,6 +870,14 @@ public function cooperation(Request $request){
|
||||
<ul class="link-list-opt">
|
||||
<li><a href="'.$showUrl.'"><em class="icon ni ni-eye"></em><span>Detail</span></a></li>';
|
||||
|
||||
if (is_role([1, 3])) {
|
||||
$dropdown .= '<li><a href="'.$processUrl.'"><em class="icon ni ni-loader"></em><span>Proses</span></a></li>';
|
||||
}
|
||||
|
||||
if (is_role([1]) && !$isHaveMediaOrder) {
|
||||
$dropdown .= '<li><a href="'.$createMediaOrderUrl.'"><em class="icon ni ni-plus"></em><span>Buat Media Order</span></a></li>';
|
||||
}
|
||||
|
||||
if (is_role([1])) {
|
||||
$dropdown .= '<li><a href="'.$proposalsUrl.'"><em class="icon ni ni-file-docs"></em><span>Data Pengajuan</span></a></li>';
|
||||
}
|
||||
@ -864,7 +898,7 @@ public function cooperation(Request $request){
|
||||
return $dropdown;
|
||||
})
|
||||
|
||||
->rawColumns(['name', 'action'])
|
||||
->rawColumns(['status', 'name', 'action'])
|
||||
->make(true);
|
||||
}
|
||||
|
||||
@ -1192,6 +1226,55 @@ public function mediaProposal(Request $request){
|
||||
|
||||
}
|
||||
|
||||
public function orderMedia(Request $request, $id){
|
||||
if ($request->ajax()) {
|
||||
$cooperation = Cooperation::with(['media', 'mediaOrder.media'])->where('id', '=', decrypt_id($id))->first();
|
||||
|
||||
$data = $cooperation->mediaOrder->media;
|
||||
|
||||
return DataTables::of($data)
|
||||
->addIndexColumn()
|
||||
->addColumn('media_name', function ($data) {
|
||||
return $data->name;
|
||||
})
|
||||
->addColumn('company_name', function ($data) {
|
||||
return $data->company->name;
|
||||
})
|
||||
->addColumn('email', function ($data) {
|
||||
return $data->company->email;
|
||||
})
|
||||
->addColumn('type', function ($data) {
|
||||
return ucfirst($data->type);
|
||||
})
|
||||
->addColumn('classification', function ($data) {
|
||||
return ucfirst($data->classification);
|
||||
})
|
||||
->addColumn('status', function ($data) use ($cooperation) {
|
||||
switch($data->pivot->status){
|
||||
case 0:
|
||||
return '<span class="badge bg-warning" style="display:inline-block;font-size:0.8rem;">Menunggu</span>';
|
||||
case 1:
|
||||
return '<span class="badge bg-success" style="display:inline-block;font-size:0.8rem;">Menerima</span>';
|
||||
case 2:
|
||||
return '<span class="badge bg-danger" style="display:inline-block;font-size:0.8rem;">Menolak</span> <span class="badge bg-transparent"><a href="javascript:void(0);"
|
||||
class="text-dark"
|
||||
onclick="showDetail('.htmlspecialchars(json_encode(strip_tags($data->pivot->rejection_reason))).')"
|
||||
style="margin-top:0.2rem;">
|
||||
<em class="icon ni ni-eye"></em>
|
||||
</a></span>';
|
||||
case 3:
|
||||
return '<span class="badge bg-secondary" style="display:inline-block;font-size:0.8rem;">Tidak Diketahui</span>';
|
||||
}
|
||||
})
|
||||
|
||||
->rawColumns(['link', 'address', 'status'])
|
||||
->make(true);
|
||||
}
|
||||
|
||||
return response()->json(['error' => 'Unauthorized'], 401);
|
||||
|
||||
}
|
||||
|
||||
public function contentRecap(Request $request){
|
||||
if ($request->ajax()) {
|
||||
|
||||
|
||||
@ -7,6 +7,7 @@
|
||||
use App\Models\Cooperation;
|
||||
use App\Models\CooperationProposal;
|
||||
use App\Models\Media;
|
||||
use App\Models\MediaOrder;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
|
||||
@ -160,5 +161,43 @@ public function mediaProposalRejectAction(Request $request, $id, $proposalId){
|
||||
|
||||
}
|
||||
|
||||
public function process($id, $process){
|
||||
$mediaCooperation = Cooperation::with(['media', 'mediaOrder.media'])->findOrFail(decrypt_id($id));
|
||||
$data = [
|
||||
'title' => 'Detail Kerjasama',
|
||||
'process' => $process,
|
||||
'mediaCooperation' => $mediaCooperation,
|
||||
];
|
||||
|
||||
if($process === 'cooperation'){
|
||||
$data['title'] = 'Detail Kerjasama';
|
||||
$data['mediaOrder'] = $mediaCooperation->mediaOrder;
|
||||
|
||||
if(is_role(['3'])){
|
||||
$mediaId = Auth::user()->company->media->id;
|
||||
$mediaOrder = $mediaCooperation->mediaOrder->media->where('id', $mediaId)->first();
|
||||
if($mediaOrder){
|
||||
$data['mediaOrderPivot'] = $mediaOrder->pivot;
|
||||
}else{
|
||||
return redirect()->back()->with('warning-status', 'Mohon maaf, admin telah menerbitkan media order!');
|
||||
}
|
||||
}
|
||||
|
||||
return view('dashboard.media-cooperations.processes.cooperations.index', $data);
|
||||
}else if($process === 'media-order'){
|
||||
$data['title'] = 'Media Order';
|
||||
|
||||
if(is_role(['3'])){
|
||||
$data['mediaOrder'] = $mediaCooperation->mediaOrder;
|
||||
$mediaId = Auth::user()->company->media->id;
|
||||
$data['mediaOrderPivot'] = $mediaCooperation->mediaOrder->media->where('id', $mediaId)->first()->pivot;
|
||||
}else{
|
||||
$data['mediaOrder'] = $mediaCooperation->mediaOrder;
|
||||
}
|
||||
|
||||
return view('dashboard.media-cooperations.processes.media-orders.index', $data);
|
||||
}
|
||||
}
|
||||
|
||||
public function destroy(){}
|
||||
}
|
||||
|
||||
154
app/Http/Controllers/Dashboard/MediaOrderController.php
Normal file
154
app/Http/Controllers/Dashboard/MediaOrderController.php
Normal file
@ -0,0 +1,154 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Dashboard;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Http\Requests\OrderRequest;
|
||||
use App\Models\Cooperation;
|
||||
use App\Models\Media;
|
||||
use App\Models\Order;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
|
||||
class MediaOrderController extends Controller
|
||||
{
|
||||
public function create($id){
|
||||
$cooperation = Cooperation::findOrFail(decrypt_id($id));
|
||||
$media = $cooperation->proposals->where('status', '1')->pluck('media_id');
|
||||
|
||||
return view('dashboard.media-orders.create', [
|
||||
'title' => 'Buat Media Order',
|
||||
'cooperation' => $cooperation,
|
||||
'media' => Media::all(),
|
||||
'acceptedMedia' => $media
|
||||
]);
|
||||
}
|
||||
|
||||
public function store(OrderRequest $request, $id){
|
||||
$validatedData = $request->validated();
|
||||
$validatedData['enhancer_id'] = Auth::id();
|
||||
$validatedData['image'] = store_file($validatedData['image'], '/uploads/media-orders', 'public')['randomFileName'];
|
||||
|
||||
$cooperation = Cooperation::findOrFail(decrypt_id($id));
|
||||
$validatedData['cooperation_id'] = $cooperation->id;
|
||||
|
||||
$createdOrder = Order::create($validatedData);
|
||||
$createdOrder->media()->attach($validatedData['media_ids']);
|
||||
|
||||
if ($createdOrder->media()->count() > 0) {
|
||||
return redirect()->back()->with('success-status', 'Berhasil membuat media order.');
|
||||
} else {
|
||||
return redirect()->back()->with('failed-status', 'Gagal membuat media order');
|
||||
}
|
||||
}
|
||||
|
||||
public function edit($id){
|
||||
// $cooperation = Cooperation::findOrFail(decrypt_id($id));
|
||||
|
||||
$mediaOrder = Order::findOrFail(decrypt_id($id));
|
||||
$media = $mediaOrder->cooperation->proposals->where('status', '1')->pluck('media_id');
|
||||
|
||||
// dd($mediaOrder->media->pluck('id'));
|
||||
|
||||
return view('dashboard.media-orders.edit', [
|
||||
'title' => 'Buat Media Order',
|
||||
'cooperation' => $mediaOrder->cooperation,
|
||||
'mediaOrder' => $mediaOrder,
|
||||
'media' => Media::all(),
|
||||
'acceptedMedia' => $media,
|
||||
'acceptedMediaNow' => $mediaOrder->media->pluck('id')
|
||||
]);
|
||||
}
|
||||
|
||||
public function update(OrderRequest $request, $id){
|
||||
$validatedData = $request->validated();
|
||||
$validatedData['enhancer_id'] = Auth::id();
|
||||
|
||||
$mediaOrder = Order::findOrFail(decrypt_id($id));
|
||||
|
||||
$validatedData['cooperation_id'] = $mediaOrder->cooperation_id;
|
||||
|
||||
if($request->hasFile('image')){
|
||||
$validatedData['image'] = store_file($validatedData['image'], '/uploads/media-orders', 'public')['randomFileName'];
|
||||
|
||||
delete_file('app/public/uploads/media-orders/'.$mediaOrder->image);
|
||||
}else{
|
||||
$validatedData['image'] = $mediaOrder->image;
|
||||
}
|
||||
|
||||
$mediaOrder->update($validatedData);
|
||||
|
||||
if ($request->has('media_ids')) {
|
||||
$mediaOrder->media()->sync($validatedData['media_ids']);
|
||||
}
|
||||
|
||||
if ($mediaOrder->media()->exists()) {
|
||||
return redirect()->back()->with('success-status', 'Berhasil mengubah media order.');
|
||||
} else {
|
||||
return redirect()->back()->with('failed-status', 'Gagal mengubah media order');
|
||||
}
|
||||
}
|
||||
|
||||
public function accept(Request $request, $id){
|
||||
if(!Auth::check() || Auth::user()->role_id !== 3){
|
||||
return abort(403, 'Unauthorized action.');
|
||||
}
|
||||
|
||||
$order = Order::with('media')->findOrFail(decrypt_id($id));
|
||||
|
||||
$mediaOrder = $order->media()
|
||||
->where('media.id', Auth::user()->company->media->id)
|
||||
->first();
|
||||
|
||||
if (!$mediaOrder) {
|
||||
return abort(404, 'Media not found for the cooperation.');
|
||||
}
|
||||
|
||||
if ($mediaOrder->pivot->status == '0') {
|
||||
$affectedRows = $order->media()->updateExistingPivot($mediaOrder->id, [
|
||||
'status' => '1',
|
||||
]);
|
||||
|
||||
if ($affectedRows > 0) {
|
||||
return redirect()->back()->with('success-status', 'Berhasil menerima media order.');
|
||||
} else {
|
||||
return redirect()->back()->with('failed-status', 'Gagal menerima media order.');
|
||||
}
|
||||
} else {
|
||||
return redirect()->back()->with('failed-status', 'Kerjasama sudah diterima sebelumnya.');
|
||||
}
|
||||
}
|
||||
|
||||
public function reject(Request $request, $id){
|
||||
$validatedData = $request->validate([
|
||||
'rejection_reason' => ['required'],
|
||||
], [
|
||||
'rejection_reason.required' => 'Alasan penolakan wajib diisi.',
|
||||
]);
|
||||
|
||||
$order = Order::with('media')->findOrFail(decrypt_id($id));
|
||||
|
||||
$mediaOrder = $order->media()
|
||||
->where('media.id', Auth::user()->company->media->id)
|
||||
->first();
|
||||
|
||||
if (!$mediaOrder) {
|
||||
return abort(404, 'Media not found for the cooperation.');
|
||||
}
|
||||
|
||||
if ($mediaOrder->pivot->status == '0') {
|
||||
$affectedRows = $order->media()->updateExistingPivot($mediaOrder->id, [
|
||||
'status' => '2',
|
||||
'rejection_reason' => $validatedData['rejection_reason']
|
||||
]);
|
||||
|
||||
if ($affectedRows > 0) {
|
||||
return redirect()->back()->with('success-status', 'Berhasil menolak media order.');
|
||||
} else {
|
||||
return redirect()->back()->with('failed-status', 'Gagal menolak media order.');
|
||||
}
|
||||
} else {
|
||||
return redirect()->back()->with('failed-status', 'Kerjasama sudah diterima sebelumnya.');
|
||||
}
|
||||
}
|
||||
}
|
||||
35
app/Http/Requests/OrderRequest.php
Normal file
35
app/Http/Requests/OrderRequest.php
Normal file
@ -0,0 +1,35 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Requests;
|
||||
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
|
||||
class OrderRequest extends FormRequest
|
||||
{
|
||||
/**
|
||||
* Determine if the user is authorized to make this request.
|
||||
*/
|
||||
public function authorize(): bool
|
||||
{
|
||||
return Auth::check() && is_role(['1']);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the validation rules that apply to the request.
|
||||
*
|
||||
* @return array<string, \Illuminate\Contracts\Validation\ValidationRule|array<mixed>|string>
|
||||
*/
|
||||
public function rules(): array
|
||||
{
|
||||
return [
|
||||
'start_date' => ['required', 'date'],
|
||||
'end_date' => ['required', 'date'],
|
||||
'media_ids' => ['required', 'array'],
|
||||
'media_ids.*' => ['required', 'exists:media,id'],
|
||||
'image' => ['nullable', 'image', 'mimes:png,jpg,jpeg', 'max:2048'],
|
||||
'amount_report' => ['required', 'numeric', 'min:1', 'max:100'],
|
||||
'task_description' => ['required'],
|
||||
];
|
||||
}
|
||||
}
|
||||
@ -32,4 +32,8 @@ public function media()
|
||||
public function proposals(){
|
||||
return $this->hasMany(CooperationProposal::class, 'cooperation_id', 'id');
|
||||
}
|
||||
|
||||
public function mediaOrder(){
|
||||
return $this->hasOne(Order::class, 'cooperation_id', 'id');
|
||||
}
|
||||
}
|
||||
|
||||
@ -34,6 +34,14 @@ public function journalists(){
|
||||
return $this->hasMany(Journalist::class, 'media_id', 'id');
|
||||
}
|
||||
|
||||
public function announcements()
|
||||
{
|
||||
return $this->belongsToMany(Announcement::class, 'announcements_media', 'media_id', 'announcement_id')
|
||||
->using(AnnouncementMedia::class)
|
||||
->withPivot(['status', 'category'])
|
||||
->withTimestamps();
|
||||
}
|
||||
|
||||
public function cooperations()
|
||||
{
|
||||
return $this->belongsToMany(Cooperation::class, 'media_cooperations', 'media_id', 'cooperation_id')
|
||||
@ -42,11 +50,11 @@ public function cooperations()
|
||||
->withTimestamps();
|
||||
}
|
||||
|
||||
public function announcements()
|
||||
public function orders()
|
||||
{
|
||||
return $this->belongsToMany(Announcement::class, 'announcements_media', 'media_id', 'announcement_id')
|
||||
->using(AnnouncementMedia::class)
|
||||
->withPivot(['status', 'category'])
|
||||
return $this->belongsToMany(Order::class, 'media_orders', 'media_id', 'order_id')
|
||||
->using(MediaOrder::class)
|
||||
->withPivot(['status', 'rejection_reason'])
|
||||
->withTimestamps();
|
||||
}
|
||||
}
|
||||
|
||||
26
app/Models/MediaOrder.php
Normal file
26
app/Models/MediaOrder.php
Normal file
@ -0,0 +1,26 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\Pivot;
|
||||
|
||||
class MediaOrder extends Pivot
|
||||
{
|
||||
protected $table = 'media_orders';
|
||||
|
||||
protected $fillable = [
|
||||
'order_id',
|
||||
'media_id',
|
||||
'status',
|
||||
'rejection_reason'
|
||||
];
|
||||
|
||||
public function order(){
|
||||
return $this->belongsTo(Order::class, 'order_id', 'id');
|
||||
}
|
||||
|
||||
public function media(){
|
||||
return $this->belongsTo(Media::class, 'media_id', 'id');
|
||||
}
|
||||
}
|
||||
35
app/Models/Order.php
Normal file
35
app/Models/Order.php
Normal file
@ -0,0 +1,35 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\SoftDeletes;
|
||||
|
||||
class Order extends Model
|
||||
{
|
||||
use SoftDeletes;
|
||||
|
||||
protected $table = 'orders';
|
||||
|
||||
protected $fillable = [
|
||||
'start_date',
|
||||
'end_date',
|
||||
'image',
|
||||
'task_description',
|
||||
'amount_report',
|
||||
'cooperation_id',
|
||||
'enhancer_id',
|
||||
];
|
||||
|
||||
public function media()
|
||||
{
|
||||
return $this->belongsToMany(Media::class, 'media_orders', 'order_id', 'media_id')
|
||||
->using(MediaOrder::class)
|
||||
->withPivot(['status', 'rejection_reason'])
|
||||
->withTimestamps();
|
||||
}
|
||||
|
||||
public function cooperation(){
|
||||
return $this->belongsTo(Cooperation::class, 'cooperation_id', 'id')->withTrashed();
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,37 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*/
|
||||
public function up(): void
|
||||
{
|
||||
Schema::create('orders', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->date('start_date');
|
||||
$table->date('end_date');
|
||||
$table->string('image')->nullable();
|
||||
$table->text('task_description');
|
||||
$table->integer('amount_report')->default(0);
|
||||
$table->unsignedBigInteger('cooperation_id');
|
||||
$table->unsignedBigInteger('enhancer_id');
|
||||
$table->foreign('cooperation_id')->references('id')->on('cooperations');
|
||||
$table->foreign('enhancer_id')->references('id')->on('users');
|
||||
$table->timestamps();
|
||||
$table->softDeletes();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('orders');
|
||||
}
|
||||
};
|
||||
@ -0,0 +1,33 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*/
|
||||
public function up(): void
|
||||
{
|
||||
Schema::create('media_orders', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->unsignedBigInteger('order_id');
|
||||
$table->unsignedBigInteger('media_id');
|
||||
$table->foreign('order_id')->references('id')->on('orders');
|
||||
$table->foreign('media_id')->references('id')->on('media');
|
||||
$table->enum('status', ['0', '1', '2', '3'])->default('0');
|
||||
$table->text('rejection_reason')->nullable();
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('media_orders');
|
||||
}
|
||||
};
|
||||
17
database/seeders/OrderSeeder.php
Normal file
17
database/seeders/OrderSeeder.php
Normal file
@ -0,0 +1,17 @@
|
||||
<?php
|
||||
|
||||
namespace Database\Seeders;
|
||||
|
||||
use Illuminate\Database\Console\Seeds\WithoutModelEvents;
|
||||
use Illuminate\Database\Seeder;
|
||||
|
||||
class OrderSeeder extends Seeder
|
||||
{
|
||||
/**
|
||||
* Run the database seeds.
|
||||
*/
|
||||
public function run(): void
|
||||
{
|
||||
//
|
||||
}
|
||||
}
|
||||
@ -138,5 +138,6 @@ .nk-wizard .actions a[href="#previous"] {
|
||||
margin-left: -0.8rem !important; /* Hapus margin negatif */
|
||||
}
|
||||
|
||||
|
||||
|
||||
.soft-grey-backgorund{
|
||||
background-color: #ebecee !important;
|
||||
}
|
||||
|
||||
@ -31,7 +31,7 @@
|
||||
<div class="profile-ud-item">
|
||||
<div class="profile-ud wider">
|
||||
<span class="profile-ud-label">Tanggal</span>
|
||||
<span class="profile-ud-value">{{idn_date($announcement->created_at, 'l, m F Y')}}</span>
|
||||
<span class="profile-ud-value">{{idn_date($announcement->created_at, 'l, d F Y')}}</span>
|
||||
</div>
|
||||
</div>
|
||||
</div><!-- .profile-ud-list -->
|
||||
|
||||
@ -31,7 +31,7 @@
|
||||
<div class="profile-ud-item">
|
||||
<div class="profile-ud wider">
|
||||
<span class="profile-ud-label">Tanggal</span>
|
||||
<span class="profile-ud-value">{{idn_date($announcement->created_at, 'l, m F Y')}}</span>
|
||||
<span class="profile-ud-value">{{idn_date($announcement->created_at, 'l, d F Y')}}</span>
|
||||
</div>
|
||||
</div>
|
||||
</div><!-- .profile-ud-list -->
|
||||
|
||||
@ -31,19 +31,19 @@
|
||||
<div class="profile-ud-item">
|
||||
<div class="profile-ud wider">
|
||||
<span class="profile-ud-label">Diunggah Pada</span>
|
||||
<span class="profile-ud-value">{{idn_date($cooperation->created_at, 'l, m F Y')}}</span>
|
||||
<span class="profile-ud-value">{{idn_date($cooperation->created_at, 'l, d F Y')}}</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="profile-ud-item">
|
||||
<div class="profile-ud wider">
|
||||
<span class="profile-ud-label">Tanggal Mulai Pengajuan</span>
|
||||
<span class="profile-ud-value">{{idn_date($cooperation->start_date, 'l, m F Y')}}</span>
|
||||
<span class="profile-ud-value">{{idn_date($cooperation->start_date, 'l, d F Y')}}</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="profile-ud-item">
|
||||
<div class="profile-ud wider">
|
||||
<span class="profile-ud-label">Tanggal Akhir Pengajuan</span>
|
||||
<span class="profile-ud-value">{{idn_date($cooperation->end_date, 'l, m F Y')}}</span>
|
||||
<span class="profile-ud-value">{{idn_date($cooperation->end_date, 'l, d F Y')}}</span>
|
||||
</div>
|
||||
</div>
|
||||
</div><!-- .profile-ud-list -->
|
||||
|
||||
@ -31,19 +31,19 @@
|
||||
<div class="profile-ud-item">
|
||||
<div class="profile-ud wider">
|
||||
<span class="profile-ud-label">Diunggah Pada</span>
|
||||
<span class="profile-ud-value">{{idn_date($cooperation->created_at, 'l, m F Y')}}</span>
|
||||
<span class="profile-ud-value">{{idn_date($cooperation->created_at, 'l, d F Y')}}</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="profile-ud-item">
|
||||
<div class="profile-ud wider">
|
||||
<span class="profile-ud-label">Tanggal Mulai Pengajuan</span>
|
||||
<span class="profile-ud-value">{{idn_date($cooperation->start_date, 'l, m F Y')}}</span>
|
||||
<span class="profile-ud-value">{{idn_date($cooperation->start_date, 'l, d F Y')}}</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="profile-ud-item">
|
||||
<div class="profile-ud wider">
|
||||
<span class="profile-ud-label">Tanggal Akhir Pengajuan</span>
|
||||
<span class="profile-ud-value">{{idn_date($cooperation->end_date, 'l, m F Y')}}</span>
|
||||
<span class="profile-ud-value">{{idn_date($cooperation->end_date, 'l, d F Y')}}</span>
|
||||
</div>
|
||||
</div>
|
||||
</div><!-- .profile-ud-list -->
|
||||
|
||||
@ -82,13 +82,13 @@
|
||||
<div class="profile-ud-item">
|
||||
<div class="profile-ud wider">
|
||||
<span class="profile-ud-label">Tanggal Input</span>
|
||||
<span class="profile-ud-value">{{idn_date($mediaMonitoring->created_at, 'l, m F Y')}}</span>
|
||||
<span class="profile-ud-value">{{idn_date($mediaMonitoring->created_at, 'l, d F Y')}}</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="profile-ud-item">
|
||||
<div class="profile-ud wider">
|
||||
<span class="profile-ud-label">Tanggal Rilis</span>
|
||||
<span class="profile-ud-value">{{idn_date($mediaMonitoring->release_date, 'l, m F Y')}}</span>
|
||||
<span class="profile-ud-value">{{idn_date($mediaMonitoring->release_date, 'l, d F Y')}}</span>
|
||||
</div>
|
||||
</div>
|
||||
</div><!-- .profile-ud-list -->
|
||||
|
||||
@ -82,13 +82,13 @@
|
||||
<div class="profile-ud-item">
|
||||
<div class="profile-ud wider">
|
||||
<span class="profile-ud-label">Tanggal Input</span>
|
||||
<span class="profile-ud-value">{{idn_date($mediaMonitoring->created_at, 'l, m F Y')}}</span>
|
||||
<span class="profile-ud-value">{{idn_date($mediaMonitoring->created_at, 'l, d F Y')}}</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="profile-ud-item">
|
||||
<div class="profile-ud wider">
|
||||
<span class="profile-ud-label">Tanggal Rilis</span>
|
||||
<span class="profile-ud-value">{{idn_date($mediaMonitoring->release_date, 'l, m F Y')}}</span>
|
||||
<span class="profile-ud-value">{{idn_date($mediaMonitoring->release_date, 'l, d F Y')}}</span>
|
||||
</div>
|
||||
</div>
|
||||
</div><!-- .profile-ud-list -->
|
||||
|
||||
@ -69,7 +69,7 @@
|
||||
<div class="profile-ud-item">
|
||||
<div class="profile-ud wider">
|
||||
<span class="profile-ud-label">Tanggal Input</span>
|
||||
<span class="profile-ud-value">{{idn_date($issueManagement->created_at, 'l, m F Y')}}</span>
|
||||
<span class="profile-ud-value">{{idn_date($issueManagement->created_at, 'l, d F Y')}}</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="profile-ud-item">
|
||||
@ -158,13 +158,13 @@
|
||||
<div class="profile-ud-item">
|
||||
<div class="profile-ud wider">
|
||||
<span class="profile-ud-label">Tanggal Input</span>
|
||||
<span class="profile-ud-value">{{idn_date($mediaMonitoring->created_at, 'l, m F Y')}}</span>
|
||||
<span class="profile-ud-value">{{idn_date($mediaMonitoring->created_at, 'l, d F Y')}}</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="profile-ud-item">
|
||||
<div class="profile-ud wider">
|
||||
<span class="profile-ud-label">Tanggal Rilis</span>
|
||||
<span class="profile-ud-value">{{idn_date($mediaMonitoring->release_date, 'l, m F Y')}}</span>
|
||||
<span class="profile-ud-value">{{idn_date($mediaMonitoring->release_date, 'l, d F Y')}}</span>
|
||||
</div>
|
||||
</div>
|
||||
</div><!-- .profile-ud-list -->
|
||||
|
||||
@ -46,9 +46,10 @@
|
||||
<tr>
|
||||
<th style="width: 10% !important;">No</th>
|
||||
<th>Nama Kegiatan</th>
|
||||
<th>Tanggal Mulai Pengajuan</th>
|
||||
<th>Tanggal Akhir Pengajuan</th>
|
||||
{{-- <th>Tanggal Mulai Pengajuan</th>
|
||||
<th>Tanggal Akhir Pengajuan</th> --}}
|
||||
<th>Dibuat Pada</th>
|
||||
<th>Step/Status</th>
|
||||
<th style="width: 10% !important;"></th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
@ -0,0 +1,177 @@
|
||||
@include('partials.dashboard.head')
|
||||
@include('partials.dashboard.sidebar', ['page' => 'cooperations'])
|
||||
@include('partials.dashboard.header')
|
||||
<!-- content @s -->
|
||||
<div class="nk-content ">
|
||||
<div class="container-fluid">
|
||||
<div class="nk-content-inner">
|
||||
<div class="nk-content-body">
|
||||
<div class="nk-block nk-block-lg">
|
||||
<div class="card card-bordered card-preview">
|
||||
<div class="card-inner">
|
||||
@include('dashboard.media-cooperations.processes.tab')
|
||||
<div class="tab-content">
|
||||
<div class="tab-pane active" id="cooperation">
|
||||
<div class="card-content">
|
||||
<ul class="nav nav-tabs nav-tabs-mb-icon nav-tabs-card soft-grey-backgorund">
|
||||
<li class="nav-item">
|
||||
<a class="nav-link text-primary" href="#"><em class="icon ni ni-info"></em><span>Data Pengajuan Kerjasama</span></a>
|
||||
</li>
|
||||
</ul><!-- .nav-tabs -->
|
||||
<div class="card-inner">
|
||||
<div class="nk-block">
|
||||
{{-- <div class="nk-block-head">
|
||||
<h5 class="title">Personal Information</h5>
|
||||
<p>Basic info, like your name and address, that you use on Nio Platform.</p>
|
||||
</div> --}}
|
||||
<div class="profile-ud-list">
|
||||
<div class="profile-ud-item">
|
||||
<div class="profile-ud wider">
|
||||
<span class="profile-ud-label">Nama Kegiatan</span>
|
||||
<span class="profile-ud-value">{{$mediaCooperation->name}}</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="profile-ud-item">
|
||||
<div class="profile-ud wider">
|
||||
<span class="profile-ud-label">Diunggah Pada</span>
|
||||
<span class="profile-ud-value">{{idn_date($mediaCooperation->created_at, 'l, d F Y')}}</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="profile-ud-item">
|
||||
<div class="profile-ud wider">
|
||||
<span class="profile-ud-label">Tanggal Mulai Pengajuan</span>
|
||||
<span class="profile-ud-value">{{idn_date($mediaCooperation->start_date, 'l, d F Y')}}</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="profile-ud-item">
|
||||
<div class="profile-ud wider">
|
||||
<span class="profile-ud-label">Tanggal Akhir Pengajuan</span>
|
||||
<span class="profile-ud-value">{{idn_date($mediaCooperation->end_date, 'l, d F Y')}}</span>
|
||||
</div>
|
||||
</div>
|
||||
@if (is_role(['1']))
|
||||
<div class="profile-ud-item">
|
||||
<div class="profile-ud wider">
|
||||
<span class="profile-ud-label">Data Pengajuan Kerjasama</span>
|
||||
<span class="profile-ud-value"><a href="{{route('dashboard.cooperations.media.proposal', ['id' => encrypt_id($mediaCooperation->id)])}}" class="btn btn-info">Lihat Data</a></span>
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
<div class="profile-ud-item">
|
||||
<div class="profile-ud wider">
|
||||
<span class="profile-ud-label">Status</span>
|
||||
<span class="profile-ud-value">
|
||||
@if ($mediaOrder)
|
||||
<span class="profile-ud-value"><span class="badge bg-primary">Media Order</span></span>
|
||||
@else
|
||||
<span class="profile-ud-value"><span class="badge bg-warning">Kerjasama</span></span>
|
||||
@endif
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</div><!-- .profile-ud-list -->
|
||||
</div><!-- .nk-block -->
|
||||
{{-- <div class="nk-divider divider md"></div> --}}
|
||||
<div class="nk-block">
|
||||
<div class="nk-block-head nk-block-head-sm nk-block-between">
|
||||
<span class="profile-ud-label">Deskripsi</span>
|
||||
</div><!-- .nk-block-head -->
|
||||
<div class="bq-note">
|
||||
<div class="bq-note-item">
|
||||
<div class="bq-note-text">
|
||||
{!!$mediaCooperation->description!!}
|
||||
</div>
|
||||
</div><!-- .bq-note-item -->
|
||||
</div><!-- .bq-note -->
|
||||
</div><!-- .nk-block -->
|
||||
<div id="accordion" class="accordion my-3">
|
||||
<div class="accordion-item">
|
||||
<a href="#" class="accordion-head" data-bs-toggle="collapse" data-bs-target="#accordion-item-1">
|
||||
<h6 class="title">Banner</h6>
|
||||
<span class="accordion-icon"></span>
|
||||
</a>
|
||||
<div class="accordion-body collapse" id="accordion-item-1" data-bs-parent="#accordion">
|
||||
<div class="accordion-inner">
|
||||
<div class="bq-note">
|
||||
<div class="bq-note-item">
|
||||
<div class="bq-note-text">
|
||||
@if (filled($mediaCooperation->banner))
|
||||
<img src="{{asset('storage/uploads/cooperations/'. $mediaCooperation->banner)}}" alt="Banner" style="max-width: 300px; height: auto; display: block; margin: auto;">
|
||||
@else
|
||||
-
|
||||
@endif
|
||||
</div>
|
||||
</div><!-- .bq-note-item -->
|
||||
</div><!-- .bq-note -->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="accordion-item">
|
||||
<a href="#" class="accordion-head collapsed" data-bs-toggle="collapse" data-bs-target="#accordion-item-2">
|
||||
<h6 class="title">Template Pengajuan</h6>
|
||||
<span class="accordion-icon"></span>
|
||||
</a>
|
||||
<div class="accordion-body collapse" id="accordion-item-2" data-bs-parent="#accordion">
|
||||
<div class="accordion-inner">
|
||||
<div class="bq-note">
|
||||
<div class="bq-note-item">
|
||||
<div class="bq-note-text">
|
||||
@if (filled($mediaCooperation->offer_file_template))
|
||||
<iframe src="{{ asset('storage/uploads/cooperations/' . $mediaCooperation->offer_file_template) }}"
|
||||
width="100%" height="400">
|
||||
<p>Browser Anda tidak mendukung PDF viewer. Anda bisa mengunduh PDF ini <a href="{{ asset('storage/uploads/cooperations/' . $mediaCooperation->offer_file_template) }}">di sini</a>.</p>
|
||||
</iframe>
|
||||
@else
|
||||
-
|
||||
@endif
|
||||
</div>
|
||||
</div><!-- .bq-note-item -->
|
||||
</div><!-- .bq-note -->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div><!-- .card-inner -->
|
||||
@if (is_role(['1']))
|
||||
<ul class="nav nav-tabs nav-tabs-mb-icon nav-tabs-card soft-grey-backgorund">
|
||||
<li class="nav-item">
|
||||
<a class="nav-link text-primary" href="#"><em class="icon ni ni-info"></em><span>Data Media</span></a>
|
||||
</li>
|
||||
</ul><!-- .nav-tabs -->
|
||||
<div class="card-inner">
|
||||
<div class="table-responsive">
|
||||
<table class="table table-striped table-bordered nowrap" id="cooperationMediaTable" border="1">
|
||||
<thead>
|
||||
<tr>
|
||||
<th style="width: 10% !important;">No</th>
|
||||
<th>Nama Media</th>
|
||||
<th>Nama Perusahaan</th>
|
||||
<th>Email</th>
|
||||
<th>Tipe</th>
|
||||
<th>Klasifikasi</th>
|
||||
<th>Status</th>
|
||||
</tr>
|
||||
</thead>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
</div><!-- .card-content -->
|
||||
<hr>
|
||||
<div class="nk-block d-flex justify-content-end">
|
||||
<a href="{{route('dashboard.cooperations.index')}}" class="btn btn-white btn-dim btn-outline-light mx-2"><span>Kembali</span></a>
|
||||
@if (!$mediaOrder && is_role(['1']))
|
||||
<a href="{{route('dashboard.media.orders.create', ['id' => encrypt_id($mediaCooperation->id)])}}" class="btn btn-primary"><span>Buat Media Order</span></a>
|
||||
@endif
|
||||
</div><!-- .nk-block -->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div><!-- .card-preview -->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- content @e -->
|
||||
@include('partials.dashboard.footer', ['rich_editor' => false, 'datatable' => 'cooperation_media'])
|
||||
@ -0,0 +1,201 @@
|
||||
@include('partials.dashboard.head')
|
||||
@include('partials.dashboard.sidebar', ['page' => 'cooperations'])
|
||||
@include('partials.dashboard.header')
|
||||
<!-- content @s -->
|
||||
<div class="nk-content ">
|
||||
<div class="container-fluid">
|
||||
<div class="nk-content-inner">
|
||||
<div class="nk-content-body">
|
||||
<div class="nk-block nk-block-lg">
|
||||
<div class="card card-bordered card-preview">
|
||||
<div class="card-inner">
|
||||
@include('dashboard.media-cooperations.processes.tab')
|
||||
<div class="tab-content">
|
||||
<div class="tab-pane active" id="cooperation">
|
||||
<div class="card-content">
|
||||
<ul class="nav nav-tabs nav-tabs-mb-icon nav-tabs-card soft-grey-backgorund">
|
||||
<li class="nav-item">
|
||||
<a class="nav-link text-primary" href="#"><em class="icon ni ni-info"></em><span>Data Media Order</span></a>
|
||||
</li>
|
||||
</ul><!-- .nav-tabs -->
|
||||
<div class="card-inner">
|
||||
<div class="nk-block">
|
||||
{{-- <div class="nk-block-head">
|
||||
<h5 class="title">Personal Information</h5>
|
||||
<p>Basic info, like your name and address, that you use on Nio Platform.</p>
|
||||
</div> --}}
|
||||
<div class="profile-ud-list">
|
||||
<div class="profile-ud-item">
|
||||
<div class="profile-ud wider">
|
||||
<span class="profile-ud-label">Nama Kegiatan</span>
|
||||
<span class="profile-ud-value">{{$mediaOrder->cooperation->name}}</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="profile-ud-item">
|
||||
<div class="profile-ud wider">
|
||||
<span class="profile-ud-label">Dibuat Pada</span>
|
||||
<span class="profile-ud-value">{{idn_date($mediaOrder->created_at, 'l, d F Y')}}</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="profile-ud-item">
|
||||
<div class="profile-ud wider">
|
||||
<span class="profile-ud-label">Tanggal Mulai Pelaksaan</span>
|
||||
<span class="profile-ud-value">{{idn_date($mediaOrder->start_date, 'l, d F Y')}}</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="profile-ud-item">
|
||||
<div class="profile-ud wider">
|
||||
<span class="profile-ud-label">Tanggal Selesai Pelaksaan</span>
|
||||
<span class="profile-ud-value">{{idn_date($mediaOrder->end_date, 'l, d F Y')}}</span>
|
||||
</div>
|
||||
</div>
|
||||
@if (is_role(['3']))
|
||||
<div class="profile-ud-item">
|
||||
<div class="profile-ud wider">
|
||||
<span class="profile-ud-label">Status</span>
|
||||
<span class="profile-ud-value">
|
||||
@if ($mediaOrderPivot->status === '0')
|
||||
<span class="profile-ud-value"><span class="badge bg-warning">Menunggu</span></span>
|
||||
@elseif($mediaOrderPivot->status === '1')
|
||||
<span class="profile-ud-value"><span class="badge bg-success">Menerima</span></span>
|
||||
@elseif($mediaOrderPivot->status === '2')
|
||||
<span class="profile-ud-value"><span class="badge bg-danger">Menolak</span></span>
|
||||
@else
|
||||
<span class="profile-ud-value"><span class="badge bg-secondary">Tidak Diketahui</span></span>
|
||||
@endif
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
</div><!-- .profile-ud-list -->
|
||||
</div><!-- .nk-block -->
|
||||
{{-- <div class="nk-divider divider md"></div> --}}
|
||||
<div class="nk-block">
|
||||
<div class="nk-block-head nk-block-head-sm nk-block-between">
|
||||
<span class="profile-ud-label">Deskripsi Tugas</span>
|
||||
</div><!-- .nk-block-head -->
|
||||
<div class="bq-note">
|
||||
<div class="bq-note-item">
|
||||
<div class="bq-note-text">
|
||||
{!!$mediaOrder->task_description!!}
|
||||
</div>
|
||||
</div><!-- .bq-note-item -->
|
||||
</div><!-- .bq-note -->
|
||||
</div><!-- .nk-block -->
|
||||
<div id="accordion" class="accordion my-3">
|
||||
<div class="accordion-item">
|
||||
<a href="#" class="accordion-head" data-bs-toggle="collapse" data-bs-target="#accordion-item-1">
|
||||
<h6 class="title">Gambar</h6>
|
||||
<span class="accordion-icon"></span>
|
||||
</a>
|
||||
<div class="accordion-body collapse" id="accordion-item-1" data-bs-parent="#accordion">
|
||||
<div class="accordion-inner">
|
||||
<div class="bq-note">
|
||||
<div class="bq-note-item">
|
||||
<div class="bq-note-text">
|
||||
@if (filled($mediaOrder->image))
|
||||
<img src="{{asset('storage/uploads/media-orders/'. $mediaOrder->image)}}" alt="Gambar" style="max-width: 300px; height: auto; display: block; margin: auto;">
|
||||
@else
|
||||
-
|
||||
@endif
|
||||
</div>
|
||||
</div><!-- .bq-note-item -->
|
||||
</div><!-- .bq-note -->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@if (is_role(['3']) && $mediaOrderPivot->status === '2')
|
||||
<div class="nk-block">
|
||||
<div class="nk-block-head nk-block-head-sm nk-block-between">
|
||||
<span class="profile-ud-label">Alasan Menolak</span>
|
||||
</div><!-- .nk-block-head -->
|
||||
<div class="bq-note">
|
||||
<div class="bq-note-item">
|
||||
<div class="bq-note-text" style="background-color: rgb(247, 206, 206);">
|
||||
{!!$mediaOrderPivot->rejection_reason!!}
|
||||
</div>
|
||||
</div><!-- .bq-note-item -->
|
||||
</div><!-- .bq-note -->
|
||||
</div><!-- .nk-block -->
|
||||
@endif
|
||||
</div><!-- .card-inner -->
|
||||
@if (is_role(['1']))
|
||||
<ul class="nav nav-tabs nav-tabs-mb-icon nav-tabs-card soft-grey-backgorund">
|
||||
<li class="nav-item">
|
||||
<a class="nav-link text-primary" href="#"><em class="icon ni ni-info"></em><span>Data Media</span></a>
|
||||
</li>
|
||||
</ul><!-- .nav-tabs -->
|
||||
<div class="card-inner">
|
||||
<div class="table-responsive">
|
||||
<table class="table table-striped table-bordered nowrap" id="orderMediaTable" border="1">
|
||||
<thead>
|
||||
<tr>
|
||||
<th style="width: 10% !important;">No</th>
|
||||
<th>Nama Media</th>
|
||||
<th>Nama Perusahaan</th>
|
||||
<th>Email</th>
|
||||
<th>Tipe</th>
|
||||
<th>Klasifikasi</th>
|
||||
<th>Status</th>
|
||||
</tr>
|
||||
</thead>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
</div><!-- .card-content -->
|
||||
<hr>
|
||||
<div class="nk-block d-flex {{$mediaOrder && is_role(['3']) && $mediaOrderPivot->status === '0' ? 'justify-content-between' : 'justify-content-end'}}">
|
||||
<a href="{{route('dashboard.cooperations.index')}}" class="btn btn-white btn-dim btn-outline-light mx-2"><span>Kembali</span></a>
|
||||
@if ($mediaOrder && is_role(['3']) && $mediaOrderPivot->status === '0')
|
||||
<div>
|
||||
<a href="javascript:void(0);" class="btn btn-danger mx-1" data-bs-toggle="modal" data-bs-target="#modalForm"><span>Tolak</span></a>
|
||||
<a href="javascript:void(0);" class="btn btn-success" onclick="itemConfirm('{{ route('dashboard.media.orders.accept', ['id' => encrypt_id($mediaOrder->id)]) }}', 'Apakah Anda yakin ingin menerima media order ini?', 'Ya, terima!')"><span>Terima</span></a>
|
||||
</div>
|
||||
@elseif (is_role(['1']))
|
||||
<a href="{{route('dashboard.media.orders.edit', ['id' => encrypt_id($mediaOrder->id)])}}" class="btn btn-warning"><span>Ubah</span></a>
|
||||
@endif
|
||||
</div><!-- .nk-block -->
|
||||
@if (is_role(['3']))
|
||||
<div class="modal fade" id="modalForm">
|
||||
<div class="modal-dialog" role="document">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h5 class="modal-title">Form Penolakan</h5>
|
||||
<a href="#" class="close" data-bs-dismiss="modal" aria-label="Close">
|
||||
<em class="icon ni ni-cross"></em>
|
||||
</a>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<form action="{{route('dashboard.media.orders.reject', ['id' => encrypt_id($mediaOrder->id)])}}" class="form-validate is-alter" method="post">
|
||||
@csrf
|
||||
<div class="form-group">
|
||||
<label class="form-label" for="rejection_reason">Alasan Menolak<span class="required-input">*</span></label>
|
||||
<div class="form-control-wrap">
|
||||
<textarea name="rejection_reason" id="rejection_reason" class="form-control" required></textarea>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group d-flex justify-content-end">
|
||||
<button type="submit" class="btn btn-md btn-primary">Kirim</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<div class="modal-footer bg-light">
|
||||
<span class="sub-text"></span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div><!-- .card-preview -->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- content @e -->
|
||||
@include('partials.dashboard.footer', ['rich_editor' => false, 'datatable' => 'order_media'])
|
||||
@ -0,0 +1,44 @@
|
||||
<ul class="nav nav-tabs nav-tabs-s2 mt-n2">
|
||||
<li class="nav-item">
|
||||
<a class="nav-link {{$process === 'cooperation' ? 'active' : ''}}" href="{{route('dashboard.cooperations.process', ['id' => encrypt_id($mediaCooperation->id), 'process' => 'cooperation'])}}">
|
||||
Ajuan Kerjasama</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link {{$process === 'media-order' ? 'active' : ''}}" href="{{ $mediaOrder ? route('dashboard.cooperations.process', ['id' => encrypt_id($mediaCooperation->id), 'process' => 'media-order']) : 'javascript:void(0)'}}">
|
||||
@if (!$mediaOrder)
|
||||
<em class="icon ni ni-lock" style="margin-right: 0.3rem;"></em>
|
||||
@endif
|
||||
Media Order</a>
|
||||
</li>
|
||||
@if (is_role(['1']))
|
||||
<li class="nav-item">
|
||||
<a class="nav-link {{$process === 'report' ? 'active' : ''}}" href="{{ $mediaOrder ? route('dashboard.cooperations.process', ['id' => encrypt_id($mediaCooperation->id), 'process' => 'reports']) : 'javascript:void(0)'}}">
|
||||
@if (!$mediaOrder)
|
||||
<em class="icon ni ni-lock" style="margin-right: 0.3rem;"></em>
|
||||
@endif
|
||||
Laporan</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link {{$process === 'finish' ? 'active' : ''}}" href="{{ $mediaOrder ? route('dashboard.cooperations.process', ['id' => encrypt_id($mediaCooperation->id), 'process' => 'finish']) : 'javascript:void(0)'}}">
|
||||
@if (!$mediaOrder)
|
||||
<em class="icon ni ni-lock" style="margin-right: 0.3rem;"></em>
|
||||
@endif
|
||||
Selesai</a>
|
||||
</li>
|
||||
@else
|
||||
<li class="nav-item">
|
||||
<a class="nav-link {{$process === 'report' ? 'active' : ''}}" href="{{ $mediaOrder && $mediaOrderPivot->status === '1' ? route('dashboard.cooperations.process', ['id' => encrypt_id($mediaCooperation->id), 'process' => 'reports']) : 'javascript:void(0)'}}">
|
||||
@if ($mediaOrder && $mediaOrderPivot->status !== '1')
|
||||
<em class="icon ni ni-lock" style="margin-right: 0.3rem;"></em>
|
||||
@endif
|
||||
Laporan</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link {{$process === 'finish' ? 'active' : ''}}" href="{{ $mediaOrder && $mediaOrderPivot->status === '1' ? route('dashboard.cooperations.process', ['id' => encrypt_id($mediaCooperation->id), 'process' => 'finish']) : 'javascript:void(0)'}}">
|
||||
@if ($mediaOrder && $mediaOrderPivot->status !== '1')
|
||||
<em class="icon ni ni-lock" style="margin-right: 0.3rem;"></em>
|
||||
@endif
|
||||
Selesai</a>
|
||||
</li>
|
||||
@endif
|
||||
</ul>
|
||||
@ -31,19 +31,19 @@
|
||||
<div class="profile-ud-item">
|
||||
<div class="profile-ud wider">
|
||||
<span class="profile-ud-label">Diunggah Pada</span>
|
||||
<span class="profile-ud-value">{{idn_date($mediaCooperation->created_at, 'l, m F Y')}}</span>
|
||||
<span class="profile-ud-value">{{idn_date($mediaCooperation->created_at, 'l, d F Y')}}</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="profile-ud-item">
|
||||
<div class="profile-ud wider">
|
||||
<span class="profile-ud-label">Tanggal Mulai Pengajuan</span>
|
||||
<span class="profile-ud-value">{{idn_date($mediaCooperation->start_date, 'l, m F Y')}}</span>
|
||||
<span class="profile-ud-value">{{idn_date($mediaCooperation->start_date, 'l, d F Y')}}</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="profile-ud-item">
|
||||
<div class="profile-ud wider">
|
||||
<span class="profile-ud-label">Tanggal Akhir Pengajuan</span>
|
||||
<span class="profile-ud-value">{{idn_date($mediaCooperation->end_date, 'l, m F Y')}}</span>
|
||||
<span class="profile-ud-value">{{idn_date($mediaCooperation->end_date, 'l, d F Y')}}</span>
|
||||
</div>
|
||||
</div>
|
||||
</div><!-- .profile-ud-list -->
|
||||
@ -111,12 +111,15 @@
|
||||
<hr>
|
||||
<div class="nk-block d-flex justify-content-end">
|
||||
<a href="{{route('dashboard.cooperations.index')}}" class="btn btn-white btn-dim btn-outline-light mx-2"><span>Kembali</span></a>
|
||||
<a href="{{route('dashboard.cooperations.edit', ['id' => encrypt_id($mediaCooperation->id)])}}" class="btn btn-warning"><span>Ubah</span></a>
|
||||
@if (is_role(['1']))
|
||||
<a href="{{route('dashboard.cooperations.edit', ['id' => encrypt_id($mediaCooperation->id)])}}" class="btn btn-warning"><span>Ubah</span></a>
|
||||
@endif
|
||||
</div><!-- .nk-block -->
|
||||
</div><!-- .card-inner -->
|
||||
</div><!-- .card-content -->
|
||||
</div><!-- .card-aside-wrap -->
|
||||
</div>
|
||||
@if (is_role(['1']))
|
||||
<div class="card card-bordered card-preview">
|
||||
<ul class="nav nav-tabs nav-tabs-mb-icon nav-tabs-card">
|
||||
<li class="nav-item">
|
||||
@ -141,6 +144,7 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@ -79,13 +79,13 @@
|
||||
<div class="profile-ud-item">
|
||||
<div class="profile-ud wider">
|
||||
<span class="profile-ud-label">Tanggal Input</span>
|
||||
<span class="profile-ud-value">{{idn_date($mediaMonitoring->created_at, 'l, m F Y')}}</span>
|
||||
<span class="profile-ud-value">{{idn_date($mediaMonitoring->created_at, 'l, d F Y')}}</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="profile-ud-item">
|
||||
<div class="profile-ud wider">
|
||||
<span class="profile-ud-label">Tanggal Rilis</span>
|
||||
<span class="profile-ud-value">{{idn_date($mediaMonitoring->release_date, 'l, m F Y')}}</span>
|
||||
<span class="profile-ud-value">{{idn_date($mediaMonitoring->release_date, 'l, d F Y')}}</span>
|
||||
</div>
|
||||
</div>
|
||||
</div><!-- .profile-ud-list -->
|
||||
|
||||
117
resources/views/dashboard/media-orders/create.blade.php
Normal file
117
resources/views/dashboard/media-orders/create.blade.php
Normal file
@ -0,0 +1,117 @@
|
||||
@include('partials.dashboard.head')
|
||||
@include('partials.dashboard.sidebar', ['page' => 'cooperations'])
|
||||
@include('partials.dashboard.header')
|
||||
<!-- content @s -->
|
||||
<div class="nk-content ">
|
||||
<div class="container-fluid">
|
||||
<div class="nk-content-inner">
|
||||
<div class="nk-content-body">
|
||||
<div class="nk-block nk-block-lg">
|
||||
<div class="card card-bordered card-preview">
|
||||
<div class="card-inner">
|
||||
<div class="card-head">
|
||||
<h5 class="card-title">{{$title}}</h5>
|
||||
</div>
|
||||
<form action="{{route('dashboard.media.orders.store', ['id' => encrypt_id($cooperation->id)])}}" method="post" id="myForm" enctype="multipart/form-data">
|
||||
@csrf
|
||||
<div class="row g-4">
|
||||
<div class="col-lg-12">
|
||||
<div class="form-group">
|
||||
<label class="form-label" for="name">Nama Kegiatan<span class="required-input">*</span></label>
|
||||
<div class="form-control-wrap">
|
||||
<input type="text" class="form-control @error('name') border-danger @enderror" id="name" name="name" placeholder="Masukan nama kegiatan" value="{{$cooperation->name}}" readonly>
|
||||
</div>
|
||||
@error('name')
|
||||
<span class="validation-error">{{$message}}</span>
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-lg-6">
|
||||
<div class="form-group">
|
||||
<label class="form-label" for="start_date">Tanggal Mulai Pelaksanaan<span class="required-input">*</span></label>
|
||||
<div class="form-control-wrap">
|
||||
<input type="date" class="form-control @error('start_date') border-danger @enderror" id="start_date" name="start_date" placeholder="Masukan tanggal mulai" value="{{old('start_date')}}">
|
||||
</div>
|
||||
@error('start_date')
|
||||
<span class="validation-error">{{$message}}</span>
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-lg-6">
|
||||
<div class="form-group">
|
||||
<label class="form-label" for="end_date">Tanggal Selesai Pelaksanaan<span class="required-input">*</span></label>
|
||||
<div class="form-control-wrap">
|
||||
<input type="date" class="form-control @error('end_date') border-danger @enderror" id="end_date" name="end_date" placeholder="Masukan tanggal selesai" value="{{old('end_date')}}">
|
||||
</div>
|
||||
@error('end_date')
|
||||
<span class="validation-error">{{$message}}</span>
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-lg-12">
|
||||
<div class="form-group">
|
||||
<label class="form-label">Media<span class="required-input">*</span></label>
|
||||
<div class="form-control-wrap">
|
||||
<select class="form-select js-select2" data-search="on" name="media_ids[]" multiple="multiple" data-placeholder="Pilih Media">
|
||||
@foreach ($media->whereIn('id', $acceptedMedia) as $item)
|
||||
<option value="{{ $item->id }}"
|
||||
{{ (is_array(old('media_ids')) && in_array($item->id, old('media_ids'))) || in_array($item->id, $acceptedMedia->toArray()) ? 'selected' : '' }}>
|
||||
{{ $item->name }}
|
||||
</option>
|
||||
@endforeach
|
||||
</select>
|
||||
</div>
|
||||
@error('media_ids')
|
||||
<span class="validation-error">{{ $message }}</span>
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-lg-6">
|
||||
<div class="form-group">
|
||||
<label class="form-label" for="image">Gambar</label>
|
||||
<div class="form-control-wrap">
|
||||
<input type="file" class="form-control @error('image') border-danger @enderror" id="image" name="image" placeholder="Masukan file image" value="{{old('image')}}" accept="image/*">
|
||||
</div>
|
||||
@error('image')
|
||||
<span class="validation-error">{{$message}}</span>
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-lg-6">
|
||||
<div class="form-group">
|
||||
<label class="form-label" for="amount_report">Jumlah Laporan<span class="required-input">*</span></label>
|
||||
<div class="form-control-wrap">
|
||||
<input type="number" class="form-control @error('amount_report') border-danger @enderror" id="amount_report" name="amount_report" placeholder="Masukan jumlah laporan" value="{{old('amount_report')}}" min="1" max="100">
|
||||
</div>
|
||||
@error('amount_report')
|
||||
<span class="validation-error">{{$message}}</span>
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-lg-12">
|
||||
<div class="form-group">
|
||||
<label class="form-label" for="phone-no-1">Deskripsi Tugas<span class="required-input">*</span></label>
|
||||
<div class="form-control-wrap">
|
||||
<textarea class="tinymce-basic form-control" name="task_description">{!!old('task_description')!!}</textarea>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-12">
|
||||
<hr>
|
||||
<div class="form-group d-flex justify-content-end">
|
||||
<a href="{{route('dashboard.cooperations.index')}}" class="btn btn-white btn-dim btn-outline-light mx-2"><span>Kembali</span></a>
|
||||
<button type="button" class="btn btn-md btn-primary" id="submitButton">Buat Media Order</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- content @e -->
|
||||
@include('partials.dashboard.footer', ['rich_editor' => true])
|
||||
118
resources/views/dashboard/media-orders/edit.blade.php
Normal file
118
resources/views/dashboard/media-orders/edit.blade.php
Normal file
@ -0,0 +1,118 @@
|
||||
@include('partials.dashboard.head')
|
||||
@include('partials.dashboard.sidebar', ['page' => 'cooperations'])
|
||||
@include('partials.dashboard.header')
|
||||
<!-- content @s -->
|
||||
<div class="nk-content ">
|
||||
<div class="container-fluid">
|
||||
<div class="nk-content-inner">
|
||||
<div class="nk-content-body">
|
||||
<div class="nk-block nk-block-lg">
|
||||
<div class="card card-bordered card-preview">
|
||||
<div class="card-inner">
|
||||
<div class="card-head">
|
||||
<h5 class="card-title">{{$title}}</h5>
|
||||
</div>
|
||||
<form action="{{route('dashboard.media.orders.update', ['id' => encrypt_id($mediaOrder->id)])}}" method="post" id="myForm" enctype="multipart/form-data">
|
||||
@csrf
|
||||
@method('put')
|
||||
<div class="row g-4">
|
||||
<div class="col-lg-12">
|
||||
<div class="form-group">
|
||||
<label class="form-label" for="name">Nama Kegiatan<span class="required-input">*</span></label>
|
||||
<div class="form-control-wrap">
|
||||
<input type="text" class="form-control @error('name') border-danger @enderror" id="name" name="name" placeholder="Masukan nama kegiatan" value="{{$cooperation->name}}" readonly>
|
||||
</div>
|
||||
@error('name')
|
||||
<span class="validation-error">{{$message}}</span>
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-lg-6">
|
||||
<div class="form-group">
|
||||
<label class="form-label" for="start_date">Tanggal Mulai Pelaksanaan<span class="required-input">*</span></label>
|
||||
<div class="form-control-wrap">
|
||||
<input type="date" class="form-control @error('start_date') border-danger @enderror" id="start_date" name="start_date" placeholder="Masukan tanggal mulai" value="{{$mediaOrder->start_date}}">
|
||||
</div>
|
||||
@error('start_date')
|
||||
<span class="validation-error">{{$message}}</span>
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-lg-6">
|
||||
<div class="form-group">
|
||||
<label class="form-label" for="end_date">Tanggal Selesai Pelaksanaan<span class="required-input">*</span></label>
|
||||
<div class="form-control-wrap">
|
||||
<input type="date" class="form-control @error('end_date') border-danger @enderror" id="end_date" name="end_date" placeholder="Masukan tanggal selesai" value="{{$mediaOrder->end_date}}">
|
||||
</div>
|
||||
@error('end_date')
|
||||
<span class="validation-error">{{$message}}</span>
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-lg-12">
|
||||
<div class="form-group">
|
||||
<label class="form-label">Media<span class="required-input">*</span></label>
|
||||
<div class="form-control-wrap">
|
||||
<select class="form-select js-select2" data-search="on" name="media_ids[]" multiple="multiple" data-placeholder="Pilih Media">
|
||||
@foreach ($media->whereIn('id', $acceptedMedia) as $item)
|
||||
<option value="{{ $item->id }}"
|
||||
{{ (is_array(old('media_ids')) && in_array($item->id, old('media_ids'))) || in_array($item->id, $acceptedMediaNow->toArray()) ? 'selected' : '' }}>
|
||||
{{ $item->name }}
|
||||
</option>
|
||||
@endforeach
|
||||
</select>
|
||||
</div>
|
||||
@error('media_ids')
|
||||
<span class="validation-error">{{ $message }}</span>
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-lg-6">
|
||||
<div class="form-group">
|
||||
<label class="form-label" for="image">Gambar</label>
|
||||
<div class="form-control-wrap">
|
||||
<input type="file" class="form-control @error('image') border-danger @enderror" id="image" name="image" placeholder="Masukan file image" value="{{old('image')}}" accept="image/*">
|
||||
</div>
|
||||
@error('image')
|
||||
<span class="validation-error">{{$message}}</span>
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-lg-6">
|
||||
<div class="form-group">
|
||||
<label class="form-label" for="amount_report">Jumlah Laporan<span class="required-input">*</span></label>
|
||||
<div class="form-control-wrap">
|
||||
<input type="number" class="form-control @error('amount_report') border-danger @enderror" id="amount_report" name="amount_report" placeholder="Masukan jumlah laporan" value="{{$mediaOrder->amount_report}}" min="1" max="100">
|
||||
</div>
|
||||
@error('amount_report')
|
||||
<span class="validation-error">{{$message}}</span>
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-lg-12">
|
||||
<div class="form-group">
|
||||
<label class="form-label" for="phone-no-1">Deskripsi Tugas<span class="required-input">*</span></label>
|
||||
<div class="form-control-wrap">
|
||||
<textarea class="tinymce-basic form-control" name="task_description">{!!$mediaOrder->task_description!!}</textarea>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-12">
|
||||
<hr>
|
||||
<div class="form-group d-flex justify-content-end">
|
||||
<a href="{{route('dashboard.cooperations.index')}}" class="btn btn-white btn-dim btn-outline-light mx-2"><span>Kembali</span></a>
|
||||
<button type="button" class="btn btn-md btn-primary" id="submitButton">Simpan</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- content @e -->
|
||||
@include('partials.dashboard.footer', ['rich_editor' => true])
|
||||
@ -368,9 +368,10 @@
|
||||
columns: [
|
||||
{ data: 'DT_RowIndex', name: 'DT_RowIndex', orderable: false, searchable: false },
|
||||
{ data: 'name', name: 'name' },
|
||||
{ data: 'start_date', name: 'start_date' },
|
||||
{ data: 'end_date', name: 'end_date' },
|
||||
// { data: 'start_date', name: 'start_date' },
|
||||
// { data: 'end_date', name: 'end_date' },
|
||||
{ data: 'posted_at', name: 'posted_at' },
|
||||
{ data: 'status', name: 'status' },
|
||||
{ data: 'action', name: 'action', orderable: false, searchable: false },
|
||||
{ data: 'created_at', name: 'created_at', visible: false },
|
||||
{ data: 'id', name: 'id', orderable: true, searchable: false, visible: false },
|
||||
@ -507,6 +508,35 @@
|
||||
</script>
|
||||
@endif
|
||||
|
||||
@if ($datatable === 'order_media')
|
||||
<script>
|
||||
$(document).ready(function() {
|
||||
$('#orderMediaTable').DataTable({
|
||||
processing: true,
|
||||
serverSide: true,
|
||||
ajax: '{{ route('dashboard.media.orders.media.data', ["id" => encrypt_id($mediaCooperation->id)]) }}',
|
||||
columns: [
|
||||
{ data: 'DT_RowIndex', name: 'DT_RowIndex', orderable: false, searchable: false },
|
||||
{ data: 'media_name', name: 'media_name' },
|
||||
{ data: 'company_name', name: 'company_name' },
|
||||
{ data: 'email', name: 'email' },
|
||||
{ data: 'type', name: 'type' },
|
||||
{ data: 'classification', name: 'classification' },
|
||||
{ data: 'status', name: 'status' },
|
||||
{ data: 'created_at', name: 'created_at', visible: false },
|
||||
{ data: 'id', name: 'id', orderable: true, searchable: false, visible: false },
|
||||
],
|
||||
language: datatableLanguage,
|
||||
autoWidth: false,
|
||||
order: [[7, 'desc']],
|
||||
pagingType: "simple",
|
||||
lengthMenu: [[10, 25, 50, 100, -1], ['Tampilkan 10 data', 'Tampilkan 25 data', 'Tampilkan 50 data', 'Tampilkan 100 data', 'Tampilkan semua']],
|
||||
scrollX: true
|
||||
});
|
||||
});
|
||||
</script>
|
||||
@endif
|
||||
|
||||
@if ($datatable === 'content_recap')
|
||||
<script>
|
||||
$(document).ready(function() {
|
||||
|
||||
@ -116,6 +116,17 @@ function statusAction(url, message, confirmButtonAction) {
|
||||
</script>
|
||||
@endif
|
||||
|
||||
@if (session('warning-status'))
|
||||
<script>
|
||||
Swal.fire({
|
||||
icon: 'warning',
|
||||
title: 'Informasi',
|
||||
text: '{{ session('warning-status') }}',
|
||||
confirmButtonText: 'OK'
|
||||
});
|
||||
</script>
|
||||
@endif
|
||||
|
||||
<script>
|
||||
$('#submitButton').click(function(e) {
|
||||
e.preventDefault();
|
||||
|
||||
@ -143,7 +143,7 @@
|
||||
<span class="nk-menu-text">Kerjasama Media</span>
|
||||
</a>
|
||||
</li><!-- .nk-menu-item -->
|
||||
@if (is_role(['1']))
|
||||
{{-- @if (is_role(['1']))
|
||||
<li class="nk-menu-item">
|
||||
<a href="javascript:void(0);" class="nk-menu-link">
|
||||
<span class="nk-menu-icon"><em class="icon ni ni-briefcase"></em></span>
|
||||
@ -156,13 +156,13 @@
|
||||
<span class="nk-menu-text">Laporan</span>
|
||||
</a>
|
||||
</li><!-- .nk-menu-item -->
|
||||
@endif
|
||||
<li class="nk-menu-item">
|
||||
<a href="javascript:void(0);" class="nk-menu-link">
|
||||
<span class="nk-menu-icon"><em class="icon ni ni-check-circle-cut"></em></span>
|
||||
<span class="nk-menu-text">Selesai</span>
|
||||
</a>
|
||||
</li><!-- .nk-menu-item -->
|
||||
@endif --}}
|
||||
<li class="nk-menu-item">
|
||||
<a href="javascript:void(0);" class="nk-menu-link">
|
||||
<span class="nk-menu-icon"><em class="icon ni ni-archive"></em></span>
|
||||
|
||||
@ -15,6 +15,7 @@
|
||||
use App\Http\Controllers\Dashboard\MediaController;
|
||||
use App\Http\Controllers\Dashboard\MediaCooperationController;
|
||||
use App\Http\Controllers\Dashboard\MediaMonitoringController;
|
||||
use App\Http\Controllers\Dashboard\MediaOrderController;
|
||||
use App\Http\Controllers\Dashboard\NewsController;
|
||||
use App\Http\Controllers\Dashboard\OverviewController;
|
||||
use App\Http\Controllers\Dashboard\RoleController;
|
||||
@ -266,6 +267,8 @@
|
||||
Route::get('/{id}/edit', 'edit')->name('edit');
|
||||
Route::put('/{id}', 'update')->name('update');
|
||||
Route::delete('/{id}', 'destroy')->name('destroy');
|
||||
|
||||
Route::get('/{id}/process/{process}', 'process')->name('process');
|
||||
});
|
||||
|
||||
Route::get('/data', [DatatableController::class, 'cooperation'])->name('data');
|
||||
@ -284,8 +287,8 @@
|
||||
Route::get('/my-proposals', 'mediaProposal')->name('media.proposals');
|
||||
Route::get('/my-proposals/{id}/show', 'mediaProposalShow')->name('media.proposals.show');
|
||||
Route::post('/{id}/accept', 'accept')->name('accept');
|
||||
Route::get('/{id}/proposal', 'proposal')->name('proposal');
|
||||
Route::post('/{id}/proposal', 'proposalAction')->name('proposal.action');
|
||||
Route::get('/{id}/proposal', 'createProposal')->name('proposal');
|
||||
Route::post('/{id}/proposal', 'storeProposal')->name('proposal.action');
|
||||
Route::get('/{id}/reject', 'reject')->name('reject');
|
||||
Route::post('/{id}/reject', 'rejectAction')->name('reject.action');
|
||||
|
||||
@ -300,6 +303,30 @@
|
||||
});
|
||||
});
|
||||
|
||||
Route::prefix('media-orders')->name('media.orders.')->group(function(){
|
||||
Route::controller(MediaOrderController::class)->group(function(){
|
||||
Route::get('/', 'index')->name('index');
|
||||
Route::get('/{id}/show', 'show')->name('show');
|
||||
|
||||
Route::middleware('role:1')->group(function(){
|
||||
Route::get('/create/{id}', 'create')->name('create');
|
||||
Route::post('/{id}', 'store')->name('store');
|
||||
Route::get('/{id}/edit', 'edit')->name('edit');
|
||||
Route::put('/{id}', 'update')->name('update');
|
||||
Route::delete('/{id}', 'destroy')->name('destroy');
|
||||
|
||||
});
|
||||
|
||||
Route::middleware('role:3')->group(function(){
|
||||
Route::post('/{id}/accept', 'accept')->name('accept');
|
||||
Route::post('/{id}/reject', 'reject')->name('reject');
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
Route::get('/media-data/{id}', [DatatableController::class, 'orderMedia'])->name('media.data');
|
||||
});
|
||||
|
||||
Route::middleware('role:1,4')->group(function(){
|
||||
Route::prefix('content-recaps')->name('content.recaps.')->group(function(){
|
||||
Route::controller(ContentRecapController::class)->group(function(){
|
||||
|
||||
Loading…
Reference in New Issue
Block a user