Update Hospital Portal TTD

This commit is contained in:
ivan-sim
2024-01-09 13:34:16 +07:00
parent ba4aa586b3
commit 3bf77ff6e4
4 changed files with 144 additions and 0 deletions

View File

@@ -386,6 +386,11 @@ class RequestLogController extends Controller
(Select corporates.name FROM corporates
LEFT JOIN corporate_employees ON corporate_employees.corporate_id = corporates.id
WHERE corporate_employees.member_id = members.id LIMIT 1) AS nama_perusahaan
'),
DB::raw('
(Select corporates.id FROM corporates
LEFT JOIN corporate_employees ON corporate_employees.corporate_id = corporates.id
WHERE corporate_employees.member_id = members.id LIMIT 1) AS id_perusahaan
'),
DB::raw('
(Select services.name FROM services
@@ -451,6 +456,27 @@ class RequestLogController extends Controller
$data['logoPerusahaan'] = $logoPerusahaan;
$signatureDr = DB::table('signatures')
->leftJoin('corporate_manager', 'corporate_manager.user_id', '=', 'signatures.user_id')
->leftJoin('files', 'files.fileable_id', '=', 'signatures.id')
->where('files.fileable_type', '=', 'App\Models\Signature')
->where('signatures.type', '=', 1)
->where('corporate_manager.corporate_id', '=', $dataMember->id_perusahaan)
->select('files.path')
->first();
$data['signatureDr'] = $signatureDr;
$signatureAd = DB::table('signatures')
->leftJoin('files', 'files.fileable_id', '=', 'signatures.id')
->where('files.fileable_type', '=', 'App\Models\Signature')
->where('signatures.type', '=', 2)
->where('signatures.user_id', '=', $dataRequestLog->approved_by)
->select('files.path')
->first();
$data['signatureAd'] = $signatureAd;
$pdf = new Dompdf();
$options = new Options();
@@ -508,6 +534,11 @@ class RequestLogController extends Controller
LEFT JOIN corporate_employees ON corporate_employees.corporate_id = corporates.id
WHERE corporate_employees.member_id = members.id LIMIT 1) AS nama_perusahaan
'),
DB::raw('
(Select corporates.id FROM corporates
LEFT JOIN corporate_employees ON corporate_employees.corporate_id = corporates.id
WHERE corporate_employees.member_id = members.id LIMIT 1) AS id_perusahaan
'),
DB::raw('
(Select services.name FROM services
WHERE services.code = "'.$dataRequestLog->service_code.'" LIMIT 1) AS jenis_perwatan
@@ -591,6 +622,27 @@ class RequestLogController extends Controller
$data['logoPerusahaan'] = $logoPerusahaan;
$signatureDr = DB::table('signatures')
->leftJoin('corporate_manager', 'corporate_manager.user_id', '=', 'signatures.user_id')
->leftJoin('files', 'files.fileable_id', '=', 'signatures.id')
->where('files.fileable_type', '=', 'App\Models\Signature')
->where('signatures.type', '=', 1)
->where('corporate_manager.corporate_id', '=', $dataMember->id_perusahaan)
->select('files.path')
->first();
$data['signatureDr'] = $signatureDr;
$signatureAd = DB::table('signatures')
->leftJoin('files', 'files.fileable_id', '=', 'signatures.id')
->where('files.fileable_type', '=', 'App\Models\Signature')
->where('signatures.type', '=', 2)
->where('signatures.user_id', '=', $dataRequestLog->approved_by)
->select('files.path')
->first();
$data['signatureAd'] = $signatureAd;
$pdf = new Dompdf();
$options = new Options();

View File

@@ -0,0 +1,35 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('signatures', function (Blueprint $table) {
$table->id();
$table->bigInteger('user_id');
$table->integer('type')->nullable()->comment('1=Offsite Medical Treatment, 2=Customer Service Team');
$table->bigInteger('created_by')->nullable();
$table->bigInteger('updated_by')->nullable();
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('signatures');
}
};

View File

@@ -158,6 +158,12 @@
left: 10px;
text-align: left;
}
.bottom-left-ttd-2-<?php echo now()->timestamp; ?> {
color: #000000;
bottom: 225px;
left: 30px;
text-align: left;
}
.bottom-right-ttd-<?php echo now()->timestamp; ?> {
color: #000000;
bottom: 200px;
@@ -171,6 +177,12 @@
right: 10px;
text-align: left;
}
.bottom-right-ttd-2-<?php echo now()->timestamp; ?> {
color: #000000;
bottom: 225px;
right: 30px;
text-align: left;
}
.bottom-left1-ttd-<?php echo now()->timestamp; ?> {
color: #000000;
bottom: 100px;
@@ -251,6 +263,14 @@
Hormat Kami,<br>
{{ $dataMember->nama_perusahaan }}
</div>
<div class="corner-text-<?php echo now()->timestamp; ?> bottom-left-ttd-2-<?php echo now()->timestamp; ?> ">
@php
if(!empty($signatureDr->path)) {
$imgSrc = 'data:image/png;base64,' . base64_encode(file_get_contents(storage_path('app/public/' . $signatureDr->path)));
echo '<img style="width: 65px; height: 48px;" src="' . $imgSrc . '">';
}
@endphp
</div>
<div class="corner-text-<?php echo now()->timestamp; ?> bottom-left-ttd-<?php echo now()->timestamp; ?> ">
@php
if (!empty($logoPerusahaan->code) === 'VALEIND') {
@@ -269,6 +289,14 @@
{{ \Carbon\Carbon::parse(now())->format('d M Y') }},<br>
Petugas Alarm Center
</div>
<div class="corner-text-<?php echo now()->timestamp; ?> bottom-right-ttd-2-<?php echo now()->timestamp; ?> ">
@php
if(!empty($signatureAd->path)) {
$imgSrc = 'data:image/png;base64,' . base64_encode(file_get_contents(storage_path('app/public/' . $signatureAd->path)));
echo '<img style="width: 65px; height: 48px;" src="' . $imgSrc . '">';
}
@endphp
</div>
<div class="corner-text-<?php echo now()->timestamp; ?> bottom-right-ttd-<?php echo now()->timestamp; ?> ">
(.......................................)<br>
<b>Customer Service Team</b>

View File

@@ -158,6 +158,12 @@
left: 10px;
text-align: left;
}
.bottom-left-ttd-2-<?php echo now()->timestamp; ?> {
color: #000000;
bottom: 225px;
left: 30px;
text-align: left;
}
.bottom-right-ttd-<?php echo now()->timestamp; ?> {
color: #000000;
bottom: 200px;
@@ -172,6 +178,13 @@
text-align: left;
}
.bottom-right-ttd-2-<?php echo now()->timestamp; ?> {
color: #000000;
bottom: 225px;
right: 30px;
text-align: left;
}
.bottom-right1-ttd-<?php echo now()->timestamp; ?> {
color: #000000;
bottom: 100px;
@@ -416,6 +429,14 @@
Hormat Kami,<br>
{{ $dataMember->nama_perusahaan }}
</div>
<div class="corner-text-<?php echo now()->timestamp; ?> bottom-left-ttd-2-<?php echo now()->timestamp; ?> ">
@php
if(!empty($signatureDr->path)) {
$imgSrc = 'data:image/png;base64,' . base64_encode(file_get_contents(storage_path('app/public/' . $signatureDr->path)));
echo '<img style="width: 65px; height: 48px;" src="' . $imgSrc . '">';
}
@endphp
</div>
<div class="corner-text-<?php echo now()->timestamp; ?> bottom-left-ttd-<?php echo now()->timestamp; ?> ">
@php
if (!empty($logoPerusahaan->code) === 'VALEIND') {
@@ -434,6 +455,14 @@
{{ \Carbon\Carbon::parse(now())->format('d M Y') }},<br>
Petugas Alarm Center
</div>
<div class="corner-text-<?php echo now()->timestamp; ?> bottom-right-ttd-2-<?php echo now()->timestamp; ?> ">
@php
if(!empty($signatureAd->path)) {
$imgSrc = 'data:image/png;base64,' . base64_encode(file_get_contents(storage_path('app/public/' . $signatureAd->path)));
echo '<img style="width: 65px; height: 48px;" src="' . $imgSrc . '">';
}
@endphp
</div>
<div class="corner-text-<?php echo now()->timestamp; ?> bottom-right-ttd-<?php echo now()->timestamp; ?> ">
(.......................................)<br>
<b>Customer Service Team</b>