first commit

This commit is contained in:
Andini Royyanti 2024-06-21 12:24:27 +07:00
commit 1b56734096
19222 changed files with 2148325 additions and 0 deletions

18
.editorconfig Normal file
View File

@ -0,0 +1,18 @@
root = true
[*]
charset = utf-8
end_of_line = lf
insert_final_newline = true
indent_style = space
indent_size = 4
trim_trailing_whitespace = true
[*.md]
trim_trailing_whitespace = false
[*.{yml,yaml}]
indent_size = 2
[docker-compose.yml]
indent_size = 4

53
.env Normal file
View File

@ -0,0 +1,53 @@
APP_NAME=Laravel
APP_ENV=local
APP_KEY=base64:KMDQqYl4YG9s6Oj5m3R4GwYoVzIltAM2zlfUfVdkszw=
APP_DEBUG=true
APP_URL=https://postamu.com
APP_FORCE_HTTPS=true
LOG_CHANNEL=stack
LOG_DEPRECATIONS_CHANNEL=null
LOG_LEVEL=debug
DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=skripsi
DB_USERNAME=root
DB_PASSWORD=
BROADCAST_DRIVER=log
CACHE_DRIVER=file
FILESYSTEM_DRIVER=local
QUEUE_CONNECTION=sync
SESSION_DRIVER=file
SESSION_LIFETIME=120
MEMCACHED_HOST=127.0.0.1
REDIS_HOST=127.0.0.1
REDIS_PASSWORD=null
REDIS_PORT=6379
# MAIL_MAILER=smtp
# MAIL_HOST=kelola.biz.id
# MAIL_PORT=465
# MAIL_USERNAME=info@kelola.biz.id
# MAIL_PASSWORD="default123@#"
# MAIL_ENCRYPTION=ssl
# MAIL_FROM_ADDRESS=info@kelola.biz.id
# MAIL_FROM_NAME="${APP_NAME}"
AWS_ACCESS_KEY_ID=cd5094c0f1086272cf69ed521c5ec316
AWS_SECRET_ACCESS_KEY=bd99a32384636d52baa21504faafe0d60c5a4a6449131bccb7ba6468d7010021
AWS_DEFAULT_REGION=auto
AWS_BUCKET=cdn-progriva
AWS_USE_PATH_STYLE_ENDPOINT=false
PUSHER_APP_ID=
PUSHER_APP_KEY=
PUSHER_APP_SECRET=
PUSHER_APP_CLUSTER=mt1
MIX_PUSHER_APP_KEY="${PUSHER_APP_KEY}"
MIX_PUSHER_APP_CLUSTER="${PUSHER_APP_CLUSTER}"

52
.env.example Normal file
View File

@ -0,0 +1,52 @@
APP_NAME=Laravel
APP_ENV=local
APP_KEY=
APP_DEBUG=true
APP_URL=http://localhost
LOG_CHANNEL=stack
LOG_DEPRECATIONS_CHANNEL=null
LOG_LEVEL=debug
DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=laravel
DB_USERNAME=root
DB_PASSWORD=
BROADCAST_DRIVER=log
CACHE_DRIVER=file
FILESYSTEM_DRIVER=local
QUEUE_CONNECTION=sync
SESSION_DRIVER=file
SESSION_LIFETIME=120
MEMCACHED_HOST=127.0.0.1
REDIS_HOST=127.0.0.1
REDIS_PASSWORD=null
REDIS_PORT=6379
MAIL_MAILER=smtp
MAIL_HOST=mailhog
MAIL_PORT=1025
MAIL_USERNAME=null
MAIL_PASSWORD=null
MAIL_ENCRYPTION=null
MAIL_FROM_ADDRESS=null
MAIL_FROM_NAME="${APP_NAME}"
AWS_ACCESS_KEY_ID=
AWS_SECRET_ACCESS_KEY=
AWS_DEFAULT_REGION=us-east-1
AWS_BUCKET=
AWS_USE_PATH_STYLE_ENDPOINT=false
PUSHER_APP_ID=
PUSHER_APP_KEY=
PUSHER_APP_SECRET=
PUSHER_APP_CLUSTER=mt1
MIX_PUSHER_APP_KEY="${PUSHER_APP_KEY}"
MIX_PUSHER_APP_CLUSTER="${PUSHER_APP_CLUSTER}"

15
.htaccess Normal file
View File

@ -0,0 +1,15 @@
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteRule ^(.*)$ public/$1 [L]
</IfModule>
# php -- BEGIN cPanel-generated handler, do not edit
# Set the “ea-php81” package as the default “PHP” programming language.
<IfModule mime_module>
AddHandler application/x-httpd-ea-php81 .php .php8 .phtml
</IfModule>
# php -- END cPanel-generated handler, do not edit

14
.styleci.yml Normal file
View File

@ -0,0 +1,14 @@
php:
preset: laravel
version: 8
disabled:
- no_unused_imports
finder:
not-name:
- index.php
- server.php
js:
finder:
not-name:
- webpack.mix.js
css: true

View File

View File

@ -0,0 +1,5 @@
<?php
return [
'name' => 'Seller'
];

View File

View File

View File

@ -0,0 +1,21 @@
<?php
namespace Modules\Seller\Database\Seeders;
use Illuminate\Database\Seeder;
use Illuminate\Database\Eloquent\Model;
class SellerDatabaseSeeder extends Seeder
{
/**
* Run the database seeds.
*
* @return void
*/
public function run()
{
Model::unguard();
// $this->call("OthersTableSeeder");
}
}

View File

View File

@ -0,0 +1,22 @@
<?php
namespace Modules\Seller\Entities;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Factories\HasFactory;
class AccountModel extends Model
{
use HasFactory;
protected $table = 'tbl_users';
protected $fillable = ['id','password','username','name','email','email_verified_token','email_verified_at','phone','income','balance','campaign','remember_token','is_close_guide','is_buzzer','thumbnail','level', 'is_buzzer_gender', 'is_advertiser'];
protected $hidden = [
'password',
'remember_token',
];
protected $casts = [
'email_verified_at' => 'datetime',
];
public $timestamps = false;
}

View File

@ -0,0 +1,19 @@
<?php
namespace Modules\Seller\Entities;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Factories\HasFactory;
class BillingModel extends Model
{
use HasFactory;
protected $table = 'tbl_billing';
protected $fillable = [
'id', 'invoice_id', 'user_id'
];
protected $keyType = 'string';
public $incrementing = false;
public $timestamps = false;
}

View File

@ -0,0 +1,25 @@
<?php
namespace Modules\Seller\Entities;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Factories\HasFactory;
class NotificationModel extends Model
{
use HasFactory;
protected $table = 'tbl_notifications';
protected $primaryKey = 'uid';
protected $fillable = [
'uid', 'user_id', 'notifyAs',
'onUpdateProduct', 'onUpdateNews',
'onUpdateOrders', 'created_at', 'updated_at'
];
protected $hidden = [
'created_at', 'updated_at'
];
protected $keyType = 'string';
public $incrementing = false;
}

View File

@ -0,0 +1,18 @@
<?php
namespace Modules\Seller\Entities;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Factories\HasFactory;
class NotifyModel extends Model
{
use HasFactory;
protected $fillable = [];
protected static function newFactory()
{
return \Modules\Seller\Database\factories\NotifyModelFactory::new();
}
}

View File

@ -0,0 +1,37 @@
<?php
namespace Modules\Seller\Entities;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Carbon\Carbon;
use Modules\Seller\Entities\AccountModel;
class PaymentModel extends Model
{
use HasFactory;
protected $table = 'tbl_deposit';
protected $fillable = [
'id', 'user_id', 'deposit_number', 'payment_method',
'methodWith', 'amount', 'processing_fee', 'total',
'is_status', 'created_at', 'updated_at', 'urlRedirect',
'is_reference'
];
protected $hidden = [
'created_at', 'updated_at'
];
protected $keyType = 'string';
public $incrementing = false;
public function getCreatedAtAttribute($value)
{
return Carbon::parse($value)->format('Y-m-d H:i:s');
}
public function user()
{
return $this->hasMany(AccountModel::class, 'id', 'user_id');
}
}

View File

@ -0,0 +1,29 @@
<?php
namespace Modules\Seller\Entities;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Factories\HasFactory;
class ProductModel extends Model
{
use HasFactory;
protected $table = 'tbl_product';
protected $fillable = [
'id', 'user_id', 'name', 'description',
'is_role', 'is_type', 'is_delivery_time', 'is_price',
'is_status', 'thumbnail'
];
protected $hidden = [
'created_at', 'updated_at',
];
protected $keyType = 'string';
public $incrementing = false;
public function user()
{
return $this->hasOne(AccountModel::class, 'id', 'user_id');
}
}

View File

@ -0,0 +1,17 @@
<?php
namespace Modules\Seller\Entities;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Factories\HasFactory;
class RekeningBankModel extends Model
{
use HasFactory;
protected $table = 'tbl_rekeningbank';
protected $fillable = ['id', 'nama', 'kodebank'];
protected $hidden = ['id', 'kodebank'];
public $timestamps = false;
}

View File

@ -0,0 +1,22 @@
<?php
namespace Modules\Seller\Entities;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Factories\HasFactory;
class RekeningModel extends Model
{
use HasFactory;
protected $table = 'tbl_rekening';
protected $fillable = ['id', 'rid', 'account_number', 'is_active',
'created_at', 'updated_at', 'user_id', 'name'
];
protected $hidden = [
'created_at', 'updated_at'
];
protected $keyType = 'string';
public $incrementing = false;
}

View File

@ -0,0 +1,34 @@
<?php
namespace Modules\Seller\Entities;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Factories\HasFactory;
class WithdrawalModel extends Model
{
use HasFactory;
protected $table = 'tbl_withdrawal';
protected $fillable = [
'id', 'user_id', 'amount', 'is_status', 'is_account',
'created_at', 'updated_at', 'invoice_id'
];
protected $keyType = 'string';
public $incrementing = false;
public function user()
{
return $this->hasMany(AccountModel::class, 'id', 'user_id');
}
public function rekening()
{
return $this->hasMany(RekeningModel::class, 'id', 'is_account');
}
public function getCreatedAtAttribute($value)
{
return date('Y-m-d H:i:s', strtotime($value));
}
}

View File

@ -0,0 +1,19 @@
<?php
namespace Modules\Seller\Events;
use Illuminate\Foundation\Events\Dispatchable;
use Illuminate\Queue\SerializesModels;
use Modules\Seller\Entities\TicketResponseModel;
class TicketCreated
{
use Dispatchable, SerializesModels;
public $ticketResponse;
public function __construct(TicketResponseModel $ticketResponse)
{
$this->ticketResponse = $ticketResponse;
dd($ticketResponse);
}
}

View File

View File

@ -0,0 +1,456 @@
<?php
namespace Modules\Seller\Http\Controllers;
use Illuminate\Contracts\Support\Renderable;
use Illuminate\Http\Request;
use Illuminate\Routing\Controller;
use Illuminate\Support\Collection;
use Illuminate\Support\Facades\Validator;
use Illuminate\Support\Facades\Storage;
use Illuminate\Support\Str;
use DataTables;
use Modules\Seller\Entities\RekeningModel;
use Modules\Seller\Entities\NotificationModel as Notificator;
use Modules\Seller\Entities\RekeningBankModel as ListBank;
use Modules\User\Entities\OrderModel as Order;
use Modules\Seller\Entities\WithdrawalModel as Withdrawal;
use Modules\Seller\Entities\ProductModel as Product;
use App\Models\Seller;
use App\Models\User;
use App\Models\LogActivites;
use App\Enums\GlobalEnum;
use App\Helpers\MailerHelper as Mailers;
class AccountController extends Controller
{
public function index()
{
$data = [
'subtitle' => 'Akun Saya'
];
return view('seller::account.index', compact('data'));
}
public function preference()
{
$data = [
'subtitle' => 'Preferensi'
];
$getNotificationPreferences = Notificator::where('user_id', user()['id'])->where('notifyAs', GlobalEnum::isNotifyAsSeller)->first();
return view('seller::account.preference', compact('data', 'getNotificationPreferences'));
}
public function updateProfile(Request $request, $id)
{
$validator = Validator::make($request->all(), [
'name' => 'required',
'alias' => 'required',
'nama' => 'required',
'email' => 'required',
]);
if ($validator->fails()) {
return redirect()->back()->withErrors($validator)->withInput();
}
$input = $request->all();
$findUser = Seller::where('user_id', user()->id)->exists();
if($findUser) {
// update data
$updateUser = Seller::where('user_id', user()->id)->first();
$updateUser->name = $input['name'];
$updateUser->alias = $input['alias'];
$findAccount = User::where('id', user()->id)->first();
$findAccount->name = $input['nama'];
$findAccount->email = $input['email'];
!empty($input['password']) ? $findAccount->password = bcrypt($input['password']) : '';
// save data
$updateUser->save();
$findAccount->save();
return redirect()->back()->with('swal', swal_alert('success', 'Data berhasil disimpan'));
} else {
$seller = new Seller([
'uuid' => Str::uuid(),
'user_id' => user()->id,
'name' => $input['name'],
'alias' => $input['alias'],
'is_active' => 1,
]);
if ($seller->save()) {
return redirect()->back()->with('swal', swal_alert('success', 'Anda berhasil mengkonfirmasi akun sebagai vendor party planner'));
} else {
return redirect()->back()->with('swal', swal_alert('error', 'Terjadi kesalahan pada sistem!'));
}
}
}
public function updatePreference(Request $request, $id)
{
$validator = Validator::make($request->all(), [
'updateProduct' => 'string',
'updateNews' => 'string',
'updateOrder' => 'string',
]);
if ($validator->fails()) {
return redirect()->back()->withErrors($validator)->withInput();
}
$input = $request->all();
$findPreference = Notificator::where('user_id', user()->id)->where('notifyAs', GlobalEnum::isNotifyAsSeller)->first();
$checkPreference = Notificator::where('user_id', user()->id)->where('notifyAs', GlobalEnum::isNotifyAsSeller)->count();
if($checkPreference > 0) {
// update data
$findPreference->onUpdateProduct = $request->has('updateProduct') ? 1 : 0;
$findPreference->onUpdateNews = $request->has('updateNews') ? 1 : 0;
$findPreference->onUpdateOrders = $request->has('updateOrder') ? 1 : 0;
// save data
// dd($findPreference);
$findPreference->save();
return redirect()->back()->with('swal', swal_alert('success', 'Data berhasil disimpan'));
} else {
$updateProduct = $request->has('updateProduct') ? 1 : 0;
$updateNews = $request->has('updateNews') ? 1 : 0;
$updateOrder = $request->has('updateOrder') ? 1 : 0;
$post = new Notificator([
'uid' => Str::uuid(),
'user_id' => user()->id,
'notifyAs' => GlobalEnum::isNotifyAsSeller,
'onUpdateProduct' => $updateProduct,
'onUpdateNews' => $updateNews,
'onUpdateOrders' => $updateOrder
]);
if ($post->save()) {
return redirect()->back()->with('swal', swal_alert('success', 'Anda berhasil menambahkan data baru'));
} else {
return redirect()->back()->with('swal', swal_alert('error', 'Terjadi kesalahan pada sistem!'));
}
}
}
// controller::for-rekening
public function rekening(Request $request)
{
if ($request->ajax()) {
$data = RekeningModel::where('user_id', auth()->user()->id)->select('*');
// Convert the Eloquent Collection to a regular PHP array
$data->each(function ($item, $key) {
$item->rowIndex = $key + 1;
});
return Datatables::of($data)
->addIndexColumn()
->addColumn('title-post', function($row){
$getNameofBank = ListBank::where('id', $row->rid)->first()->nama;
$text = '
<p class="mb-0">' . $row->account_number . ' - ' . $getNameofBank . '</p>
';
return $text;
})
->addColumn('action', function($row){
$edit = route('rekening.edit', ['id' => $row->id]);
$delete = route('rekening.delete', ['id' => $row->id]);
$btn = '
<a href="' . $edit . '" class="btn btn-light btn-sm px-4"><i class="ki-outline ki-pencil"></i></a>
<a data-url="' . $delete . '" href="#" class="btn btn-light btn-sm deleteContent px-4"><i class="ki-outline ki-trash"></i></a>
';
return $btn;
})
->addColumn('status', function($row){
if ($row->is_active == GlobalEnum::isRekeningActive) {
return '<span class="mb-1 badge font-medium bg-light-success text-success px-2 py-1">Aktif</span>';
} elseif($row->is_active == GlobalEnum::isRekeningInactive) {
return '<span class="mb-1 badge font-medium bg-light-primary text-primary px-2 py-1">Tidak Aktif</span>';
}
})
->rawColumns(['title-post','action','status'])
->make(true);
}
$data = [
'subtitle' => 'Semua Rekening',
'button' => true,
'module' => [
'url' => site_url('seller', 'account/rekening/create'),
'name' => 'Tambah baru'
]
];
return view('seller::account.rekening.index', compact('data'));
}
public function createRekening()
{
$data = [
'subtitle' => 'Tambah Baru'
];
$listAllBank = ListBank::all();
return view('seller::account.rekening.add', compact('data', 'listAllBank'));
}
public function storeRekening(Request $request)
{
$validator = Validator::make($request->all(), [
'name' => 'required',
'account_number' => 'required|numeric',
'rid' => 'required',
]);
if($validator->fails()) {
return redirect()->back()->with('swal', swal_alert('error', 'Terjadi kesalahan saat menambahkan rekening ' . $validator->errors()->first()))->withInput();
}
$input = $request->all();
$post = new RekeningModel([
'id' => Str::uuid(),
'user_id' => auth()->user()->id,
'account_number' => $input['account_number'],
'rid' => $input['rid'],
'name' => $input['name'],
'is_active' => 1
]);
$check = RekeningModel::where('account_number', $input['account_number'])->count();
if($check == 0) {
if($post->save()) {
return redirect()->to(site_url('seller', 'account/rekening'))->with('swal', swal_alert('success', 'Anda berhasil menambahkan rekening.'));
} else {
return redirect()->back()->with('swal', swal_alert('error', 'Terjadi kesalahan saat menambahkan rekening.'));
}
} else {
return redirect()->back()->with('swal', swal_alert('error', 'Ditemukan data yang telah ada'));
}
}
public function editRekening($id)
{
$data = [
'subtitle' => 'Edit'
];
$listAllBank = ListBank::all();
$getDetailAccount = RekeningModel::find($id);
return view('seller::account.rekening.edit', compact('data', 'listAllBank', 'getDetailAccount'));
}
public function updateRekening(Request $request, $id)
{
$validator = Validator::make($request->all(), [
'name' => 'required',
'rid' => 'required',
'account_number' => 'required|numeric',
'is_active' => 'required'
]);
if ($validator->fails()) {
return redirect()->back()->with('swal', swal_alert('error', $validator->errors()->first()))->withInput();
}
$input = $request->all();
$account = RekeningModel::find($id);
if($account) {
$account->name = $input['name'];
$account->rid = $input['rid'];
$account->account_number = $input['account_number'];
$account->is_active = $input['is_active'];
$account->save();
return redirect()->to(site_url('seller', 'account/rekening'))->with('swal', swal_alert('success', 'Berhasil memperbarui rekening.'));
} else {
return redirect()->back()->with('swal', swal_alert('error', 'Rekening tidak ditemukan.'));
}
}
public function removeRekening($id)
{
$account = RekeningModel::find($id);
if($account) {
$account->delete();
return redirect()->to(site_url('seller', 'account/rekening'))->with('swal', swal_alert('success', 'Berhasil menghapus data.'));
} else {
return redirect()->back()->with('swal', swal_alert('error', 'Site tidak ditemukan.'));
}
}
public function withdrawal(Request $request)
{
if ($request->ajax()) {
$data = Withdrawal::where('user_id', auth()->user()->id)->select('id', 'invoice_id', 'user_id', 'amount', 'is_status', 'is_account');
return Datatables::of($data)
->addIndexColumn()
->addColumn('invoice-number', function($row){
$text = '
<p class="fw-bold mb-n1">#' . $row->invoice_id . '</p>
';
return $text;
})
->addColumn('account', function($row){
$checkBank = ListBank::where('id', $row->rekening->first()->rid)->first();
$checkUserBank = RekeningModel::where('id', $row->is_account)->first();
$text = '
<p class="fw-bold mb-0">' . $checkUserBank->account_number . '</p>
<p class="small text-gray-400 mb-n1">' . $checkUserBank->name . ' / ' . $checkBank->nama . '</p>
';
return $text;
})
->addColumn('status', function($row){
if ($row->is_status == GlobalEnum::isWithdrawPending) {
return '<span class="mb-1 badge font-medium bg-light-warning text-warning py-3 px-4 fs-7">Menunggu Pembayaran</span>';
} elseif($row->is_status == GlobalEnum::isWithdrawOnProgress) {
return '<span class="mb-1 badge font-medium bg-light-primary text-primary py-3 px-4 fs-7">Sedang Proses</span>';
} elseif($row->is_status == GlobalEnum::isWithdrawPaid) {
return '<span class="mb-1 badge font-medium bg-light-success text-success py-3 px-4 fs-7">Dibayarkan</span>';
} elseif($row->is_status == GlobalEnum::isWithdrawCancel) {
return '<span class="mb-1 badge font-medium bg-light-danger text-danger py-3 px-4 fs-7">Dibatalkan</span>';
}
})
->addColumn('price', function($row){
return 'Rp. ' . number_format($row->amount, 0, ',', '.');
})
->rawColumns(['invoice-number','account','status','price'])
->filter(function ($query) use ($request) {
if ($request->has('search')) {
$search = $request->get('search')['value'];
$filterCategory = explode('|', $search);
if($filterCategory[0] === 'status') {
if(!empty($filterCategory[1])) {
$query->where('is_status', '=', $filterCategory[1]);
} else {
$query->get();
}
} elseif($filterCategory[0] === 'invoice') {
if(!empty($filterCategory[1])) {
$query->where('invoice_id', 'LIKE', "%$filterCategory[1]%");
} else {
$query->get();
}
}
}
})
->make(true);
}
$data = [
'subtitle' => 'Penarikan',
'button' => true,
'module' => [
'url' => site_url('seller', 'account/withdrawal/create'),
'name' => 'Tarik Tunai'
]
];
return view('seller::account.withdraw.index', compact('data'));
}
public function createRequest()
{
$data = [
'subtitle' => 'Tarik Tunai',
];
$getListOfBank = RekeningModel::where('user_id', user()->id)->get();
return view('seller::account.withdraw.add', compact('data', 'getListOfBank'));
}
public function storeRequest(Request $request)
{
$validator = Validator::make($request->all(), [
'amount' => 'required|numeric',
'is_account' => 'required'
]);
if($validator->fails()) {
return redirect()->back()->with('swal', swal_alert('error', $validator->errors()->first()))->withInput();
}
$input = $request->all();
$invoice_number = invoiceGenerator();
$post = new Withdrawal([
'id' => Str::uuid(),
'invoice_id' => $invoice_number,
'user_id' => user()->id,
'amount' => $input['amount'],
'is_status' => GlobalEnum::isWithdrawPending,
'is_account' => $input['is_account']
]);
if(user()->income < $input['amount']) {
return redirect()->back()->with('swal', swal_alert('error', 'Saldo tidak mencukupi untuk melakukan penarikan.'));
}
if($post->save())
{
LogActivites::default([
'causedBy' => user()->id,
'logType' => GlobalEnum::LogOfGeneral,
'withContent' => [
'status' => 'minus',
'text' => 'Anda berhasil melakukan permintaan tarik tunai pada tanggal ' . date('Y-m-d H:i:s'),
]
]);
return redirect()->to(site_url('seller', 'account/withdrawal'))->with('swal', swal_alert('success', 'Anda berhasil melakukan permintaan tarik tunai.'));
} else {
return redirect()->back()->with('swal', swal_alert('error', 'Terjadi kesalahan/data telah ada pada sistem.'));
}
}
public function viewRequest($invoice)
{
$payment = Withdrawal::find($invoice);
if($payment) {
$data = [
'subtitle' => 'Detil Penarikan',
];
return view('seller::account.withdraw.detail', compact('data', 'payment'));
} else {
return redirect()->back()->with('swal', swal_alert('error', 'Data tidak ditemukan.'));
}
}
public function cancelRequest($invoice)
{
$payment = Withdrawal::find($invoice);
if($payment) {
$payment->is_status = GlobalEnum::isWithdrawCancel;
if($payment->save()) {
LogActivites::default([
'causedBy' => user()->id,
'logType' => GlobalEnum::LogOfGeneral,
'withContent' => [
'status' => 'minus',
'text' => 'Anda berhasil melakukan pembatalan tarik tunai dengan kode invoice ' . $payment->invoice_id .' pada tanggal ' . date('Y-m-d H:i:s'),
]
]);
return redirect()->to(site_url('seller', 'account/withdrawal'))->with('swal', swal_alert('success', 'Anda berhasil melakukan pembatalan tarik tunai.'));
} else {
return redirect()->back()->with('swal', swal_alert('error', 'Terjadi kesalahan saat melakukan pembatalan penarikan.'));
}
} else {
return redirect()->back()->with('swal', swal_alert('error', 'Data tidak ditemukan.'));
}
}
}

View File

@ -0,0 +1,138 @@
<?php
namespace Modules\Seller\Http\Controllers;
use Illuminate\Http\Request;
use Illuminate\Routing\Controller;
use Illuminate\Support\Collection;
use Illuminate\Support\Facades\Validator;
use Illuminate\Support\Facades\Storage;
use Illuminate\Support\Str;
use DataTables;
// additional library loaded
use App\Enums\GlobalEnum;
use App\Helpers\MailerHelper as Mailers;
// additional model binding
use Modules\User\Entities\OrderModel as Order;
use Modules\User\Entities\OrderHistoryModel as OrderHistory;
use Modules\Seller\Entities\BillingModel as Billing;
use Modules\Seller\Entities\AccountModel as Account;
use Modules\Seller\Entities\PaymentModel as Payment;
use App\Models\User;
use App\Models\LogActivites;
class OrdersController extends Controller
{
public function index(Request $request)
{
if ($request->ajax()) {
$data = OrderHistory::where('seller_id', user()->id)->select('*')->orderBy('created_at', 'DESC');
// Convert the Eloquent Collection to a regular PHP array
$data->each(function ($item, $key) {
$item->rowIndex = $key + 1;
});
return Datatables::of($data)
->addIndexColumn()
->addColumn('pemesan', function($row){
return User::where('id', $row->buy_id)->first()->name;
})
->addColumn('invoice', function($row){
$text = '
<p class="fw-bold">#' . $row->order_id . '</p>
';
return $text;
})
->addColumn('status', function($row){
if ($row->is_status == 1) {
return '<span class="mb-1 badge font-medium bg-light-dark text-dark py-3 px-4 fs-7 text-center">Pending</span>';
} elseif($row->is_status == 2) {
return '<span class="mb-1 badge font-medium bg-light-primary text-primary py-3 px-4 fs-7 text-center">Dalam pengerjaan</span>';
} elseif($row->is_status == 3) {
return '<span class="mb-1 badge font-medium bg-light-success text-success py-3 px-4 fs-7 text-center">Selesai</span>';
} elseif($row->is_status == 4) {
return '<span class="mb-1 badge font-medium bg-light-danger text-danger py-3 px-4 fs-7 text-center">Dibatalkan</span>';
}
})
->addColumn('harga', function($row){
return 'Rp. ' . number_format($row->price, 0, ',', '.');
})
->filter(function ($query) use ($request) {
if ($request->has('search')) {
$search = $request->get('search')['value'];
$filterCategory = explode('|', $search);
if($filterCategory[0] === 'status') {
if(!empty($filterCategory[1])) {
$query->where('is_status', $filterCategory[1]);
} else {
$query->get();
}
} elseif($filterCategory[0] === 'orders') {
if(!empty($filterCategory[1])) {
$query->where('invoice_number', 'LIKE', "%$filterCategory[1]%");
} else {
$query->get();
}
}
}
})
->rawColumns(['invoice', 'status','harga', 'pemesan'])
->make(true);
}
$data = [
'subtitle' => 'Semua Pesanan'
];
return view('seller::orders.index', compact('data'));
}
public function view($invoice)
{
$check = OrderHistory::where('order_id', $invoice)->first();
if($check)
{
$data = [
'subtitle' => 'Detil Pesanan'
];
$getInfoOrders = $check;
return view('seller::orders.detail', compact('data', 'getInfoOrders'));
} else {
return redirect()->back()->with('swal', swal_alert('error', 'Tidak ditemukan data yang anda cari'));
}
}
public function complete(Request $request, $invoice)
{
$check = OrderHistory::where('order_id', $invoice)->where('seller_id', user()->id)->first();
if($check)
{
$check->is_status = 3;
$check->save();
return redirect()->back()->with('swal', swal_alert('success', 'Anda telah berhasil memperbarui status'));
} else {
return redirect()->back()->with('swal', swal_alert('error', 'Tidak ditemukan data yang anda cari'));
}
}
public function working(Request $request, $invoice)
{
$check = OrderHistory::where('order_id', $invoice)->where('seller_id', user()->id)->first();
if($check)
{
$check->is_status = 2;
$check->save();
return redirect()->back()->with('swal', swal_alert('success', 'Anda telah berhasil memperbarui status'));
} else {
return redirect()->back()->with('swal', swal_alert('error', 'Tidak ditemukan data yang anda cari'));
}
}
}

View File

@ -0,0 +1,269 @@
<?php
namespace Modules\Seller\Http\Controllers;
use Illuminate\Contracts\Support\Renderable;
use Illuminate\Http\Request;
use Illuminate\Routing\Controller;
use Illuminate\Support\Collection;
use Illuminate\Support\Facades\Validator;
use Illuminate\Support\Facades\Storage;
use Illuminate\Support\Str;
use DataTables;
use Modules\Seller\Entities\ProductModel;
use App\Models\User;
use App\Models\Seller;
use App\Enums\GlobalEnum;
class ProductController extends Controller
{
/**
* Display a listing of the resource.
* @return Renderable
*/
public function index(Request $request)
{
// 94
if ($request->ajax()) {
$data = ProductModel::where('user_id', auth()->user()->id)->orderBy('created_at', 'desc');
return Datatables::eloquent($data)
->addIndexColumn()
->addColumn('title-post', function($row){
return $row->name;
})
->addColumn('author', function($row){
$user = User::where('id', $row->user_id)->first();
if($user) {
$name = $user->name;
$email = gravatar_team($user->email);
} else {
$name = '-';
$email = gravatar_team('random' . rand(111, 999) . '@gmail.com');
}
return '
<div class="d-flex align-items-center">
<div class="symbol symbol-25px symbol-circle">
<div class="symbol-label" style="background-image:url(' . $email . ')"></div>
</div>
<div class="ms-3"><span>' . $name . '</span></div>
</div>
';
})
->addColumn('is_status', function($row){
if ($row->is_status == GlobalEnum::isSiteActive) {
return '<span class="mb-1 badge font-medium bg-light-success text-success py-3 px-4 fs-7">Aktif</span>';
} elseif($row->is_status == GlobalEnum::isSiteInReview) {
return '<span class="mb-1 badge font-medium bg-light-primary text-primary py-3 px-4 fs-7">Dalam review</span>';
} elseif($row->is_status == GlobalEnum::isSiteNotActive) {
return '<span class="mb-1 badge font-medium bg-light-danger text-danger py-3 px-4 fs-7">Tidak aktif</span>';
} elseif($row->is_status == GlobalEnum::isSiteRejected) {
return '<span class="mb-1 badge font-medium bg-light-warning text-warning py-3 px-4 fs-7">Ditolak</span>';
} elseif($row->is_status == GlobalEnum::isSiteDeactivated) {
return '<span class="mb-1 badge font-medium bg-light-info text-info py-3 px-4 fs-7">Dimatikan</span>';
}
})
->addColumn('type', function($row){
if ($row->is_type == 1) {
return 'Pre/Weeding';
} elseif($row->is_type == 2) {
return 'Engagement';
} elseif($row->is_type == 3) {
return 'Party';
} else {
return 'Other';
}
})
->addColumn('price', function($row){
return 'Rp. ' . number_format($row->is_price, 0, ',', '.');
})
->addColumn('delivery_time', function($row){
return $row->is_delivery_time . ' Hari';
})
->rawColumns(['title-post', 'author', 'is_status', 'type', 'price', 'delivery_time'])
->filter(function ($query) use ($request) {
if ($request->has('search')) {
$search = $request->get('search')['value'];
$filterCategory = explode('|', $search);
if($filterCategory[0] === 'status') {
if(!empty($filterCategory[1])) {
$query->where('is_status', '=', $filterCategory[1]);
} else {
$query->get();
}
} elseif($filterCategory[0] === 'sites') {
if(!empty($filterCategory[1])) {
$query->where('name', 'LIKE', "%$filterCategory[1]%");
} else {
$query->get();
}
}
}
})
->make(true);
}
$data = [
'subtitle' => 'Semua Produk',
'button' => true,
'module' => [
'url' => site_url('seller', 'product/create'),
'name' => 'Tambah baru'
]
];
return view('seller::product.index', compact('data'));
}
public function create()
{
$data = [
'subtitle' => 'Tambah Baru'
];
return view('seller::product.add', compact('data'));
}
public function store(Request $request)
{
$validator = Validator::make($request->all(), [
'name' => 'required',
'description' => 'required',
'type' => 'required',
'is_price' => 'required',
'is_delivery_time' => 'required',
'image' => 'image|mimes:jpg,jpeg,png,svg|max:7048',
], [
'image.mimes' => 'Tipe file yang diunggah harus jpg, jpeg, png, atau svg.',
]);
if ($validator->fails()) {
return redirect()->back()->with('swal', swal_alert('error', $validator->errors()->first()))->withInput();
}
$input = $request->all();
$foto_namaBaru = null;
if ($request->hasFile('image') && $request->file('image')->isValid()) {
$foto_namaBaru = $request->file('image')->store('public/images');
}
$post = new ProductModel([
'id' => Str::uuid(),
'user_id' => user()->id,
'name' => $input['name'], // Membersihkan input judul menggunakan Purifier
'description' => clean($input['description']), // Membersihkan input deskripsi menggunakan Purifier
'is_role' => 2,
'is_type' => $input['type'],
'is_price' => $input['is_price'],
'is_delivery_time' => $input['is_delivery_time'],
'is_status' => 1,
'thumbnail' => $foto_namaBaru
]);
$check = ProductModel::where('name', $input['name'])->where('is_type', $input['type'])->count();
if ($check == 0) {
if ($post->save()) {
return redirect()->to(site_url('seller','product'))->with('swal', swal_alert('success', 'Anda berhasil menambahkan data baru'));
} else {
return redirect()->back()->with('swal', swal_alert('error', 'Terjadi kesalahan pada sistem!'));
}
} else {
return redirect()->back()->with('swal', swal_alert('error', 'Galat! Ditemukan data yang sudah ada.'));
}
}
public function edit($id)
{
$data = [
'subtitle' => 'Edit',
];
$getSitesInfo = ProductModel::find($id);
return view('seller::product.edit', compact('data', 'getSitesInfo'));
}
public function update(Request $request, $id)
{
$validator = Validator::make($request->all(), [
'name' => 'required',
'description' => 'required',
'type' => 'required',
'is_price' => 'required',
'is_delivery_time' => 'required',
'is_status' => 'required',
'image' => 'image|mimes:jpg,jpeg,png,svg|max:7048',
], [
'image.mimes' => 'Tipe file yang diunggah harus jpg, jpeg, png, atau svg.',
]);
if ($validator->fails()) {
return redirect()->back()->with('swal', swal_alert('error', $validator->errors()->first()))->withInput();
}
$input = $request->all();
$sites = ProductModel::find($id);
if($sites) {
if ($request->hasFile('image') && $request->file('image')->isValid()) {
if ($sites->is_thumbnail) {
Storage::delete($sites->is_thumbnail);
}
}
$sites->name = $input['name'];
$sites->description = clean($input['description']);
$sites->is_type = $input['type'];
$sites->is_price = $input['is_price'];
$sites->is_delivery_time = $input['is_delivery_time'];
$sites->is_status = $input['is_status'];
// Jika ada file baru yang diunggah, simpan file baru di storage
if ($request->hasFile('image') && $request->file('image')->isValid()) {
$foto_namaBaru = $request->file('image')->store('public/images');
$sites->is_thumbnail = $foto_namaBaru;
}
$sites->save();
return redirect()->to(site_url('seller','product'))->with('swal', swal_alert('success', 'Berhasil memperbarui data.'));
} else {
return redirect()->back()->with('swal', swal_alert('error', 'Data tidak ditemukan.'));
}
}
public function detail($id)
{
$check = ProductModel::where('id', $id)->first();
if($check) {
$detail = [
'name' => $check->name,
'description' => $check->description,
'is_role' => $check->is_role == GlobalEnum::isSiteOwner ? 'Owner' : 'Member',
'is_type' => $check->is_type == 1 ? 'Pre/Weeding' : ($check->is_type == 2 ? 'Engagement' : ($check->is_type == 3 ? 'Party' : 'Other')),
'is_price' => 'Rp. ' . number_format($check->is_price, '0', ',', '.'),
'is_delivery_time' => $check->is_delivery_time,
'is_seller' => $check->is_role == 1 ? 'Admin' :
(empty(Seller::where('user_id', $check->user_id)->first()) ? '-'
: Seller::where('user_id', $check->user_id)->first()->name),
];
return $detail;
}
}
public function destroy($id)
{
$sites = ProductModel::find($id);
if($sites) {
if($sites->thumbnail) {
Storage::delete($sites->thumbnail);
}
$sites->delete();
return redirect()->to(site_url('seller', 'product'))->with('swal', swal_alert('success', 'Berhasil menghapus data.'));
} else {
return redirect()->back()->with('swal', swal_alert('error', 'Data tidak ditemukan.'));
}
}
}

View File

@ -0,0 +1,51 @@
<?php
namespace Modules\Seller\Http\Controllers;
use Illuminate\Contracts\Support\Renderable;
use Illuminate\Http\Request;
use Illuminate\Routing\Controller;
use Illuminate\Support\Collection;
use Illuminate\Support\Facades\Validator;
use Illuminate\Support\Facades\Storage;
use Illuminate\Support\Str;
use DataTables;
use Modules\Seller\Entities\RekeningModel;
use Modules\Seller\Entities\RekeningBankModel as ListBank;
use Modules\User\Entities\OrderHistoryModel as Order;
use Modules\Seller\Entities\WithdrawalModel as Withdrawal;
use App\Models\LogActivites;
use WithPagination;
use App\Enums\GlobalEnum;
class ReportController extends Controller
{
public function index()
{
$getTotalIncomeOrder = Order::where('seller_id', user()->id)->sum('price');
$getTotalPendingIncomeOrder = Order::where('seller_id', user()->id)->where('is_status', 1)->sum('price');
$getListOrder = Order::where('seller_id', user()->id)->orderBy('created_at', 'desc')->limit(5)->get();
$getFlowOrder = Order::getTotalIncomeSeller();
$getTotalOrder = Order::where('seller_id', user()->id)->count();
$getListAwaitingWithdrawal = Withdrawal::where('is_status', 1)->where('user_id', user()->id)->count();
$data = [
'subtitle' => 'Keuangan dan Transaksi'
];
return view('seller::reports.index', compact('data', 'getTotalIncomeOrder', 'getTotalPendingIncomeOrder', 'getListOrder', 'getFlowOrder', 'getListAwaitingWithdrawal', 'getTotalOrder'));
}
public function statistic(Request $request)
{
$logsActivity = LogActivites::where('logType', GlobalEnum::LogOfLogin)->where('causedBy', user()->id)->orderBy('created_at', 'desc')->limit(5)->get();
$logGeneral = LogActivites::where('logType', GlobalEnum::LogOfGeneral)->where('causedBy', user()->id)->orderBy('created_at', 'desc')->limit(5)->get();
$data = [
'subtitle' => 'Riwayat Aktifitas'
];
return view('seller::reports.statistic', compact('data', 'logsActivity', 'logGeneral'));
}
}

View File

@ -0,0 +1,37 @@
<?php
namespace Modules\Seller\Http\Controllers;
use Illuminate\Contracts\Support\Renderable;
use Illuminate\Http\Request;
use Illuminate\Routing\Controller;
use Illuminate\Support\Collection;
use Illuminate\Support\Facades\Validator;
use Illuminate\Support\Facades\Storage;
use Illuminate\Support\Str;
use DataTables;
use Modules\Seller\Entities\RekeningModel;
use Modules\Seller\Entities\RekeningBankModel as ListBank;
use Modules\User\Entities\OrderModel as Order;
use Modules\User\Entities\OrderHistoryModel as History;
use Modules\Seller\Entities\ProductModel as Product;
use App\Enums\GlobalEnum;
class SellerController extends Controller
{
public function index()
{
$data = [
'subtitle' => 'Halaman Utama',
];
$getTotalOrders = History::where('seller_id', auth()->user()->id)->where('is_status', 1)->count();
$getTotalOrdersCancel = History::where('seller_id', auth()->user()->id)->where('is_status', 4)->count();
$getTotalWebsite = Product::where('user_id', auth()->user()->id)->count();
$getListOrder = History::where('seller_id', auth()->user()->id)->orderBy('created_at', 'desc')->limit(10)->get();
return view('seller::index', compact('data', 'getTotalOrders', 'getTotalOrdersCancel', 'getTotalWebsite', 'getListOrder'));
}
}

View File

View File

View File

@ -0,0 +1,25 @@
<?php
namespace Modules\Seller\Listeners;
use Modules\Seller\Events\TicketCreated;
use Modules\Seller\Entities\TicketResponseModel;
use Illuminate\Support\Str;
class TicketCreatedListener
{
public function handle(TicketCreated $event)
{
$ticket = $event->ticketResponse;
// Simpan data ke dalam TicketResponseModel
$ticketResponse = new TicketResponseModel([
'id' => Str::uuid(), // Generate UUID baru
'id_ticket' => $ticket->id, // Gunakan ID tiket yang baru saja dibuat
'user_id' => $ticket->user_id, // Isi dengan nilai yang sesuai
'message' => $ticket->message, // Sesuaikan dengan data yang diperlukan
]);
$ticketResponse->save();
}
}

View File

View File

@ -0,0 +1,17 @@
<?php
namespace Modules\Seller\Providers;
use Illuminate\Support\ServiceProvider;
use Illuminate\Support\Facades\Event;
use Modules\Seller\Events\TicketCreated;
use Modules\Seller\Listeners\TicketCreatedListener;
class EventServiceProvider extends ServiceProvider
{
protected $listen = [
TicketCreated::class => [
TicketCreatedListener::class,
],
];
}

View File

@ -0,0 +1,69 @@
<?php
namespace Modules\Seller\Providers;
use Illuminate\Support\Facades\Route;
use Illuminate\Foundation\Support\Providers\RouteServiceProvider as ServiceProvider;
class RouteServiceProvider extends ServiceProvider
{
/**
* The module namespace to assume when generating URLs to actions.
*
* @var string
*/
protected $moduleNamespace = 'Modules\Seller\Http\Controllers';
/**
* Called before routes are registered.
*
* Register any model bindings or pattern based filters.
*
* @return void
*/
public function boot()
{
parent::boot();
}
/**
* Define the routes for the application.
*
* @return void
*/
public function map()
{
$this->mapApiRoutes();
$this->mapWebRoutes();
}
/**
* Define the "web" routes for the application.
*
* These routes all receive session state, CSRF protection, etc.
*
* @return void
*/
protected function mapWebRoutes()
{
Route::middleware('web')
->namespace($this->moduleNamespace)
->group(module_path('Seller', '/Routes/web.php'));
}
/**
* Define the "api" routes for the application.
*
* These routes are typically stateless.
*
* @return void
*/
protected function mapApiRoutes()
{
Route::prefix('api')
->middleware('api')
->namespace($this->moduleNamespace)
->group(module_path('Seller', '/Routes/api.php'));
}
}

View File

@ -0,0 +1,113 @@
<?php
namespace Modules\Seller\Providers;
use Illuminate\Support\ServiceProvider;
use Illuminate\Database\Eloquent\Factory;
class SellerServiceProvider extends ServiceProvider
{
/**
* @var string $moduleName
*/
protected $moduleName = 'Seller';
/**
* @var string $moduleNameLower
*/
protected $moduleNameLower = 'seller';
/**
* Boot the application events.
*
* @return void
*/
public function boot()
{
$this->registerTranslations();
$this->registerConfig();
$this->registerViews();
$this->loadMigrationsFrom(module_path($this->moduleName, 'Database/Migrations'));
}
/**
* Register the service provider.
*
* @return void
*/
public function register()
{
$this->app->register(RouteServiceProvider::class);
$this->app->register(EventServiceProvider::class);
}
/**
* Register config.
*
* @return void
*/
protected function registerConfig()
{
$this->publishes([
module_path($this->moduleName, 'Config/config.php') => config_path($this->moduleNameLower . '.php'),
], 'config');
$this->mergeConfigFrom(
module_path($this->moduleName, 'Config/config.php'), $this->moduleNameLower
);
}
/**
* Register views.
*
* @return void
*/
public function registerViews()
{
$viewPath = resource_path('views/modules/' . $this->moduleNameLower);
$sourcePath = module_path($this->moduleName, 'Resources/views');
$this->publishes([
$sourcePath => $viewPath
], ['views', $this->moduleNameLower . '-module-views']);
$this->loadViewsFrom(array_merge($this->getPublishableViewPaths(), [$sourcePath]), $this->moduleNameLower);
}
/**
* Register translations.
*
* @return void
*/
public function registerTranslations()
{
$langPath = resource_path('lang/modules/' . $this->moduleNameLower);
if (is_dir($langPath)) {
$this->loadTranslationsFrom($langPath, $this->moduleNameLower);
} else {
$this->loadTranslationsFrom(module_path($this->moduleName, 'Resources/lang'), $this->moduleNameLower);
}
}
/**
* Get the services provided by the provider.
*
* @return array
*/
public function provides()
{
return [];
}
private function getPublishableViewPaths(): array
{
$paths = [];
foreach (\Config::get('view.paths') as $path) {
if (is_dir($path . '/modules/' . $this->moduleNameLower)) {
$paths[] = $path . '/modules/' . $this->moduleNameLower;
}
}
return $paths;
}
}

View File

View File

View File

View File

@ -0,0 +1,75 @@
@include('components.theme.pages.header')
<section>
<div class="row">
<div class="col-md-12">
<div class="card">
<div class="card-header">
<h3 class="card-title">Umum</h3>
</div>
<div class="card-body">
<form action="{{ site_url('seller', 'account/update') . '/' . user()['id'] }}" method="POST">
@csrf
<div class="row mb-4">
@php
if(\App\Models\Seller::where('user_id', user()->id)->exists()) {
$getDetailSeller = \App\Models\Seller::where('user_id', user()->id)->first();
$name = $getDetailSeller->name;
$alias = $getDetailSeller->alias;
} else {
$name = '';
$alias = '';
}
@endphp
<div class="col-6 form-group">
<label class="form-label">Nama Bisnis<sup class="ms-1 text-danger">*</sup></label>
<input type="text" name="name" class="form-control form-control-solid mt-2" value="{{ $name }}" placeholder="Nama Bisnis">
</div>
<div class="col-6 form-group">
<label class="form-label">Sebutan Alias<sup class="ms-1 text-danger">*</sup></label>
<input type="text" name="alias" class="form-control form-control-solid mt-2" id="alias" value="{{ $alias }}" placeholder="Nama Alias">
</div>
</div>
<div class="row mb-4">
<div class="col-6 form-group">
<label class="form-label">Nama Lengkap<sup class="ms-1 text-danger">*</sup></label>
<input type="text" name="nama" class="form-control form-control-solid mt-2" value="{{ user()->name }}" placeholder="Nama Lengkap">
</div>
<div class="col-6 form-group">
<label class="form-label">Email Address<sup class="ms-1 text-danger">*</sup></label>
<input type="email" name="email" class="form-control form-control-solid mt-2" id="alias" value="{{ user()->email }}" placeholder="Alamat Email">
</div>
</div>
<div class="form-group mb-4">
<label class="form-label">Password<sup class="ms-1 text-danger">kosongi jika tidak ingin diubah</sup></label>
<input type="password" name="password" class="form-control form-control-solid mt-2" placeholder="Masukkan Password">
</div>
<div class="form-group mb-0">
<button type="submit" class="btn btn-primary">Simpan</button>
<a href="{{ site_url('seller', 'account') }}" class="btn btn-light btn-light">Kembali</a>
</div>
{!! Form::close() !!}
</div>
</div>
</div>
</div>
</section>
@push('scripts')
<script>
Inputmask({
mask: "*{1,20}[.*{1,20}][.*{1,20}][.*{1,20}]@*{1,20}[.*{2,6}][.*{1,2}]",
greedy: false,
onBeforePaste: function (pastedValue, opts) {
pastedValue = pastedValue.toLowerCase();
return pastedValue.replace("mailto:", "");
},
definitions: {
"*": {
validator: '[0-9A-Za-z!#$%&"*+/=?^_`{|}~\-]',
cardinality: 1,
casing: "lower"
}
}
}).mask("#email");
</script>
@endpush
@include('components.theme.pages.footer')

View File

@ -0,0 +1,66 @@
@include('components.theme.pages.header')
<section>
<div class="row">
@php
$url_segment = segment(3);
if(empty($url_segment)) {
$url_segment = '';
}
@endphp
<x-theme.pages.account-preference :activeSetting="$url_segment" />
<div class="col-md-12 mt-9">
<div class="card">
<div class="card-header">
<h3 class="card-title">Preferensi<span class="ms-2 fs-8 text-muted">Notifikasi</span></h3>
</div>
<div class="card-body">
<form method="POST" action="{{ site_url('seller', 'account/update-preference') . '/' . user()->id }}">
@csrf
<div class="form-check form-switch form-check-custom form-check-solid mb-4">
<input class="form-check-input" type="checkbox" name="updateProduct" {{ !empty($getNotificationPreferences->onUpdateProduct) && $getNotificationPreferences->onUpdateProduct ? 'checked' : '' }} id="flexSwitchDefault"/>
<label class="form-check-label" for="flexSwitchDefault">
Terima pembaruan/informasi produk terbaru
</label>
</div>
<div class="form-check form-switch form-check-custom form-check-solid mb-4">
<input class="form-check-input" type="checkbox" name="updateNews" {{ !empty($getNotificationPreferences->onUpdateNews) && $getNotificationPreferences->onUpdateNews ? 'checked' : '' }} id="flexSwitchDefault"/>
<label class="form-check-label" for="flexSwitchDefault">
Terima informasi berita terbaru
</label>
</div>
<div class="form-check form-switch form-check-custom form-check-solid mb-4">
<input class="form-check-input" type="checkbox" name="updateOrder" {{ !empty($getNotificationPreferences->onUpdateOrders) && $getNotificationPreferences->onUpdateOrders ? 'checked' : '' }} id="flexSwitchDefault"/>
<label class="form-check-label" for="flexSwitchDefault">
Terima informasi detail pesanan secara realtime
</label>
</div>
<div class="form-group mt-8 mb-0">
<button type="submit" class="btn btn-primary">Simpan</button>
<a href="{{ site_url('user', 'account') }}" class="btn btn-light btn-light">Kembali</a>
</div>
</form>
</div>
</div>
</div>
</div>
</section>
@push('scripts')
<script>
Inputmask({
mask: "*{1,20}[.*{1,20}][.*{1,20}][.*{1,20}]@*{1,20}[.*{2,6}][.*{1,2}]",
greedy: false,
onBeforePaste: function (pastedValue, opts) {
pastedValue = pastedValue.toLowerCase();
return pastedValue.replace("mailto:", "");
},
definitions: {
"*": {
validator: '[0-9A-Za-z!#$%&"*+/=?^_`{|}~\-]',
cardinality: 1,
casing: "lower"
}
}
}).mask("#email");
</script>
@endpush
@include('components.theme.pages.footer')

View File

@ -0,0 +1,59 @@
@include('components.theme.pages.header')
<section>
<!-- basic table -->
<div class="row">
<div class="col-12">
<div class="card">
<div class="card-body">
<form method="POST" action="{{ site_url('seller', 'account/rekening/store') }}">
@csrf
<div class="form-group mb-4">
<label class="form-label">Atas Nama<sup class="text-danger">*</sup></label>
<input type="text" name="name" value="{{ old('name') }}" autocomplete="off" class="form-control form-control-solid mt-2 {{ $errors->has('name') ? 'is-invalid' : '' }}" placeholder="Masukkan Atas Nama">
@error('name') <small class="text-danger">{{ $message }}</small> @enderror
</div>
<div class="form-group mb-4">
<label class="form-label">Nomer Rekening<sup class="text-danger">*</sup></label>
<input type="number" name="account_number" value="{{ old('account_number') }}" autocomplete="off" class="form-control form-control-solid mt-2 {{ $errors->has('account_number') ? 'is-invalid' : '' }}" placeholder="Masukkan Nomor Rekening">
@error('account_number') <small class="text-danger">{{ $message }}</small> @enderror
</div>
<div class="form-group mb-4">
<label class="form-label">Daftar Bank<sup class="text-danger">*</sup></label>
<select name="rid" class="form-select form-select-solid input-bank mt-2 {{ $errors->has('rid') ? 'is-invalid' : '' }}">
@foreach ($listAllBank as $bank)
@if (strlen($bank->kodebank) == 1)
@php $code = '00' . $bank->kodebank @endphp
@elseif(strlen($bank->kodebank) == 2)
@php $code = '0' . $bank->kodebank @endphp
@else
@php $code = $bank->kodebank @endphp
@endif
<option value="{{ $bank->id }}">Kode Bank: {{ $code }} / {{ $bank->nama }}</option>
@endforeach
</select>
@error('rid') <small class="text-danger">{{ $message }}</small> @enderror
</div>
<div class="form-group mb-0">
<button type="submit" class="btn btn-primary">Simpan</button>
<a href="{{ route('rekening') }}" class="btn btn-light btn-light">Kembali</a>
</div>
{{ Form::close() }}
</div>
</div>
</div>
</div>
</section>
@push('scripts')
<script src="https://preview.keenthemes.com/html/metronic/docs/assets/plugins/custom/ckeditor/ckeditor-classic.bundle.js"></script>
<script>
$(document).ready(function () {
$('.input-bank').select2({
placeholder: 'Pilih salah satu',
dropdownParent: $('.input-bank').parent()
});
});
</script>
@endpush
@include('components.theme.pages.footer')

View File

@ -0,0 +1,70 @@
@include('components.theme.pages.header')
<section>
<!-- basic table -->
<div class="row">
<div class="col-12">
<div class="card">
<div class="card-body">
<form action="{{ site_url('seller', 'account/rekening/update') . '/' . $getDetailAccount->id }}" id="form-tag-update" method="POST">
@csrf
<div class="form-group mb-4">
<label class="form-label">Atas Nama<sup class="text-danger">*</sup></label>
<input type="text" name="name" value="{{ $getDetailAccount->name }}" autocomplete="off" class="form-control form-control-solid mt-2 {{ $errors->has('name') ? 'is-invalid' : '' }}" placeholder="Masukkan Atas Nama">
@error('name') <small class="text-danger">{{ $message }}</small> @enderror
</div>
<div class="form-group mb-4">
<label class="form-label">Nomer Rekening<sup class="text-danger">*</sup></label>
<input type="number" name="account_number" value="{{ $getDetailAccount->account_number }}" autocomplete="off" class="form-control form-control-solid mt-2 {{ $errors->has('account_number') ? 'is-invalid' : '' }}" placeholder="Masukkan Nomor Rekening">
@error('account_number') <small class="text-danger">{{ $message }}</small> @enderror
</div>
<div class="form-group mb-4">
<label class="form-label">Daftar Bank<sup class="text-danger">*</sup></label>
<select name="rid" class="form-select form-select-solid input-bank mt-2 {{ $errors->has('rid') ? 'is-invalid' : '' }}">
@foreach ($listAllBank as $bank)
@if (strlen($bank->kodebank) == 1)
@php $code = '00' . $bank->kodebank @endphp
@elseif(strlen($bank->kodebank) == 2)
@php $code = '0' . $bank->kodebank @endphp
@else
@php $code = $bank->kodebank @endphp
@endif
<option value="{{ $bank->id }}">Kode Bank: {{ $code }} / {{ $bank->nama }}</option>
@endforeach
</select>
@error('rid') <small class="text-danger">{{ $message }}</small> @enderror
</div>
<div class="form-group mb-4">
<label class="form-label">Status Rekening<sup class="text-danger">*</sup></label>
<select name="is_active" class="form-select form-select-solid mt-2 {{ $errors->has('is_active') ? 'is-invalid' : '' }}">
@foreach ([1,2] as $status)
@php $name = $status == 1 ? 'Aktif' : 'Tidak Aktif' @endphp
@php $selected = $status == $getDetailAccount->is_active ? 'selected' : '' @endphp
<option value="{{ $status }}" {{ $selected }}>{{ $name }}</option>
@endforeach
</select>
@error('is_active') <small class="text-danger">{{ $message }}</small> @enderror
</div>
<div class="form-group mb-0">
<button type="submit" class="btn btn-primary">Perbarui</button>
<a href="{{ route('rekening') }}" class="btn btn-light btn-light">Kembali</a>
</div>
{{ Form::close() }}
</div>
</div>
</div>
</div>
</section>
@push('scripts')
<script src="https://preview.keenthemes.com/html/metronic/docs/assets/plugins/custom/ckeditor/ckeditor-classic.bundle.js"></script>
<script>
$(document).ready(function () {
$('.input-bank').select2({
placeholder: 'Pilih salah satu',
dropdownParent: $('.input-bank').parent()
});
});
</script>
@endpush
@include('components.theme.pages.footer')

View File

@ -0,0 +1,79 @@
@push('css')
<link href="{{ frontend('plugins/custom/datatables/datatables.bundle.css') }}" rel="stylesheet" type="text/css" />
@endpush
@include('components.theme.pages.header')
<section>
<!-- basic table -->
<div class="row">
<div class="col-12">
<div class="card card-flush">
<div class="card-header flex-nowrap pt-5">
<div>
<div class="d-flex align-items-center position-relative my-1">
<i class="ki-outline ki-magnifier fs-1 position-absolute ms-6"><span class="path1"></span><span class="path2"></span></i>
<input type="text" id="search" class="form-control form-control-solid w-250px ps-15" placeholder="Temukan Rekening"/>
</div>
</div>
</div>
<div class="card-body">
<div class="table-responsive">
<table id="data-table" class="table align-middle table-row-dashed fs-6 gy-5">
<thead>
<tr class="text-start text-gray-400 fw-bold fs-7 text-uppercase gs-0">
<th>ID</th>
<th>Nomor Rekening</th>
<th>Atas Nama</th>
<th>Status</th>
<th>Action</th>
</tr>
</thead>
<tbody class="text-gray-600 fw-semibold"></tbody>
</table>
</div>
</div>
</div>
</div>
</div>
</section>
@push('scripts')
<script src="{{ frontend('plugins/custom/datatables/datatables.bundle.js') }}"></script>
<script type="text/javascript">
$(function () {
var table = $('#data-table').DataTable({
processing: true,
serverSide: true,
ajax: "{{ site_url('seller', 'account/rekening') }}",
order: [[1, 'desc']],
stateSave: true,
columns: [
{data: null, name: 'id'},
{data: 'title-post', name: 'title-post'},
{data: 'name', name: 'name'},
{data: 'status', name: 'status'},
{data: 'action', name: 'action', orderable: false, searchable: false},
],
createdRow: function (row, data, dataIndex) {
// Set the sequential number starting from 1
$('td', row).eq(0).html(dataIndex + 1);
}
});
// #myInput is a <input type="text"> element
$('#search').on('keyup change', function () {
table.search(this.value).draw();
});
$('#data-table').on('click', '.deleteContent', function() {
var url = $(this).data('url');
$('#exampleModal').modal('show', {
backdrop: 'static'
});
$('.link').attr('href', url)
})
});
</script>
@endpush
@include('components.theme.pages.footer')

View File

@ -0,0 +1,171 @@
@include('components.theme.pages.header')
<section>
<!-- basic table -->
<form method="POST" action="{{ site_url('seller', 'account/withdrawal/store') }}">
@csrf
<div class="row">
<div class="col-8">
<div class="card">
<div class="card-header">
<h6 class="card-title">Formulir Tarik Tunai</h6>
<div class="card-toolbar">
<i class="ki-duotone ki-information-2 fs-2" data-bs-toggle="tooltip" data-bs-placement="top" title="Tolong dilengkapi data informasi dengan valid">
<span class="path1"></span>
<span class="path2"></span>
<span class="path3"></span>
</i>
</div>
</div>
<div class="card-body">
<div class="d-flex flex-column fv-row">
<label class="d-flex align-items-center fs-6 fw-semibold mb-4">
<span class="required">Opsi</span>
<span class="ms-1" data-bs-toggle="tooltip" title="Pilih salah satu">
<i class="ki-duotone ki-information text-gray-500 fs-7"><span class="path1"></span><span class="path2"></span><span class="path3"></span></i>
</span>
</label>
<div class="d-flex flex-stack gap-5 mb-4">
<button type="button" class="btn btn-light-primary w-100 pick-amount" data-kt-docs-advanced-forms="interactive" data-amount="10000">10000</button>
<button type="button" class="btn btn-light-primary w-100 pick-amount" data-kt-docs-advanced-forms="interactive" data-amount="50000">50000</button>
<button type="button" class="btn btn-light-primary w-100 pick-amount" data-kt-docs-advanced-forms="interactive" data-amount="100000">100000</button>
</div>
<input type="hidden" name="action" value=""/>
<input type="number" class="form-control form-control-solid py-5" placeholder="Masukkan Jumlah" name="amount" />
</div>
<div class="form-group mt-4 mb-0">
<button type="submit" class="btn btn-primary w-100">Proses</button>
</div>
</div>
</div>
</div>
<div class="col-4">
<div class="card">
<div class="card-header">
<h6 class="card-title">Ringkasan</h6>
</div>
<div class="card-body">
<div class="form-group mb-3">
<label class="form-label pb-1">Rekening</label>
<select class="form-select form-select-solid form-select-sm mb-1 input-bayar" name="is_account">
@foreach($getListOfBank as $bank)
<option value="{{ $bank->id }}">{{ $bank->account_number . ' (' . $bank->name . ')' }}</option>
@endforeach
</select>
</div>
<ul class="list-group list-group-flush">
<li class="d-flex list-group-item px-0 pb-3">
<span class="fw-bold">Saldo <i class="ki-outline ki-information-2 fs-9 ms-1" data-bs-toggle="tooltip" data-bs-placement="bottom" title="Saldo anda tersedia senilai {{ 'Rp. ' . number_format(user()->income, 0, ',', '.') }}"></i></span>
<span class="ms-auto">{{ rupiah_changer(user()->income) }}</span>
</li>
<li class="d-flex list-group-item px-0 pb-3 pt-3">
<span class="fw-bold">Nominal Ditarik</span>
<span class="ms-auto amount">0</span>
</li>
</ul>
</div>
</div>
</div>
</div>
{{ Form::close() }}
</section>
@push('scripts')
<script>
$(document).ready(function () {
$('.input-bayar').select2({
placeholder: 'Pilih salah satu',
})
const options = document.querySelectorAll('[data-kt-docs-advanced-forms="interactive"]');
const inputEl = document.querySelector('[name="amount"]');
options.forEach(option => {
option.addEventListener('click', e => {
e.preventDefault();
inputEl.value = e.target.innerText;
const amount = parseInt(e.target.innerText);
var formatAmount = new Intl.NumberFormat('id-ID', {
style: 'currency',
currency: 'IDR'
}).format(amount);
$('.amount').html(formatAmount.replace(/,00/g, ''));
});
});
$('input[name=amount]').change(function() {
const amount = parseInt($(this).val());
var formatAmount = new Intl.NumberFormat('id-ID', {
style: 'currency',
currency: 'IDR'
}).format(amount);
$('.amount').html(formatAmount.replace(/,00/g, ''));
});
$('.btnDeposit').click(function() {
if($('input[name=amount]').val() === '' && $('.input-bayar').val() === '') {
Swal.fire({
text: "Nominal dan rekening tidak boleh kosong",
icon: "error"
});
} else {
$(this).attr('disabled', 'disabled');
$(this).html(`
<div class="spinner-border text-white mb-n1" role="status">
<span class="visually-hidden">Loading...</span>
</div>
`);
const amount = $('input[name=amount]').val();
var amountBalance = new Intl.NumberFormat('id-ID', {
style: 'currency',
currency: 'IDR'
}).format(amount).replace(/,00/g, '');
$('#transaksiModal').modal('show', {
backdrop: 'static'
});
$('#transaksiModalLabel').html('Konfirmasi Penarikan Tunai');
$('.result').html(`
<div class="d-flex flex-stack">
<div class="text-gray-700 fw-semibold fs-6 me-2">Nominal yang akan ditarik</div>
<div class="d-flex align-items-senter">
<i class="ki-outline ki-arrow-up-right fs-2 text-success me-2"></i>
<span class="text-gray-900 fw-bolder fs-6">${amountBalance}</span>
</div>
</div>
<div class="separator separator-dashed my-3"></div>
<div class="d-flex flex-stack">
<div class="text-gray-700 fw-semibold fs-6 me-2">Saldo tersedia</div>
<div class="d-flex align-items-senter">
<i class="ki-outline ki-arrow-down-right fs-2 text-danger me-2"></i>
<span class="text-gray-900 fw-bolder fs-6">{{ 'Rp. ' . number_format(user()->income, 0, ',', '.') }}</span>
</div>
</div>
`);
$('.buttonOrder').html(`
<button class="btn btn-outline btn-primary me-2 placeDeposit" data-button="tarik-sekarang" type="button">Tarik Sekarang</button>
<button class="btn btn-outline btn-outline-dashed me-2" data-bs-dismiss="modal" type="button">Batal</button>
`);
setTimeout(() => {
$(this).removeAttr('disabled');
$(this).html('Proses');
}, 4000);
}
$('.placeDeposit').click(function() {
const action = $(this).data('button');
if(action === "tarik-sekarang") {
$('input[name=action]').val(1);
$('#form-deposit').submit();
}
})
})
});
</script>
@endpush
@include('components.theme.pages.footer')

View File

@ -0,0 +1,144 @@
@if($payment->is_status == 1)
@section('additional')
<div class="card-toolbar">
<button class="btn btn-sm btn-light-danger border border-dotted cancelOrder" data-invoice="{{ $payment->id }}">Batalkan</button>
</div>
@endsection
@elseif($payment->is_status == 3)
@section('additional')
<div class="card-toolbar">
<button class="btn btn-sm btn-light-primary border border-dotted viewPayment" data-payment="{{ $payment->is_attachment }}">Bukti Pembayaran</button>
</div>
@endsection
@endif
@include('components.theme.pages.header')
<section class="invoice">
<div class="row">
<div class="col-md-7 mb-5">
<div class="card">
<div class="card-header">
<h3 class="card-title">Informasi</h3>
</div>
<div class="card-body">
<div class="d-flex flex-stack">
<div class="text-gray-700 fw-semibold fs-6 me-2">Secure Code</div>
<span class="text-gray-900 fw-bolder fs-6">{{ $payment->id }}</span>
</div>
<div class="separator separator-dashed my-3"></div>
<div class="d-flex flex-stack">
<div class="text-gray-700 fw-semibold fs-6 me-2">Invoice ID</div>
<span class="text-gray-900 fw-bolder fs-6">{{ $payment->invoice_id }}</span>
</div>
<div class="separator separator-dashed my-3"></div>
<div class="d-flex flex-stack">
<div class="text-gray-700 fw-semibold fs-6 me-2">Nominal Deposit</div>
<div class="d-flex align-items-senter">
<i class="ki-outline ki-arrow-up-right fs-2 text-success me-2"></i>
<span class="text-gray-900 fw-bolder fs-6">{{ 'Rp ' . number_format($payment->amount, 0, ',', '.') }}</span>
</div>
</div>
<div class="separator separator-dashed my-3"></div>
<div class="d-flex flex-stack">
<div class="text-gray-700 fw-semibold fs-6 me-2">Terakhir Diperbarui</div>
<span class="text-gray-900 fw-bolder fs-6">{{ date_formatting($payment->updated_at, 'timeago') }}</span>
</div>
</div>
</div>
</div>
<div class="col-md-5 mb-5">
<div class="card">
<div class="card-header">
<h3 class="card-title">Tambahan</h3>
</div>
<div class="card-body">
<div class="d-flex flex-stack">
<div class="text-gray-700 fw-semibold fs-6 me-2">Status</div>
<span class="fs-6">
@if ($payment->is_status == enum('isWithdrawPending'))
<span class="badge badge-light-dark">Menunggu Pembayaran</span>
@elseif($payment->is_status == enum('isWithdrawOnProgress'))
<span class="badge badge-light-info">Sedang Proses</span>
@elseif($payment->is_status == enum('isWithdrawPaid'))
<span class="badge badge-light-success">Telah dibayarkan</span>
@elseif($payment->is_status == enum('isWithdrawCancel'))
<span class="badge badge-light-danger">Dibatalkan</span>
@endif
</span>
</div>
<div class="separator separator-dashed my-3"></div>
<div class="d-flex flex-stack">
<div class="text-gray-700 fw-semibold fs-6 me-2">Invoice Dibuat</div>
<span class="text-gray-900 fw-bolder fs-6">{{ date('Y-m-d', strtotime($payment->created_at)) }}</span>
</div>
<div class="separator separator-dashed my-3"></div>
<div class="d-flex flex-stack">
<div class="text-gray-700 fw-semibold fs-6 me-2">Metode</div>
<span class="text-gray-900 fw-bolder fs-6">
@php
$checkBank = \Modules\Seller\Entities\RekeningBankModel::where('id', $payment->rekening->first()->rid)->first();
@endphp
{{ $checkBank->nama }}
</span>
</div>
<div class="separator separator-dashed my-3"></div>
<div class="d-flex flex-stack">
<div class="text-gray-700 fw-semibold fs-6 me-2">Issued By</div>
<span class="text-gray-900 fw-bolder fs-6">{{ user()->name }}</span>
</div>
</div>
</div>
</div>
</div>
</section>
@push('scripts')
<script>
$(document).ready(function() {
$('.input-bayar').select2({
placeholder: 'Pilih salah satu',
});
$('.cancelOrder').click(function() {
Swal.fire({
title: 'Apakah anda?',
text: "Anda tidak akan dapat mengembalikan ini!",
icon: 'warning',
showCancelButton: true,
confirmButtonColor: 'btn btn-primary',
cancelButtonColor: 'btn btn-danger',
confirmButtonText: 'Ya, Batalkan!',
cancelButtonText: 'Batal'
}).then((result) => {
if (result.isConfirmed) {
Swal.fire(
'Dibatalkan!',
'Anda membatalkan transaksi ini.',
'success'
)
setTimeout(() => {
window.location.href = "{{ site_url('seller', 'account/withdrawal/c') }}/" + $(this).data('invoice');
}, 1000)
}
})
});
@if($payment->is_status == enum('isWithdrawPaid'))
$('.viewPayment').on('click', () => {
$('#viewerModal').modal('show');
$('.result').html(`
<div class="">
<img src="{{ assets_url($payment->is_attachment) }}" class="img-responsive w-100">
</div>
`);
})
@endif
})
</script>
@endpush
@include('components.theme.pages.footer')

View File

@ -0,0 +1,182 @@
@push('css')
<link href="{{ frontend('plugins/custom/datatables/datatables.bundle.css') }}" rel="stylesheet" type="text/css" />
@endpush
@include('components.theme.pages.header')
<section>
<!-- basic table -->
<div class="row">
<div class="col-12">
<div class="card card-flush">
<div class="card-header flex-nowrap pt-5">
<div>
<div class="d-flex align-items-center position-relative my-1">
<i class="ki-outline ki-magnifier fs-1 position-absolute ms-6"><span class="path1"></span><span class="path2"></span></i>
<input type="text" id="search" class="form-control form-control-solid w-250px ps-15" placeholder="Temukan Invoice"/>
</div>
</div>
<div class="card-toolbar">
<!--begin::Menu-->
<button class="btn btn-light-primary btn-active-light-primary justify-content-end"
data-kt-menu-trigger="click" data-kt-menu-placement="bottom-end"
data-kt-menu-overflow="true">
<i class="ki-outline ki-filter fs-1 me-n1"></i>
<span class="mb-0">Filter</span>
</button>
<div class="menu menu-sub menu-sub-dropdown menu-column menu-rounded menu-gray-800 menu-state-bg-light-primary fw-semibold w-300px"
data-kt-menu="true">
<div class="menu-item px-3">
<div class="menu-content fs-6 text-dark fw-bold px-3 py-4">Filter By</div>
</div>
<div class="separator mb-3 opacity-75"></div>
<div class="px-7 py-5 menu-item" data-kt-docs-table-filter="status_type">
<div class="form-check form-check-custom form-check-solid mb-3">
<input class="form-check-input" name="status" type="radio" value="1" id="flexRadioDefault"/>
<label class="form-check-label" for="flexRadioDefault">
Menunggu Diproses
</label>
</div>
<div class="form-check form-check-custom form-check-solid mb-3">
<input class="form-check-input" name="status" type="radio" value="2" id="flexRadioDefault"/>
<label class="form-check-label" for="flexRadioDefault">
Sedang Proses
</label>
</div>
<div class="form-check form-check-custom form-check-solid mb-3">
<input class="form-check-input" name="status" type="radio" value="3" id="flexRadioDefault"/>
<label class="form-check-label" for="flexRadioDefault">
Dibayarkan
</label>
</div>
<div class="d-flex justify-content-end py-3">
<button type="reset" class="btn btn-light btn-active-light-primary me-2" data-kt-menu-dismiss="true" data-kt-docs-table-filter="reset">Atur Ulang</button>
<button type="submit" class="btn btn-primary" data-kt-menu-dismiss="true" data-kt-docs-table-filter="filter">Terapkan</button>
</div>
</div>
</div>
</div>
</div>
<div class="card-body">
<div class="table-responsive">
<table id="data-table" class="table align-middle table-row-dashed fs-6 gy-5">
<thead>
<tr class="text-start text-gray-400 fw-bold fs-7 text-uppercase gs-0">
<th>Invoice ID</th>
<th>Nominal</th>
<th>Metode</th>
<th>Status</th>
<th>Action</th>
</tr>
</thead>
<tbody class="text-gray-600 fw-semibold"></tbody>
</table>
</div>
</div>
</div>
</div>
</div>
</section>
@push('scripts')
<script src="{{ frontend('plugins/custom/datatables/datatables.bundle.js') }}"></script>
<script type="text/javascript">
$(function () {
var filterStatus;
var table = $('#data-table').DataTable({
processing: true,
serverSide: true,
ajax: "{{ site_url('seller', 'account/withdrawal') }}",
stateSave: true,
columns: [
{data: 'invoice-number', name: 'invoice-number'},
{data: 'price', name: 'price'},
{data: 'account', name: 'account'},
{data: 'status', name: 'status'},
{data: null}
],
columnDefs: [
{
targets: -1,
data: null,
orderable: false,
render: function (data, type, row) {
return `
<a href="#" class="btn btn-light btn-active-light-primary btn-sm" data-kt-menu-trigger="click" data-kt-menu-placement="bottom-end" data-kt-menu-flip="top-end">
Aksi
</a>
<!--begin::Menu-->
<div class="menu menu-sub menu-sub-dropdown menu-column menu-rounded menu-gray-600 menu-state-bg-light-primary fw-bold fs-7 w-125px py-4" data-kt-menu="true">
<!--begin::Menu item-->
<div class="menu-item px-3">
<a href="{{ site_url('seller', 'account/withdrawal/v') }}/${row.id}" class="menu-link px-3 viewContent">
Detail
</a>
</div>
<!--end::Menu item-->
</div>
<!--end::Menu-->
`;
},
}
],
});
// Filter Datatable
var handleFilterDatatable = () => {
// Select filter options
filterStatus = document.querySelectorAll('[data-kt-docs-table-filter="status_type"] [name="status"]');
const filterButton = document.querySelector('[data-kt-docs-table-filter="filter"]');
// Filter datatable on submit
filterButton.addEventListener('click', function () {
let statusValue = 'status|';
filterStatus.forEach(r => {
if (r.checked) {
statusValue = 'status|' + r.value;
}
if (statusValue === 'status|') {
statusValue = 'status|';
}
});
table.search(statusValue).draw();
});
}
// Reset Filter
var handleResetForm = () => {
const resetButton = document.querySelector('[data-kt-docs-table-filter="reset"]');
resetButton.addEventListener('click', function () {
filterStatus[0].checked = true;
table.search('').draw();
});
}
table.on('draw', function () {
handleFilterDatatable();
handleResetForm();
KTMenu.createInstances();
});
table.search('').draw();
// #myInput is a <input type="text"> element
$('#search').on('keyup change', function () {
table.search('invoice|' + this.value).draw();
});
$('#data-table').on('click', '.deleteContent', function() {
var url = $(this).data('url');
$('#exampleModal').modal('show', {
backdrop: 'static'
});
$('.link').attr('href', url)
})
});
</script>
@endpush
@include('components.theme.pages.footer')

View File

@ -0,0 +1,130 @@
@include('components.theme.pages.header')
<section>
<div class="row">
<div class="col-lg-3">
<div class="card bg-body hoverable card-xl-stretch mb-xl-8">
<div class="card-body">
<i class="ki-outline ki-purchase text-dark fs-2x ms-n1"></i>
<div class="text-gray-900 fw-bold fs-2 mb-2 mt-5">
{{ $getTotalOrders }}
</div>
<div class="fw-semibold text-gray-400">
Total Pesanan Baru
</div>
</div>
</div>
</div>
<div class="col-lg-3">
<div class="card bg-body hoverable card-xl-stretch mb-xl-8">
<div class="card-body">
<i class="ki-outline ki-purchase text-danger fs-2x ms-n1"></i>
<div class="text-gray-900 fw-bold fs-2 mb-2 mt-5">
{{ $getTotalOrdersCancel }}
</div>
<div class="fw-semibold text-gray-400">
Total Pesanan Dibatalkan
</div>
</div>
</div>
</div>
<div class="col-lg-3">
<div class="card bg-body hoverable card-xl-stretch mb-xl-8">
<div class="card-body">
<i class="ki-outline ki-plus-square text-primary fs-2x ms-n1"></i>
<div class="text-gray-900 fw-bold fs-2 mb-2 mt-5">
{{ 'Rp. ' . number_format(user()->income, 0, ',', '.') }}
</div>
<div class="fw-semibold text-gray-400">
Total Pendapatan
</div>
</div>
</div>
</div>
<div class="col-lg-3">
<div class="card bg-body hoverable card-xl-stretch mb-xl-8">
<div class="card-body">
<i class="ki-outline ki-pin text-danger fs-2x ms-n1"></i>
<div class="text-gray-900 fw-bold fs-2 mb-2 mt-5">
{{ $getTotalWebsite }}
</div>
<div class="fw-bold text-gray-400">
Total Produk
</div>
</div>
</div>
</div>
<div class="col-xl-12">
@if(\App\Models\Seller::where('user_id', user()->id)->exists() == false)
<div class="alert alert-info d-flex align-items-center p-5">
<div class="alert-text">
Anda belum melakukan pendataan sebagai <b>Vendor Party Planner</b>. Silahkan lengkapi profil anda terlebih dahulu dengan klik tombol disamping.
</div>
<a href="{{ site_url('seller', 'account') }}" class="btn btn-outline btn-light-info ms-auto">Lengkapi Profil</a>
</div>
@endif
<div class="card">
<div class="card-header">
<h3 class="card-title">Pesanan</h3>
</div>
<div class="card-body p-0">
<div class="table-responsive">
<table class="table align-middle table-row-bordered table-row-solid gy-4 gs-9">
<thead>
<tr class="text-start text-gray-400 fw-bold fs-7 text-uppercase gs-0">
<th>No.</th>
<th>Produk</th>
<th>Pemesan</th>
<th>Status Pesanan</th>
<th>Status Pembayaran</th>
</tr>
</thead>
<tbody class="text-gray-600 fw-semibold">
@if(empty($getListOrder))
<tr>
<td colspan="5" class="text-center">Tidak ada pesanan...</td>
</tr>
@else
@php
$no = 1;
@endphp
@foreach($getListOrder as $order)
@php
$orders = \Modules\User\Entities\OrderModel::where('invoice_number', $order->order_id)->first();
@endphp
<tr>
<td>{{ $no++ }}</td>
<td>{{ $order->product->name }}</td>
<td>{{ $order->client->name }}</td>
<td>
@if ($order->is_status == 1)
<span class="mb-1 badge font-medium bg-light-dark text-dark py-3 px-4 fs-7 text-center">Pending</span>
@elseif($order->is_status == 2)
<span class="mb-1 badge font-medium bg-light-info text-info py-3 px-4 fs-7 text-center">Dalam pengerjaan</span>
@elseif($order->is_status == 3)
<span class="mb-1 badge font-medium bg-light-success text-success py-3 px-4 fs-7 text-center">Selesai</span>
@elseif($order->is_status == 4)
<span class="mb-1 badge font-medium bg-light-danger text-danger py-3 px-4 fs-7 text-center">Dibatalkan</span>
@endif
</td>
<td>
@if ($orders->is_status == 1)
<span class="mb-1 badge font-medium bg-light-dark text-dark py-3 px-4 fs-7 text-center">Belum</span>
@elseif($orders->is_status == 2 || $orders->is_status == 3 || $orders->is_status == 5)
<span class="mb-1 badge font-medium bg-light-success text-success py-3 px-4 fs-7 text-center">Lunas</span>
@elseif($orders->is_status == 4)
<span class="mb-1 badge font-medium bg-light-danger text-danger py-3 px-4 fs-7 text-center">Dibatalkan</span>
@endif
</td>
</tr>
@endforeach
@endif
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
</section>
@include('components.theme.pages.footer')

View File

@ -0,0 +1,126 @@
@if($getInfoOrders->is_status == 1)
@section('additional')
<div class="ms-auto me-2">
<button type="button" class="btn btn-light-info btn-active-light-info btn-outline-dashed markAsProgress" data-url="{{ site_url('seller', 'transaction/working') . '/' . $getInfoOrders->order_id }}">Tandai Dalam Progress</button>
</div>
@endsection
@elseif($getInfoOrders->is_status == 2)
@section('additional')
<div class="ms-auto me-2">
<button type="button" class="btn btn-light-success btn-active-light-success btn-outline-dashed markAsComplete" data-url="{{ site_url('seller', 'transaction/complete') . '/' . $getInfoOrders->order_id }}">Tandai Selesai</button>
</div>
@endsection
@endif
@include('components.theme.pages.header')
<section class="invoice">
<div class="row">
<div class="col-md-12 mb-5">
<div class="card">
<div class="card-header">
<h3 class="card-title">Detil Transaksi</h3>
</div>
<div class="card-body">
<div class="d-flex flex-stack">
<div class="text-gray-700 fw-semibold fs-6 me-2">No. Invoice</div>
<span class="text-gray-900 fw-bolder fs-6">{{ $getInfoOrders->order_id }}</span>
</div>
<div class="separator separator-dashed my-3"></div>
<div class="d-flex flex-stack">
<div class="text-gray-700 fw-semibold fs-6 me-2">Layanan</div>
<span class="text-gray-900 fw-bolder fs-6">{{ \Modules\Seller\Entities\ProductModel::where('id', $getInfoOrders->product_id)->first()->name }}</span>
</div>
<div class="separator separator-dashed my-3"></div>
<div class="d-flex flex-stack">
<div class="text-gray-700 fw-semibold fs-6 me-2">Nama Pemesan</div>
<span class="text-gray-900 fw-bolder fs-6">{{ \App\Models\User::where('id', $getInfoOrders->buy_id)->first()->name }}</span>
</div>
<div class="separator separator-dashed my-3"></div>
<div class="d-flex flex-stack">
<div class="text-gray-700 fw-semibold fs-6 me-2">Total Harga</div>
<span class="text-gray-900 fw-bolder fs-6">{{ 'Rp. ' . number_format($getInfoOrders->price, 0, ',', '.') }}</span>
</div>
<div class="separator separator-dashed my-3"></div>
<div class="d-flex flex-stack">
<div class="text-gray-700 fw-semibold fs-6 me-2">Tanggal Transaksi</div>
<span class="text-gray-900 fw-bolder fs-6">{{ \Carbon\Carbon::parse($getInfoOrders->created_at)->format('d F Y H:i') }}</span>
</div>
<div class="separator separator-dashed my-3"></div>
<div class="d-flex flex-stack">
<div class="text-gray-700 fw-semibold fs-6 me-2">Tanggal Transaksi Diperbarui</div>
<span class="text-gray-900 fw-bolder fs-6">{{ \Carbon\Carbon::parse($getInfoOrders->updated_at)->format('d F Y H:i') }}</span>
</div>
<div class="separator separator-dashed my-3"></div>
<div class="d-flex flex-stack">
<div class="text-gray-700 fw-semibold fs-6 me-2">Status</div>
<span class="text-gray-900 fw-bolder fs-6">
@if($getInfoOrders->is_status == 1)
Menunggu Proses
@elseif($getInfoOrders->is_status == 2)
Pembayaran Diterima, Sedang Dikerjakan
@elseif($getInfoOrders->is_status == 3)
Dikirim oleh Vendor, sedang menunggu konfirmasi dari klien
@elseif($getInfoOrders->is_status == 4)
Dibatalkan
@elseif($getInfoOrders->is_status == 5)
Selesai
@endif
</span>
</div>
</div>
</div>
</div>
</div>
</section>
@push('scripts')
<script src="{{ frontend('js/custom/documentation.js') }}"></script>
<script>
$(document).ready(function() {
$('.markAsComplete').click(function() {
var url = $(this).data('url');
$('#generalModal').modal('show', {
backdrop: 'static'
});
$('#generalModalLabel').text('Tandai Selesai');
$('.result').html(`
<form method="POST" action="{{ site_url('seller', 'transaction/complete') . '/' . $getInfoOrders->order_id }}">
@csrf
<div class="alert alert-info">
Pesanan klien telah selesai. Tekan "Tandai Selesai" untuk menandai pesanan ini sebagai selesai.
</div>
<div class="form-group">
<button type="submit" class="btn btn-primary">Kirim</button>
<button type="button" class="btn btn-light btn-light" data-bs-dismiss="modal">Tutup</button>
</div>
</form>
`);
})
$('.markAsProgress').click(function() {
var url = $(this).data('url');
$('#generalModal').modal('show', {
backdrop: 'static'
});
$('#generalModalLabel').text('Tandai Dalam Proses');
$('.result').html(`
<form method="POST" action="{{ site_url('seller', 'transaction/working') . '/' . $getInfoOrders->order_id }}">
@csrf
<div class="alert alert-info">
Pesanan klien telah dalam proses. Tekan "Tandai Selesai" untuk menandai pesanan ini sebagai selesai.
</div>
<div class="form-group">
<button type="submit" class="btn btn-primary">Kirim</button>
<button type="button" class="btn btn-light btn-light" data-bs-dismiss="modal">Tutup</button>
</div>
</form>
`);
})
})
</script>
@endpush
@include('components.theme.pages.footer')

View File

@ -0,0 +1,206 @@
@push('css')
<link href="{{ frontend('plugins/custom/datatables/datatables.bundle.css') }}" rel="stylesheet" type="text/css" />
@endpush
@include('components.theme.pages.header')
<section>
<!-- basic table -->
<div class="row">
<div class="col-12">
<div class="card card-flush">
<div class="card-header flex-nowrap pt-5">
<div>
<div class="d-flex align-items-center position-relative my-1">
<i class="ki-outline ki-magnifier fs-1 position-absolute ms-6"><span class="path1"></span><span class="path2"></span></i>
<input type="text" id="search" class="form-control form-control-solid w-250px ps-15" placeholder="Temukan Pesanan"/>
</div>
</div>
<div class="card-toolbar">
<!--begin::Menu-->
<button class="btn btn-light-primary btn-active-light-primary justify-content-end"
data-kt-menu-trigger="click" data-kt-menu-placement="bottom-end"
data-kt-menu-overflow="true">
<i class="ki-outline ki-filter fs-1 me-n1"></i>
<span class="mb-0">Filter</span>
</button>
<div class="menu menu-sub menu-sub-dropdown menu-column menu-rounded menu-gray-800 menu-state-bg-light-primary fw-semibold w-300px"
data-kt-menu="true">
<div class="menu-item px-3">
<div class="menu-content fs-6 text-dark fw-bold px-3 py-4">Filter By</div>
</div>
<div class="separator mb-3 opacity-75"></div>
<div class="px-7 py-5 menu-item" data-kt-docs-table-filter="status_type">
<div class="form-check form-check-custom form-check-solid mb-3">
<input class="form-check-input" name="status" type="radio" value="1" id="flexRadioDefault"/>
<label class="form-check-label" for="flexRadioDefault">
Pending
</label>
</div>
<div class="form-check form-check-custom form-check-solid mb-3">
<input class="form-check-input" name="status" type="radio" value="2" id="flexRadioDefault"/>
<label class="form-check-label" for="flexRadioDefault">
Dalam pengerjaan
</label>
</div>
<div class="form-check form-check-custom form-check-solid mb-3">
<input class="form-check-input" name="status" type="radio" value="3" id="flexRadioDefault"/>
<label class="form-check-label" for="flexRadioDefault">
Selesai
</label>
</div>
<div class="form-check form-check-custom form-check-solid mb-3">
<input class="form-check-input" name="status" type="radio" value="4" id="flexRadioDefault"/>
<label class="form-check-label" for="flexRadioDefault">
Dibatalkan
</label>
</div>
<div class="d-flex justify-content-end py-3">
<button type="reset" class="btn btn-light btn-active-light-primary me-2" data-kt-menu-dismiss="true" data-kt-docs-table-filter="reset">Atur Ulang</button>
<button type="submit" class="btn btn-primary" data-kt-menu-dismiss="true" data-kt-docs-table-filter="filter">Terapkan</button>
</div>
</div>
</div>
<!--end::Menu-->
<!--begin::Print Button-->
<button class="btn btn-light-success btn-active-light-success ms-3" id="printButton">
<i class="ki-outline ki-print fs-1 me-n1"></i>
<span class="mb-0">Cetak</span>
</button>
<!--end::Print Button-->
</div>
</div>
<div class="card-body">
<div class="table-responsive">
<table id="data-table" class="table align-middle table-row-dashed fs-6 gy-5">
<thead>
<tr class="text-start text-gray-400 fw-bold fs-7 text-uppercase gs-0">
<th>ID</th>
<th>No. Invoice</th>
<th>Pemesan </th>
<th>Biaya</th>
<th>Status</th>
<th>Created</th>
<th>Action</th>
</tr>
</thead>
<tbody class="text-gray-600 fw-semibold"></tbody>
</table>
</div>
</div>
</div>
</div>
</div>
</section>
@push('scripts')
<script src="{{ frontend('plugins/custom/datatables/datatables.bundle.js') }}"></script>
<script type="text/javascript">
$(function () {
var table = $('#data-table').DataTable({
processing: true,
serverSide: true,
ajax: "{{ site_url('seller', 'transaction') }}",
order: [[5, 'desc']],
stateSave: true,
columns: [
{data: null, className: 'text-center', name: 'id'},
{data: 'invoice', name: 'invoice'},
{data: 'pemesan', name: 'pemesan'},
{data: 'harga', name: 'harga'},
{data: 'status', name: 'status'},
{data: 'created_at', name: 'created_at'},
{data: null, name: 'action', orderable: false, searchable: false},
],
columnDefs: [
{
targets: -1,
data: null,
orderable: false,
render: function (data, type, row) {
return `
<a href="#" class="btn btn-light btn-active-light-primary btn-sm" data-kt-menu-trigger="click" data-kt-menu-placement="bottom-end" data-kt-menu-flip="top-end">
Aksi
</a>
<!--begin::Menu-->
<div class="menu menu-sub menu-sub-dropdown menu-column menu-rounded menu-gray-600 menu-state-bg-light-primary fw-bold fs-7 w-125px py-4" data-kt-menu="true">
<!--begin::Menu item-->
<div class="menu-item px-3">
<a href="{{ site_url('seller', 'transaction/v') . '/' }}${row.order_id}" class="menu-link px-3">
Detail
</a>
</div>
</div>
<!--end::Menu-->
`;
},
}
],
createdRow: function (row, data, dataIndex) {
// Set the sequential number starting from 1
$('td', row).eq(0).html(dataIndex + 1);
}
});
var handleFilterDatatable = () => {
// Select filter options
filterStatus = document.querySelectorAll('[data-kt-docs-table-filter="status_type"] [name="status"]');
const filterButton = document.querySelector('[data-kt-docs-table-filter="filter"]');
// Filter datatable on submit
filterButton.addEventListener('click', function () {
let statusValue = 'status|';
filterStatus.forEach(r => {
if (r.checked) {
statusValue = 'status|' + r.value;
}
if (statusValue === 'status|') {
statusValue = 'status|';
}
});
table.search(statusValue).draw();
});
}
// Reset Filter
var handleResetForm = () => {
const resetButton = document.querySelector('[data-kt-docs-table-filter="reset"]');
resetButton.addEventListener('click', function () {
filterStatus[0].checked = true;
table.search('').draw();
});
}
table.on('draw', function () {
handleFilterDatatable();
handleResetForm();
KTMenu.createInstances();
});
table.search('').draw();
// #myInput is a <input type="text"> element
$('#search').on('keyup change', function () {
table.search('orders|' + this.value).draw();
});
$('#data-table').on('click', '.deleteContent', function() {
var url = $(this).data('url');
$('#exampleModal').modal('show', {
backdrop: 'static'
});
$('.link').attr('href', url)
});
// Print button functionality
$('#printButton').on('click', function() {
window.print();
});
});
</script>
@endpush
@include('components.theme.pages.footer')

View File

@ -0,0 +1,115 @@
@include('components.theme.pages.header')
<section>
<!-- basic table -->
<div class="row">
<div class="col-md-12">
<div class="card">
<div class="card-header">
<h6 class="card-title">Formulir Produk</h6>
<div class="card-toolbar">
<i class="ki-duotone ki-information-2 fs-2" data-bs-toggle="tooltip" data-bs-placement="top" title="Tolong dilengkapi data informasi dengan valid">
<span class="path1"></span>
<span class="path2"></span>
<span class="path3"></span>
</i>
</div>
</div>
<div class="card-body">
<form method="POST" action="{{ site_url('seller', 'product/store') }}" enctype="multipart/form-data">
@csrf
<div class="row mb-4">
<div class="col-md-6">
<label class="form-label">Nama Produk<sup class="text-danger">*</sup></label>
<input type="text" name="name" value="{{ old('name') }}" autocomplete="off" class="form-control form-control-solid mt-2 {{ $errors->has('name') ? 'is-invalid' : '' }}" placeholder="Masukkan Nama Produk">
@error('name') <small class="text-danger">{{ $message }}</small> @enderror
</div>
<div class="col-md-6">
<label class="form-label">Jenis Produk<sup class="text-danger">*</sup></label>
<select name="type" class="form-select form-select-solid mt-2 {{ $errors->has('type') ? 'is-invalid' : '' }}">
<option value="">Pilih Jenis</option>
@foreach([1,2,3,4] as $type)
@php
$name = $type == 1 ? 'Pre/Weeding' : ($type == 2 ? 'Engagement' : ($type == 3 ? 'Party' : 'Other'));
$select = $type == old('type') ? 'selected' : '';
@endphp
<option value="{{ $type }}" {{ $select }}>{{ $name }}</option>
@endforeach
</select>
@error('type') <small class="text-danger">{{ $message }}</small> @enderror
</div>
</div>
<div class="form-group mb-4">
<label class="form-label mb-4">Deskripsi<sup class="text-danger">*</sup></label>
<textarea name="description" id="description" class="form-control form-control-solid mt-2 {{ $errors->has('description') ? 'is-invalid' : '' }}">{{ old('description') }}</textarea>
@error('description') <small class="text-danger">{{ $message }}</small> @enderror
</div>
<div class="form-group mb-4">
<label class="form-label mb-4">Harga<sup class="text-danger">*</sup></label>
<div class="input-group">
<span class="input-group-text" id="basic-addon1">Rp. </span>
<input type="number" class="form-control {{ $errors->has('is_price') ? 'is-invalid' : '' }}" name="is_price" value="{{ old('is_price') }}" min="0" placeholder="0"/>
</div>
@error('is_price') <small class="text-danger">{{ $message }}</small> @enderror
</div>
<div class="form-group mb-4">
<label class="form-label mb-4">Estimasi Waktu<sup class="text-danger">*</sup></label>
<div class="input-group">
<input type="number" class="form-control {{ $errors->has('is_delivery_time') ? 'is-invalid' : '' }}" name="is_delivery_time" value="{{ old('is_delivery_time') }}" min="0" placeholder="0"/>
<span class="input-group-text" id="basic-addon2">hari</span>
</div>
@error('is_delivery_time') <small class="text-danger">{{ $message }}</small> @enderror
</div>
<div class="form-group mb-4">
<label class="form-label mb-4">Thumbnail</label>
<input type="file" class="form-control form-control-solid" name="image">
</div>
<div class="form-group mb-0">
<button type="submit" class="btn btn-primary">Tambah</button>
<a href="{{ site_url('seller', 'product') }}" class="btn btn-light btn-light">Kembali</a>
</div>
</form>
</div>
</div>
</div>
</div>
</section>
@push('scripts')
<script src="https://preview.keenthemes.com/html/metronic/docs/assets/plugins/custom/ckeditor/ckeditor-classic.bundle.js"></script>
<script>
$(document).ready(function () {
$('.input-category').select2({
placeholder: 'Pilih salah satu',
dropdownParent: $('.input-category').parent()
});
$(".checkbox").change(function() {
if(this.checked) {
$('.form-custom-content').removeClass('d-none');
} else {
$('.form-custom-content').addClass('d-none');
}
});
});
ClassicEditor
.create(document.querySelector('#description'), {
toolbar: {
alignment: {
options: ['left','right']
},
items: [
'undo', 'redo',
'|', 'heading',
'|', 'bold', 'italic', 'underline', 'strikethrough',
'|', 'link', 'insertTable',
'|', 'bulletedList', 'numberedList', 'outdent', 'indent',
'|', 'alignment','blockQuote',
'|', 'horizontalLine',
]
}
});
</script>
@endpush
@include('components.theme.pages.footer')

View File

@ -0,0 +1,132 @@
@include('components.theme.pages.header')
<section>
<!-- basic table -->
<div class="row">
<div class="col-md-12">
<div class="card">
<div class="card-header">
<h6 class="card-title">Formulir Produk</h6>
<div class="card-toolbar">
<i class="ki-duotone ki-information-2 fs-2" data-bs-toggle="tooltip" data-bs-placement="top" title="Tolong dilengkapi data informasi dengan valid">
<span class="path1"></span>
<span class="path2"></span>
<span class="path3"></span>
</i>
</div>
</div>
<div class="card-body">
<form method="POST" action="{{ site_url('seller', 'product/update') . '/' . $getSitesInfo->id }}" enctype="multipart/form-data">
@csrf
<div class="row mb-4">
<div class="col-md-6">
<label class="form-label">Nama Produk<sup class="text-danger">*</sup></label>
<input type="text" name="name" value="{{ $getSitesInfo->name }}" autocomplete="off" class="form-control form-control-solid mt-2 {{ $errors->has('name') ? 'is-invalid' : '' }}" placeholder="Masukkan Nama Produk">
@error('name') <small class="text-danger">{{ $message }}</small> @enderror
</div>
<div class="col-md-6">
<label class="form-label">Jenis Produk<sup class="text-danger">*</sup></label>
<select name="type" class="form-select form-select-solid mt-2 {{ $errors->has('type') ? 'is-invalid' : '' }}">
<option value="">Pilih Jenis</option>
@foreach([1,2,3,4] as $type)
@php
$name = $type == 1 ? 'Pre/Weeding' : ($type == 2 ? 'Engagement' : ($type == 3 ? 'Party' : 'Other'));
$select = $type == $getSitesInfo->is_type ? 'selected' : '';
@endphp
<option value="{{ $type }}" {{ $select }}>{{ $name }}</option>
@endforeach
</select>
@error('type') <small class="text-danger">{{ $message }}</small> @enderror
</div>
</div>
<div class="form-group mb-4">
<label class="form-label mb-4">Deskripsi<sup class="text-danger">*</sup></label>
<textarea name="description" id="description" class="form-control form-control-solid mt-2 {{ $errors->has('description') ? 'is-invalid' : '' }}">{{ $getSitesInfo->description }}</textarea>
@error('description') <small class="text-danger">{{ $message }}</small> @enderror
</div>
<div class="form-group mb-4">
<label class="form-label mb-4">Harga<sup class="text-danger">*</sup></label>
<div class="input-group">
<span class="input-group-text" id="basic-addon1">Rp. </span>
<input type="number" class="form-control {{ $errors->has('is_price') ? 'is-invalid' : '' }}" name="is_price" value="{{ $getSitesInfo->is_price }}" min="0" placeholder="0"/>
</div>
@error('is_price') <small class="text-danger">{{ $message }}</small> @enderror
</div>
<div class="form-group mb-4">
<label class="form-label mb-4">Estimasi Waktu<sup class="text-danger">*</sup></label>
<div class="input-group">
<input type="number" class="form-control {{ $errors->has('is_delivery_time') ? 'is-invalid' : '' }}" name="is_delivery_time" value="{{ $getSitesInfo->is_delivery_time }}" min="0" placeholder="0"/>
<span class="input-group-text" id="basic-addon2">hari</span>
</div>
@error('is_delivery_time') <small class="text-danger">{{ $message }}</small> @enderror
</div>
<div class="form-group mb-4">
<label class="form-label mb-4">Status Produk<sup class="text-danger">*</sup></label>
<select class="form-select form-select-solid {{ $errors->has('is_status') ? 'is-invalid' : '' }}" name="is_status">
<option value="">Pilih salah satu</option>
@foreach([1,2,3,4,5] as $status)
@php
$name = $status == 1 ? 'Aktif' : ($status == 2 ? 'Sedang Ditinjau' : ($status == 3 ? 'Tidak Aktif' : ($status == 4 ? 'Ditolak' : 'Dinonaktifkan')));
$select = $status == $getSitesInfo->is_status ? 'selected' : '';
@endphp
<option value="{{ $status }}" {{ $select }}>{{ $name }}</option>
@endforeach
</select>
@error('is_status') <small class="text-danger">{{ $message }}</small> @enderror
</div>
<div class="form-group mb-4">
<label class="form-label mb-4">Thumbnail</label>
<input type="file" class="form-control form-control-solid" name="image">
@if(!empty($getSitesInfo->thumbnail))
<a href="{{ assets_url($getSitesInfo->thumbnail) }}" target="_blank">klik disini</a> untuk melihat gambar</a>
@endif
</div>
<div class="form-group mb-0">
<button type="submit" class="btn btn-primary">Perbarui</button>
<a href="{{ site_url('seller', 'product') }}" class="btn btn-light btn-light">Kembali</a>
</div>
</form>
</div>
</div>
</div>
</div>
</section>
@push('scripts')
<script src="https://preview.keenthemes.com/html/metronic/docs/assets/plugins/custom/ckeditor/ckeditor-classic.bundle.js"></script>
<script>
$(document).ready(function () {
$('.input-category').select2({
placeholder: 'Pilih salah satu',
dropdownParent: $('.input-category').parent()
});
$(".checkbox").change(function() {
if(this.checked) {
$('.form-custom-content').removeClass('d-none');
} else {
$('.form-custom-content').addClass('d-none');
}
});
});
ClassicEditor
.create(document.querySelector('#description'), {
toolbar: {
alignment: {
options: ['left','right']
},
items: [
'undo', 'redo',
'|', 'heading',
'|', 'bold', 'italic', 'underline', 'strikethrough',
'|', 'link', 'insertTable',
'|', 'bulletedList', 'numberedList', 'outdent', 'indent',
'|', 'alignment','blockQuote',
'|', 'horizontalLine',
]
}
});
</script>
@endpush
@include('components.theme.pages.footer')

View File

@ -0,0 +1,278 @@
@push('css')
<link href="{{ frontend('plugins/custom/datatables/datatables.bundle.css') }}" rel="stylesheet" type="text/css" />
@endpush
@include('components.theme.pages.header')
<section>
<!-- basic table -->
<div class="row">
<div class="col-12">
<div class="card card-flush">
<div class="card-header flex-nowrap pt-5">
<div>
<div class="d-flex align-items-center position-relative my-1">
<i class="ki-outline ki-magnifier fs-1 position-absolute ms-6"><span class="path1"></span><span class="path2"></span></i>
<input type="text" id="search" class="form-control form-control-solid w-250px ps-15" placeholder="Temukan Nama Produk"/>
</div>
</div>
<div class="card-toolbar">
<!--begin::Menu-->
<button class="btn btn-light-primary btn-active-light-primary justify-content-end"
data-kt-menu-trigger="click" data-kt-menu-placement="bottom-end"
data-kt-menu-overflow="true">
<i class="ki-outline ki-filter fs-1 me-n1"></i>
<span class="mb-0">Filter</span>
</button>
<div class="menu menu-sub menu-sub-dropdown menu-column menu-rounded menu-gray-800 menu-state-bg-light-primary fw-semibold w-300px"
data-kt-menu="true">
<div class="menu-item px-3">
<div class="menu-content fs-6 text-dark fw-bold px-3 py-4">Filter By</div>
</div>
<div class="separator mb-3 opacity-75"></div>
<div class="px-7 py-5 menu-item" data-kt-docs-table-filter="status_type">
<div class="form-check form-check-custom form-check-solid mb-3">
<input class="form-check-input" name="status" type="radio" value="1" id="flexRadioDefault"/>
<label class="form-check-label" for="flexRadioDefault">
Aktif
</label>
</div>
<div class="form-check form-check-custom form-check-solid mb-3">
<input class="form-check-input" name="status" type="radio" value="2" id="flexRadioDefault"/>
<label class="form-check-label" for="flexRadioDefault">
Dalam Tinjau
</label>
</div>
<div class="form-check form-check-custom form-check-solid mb-3">
<input class="form-check-input" name="status" type="radio" value="3" id="flexRadioDefault"/>
<label class="form-check-label" for="flexRadioDefault">
Tidak Aktif
</label>
</div>
<div class="form-check form-check-custom form-check-solid mb-3">
<input class="form-check-input" name="status" type="radio" value="4" id="flexRadioDefault"/>
<label class="form-check-label" for="flexRadioDefault">
Ditolak
</label>
</div>
<div class="form-check form-check-custom form-check-solid mb-3">
<input class="form-check-input" name="status" type="radio" value="5" id="flexRadioDefault"/>
<label class="form-check-label" for="flexRadioDefault">
Ditutup
</label>
</div>
<div class="d-flex justify-content-end py-3">
<button type="reset" class="btn btn-light btn-active-light-primary me-2" data-kt-menu-dismiss="true" data-kt-docs-table-filter="reset">Atur Ulang</button>
<button type="submit" class="btn btn-primary" data-kt-menu-dismiss="true" data-kt-docs-table-filter="filter">Terapkan</button>
</div>
</div>
</div>
</div>
</div>
<div class="card-body">
<div class="table-responsive">
<table id="data-table" class="table align-middle table-row-dashed fs-6 gy-5">
<thead>
<tr class="text-start text-gray-400 fw-bold fs-7 text-uppercase gs-0">
<th>ID</th>
<th>Name</th>
<th style="width: 100px">Harga</th>
<th style="width: 150px">Pemilik</th>
<th style="width: 150px">Jenis</th>
<th>Status</th>
<th>Action</th>
</tr>
</thead>
<tbody class="text-gray-600 fw-semibold"></tbody>
</table>
</div>
</div>
</div>
</div>
</div>
</section>
@push('scripts')
<script src="{{ frontend('plugins/custom/datatables/datatables.bundle.js') }}"></script>
<script type="text/javascript">
$(function () {
var filterStatus;
var table = $('#data-table').DataTable({
processing: true,
serverSide: true,
ajax: "{{ site_url('seller', 'product') }}",
order: [[5, 'desc']],
stateSave: true,
columns: [
{data: null, name: 'id'},
{data: 'name', name: 'name'},
{data: 'price', name: 'price'},
{data: 'author', name: 'author'},
{data: 'type', name: 'type'},
{data: 'is_status', name: 'is_status'},
{data: null}
],
columnDefs: [
{
targets: -1,
data: null,
orderable: false,
render: function (data, type, row) {
return `
<a href="#" class="btn btn-light btn-active-light-primary btn-sm" data-kt-menu-trigger="click" data-kt-menu-placement="bottom-end" data-kt-menu-flip="top-end">
Aksi
</a>
<!--begin::Menu-->
<div class="menu menu-sub menu-sub-dropdown menu-column menu-rounded menu-gray-600 menu-state-bg-light-primary fw-bold fs-7 w-125px py-4" data-kt-menu="true">
<!--begin::Menu item-->
<div class="menu-item px-3">
<a href="#" data-id="${row.id}" class="menu-link px-3 viewContent">
Detail
</a>
</div>
<!--end::Menu item-->
<div class="menu-item px-3">
<a href="{{ site_url('seller', 'product/edit') }}/${row.id}" class="menu-link px-3" data-kt-docs-table-filter="delete_row">
Edit
</a>
</div>
<!--begin::Menu item-->
<div class="menu-item px-3">
<a href="#" data-url="{{ site_url('seller', 'product/delete') }}/${row.id}" class="menu-link px-3 deleteContent">
Delete
</a>
</div>
<!--end::Menu item-->
</div>
<!--end::Menu-->
`;
},
}
],
createdRow: function (row, data, dataIndex) {
// Set the sequential number starting from 1
$('td', row).eq(0).html(dataIndex + 1);
}
});
// Filter Datatable
var handleFilterDatatable = () => {
// Select filter options
filterStatus = document.querySelectorAll('[data-kt-docs-table-filter="status_type"] [name="status"]');
const filterButton = document.querySelector('[data-kt-docs-table-filter="filter"]');
// Filter datatable on submit
filterButton.addEventListener('click', function () {
let statusValue = 'status|';
filterStatus.forEach(r => {
if (r.checked) {
statusValue = 'status|' + r.value;
}
if (statusValue === 'status|') {
statusValue = 'status|';
}
});
table.search(statusValue).draw();
});
}
// Reset Filter
var handleResetForm = () => {
const resetButton = document.querySelector('[data-kt-docs-table-filter="reset"]');
resetButton.addEventListener('click', function () {
filterStatus[0].checked = true;
table.search('').draw();
});
}
table.on('draw', function () {
handleFilterDatatable();
handleResetForm();
KTMenu.createInstances();
});
table.search('').draw();
// #myInput is a <input type="text"> element
$('#search').on('keyup change', function () {
table.search('sites|' + this.value).draw();
});
$('#data-table').on('click', '.deleteContent', function() {
var url = $(this).data('url');
$('#exampleModal').modal('show', {
backdrop: 'static'
});
$('.link').attr('href', url)
})
$('#data-table').on('click', '.viewContent', function() {
var url = $(this).data('id');
$('#viewerModal').modal('show', {
backdrop: 'static'
});
$.ajax({
url: `{{ site_url('seller', 'product/detail') }}/${url}`,
type: 'GET',
header: {
'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
},
success: function (data) {
if(data.secure) {
var iconSecure = `
<i class="ki-duotone ki-shield-tick fs-2 text-success">
<span class="path1"></span>
<span class="path2"></span>
</i>
`
} else {
var iconSecure = `
<i class="ki-duotone ki-shield-cross fs-2 text-danger">
<span class="path1"></span>
<span class="path2"></span>
<span class="path3"></span>
</i>
`
}
$('.result').html(`
<h4 class="mb-0 font-weight-bold">Informasi Produk</h4>
<div class="row">
<div class="separator separator-dotted border-secondary my-6"></div>
<div class="col-4">
<div class="fw-bold">Pemilik Produk</div>
<div class="text-muted">${data.is_seller}</div>
</div>
<div class="col-4">
<div class="fw-bold">Hak Kepemilikan</div>
<div class="text-muted">${data.is_role}</div>
</div>
<div class="col-4">
<div class="fw-bold">Jenis Produk</div>
<div class="text-muted">${data.is_type == 1 ? 'Pre/Weeding' : (data.is_type == 2 ? 'Engagement' : (data.is_type == 3 ? 'Party' : 'Other'))}</div>
</div>
<div class="my-3"></div>
<div class="col-4">
<div class="fw-bold">Estimasi Pengerjaan</div>
<div class="text-muted">${data.is_delivery_time} Hari</div>
</div>
<div class="col-4">
<div class="fw-bold">Harga</div>
<div class="text-muted">${data.is_price}</div>
</div>
</div>
`);
}
})
})
});
</script>
@endpush
@include('components.theme.pages.footer')

View File

@ -0,0 +1,275 @@
@include('components.theme.pages.header')
<section>
<div class="row">
<div class="col-xl-3">
<div class="card bg-body hoverable card-xl-stretch mb-xl-8">
<div class="card-body">
<i class="ki-outline ki-purchase text-dark fs-2x ms-n1"></i>
<div class="text-gray-900 fw-bold fs-2 mb-2 mt-5">
{{ $getTotalOrder }}
</div>
<div class="fw-semibold text-gray-400">
Total Pesanan
</div>
</div>
</div>
</div>
<div class="col-xl-3">
<div class="card bg-body hoverable card-xl-stretch mb-xl-8">
<div class="card-body">
<i class="ki-outline ki-plus-square text-primary fs-2x ms-n1"></i>
<div class="text-gray-900 fw-bold fs-2 mb-2 mt-5">
{{ 'Rp. ' . number_format($getTotalIncomeOrder, 0, ',', '.') }}
</div>
<div class="fw-semibold text-gray-400">
Total Pendapatan Semua
</div>
</div>
</div>
</div>
<div class="col-xl-3">
<div class="card bg-body hoverable card-xl-stretch mb-xl-8">
<div class="card-body">
<i class="ki-outline ki-pin text-danger fs-2x ms-n1"></i>
<div class="text-gray-900 fw-bold fs-2 mb-2 mt-5">
{{ 'Rp. ' . number_format($getTotalPendingIncomeOrder, 0, ',', '.') }}
</div>
<div class="fw-bold text-gray-400">
Total Pendapatan Pending
</div>
</div>
</div>
</div>
<div class="col-xl-3">
<div class="card bg-body hoverable card-xl-stretch mb-xl-8">
<div class="card-body">
<span class="pulse pulse-warning">
<i class="ki-outline ki-dots-square fs-2x ms-n1 text-warning"><span class="path1"></span><span class="path2"></span><span class="path3"></span><span class="path4"></span></i>
<span class="pulse-ring" style="top: -15px; left: -10px"></span>
</span>
<div class="text-gray-900 fw-bold fs-2 mb-2 mt-5">
{{ $getListAwaitingWithdrawal }}</span>
</div>
<div class="fw-bold text-gray-400">
Penarikan Pending
</div>
</div>
</div>
</div>
<div class="col-12 mb-5">
<div class="card">
<div class="card-header">
<h3 class="card-title">Flow Transaksi</h3>
</div>
<div class="card-body">
<div id="kt_apexcharts_3" style="height: 300px;"></div>
</div>
</div>
</div>
<div class="col-xl-12">
<div class="card">
<div class="card-header">
<h3 class="card-title">Pesanan</h3>
</div>
<div class="card-body p-0">
<div class="table-responsive">
<table class="table align-middle table-row-bordered table-row-solid gy-4 gs-9">
<thead>
<tr class="text-start text-gray-400 fw-bold fs-7 text-uppercase gs-0">
<th>Invoice ID</th>
<th>Jenis</th>
<th>Pemesan</th>
<th>Status</th>
<th>Action</th>
</tr>
</thead>
<tbody class="text-gray-600 fw-semibold">
@if(empty($getListOrder->items))
<tr>
<td colspan="5" class="text-center">Tidak ada pesanan...</td>
</tr>
@else
@foreach($getListOrder as $order)
<tr>
<td>{{ $order->invoice_number }}</td>
<td>
@if($order->is_type == 1)
<span class="badge badge-light-success fs-7 fw-bold">Publisher</span>
@else
<span class="badge badge-light-danger fs-7 fw-bold">Domain</span>
@endif
</td>
<td>{{ $order->user->first()->name }}</td>
<td>
@if ($row->is_status == enum('isOrderRequested'))
<span class="mb-1 badge font-medium bg-dark text-white py-3 px-4 fs-7 w-100 text-center">Menunggu</span>
@elseif($row->is_status == enum('isOrderOnWorking'))
<span class="mb-1 badge font-medium bg-primary text-white py-3 px-4 fs-7 w-100 text-center">Dalam pengerjaan</span>
@elseif($row->is_status == enum('isOrderSubmitted'))
<span class="mb-1 badge font-medium bg-danger text-white py-3 px-4 fs-7 w-100 text-center">Dikirim</span>
@elseif($row->is_status == enum('isOrderCompleted'))
<span class="mb-1 badge font-medium bg-success text-white py-3 px-4 fs-7 w-100 text-center">Selesai</span>
@elseif($row->is_status == enum('isOrderReqCancel'))
<span class="mb-1 badge font-medium bg-danger text-white py-3 px-4 fs-7 w-100 text-center">Permintaan Ditolak</span>
@elseif($row->is_status == enum('isOrderCancelled'))
<span class="mb-1 badge font-medium bg-danger text-white py-3 px-4 fs-7 w-100 text-center">Dibatalkan</span>
@elseif($row->is_status == enum('isOrderRejected'))
<span class="mb-1 badge font-medium bg-danger text-white py-3 px-4 fs-7 w-100 text-center">Ditolak</span>
@endif
</td>
<td>
<a href="{{ route('seller.orders.detail', ['id' => $order->id]) }}" class="btn btn-sm btn-light"><i class="ki-outline ki-arrow-up-right fs-4"></i></a>
</td>
</tr>
@endforeach
@endif
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
</section>
@push('scripts')
<script>
var element = document.getElementById('kt_apexcharts_3');
var height = parseInt(KTUtil.css(element, 'height'));
var labelColor = "#99a1b7";
var borderColor = "#eceff1";
var baseColor = "#7239ea";
var lightColor = "#f8f5ff";
@php
$month = [];
$profit = [];
foreach($getFlowOrder as $keyMonth => $valueMonth) {
array_push($month, ucfirst($keyMonth));
array_push($profit, (int) $valueMonth);
}
@endphp
var options = {
series: [{
name: 'Pendapatan',
data: <?= json_encode($profit) ?>
}],
chart: {
fontFamily: 'inherit',
type: 'area',
height: height,
toolbar: {
show: false
}
},
plotOptions: {
},
legend: {
show: false
},
dataLabels: {
enabled: false
},
fill: {
type: 'solid',
opacity: 1
},
stroke: {
curve: 'smooth',
show: true,
width: 3,
colors: [baseColor]
},
xaxis: {
categories: <?= json_encode($month) ?>,
axisBorder: {
show: false,
},
axisTicks: {
show: false
},
labels: {
style: {
colors: labelColor,
fontSize: '12px'
}
},
crosshairs: {
position: 'front',
stroke: {
color: baseColor,
width: 1,
dashArray: 3
}
},
tooltip: {
enabled: true,
formatter: undefined,
offsetY: 0,
style: {
fontSize: '12px'
}
}
},
yaxis: {
labels: {
style: {
colors: labelColor,
fontSize: '12px'
}
}
},
states: {
normal: {
filter: {
type: 'none',
value: 0
}
},
hover: {
filter: {
type: 'none',
value: 0
}
},
active: {
allowMultipleDataPointsSelection: false,
filter: {
type: 'none',
value: 0
}
}
},
tooltip: {
style: {
fontSize: '12px'
},
y: {
formatter: function (val) {
return 'Rp. ' + val.toLocaleString('id-ID');
}
}
},
colors: [lightColor],
grid: {
borderColor: borderColor,
strokeDashArray: 4,
yaxis: {
lines: {
show: true
}
}
},
markers: {
strokeColor: baseColor,
strokeWidth: 3
}
};
var chart = new ApexCharts(element, options);
chart.render();
</script>
@endpush
@include('components.theme.pages.footer')

View File

@ -0,0 +1,95 @@
@include('components.theme.pages.header')
<section>
<div class="row">
<div class="col-md-12 mb-5">
<div class="card">
<div class="card-header">
<h3 class="card-title">Riwayat Login</h3>
</div>
<div class="card-body p-0">
<div class="table-responsive">
<table class="table align-middle table-row-bordered table-row-solid gy-4 gs-9">
<thead class="border-gray-200 fs-5 fw-semibold bg-lighten">
<tr>
<th class="min-w-100px">Status</th>
<th class="min-w-150px">User Agent</th>
<th class="min-w-150px">Catatan</th>
<th class="min-w-150px">IP Address</th>
<th class="min-w-150px">Waktu</th>
</tr>
</thead>
<tbody class="fw-6 fw-semibold text-gray-600">
@foreach($logsActivity as $log)
@php
$logs = json_decode($log->withContent);
@endphp
<tr>
<td><span class="badge badge-light-success fs-7 fw-bold">OK</span></td>
<td>{{ $logs->user_agent }}</td>
<td>{{ $logs->text }}</td>
<td>{{ $logs->ip_address }}</td>
<td>{{ date_formatting($log->performedOn, 'timeago') }}</td>
</tr>
@endforeach
</tbody>
</table>
</div>
</div>
</div>
</div>
<div class="col-md-12">
<div class="card">
<div class="card-header">
<h3 class="card-title">Riwayat Umum</h3>
</div>
<div class="card-body p-0">
<div class="table-responsive">
<table class="table align-middle table-row-bordered table-row-solid gy-4 gs-9">
<thead class="border-gray-200 fs-5 fw-semibold bg-lighten">
<tr>
<th class="min-w-100px">Status</th>
<th class="min-w-150px">Tipe</th>
<th class="min-w-150px">Catatan</th>
<th class="min-w-150px">Waktu</th>
</tr>
</thead>
<tbody class="fw-6 fw-semibold text-gray-600">
@foreach($logGeneral as $log)
@php
$logs = json_decode($log->withContent);
@endphp
<tr>
<td><span class="badge badge-light-success fs-7 fw-bold">OK</span></td>
<td><span class="text-uppercase">{{ $logs->status }}</span></td>
<td>{{ $logs->text }}</td>
<td>{{ date_formatting($log->performedOn, 'timeago') }}</td>
</tr>
@endforeach
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
</section>
@push('scripts')
<script>
Inputmask({
mask: "*{1,20}[.*{1,20}][.*{1,20}][.*{1,20}]@*{1,20}[.*{2,6}][.*{1,2}]",
greedy: false,
onBeforePaste: function (pastedValue, opts) {
pastedValue = pastedValue.toLowerCase();
return pastedValue.replace("mailto:", "");
},
definitions: {
"*": {
validator: '[0-9A-Za-z!#$%&"*+/=?^_`{|}~\-]',
cardinality: 1,
casing: "lower"
}
}
}).mask("#email");
</script>
@endpush
@include('components.theme.pages.footer')

View File

View File

@ -0,0 +1,18 @@
<?php
use Illuminate\Http\Request;
/*
|--------------------------------------------------------------------------
| API Routes
|--------------------------------------------------------------------------
|
| Here is where you can register API routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| is assigned the "api" middleware group. Enjoy building your API!
|
*/
Route::middleware('auth:api')->get('/seller', function (Request $request) {
return $request->user();
});

View File

@ -0,0 +1,51 @@
<?php
Route::group(['prefix' => 'seller', 'middleware' => ['auth', 'check.seller']], function () {
Route::get('/', 'SellerController@index')->name('seller');
Route::group(['prefix' => 'product', 'middleware' => ['check.status']], function() {
Route::get('/', 'ProductController@index')->name('product');
Route::get('create', 'ProductController@create')->name('product.create');
Route::post('store', 'ProductController@store')->name('product.store');
Route::get('edit/{id}', 'ProductController@edit')->name('product.edit');
Route::post('update/{id}', 'ProductController@update')->name('product.update');
Route::get('detail/{id}', 'ProductController@detail')->name('product.detail');
Route::get('delete/{id}', 'ProductController@destroy')->name('product.delete');
});
Route::group(['prefix' => 'transaction', 'middleware' => ['check.status']], function() {
Route::get('/', 'OrdersController@index')->name('orders');
Route::get('v/{invoice}', 'OrdersController@view')->name('orders.view');
Route::post('complete/{invoice}', 'OrdersController@complete')->name('orders.complete');
Route::post('working/{invoice}', 'OrdersController@working')->name('orders.working')->middleware('XssSanitization');
});
Route::prefix('account')->group(function () {
Route::get('/', 'AccountController@index')->name('account');
Route::get('preference', 'AccountController@preference')->name('user.preference');
Route::post('update/{id}', 'AccountController@updateProfile')->name('user.account.update.profile');
Route::post('update-preference/{id}', 'AccountController@updatePreference')->name('user.account.update.preference');
Route::group(['prefix' => 'rekening', 'middleware' => ['check.status']], function() {
Route::get('/', 'AccountController@rekening')->name('rekening');
Route::get('create', 'AccountController@createRekening')->name('rekening.create');
Route::post('store', 'AccountController@storeRekening')->name('rekening.store')->middleware('XssSanitization');
Route::get('edit/{id}', 'AccountController@editRekening')->name('rekening.edit');
Route::post('update/{id}', 'AccountController@updateRekening')->name('rekening.update')->middleware('XssSanitization');
Route::get('delete/{id}', 'AccountController@deleteRekening')->name('rekening.delete');
});
Route::group(['prefix' => 'withdrawal', 'middleware' => ['check.status']], function() {
Route::get('/', 'AccountController@withdrawal')->name('withdrawal');
Route::get('create', 'AccountController@createRequest')->name('withdrawal.create');
Route::post('store', 'AccountController@storeRequest')->name('withdrawal.store')->middleware('XssSanitization');
Route::get('v/{invoice}', 'AccountController@viewRequest')->name('withdrawal.view');
Route::get('c/{invoice}', 'AccountController@cancelRequest')->name('withdrawal.cancel');
});
});
Route::group(['prefix' => 'report', 'middleware' => ['check.status']], function() {
Route::get('/', 'ReportController@index')->name('report');
Route::get('statistic', 'ReportController@statistic')->name('report.statistic');
});
});

View File

View File

View File

@ -0,0 +1,23 @@
{
"name": "nwidart/seller",
"description": "",
"authors": [
{
"name": "Nicolas Widart",
"email": "n.widart@gmail.com"
}
],
"extra": {
"laravel": {
"providers": [],
"aliases": {
}
}
},
"autoload": {
"psr-4": {
"Modules\\Seller\\": ""
}
}
}

View File

@ -0,0 +1,13 @@
{
"name": "Seller",
"alias": "seller",
"description": "",
"keywords": [],
"priority": 0,
"providers": [
"Modules\\Seller\\Providers\\SellerServiceProvider"
],
"aliases": {},
"files": [],
"requires": []
}

View File

@ -0,0 +1,21 @@
{
"private": true,
"scripts": {
"dev": "npm run development",
"development": "mix",
"watch": "mix watch",
"watch-poll": "mix watch -- --watch-options-poll=1000",
"hot": "mix watch --hot",
"prod": "npm run production",
"production": "mix --production"
},
"devDependencies": {
"axios": "^0.21.4",
"dotenv": "^10.0.0",
"dotenv-expand": "^5.1.0",
"laravel-mix": "^6.0.31",
"laravel-mix-merge-manifest": "^2.0.0",
"lodash": "^4.17.21",
"postcss": "^8.3.7"
}
}

View File

@ -0,0 +1,14 @@
const dotenvExpand = require('dotenv-expand');
dotenvExpand(require('dotenv').config({ path: '../../.env'/*, debug: true*/}));
const mix = require('laravel-mix');
require('laravel-mix-merge-manifest');
mix.setPublicPath('../../public').mergeManifest();
mix.js(__dirname + '/Resources/assets/js/app.js', 'js/seller.js')
.sass( __dirname + '/Resources/assets/sass/app.scss', 'css/seller.css');
if (mix.inProduction()) {
mix.version();
}

View File

View File

@ -0,0 +1,5 @@
<?php
return [
'name' => 'User'
];

View File

View File

View File

@ -0,0 +1,21 @@
<?php
namespace Modules\User\Database\Seeders;
use Illuminate\Database\Seeder;
use Illuminate\Database\Eloquent\Model;
class UserDatabaseSeeder extends Seeder
{
/**
* Run the database seeds.
*
* @return void
*/
public function run()
{
Model::unguard();
// $this->call("OthersTableSeeder");
}
}

View File

View File

View File

@ -0,0 +1,72 @@
<?php
namespace Modules\User\Entities;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Modules\Seller\Entities\AccountModel as User;
class CartModel extends Model
{
use HasFactory;
protected $table = 'tbl_carts';
protected $fillable = [
'id', 'user_id', 'name',
'price', 'quantity'
];
public $timestamps = false;
protected $keyType = 'string';
public $incrementing = false;
public $sessionUnique = null;
public function user()
{
return $this->hasMany(User::class, 'id', 'user_id');
}
public static function session($sessionId)
{
$instance = new static(); // Create an instance of the class
$instance->sessionUnique = $sessionId; // Set the session ID
return $instance; // Return the instance for chaining
}
public function getCart()
{
return self::where('user_id', user()->id)->limit(5)->get();
}
public function store($data)
{
// Add cart item to the database with the session ID from $this
return self::insert(array_merge(['user_id' => user()->id], $data));
}
public static function updateCart($uniqueId, $data)
{
// Update the cart item based on the unique ID and the session ID from $this
return self::where('id', $uniqueId)->where('user_id', user()->id)->update($data);
}
public function remove($uniqueId)
{
// Remove the cart item based on the unique ID and the session ID from $this
return self::where('id', $uniqueId)->where('user_id', $this->id)->delete();
}
public function getTotal()
{
// Get the total cart amount based on the session ID from $this
return self::where('user_id', $this->id)->sum('price');
}
public function getSubTotal()
{
// Get the subtotal cart amount based on the session ID from $this
return self::where('user_id', $this->id)
->selectRaw('SUM(price * quantity) as subtotal')
->value('subtotal');
}
}

View File

@ -0,0 +1,56 @@
<?php
namespace Modules\User\Entities;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Modules\Seller\Entities\ProductModel;
use App\Models\User;
class OrderHistoryModel extends Model
{
use HasFactory;
protected $table = 'tbl_order_detail';
protected $fillable = [
'id', 'seller_id', 'buy_id', 'order_id', 'product_id', 'is_status',
'comment', 'price'
];
protected $keyType = "string";
public $incrementing = false;
protected $primaryKey = 'id';
public function product()
{
return $this->hasOne(ProductModel::class, 'id', 'product_id');
}
public function client()
{
return $this->hasOne(User::class, 'id', 'buy_id');
}
public static function getTotalIncomeSeller()
{
$months = [
'jan' => 1, 'feb' => 2, 'mar' => 3, 'apr' => 4, 'may' => 5, 'jun' => 6,
'jul' => 7, 'aug' => 8, 'sep' => 9, 'oct' => 10, 'nov' => 11, 'dec' => 12,
];
$result = collect($months)->mapWithKeys(function ($month, $monthName) {
$totalAmount = self::whereMonth('created_at', $month)
->whereYear('created_at', now()->year)
->where('seller_id', user()->id)
->sum('price');
return [$monthName => $totalAmount];
});
return $result;
}
public function getCreatedAtAttribute($value)
{
return date('d M Y H:i', strtotime($value));
}
}

View File

@ -0,0 +1,72 @@
<?php
namespace Modules\User\Entities;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Modules\Seller\Entities\AccountModel;
use Modules\Seller\Entities\SitesModel;
use Modules\User\Entities\OrderHistoryModel;
use Carbon\Carbon;
class OrderModel extends Model
{
use HasFactory;
protected $table = 'tbl_order';
protected $fillable = [
'id', 'user_id', 'invoice_number', 'price',
'url_payment', 'is_status'
];
protected $keyType = 'string';
public $incrementing = false;
protected $primaryKey = 'id';
public function user()
{
return $this->hasOne(AccountModel::class, 'id', 'buy_id');
}
public function seller()
{
return $this->hasOne(AccountModel::class, 'id', 'sell_id');
}
public function history()
{
return $this->hasMany(OrderHistoryModel::class, 'order_id', 'id')->orderBy('created_at', 'desc')->limit(5);
}
public static function getTotalAmountByMonth()
{
$months = [
'jan' => 1, 'feb' => 2, 'mar' => 3, 'apr' => 4, 'may' => 5, 'jun' => 6,
'jul' => 7, 'aug' => 8, 'sep' => 9, 'oct' => 10, 'nov' => 11, 'dec' => 12,
];
$result = collect($months)->mapWithKeys(function ($month, $monthName) {
$totalAmount = self::whereMonth('created_at', $month)
->whereYear('created_at', now()->year)
->sum('price');
return [$monthName => $totalAmount];
});
return $result;
}
protected $appends = ['seller_email']; // Kolom virtual
public function getSellerEmailAttribute()
{
// Di sini Anda dapat mengembalikan nilai yang sesuai
// berdasarkan logika bisnis Anda
// Contoh sederhana, jika ada $isEmailSeller, maka gunakan itu
return $this->attributes['seller_email'] ?? $this->isEmailSeller;
}
public function getCreatedAtAttribute($value)
{
return Carbon::parse($value)->format('Y-m-d H:i:s');
}
}

View File

@ -0,0 +1,37 @@
<?php
namespace Modules\User\Entities;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Modules\Seller\Entities\AccountModel as Account;
use Modules\Seller\Entities\SitesModel as Sites;
class ReviewModel extends Model
{
use HasFactory;
protected $table = 'tbl_reviews';
protected $fillable = [
'id', 'buy_id', 'sell_id', 'website_id', 'review',
'rating', 'created_at', 'updated_at'
];
protected $keyType = 'string';
public $incrementing = false;
public function user()
{
return $this->hasMany(Account::class, 'id', 'buy_id');
}
public function seller()
{
return $this->hasMany(Account::class, 'id', 'sell_id');
}
public function website()
{
return $this->hasMany(Sites::class, 'id', 'website_id');
}
}

View File

View File

@ -0,0 +1,240 @@
<?php
namespace Modules\User\Http\Controllers;
use Illuminate\Contracts\Support\Renderable;
use Illuminate\Http\Request;
use Illuminate\Routing\Controller;
use Illuminate\Support\Collection;
use Illuminate\Support\Facades\Validator;
use Illuminate\Support\Facades\Storage;
use Illuminate\Support\Str;
use DataTables;
// additional library loaded
use App\Enums\GlobalEnum;
use Carbon\Carbon;
use App\Helpers\MailerHelper as Mailers;
// additional modules model binding
use Modules\Seller\Entities\NotificationModel as Notificator;
use Modules\Seller\Entities\AccountModel as Account;
use Modules\Seller\Entities\RekeningBankModel as ListBank;
use Modules\User\Entities\CartModel as Carts;
use Modules\Seller\Entities\ProductModel as Product;
use Modules\User\Entities\OrderModel as Orders;
use Modules\User\Entities\OrderHistoryModel as Detail;
use Modules\Seller\Entities\BillingModel as Billing;
use App\Models\LogActivites;
class AccountController extends Controller
{
public $totalOrders; // total order of user
public function index()
{
$data = [
'subtitle' => 'Akun'
];
return view('user::account.index', compact('data'));
}
public function updateProfile(Request $request, $id)
{
$validator = Validator::make($request->all(), [
'name' => 'required',
'email' => 'required',
'phone' => 'required',
'password' => 'string',
]);
if ($validator->fails()) {
return redirect()->back()->withErrors($validator)->withInput();
}
$input = $request->all();
$findUser = Account::find($id);
if($findUser) {
// update data
$findUser->name = $input['name'];
$findUser->email = $input['email'];
$findUser->phone = $input['phone'];
if(empty($input['password'])) {
$findUser->password = $findUser->password;
} else {
$findUser->password = bcrypt($input['password']);
}
// save data
$findUser->save();
return redirect()->back()->with('swal', swal_alert('success', 'Data berhasil disimpan'));
} else {
return redirect()->back()->with('swal', swal_alert('error', 'Tidak ditemukan data!'));
}
}
public function cart()
{
$data = [
'subtitle' => 'Keranjang'
];
$getListCart = Carts::session(user()->id)->getCart();
return view('user::transaction.cart', compact('data', 'getListCart'));
}
public function checkout(Request $request)
{
$input = $request->all();
if(empty($input['cartItem'])) {
return redirect()->back()->with('swal', swal_alert('error', 'Tidak ditemukan produk yang dipilih!'));
}
$data = [
'subtitle' => 'Checkout'
];
$checkoutItem = array_map(function($item) {
$getInfoCart = Carts::find($item);
$name = $getInfoCart->name;
$categoryItem = null;
$items = [];
$detailItems = Product::where('name', 'like', '%' . $name . '%')->first();
$items = [
'item_id' => $item,
'user_id' => $detailItems->user_id,
'price' => (int) $detailItems->is_price,
'name' => $detailItems->name,
'description' => $detailItems->description,
'type' => $detailItems->is_type == 1 ? 'Pre/Wedding' : ($detailItems->is_type == 2 ? 'Engagement' : ($detailItems->is_type == 3 ? 'Party' : ($detailItems->is_type == 4 ? 'Other' : ''))),
];
$this->totalOrders += (int) $detailItems->is_price;
return [
'id' => $item,
'name' => $name,
'items' => $items,
];
}, $input['cartItem']);
$totalCart = $this->totalOrders;
$showPlaceOrder = true;
return view('user::transaction.checkout', compact('data', 'checkoutItem', 'totalCart', 'showPlaceOrder'));
}
public function deleteCart($id)
{
$cart = Carts::find($id)->delete();
if($cart) {
return redirect()->back()->with('swal', swal_alert('success', 'Data berhasil dihapus'));
} else {
return redirect()->back()->with('swal', swal_alert('error', 'Terjadi kesalahan od sistem!'));
}
}
public function placeOrder(Request $request)
{
$input = $request->all();
$listCheckout = [];
$totalTagihan = 0;
$invoiceNumber = invoiceGenerator();
foreach($input['content'] as $key => $itemId) {
$keyExist = explode(',', $key);
// find item
$itemBox = $keyExist[0];
$itemName = $keyExist[1];
// find seller id
$selectCarts = Carts::where('id', $itemName)->first();
$selectUrlsFromCarts = explode(' ', $selectCarts->name)[1];
$totalAmount = $selectCarts->price;
$findSellerFromUrls = Product::where('name', 'like', '%' . $selectUrlsFromCarts . '%');
if($findSellerFromUrls->count() > 0) {
$detailSellerWebsite = $findSellerFromUrls->first();
}
$totalTagihan += $totalAmount;
$listWebsite[] = $selectUrlsFromCarts;
// additional automatically added
$totalPrice = ($totalAmount);
$listCheckout[] = [
'id' => Str::uuid()->toString(),
'buy_id' => user()->id,
'seller_id' => $detailSellerWebsite->user_id,
'order_id' => $invoiceNumber,
'product_id' => $detailSellerWebsite->id,
'price' => $totalAmount,
'is_status' => 1,
];
}
$initPayment = virtual_gateway([
'amount' => $totalTagihan,
'invoice' => $invoiceNumber,
'method' => 'VC'
]);
$check = Orders::where('invoice_number', $invoiceNumber)->count();
if($check == 0) {
if($initPayment['status'] === 'success') {
$url_payment = $initPayment['url'];
} else {
$url_payment = NULL;
}
$newOrder = new Orders([
'id' => Str::uuid(),
'user_id' => user()->id,
'invoice_number' => $invoiceNumber,
'price' => $totalTagihan,
'url_payment' => $url_payment,
'is_status' => 1
]);
if($newOrder->save()) {
$insertDetail = Detail::insert($listCheckout);
if($insertDetail) {
LogActivites::default([
'causedBy' => user()->id,
'logType' => GlobalEnum::LogOfGeneral,
'withContent' => [
'status' => 'add',
'text' => 'Anda berhasil melakukan transaksi baru pada tanggal ' . date('Y-m-d H:i:s'),
]
]);
if($url_payment != NULL) {
return redirect()->to($url_payment);
} else {
return redirect()->to(site_url('user', 'account/cart'))->with('swal', swal_alert('error', 'Gagal melakukan transaksi [500].'));
}
} else {
return redirect()->to(site_url('user', 'account/cart'))->with('swal', swal_alert('error', 'Gagal melakukan transaksi [600].'));
}
} else {
return redirect()->to(site_url('user', 'account/cart'))->with('swal', swal_alert('error', 'Gagal melakukan transaksi [700].'));
}
}
// dd($listCheckout);
}
public function activity()
{
$logsActivity = LogActivites::where('logType', GlobalEnum::LogOfLogin)->where('causedBy', user()->id)->orderBy('created_at', 'desc')->limit(5)->get();
$logGeneral = LogActivites::where('logType', GlobalEnum::LogOfGeneral)->where('causedBy', user()->id)->orderBy('created_at', 'desc')->limit(5)->get();
$data = [
'subtitle' => 'Riwayat Aktifitas'
];
return view('user::account.activity', compact('data', 'logsActivity', 'logGeneral'));
}
}

View File

@ -0,0 +1,72 @@
<?php
namespace Modules\User\Http\Controllers;
use Illuminate\Contracts\Support\Renderable;
use Illuminate\Http\Request;
use Illuminate\Routing\Controller;
use Illuminate\Support\Collection;
use Illuminate\Support\Facades\Validator;
use Illuminate\Support\Facades\Storage;
use Illuminate\Support\Str;
use DataTables;
use Modules\Seller\Entities\ProductModel;
use Modules\User\Entities\CartModel as Carts;
use Modules\User\Entities\OrderModel as Order;
use App\Enums\GlobalEnum as Status;
class ProductController extends Controller
{
public function index()
{
$data = [
'subtitle' => 'Produk',
];
return view('user::product.index', compact('data'));
}
public function view($id)
{
$sites = ProductModel::find($id);
if(empty($sites)){
return redirect()->back();
}
$data = [
'subtitle' => $sites->name,
];
$listCart = Carts::session(user()->id)->getCart();
return view('user::product.detail', compact('data', 'sites', 'listCart'));
}
public function addToCart($id)
{
$sites = ProductModel::find($id);
if(empty($sites)){
return redirect()->back();
}
$name = $sites->name;
$price = $sites->is_price;
$check = Carts::where('user_id', user()->id)->where('name', 'LIKE', '%' . $name . '%')->first();
if(!empty($check)){
return redirect()->back()->with('swal', swal_alert('error', 'Produk sudah ada di keranjang.'));
}
Carts::create([
'user_id' => user()->id,
'name' => $name,
'price' => $price,
'quantity' => 1,
'id' => Str::random(5),
]);
return redirect()->route('user.account.cart')->with('swal', swal_alert('success', 'Berhasil menambahkan ke keranjang.'));
}
}

View File

@ -0,0 +1,241 @@
<?php
namespace Modules\User\Http\Controllers;
use Illuminate\Contracts\Support\Renderable;
use Illuminate\Http\Request;
use Illuminate\Routing\Controller;
use Illuminate\Support\Collection;
use Illuminate\Support\Facades\Validator;
use Illuminate\Support\Facades\Storage;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Str;
use DataTables;
// additional library loaded
use App\Enums\GlobalEnum;
use App\Helpers\MailerHelper as Mailers;
// additional model binding
use Modules\User\Entities\OrderModel as Order;
use Modules\User\Entities\OrderHistoryModel as OrderHistory;
use Modules\Seller\Entities\BillingModel as Billing;
use App\Models\User;
use App\Models\LogActivites;
class TransactionsController extends Controller
{
public function index(Request $request)
{
if ($request->ajax()) {
$data = Order::where('user_id', auth()->user()->id)->orderBy('created_at', 'DESC');
// Convert the Eloquent Collection to a regular PHP array
$data->each(function ($item, $key) {
$item->rowIndex = $key + 1;
});
return Datatables::of($data)
->addIndexColumn()
->addColumn('invoice', function($row){
$text = '
<p class="fw-bold">#' . $row->invoice_number . '</p>
';
return $text;
})
->addColumn('status', function($row){
if ($row->is_status == 1) {
return '<span class="mb-1 badge font-medium bg-light-dark text-dark py-3 px-4 fs-7 text-center">Pending</span>';
} elseif($row->is_status == 2) {
return '<span class="mb-1 badge font-medium bg-light-primary text-primary py-3 px-4 fs-7 text-center">Dalam pengerjaan</span>';
} elseif($row->is_status == 3) {
return '<span class="mb-1 badge font-medium bg-light-info text-info py-3 px-4 fs-7 text-center">Dikirim</span>';
} elseif($row->is_status == 4) {
return '<span class="mb-1 badge font-medium bg-light-danger text-danger py-3 px-4 fs-7 text-center">Dibatalkan</span>';
} elseif($row->is_status == 5) {
return '<span class="mb-1 badge font-medium bg-light-success text-success py-3 px-4 fs-7 text-center">Selesai</span>';
}
})
->addColumn('harga', function($row){
return 'Rp. ' . number_format($row->price, 0, ',', '.');
})
->filter(function ($query) use ($request) {
if ($request->has('search')) {
$search = $request->get('search')['value'];
$filterCategory = explode('|', $search);
if($filterCategory[0] === 'status') {
if(!empty($filterCategory[1])) {
$query->where('is_status', '=', $filterCategory[1]);
} else {
$query->get();
}
} elseif($filterCategory[0] === 'orders') {
if(!empty($filterCategory[1])) {
$query->where('invoice_number', 'LIKE', "%$filterCategory[1]%");
} else {
$query->get();
}
}
}
})
->rawColumns(['invoice', 'status','harga'])
->make(true);
}
$data = [
'subtitle' => 'Semua Pesanan'
];
return view('user::transaction.orders.index', compact('data'));
}
public function view($invoice)
{
$check = Order::where('id', $invoice)->where('user_id', auth()->user()->id)->first();
if($check)
{
$data = [
'subtitle' => 'Detil Pesanan'
];
$getInfoOrders = $check;
return view('user::transaction.orders.detail', compact('data', 'getInfoOrders'));
} else {
return redirect()->back()->with('swal', swal_alert('error', 'Tidak ditemukan data yang anda cari'));
}
}
public function cancelOrder(Request $request, $invoice)
{
$check = Order::where('id', $invoice)->where('user_id', auth()->user()->id)->first();
if($check)
{
$check->is_status = 4;
$check->url_payment = NULL;
$check->save();
$code = $check->invoice_number;
DB::statement("UPDATE tbl_order_detail SET is_status = 4 where order_id = '$code'");
return redirect()->back()->with('swal', swal_alert('success', 'Pesanan anda telah dibatalkan'));
} else {
return redirect()->back()->with('swal', swal_alert('error', 'Tidak ditemukan data yang anda cari'));
}
}
public function complete(Request $request, $invoice)
{
$check = Order::where('id', $invoice)->where('user_id', auth()->user()->id)->first();
if($check)
{
$check->is_status = 5;
$check->url_payment = NULL;
$check->save();
$getDetail = OrderHistory::where('order_id', $check->invoice_number)->get();
foreach($getDetail as $items) {
if($items->is_status == 3) {
$price = $items->price;
$seller_id = $items->seller_id;
$id = $items->id;
$update = DB::statement("UPDATE tbl_order_detail SET is_status = '4' where id = '$id'");
$save = DB::statement("UPDATE tbl_users SET income = income + $price where id = '$seller_id'");
if($save && $update) {
return redirect()->back()->with('swal', swal_alert('success', 'Pesan telah anda terima dan sesuai permintaan anda.'));
} else {
return redirect()->back()->with('swal', swal_alert('error', 'Terjadi kesalahan saat melakukan penambahan saldo.'));
}
} else {
return redirect()->back()->with('swal', swal_alert('error', 'Terdapat pesanan yang belum selesai'));
}
}
} else {
return redirect()->back()->with('swal', swal_alert('error', 'Tidak ditemukan data yang anda cari'));
}
}
public function billing(Request $request)
{
if ($request->ajax()) {
$data = Billing::where('buy_id', auth()->user()->id)->select('*');
return Datatables::of($data)
->addIndexColumn()
->addColumn('ticket-invoice', function($row){
$text = '
<p class="fw-bold">#' . $row->invoice_number . '</p>
';
return $text;
})
->addColumn('title-post', function($row){
$text = '
<p class="mb-0 fw-bold">' . removeUrlPrefix($row->website_url) . '</p>
<p class="mb-0 small text-muted">Terakhir diperbarui pada ' . date_formatting($row->updated_at, 'timeago') . '</p>
';
return $text;
})
->addColumn('status', function($row){
if ($row->is_status == GlobalEnum::isOrderRequested) {
return '<span class="mb-1 badge font-medium bg-dark text-white py-3 px-4 fs-7">Menunggu</span>';
} elseif($row->is_status == GlobalEnum::isOrderOnWorking) {
return '<span class="mb-1 badge font-medium bg-primary text-white py-3 px-4 fs-7">Dalam pengerjaan</span>';
} elseif($row->is_status == GlobalEnum::isOrderSubmitted) {
return '<span class="mb-1 badge font-medium bg-danger text-white py-3 px-4 fs-7">Dikirim</span>';
} elseif($row->is_status == GlobalEnum::isOrderCompleted) {
return '<span class="mb-1 badge font-medium bg-success text-white py-3 px-4 fs-7">Selesai</span>';
} elseif($row->is_status == GlobalEnum::isOrderReqCancel) {
return '<span class="mb-1 badge font-medium bg-danger text-white py-3 px-4 fs-7">Permintaan Ditolak</span>';
} elseif($row->is_status == GlobalEnum::isOrderCancelled) {
return '<span class="mb-1 badge font-medium bg-danger text-white py-3 px-4 fs-7">Dibatalkan</span>';
} elseif($row->is_status == GlobalEnum::isOrderRejected) {
return '<span class="mb-1 badge font-medium bg-danger text-white py-3 px-4 fs-7">Ditolak</span>';
}
})
->addColumn('price', function($row){
return 'Rp. ' . number_format($row->total, 0, ',', '.');
})
->filter(function ($query) use ($request) {
if ($request->has('search')) {
$search = $request->get('search')['value'];
$filterCategory = explode('|', $search);
if($filterCategory[0] === 'status') {
if(!empty($filterCategory[1])) {
$query->where('is_status', '=', $filterCategory[1]);
} else {
$query->get();
}
} elseif($filterCategory[0] === 'orders') {
if(!empty($filterCategory[1])) {
$query->where('invoice_number', 'LIKE', "%$filterCategory[1]%");
} else {
$query->get();
}
}
}
})
->rawColumns(['ticket-invoice','title-post','status','price'])
->make(true);
}
$data = [
'subtitle' => 'Semua Tagihan'
];
return view('user::transaction.billing.index', compact('data'));
}
public function return(Request $request)
{
$payment = Order::where('invoice_number', $request->input('merchantOrderId'))->get()->first();
if($payment) {
if($request->input('statusCode') == 00) {
return redirect()->to(site_url('user', 'orders'))->with('swal', swal_alert('success', 'Anda kembali ke laman detail deposit.'));
} else {
return redirect()->to(site_url('user', 'orders'))->with('swal', swal_alert('error', 'Terjadi kesalahan saat melakukan penambahan saldo.'));
}
} else {
return redirect()->to(site_url('user', 'orders'))->with('swal', swal_alert('error', 'Tidak ditemukan data.'));
}
}
}

View File

@ -0,0 +1,34 @@
<?php
namespace Modules\User\Http\Controllers;
use Illuminate\Contracts\Support\Renderable;
use Illuminate\Http\Request;
use Illuminate\Routing\Controller;
use Illuminate\Support\Collection;
use Illuminate\Support\Facades\Validator;
use Illuminate\Support\Facades\Storage;
use Illuminate\Support\Str;
// additional library loaded
use App\Enums\GlobalEnum;
use App\Models\Seller;
use App\Models\LogActivites;
use Modules\User\Entities\OrderModel as Order;
use Modules\Seller\Entities\AccountModel as Account;
class UserController extends Controller
{
public function index()
{
$data = [
'subtitle' => 'Halaman Utama',
];
$getTotalOrders = Order::where('user_id', user()->id)->count();
$getListOrder = Order::where('user_id', user()->id)->orderBy('created_at', 'desc')->limit(5)->get();
$getListPengeluaran = Order::where('user_id', user()->id)->where('is_status', 5)->orderBy('created_at', 'desc')->sum('price');
return view('user::index', compact('data', 'getTotalOrders', 'getListOrder', 'getListPengeluaran'));
}
}

View File

View File

View File

View File

@ -0,0 +1,69 @@
<?php
namespace Modules\User\Providers;
use Illuminate\Support\Facades\Route;
use Illuminate\Foundation\Support\Providers\RouteServiceProvider as ServiceProvider;
class RouteServiceProvider extends ServiceProvider
{
/**
* The module namespace to assume when generating URLs to actions.
*
* @var string
*/
protected $moduleNamespace = 'Modules\User\Http\Controllers';
/**
* Called before routes are registered.
*
* Register any model bindings or pattern based filters.
*
* @return void
*/
public function boot()
{
parent::boot();
}
/**
* Define the routes for the application.
*
* @return void
*/
public function map()
{
$this->mapApiRoutes();
$this->mapWebRoutes();
}
/**
* Define the "web" routes for the application.
*
* These routes all receive session state, CSRF protection, etc.
*
* @return void
*/
protected function mapWebRoutes()
{
Route::middleware('web')
->namespace($this->moduleNamespace)
->group(module_path('User', '/Routes/web.php'));
}
/**
* Define the "api" routes for the application.
*
* These routes are typically stateless.
*
* @return void
*/
protected function mapApiRoutes()
{
Route::prefix('api')
->middleware('api')
->namespace($this->moduleNamespace)
->group(module_path('User', '/Routes/api.php'));
}
}

View File

@ -0,0 +1,112 @@
<?php
namespace Modules\User\Providers;
use Illuminate\Support\ServiceProvider;
use Illuminate\Database\Eloquent\Factory;
class UserServiceProvider extends ServiceProvider
{
/**
* @var string $moduleName
*/
protected $moduleName = 'User';
/**
* @var string $moduleNameLower
*/
protected $moduleNameLower = 'user';
/**
* Boot the application events.
*
* @return void
*/
public function boot()
{
$this->registerTranslations();
$this->registerConfig();
$this->registerViews();
$this->loadMigrationsFrom(module_path($this->moduleName, 'Database/Migrations'));
}
/**
* Register the service provider.
*
* @return void
*/
public function register()
{
$this->app->register(RouteServiceProvider::class);
}
/**
* Register config.
*
* @return void
*/
protected function registerConfig()
{
$this->publishes([
module_path($this->moduleName, 'Config/config.php') => config_path($this->moduleNameLower . '.php'),
], 'config');
$this->mergeConfigFrom(
module_path($this->moduleName, 'Config/config.php'), $this->moduleNameLower
);
}
/**
* Register views.
*
* @return void
*/
public function registerViews()
{
$viewPath = resource_path('views/modules/' . $this->moduleNameLower);
$sourcePath = module_path($this->moduleName, 'Resources/views');
$this->publishes([
$sourcePath => $viewPath
], ['views', $this->moduleNameLower . '-module-views']);
$this->loadViewsFrom(array_merge($this->getPublishableViewPaths(), [$sourcePath]), $this->moduleNameLower);
}
/**
* Register translations.
*
* @return void
*/
public function registerTranslations()
{
$langPath = resource_path('lang/modules/' . $this->moduleNameLower);
if (is_dir($langPath)) {
$this->loadTranslationsFrom($langPath, $this->moduleNameLower);
} else {
$this->loadTranslationsFrom(module_path($this->moduleName, 'Resources/lang'), $this->moduleNameLower);
}
}
/**
* Get the services provided by the provider.
*
* @return array
*/
public function provides()
{
return [];
}
private function getPublishableViewPaths(): array
{
$paths = [];
foreach (\Config::get('view.paths') as $path) {
if (is_dir($path . '/modules/' . $this->moduleNameLower)) {
$paths[] = $path . '/modules/' . $this->moduleNameLower;
}
}
return $paths;
}
}

View File

View File

View File

View File

View File

@ -0,0 +1,49 @@
@include('components.theme.pages.header')
<section>
<div class="row">
<div class="col-md-12 mt-9">
<div class="card">
<div class="card-header">
<h3 class="card-title">Aktifasi sebagai Reseller</h3>
</div>
<div class="card-body">
<form action="{{ route('user.activate.store', ['user_id' => user()['id']]) }}" method="POST">
@csrf
<div class="form-group mb-4">
<label class="form-label mb-3">Nama Bisnis<sup class="ms-1 text-danger">*</sup></label>
<input type="text" name="name" class="form-control form-control-solid mt-2" value="{{ old('name') }}" placeholder="Nama Bisnis">
</div>
<div class="form-group mb-4">
<label class="form-label mb-3">Nama Alias<sup class="ms-1 text-danger">*</sup></label>
<input type="text" name="alias" class="form-control form-control-solid mt-2" value="{{ old('alias') }}" placeholder="Nama Alias, eg: depa.id">
</div>
<div class="form-group mb-0">
<button type="submit" class="btn btn-primary">Gabung</button>
<a href="{{ site_url('user', '/') }}" class="btn btn-light btn-light">Kembali</a>
</div>
{!! Form::close() !!}
</div>
</div>
</div>
</div>
</section>
@push('scripts')
<script>
Inputmask({
mask: "*{1,20}[.*{1,20}][.*{1,20}][.*{1,20}]@*{1,20}[.*{2,6}][.*{1,2}]",
greedy: false,
onBeforePaste: function (pastedValue, opts) {
pastedValue = pastedValue.toLowerCase();
return pastedValue.replace("mailto:", "");
},
definitions: {
"*": {
validator: '[0-9A-Za-z!#$%&"*+/=?^_`{|}~\-]',
cardinality: 1,
casing: "lower"
}
}
}).mask("#email");
</script>
@endpush
@include('components.theme.pages.footer')

View File

@ -0,0 +1,83 @@
@include('components.theme.pages.header')
<section>
<div class="row">
@php
$url_segment = segment(3);
if(empty($url_segment)) {
$url_segment = '';
}
@endphp
<x-theme.pages.account-preference :activeSetting="$url_segment" />
<div class="col-md-12 mb-5 mt-9">
<div class="card">
<div class="card-header">
<h3 class="card-title">Riwayat Login</h3>
</div>
<div class="card-body p-0">
<div class="table-responsive">
<table class="table align-middle table-row-bordered table-row-solid gy-4 gs-9">
<thead class="border-gray-200 fs-5 fw-semibold bg-lighten">
<tr>
<th class="min-w-100px">Status</th>
<th class="min-w-150px">User Agent</th>
<th class="min-w-150px">Catatan</th>
<th class="min-w-150px">IP Address</th>
<th class="min-w-150px">Waktu</th>
</tr>
</thead>
<tbody class="fw-6 fw-semibold text-gray-600">
@foreach($logsActivity as $log)
@php
$logs = json_decode($log->withContent);
@endphp
<tr>
<td><span class="badge badge-light-success fs-7 fw-bold">OK</span></td>
<td>{{ $logs->user_agent }}</td>
<td>{{ $logs->text }}</td>
<td>{{ $logs->ip_address }}</td>
<td>{{ date_formatting($log->performedOn, 'timeago') }}</td>
</tr>
@endforeach
</tbody>
</table>
</div>
</div>
</div>
</div>
<div class="col-md-12">
<div class="card">
<div class="card-header">
<h3 class="card-title">Riwayat Umum</h3>
</div>
<div class="card-body p-0">
<div class="table-responsive">
<table class="table align-middle table-row-bordered table-row-solid gy-4 gs-9">
<thead class="border-gray-200 fs-5 fw-semibold bg-lighten">
<tr>
<th class="min-w-100px">Status</th>
<th class="min-w-150px">Tipe</th>
<th class="min-w-150px">Catatan</th>
<th class="min-w-150px">Waktu</th>
</tr>
</thead>
<tbody class="fw-6 fw-semibold text-gray-600">
@foreach($logGeneral as $log)
@php
$logs = json_decode($log->withContent);
@endphp
<tr>
<td><span class="badge badge-light-success fs-7 fw-bold">OK</span></td>
<td><span class="text-uppercase">{{ $logs->status }}</span></td>
<td>{{ $logs->text }}</td>
<td>{{ date_formatting($log->performedOn, 'timeago') }}</td>
</tr>
@endforeach
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
</section>
@include('components.theme.pages.footer')

View File

@ -0,0 +1,66 @@
@include('components.theme.pages.header')
<section>
<div class="row">
@php
$url_segment = segment(2);
if(empty($url_segment)) {
$url_segment = '';
}
@endphp
<x-theme.pages.account-preference :activeSetting="$url_segment" />
<div class="col-md-12 mt-9">
<div class="card">
<div class="card-header">
<h3 class="card-title">Umum</h3>
</div>
<div class="card-body">
<form action="{{ site_url('user', 'account/update') . '/' . user()['id'] }}" method="POST">
@csrf
<div class="row mb-4">
<div class="col-6 form-group">
<label class="form-label">Nama Lengkap<sup class="ms-1 text-danger">*</sup></label>
<input type="text" name="name" class="form-control form-control-solid mt-2" value="{{ user()->name }}" placeholder="Nama Lengkap">
</div>
<div class="col-6 form-group">
<label class="form-label">Alamat Email<sup class="ms-1 text-danger">*</sup></label>
<input type="email" name="email" class="form-control form-control-solid mt-2" id="email" value="{{ user()->email }}" placeholder="Alamat Email">
</div>
</div>
<div class="form-group mb-4">
<label class="form-label mb-3">Kata Sandi<span class="ms-2 fs-8 text-muted">opsional (kosongi jika tidak ingin merubah)</span></label>
<input type="password" name="password" class="form-control form-control-solid mt-2" value="" placeholder="Kata Sandi">
</div>
<div class="form-group mb-4">
<label class="form-label mb-3">Nomer Telepon<sup class="ms-1 text-danger">*</sup></label>
<input type="phone" name="phone" class="form-control form-control-solid mt-2" value="{{ user()->phone }}" placeholder="Nomer Telepon">
</div>
<div class="form-group mb-0">
<button type="submit" class="btn btn-primary">Simpan</button>
<a href="{{ site_url('user', 'account') }}" class="btn btn-light btn-light">Kembali</a>
</div>
{!! Form::close() !!}
</div>
</div>
</div>
</div>
</section>
@push('scripts')
<script>
Inputmask({
mask: "*{1,20}[.*{1,20}][.*{1,20}][.*{1,20}]@*{1,20}[.*{2,6}][.*{1,2}]",
greedy: false,
onBeforePaste: function (pastedValue, opts) {
pastedValue = pastedValue.toLowerCase();
return pastedValue.replace("mailto:", "");
},
definitions: {
"*": {
validator: '[0-9A-Za-z!#$%&"*+/=?^_`{|}~\-]',
cardinality: 1,
casing: "lower"
}
}
}).mask("#email");
</script>
@endpush
@include('components.theme.pages.footer')

View File

@ -0,0 +1,66 @@
@include('components.theme.pages.header')
<section>
<div class="row">
@php
$url_segment = segment(3);
if(empty($url_segment)) {
$url_segment = '';
}
@endphp
<x-theme.pages.account-preference :activeSetting="$url_segment" />
<div class="col-md-12 mt-9">
<div class="card">
<div class="card-header">
<h3 class="card-title">Preferensi<span class="ms-2 fs-8 text-muted">Notifikasi</span></h3>
</div>
<div class="card-body">
<form method="POST" action="{{ site_url('user', 'account/update-preference') . '/' . user()->id }}">
@csrf
<div class="form-check form-switch form-check-custom form-check-solid mb-4">
<input class="form-check-input" type="checkbox" name="updateProduct" {{ !empty($getNotificationPreferences->onUpdateProduct) && $getNotificationPreferences->onUpdateProduct ? 'checked' : '' }} id="flexSwitchDefault"/>
<label class="form-check-label" for="flexSwitchDefault">
Terima pembaruan/informasi produk terbaru
</label>
</div>
<div class="form-check form-switch form-check-custom form-check-solid mb-4">
<input class="form-check-input" type="checkbox" name="updateNews" {{ !empty($getNotificationPreferences->onUpdateNews) && $getNotificationPreferences->onUpdateNews ? 'checked' : '' }} id="flexSwitchDefault"/>
<label class="form-check-label" for="flexSwitchDefault">
Terima informasi berita terbaru
</label>
</div>
<div class="form-check form-switch form-check-custom form-check-solid mb-4">
<input class="form-check-input" type="checkbox" name="updateOrder" {{ !empty($getNotificationPreferences->onUpdateOrders) && $getNotificationPreferences->onUpdateOrders ? 'checked' : '' }} id="flexSwitchDefault"/>
<label class="form-check-label" for="flexSwitchDefault">
Terima informasi detail pesanan secara realtime
</label>
</div>
<div class="form-group mt-8 mb-0">
<button type="submit" class="btn btn-primary">Simpan</button>
<a href="{{ site_url('user', 'account') }}" class="btn btn-light btn-light">Kembali</a>
</div>
</form>
</div>
</div>
</div>
</div>
</section>
@push('scripts')
<script>
Inputmask({
mask: "*{1,20}[.*{1,20}][.*{1,20}][.*{1,20}]@*{1,20}[.*{2,6}][.*{1,2}]",
greedy: false,
onBeforePaste: function (pastedValue, opts) {
pastedValue = pastedValue.toLowerCase();
return pastedValue.replace("mailto:", "");
},
definitions: {
"*": {
validator: '[0-9A-Za-z!#$%&"*+/=?^_`{|}~\-]',
cardinality: 1,
casing: "lower"
}
}
}).mask("#email");
</script>
@endpush
@include('components.theme.pages.footer')

View File

@ -0,0 +1,59 @@
@include('components.theme.pages.header')
<section>
<!-- basic table -->
<div class="row">
<div class="col-12">
<div class="card">
<div class="card-body">
{{ Form::open(['route' => 'rekening.store']) }}
@csrf
<div class="form-group mb-4">
<label class="form-label">Atas Nama<sup class="text-danger">*</sup></label>
<input type="text" name="name" value="{{ old('name') }}" autocomplete="off" class="form-control form-control-solid mt-2 {{ $errors->has('name') ? 'is-invalid' : '' }}" placeholder="Masukkan Atas Nama">
@error('name') <small class="text-danger">{{ $message }}</small> @enderror
</div>
<div class="form-group mb-4">
<label class="form-label">Nomer Rekening<sup class="text-danger">*</sup></label>
<input type="number" name="account_number" value="{{ old('account_number') }}" autocomplete="off" class="form-control form-control-solid mt-2 {{ $errors->has('account_number') ? 'is-invalid' : '' }}" placeholder="Masukkan Nomor Rekening">
@error('account_number') <small class="text-danger">{{ $message }}</small> @enderror
</div>
<div class="form-group mb-4">
<label class="form-label">Daftar Bank<sup class="text-danger">*</sup></label>
<select name="rid" class="form-select form-select-solid input-bank mt-2 {{ $errors->has('rid') ? 'is-invalid' : '' }}">
@foreach ($listAllBank as $bank)
@if (strlen($bank->kodebank) == 1)
@php $code = '00' . $bank->kodebank @endphp
@elseif(strlen($bank->kodebank) == 2)
@php $code = '0' . $bank->kodebank @endphp
@else
@php $code = $bank->kodebank @endphp
@endif
<option value="{{ $bank->id }}">Kode Bank: {{ $code }} / {{ $bank->nama }}</option>
@endforeach
</select>
@error('rid') <small class="text-danger">{{ $message }}</small> @enderror
</div>
<div class="form-group mb-0">
<button type="submit" class="btn btn-primary">Simpan</button>
<a href="{{ route('rekening') }}" class="btn btn-light btn-light">Kembali</a>
</div>
{{ Form::close() }}
</div>
</div>
</div>
</div>
</section>
@push('scripts')
<script src="https://preview.keenthemes.com/html/metronic/docs/assets/plugins/custom/ckeditor/ckeditor-classic.bundle.js"></script>
<script>
$(document).ready(function () {
$('.input-bank').select2({
placeholder: 'Pilih salah satu',
dropdownParent: $('.input-bank').parent()
});
});
</script>
@endpush
@include('components.theme.pages.footer')

View File

@ -0,0 +1,70 @@
@include('components.theme.pages.header')
<section>
<!-- basic table -->
<div class="row">
<div class="col-12">
<div class="card">
<div class="card-body">
<form action="{{ route('rekening.update', ['id' => $getDetailAccount->id]) }}" id="form-tag-update" method="POST">
@csrf
<div class="form-group mb-4">
<label class="form-label">Atas Nama<sup class="text-danger">*</sup></label>
<input type="text" name="name" value="{{ $getDetailAccount->name }}" autocomplete="off" class="form-control form-control-solid mt-2 {{ $errors->has('name') ? 'is-invalid' : '' }}" placeholder="Masukkan Atas Nama">
@error('name') <small class="text-danger">{{ $message }}</small> @enderror
</div>
<div class="form-group mb-4">
<label class="form-label">Nomer Rekening<sup class="text-danger">*</sup></label>
<input type="number" name="account_number" value="{{ $getDetailAccount->account_number }}" autocomplete="off" class="form-control form-control-solid mt-2 {{ $errors->has('account_number') ? 'is-invalid' : '' }}" placeholder="Masukkan Nomor Rekening">
@error('account_number') <small class="text-danger">{{ $message }}</small> @enderror
</div>
<div class="form-group mb-4">
<label class="form-label">Daftar Bank<sup class="text-danger">*</sup></label>
<select name="rid" class="form-select form-select-solid input-bank mt-2 {{ $errors->has('rid') ? 'is-invalid' : '' }}">
@foreach ($listAllBank as $bank)
@if (strlen($bank->kodebank) == 1)
@php $code = '00' . $bank->kodebank @endphp
@elseif(strlen($bank->kodebank) == 2)
@php $code = '0' . $bank->kodebank @endphp
@else
@php $code = $bank->kodebank @endphp
@endif
<option value="{{ $bank->id }}">Kode Bank: {{ $code }} / {{ $bank->nama }}</option>
@endforeach
</select>
@error('rid') <small class="text-danger">{{ $message }}</small> @enderror
</div>
<div class="form-group mb-4">
<label class="form-label">Status Rekening<sup class="text-danger">*</sup></label>
<select name="is_active" class="form-select form-select-solid mt-2 {{ $errors->has('is_active') ? 'is-invalid' : '' }}">
@foreach ([1,2] as $status)
@php $name = $status == 1 ? 'Aktif' : 'Tidak Aktif' @endphp
@php $selected = $status == $getDetailAccount->is_active ? 'selected' : '' @endphp
<option value="{{ $status }}" {{ $selected }}>{{ $name }}</option>
@endforeach
</select>
@error('is_active') <small class="text-danger">{{ $message }}</small> @enderror
</div>
<div class="form-group mb-0">
<button type="submit" class="btn btn-primary">Perbarui</button>
<a href="{{ route('rekening') }}" class="btn btn-light btn-light">Kembali</a>
</div>
{{ Form::close() }}
</div>
</div>
</div>
</div>
</section>
@push('scripts')
<script src="https://preview.keenthemes.com/html/metronic/docs/assets/plugins/custom/ckeditor/ckeditor-classic.bundle.js"></script>
<script>
$(document).ready(function () {
$('.input-bank').select2({
placeholder: 'Pilih salah satu',
dropdownParent: $('.input-bank').parent()
});
});
</script>
@endpush
@include('components.theme.pages.footer')

View File

@ -0,0 +1,79 @@
@push('css')
<link href="{{ frontend('plugins/custom/datatables/datatables.bundle.css') }}" rel="stylesheet" type="text/css" />
@endpush
@include('components.theme.pages.header')
<section>
<!-- basic table -->
<div class="row">
<div class="col-12">
<div class="card card-flush">
<div class="card-header flex-nowrap pt-5">
<div>
<div class="d-flex align-items-center position-relative my-1">
<i class="ki-outline ki-magnifier fs-1 position-absolute ms-6"><span class="path1"></span><span class="path2"></span></i>
<input type="text" id="search" class="form-control form-control-solid w-250px ps-15" placeholder="Temukan Rekening"/>
</div>
</div>
</div>
<div class="card-body">
<div class="table-responsive">
<table id="data-table" class="table align-middle table-row-dashed fs-6 gy-5">
<thead>
<tr class="text-start text-gray-400 fw-bold fs-7 text-uppercase gs-0">
<th>ID</th>
<th>Nomor Rekening</th>
<th>Atas Nama</th>
<th>Status</th>
<th>Action</th>
</tr>
</thead>
<tbody class="text-gray-600 fw-semibold"></tbody>
</table>
</div>
</div>
</div>
</div>
</div>
</section>
@push('scripts')
<script src="{{ frontend('plugins/custom/datatables/datatables.bundle.js') }}"></script>
<script type="text/javascript">
$(function () {
var table = $('#data-table').DataTable({
processing: true,
serverSide: true,
ajax: "{{ site_url('user', 'account/rekening') }}",
// order: [[5, 'desc']],
stateSave: true,
columns: [
{data: null, name: 'id'},
{data: 'title-post', name: 'title-post'},
{data: 'name', name: 'name'},
{data: 'status', name: 'status'},
{data: 'action', name: 'action', orderable: false, searchable: false},
],
createdRow: function (row, data, dataIndex) {
// Set the sequential number starting from 1
$('td', row).eq(0).html(dataIndex + 1);
}
});
// #myInput is a <input type="text"> element
$('#search').on('keyup change', function () {
table.search(this.value).draw();
});
$('#data-table').on('click', '.deleteContent', function() {
var url = $(this).data('url');
$('#exampleModal').modal('show', {
backdrop: 'static'
});
$('.link').attr('href', url)
})
});
</script>
@endpush
@include('components.theme.pages.footer')

Some files were not shown because too many files have changed in this diff Show More