modified assests

This commit is contained in:
2026-06-15 11:25:16 +07:00
parent 3f115866d9
commit e96d58dcb4
1218 changed files with 1162 additions and 339502 deletions

View File

@@ -1,16 +1,7 @@
<!DOCTYPE html>
<html lang="{{ str_replace('_', '-', app()->getLocale()) }}">
<head>
@include('layout.header')
<style>
.item-config {
background: #feffff;
border-radius: 8px;
border: 1px solid #e1edfc;
}
</style>
</head>
<body>
<div class="row" id="x" style="display: none;">
@@ -33,730 +24,281 @@
<div class="content-wrapper">
<div class="row">
<div class="col-md-12 grid-margin stretch-card">
<div class="card">
<div class="card" style="min-height: 80vh;">
<div class="card-body">
<h4 class="card-title"><i class="mdi mdi-dots-vertical menu-icon"></i> {{__('general.laboratory_settings')}}</h4>
<div class="col-sm-12">
<h6 class="text-muted"><span class="mdi mdi-square-rounded text-muted"></span> {{__('general.general_settings')}}</h6>
<div class="row">
<div class="col-sm-6 p-2">
<div class="col-sm-12 py-3 item-config">
<p class="font-weight-bold mb-3">{{__('lab_profile.sample_numner_conf')}}
@if(\App\Http\Controllers\Helper\GlobalController::user_can(Auth::user()->role_id, ['update_laboratory_information']))
<button type="button" class="btn btn-xs btn-light rounded-25 text-info float-right" style="font-size: 12px !important; padding: 5px;" onclick="toggleElements('.sample-number-mode-setter','.sample-number-mode-getter')"><i class="fa fa-gear text-muted"></i> {{__('lab_profile.btn_change')}}</button>
@endif
</p>
<div class="sample-number-mode-getter">
<label class="badge badge-outline-secondary rounded-25">{{$info->sample_number==0? __('lab_profile.manual') :__('lab_profile.system_generate')}}</label>
</div>
<div class="sample-number-mode-setter" style="display: none">
<div class="form-check col-sm-9">
<label class="form-check-label">
<input type="radio" class="form-check-input" {{$info->sample_number==0? 'checked':''}} data-id="0" name="sample_number"> {{__('lab_profile.manual')}}
<i class="input-helper"></i></label>
</div>
<div class="form-check col-sm-9">
<label class="form-check-label">
<input type="radio" class="form-check-input" {{$info->sample_number==1? 'checked':''}} data-id="1" name="sample_number"> {{__('lab_profile.system_generate')}}
<i class="input-helper"></i></label>
</div>
<button class="btn btn-xs btn-inverse-info rounded-25 px-3" type="button" style="font-size: 12px; padding: 5px" onclick="postLabSettingSetter()"><i class="fa fa-save"></i> {{__('lab_profile.btn_save')}} </button>
</div>
</div>
</div>
<div class="col-sm-6 p-2">
<div class="col-sm-12 py-3 item-config">
<p class="font-weight-bold mb-3">{{__('lab_profile.patient_numner_conf')}}
@if(\App\Http\Controllers\Helper\GlobalController::user_can(Auth::user()->role_id, ['update_laboratory_information']))
<button type="button" class="btn btn-xs btn-light rounded-25 text-info float-right" style="font-size: 12px !important; padding: 5px;" onclick="toggleElements('.patient-number-mode-setter','.patient-number-mode-getter')"><i class="fa fa-gear text-muted"></i> {{__('lab_profile.btn_change')}}</button>
@endif
</p>
<div class="patient-number-mode-getter">
<label class="badge badge-outline-secondary rounded-25">{{$info->patient_code==0? __('lab_profile.manual'):__('lab_profile.system_generate')}}</label>
</div>
<div class="patient-number-mode-setter" style="display: none">
<div class="form-check col-sm-12">
<label class="form-check-label">
<input type="radio" class="form-check-input" {{$info->patient_code==0? 'checked':''}} data-id="0" name="patient_number"> {{__('lab_profile.manual')}}
<i class="input-helper"></i></label>
</div>
<div class="form-check col-sm-12">
<label class="form-check-label">
<input type="radio" class="form-check-input" {{$info->patient_code==1? 'checked':''}} data-id="1" name="patient_number"> {{__('lab_profile.system_generate')}}
<i class="input-helper"></i></label>
</div>
<button class="btn btn-xs btn-inverse-info rounded-25 px-3" type="button" style="font-size: 12px; padding: 5px" onclick="postLabSettingSetter()"><i class="fa fa-save"></i> {{__('lab_profile.btn_save')}} </button>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-sm-6 p-2">
<div class="col-sm-12 py-3 item-config">
<p class="font-weight-bold mb-3">{{__('lab_profile.based_currency')}}
@if(\App\Http\Controllers\Helper\GlobalController::user_can(Auth::user()->role_id, ['update_laboratory_information']))
<button type="button" class="btn btn-xs btn-light rounded-25 text-info float-right" style="font-size: 12px !important; padding: 5px;" onclick="toggleElements('.base-currency-mode-setter','.base-currency-mode-getter')"><i class="fa fa-gear text-muted"></i> {{__('lab_profile.btn_change')}}</button>
@endif
</p>
<div class="base-currency-mode-getter">
<label class="badge badge-outline-secondary rounded-25">{{$info->currency==0? __('USD ($)') :__('Riel (៛)')}}</label>
</div>
<div class="base-currency-mode-setter" style="display: none">
<div class="form-check col-sm-3">
<label class="form-check-label">
<input type="radio" class="form-check-input" {{$info->currency==0? 'checked':''}} data-id="0" name="currency"> {{__('USD ($)')}}
<i class="input-helper"></i></label>
</div>
<div class="form-check col-sm-9">
<label class="form-check-label">
<input type="radio" class="form-check-input" {{$info->currency==1? 'checked':''}} data-id="1" name="currency"> {{__('Riel (៛)')}}
<i class="input-helper"></i></label>
</div>
<button class="btn btn-xs btn-inverse-info rounded-25 px-3" type="button" style="font-size: 12px; padding: 5px" onclick="postLabSettingSetter()"><i class="fa fa-save"></i> {{__('lab_profile.btn_save')}} </button>
</div>
</div>
</div>
<div class="col-sm-6 p-2">
<div class="col-sm-12 py-3 item-config">
<p class="font-weight-bold mb-3">{{__('lab_profile.type_of_discount_conf')}}
@if(\App\Http\Controllers\Helper\GlobalController::user_can(Auth::user()->role_id, ['update_laboratory_information']))
<button type="button" class="btn btn-xs btn-light rounded-25 text-info float-right" style="font-size: 12px !important; padding: 5px;" onclick="toggleElements('.discount-type-setter','.discount-type-getter')"><i class="fa fa-gear text-muted"></i> {{__('lab_profile.btn_change')}}</button>
@endif
</p>
<div class="discount-type-getter">
<label class="badge badge-outline-secondary rounded-25">{{$info->discount_type == 1 ? '(%) '.__('lab_profile.percentage'):'($) '.__('lab_profile.price')}}</label>
</div>
<div class="discount-type-setter" style="display: none">
<div class="form-check col-sm-3">
<label class="form-check-label">
<input type="radio" class="form-check-input" {{$info->discount_type==1? 'checked':''}} data-id="1" name="discount_type"> (%) {{__('lab_profile.percentage')}}
<i class="input-helper"></i></label>
</div>
<div class="form-check col-sm-9">
<label class="form-check-label">
<input type="radio" class="form-check-input" {{$info->discount_type==2? 'checked':''}} data-id="2" name="discount_type"> ($) {{__('lab_profile.price')}}
<i class="input-helper"></i></label>
</div>
<button class="btn btn-xs btn-inverse-info rounded-25 px-3" type="button" style="font-size: 12px; padding: 5px" onclick="postLabSettingSetter()"><i class="fa fa-save"></i> {{__('lab_profile.btn_save')}} </button>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-sm-6 p-2">
<div class="col-sm-12 py-3 item-config">
<p class="font-weight-bold mb-3">{{__('lab_profile.exchange_rate')}}
@if(\App\Http\Controllers\Helper\GlobalController::user_can(Auth::user()->role_id, ['update_laboratory_information']))
<button type="button" class="btn btn-xs btn-light rounded-25 text-info float-right" style="font-size: 12px !important; padding: 5px;" onclick="toggleElements('.exchange-rate-setter','.exchange-rate-getter')"><i class="fa fa-gear text-muted"></i> {{__('lab_profile.btn_change')}}</button>
@endif
</p>
<div class="exchange-rate-getter">
<label class="badge badge-outline-secondary rounded-25">1 USD = {{$info->exchange_rate}} </label>
</div>
<div class="exchange-rate-setter" style="display: none">
<h4 class="card-title"><i class="mdi text-info mdi-apps"></i> {{__('laboratory.table_title')}}</h4>
<div class="row">
<div class="col-sm-12">
<form method="get" action="{{url('laboratory/search')}}">
<div class="row">
<div class="col-xs-12 col-sm-12 col-md-8 col-lg-8">
<div class="input-group">
<input type="number" class="form-control rounded-right-0 form-control-sm" id="exchange-rate" value="{{$info->exchange_rate}}" placeholder="{{__('Exchange Rate')}}">
<input type="text" class="form-control form-control-md rounded-left-25 rounded-right-0" value="{{isset($_GET['kword']) ? $_GET['kword'] : ''}}" name="kword" id="kword" placeholder="{{__('laboratory.search_placeholder')}}">
<div class="input-group-append">
<button class="btn btn-xs btn-inverse-info px-3" type="button" style="font-size: 12px; padding: 5px" onclick="postLabSettingSetter()"><i class="fa fa-save"></i> {{__('lab_profile.btn_save')}} </button>
<button class="btn btn-md btn-inverse-secondary rounded-right-25 px-3" type="submit"><i class="fa fa-search"></i>&nbsp;{{__('general.btn_search')}}</button>
<button class="btn btn-md btn-inverse-success waves-effect rounded-25 px-4 ml-3" type="button" data-action="new" data-toggle="modal" data-target="#modal-laboratory" data-backdrop="static"><i class="typcn typcn-plus"></i> {{__('general.btn_add_new')}}</button>
</div>
</div>
</div>
</div>
</div>
<div class="col-sm-6 p-2">
<div class="col-sm-12 py-3 item-config">
<p class="font-weight-bold mb-3">{{__('sidebar.invoice')}}
@if(\App\Http\Controllers\Helper\GlobalController::user_can(Auth::user()->role_id, ['update_laboratory_information']))
<button type="button" class="btn btn-xs btn-light rounded-25 text-info float-right" style="font-size: 12px !important; padding: 5px;" onclick="toggleElements('.invoice-template-mode-setter','.invoice-template-mode-getter')"><i class="fa fa-gear text-muted"></i> {{__('lab_profile.btn_change')}}</button>
@endif
</p>
<div class="invoice-template-mode-getter">
<label class="badge badge-outline-secondary rounded-25"> {{$info->is_auto_make_invoice==0? __('lab_profile.manual'):__('lab_profile.system_generate')}}</label>
<label class="badge badge-outline-secondary rounded-25"> {{$info->invoice_template_id==1? __('lab_profile.invoice_detail'): ($info->invoice_template_id==2 ? __('lab_profile.invoice_summary') : ($info->invoice_template_id==3 ? __('lab_profile.detail_with_panel') : ''))}}</label>
</div>
<div class="invoice-template-mode-setter" style="display: none">
<p class="text-muted">{{__('invoice.form_btn_generate_invoice')}}</p>
<div class="form-check col-sm-12">
<label class="form-check-label">
<input type="radio" class="form-check-input" {{$info->is_auto_make_invoice==0? 'checked':''}} data-id="0" name="is_auto_make_invoice"> {{__('lab_profile.manual')}}
<i class="input-helper"></i></label>
</div>
<div class="form-check col-sm-12">
<label class="form-check-label">
<input type="radio" class="form-check-input" {{$info->is_auto_make_invoice==1? 'checked':''}} data-id="1" name="is_auto_make_invoice"> {{__('lab_profile.system_generate')}}
<i class="input-helper"></i></label>
</div>
<p class="text-muted">{{__('lab_profile.invoice_template')}}</p>
<div class="form-check col-sm-12">
<label class="form-check-label">
<input type="radio" class="form-check-input" {{$info->invoice_template_id==1? 'checked':''}} data-id="1" name="invoice_template_id"> {{__('lab_profile.invoice_detail')}}
<i class="input-helper"></i></label>
</div>
<div class="form-check col-sm-12">
<label class="form-check-label">
<input type="radio" class="form-check-input" {{$info->invoice_template_id==3? 'checked':''}} data-id="3" name="invoice_template_id"> {{__('lab_profile.detail_with_panel')}}
<i class="input-helper"></i></label>
</div>
<div class="form-check col-sm-12">
<label class="form-check-label">
<input type="radio" class="form-check-input" {{$info->invoice_template_id==2? 'checked':''}} data-id="2" name="invoice_template_id"> {{__('lab_profile.invoice_summary')}}
<i class="input-helper"></i></label>
</div>
<button class="btn btn-xs btn-inverse-info rounded-25 px-3" type="button" style="font-size: 12px; padding: 5px" onclick="postLabSettingSetter()"><i class="fa fa-save"></i> {{__('lab_profile.btn_save')}} </button>
</div>
</div>
</div>
</div>
<h6 class="mt-3 text-muted"><span class="mdi mdi-square-rounded text-muted"></span> {{__('general.result_settings')}}</h6>
@php
$configures = collect($info->labConfigures);
$fontNameHeader = ($configures->where('atrribute_code', 'FONT_NAME_FOR_RESULT_HEADER')->pluck('assigned_attribute_value')->first());
$fontSizeHeader = ($configures->where('atrribute_code', 'FONT_SIZE_FOR_RESULT_HEADER')->pluck('assigned_attribute_value')->first());
$resultColorHeader = ($configures->where('atrribute_code', 'COLOR_FOR_RESULT_HEADER')->pluck('assigned_attribute_value')->first());
$fontName = ($configures->where('atrribute_code', 'FONT_NAME_FOR_RESULT')->pluck('assigned_attribute_value')->first());
$fontSize = ($configures->where('atrribute_code', 'FONT_SIZE_FOR_RESULT')->pluck('assigned_attribute_value')->first());
$resultColor = ($configures->where('atrribute_code', 'COLOR_FOR_RESULT')->pluck('assigned_attribute_value')->first());
$lineHeight = ($configures->where('atrribute_code', 'LINE_HEIGHT_FOR_RESULT_HEADER')->pluck('assigned_attribute_value')->first());
$resultTemplateId = ($configures->where('atrribute_code', 'RESULT_TEMPLATE')->pluck('assigned_attribute_value')->first());
@endphp
<div class="row">
<div class="col-sm-6 p-2">
<div class="col-sm-12 py-3 item-config">
<p class="font-weight-bold mb-3">{{__('lab_profile.header_font_name')}}
@if(\App\Http\Controllers\Helper\GlobalController::user_can(Auth::user()->role_id, ['update_laboratory_information']))
<button type="button" class="btn btn-xs btn-light rounded-25 text-info float-right" style="font-size: 12px !important; padding: 5px;" onclick="toggleElements('.header-font-name-mode-setter','.header-font-name-mode-getter')"><i class="fa fa-gear text-muted"></i> {{__('lab_profile.btn_change')}}</button>
@endif
</p>
<div class="header-font-name-mode-getter">
<label class="badge badge-outline-secondary rounded-25">{{$fontNameHeader}}</label>
</div>
<div class="header-font-name-mode-setter" style="display: none">
<div class="input-group ml-1">
<select class="form-control form-control-sm rounded-right-0" id="result-font-name-header">
<option {{$fontNameHeader=='Times New Roman'?'selected' : ''}} value="Times New Roman">Times New Roman</option>
<option {{$fontNameHeader=='Nimbus Mono'?'selected' : ''}} value="Nimbus Mono">Nimbus Mono</option>
<option {{$fontNameHeader=='Calibri'?'selected' : ''}} value="Calibri">Calibri</option>
<option {{$fontNameHeader=='Courier New'?'selected' : ''}} value="Courier New">Courier New</option>
</select>
<div class="input-group-append">
<button class="btn btn-xs btn-inverse-info px-3" type="button" style="font-size: 12px; padding: 5px" onclick="postLabConfigure('FONT_NAME_FOR_RESULT_HEADER', $('#result-font-name-header').val())"><i class="fa fa-save"></i> {{__('lab_profile.btn_save')}}</button>
</div>
</div>
</div>
</div>
</div>
<div class="col-sm-6 p-2">
<div class="col-sm-12 py-3 item-config">
<p class="font-weight-bold mb-3">{{__('lab_profile.header_font_size')}}
@if(\App\Http\Controllers\Helper\GlobalController::user_can(Auth::user()->role_id, ['update_laboratory_information']))
<button type="button" class="btn btn-xs btn-light rounded-25 text-info float-right" style="font-size: 12px !important; padding: 5px;" onclick="toggleElements('.header-font-size-mode-setter','.header-font-size-mode-getter')"><i class="fa fa-gear text-muted"></i> {{__('lab_profile.btn_change')}}</button>
@endif
</p>
<div class="header-font-size-mode-getter">
<label class="badge badge-outline-secondary rounded-25">{{$fontSizeHeader}}</label>
</div>
<div class="header-font-size-mode-setter" style="display: none">
<div class="input-group ml-1">
<select class="form-control form-control-sm rounded-right-0" id="result-font-size-header">
<option {{$fontSizeHeader=='8.5pt' ? 'selected':''}} value="8.5pt">8.5pt</option>
<option {{$fontSizeHeader=='9pt' ? 'selected':''}} value="9pt">9pt</option>
<option {{$fontSizeHeader=='10pt' ? 'selected':''}} value="10pt">10pt</option>
<option {{$fontSizeHeader=='11pt' ? 'selected':''}} value="11pt">11pt</option>
<option {{$fontSizeHeader=='12pt' ? 'selected':''}} value="12pt">12pt</option>
<option {{$fontSizeHeader=='13pt' ? 'selected':''}} value="13pt">13pt</option>
<option {{$fontSizeHeader=='14pt' ? 'selected':''}} value="14pt">14pt</option>
<option {{$fontSizeHeader=='15pt' ? 'selected':''}} value="15pt">15pt</option>
</select>
<div class="input-group-append">
<button class="btn btn-xs btn-inverse-info px-3" type="button" style="font-size: 12px; padding: 5px" onclick="postLabConfigure('FONT_SIZE_FOR_RESULT_HEADER', $('#result-font-size-header').val())"><i class="fa fa-save"></i> {{__('lab_profile.btn_save')}}</button>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-sm-6 p-2">
<div class="col-sm-12 py-3 item-config">
<p class="font-weight-bold mb-3">{{__('lab_profile.body_font_name')}}
@if(\App\Http\Controllers\Helper\GlobalController::user_can(Auth::user()->role_id, ['update_laboratory_information']))
<button type="button" class="btn btn-xs btn-light rounded-25 text-info float-right" style="font-size: 12px !important; padding: 5px;" onclick="toggleElements('.body-font-name-mode-setter','.body-font-name-mode-getter')"><i class="fa fa-gear text-muted"></i> {{__('lab_profile.btn_change')}}</button>
@endif
</p>
<div class="body-font-name-mode-getter">
<label class="badge badge-outline-secondary rounded-25">{{$fontName}}</label>
</div>
<div class="body-font-name-mode-setter" style="display: none">
<div class="input-group ml-1">
<select class="form-control form-control-sm rounded-right-0" id="result-font-name">
<option {{$fontName=='Times New Roman'?'selected' : ''}} value="Times New Roman">Times New Roman</option>
<option {{$fontName=='Nimbus Mono'?'selected' : ''}} value="Nimbus Mono">Nimbus Mono</option>
<option {{$fontName=='Calibri'?'selected' : ''}} value="Calibri">Calibri</option>
<option {{$fontName=='Courier New'?'selected' : ''}} value="Courier New">Courier New</option>
</select>
<div class="input-group-append">
<button class="btn btn-xs btn-inverse-info px-3" type="button" style="font-size: 12px; padding: 5px" onclick="postLabConfigure('FONT_NAME_FOR_RESULT', $('#result-font-name').val())"><i class="fa fa-save"></i> {{__('lab_profile.btn_save')}}</button>
</div>
</div>
</div>
</div>
</div>
<div class="col-sm-6 p-2">
<div class="col-sm-12 py-3 item-config">
<p class="font-weight-bold mb-3">{{__('lab_profile.body_font_size')}}
@if(\App\Http\Controllers\Helper\GlobalController::user_can(Auth::user()->role_id, ['update_laboratory_information']))
<button type="button" class="btn btn-xs btn-light rounded-25 text-info float-right" style="font-size: 12px !important; padding: 5px;" onclick="toggleElements('.body-font-size-mode-setter','.body-font-size-mode-getter')"><i class="fa fa-gear text-muted"></i> {{__('lab_profile.btn_change')}}</button>
@endif
</p>
<div class="body-font-size-mode-getter">
<label class="badge badge-outline-secondary rounded-25">{{$fontSize}}</label>
</div>
<div class="body-font-size-mode-setter" style="display: none">
<div class="input-group ml-1">
<select class="form-control form-control-sm rounded-right-0" id="result-font-size">
<option {{$fontSize=='8.5pt' ? 'selected':''}} value="8.5pt">8.5pt</option>
<option {{$fontSize=='9pt' ? 'selected':''}} value="9pt">9pt</option>
<option {{$fontSize=='10pt' ? 'selected':''}} value="10pt">10pt</option>
<option {{$fontSize=='11pt' ? 'selected':''}} value="11pt">11pt</option>
<option {{$fontSize=='12pt' ? 'selected':''}} value="12pt">12pt</option>
<option {{$fontSize=='13pt' ? 'selected':''}} value="13pt">13pt</option>
<option {{$fontSize=='14pt' ? 'selected':''}} value="14pt">14pt</option>
<option {{$fontSize=='15pt' ? 'selected':''}} value="15pt">15pt</option>
</select>
<div class="input-group-append">
<button class="btn btn-xs btn-inverse-info px-3" type="button" style="font-size: 12px; padding: 5px" onclick="postLabConfigure('FONT_SIZE_FOR_RESULT', $('#result-font-size').val())"><i class="fa fa-save"></i> {{__('lab_profile.btn_save')}}</button>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-sm-6 p-2">
<div class="col-sm-12 py-3 item-config">
<p class="font-weight-bold mb-3">{{__('lab_profile.abnormal_result')}}
@if(\App\Http\Controllers\Helper\GlobalController::user_can(Auth::user()->role_id, ['update_laboratory_information']))
<button type="button" class="btn btn-xs btn-light rounded-25 text-info float-right" style="font-size: 12px !important; padding: 5px;" onclick="toggleElements('.abr-font-weight-mode-setter','.abr-font-weight-mode-getter')"><i class="fa fa-gear text-muted"></i> {{__('lab_profile.btn_change')}}</button>
@endif
</p>
<div class="abr-font-weight-mode-getter">
<label class="badge badge-outline-secondary rounded-25">{{$info->abnormal_result_font_weight == 1 ? __('lab_profile.font_bold') : __('lab_profile.font_normal') }}</label>
<label class="badge badge-outline-secondary rounded-25"><span class="rounded-25" style="width: 50px; height: 10px; background: {{$info->abnormal_text_color}}; float: left;"></span>.</label>
</div>
<div class="abr-font-weight-mode-setter" style="display: none">
<p>{{__('lab_profile.font_weight')}}</p>
<div class="form-check form-check-primary d-flex ml-1">
<label class="form-check-label ">
<input onclick="postLabSettingSetter()" {{$info->abnormal_result_font_weight==1 ? 'checked':''}} type="radio" class="checkbox" data-id="1" value="1" name="abnormal_result_font_weight" id="font-weight-bold"> {{__('lab_profile.font_bold')}}
</label>
</div>
<div class="form-check form-check-primary d-flex ml-1">
<label class="form-check-label">
<input onclick="postLabSettingSetter()" {{$info->abnormal_result_font_weight==0 ? 'checked':''}} type="radio" class="checkbox" data-id="0" value="0" name="abnormal_result_font_weight" id="font-weight-normal"> {{__('lab_profile.font_normal')}}
</label>
</div>
<p>{{__('lab_profile.text_color')}}</p>
<div class="input-group ml-1">
<input type="color" id="abnormal-text-color" class="rounded-right-0 form-control form-control-sm p-0" value="{{$info->abnormal_text_color}}">
<div class="input-group-append">
<button onclick="postLabSettingSetter()" type="button" class="btn btn-xs btn-inverse-info px-3" style="font-size: 12px; padding: 5px"><i class="fa fa-save"></i> {{__('lab_profile.btn_save')}}</button>
</div>
</div>
</div>
</div>
</div>
<div class="col-sm-6 p-2">
<div class="col-sm-12 py-3 item-config">
<p class="font-weight-bold mb-3">{{__('lab_profile.verify_label')}}
@if(\App\Http\Controllers\Helper\GlobalController::user_can(Auth::user()->role_id, ['update_laboratory_information']))
<button type="button" class="btn btn-xs btn-light rounded-25 text-info float-right" style="font-size: 12px !important; padding: 5px;" onclick="toggleElements('.verify-label-mode-setter','.verify-label-mode-getter')"><i class="fa fa-gear text-muted"></i> {{__('lab_profile.btn_change')}}</button>
@endif
</p>
<div class="verify-label-mode-getter">
<img style="height: 33px !important;" src="{{!empty($info->verify_label) ? url(env("APP_URL").'storage/images/avatars/labs/'.$info->verify_label) :''}}">
</div>
<div class="verify-label-mode-setter" style="display: none">
<form id="verify-image-upload-form" method="POST" enctype="multipart/form-data">
@csrf
<div class="center_">
<div class="form-input">
<div class="preview" style="width: 120px;">
<img id="verify-image-preview" src="{{!empty($info->verify_label) ? url(env("APP_URL").'storage/images/avatars/labs/'.$info->verify_label) :''}}">
</form> <hr class="my-3 d-none">
<div class="col-sm-12 p-0 mb-1 mt-3">
<div class="table-responsive">
<table class="table table-bordered table-striped table-hover" id="lab_dt">
<thead>
<tr class="bg-gradient-light">
<th class="py-2" width="50px">{{__('laboratory.table_no')}}</th>
<th class="py-2 text-center" width="100px">{{__('laboratory.table_action')}}</th>
<th class="py-2">{{__('laboratory.table_name_en')}}</th>
<th class="py-2">{{__('laboratory.table_name_kh')}}</th>
<th class="py-2">{{__('lab_profile.short_name')}}</th>
<th class="py-2 text-center">{{__('lab_profile.sample_numner_conf')}}</th>
<th class="py-2 text-center">{{__('lab_profile.patient_numner_conf')}}</th>
<th class="py-2 text-center" width="100px">{{__('laboratory.table_status')}}</th>
</tr>
</thead>
<tbody>
@foreach($laboratories as $k=>$laboratory)
<tr>
<td class="py-1 text-center">{{($k+1) + (($_GET['page'] ?? 1) * 20) - 20}}</td>
<td class="text-center py-1">
<div class="btn-group" role="group" aria-label="Basic example" >
<button type="button" class="btn btn-sm btn-inverse-primary mr-2" title="Edit" data-action="edit" data-labid="{{$laboratory->id}}" data-toggle="modal" data-target="#modal-laboratory" data-backdrop="static"><i class="typcn typcn-edit"></i></button>
@if($laboratory->record_status_id==0)
<button type="button" class="btn btn-sm btn-inverse-primary" title="Restore" onclick="restore_lab({{$laboratory->id}})"><i class="typcn typcn-plus"></i></button>
@else
<button type="button" class="btn btn-sm btn-inverse-danger " title="Delete" onclick="delete_lab({{$laboratory->id}})"><i class="mdi mdi-close-circle"></i></button>
@endif
</div>
@if(\App\Http\Controllers\Helper\GlobalController::user_can(Auth::user()->role_id, ['update_laboratory_information']))
<label for="verify-image" class="rounded btn-light">
<i class="mdi mdi-image-filter"></i> <span style="font-size: 12px">{{__('physician.form_logo_upload')}}</span>
</label>
<button type="button" id="btn-remove-verify-label" class="btn btn-xs btn-danger ml-2" style="padding: 2px !important; margin-top: -3px !important;"><i class="mdi mdi-close-circle"></i></button>
@endif
<input type="file" name="image" id="verify-image" accept="image/*" onchange="showPreviewVerifyImage(event);">
</div>
</div>
</form>
</div>
</td>
<td class="py-1">{{$laboratory->name_en}}</td>
<td class="py-1">{{$laboratory->name_kh}}</td>
<td class="py-1">{{$laboratory->short_name}}</td>
<td class="text-center py-1">
<label class="badge badge-success">
{{$laboratory->sample_number == 1 ? __('lab_profile.system_generate') : __('lab_profile.manual')}}
</label>
</td>
<td class="text-center py-1">
<label class="badge badge-success">
{{$laboratory->patient_code == 1 ? __('lab_profile.system_generate') : __('lab_profile.manual')}}
</label>
</td>
<td class="py-1 text-center">
<i class="mdi {{$laboratory->record_status_id == 1 ? 'mdi-check-circle text-primary' : 'mdi-checkbox-blank-circle-outline'}}"></i>
</td>
</tr>
@endforeach
</tbody>
</table>
</div>
</div>
<div class="float-right mt-3">
{!! $laboratories->links('pagination.custom') !!}
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<!-- Modal Laboratory -->
<div class="modal mt-5 fade modal-primary" id="modal-laboratory">
<div class="modal-dialog modal-xl">
<div class="modal-content">
<div class="modal-header">
<h6 class="modal-title">{{__('_')}}</h6>
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true" class="mdi mdi-close"></span></button>
</div>
<div class="modal-body">
<form method="post" action="#" id="form" onkeydown="return event.key != 'Enter';">
@csrf
<input type="hidden" class="form-control" name="lab_id" id="lab-id" value="0" />
<div class="form-vertical">
<div class="row">
<div class="col-sm-6">
<div class="form-group mb-1">
<label for="lab-name-en">{{__('laboratory.table_name_en')}} <span class="text-danger">*</span></label>
<input type="text" class="form-control form-control-sm" name="lab_name_en" id="lab-name-en" placeholder="{{__('laboratory.table_name_en')}}">
</div>
<div class="form-group mb-1">
<label for="lab-name-kh">{{__('laboratory.table_name_kh')}} </label>
<input type="text" class="form-control form-control-sm" name="lab_name_kh" id="lab-name-kh" placeholder="{{__('laboratory.table_name_kh')}}"/>
</div>
<div class="form-group mb-1">
<label for="lab-code" class="control-label">{{__('lab_profile.short_name')}}&nbsp;<span class="text-danger">*</span></label>
<input type="text" class="form-control form-control-sm" name="lab_code" id="lab-code" maxlength="5" placeholder="{{__('lab_profile.short_name')}}">
</div>
<div class="form-group mb-1">
<label for="lab-name-kh">{{__('patient.table_phon')}} </label>
<input type="text" class="form-control form-control-sm" name="phone_number" id="phone-number" placeholder="{{__('patient.table_phon')}}"/>
</div>
<div class="form-group mb-1">
<label for="lab-name-kh">{{__('lab_profile.emial')}} </label>
<input type="email" class="form-control form-control-sm" name="email" id="email" placeholder="{{__('lab_profile.emial')}}"/>
</div>
<div class="form-group mb-1">
<label for="lab-name-kh">{{__('Laboratory Type')}} </label>
<select name="lab_category_id" class="form-control form-control-sm" id="lab-category-id">
<option value="0">General Medical Laboratory</option>
<option value="1">Anapathology Laboratory</option>
</select>
</div>
<div class="form-group mb-1">
<label for="lab-name-kh">{{__('Fixed Comission Rate')}} </label>
<input type="number" class="form-control form-control-sm" name="is_hide_comission_percentage" id="is_hide_comission_percentage" value="0"/>
</div>
</div>
<div class="col-sm-6">
<div class="form-group mb-1">
<label for="address-en">{{__('laboratory.form_address_en')}}</label>
<input type="text" class="form-control form-control-sm" name="address_en" id="address-en" placeholder="{{__('laboratory.form_address_en')}}">
</div>
<div class="row form-group mb-1">
<div class="col-sm-12">
<label for="address-kh" class="control-label">{{__('laboratory.form_address_kh')}}</label>
<input type="text" class="form-control form-control-sm" name="address_kh" id="address-kh" placeholder="{{__('laboratory.form_address_kh')}}">
</div>
</div>
<div class="form-group mb-1">
<label for="lab-code" class="control-label">{{__('lab_profile.start_date') . ' & '.__('lab_profile.usage_period')}}&nbsp;</label>
<div class="input-group">
<input class="form-control form-control-sm" name="start_date" onfocus="(this.type='date')" onblur="(this.type='text')" id="start-date" placeholder="{{__('general.type_date_placeholder')}}">
<input class="form-control form-control-sm" onfocus="(this.type='date')" onblur="(this.type='text')" name="end_date" id="end-date" placeholder="{{__('general.type_date_placeholder')}}">
</div>
</div>
{{-- <div class="form-group mb-1">--}}
{{-- <label for="lab-code" class="control-label">{{__('lab_profile.start_date') }} <span class="text-danger">*</span></label>--}}
{{-- <input class="form-control form-control-sm" name="start_date" onfocus="(this.type='date')" onblur="(this.type='text')" id="start-date" placeholder="{{__('general.type_date_placeholder')}}">--}}
{{-- </div>--}}
{{-- <div class="form-group mb-1">--}}
{{-- <label for="lab-code" class="control-label">{{__('lab_profile.usage_period')}}&nbsp;</label>--}}
{{-- <input class="form-control form-control-sm" onfocus="(this.type='date')" onblur="(this.type='text')" name="end_date" id="end-date" placeholder="{{__('general.type_date_placeholder')}}">--}}
{{-- </div>--}}
<div class="form-group mb-1">
<label for="lab-name-en">{{__('lab_profile.sample_numner_conf')}} <span class="text-danger">*</span></label>
<div class="form-group pl-3">
<div class="row">
<div class="form-check col-sm-3">
<label class="form-check-label">
<input type="radio" class="form-check-input" name="sample_number" data-id="0" value="0"> {{__('lab_profile.manual')}}
</label>
</div>
<div class="form-check col-sm-9">
<label class="form-check-label">
<input type="radio" class="form-check-input" name="sample_number" checked data-id="1" value="1"> {{__('lab_profile.system_generate')}}
</label>
</div>
</div>
</div>
</div>
<div class="form-group mb-1">
<label for="lab-name-en">{{__('lab_profile.patient_numner_conf')}} <span class="text-danger">*</span></label>
<div class="form-group pl-3">
<div class="row">
<div class="form-check col-sm-3">
<label class="form-check-label">
<input type="radio" class="form-check-input" name="patient_number" data-id="0" value="0"> {{__('lab_profile.manual')}}
</label>
</div>
<div class="form-check col-sm-9">
<label class="form-check-label">
<input type="radio" class="form-check-input" name="patient_number" checked data-id="1" value="1"> {{__('lab_profile.system_generate')}}
</label>
</div>
</div>
</div>
</div>
<div class="form-group mb-0">
<label for="lab-name-en">{{__('Make Invoice')}} <span class="text-danger">*</span></label>
<div class="form-group pl-3">
<div class="row">
<div class="form-check col-sm-3">
<label class="form-check-label">
<input type="radio" class="form-check-input" name="is_auto_make_invoice" checked data-id="0" value="0"> {{__('lab_profile.manual')}}
</label>
</div>
<div class="form-check col-sm-9">
<label class="form-check-label">
<input type="radio" class="form-check-input" name="is_auto_make_invoice" data-id="1" value="1"> {{__('lab_profile.system_generate')}}
</label>
</div>
</div>
</div>
</div>
<div class="form-group mb-1">
<div class="row">
<div class="col-sm-6">
<div class="form-check form-check-flat form-check-primary mb-1 mt-1">
<div class="form-check form-check-primary">
<label class="form-check-label">
<input type="checkbox" class="checkbox" data-id="1" name="shareable_lab_result" id="shareable_lab_result"> {{__('Share Laboratory Result')}}
</label>
</div>
</div>
</div>
<div class="col-sm-6">
<div class="form-check form-check-flat form-check-primary mb-1 mt-1">
<div class="form-check form-check-primary">
<label class="form-check-label">
<input type="checkbox" class="checkbox" data-id="1" name="allow_external_request" id="allow_external_request"> {{__('Allow External Request Test')}}
</label>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</form>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-info" id="btnSave"><i class="fa fa-floppy-o"></i>&nbsp;&nbsp;<span class="save">{{__('lang.save')}}</span><span class="update" style="display: none">{{__('lang.update')}}</span></button>
<button type="button" class="btn btn-light" data-dismiss='modal'>{{__('lang.cancel')}}</button>
</div>
</div>
</div>
</div>
@include('layout.footer')
</div>
</div>
</div>
@include('layout.common_script')
</body>
<script src="{{url(env("APP_URL").'storage/assets/vendors/js/org.vendor.bundle.base.js')}}"></script>
<script>
var save_lab_url = "{{url('laboratory.save')}}";
var update_lab_url = "{{url('laboratory.update')}}";
var delete_lab_url = "{{url('laboratory.delete')}}";
var restore_lab_url = "{{url('laboratory.restore')}}";
var get_lab_url = "{{url('laboratory.get')}}";
let base_url = "{{url('laboratory-profile')}}";
let sample_number = "{{$info->sample_number}}";
let patient_code = "{{$info->patient_code}}";
let technician_label = "{{$info->technician_label}}";
let discount_type = "{{$info->discount_type}}";
let phone_number = "{{$info->phone_number}}";
let email = "{{$info->email}}";
let currency = "{{$info->currency}}";
let exchange_rate = "{{$info->exchange_rate}}";
let abnormal_text_color = "{{$info->abnormal_text_color}}";
let show_result_footer = "{{$info->show_result_footer}}";
let abnormal_result_font_weight = "{{$info->abnormal_result_font_weight}}";
let result_header_id = "{{$info->result_header_id}}";
let invoice_template_id = "{{$info->invoice_template_id}}";
let is_auto_make_invoice = "{{$info->is_auto_make_invoice}}";
function generateSlug(text) {
return text
.trim()
.split(/\s+/)
.slice(0, 3)
.map(word => word[0])
.join('')
.toUpperCase().padEnd(3, 'X');
}
function showPreview(event){
if(event.target.files.length > 0){
var src = URL.createObjectURL(event.target.files[0]);
var preview = document.getElementById("file-ip-1-preview");
preview.src = src;
preview.style.display = "block";
$('#image-upload-form').submit();
}
}
/* alternative logo start */
function showAlternativeLogo(event){
if(event.target.files.length > 0){
var src = URL.createObjectURL(event.target.files[0]);
var preview = document.getElementById("file-ip-2-preview");
preview.src = src;
preview.style.display = "block";
$('#alternative-logo-upload-form').submit();
}
}
$('#alternative-logo-upload-form').submit(function(e) {
e.preventDefault();
var formData = new FormData(this);
$.ajax({
url: '{{'laboratory-profile/alternative-logo/upload'}}',
type: 'POST',
data: formData,
processData: false,
contentType: false,
success:function(res){
handleMessage(res.success, res.message)
}
});
});
$('#btn-remove-alternative-logo').click(function(e) {
$.ajax({
url: '{{'laboratory-profile/alternative-logo/remove'}}',
type: 'POST',
data: {"_token": "{{ csrf_token() }}"},
success:function(res){
$('#file-ip-2-preview').attr('src',"")
handleMessage(res.success, res.message)
}
});
});
/* alterntive logo end */
/* default_footer start */
function showDefaultFooter(event){
if(event.target.files.length > 0){
var src = URL.createObjectURL(event.target.files[0]);
var preview = document.getElementById("file-ip-4-preview");
preview.src = src;
preview.style.display = "block";
$('#default-footer-upload-form').submit();
}
}
$('#default-footer-upload-form').submit(function(e) {
e.preventDefault();
var formData = new FormData(this);
$.ajax({
url: '{{'laboratory-profile/default-footer/upload'}}',
type: 'POST',
data: formData,
processData: false,
contentType: false,
success:function(res){
handleMessage(res.success, res.message)
}
});
});
$('#btn-remove-default-footer').click(function(e) {
$.ajax({
url: '{{'laboratory-profile/default-footer/remove'}}',
type: 'POST',
data: {"_token": "{{ csrf_token() }}"},
success:function(res){
$('#file-ip-4-preview').attr('src',"")
handleMessage(res.success, res.message)
}
});
});
/* default_footer end */
/* alternative footer start */
function showAlternativeFooter(event){
if(event.target.files.length > 0){
var src = URL.createObjectURL(event.target.files[0]);
var preview = document.getElementById("file-ip-3-preview");
preview.src = src;
preview.style.display = "block";
$('#alternative-footer-upload-form').submit();
}
}
$('#alternative-footer-upload-form').submit(function(e) {
e.preventDefault();
var formData = new FormData(this);
$.ajax({
url: '{{'laboratory-profile/alternative-footer/upload'}}',
type: 'POST',
data: formData,
processData: false,
contentType: false,
success:function(res){
handleMessage(res.success, res.message)
}
});
});
$('#btn-remove-alternative-footer').click(function(e) {
$.ajax({
url: '{{'laboratory-profile/alternative-footer/remove'}}',
type: 'POST',
data: {"_token": "{{ csrf_token() }}"},
success:function(res){
$('#file-ip-3-preview').attr('src',"")
handleMessage(res.success, res.message)
}
});
});
/* alternative footer end */
function showPreviewAlterVerifyImage(event){
if(event.target.files.length > 0){
var src = URL.createObjectURL(event.target.files[0]);
var preview = document.getElementById("alter-verify-image-preview");
preview.src = src;
preview.style.display = "block";
$('#alter-verify-image-upload-form').submit();
}
}
$('#alter-verify-image-upload-form').submit(function(e) {
e.preventDefault();
var formData = new FormData(this);
$.ajax({
url: '{{'laboratory-profile/alter-verify-sign/upload'}}',
type: 'POST',
data: formData,
processData: false,
contentType: false,
success:function(res){
handleMessage(res.success, res.message)
}
});
});
$('#btn-remove-alter-verify-label').click(function(e) {
$.ajax({
url: '{{'laboratory-profile/alter-verify-sign/remove'}}',
type: 'POST',
data: {"_token": "{{ csrf_token() }}"},
success:function(res){
$('#alter-verify-image-preview').attr('src',"")
handleMessage(res.success, res.message)
}
});
});
$('#image-upload-form').submit(function(e) {
e.preventDefault();
var formData = new FormData(this);
$.ajax({
url: '{{'laboratory-profile/avatar/upload'}}',
type: 'POST',
data: formData,
processData: false,
contentType: false,
success:function(res){
handleMessage(res.success, res.message)
}
});
});
function postLabConfigure(attr_code, attr_value) {
let url = base_url + '/configure/save';
$.ajax({
url: url,
type:"POST",
data :{
"_token": csrf_token,
attribute_code : attr_code,
attribute_value: attr_value
},
success:function(res){
handleMessage(res.success, res.message)
}
});
}
function postLabSettingSetter() {
let url = base_url + '/save';
technician_label = $('#technician-label').val()
sample_number = $("input[name='sample_number']:checked").attr('data-id')
patient_code = $("input[name='patient_number']:checked").attr('data-id')
discount_type = $("input[name='discount_type']:checked").attr('data-id')
exchange_rate = $('#exchange-rate').val()
abnormal_text_color = $('#abnormal-text-color').val()
show_result_footer = 1
abnormal_result_font_weight = $('input[name="abnormal_result_font_weight"]:checked').attr('data-id')
result_header_id = 1 //$('input[name="result_header_id"]:checked').attr('data-id')
invoice_template_id = $('input[name="invoice_template_id"]:checked').attr('data-id')
is_auto_make_invoice = $('input[name="is_auto_make_invoice"]:checked').attr('data-id')
if($('#phone-number').val()!='') phone_number = $('#phone-number').val()
if($('#email').val()!='') email = $('#email').val()
currency = $("input[name='currency']:checked").attr('data-id')
$.ajax({
url: url,
type:"POST",
data :{
"_token": csrf_token,
sample_number : sample_number,
patient_code: patient_code,
discount_type: discount_type,
technician_label: technician_label,
phone_number: phone_number,
email: email,
exchange_rate: exchange_rate,
abnormal_text_color: abnormal_text_color,
show_result_footer: show_result_footer,
abnormal_result_font_weight: abnormal_result_font_weight,
result_header_id: result_header_id,
currency:currency,
invoice_template_id: invoice_template_id,
is_auto_make_invoice: is_auto_make_invoice
},
success:function(res){
handleMessage(res.success, res.message)
if(res.success) setTimeout(function () {location.reload()}, messageDuration)
}
});
}
/** verify label image */
$('#verify-image-upload-form').submit(function(e) {
e.preventDefault();
var formData = new FormData(this);
$.ajax({
url: '{{'laboratory-profile/verifies/upload'}}',
type: 'POST',
data: formData,
processData: false,
contentType: false,
success:function(res){
handleMessage(res.success, res.message)
}
});
});
function showPreviewVerifyImage(event){
if(event.target.files.length > 0){
var src = URL.createObjectURL(event.target.files[0]);
var preview = document.getElementById("verify-image-preview");
preview.src = src;
preview.style.display = "block";
$('#verify-image-upload-form').submit();
}
}
$('#btn-remove-verify-label').click(function(e) {
$.ajax({
url: '{{'laboratory-profile/verifies/remove'}}',
type: 'POST',
data: {"_token": "{{ csrf_token() }}"},
success:function(res){
$('#verify-image-preview').attr('src',"")
handleMessage(res.success, res.message)
}
});
});
let modal_add_title = "{{__('laboratory.form_add_tittle')}}";
let modal_edit_title = "{{__('laboratory.form_edit_tittle')}}";
</script>
<script src="{{url(env("APP_URL").'storage/assets/js/admin/laboratory.js?_').time()}}"></script>
</body>
</html>