add struk method
This commit is contained in:
parent
f1bcae15e3
commit
92ac0f3dce
150
app/Http/Controllers/Admin/TrRegistrasiController.php
Normal file
150
app/Http/Controllers/Admin/TrRegistrasiController.php
Normal file
@ -0,0 +1,150 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Http\Controllers\Admin;
|
||||||
|
|
||||||
|
use App\Http\Controllers\Controller;
|
||||||
|
use App\Interfaces\TrRegistrasiInterface;
|
||||||
|
use App\Interfaces\MsPasienInterface;
|
||||||
|
use App\Interfaces\MsPegawaiInterface;
|
||||||
|
use App\Interfaces\MsAsuransiInterface;
|
||||||
|
use App\Interfaces\MsRuangPelayananInterface;
|
||||||
|
use App\Interfaces\TrTransaksiInterface;
|
||||||
|
use Illuminate\Http\Request;
|
||||||
|
|
||||||
|
class TrRegistrasiController extends Controller
|
||||||
|
{
|
||||||
|
private $trRegistrasi;
|
||||||
|
private $msPasien;
|
||||||
|
private $msPegawai;
|
||||||
|
private $msAsuransi;
|
||||||
|
private $msRuangPelayanan;
|
||||||
|
private $trTransaksi;
|
||||||
|
|
||||||
|
public function __construct(
|
||||||
|
TrRegistrasiInterface $trRegistrasi,
|
||||||
|
MsPasienInterface $msPasien,
|
||||||
|
MsPegawaiInterface $msPegawai,
|
||||||
|
MsAsuransiInterface $msAsuransi,
|
||||||
|
MsRuangPelayananInterface $msRuangPelayanan,
|
||||||
|
TrTransaksiInterface $trTransaksi
|
||||||
|
)
|
||||||
|
{
|
||||||
|
$this->trRegistrasi = $trRegistrasi;
|
||||||
|
$this->msPasien = $msPasien;
|
||||||
|
$this->msPegawai = $msPegawai;
|
||||||
|
$this->msAsuransi = $msAsuransi;
|
||||||
|
$this->msRuangPelayanan = $msRuangPelayanan;
|
||||||
|
$this->trTransaksi = $trTransaksi;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function index(Request $request)
|
||||||
|
{
|
||||||
|
return view('admin.tr_registrasi.index',[
|
||||||
|
'registrasi' => $this->trRegistrasi->getAll(),
|
||||||
|
'pasien' => $this->msPasien->getAll(),
|
||||||
|
'pegawai' => $this->msPegawai->getAll(),
|
||||||
|
'asuransi' => $this->msAsuransi->getAll(),
|
||||||
|
'ruang_pelayanan' => $this->msRuangPelayanan->getAll(),
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function data(Request $request)
|
||||||
|
{
|
||||||
|
if ($request->ajax()) {
|
||||||
|
return DataTables()->of($this->trRegistrasi->getAll())
|
||||||
|
->addIndexColumn()
|
||||||
|
->addColumn('mr_pasien', function ($data) {
|
||||||
|
return $this->msPasien->getById($data->mr_pasien)->nama_pasien;
|
||||||
|
})
|
||||||
|
->addColumn('id_asuransi', function ($data) {
|
||||||
|
return $this->msAsuransi->getById($data->id_asuransi)->nama_asuransi;
|
||||||
|
})
|
||||||
|
->addColumn('no_asuransi', function ($data) {
|
||||||
|
return $data->no_asuransi;
|
||||||
|
})
|
||||||
|
->addColumn('id_ruang_pelayanan', function ($data) {
|
||||||
|
return $this->msRuangPelayanan->getById($data->id_ruang_pelayanan)->nama_ruang_pelayanan;
|
||||||
|
})
|
||||||
|
->addColumn('id_pegawai', function ($data) {
|
||||||
|
return $this->msPegawai->getById($data->id_pegawai)->nama_pegawai;
|
||||||
|
})
|
||||||
|
->addColumn('tanggal_registrasi', function ($data) {
|
||||||
|
return $data->tanggal_registrasi;
|
||||||
|
})
|
||||||
|
->addColumn('status', function ($data) {
|
||||||
|
return $data->status;
|
||||||
|
})
|
||||||
|
->addColumn('action', function ($data) {
|
||||||
|
return view('admin.tr_registrasi.column.action', compact('data'));
|
||||||
|
})
|
||||||
|
->make(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
return view('admin.tr_registrasi.data');
|
||||||
|
}
|
||||||
|
|
||||||
|
public function showTransaksiByRegistrasi($id)
|
||||||
|
{
|
||||||
|
$transaksi = $this->trTransaksi->getByRegistrasi($id);
|
||||||
|
return view('admin.tr_registrasi.transaksi', compact('transaksi'));
|
||||||
|
}
|
||||||
|
|
||||||
|
public function create()
|
||||||
|
{
|
||||||
|
return view('admin.tr_registrasi.create', [
|
||||||
|
'pasien' => $this->msPasien->getAll(),
|
||||||
|
'pegawai' => $this->msPegawai->getAll(),
|
||||||
|
'asuransi' => $this->msAsuransi->getAll(),
|
||||||
|
'ruang_pelayanan' => $this->msRuangPelayanan->getAll(),
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function store(Request $request)
|
||||||
|
{
|
||||||
|
$request->validate([
|
||||||
|
'mr_pasien' => 'required',
|
||||||
|
'id_asuransi' => 'required',
|
||||||
|
'no_asuransi' => 'required',
|
||||||
|
'id_ruang_pelayanan' => 'required',
|
||||||
|
'id_pegawai' => 'required',
|
||||||
|
]);
|
||||||
|
|
||||||
|
$this->trRegistrasi->store($request->all());
|
||||||
|
|
||||||
|
return redirect()->route('admin.tr_registrasi.index')->with('success', 'Data Registrasi berhasil ditambahkan.');
|
||||||
|
}
|
||||||
|
|
||||||
|
public function edit($id)
|
||||||
|
{
|
||||||
|
$registrasi = $this->trRegistrasi->getById($id);
|
||||||
|
return view('admin.tr_registrasi.edit',[
|
||||||
|
'registrasi' => $registrasi,
|
||||||
|
'pasien' => $this->msPasien->getAll(),
|
||||||
|
'pegawai' => $this->msPegawai->getAll(),
|
||||||
|
'asuransi' => $this->msAsuransi->getAll(),
|
||||||
|
'ruang_pelayanan' => $this->msRuangPelayanan->getAll(),
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function update(Request $request, $id)
|
||||||
|
{
|
||||||
|
$request->validate([
|
||||||
|
'mr_pasien' => 'required',
|
||||||
|
'id_asuransi' => 'required',
|
||||||
|
'no_asuransi' => 'required',
|
||||||
|
'id_ruang_pelayanan' => 'required',
|
||||||
|
'id_pegawai' => 'required',
|
||||||
|
'tanggal_registrasi' => 'required|date',
|
||||||
|
]);
|
||||||
|
|
||||||
|
$this->trRegistrasi->update($id, $request->all());
|
||||||
|
|
||||||
|
return redirect()->route('admin.tr_registrasi.index')->with('success', 'Data Registrasi berhasil diperbarui.');
|
||||||
|
}
|
||||||
|
|
||||||
|
public function destroy($id)
|
||||||
|
{
|
||||||
|
$this->trRegistrasi->delete($id);
|
||||||
|
return response()->json(['success' => 'Data Registrasi berhasil dihapus.']);
|
||||||
|
}
|
||||||
|
}
|
||||||
102
app/Http/Controllers/Admin/TrTransaksiController.php
Normal file
102
app/Http/Controllers/Admin/TrTransaksiController.php
Normal file
@ -0,0 +1,102 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Http\Controllers\Admin;
|
||||||
|
|
||||||
|
use App\Http\Controllers\Controller;
|
||||||
|
use App\Interfaces\TrTransaksiInterface;
|
||||||
|
use App\Interfaces\MsTindakanInterface;
|
||||||
|
use App\Interfaces\MsPegawaiInterface;
|
||||||
|
use Illuminate\Http\Request;
|
||||||
|
|
||||||
|
class TrTransaksiController extends Controller
|
||||||
|
{
|
||||||
|
private $trTransaksi;
|
||||||
|
private $msTindakan;
|
||||||
|
private $msPegawai;
|
||||||
|
|
||||||
|
public function __construct(TrTransaksiInterface $trTransaksi, MsTindakanInterface $msTindakan, MsPegawaiInterface $msPegawai)
|
||||||
|
{
|
||||||
|
$this->trTransaksi = $trTransaksi;
|
||||||
|
$this->msTindakan = $msTindakan;
|
||||||
|
$this->msPegawai = $msPegawai;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function index(Request $request)
|
||||||
|
{
|
||||||
|
if ($request->ajax()) {
|
||||||
|
return DataTables()->of($this->trTransaksi->getAll())
|
||||||
|
->addIndexColumn()
|
||||||
|
->addColumn('nama_tindakan', function ($data) {
|
||||||
|
return $this->msTindakan->getById($data->id_tindakan)->nama_tindakan;
|
||||||
|
})
|
||||||
|
->addColumn('jumlah_tindakan', function ($data) {
|
||||||
|
return $data->jumlah_tindakan;
|
||||||
|
})
|
||||||
|
->addColumn('nama_pegawai', function ($data) {
|
||||||
|
return $this->msPegawai->getById($data->id_pegawai)->nama_pegawai;
|
||||||
|
})
|
||||||
|
->addColumn('total_tarif', function ($data) {
|
||||||
|
return $data->jumlah_tindakan * $this->msTindakan->getById($data->id_tindakan)->tarif;
|
||||||
|
})
|
||||||
|
->addColumn('action', function ($data) {
|
||||||
|
return view('admin.tr_transaksi.column.action', compact('data'));
|
||||||
|
})
|
||||||
|
->make(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
return view('admin.tr_transaksi.index');
|
||||||
|
}
|
||||||
|
|
||||||
|
public function create()
|
||||||
|
{
|
||||||
|
return view('admin.tr_transaksi.create', [
|
||||||
|
'registrasi' => $this->trTransaksi->getAll(),
|
||||||
|
'tindakan' => $this->msTindakan->getAll(),
|
||||||
|
'pegawai' => $this->msPegawai->getAll(),
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function store(Request $request)
|
||||||
|
{
|
||||||
|
$request->validate([
|
||||||
|
'id_registrasi' => 'required',
|
||||||
|
'id_tindakan' => 'required',
|
||||||
|
'jumlah_tindakan' => 'required|integer|min:1',
|
||||||
|
'id_pegawai' => 'required',
|
||||||
|
]);
|
||||||
|
|
||||||
|
$this->trTransaksi->store($request->all());
|
||||||
|
|
||||||
|
return redirect()->route('admin.tr_transaksi.index')->with('success', 'Data Ruang Pelayanan berhasil ditambahkan.');
|
||||||
|
}
|
||||||
|
|
||||||
|
public function edit($id)
|
||||||
|
{
|
||||||
|
$transaksi = $this->trTransaksi->getById($id);
|
||||||
|
return view('admin.tr_transaksi.edit',[
|
||||||
|
'transaksi' => $transaksi,
|
||||||
|
'tindakan' => $this->msTindakan->getAll(),
|
||||||
|
'pegawai' => $this->msPegawai->getAll(),
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function update(Request $request, $id)
|
||||||
|
{
|
||||||
|
$request->validate([
|
||||||
|
'id_registrasi' => 'required',
|
||||||
|
'id_tindakan' => 'required',
|
||||||
|
'jumlah_tindakan' => 'required|integer|min:1',
|
||||||
|
'id_pegawai' => 'required',
|
||||||
|
]);
|
||||||
|
|
||||||
|
$this->trTransaksi->update($id, $request->all());
|
||||||
|
|
||||||
|
return redirect()->route('admin.tr_transaksi.index')->with('success', 'Data Ruang Pelayanan berhasil diperbarui.');
|
||||||
|
}
|
||||||
|
|
||||||
|
public function destroy($id)
|
||||||
|
{
|
||||||
|
$this->trTransaksi->delete($id);
|
||||||
|
return response()->json(['success' => 'Data Ruang Pelayanan berhasil dihapus.']);
|
||||||
|
}
|
||||||
|
}
|
||||||
28
app/Http/Controllers/Auth/VerifyEmailController.php
Normal file
28
app/Http/Controllers/Auth/VerifyEmailController.php
Normal file
@ -0,0 +1,28 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Http\Controllers\Auth;
|
||||||
|
|
||||||
|
use App\Http\Controllers\Controller;
|
||||||
|
use App\Providers\RouteServiceProvider;
|
||||||
|
use Illuminate\Auth\Events\Verified;
|
||||||
|
use Illuminate\Foundation\Auth\EmailVerificationRequest;
|
||||||
|
use Illuminate\Http\RedirectResponse;
|
||||||
|
|
||||||
|
class VerifyEmailController extends Controller
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Mark the authenticated user's email address as verified.
|
||||||
|
*/
|
||||||
|
public function __invoke(EmailVerificationRequest $request): RedirectResponse
|
||||||
|
{
|
||||||
|
if ($request->user()->hasVerifiedEmail()) {
|
||||||
|
return redirect()->intended(RouteServiceProvider::home().'?verified=1');
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($request->user()->markEmailAsVerified()) {
|
||||||
|
event(new Verified($request->user()));
|
||||||
|
}
|
||||||
|
|
||||||
|
return redirect()->intended(RouteServiceProvider::home().'?verified=1');
|
||||||
|
}
|
||||||
|
}
|
||||||
23
app/Http/Middleware/RoleMiddleware.php
Normal file
23
app/Http/Middleware/RoleMiddleware.php
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Http\Middleware;
|
||||||
|
|
||||||
|
use Closure;
|
||||||
|
use Illuminate\Http\Request;
|
||||||
|
use Symfony\Component\HttpFoundation\Response;
|
||||||
|
use App\Providers\RouteServiceProvider;
|
||||||
|
|
||||||
|
class RoleMiddleware
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Handle an incoming request.
|
||||||
|
*/
|
||||||
|
public function handle(Request $request, Closure $next, string $role): Response
|
||||||
|
{
|
||||||
|
if (!$request->user() || !$request->user()->hasRole($role)) {
|
||||||
|
abort(403, 'Unauthorized action.');
|
||||||
|
}
|
||||||
|
|
||||||
|
return $next($request);
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -6,6 +6,8 @@ interface TrTransaksiInterface
|
|||||||
{
|
{
|
||||||
public function getAll();
|
public function getAll();
|
||||||
public function getById($id);
|
public function getById($id);
|
||||||
|
public function getByRegistrasi($id_registrasi);
|
||||||
|
public function getByDate($date);
|
||||||
public function store($data);
|
public function store($data);
|
||||||
public function update($id, $data);
|
public function update($id, $data);
|
||||||
public function delete($id);
|
public function delete($id);
|
||||||
|
|||||||
@ -10,6 +10,7 @@ class TrRegistrasi extends Model
|
|||||||
use HasFactory;
|
use HasFactory;
|
||||||
|
|
||||||
protected $table = 'tr_registrasi';
|
protected $table = 'tr_registrasi';
|
||||||
|
protected $primaryKey = 'id_registrasi';
|
||||||
|
|
||||||
protected $fillable = [
|
protected $fillable = [
|
||||||
'id_registrasi',
|
'id_registrasi',
|
||||||
@ -19,7 +20,8 @@ class TrRegistrasi extends Model
|
|||||||
'id_ruang_pelayanan',
|
'id_ruang_pelayanan',
|
||||||
'id_pegawai',
|
'id_pegawai',
|
||||||
'tanggal_registrasi',
|
'tanggal_registrasi',
|
||||||
];
|
'status',
|
||||||
|
];
|
||||||
|
|
||||||
public function pasien()
|
public function pasien()
|
||||||
{
|
{
|
||||||
|
|||||||
@ -10,6 +10,7 @@ class TrTransaksi extends Model
|
|||||||
use HasFactory;
|
use HasFactory;
|
||||||
|
|
||||||
protected $table = 'tr_transaksi';
|
protected $table = 'tr_transaksi';
|
||||||
|
protected $primaryKey = 'id_transaksi';
|
||||||
protected $fillable = [
|
protected $fillable = [
|
||||||
'id_transaksi',
|
'id_transaksi',
|
||||||
'id_registrasi',
|
'id_registrasi',
|
||||||
|
|||||||
@ -14,7 +14,6 @@ class TrRegistrasiRepository implements TrRegistrasiInterface
|
|||||||
$this->trRegistrasi = $trRegistrasi;
|
$this->trRegistrasi = $trRegistrasi;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public function getAll()
|
public function getAll()
|
||||||
{
|
{
|
||||||
return $this->trRegistrasi->all();
|
return $this->trRegistrasi->all();
|
||||||
@ -27,6 +26,7 @@ class TrRegistrasiRepository implements TrRegistrasiInterface
|
|||||||
|
|
||||||
public function store($data)
|
public function store($data)
|
||||||
{
|
{
|
||||||
|
$data['tanggal_registrasi'] = now();
|
||||||
return $this->trRegistrasi->create($data);
|
return $this->trRegistrasi->create($data);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -24,6 +24,16 @@ class TrTransaksiRepository implements TrTransaksiInterface
|
|||||||
return $this->trTransaksi->find($id);
|
return $this->trTransaksi->find($id);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function getByRegistrasi($id_registrasi)
|
||||||
|
{
|
||||||
|
return $this->trTransaksi->where('id_registrasi', $id_registrasi)->get();
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getByDate($date)
|
||||||
|
{
|
||||||
|
return $this->trTransaksi->whereDate('created_at', $date)->get();
|
||||||
|
}
|
||||||
|
|
||||||
public function store($data)
|
public function store($data)
|
||||||
{
|
{
|
||||||
return $this->trTransaksi->create($data);
|
return $this->trTransaksi->create($data);
|
||||||
|
|||||||
@ -0,0 +1,28 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
use Illuminate\Database\Migrations\Migration;
|
||||||
|
use Illuminate\Database\Schema\Blueprint;
|
||||||
|
use Illuminate\Support\Facades\Schema;
|
||||||
|
|
||||||
|
return new class extends Migration
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Run the migrations.
|
||||||
|
*/
|
||||||
|
public function up(): void
|
||||||
|
{
|
||||||
|
Schema::table('tr_registrasi', function (Blueprint $table) {
|
||||||
|
$table->string('status')->default('active')->after('tanggal_registrasi');
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Reverse the migrations.
|
||||||
|
*/
|
||||||
|
public function down(): void
|
||||||
|
{
|
||||||
|
Schema::table('tr_registrasi', function (Blueprint $table) {
|
||||||
|
$table->dropColumn('status');
|
||||||
|
});
|
||||||
|
}
|
||||||
|
};
|
||||||
@ -0,0 +1,8 @@
|
|||||||
|
<div class="flex gap-x-2">
|
||||||
|
<a href="{{ route('admin.tr_registrasi.edit', $data->id_registrasi) }}" class="hover:scale-105 transition-transform bg-blue-400 rounded-lg px-4 py-2 text-white">
|
||||||
|
Ubah
|
||||||
|
</a>
|
||||||
|
<button onclick="deleteData('{{ $data->id_registrasi }}')" class="hover:scale-105 transition-transform bg-red-400 rounded-lg px-4 py-2 text-white">
|
||||||
|
Hapus
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
64
resources/views/admin/tr_registrasi/create.blade.php
Normal file
64
resources/views/admin/tr_registrasi/create.blade.php
Normal file
@ -0,0 +1,64 @@
|
|||||||
|
<x-app-layout>
|
||||||
|
<div class="py-12">
|
||||||
|
<div class="max-w-3xl mx-auto sm:px-6 lg:px-8">
|
||||||
|
<div class="bg-white overflow-hidden shadow-sm sm:rounded-lg">
|
||||||
|
<div class="p-6 bg-white border-b border-gray-200">
|
||||||
|
{{-- Back button --}}
|
||||||
|
<h1 class="text-xl mb-4 font-bold">Pendaftaran Pelayanan</h1>
|
||||||
|
|
||||||
|
<form action="{{ route('admin.tr_registrasi.store') }}" method="POST">
|
||||||
|
@csrf
|
||||||
|
<div class="mb-4">
|
||||||
|
<label class="block font-medium text-sm mb-2">Pasien<span class="text-red-600">*</span></label>
|
||||||
|
<select name="mr_pasien" required class="text-sm block mt-1 w-full p-2 bg-gray-50 border border-gray-300 focus:ring-gray-500 focus:border-gray-500 rounded-md shadow-sm placeholder-gray-300">
|
||||||
|
<option value="">-- Pilih --</option>
|
||||||
|
@foreach ($pasien as $p)
|
||||||
|
<option value="{{ $p->mr_pasien }}">{{ $p->nama_pasien .' - '. $p->mr_pasien}}</option>
|
||||||
|
@endforeach
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="mb-4">
|
||||||
|
<label class="block font-medium text-sm mb-2">Asuransi<span class="text-red-600">*</span></label>
|
||||||
|
<select name="id_asuransi" required class="text-sm block mt-1 w-full p-2 bg-gray-50 border border-gray-300 focus:ring-gray-500 focus:border-gray-500 rounded-md shadow-sm placeholder-gray-300">
|
||||||
|
<option value="">-- Pilih --</option>
|
||||||
|
@foreach ($asuransi as $a)
|
||||||
|
<option value="{{ $a->id_asuransi }}">{{ $a->nama_asuransi }}</option>
|
||||||
|
@endforeach
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<x-input id="no_asuransi" label="No. Asuransi" name="no_asuransi" placeholder="misal: Budi" required />
|
||||||
|
|
||||||
|
<div class="mb-4">
|
||||||
|
<label class="block font-medium text-sm mb-2">Ruang Pelayanan<span class="text-red-600">*</span></label>
|
||||||
|
<select name="id_ruang_pelayanan" required class="text-sm block mt-1 w-full p-2 bg-gray-50 border border-gray-300 focus:ring-gray-500 focus:border-gray-500 rounded-md shadow-sm placeholder-gray-300">
|
||||||
|
<option value="">-- Pilih --</option>
|
||||||
|
@foreach ($ruang_pelayanan as $rp)
|
||||||
|
<option value="{{ $rp->id_ruang_pelayanan }}">{{ $rp->id_ruang_pelayanan . ' - ' . $rp->nama_ruang_pelayanan }}</option>
|
||||||
|
@endforeach
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="mb-4">
|
||||||
|
<label class="block font-medium text-sm mb-2">Pegawai<span class="text-red-600">*</span></label>
|
||||||
|
<select name="id_pegawai" required class="text-sm block mt-1 w-full p-2 bg-gray-50 border border-gray-300 focus:ring-gray-500 focus:border-gray-500 rounded-md shadow-sm placeholder-gray-300">
|
||||||
|
<option value="">-- Pilih --</option>
|
||||||
|
@foreach ($pegawai as $pg)
|
||||||
|
<option value="{{ $pg->id_pegawai }}">{{ $pg->nama_pegawai }}</option>
|
||||||
|
@endforeach
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{{-- Submit button --}}
|
||||||
|
<div class="flex justify-end mt-4">
|
||||||
|
<a href="{{ route('admin.tr_registrasi.index') }}" class="bg-gray-300 text-gray-700 px-4 py-2 rounded-md mr-2">Batal</a>
|
||||||
|
<button type="submit" class="bg-blue-500 text-white px-4 py-2 rounded-md">Simpan Perubahan</button>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</x-app-layout>
|
||||||
149
resources/views/admin/tr_registrasi/data.blade.php
Normal file
149
resources/views/admin/tr_registrasi/data.blade.php
Normal file
@ -0,0 +1,149 @@
|
|||||||
|
<x-app-layout>
|
||||||
|
<div class="py-12">
|
||||||
|
<div class="max-w-7xl mx-auto sm:px-6 lg:px-8">
|
||||||
|
<div class="bg-white overflow-hidden shadow-sm sm:rounded-lg">
|
||||||
|
<div class="p-6 bg-white border-b border-gray-200">
|
||||||
|
<div class="flex justify-between mb-4">
|
||||||
|
<h1 class="text-xl font-bold">Data Registrasi</h1>
|
||||||
|
<a href="{{ route('admin.tr_registrasi.create') }}" class="bg-blue-500 text-white px-4 py-2 rounded-md">Tambah Data Registrasi</a>
|
||||||
|
</div>
|
||||||
|
<hr class="opacity-10 mb-4"></hr>
|
||||||
|
<table id="rowTable" class="rowTable table-bordered table-striped w-full">
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th>#</th>
|
||||||
|
<th>Nama Pasien</th>
|
||||||
|
<th>Asuransi</th>
|
||||||
|
<th>No. Asuransi</th>
|
||||||
|
<th>R. Pelayanan</th>
|
||||||
|
<th>Pelaksana</th>
|
||||||
|
<th>Tanggal</th>
|
||||||
|
<th>Status</th>
|
||||||
|
<th>Aksi</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody></tbody>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
@push('js-internal')
|
||||||
|
<script>
|
||||||
|
function deleteData(id) {
|
||||||
|
Swal.fire({
|
||||||
|
title: 'Apakah anda yakin?',
|
||||||
|
text: "Anda tidak dapat mengembalikan data yang telah dihapus!",
|
||||||
|
icon: 'warning',
|
||||||
|
showCancelButton: true,
|
||||||
|
confirmButtonText: 'Ya, hapus!',
|
||||||
|
cancelButtonText: 'Batal'
|
||||||
|
}).then((result) => {
|
||||||
|
if (result.isConfirmed) {
|
||||||
|
$.ajax({
|
||||||
|
url: "{{ route('admin.tr_registrasi.destroy', ':id') }}".replace(':id', id),
|
||||||
|
type: 'DELETE',
|
||||||
|
data: {
|
||||||
|
'_token': "{{ csrf_token() }}"
|
||||||
|
},
|
||||||
|
success: function() {
|
||||||
|
Swal.fire({
|
||||||
|
icon: 'success',
|
||||||
|
title: 'Berhasil',
|
||||||
|
text: 'Data berhasil dihapus',
|
||||||
|
showConfirmButton: false,
|
||||||
|
timer: 1500
|
||||||
|
}).then(() => {
|
||||||
|
$('.rowTable').DataTable().ajax.reload();
|
||||||
|
});
|
||||||
|
},
|
||||||
|
error: function() {
|
||||||
|
Swal.fire({
|
||||||
|
icon: 'error',
|
||||||
|
title: 'Gagal',
|
||||||
|
text: 'Data gagal dihapus',
|
||||||
|
showConfirmButton: false,
|
||||||
|
timer: 1500
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
@if (Session::has('success'))
|
||||||
|
Swal.fire({
|
||||||
|
icon: 'success',
|
||||||
|
title: 'Berhasil',
|
||||||
|
text: '{{ Session::get('success') }}',
|
||||||
|
showConfirmButton: false,
|
||||||
|
timer: 1500
|
||||||
|
}).then(() => {
|
||||||
|
$('.rowTable').DataTable().ajax.reload();
|
||||||
|
});
|
||||||
|
@endif
|
||||||
|
|
||||||
|
@if (Session::has('error'))
|
||||||
|
Swal.fire({
|
||||||
|
icon: 'error',
|
||||||
|
title: 'Gagal',
|
||||||
|
text: '{{ Session::get('error') }}',
|
||||||
|
showConfirmButton: false,
|
||||||
|
timer: 1500
|
||||||
|
});
|
||||||
|
@endif
|
||||||
|
|
||||||
|
$(document).ready(function() {
|
||||||
|
$('.rowTable').DataTable({
|
||||||
|
processing: true,
|
||||||
|
serverSide: true,
|
||||||
|
responsive: true,
|
||||||
|
autoWidth: false,
|
||||||
|
ajax: "{{ route('admin.tr_registrasi.data') }}",
|
||||||
|
columns: [
|
||||||
|
{
|
||||||
|
data: 'DT_RowIndex',
|
||||||
|
name: 'DT_RowIndex'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
data: 'mr_pasien',
|
||||||
|
name: 'mr_pasien',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
data: 'id_asuransi',
|
||||||
|
name: 'id_asuransi',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
data: 'no_asuransi',
|
||||||
|
name: 'no_asuransi',
|
||||||
|
},
|
||||||
|
|
||||||
|
{
|
||||||
|
data: 'id_ruang_pelayanan',
|
||||||
|
name: 'id_ruang_pelayanan',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
data: 'id_pegawai',
|
||||||
|
name: 'id_pegawai',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
data: 'tanggal_registrasi',
|
||||||
|
name: 'tanggal_registrasi',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
data: 'status',
|
||||||
|
name: 'status',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
data: 'action',
|
||||||
|
name: 'action',
|
||||||
|
orderable: false,
|
||||||
|
searchable: false
|
||||||
|
},
|
||||||
|
]
|
||||||
|
});
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
@endpush
|
||||||
|
</x-app-layout>
|
||||||
29
resources/views/admin/tr_registrasi/edit.blade.php
Normal file
29
resources/views/admin/tr_registrasi/edit.blade.php
Normal file
@ -0,0 +1,29 @@
|
|||||||
|
<x-app-layout>
|
||||||
|
<div class="py-12">
|
||||||
|
<div class="max-w-3xl mx-auto sm:px-6 lg:px-8">
|
||||||
|
<div class="bg-white overflow-hidden shadow-sm sm:rounded-lg">
|
||||||
|
<div class="p-6 bg-white border-b border-gray-200">
|
||||||
|
<h1 class="text-xl mb-4 font-bold">Edit Data Registrasi #{{$registrasi->id_registrasi}}</h1>
|
||||||
|
<hr class="opacity-10 mb-4"></hr>
|
||||||
|
|
||||||
|
<form method="POST" action="{{ route('admin.tr_registrasi.update', $registrasi->id_registrasi) }}">
|
||||||
|
@csrf
|
||||||
|
<x-input id="id_registrasi" label="ID Registrasi" name="id_registrasi" placeholder="misal: Budi" required :value="$registrasi->id_registrasi"/>
|
||||||
|
<x-input id="mr_pasien" label="MR Pasien" name="mr_pasien" required placeholder="misal:150000" :value="$registrasi->mr_pasien"/>
|
||||||
|
<x-input id="id_asuransi" label="Asuransi" name="id_asuransi" required placeholder="misal: 2" :value="$registrasi->id_asuransi"/>
|
||||||
|
<x-input id="no_asuransi" label="No. Asuransi" name="no_asuransi" placeholder="misal: Budi" required :value="$registrasi->no_asuransi"/>
|
||||||
|
<x-input id="id_ruang_pelayanan" label="Ruang Pelayanan" name="id_ruang_pelayanan" required placeholder="misal:150000" :value="$registrasi->id_ruang_pelayanan"/>
|
||||||
|
<x-input id="id_pegawai" label="Pelaksana" name="id_pegawai" required placeholder="misal: 1" :value="$registrasi->id_pegawai"/>
|
||||||
|
<x-input id="tanggal_registrasi" label="Tanggal Registrasi" name="tanggal_registrasi" type="date" required placeholder="misal: 2" :value="$registrasi->tanggal_registrasi"/>
|
||||||
|
|
||||||
|
<div class="flex justify-end mt-4 gap-2">
|
||||||
|
<a href="{{ route('admin.tr_registrasi.index') }}" class="bg-gray-300 text-gray-700 px-4 py-2 rounded-md id-2">Batal</a>
|
||||||
|
<button type="submit" class="bg-blue-500 text-white px-4 py-2 rounded-md">Simpan Perubahan</button>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</x-app-layout>
|
||||||
55
resources/views/admin/tr_registrasi/index.blade.php
Normal file
55
resources/views/admin/tr_registrasi/index.blade.php
Normal file
@ -0,0 +1,55 @@
|
|||||||
|
<x-app-layout>
|
||||||
|
<div class="py-12">
|
||||||
|
<div class="max-w-7xl mx-auto sm:px-6 lg:px-8">
|
||||||
|
<div class="bg-white overflow-hidden shadow-sm sm:rounded-lg">
|
||||||
|
<div class="p-6 bg-white border-b border-gray-200">
|
||||||
|
<div class="flex justify-between mb-4">
|
||||||
|
<h1 class="text-xl font-bold">Data Registrasi</h1>
|
||||||
|
<a href="{{ route('admin.tr_registrasi.data') }}" class="bg-blue-500 text-white px-4 py-2 rounded-md">Lihat selengkapnya</a>
|
||||||
|
</div>
|
||||||
|
<hr class="opacity-10 mb-4"></hr>
|
||||||
|
<div class="grid md:grid-cols-2 lg:grid-cols-3 gap-4">
|
||||||
|
@foreach ($registrasi as $d)
|
||||||
|
<div class="bg-gray-100 p-4 rounded-lg shadow-md">
|
||||||
|
<h2 class="text-lg font-semibold">#{{ $d->id_registrasi }}</h2>
|
||||||
|
<p><strong>MR Pasien:</strong> {{ $d->pasien->nama_pasien }}</p>
|
||||||
|
<p><strong>Ruang Pelayanan:</strong> {{ $d->ruangPelayanan->nama_ruang_pelayanan}}</p>
|
||||||
|
<p><strong>Pelaksana:</strong> {{ $d->pegawai->nama_pegawai }}</p>
|
||||||
|
<p class="mt-2 mb-4 text-gray-500"> {{ $d->tanggal_registrasi }}</p>
|
||||||
|
<a href="{{ route('admin.tr_registrasi.show_transaksi', $d->id_registrasi) }}" class="bg-blue-500 text-white px-4 py-2 rounded-md">Lihat Transaksi</a>
|
||||||
|
<a href="{{ route('admin.tr_transaksi.create', $d->id_registrasi) }}" class="bg-blue-500 text-white px-4 py-2 rounded-md">Tambah Transaksi</a>
|
||||||
|
</div>
|
||||||
|
@endforeach
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
@push('js-internal')
|
||||||
|
<script>
|
||||||
|
|
||||||
|
@if (Session::has('success'))
|
||||||
|
Swal.fire({
|
||||||
|
icon: 'success',
|
||||||
|
title: 'Berhasil',
|
||||||
|
text: '{{ Session::get('success') }}',
|
||||||
|
showConfirmButton: false,
|
||||||
|
timer: 1500
|
||||||
|
}).then(() => {
|
||||||
|
$('.rowTable').DataTable().ajax.reload();
|
||||||
|
});
|
||||||
|
@endif
|
||||||
|
|
||||||
|
@if (Session::has('error'))
|
||||||
|
Swal.fire({
|
||||||
|
icon: 'error',
|
||||||
|
title: 'Gagal',
|
||||||
|
text: '{{ Session::get('error') }}',
|
||||||
|
showConfirmButton: false,
|
||||||
|
timer: 1500
|
||||||
|
});
|
||||||
|
@endif
|
||||||
|
</script>
|
||||||
|
@endpush
|
||||||
|
</x-app-layout>
|
||||||
78
resources/views/admin/tr_registrasi/transaksi.blade.php
Normal file
78
resources/views/admin/tr_registrasi/transaksi.blade.php
Normal file
@ -0,0 +1,78 @@
|
|||||||
|
<x-app-layout>
|
||||||
|
<div class="py-12">
|
||||||
|
<div class="max-w-3xl mx-auto sm:px-6 lg:px-8" id="strukArea">
|
||||||
|
<div class="bg-white p-6 rounded shadow">
|
||||||
|
|
||||||
|
<h2 class="text-2xl font-bold mb-4">Struk Pembayaran</h2>
|
||||||
|
|
||||||
|
|
||||||
|
@if(count($transaksi) > 0)
|
||||||
|
<div class="mb-6">
|
||||||
|
<p><strong>Nama Pasien:</strong> {{ $transaksi[0]->registrasi->pasien->nama_pasien ?? '-' }}</p>
|
||||||
|
<p><strong>MR Pasien:</strong>{{ $transaksi[0]->registrasi->mr_pasien ?? '-' }}</p>
|
||||||
|
<hr class="my-2 opacity-20"></hr>
|
||||||
|
<p><strong>Tanggal Registrasi:</strong> {{ $transaksi[0]->registrasi->tanggal_registrasi ?? '-' }}</p>
|
||||||
|
<p><strong>Nomor Registrasi:</strong> {{ $transaksi[0]->id_registrasi }}</p>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{{-- Tabel Tindakan --}}
|
||||||
|
<table class="min-w-full divide-y divide-gray-200 mb-6">
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th class="px-4 py-2 text-left">Tindakan</th>
|
||||||
|
<th class="px-4 py-2 text-left">Jumlah</th>
|
||||||
|
<th class="px-4 py-2 text-left">Tarif</th>
|
||||||
|
<th class="px-4 py-2 text-left">Subtotal</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody class="divide-y divide-gray-200">
|
||||||
|
@php $total = 0; @endphp
|
||||||
|
@foreach ($transaksi as $t)
|
||||||
|
@foreach ($t->tindakan as $tindakan)
|
||||||
|
@php
|
||||||
|
$subtotal = $t->jumlah_tindakan * $tindakan->tarif;
|
||||||
|
$total += $subtotal;
|
||||||
|
@endphp
|
||||||
|
<tr>
|
||||||
|
<td class="px-4 py-2">{{ $tindakan->nama_tindakan }}</td>
|
||||||
|
<td class="px-4 py-2">{{ $t->jumlah_tindakan }}</td>
|
||||||
|
<td class="px-4 py-2">Rp{{ number_format($tindakan->tarif, 0, ',', '.') }}</td>
|
||||||
|
<td class="px-4 py-2">Rp{{ number_format($subtotal, 0, ',', '.') }}</td>
|
||||||
|
</tr>
|
||||||
|
@endforeach
|
||||||
|
@endforeach
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
|
||||||
|
{{-- Total --}}
|
||||||
|
<div class="text-right text-lg font-bold">
|
||||||
|
Total: Rp{{ number_format($total, 0, ',', '.') }}
|
||||||
|
</div>
|
||||||
|
@else
|
||||||
|
<p>Tidak ada transaksi ditemukan.</p>
|
||||||
|
@endif
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="flex justify-center mt-4">
|
||||||
|
<button onclick="printStruk()" class="bg-blue-500 text-white px-4 py-2 rounded-md">Cetak Struk</button>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<script src="https://cdnjs.cloudflare.com/ajax/libs/html2pdf.js/0.9.2/html2pdf.bundle.min.js"></script>
|
||||||
|
<script>
|
||||||
|
function printStruk() {
|
||||||
|
var element = document.getElementById('strukArea');
|
||||||
|
var opt = {
|
||||||
|
margin: 0.5,
|
||||||
|
filename: 'struk-pembayaran.pdf',
|
||||||
|
image: { type: 'jpeg', quality: 0.98 },
|
||||||
|
html2canvas: { scale: 2 },
|
||||||
|
jsPDF: { unit: 'in', format: 'a4', orientation: 'portrait' }
|
||||||
|
};
|
||||||
|
|
||||||
|
html2pdf().set(opt).from(element).save();
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
</x-app-layout>
|
||||||
@ -0,0 +1,8 @@
|
|||||||
|
<div class="flex gap-x-2">
|
||||||
|
<a href="{{ route('admin.tr_transaksi.edit', $data->id_transaksi) }}" class="hover:scale-105 transition-transform bg-blue-400 rounded-lg px-4 py-2 text-white">
|
||||||
|
Ubah
|
||||||
|
</a>
|
||||||
|
<button onclick="deleteData('{{ $data->id_transaksi }}')" class="hover:scale-105 transition-transform bg-red-400 rounded-lg px-4 py-2 text-white">
|
||||||
|
Hapus
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
42
resources/views/admin/tr_transaksi/create.blade.php
Normal file
42
resources/views/admin/tr_transaksi/create.blade.php
Normal file
@ -0,0 +1,42 @@
|
|||||||
|
<x-app-layout>
|
||||||
|
<div class="py-12">
|
||||||
|
<div class="max-w-3xl mx-auto sm:px-6 lg:px-8">
|
||||||
|
<div class="bg-white overflow-hidden shadow-sm sm:rounded-lg">
|
||||||
|
<div class="p-6 bg-white border-b border-gray-200">
|
||||||
|
{{-- Back button --}}
|
||||||
|
<h1 class="text-xl mb-4 font-bold">Tambah Data Transaksi</h1>
|
||||||
|
|
||||||
|
<form action="{{ route('admin.tr_transaksi.store') }}" method="POST">
|
||||||
|
@csrf
|
||||||
|
<x-input id="id_registrasi" label="ID Registrasi" name="id_registrasi" placeholder="misal: Budi" required />
|
||||||
|
<div class="mb-4">
|
||||||
|
<label class="block font-medium text-sm mb-2">Tindakan<span class="text-red-600">*</span></label>
|
||||||
|
<select name="id_tindakan" required class="text-sm block mt-1 w-full p-2 bg-gray-50 border border-gray-300 focus:ring-gray-500 focus:border-gray-500 rounded-md shadow-sm placeholder-gray-300">
|
||||||
|
<option value="">-- Pilih --</option>
|
||||||
|
@foreach ($tindakan as $data)
|
||||||
|
<option value="{{ $data->id_tindakan }}">{{ $data->nama_tindakan }}</option>
|
||||||
|
@endforeach
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
<x-input id="jumlah_tindakan" label="Jumlah Tindakan" name="jumlah_tindakan" type="number" required placeholder="misal: 2"/>
|
||||||
|
<div class="mb-4">
|
||||||
|
<label class="block font-medium text-sm mb-2">Pelaksana<span class="text-red-600">*</span></label>
|
||||||
|
<select name="id_pegawai" required class="text-sm block mt-1 w-full p-2 bg-gray-50 border border-gray-300 focus:ring-gray-500 focus:border-gray-500 rounded-md shadow-sm placeholder-gray-300">
|
||||||
|
<option value="">-- Pilih --</option>
|
||||||
|
@foreach ($pegawai as $data)
|
||||||
|
<option value="{{ $data->id_pegawai }}">{{ $data->nama_pegawai }}</option>
|
||||||
|
@endforeach
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
{{-- Submit button --}}
|
||||||
|
<div class="flex justify-end mt-4">
|
||||||
|
<a href="{{ route('admin.tr_transaksi.index') }}" class="bg-gray-300 text-gray-700 px-4 py-2 rounded-md mr-2">Batal</a>
|
||||||
|
<button type="submit" class="bg-blue-500 text-white px-4 py-2 rounded-md">Simpan Perubahan</button>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</x-app-layout>
|
||||||
25
resources/views/admin/tr_transaksi/edit.blade.php
Normal file
25
resources/views/admin/tr_transaksi/edit.blade.php
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
<x-app-layout>
|
||||||
|
<div class="py-12">
|
||||||
|
<div class="max-w-3xl mx-auto sm:px-6 lg:px-8">
|
||||||
|
<div class="bg-white overflow-hidden shadow-sm sm:rounded-lg">
|
||||||
|
<div class="p-6 bg-white border-b border-gray-200">
|
||||||
|
<h1 class="text-xl mb-4 font-bold">Edit Data Tindakan #{{$transaksi->id_transaksi}}</h1>
|
||||||
|
<hr class="opacity-10 mb-4"></hr>
|
||||||
|
|
||||||
|
<form method="POST" action="{{ route('admin.tr_transaksi.update', $transaksi->id_transaksi) }}">
|
||||||
|
@csrf
|
||||||
|
<x-input id="id_registrasi" label="ID Registrasi" name="id_registrasi" placeholder="misal: Budi" required :value="$transaksi->id_registrasi"/>
|
||||||
|
<x-input id="id_tindakan" label="Tindakan" name="id_tindakan" type="number" required placeholder="misal:150000":value="$transaksi->id_tindakan"/>
|
||||||
|
<x-input id="jumlah_tindakan" label="Jumlah Tindakan" name="jumlah_tindakan" type="number" required placeholder="misal: 2":value="$transaksi->jumlah_tindakan"/>
|
||||||
|
<x-input id="id_pegawai" label="Pelaksana" name="id_pegawai" type="number" required placeholder="misal: 1":value="$transaksi->id_pegawai"/>
|
||||||
|
<div class="flex justify-end mt-4 gap-2">
|
||||||
|
<a href="{{ route('admin.tr_transaksi.index') }}" class="bg-gray-300 text-gray-700 px-4 py-2 rounded-md id-2">Batal</a>
|
||||||
|
<button type="submit" class="bg-blue-500 text-white px-4 py-2 rounded-md">Simpan Perubahan</button>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</x-app-layout>
|
||||||
132
resources/views/admin/tr_transaksi/index.blade.php
Normal file
132
resources/views/admin/tr_transaksi/index.blade.php
Normal file
@ -0,0 +1,132 @@
|
|||||||
|
<x-app-layout>
|
||||||
|
<div class="py-12">
|
||||||
|
<div class="max-w-7xl mx-auto sm:px-6 lg:px-8">
|
||||||
|
<div class="bg-white overflow-hidden shadow-sm sm:rounded-lg">
|
||||||
|
<div class="p-6 bg-white border-b border-gray-200">
|
||||||
|
<div class="flex justify-between mb-4">
|
||||||
|
<h1 class="text-xl font-bold">Data Transaksi</h1>
|
||||||
|
</div>
|
||||||
|
<hr class="opacity-10 mb-4"></hr>
|
||||||
|
<table id="rowTable" class="rowTable table-bordered table-striped w-full">
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th>#</th>
|
||||||
|
<th>Nama Tindakan</th>
|
||||||
|
<th>Jumlah Tindakan</th>
|
||||||
|
<th>Pelaksana</th>
|
||||||
|
<th>Total Tarif</th>
|
||||||
|
<th>Aksi</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody></tbody>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
@push('js-internal')
|
||||||
|
<script>
|
||||||
|
function deleteData(id) {
|
||||||
|
Swal.fire({
|
||||||
|
title: 'Apakah anda yakin?',
|
||||||
|
text: "Anda tidak dapat mengembalikan data yang telah dihapus!",
|
||||||
|
icon: 'warning',
|
||||||
|
showCancelButton: true,
|
||||||
|
confirmButtonText: 'Ya, hapus!',
|
||||||
|
cancelButtonText: 'Batal'
|
||||||
|
}).then((result) => {
|
||||||
|
if (result.isConfirmed) {
|
||||||
|
$.ajax({
|
||||||
|
url: "{{ route('admin.tr_transaksi.destroy', ':id') }}".replace(':id', id),
|
||||||
|
type: 'DELETE',
|
||||||
|
data: {
|
||||||
|
'_token': "{{ csrf_token() }}"
|
||||||
|
},
|
||||||
|
success: function() {
|
||||||
|
Swal.fire({
|
||||||
|
icon: 'success',
|
||||||
|
title: 'Berhasil',
|
||||||
|
text: 'Data berhasil dihapus',
|
||||||
|
showConfirmButton: false,
|
||||||
|
timer: 1500
|
||||||
|
}).then(() => {
|
||||||
|
$('.rowTable').DataTable().ajax.reload();
|
||||||
|
});
|
||||||
|
},
|
||||||
|
error: function() {
|
||||||
|
Swal.fire({
|
||||||
|
icon: 'error',
|
||||||
|
title: 'Gagal',
|
||||||
|
text: 'Data gagal dihapus',
|
||||||
|
showConfirmButton: false,
|
||||||
|
timer: 1500
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
@if (Session::has('success'))
|
||||||
|
Swal.fire({
|
||||||
|
icon: 'success',
|
||||||
|
title: 'Berhasil',
|
||||||
|
text: '{{ Session::get('success') }}',
|
||||||
|
showConfirmButton: false,
|
||||||
|
timer: 1500
|
||||||
|
}).then(() => {
|
||||||
|
$('.rowTable').DataTable().ajax.reload();
|
||||||
|
});
|
||||||
|
@endif
|
||||||
|
|
||||||
|
@if (Session::has('error'))
|
||||||
|
Swal.fire({
|
||||||
|
icon: 'error',
|
||||||
|
title: 'Gagal',
|
||||||
|
text: '{{ Session::get('error') }}',
|
||||||
|
showConfirmButton: false,
|
||||||
|
timer: 1500
|
||||||
|
});
|
||||||
|
@endif
|
||||||
|
|
||||||
|
$(document).ready(function() {
|
||||||
|
$('.rowTable').DataTable({
|
||||||
|
processing: true,
|
||||||
|
serverSide: true,
|
||||||
|
responsive: true,
|
||||||
|
autoWidth: false,
|
||||||
|
ajax: "{{ route('admin.tr_transaksi.index') }}",
|
||||||
|
columns: [
|
||||||
|
{
|
||||||
|
data: 'DT_RowIndex',
|
||||||
|
name: 'DT_RowIndex'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
data: 'nama_tindakan',
|
||||||
|
name: 'nama_tindakan',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
data: 'jumlah_tindakan',
|
||||||
|
name: 'jumlah_tindakan',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
data: 'id_pegawai',
|
||||||
|
name: 'id_pegawai',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
data: 'total_tarif',
|
||||||
|
name: 'total_tarif',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
data: 'action',
|
||||||
|
name: 'action',
|
||||||
|
orderable: false,
|
||||||
|
searchable: false
|
||||||
|
},
|
||||||
|
]
|
||||||
|
});
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
@endpush
|
||||||
|
</x-app-layout>
|
||||||
@ -32,21 +32,16 @@
|
|||||||
</x-nav-link>
|
</x-nav-link>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- Logout -->
|
<p class="text-sm font-semibold text-white uppercase">Transaksi</p>
|
||||||
<li>
|
<div class="flex flex-col">
|
||||||
LogOut
|
<x-nav-link href="{{ route('admin.tr_registrasi.index') }}" :active="request()->routeIs('admin.tr_registrasi.*')">
|
||||||
{{-- <form action="{{ route('logout') }}" method="POST">
|
Registrasi Pasien
|
||||||
@csrf
|
</x-nav-link>
|
||||||
<a class="flex items-center py-3 pl-6 nav-item hover:text-orange-400 rounded-md"
|
<x-nav-link href="{{ route('admin.tr_transaksi.index') }}" :active="request()->routeIs('admin.tr_transaksi.*')">
|
||||||
onclick="event.preventDefault(); this.closest('form').submit();">
|
Transaksi Pasien
|
||||||
<i
|
</x-nav-link>
|
||||||
class="fas fa-sign-out-alt text-white w-4 h-4 transition duration-75 group-hover:text-orange-400 "></i>
|
</div>
|
||||||
<span class="ml-3 text-white">
|
|
||||||
Keluar
|
|
||||||
</span>
|
|
||||||
</a>
|
|
||||||
</form> --}}
|
|
||||||
</li>
|
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
</aside>
|
</aside>
|
||||||
@ -20,7 +20,9 @@
|
|||||||
|
|
||||||
<!-- Sweet Alert 2 -->
|
<!-- Sweet Alert 2 -->
|
||||||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/sweetalert2@11.7.27/dist/sweetalert2.min.css">
|
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/sweetalert2@11.7.27/dist/sweetalert2.min.css">
|
||||||
|
|
||||||
|
<!-- Select2 CSS -->
|
||||||
|
<link href="https://cdn.jsdelivr.net/npm/select2@4.1.0-rc.0/dist/css/select2.min.css" rel="stylesheet" />
|
||||||
|
|
||||||
</head>
|
</head>
|
||||||
<body class="font-[figtree] antialiased text-sm 2xl:text-md overflow-hidden bg-gray-100">
|
<body class="font-[figtree] antialiased text-sm 2xl:text-md overflow-hidden bg-gray-100">
|
||||||
@ -40,9 +42,6 @@
|
|||||||
</main>
|
</main>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{{--
|
|
||||||
<x-footer /> --}}
|
|
||||||
|
|
||||||
<!-- Jquery -->
|
<!-- Jquery -->
|
||||||
<script src="https://code.jquery.com/jquery-3.7.0.min.js"
|
<script src="https://code.jquery.com/jquery-3.7.0.min.js"
|
||||||
integrity="sha256-2Pmvv0kuTBOenSvLm6bvfBSSHrUJ+3A7x6P5Ebd07/g=" crossorigin="anonymous"></script>
|
integrity="sha256-2Pmvv0kuTBOenSvLm6bvfBSSHrUJ+3A7x6P5Ebd07/g=" crossorigin="anonymous"></script>
|
||||||
@ -58,6 +57,9 @@
|
|||||||
<script src="https://cdn.datatables.net/buttons/2.4.2/js/buttons.html5.min.js"></script>
|
<script src="https://cdn.datatables.net/buttons/2.4.2/js/buttons.html5.min.js"></script>
|
||||||
<script src="https://cdn.datatables.net/buttons/2.4.2/js/buttons.print.min.js"></script>
|
<script src="https://cdn.datatables.net/buttons/2.4.2/js/buttons.print.min.js"></script>
|
||||||
|
|
||||||
|
<!-- Select2 JS -->
|
||||||
|
<script src="https://cdn.jsdelivr.net/npm/select2@4.1.0-rc.0/dist/js/select2.min.js"></script>
|
||||||
|
|
||||||
@stack('js-internal')
|
@stack('js-internal')
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
@ -6,6 +6,8 @@ use App\Http\Controllers\Admin\MsPegawaiController;
|
|||||||
use App\Http\Controllers\Admin\MsAsuransiController;
|
use App\Http\Controllers\Admin\MsAsuransiController;
|
||||||
use App\Http\Controllers\Admin\MsRuangPelayananController;
|
use App\Http\Controllers\Admin\MsRuangPelayananController;
|
||||||
use App\Http\Controllers\Admin\MsTindakanController;
|
use App\Http\Controllers\Admin\MsTindakanController;
|
||||||
|
use App\Http\Controllers\Admin\TrTransaksiController;
|
||||||
|
use App\Http\Controllers\Admin\TrRegistrasiController;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|--------------------------------------------------------------------------
|
|--------------------------------------------------------------------------
|
||||||
@ -67,4 +69,24 @@ Route::group(['prefix' => 'admin'], function () {
|
|||||||
Route::post('/update/{id}', [MsTindakanController::class, 'update'])->name('admin.ms_tindakan.update');
|
Route::post('/update/{id}', [MsTindakanController::class, 'update'])->name('admin.ms_tindakan.update');
|
||||||
Route::delete('/destroy/{id}', [MsTindakanController::class, 'destroy'])->name('admin.ms_tindakan.destroy');
|
Route::delete('/destroy/{id}', [MsTindakanController::class, 'destroy'])->name('admin.ms_tindakan.destroy');
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Route::group(['prefix' => 'transaksi'], function () {
|
||||||
|
Route::get('/', [TrTransaksiController::class, 'index'])->name('admin.tr_transaksi.index');
|
||||||
|
Route::get('/create', [TrTransaksiController::class, 'create'])->name('admin.tr_transaksi.create');
|
||||||
|
Route::post('/store', [TrTransaksiController::class, 'store'])->name('admin.tr_transaksi.store');
|
||||||
|
Route::get('/edit/{id}', [TrTransaksiController::class, 'edit'])->name('admin.tr_transaksi.edit');
|
||||||
|
Route::post('/update/{id}', [TrTransaksiController::class, 'update'])->name('admin.tr_transaksi.update');
|
||||||
|
Route::delete('/destroy/{id}', [TrTransaksiController::class, 'destroy'])->name('admin.tr_transaksi.destroy');
|
||||||
|
});
|
||||||
|
|
||||||
|
Route::group(['prefix' => 'registrasi'], function () {
|
||||||
|
Route::get('/', [TrRegistrasiController::class, 'index'])->name('admin.tr_registrasi.index');
|
||||||
|
Route::get('/show_transaction/{id}', [TrRegistrasiController::class, 'showTransaksiByRegistrasi'])->name('admin.tr_registrasi.show_transaksi');
|
||||||
|
Route::get('/data', [TrRegistrasiController::class, 'data'])->name('admin.tr_registrasi.data');
|
||||||
|
Route::get('/create', [TrRegistrasiController::class, 'create'])->name('admin.tr_registrasi.create');
|
||||||
|
Route::post('/store', [TrRegistrasiController::class, 'store'])->name('admin.tr_registrasi.store');
|
||||||
|
Route::get('/edit/{id}', [TrRegistrasiController::class, 'edit'])->name('admin.tr_registrasi.edit');
|
||||||
|
Route::post('/update/{id}', [TrRegistrasiController::class, 'update'])->name('admin.tr_registrasi.update');
|
||||||
|
Route::delete('/destroy/{id}', [TrRegistrasiController::class, 'destroy'])->name('admin.tr_registrasi.destroy');
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user