CRUD building and concept codes
This commit is contained in:
123
app/Http/Controllers/BuildingController.php
Normal file
123
app/Http/Controllers/BuildingController.php
Normal file
@@ -0,0 +1,123 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
use App\Enums\RecordStatusEnum;
|
||||
use App\Http\Controllers\Helper\GlobalController;
|
||||
use App\Models\BaseModel;
|
||||
use Illuminate\Http\Request;
|
||||
use App\Models\Building;
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
|
||||
use Illuminate\Support\Facades\Session;
|
||||
|
||||
|
||||
class BuildingController extends Controller
|
||||
{
|
||||
protected $model;
|
||||
protected $baseOrganizationId;
|
||||
|
||||
public function __construct(){
|
||||
$this->baseOrganizationId = Session::get('base_organization_id');
|
||||
$this->base = Session::get('base_organization');
|
||||
$this->model = new Building();
|
||||
}
|
||||
|
||||
public function index(Request $request){
|
||||
$recordStatusCondition = Auth::id()==1 ? [RecordStatusEnum::DELETE, RecordStatusEnum::ACTIVE] : [RecordStatusEnum::ACTIVE];
|
||||
$buildings = $this->model::query()->whereIn(BaseModel::RECORD_STATUS_FIELD, $recordStatusCondition)
|
||||
->where('organization_id', $this->baseOrganizationId)
|
||||
->when(!empty($request->kword), function ($labs) use($request){
|
||||
$labs->whereRaw("replace(name_en, ' ','') like '%".str_replace(" ","",$request->kword)."%'")
|
||||
->orWhereRaw("replace(name_kh, ' ','') like '%".str_replace(" ","",$request->kword)."%'");
|
||||
})->orderBy(BaseModel::CREATED_AT,'desc')->paginate(config('nrml.pagination.perpage', 10));
|
||||
return view('building', ['buildings' => $buildings]);
|
||||
}
|
||||
|
||||
public function save(Request $request){
|
||||
try {
|
||||
|
||||
$validator = \Validator::make($request->all(), [
|
||||
'name_en' => 'required',
|
||||
'name_kh' => 'required',
|
||||
]);
|
||||
if ($validator->fails()) {
|
||||
return response()->json(['success' => false, 'message' => __('building.create_fail'), 'errors' => $validator->errors()->all()]);
|
||||
}
|
||||
$data = array(
|
||||
'name_en' => $request->name_en,
|
||||
'name_kh' => $request->name_kh,
|
||||
'code' => $request->code,
|
||||
'description' => $request->description,
|
||||
'organization_id' => $this->baseOrganizationId,
|
||||
'created_at' => date('Y-m-d H:i:s'),
|
||||
'created_by' => Auth::id()
|
||||
);
|
||||
$this->model::query()->insert($data);
|
||||
return response()->json(['success' => true, 'message' => __('laboratory.create_success')]);
|
||||
}
|
||||
catch (\Exception $e){
|
||||
return response()->json(['success' => false, 'message' => __('laboratory.create_fail'), 'errors' => $e->getMessage()]);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public function update(Request $request){
|
||||
try {
|
||||
|
||||
$validator = \Validator::make($request->all(), [
|
||||
'name_en' => 'required',
|
||||
'name_kh' => 'required',
|
||||
]);
|
||||
if ($validator->fails()) return response()->json(['errors' => $validator->errors()->all()]);
|
||||
$data = array(
|
||||
'name_en' => $request->name_en,
|
||||
'name_kh' => $request->name_kh,
|
||||
'code' => $request->code,
|
||||
'description' => $request->description,
|
||||
'updated_at' => date('Y-m-d H:i:s'),
|
||||
'updated_by' => Auth::id()
|
||||
);
|
||||
$this->model::query()->where('id', $request->building_id)->update($data);
|
||||
return response()->json(['success' => true, 'message' => __('laboratory.update_success')]);
|
||||
} catch (\Exception $e){
|
||||
return response()->json(['success' => false, 'message' => __('laboratory.update_fail'), 'errors' => $e->getMessage()]);
|
||||
}
|
||||
}
|
||||
|
||||
public function get(Request $request){
|
||||
try{
|
||||
$lab = $this->model::query()->where('id', $request->building_id)->get()->first();
|
||||
return response()->json(['success' => true, 'message' => __('laboratory.get_success'), 'data' => $lab]);
|
||||
} catch (\Exception $e){
|
||||
return response()->json(['success' => false, 'message' => __('laboratory.get_fail'), 'errors' => $e->getMessage()]);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public function delete(Request $request){
|
||||
try{
|
||||
$this->model::query()->where('id', $request->building_id)->update(array(
|
||||
BaseModel::DELETED_AT_FIELD => date('Y-m-d H:i:s'),
|
||||
BaseModel::DELETED_BY_FIELD => Auth::id(),
|
||||
BaseModel::RECORD_STATUS_FIELD => RecordStatusEnum::DELETE
|
||||
));
|
||||
return response()->json(['success' => true, 'message' => __('laboratory.delete_success')]);
|
||||
}
|
||||
catch (\Exception $e){
|
||||
return response()->json(['success' => false, 'message' => __('laboratory.delete_fail'), 'errors' => $e->getMessage()]);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public function restore(Request $request){
|
||||
try{
|
||||
$this->model::query()->where('id', $request->building_id)->update(array(BaseModel::RECORD_STATUS_FIELD=> RecordStatusEnum::ACTIVE));
|
||||
return response()->json(['success' => true, 'message' => __('laboratory.restore_success')]);
|
||||
}
|
||||
catch (\Exception $e){
|
||||
return response()->json(['success' => false, 'message' => __('laboratory.restore_fail'), 'errors' => $e->getMessage()]);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
131
app/Http/Controllers/ConceptController.php
Normal file
131
app/Http/Controllers/ConceptController.php
Normal file
@@ -0,0 +1,131 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
use App\Enums\RecordStatusEnum;
|
||||
use App\Http\Controllers\Helper\GlobalController;
|
||||
use App\Models\BaseModel;
|
||||
use App\Models\Concept;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
|
||||
use Illuminate\Support\Facades\Session;
|
||||
|
||||
|
||||
class ConceptController extends Controller
|
||||
{
|
||||
protected $model;
|
||||
protected $baseOrganizationId;
|
||||
|
||||
public function __construct(){
|
||||
//$this->baseOrganizationId = Session::get('base_organization_id');
|
||||
$this->base = Session::get('base_organization');
|
||||
$this->model = new Concept();
|
||||
}
|
||||
|
||||
public function index(Request $request){
|
||||
$recordStatusCondition = Auth::id()==1 ? [RecordStatusEnum::DELETE, RecordStatusEnum::ACTIVE] : [RecordStatusEnum::ACTIVE];
|
||||
$conceptCategories = $this->model::query()->groupBy('concept_category_code')->get('concept_category_code');
|
||||
$concepts = $this->model::query()->whereIn(BaseModel::RECORD_STATUS_FIELD, $recordStatusCondition)
|
||||
->when(!empty($request->kword), function ($query) use($request){
|
||||
$query->whereRaw("replace(name_en, ' ','') like '%".str_replace(" ","",$request->kword)."%'")
|
||||
->orWhereRaw("replace(name_kh, ' ','') like '%".str_replace(" ","",$request->kword)."%'")
|
||||
->orWhereRaw("replace(code, ' ','') like '%".str_replace(" ","",$request->kword)."%'");
|
||||
})->when(!empty(trim($request->concept_category_code)) && $request->concept_category_code != 'all', function ($query) use($request){
|
||||
$query->where('concept_category_code', $request->concept_category_code);
|
||||
})->orderBy(BaseModel::CREATED_AT, 'desc')->paginate(config('nrml.pagination.perpage', 10));
|
||||
return view('concept', ['concepts' => $concepts, 'concept_categories' => $conceptCategories]);
|
||||
}
|
||||
|
||||
public function save(Request $request){
|
||||
try {
|
||||
|
||||
$validator = \Validator::make($request->all(), [
|
||||
'name_en' => 'required',
|
||||
'code' => 'required',
|
||||
'concept_category_code' => 'required',
|
||||
'name_kh' => 'required',
|
||||
]);
|
||||
if ($validator->fails()) {
|
||||
return response()->json(['success' => false, 'message' => __('building.create_fail'), 'errors' => $validator->errors()->all()]);
|
||||
}
|
||||
$data = array(
|
||||
'name_en' => $request->name_en,
|
||||
'name_kh' => $request->name_kh,
|
||||
'code' => $request->code,
|
||||
'description' => $request->description,
|
||||
'concept_category_code' => $request->concept_category_code,
|
||||
'created_at' => date('Y-m-d H:i:s'),
|
||||
'created_by' => Auth::id()
|
||||
);
|
||||
$this->model::query()->insert($data);
|
||||
return response()->json(['success' => true, 'message' => __('laboratory.create_success')]);
|
||||
}
|
||||
catch (\Exception $e){
|
||||
return response()->json(['success' => false, 'message' => __('laboratory.create_fail'), 'errors' => $e->getMessage()]);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public function update(Request $request){
|
||||
try {
|
||||
|
||||
$validator = \Validator::make($request->all(), [
|
||||
'name_en' => 'required',
|
||||
'code' => 'required',
|
||||
'concept_category_code' => 'required',
|
||||
'name_kh' => 'required',
|
||||
]);
|
||||
if ($validator->fails()) return response()->json(['errors' => $validator->errors()->all()]);
|
||||
$data = array(
|
||||
'name_en' => $request->name_en,
|
||||
'name_kh' => $request->name_kh,
|
||||
'code' => $request->code,
|
||||
'description' => $request->description,
|
||||
'concept_category_code' => $request->concept_category_code,
|
||||
'updated_at' => date('Y-m-d H:i:s'),
|
||||
'updated_by' => Auth::id()
|
||||
);
|
||||
$this->model::query()->where('id', $request->concept_id)->update($data);
|
||||
return response()->json(['success' => true, 'message' => __('laboratory.update_success')]);
|
||||
} catch (\Exception $e){
|
||||
return response()->json(['success' => false, 'message' => __('laboratory.update_fail'), 'errors' => $e->getMessage()]);
|
||||
}
|
||||
}
|
||||
|
||||
public function get(Request $request){
|
||||
try{
|
||||
$lab = $this->model::query()->where('id', $request->concept_id)->get()->first();
|
||||
return response()->json(['success' => true, 'message' => __('laboratory.get_success'), 'data' => $lab]);
|
||||
} catch (\Exception $e){
|
||||
return response()->json(['success' => false, 'message' => __('laboratory.get_fail'), 'errors' => $e->getMessage()]);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public function delete(Request $request){
|
||||
try{
|
||||
$this->model::query()->where('id', $request->concept_id)->update(array(
|
||||
BaseModel::DELETED_AT_FIELD => date('Y-m-d H:i:s'),
|
||||
BaseModel::DELETED_BY_FIELD => Auth::id(),
|
||||
BaseModel::RECORD_STATUS_FIELD => RecordStatusEnum::DELETE
|
||||
));
|
||||
return response()->json(['success' => true, 'message' => __('laboratory.delete_success')]);
|
||||
}
|
||||
catch (\Exception $e){
|
||||
return response()->json(['success' => false, 'message' => __('laboratory.delete_fail'), 'errors' => $e->getMessage()]);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public function restore(Request $request){
|
||||
try{
|
||||
$this->model::query()->where('id', $request->concept_id)->update(array(BaseModel::RECORD_STATUS_FIELD=> RecordStatusEnum::ACTIVE));
|
||||
return response()->json(['success' => true, 'message' => __('laboratory.restore_success')]);
|
||||
}
|
||||
catch (\Exception $e){
|
||||
return response()->json(['success' => false, 'message' => __('laboratory.restore_fail'), 'errors' => $e->getMessage()]);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -30,7 +30,7 @@ class OrganismController extends Controller
|
||||
//->where('organization_id', $this->baseOrganizationId)
|
||||
->when(!empty($request->kword), function ($organisms) use($request){
|
||||
$organisms->whereRaw("replace(name_en, ' ','') like '%".str_replace(" ","",$request->kword)."%'");
|
||||
})->orderBy(BaseModel::CREATED_AT_FIELD,'desc')->paginate(config('labis.pagination.perpage', 10));
|
||||
})->orderBy(BaseModel::CREATED_AT_FIELD,'desc')->paginate(config('nrml.pagination.perpage', 10));
|
||||
return view('organism', ['organisms' => $organisms]);
|
||||
}
|
||||
|
||||
|
||||
@@ -35,7 +35,7 @@ class OrganizationController extends Controller
|
||||
->orWhereRaw("replace(name_kh, ' ','') like '%".str_replace(" ","",$request->kword)."%'")
|
||||
->orWhere('address_en','like','%'.$request->kword.'%')
|
||||
->orWhere('address_kh','like','%'.$request->kword.'%');
|
||||
})->orderBy(BaseModel::CREATED_AT,'desc')->paginate(config('labis.pagination.perpage', 10));
|
||||
})->orderBy(BaseModel::CREATED_AT,'desc')->paginate(config('nrml.pagination.perpage', 10));
|
||||
return view('laboratory', ['laboratories' => $labs]);
|
||||
}
|
||||
|
||||
|
||||
@@ -29,7 +29,7 @@ class PublicationController extends Controller
|
||||
->when(!empty($request->kword), function ($publications) use($request){
|
||||
$publications->whereRaw("replace(title_en, ' ','') like '%".str_replace(" ","",$request->kword)."%'")
|
||||
->orWhereRaw("replace(title_kh, ' ','') like '%".str_replace(" ","",$request->kword)."%'");
|
||||
})->orderBy(BaseModel::CREATED_AT_FIELD,'desc')->paginate(config('labis.pagination.perpage', 10));
|
||||
})->orderBy(BaseModel::CREATED_AT_FIELD,'desc')->paginate(config('nrml.pagination.perpage', 10));
|
||||
return view('publication', ['publications' => $publications, 'labs' => $this->labs]);
|
||||
}
|
||||
|
||||
|
||||
@@ -36,7 +36,7 @@ class RoleController extends Controller
|
||||
->whereNotIn('id', [UtilEnum::ADMINISTRATOR_ROLE])
|
||||
->when(!empty($request->kword), function ($roles) use($request){
|
||||
$roles->whereRaw("replace(name_en, ' ','') like '%".str_replace(" ","",$request->kword)."%'");
|
||||
})->orderBy(BaseModel::CREATED_AT,'desc')->paginate(config('labis.pagination.perpage', 10));
|
||||
})->orderBy(BaseModel::CREATED_AT,'desc')->paginate(config('nrml.pagination.perpage', 10));
|
||||
return view('role', ['roles' => $roles]);
|
||||
}
|
||||
|
||||
|
||||
@@ -97,7 +97,7 @@ class SampleController extends Controller
|
||||
$samples->whereIn('id', $this->filterSampleStatus($request->sample_status));
|
||||
})->when(!empty($request->sample_date) && empty($request->kword) , function ($samples) use($request){
|
||||
$samples->whereDate('admission_date', date('Y-m-d',strtotime($request->sample_date)));
|
||||
})->orderBy(BaseModel::CREATED_AT_FIELD,'desc')->paginate(config('labis.pagination.perpage', 10));
|
||||
})->orderBy(BaseModel::CREATED_AT_FIELD,'desc')->paginate(config('nrml.pagination.perpage', 10));
|
||||
return view('sample', ['samples' => $samples]);
|
||||
}
|
||||
|
||||
|
||||
@@ -53,7 +53,7 @@ class UserController extends Controller
|
||||
->orWhereRaw("REPLACE(email,' ','') LIKE ?", [$keyword]);
|
||||
})->where('id', '!=', UtilEnum::ADMINISTRATOR_USER);
|
||||
})
|
||||
->orderBy(BaseModel::CREATED_AT,'desc')->paginate(config('labis.pagination.perpage', 10));
|
||||
->orderBy(BaseModel::CREATED_AT,'desc')->paginate(config('nrml.pagination.perpage', 10));
|
||||
return view('user_account', ['users' => $users, 'roles' => $roles, 'organizations' => $this->organizations]);
|
||||
}
|
||||
|
||||
@@ -69,7 +69,7 @@ class UserController extends Controller
|
||||
->when(!empty($request->kword), function($users) use ($request) {
|
||||
$users->whereRaw("replace(name, ' ','') like '%".str_replace(" ","",$request->kword)."%'")
|
||||
->orWhereRaw("replace(email, ' ','') like '%".str_replace(" ","",$request->kword)."%'");
|
||||
})->orderBy(BaseModel::CREATED_AT,'desc')->paginate(config('labis.pagination.perpage', 10));
|
||||
})->orderBy(BaseModel::CREATED_AT,'desc')->paginate(config('nrml.pagination.perpage', 10));
|
||||
return view('user_account', ['users' => $users, 'roles' => $roles, 'labs' => $this->labs]);
|
||||
}
|
||||
|
||||
|
||||
40
app/Models/Building.php
Normal file
40
app/Models/Building.php
Normal file
@@ -0,0 +1,40 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
use App\Enums\RecordStatusEnum;
|
||||
use App\Models\Traits\HasLocalizedName;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Support\Facades\Session;
|
||||
use App\Traits\AuditLogTrait;
|
||||
|
||||
class Building extends BaseModel
|
||||
{
|
||||
public $timestamps = false;
|
||||
use HasFactory;
|
||||
use HasLocalizedName;
|
||||
use AuditLogTrait;
|
||||
/**
|
||||
* The table associated with the model.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
|
||||
protected $appends = ['name'];
|
||||
|
||||
protected $primaryKey = 'id';
|
||||
|
||||
|
||||
|
||||
protected $fillable = [
|
||||
'code', 'name_en','name_kh', 'description', 'organization_id',
|
||||
BaseModel::CREATED_BY_FIELD, BaseModel::UPDATED_AT_FIELD, BaseModel::UPDATED_BY_FIELD,
|
||||
BaseModel::DELETED_AT_FIELD, BaseModel::DELETED_BY_FIELD, BaseModel::RECORD_STATUS_FIELD
|
||||
];
|
||||
|
||||
public static function boot()
|
||||
{
|
||||
parent::boot();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
40
app/Models/Concept.php
Normal file
40
app/Models/Concept.php
Normal file
@@ -0,0 +1,40 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
use App\Enums\RecordStatusEnum;
|
||||
use App\Models\Traits\HasLocalizedName;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Support\Facades\Session;
|
||||
use App\Traits\AuditLogTrait;
|
||||
|
||||
class Concept extends BaseModel
|
||||
{
|
||||
public $timestamps = false;
|
||||
use HasFactory;
|
||||
use HasLocalizedName;
|
||||
use AuditLogTrait;
|
||||
/**
|
||||
* The table associated with the model.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
|
||||
protected $appends = ['name'];
|
||||
|
||||
protected $primaryKey = 'id';
|
||||
|
||||
|
||||
|
||||
protected $fillable = [
|
||||
'code', 'name_en','name_kh', 'description', 'concept_category_code',
|
||||
BaseModel::CREATED_BY_FIELD, BaseModel::UPDATED_AT_FIELD, BaseModel::UPDATED_BY_FIELD,
|
||||
BaseModel::DELETED_AT_FIELD, BaseModel::DELETED_BY_FIELD, BaseModel::RECORD_STATUS_FIELD
|
||||
];
|
||||
|
||||
public static function boot()
|
||||
{
|
||||
parent::boot();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
40
app/Models/Room.php
Normal file
40
app/Models/Room.php
Normal file
@@ -0,0 +1,40 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
use App\Enums\RecordStatusEnum;
|
||||
use App\Models\Traits\HasLocalizedName;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Support\Facades\Session;
|
||||
use App\Traits\AuditLogTrait;
|
||||
|
||||
class Room extends BaseModel
|
||||
{
|
||||
public $timestamps = false;
|
||||
use HasFactory;
|
||||
use HasLocalizedName;
|
||||
use AuditLogTrait;
|
||||
/**
|
||||
* The table associated with the model.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
|
||||
protected $appends = ['name'];
|
||||
|
||||
protected $primaryKey = 'id';
|
||||
|
||||
|
||||
|
||||
protected $fillable = [
|
||||
'code', 'name_en','name_kh', 'description', 'organization_id',
|
||||
BaseModel::CREATED_BY_FIELD, BaseModel::UPDATED_AT_FIELD, BaseModel::UPDATED_BY_FIELD,
|
||||
BaseModel::DELETED_AT_FIELD, BaseModel::DELETED_BY_FIELD, BaseModel::RECORD_STATUS_FIELD
|
||||
];
|
||||
|
||||
public static function boot()
|
||||
{
|
||||
parent::boot();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -1,51 +0,0 @@
|
||||
<?php
|
||||
|
||||
return [
|
||||
|
||||
'pagination' => [
|
||||
'perpage' => 20,
|
||||
],
|
||||
|
||||
'auto_complete_items' => [
|
||||
'Positive ',
|
||||
'Negative ',
|
||||
'Normal ',
|
||||
'Abnormal',
|
||||
'POSITIVE ',
|
||||
'NEGATIVE ',
|
||||
'Trace',
|
||||
'(1+)',
|
||||
'(2+)',
|
||||
'(3+)',
|
||||
],
|
||||
'baseManagerMenus' =>[
|
||||
'department',
|
||||
'sample-type',
|
||||
'test',
|
||||
'comment',
|
||||
'organism',
|
||||
'antibiotic',
|
||||
'quantity',
|
||||
'ward',
|
||||
'hospital-service',
|
||||
'patient-type',
|
||||
'physician',
|
||||
'lab-users'
|
||||
],
|
||||
|
||||
'administrator' => [
|
||||
'concept-code',
|
||||
'publication',
|
||||
'hospital',
|
||||
'user',
|
||||
'role',
|
||||
'clone-hospital'
|
||||
],
|
||||
|
||||
'sample' => [
|
||||
'sample',
|
||||
'requested'
|
||||
],
|
||||
|
||||
|
||||
];
|
||||
9
config/nrml.php
Normal file
9
config/nrml.php
Normal file
@@ -0,0 +1,9 @@
|
||||
<?php
|
||||
|
||||
return [
|
||||
|
||||
'pagination' => [
|
||||
'perpage' => 20,
|
||||
]
|
||||
|
||||
];
|
||||
@@ -92,8 +92,9 @@ return [
|
||||
'sample_entry_by' => 'Entered By',
|
||||
'modify_by' => 'Modified By',
|
||||
|
||||
'code' => 'Code'
|
||||
|
||||
|
||||
'apply_to_all_test' => 'Apply to all tests'
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -89,6 +89,6 @@ return [
|
||||
'sample_entry_by' => 'បញ្ចូលលទ្ធផលដោយ',
|
||||
'modify_by' => 'កែប្រែលទ្ធផលដោយ',
|
||||
|
||||
'apply_to_all_test' => 'កំណត់គ្រប់តេស្តទាំងអស់'
|
||||
'code' => 'លេខកូដ'
|
||||
|
||||
];
|
||||
|
||||
@@ -469,7 +469,6 @@ Lab & User Profile
|
||||
border-color: #d3d5d7 !important;
|
||||
}
|
||||
.nav .menu-icon{
|
||||
/*color: #3b86d1 !important;*/
|
||||
color: #12931d !important;
|
||||
}
|
||||
.sidebar .nav.sub-menu .nav-item::before {
|
||||
@@ -536,10 +535,15 @@ input[type=number] {
|
||||
}
|
||||
|
||||
.sidebar .nav.sub-menu .nav-item::before {
|
||||
width: 5px;
|
||||
height: 5px;
|
||||
border-radius: 50px !important;
|
||||
background: #469f37;
|
||||
width: 6px;
|
||||
height: 6px;
|
||||
border-radius: 0px !important;
|
||||
background: #ffffff;
|
||||
border: 1px solid #12931d;
|
||||
}
|
||||
|
||||
.sidebar .nav-item:has(.nav-link.active)::before {
|
||||
background: #12931d;
|
||||
}
|
||||
|
||||
.modal-header .modal-title{
|
||||
@@ -614,11 +618,6 @@ div select{
|
||||
}
|
||||
|
||||
|
||||
.sidebar .nav.sub-menu .nav-item .nav-link.active {
|
||||
font-weight: 450 !important;
|
||||
border-right: 5px solid #1460ab !important;
|
||||
}
|
||||
|
||||
|
||||
.nav-tabs .nav-link {
|
||||
border-top-left-radius: 0 !important;
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
|
||||
.select2-selection__rendered {
|
||||
line-height: 18px !important;
|
||||
line-height: 25px !important;
|
||||
}
|
||||
.select2-container .select2-selection--single{
|
||||
box-shadow: none;
|
||||
outline: none;
|
||||
}
|
||||
.select2-container .select2-selection--single, .select2-selection--multiple {
|
||||
min-height: 46px !important;
|
||||
min-height: 36px !important;
|
||||
border-radius: 0;
|
||||
border-color: #f3f3f3 !important;
|
||||
}
|
||||
@@ -15,7 +15,7 @@
|
||||
outline: none;
|
||||
}
|
||||
.select2-selection__arrow {
|
||||
height: 46px !important;
|
||||
height: 36px !important;
|
||||
}
|
||||
.select2-selection__choice{
|
||||
font-size: 13px !important;
|
||||
@@ -86,3 +86,8 @@
|
||||
.select2-selection .select2-selection--multiple:after {
|
||||
content: 'hhghgh';
|
||||
}
|
||||
|
||||
.select2-container .select2-selection--single, .main-panel .select2-selection--multiple {
|
||||
padding-top: 5px !important;
|
||||
padding-left: 5px !important;
|
||||
}
|
||||
|
||||
115
public/storage/assets/js/admin/building.js
Normal file
115
public/storage/assets/js/admin/building.js
Normal file
@@ -0,0 +1,115 @@
|
||||
|
||||
$("#btnSave").on('click',function(e){
|
||||
e.preventDefault();
|
||||
let building_id = $('#building_id').val();
|
||||
url = parseInt(building_id) === 0 ? save_url : update_url;
|
||||
$.ajax({
|
||||
url: url,
|
||||
type:"POST",
|
||||
data:{
|
||||
"_token": csrf_token,
|
||||
building_id : building_id,
|
||||
name_en: $('#name-en').val(),
|
||||
name_kh: $('#name-kh').val(),
|
||||
code: $('#code').val(),
|
||||
description: $('#description').val(),
|
||||
},
|
||||
success:function(res){
|
||||
handleMessage(res.success, res.message)
|
||||
setTimeout(function () {location.reload()}, messageDuration)
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
function delete_lab(building_id){
|
||||
Swal.fire({
|
||||
text: confirm_delete_record,
|
||||
icon: 'question',
|
||||
showCancelButton: true,
|
||||
cancelButtonClass:'danger',
|
||||
confirmButtonText: confirm_ok_delete,
|
||||
cancelButtonText: confirm_cancel
|
||||
}).then((result) => {
|
||||
if (result.value) {
|
||||
$.ajax({
|
||||
url: delete_url,
|
||||
method:'POST',
|
||||
data:{
|
||||
"_token": csrf_token,
|
||||
building_id : building_id,
|
||||
},
|
||||
success:function(res){
|
||||
handleMessage(res.success, res.message)
|
||||
setTimeout(function () {location.reload()}, messageDuration)
|
||||
}
|
||||
})
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function restore_lab(building_id){
|
||||
Swal.fire({
|
||||
text: confirm_restore_record,
|
||||
icon: 'question',
|
||||
showCancelButton: true,
|
||||
cancelButtonClass:'danger',
|
||||
confirmButtonText: confirm_ok_restore,
|
||||
cancelButtonText: confirm_cancel_restore,
|
||||
}).then((result) => {
|
||||
if (result.value) {
|
||||
$.ajax({
|
||||
url: restore_url,
|
||||
method:'POST',
|
||||
data:{
|
||||
"_token": csrf_token,
|
||||
building_id : building_id,
|
||||
},
|
||||
success:function(res){
|
||||
handleMessage(res.success, res.message)
|
||||
setTimeout(function () {location.reload()}, messageDuration)
|
||||
}
|
||||
})
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
$('#modal-building').on('show.bs.modal', function (event) {
|
||||
var button = $(event.relatedTarget) // Button that triggered the modal
|
||||
var action = button.data('action') // Extract info from data-* attributes
|
||||
$('#shareable_lab_result').prop("checked", false)
|
||||
var modal = $(this);
|
||||
if(action === "new"){
|
||||
// Clear inputs
|
||||
modal.find('.modal-body input').val("");
|
||||
modal.find('.modal-body textarea').val("");
|
||||
modal.find('.modal-body input[name="building_id"]').val(0);
|
||||
modal.find('.modal-title').html(modal_add_title);
|
||||
}else if(action === "edit"){
|
||||
building_id = button.data('building_id');
|
||||
modal.find('.modal-body input[name="building_id"]').val(building_id);
|
||||
modal.find('.modal-title').html(modal_edit_title);
|
||||
//e.preventDefault();
|
||||
$.ajax({
|
||||
url: get_url,
|
||||
type:"POST",
|
||||
data:{
|
||||
"_token": csrf_token,
|
||||
building_id: building_id,
|
||||
},
|
||||
success:function(res){
|
||||
if(res.success) {
|
||||
let data = res.data;
|
||||
modal.find('.modal-body input[name="name_en"]').val(data.name_en);
|
||||
modal.find('.modal-body input[name="name_kh"]').val(data.name_kh);
|
||||
modal.find('.modal-body input[name="code"]').val(data.code);
|
||||
modal.find('.modal-body textarea[name="description"]').val(data.description);
|
||||
} else{
|
||||
handleMessage(res.success, res.message)
|
||||
}
|
||||
},
|
||||
});
|
||||
}
|
||||
})
|
||||
|
||||
118
public/storage/assets/js/admin/concept.js
Normal file
118
public/storage/assets/js/admin/concept.js
Normal file
@@ -0,0 +1,118 @@
|
||||
|
||||
$("#btnSave").on('click',function(e){
|
||||
e.preventDefault();
|
||||
let concept_id = $('#concept_id').val();
|
||||
url = parseInt(concept_id) === 0 ? save_url : update_url;
|
||||
$.ajax({
|
||||
url: url,
|
||||
type:"POST",
|
||||
data:{
|
||||
"_token": csrf_token,
|
||||
concept_id : concept_id,
|
||||
name_en: $('#name-en').val(),
|
||||
name_kh: $('#name-kh').val(),
|
||||
code: $('#code').val(),
|
||||
concept_category_code: $('#concept_category_code').val(),
|
||||
description: $('#description').val(),
|
||||
},
|
||||
success:function(res){
|
||||
handleMessage(res.success, res.message)
|
||||
setTimeout(function () {location.reload()}, messageDuration)
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
function delete_lab(concept_id){
|
||||
Swal.fire({
|
||||
text: confirm_delete_record,
|
||||
icon: 'question',
|
||||
showCancelButton: true,
|
||||
cancelButtonClass:'danger',
|
||||
confirmButtonText: confirm_ok_delete,
|
||||
cancelButtonText: confirm_cancel
|
||||
}).then((result) => {
|
||||
if (result.value) {
|
||||
$.ajax({
|
||||
url: delete_url,
|
||||
method:'POST',
|
||||
data:{
|
||||
"_token": csrf_token,
|
||||
concept_id : concept_id,
|
||||
},
|
||||
success:function(res){
|
||||
handleMessage(res.success, res.message)
|
||||
setTimeout(function () {location.reload()}, messageDuration)
|
||||
}
|
||||
})
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function restore_lab(concept_id){
|
||||
Swal.fire({
|
||||
text: confirm_restore_record,
|
||||
icon: 'question',
|
||||
showCancelButton: true,
|
||||
cancelButtonClass:'danger',
|
||||
confirmButtonText: confirm_ok_restore,
|
||||
cancelButtonText: confirm_cancel_restore,
|
||||
}).then((result) => {
|
||||
if (result.value) {
|
||||
$.ajax({
|
||||
url: restore_url,
|
||||
method:'POST',
|
||||
data:{
|
||||
"_token": csrf_token,
|
||||
concept_id : concept_id,
|
||||
},
|
||||
success:function(res){
|
||||
handleMessage(res.success, res.message)
|
||||
setTimeout(function () {location.reload()}, messageDuration)
|
||||
}
|
||||
})
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
$('#modal-concept').on('show.bs.modal', function (event) {
|
||||
var button = $(event.relatedTarget) // Button that triggered the modal
|
||||
var action = button.data('action') // Extract info from data-* attributes
|
||||
$('#shareable_lab_result').prop("checked", false)
|
||||
var modal = $(this);
|
||||
if(action === "new"){
|
||||
// Clear inputs
|
||||
modal.find('.modal-body input').val("");
|
||||
modal.find('.modal-body textarea').val("");
|
||||
modal.find('.modal-body select[name="concept_category_code"]').val("").trigger('change');
|
||||
modal.find('.modal-body input[name="concept_id"]').val(0);
|
||||
modal.find('.modal-title').html(modal_add_title);
|
||||
}else if(action === "edit"){
|
||||
concept_id = button.data('concept_id');
|
||||
modal.find('.modal-body input[name="concept_id"]').val(concept_id);
|
||||
modal.find('.modal-title').html(modal_edit_title);
|
||||
//e.preventDefault();
|
||||
$.ajax({
|
||||
url: get_url,
|
||||
type:"POST",
|
||||
data:{
|
||||
"_token": csrf_token,
|
||||
concept_id: concept_id,
|
||||
},
|
||||
success:function(res){
|
||||
if(res.success) {
|
||||
let data = res.data;
|
||||
modal.find('.modal-body input[name="name_en"]').val(data.name_en);
|
||||
modal.find('.modal-body input[name="name_kh"]').val(data.name_kh);
|
||||
modal.find('.modal-body input[name="code"]').val(data.code);
|
||||
modal.find('.modal-body select[name="concept_category_code"]').val(data.concept_category_code).trigger('change');
|
||||
modal.find('.modal-body textarea[name="description"]').val(data.description);
|
||||
} else{
|
||||
handleMessage(res.success, res.message)
|
||||
}
|
||||
},
|
||||
});
|
||||
}
|
||||
})
|
||||
|
||||
165
resources/views/building.blade.php
Normal file
165
resources/views/building.blade.php
Normal file
@@ -0,0 +1,165 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="{{ str_replace('_', '-', app()->getLocale()) }}">
|
||||
<head>
|
||||
@include('layout.header')
|
||||
</head>
|
||||
<body>
|
||||
<div class="row" id="x" style="display: none;">
|
||||
<div class="col-12">
|
||||
<span class="d-flex align-items-center purchase-popup">
|
||||
<i class="typcn typcn-delete-outline" id="bannerClose"></i>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="container-scroller">
|
||||
@include('layout.navbar')
|
||||
<!-- partial -->
|
||||
@include('layout.breadscrum')
|
||||
<div class="container-fluid page-body-wrapper">
|
||||
|
||||
@include('layout.sidebar')
|
||||
|
||||
<!-- partial -->
|
||||
<div class="main-panel">
|
||||
<div class="content-wrapper">
|
||||
<div class="row">
|
||||
<div class="col-md-12 grid-margin stretch-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> {{__('អគារ')}}</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="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-md btn-inverse-secondary rounded-right-25 px-3" type="submit"><i class="fa fa-search"></i> {{__('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-building" data-backdrop="static"><i class="typcn typcn-plus"></i> {{__('general.btn_add_new')}}</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</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" width="120px">{{__('general.code')}}</th>
|
||||
<th class="py-2">{{__('laboratory.table_name_en')}}</th>
|
||||
<th class="py-2">{{__('laboratory.table_name_kh')}}</th>
|
||||
<th class="py-2 text-center" width="100px">{{__('laboratory.table_status')}}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach($buildings as $k=>$building)
|
||||
<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-building_id="{{$building->id}}" data-toggle="modal" data-target="#modal-building" data-backdrop="static"><i class="typcn typcn-edit"></i></button>
|
||||
@if($building->record_status_id==0)
|
||||
<button type="button" class="btn btn-sm btn-inverse-primary" title="Restore" onclick="restore_lab({{$building->id}})"><i class="typcn typcn-plus"></i></button>
|
||||
@else
|
||||
<button type="button" class="btn btn-sm btn-inverse-danger " title="Delete" onclick="delete_lab({{$building->id}})"><i class="mdi mdi-close-circle"></i></button>
|
||||
@endif
|
||||
</div>
|
||||
</td>
|
||||
<td class="py-1">{{$building->code}}</td>
|
||||
<td class="py-1">{{$building->name_en}}</td>
|
||||
<td class="py-1">{{$building->name_kh}}</td>
|
||||
<td class="py-1 text-center">
|
||||
<i class="mdi {{$building->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">
|
||||
{!! $buildings->links('pagination.custom') !!}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<!-- Modal Laboratory -->
|
||||
<div class="modal mt-5 fade modal-primary" id="modal-building">
|
||||
<div class="modal-dialog modal-lg">
|
||||
<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="building_id" id="building_id" value="0" />
|
||||
<div class="form-vertical">
|
||||
<div class="row">
|
||||
<div class="col-sm-12">
|
||||
<div class="form-group mb-1">
|
||||
<label for="lab-name-kh">{{__('លេខកូដ')}} <span class="text-danger"></span> </label>
|
||||
<input type="text" class="form-control form-control-sm" name="code" id="code" value="" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-sm-12">
|
||||
<div class="form-group mb-1">
|
||||
<label for="lab-name-kh">{{__('laboratory.table_name_kh')}} <span class="text-danger">*</span> </label>
|
||||
<input type="text" class="form-control form-control-sm" name="name_kh" id="name-kh" value="" placeholder="{{__('laboratory.table_name_kh')}}"/>
|
||||
</div>
|
||||
<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 rounded-right-0" name="name_en" id="name-en" value="" placeholder="{{__('laboratory.table_name_en')}}">
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-sm-12">
|
||||
<div class="form-group mb-1">
|
||||
<label for="lab-name-kh">{{__('បរិយាយ')}} </label>
|
||||
<textarea class="form-control" name="description" id="description"></textarea>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-success rounded-25" id="btnSave"><i class="fa fa-floppy-o"></i> <span class="save">{{__('lang.save')}}</span><span class="update" style="display: none">{{__('lang.update')}}</span></button>
|
||||
<button type="button" class="btn btn-secondary rounded-25 ml-2" data-dismiss='modal'>{{__('lang.cancel')}}</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@include('layout.footer')
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@include('layout.common_script')
|
||||
|
||||
<script>
|
||||
var save_url = "{{url('building.save')}}";
|
||||
var update_url = "{{url('building.update')}}";
|
||||
var delete_url = "{{url('building.delete')}}";
|
||||
var restore_url = "{{url('building.restore')}}";
|
||||
var get_url = "{{url('building.get')}}";
|
||||
|
||||
let modal_add_title = "Add Building";
|
||||
let modal_edit_title = "Edit Building";
|
||||
|
||||
</script>
|
||||
<script src="{{url(env("APP_URL").'storage/assets/js/admin/building.js?_').time()}}"></script>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
|
||||
186
resources/views/concept.blade.php
Normal file
186
resources/views/concept.blade.php
Normal file
@@ -0,0 +1,186 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="{{ str_replace('_', '-', app()->getLocale()) }}">
|
||||
<head>
|
||||
@include('layout.header')
|
||||
</head>
|
||||
<body>
|
||||
<div class="row" id="x" style="display: none;">
|
||||
<div class="col-12">
|
||||
<span class="d-flex align-items-center purchase-popup">
|
||||
<i class="typcn typcn-delete-outline" id="bannerClose"></i>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="container-scroller">
|
||||
@include('layout.navbar')
|
||||
<!-- partial -->
|
||||
@include('layout.breadscrum')
|
||||
<div class="container-fluid page-body-wrapper">
|
||||
|
||||
@include('layout.sidebar')
|
||||
|
||||
<!-- partial -->
|
||||
<div class="main-panel">
|
||||
<div class="content-wrapper">
|
||||
<div class="row">
|
||||
<div class="col-md-12 grid-margin stretch-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> {{__('បញ្ជីគម្រូ')}}</h4>
|
||||
<div class="row">
|
||||
<div class="col-sm-12">
|
||||
<form method="get" action="{{url('concept/search')}}">
|
||||
<div class="row">
|
||||
<div class="col-xs-12 col-sm-12 col-md-8 col-lg-8">
|
||||
<div class="input-group">
|
||||
<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">
|
||||
<select class="form-control rounded-left-0 rounded-right-0" name="concept_category_code" style="width: 250px !important;">
|
||||
<option value="all">- All Category -</option>
|
||||
@foreach($concept_categories as $concept_category)
|
||||
<option value="{{$concept_category->concept_category_code}}">{{$concept_category->concept_category_code}}</option>
|
||||
@endforeach
|
||||
</select>
|
||||
<button class="btn btn-md btn-inverse-secondary rounded-right-25 px-3" type="submit"><i class="fa fa-search"></i> {{__('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-concept" data-backdrop="static"><i class="typcn typcn-plus"></i> {{__('general.btn_add_new')}}</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</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" width="120px">{{__('general.code')}}</th>
|
||||
<th class="py-2">{{__('laboratory.table_name_en')}}</th>
|
||||
<th class="py-2">{{__('laboratory.table_name_kh')}}</th>
|
||||
<th class="py-2">{{__('Category')}}</th>
|
||||
<th class="py-2 text-center" width="100px">{{__('laboratory.table_status')}}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach($concepts as $k=>$concept)
|
||||
<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-concept_id="{{$concept->id}}" data-toggle="modal" data-target="#modal-concept" data-backdrop="static"><i class="typcn typcn-edit"></i></button>
|
||||
@if($concept->record_status_id==0)
|
||||
<button type="button" class="btn btn-sm btn-inverse-primary" title="Restore" onclick="restore_lab({{$concept->id}})"><i class="typcn typcn-plus"></i></button>
|
||||
@else
|
||||
<button type="button" class="btn btn-sm btn-inverse-danger " title="Delete" onclick="delete_lab({{$concept->id}})"><i class="mdi mdi-close-circle"></i></button>
|
||||
@endif
|
||||
</div>
|
||||
</td>
|
||||
<td class="py-1">{{$concept->code}}</td>
|
||||
<td class="py-1">{{$concept->name_en}}</td>
|
||||
<td class="py-1">{{$concept->name_kh}}</td>
|
||||
<td class="py-1">{{$concept->concept_category_code}}</td>
|
||||
<td class="py-1 text-center">
|
||||
<i class="mdi {{$concept->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">
|
||||
{!! $concepts->links('pagination.custom') !!}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<!-- Modal Laboratory -->
|
||||
<div class="modal mt-5 fade modal-primary" id="modal-concept">
|
||||
<div class="modal-dialog modal-lg">
|
||||
<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="concept_id" id="concept_id" value="0" />
|
||||
<div class="form-vertical">
|
||||
<div class="row">
|
||||
<div class="col-sm-12">
|
||||
<div class="form-group mb-1">
|
||||
<label for="lab-name-kh">{{__('លេខកូដ')}} <span class="text-danger"></span> </label>
|
||||
<input type="text" class="form-control form-control-sm" name="code" id="code" value="" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-sm-12">
|
||||
<div class="form-group mb-1">
|
||||
<label for="lab-name-kh">{{__('laboratory.table_name_kh')}} <span class="text-danger">*</span> </label>
|
||||
<input type="text" class="form-control form-control-sm" name="name_kh" id="name-kh" value="" placeholder="{{__('laboratory.table_name_kh')}}"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-sm-12">
|
||||
<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 rounded-right-0" name="name_en" id="name-en" value="" placeholder="{{__('laboratory.table_name_en')}}">
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-sm-12">
|
||||
<div class="form-group mb-1">
|
||||
<label for="lab-name-en">{{__('Category')}} <span class="text-danger">*</span></label>
|
||||
<select class="form-control select2-tags" name="concept_category_code" id="concept_category_code" style="width: 100% !important;">
|
||||
<option></option>
|
||||
@foreach($concept_categories as $concept_category)
|
||||
<option value="{{$concept_category->concept_category_code}}">{{$concept_category->concept_category_code}}</option>
|
||||
@endforeach
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-sm-12">
|
||||
<div class="form-group mb-1">
|
||||
<label for="lab-name-kh">{{__('បរិយាយ')}} </label>
|
||||
<textarea class="form-control" name="description" id="description"></textarea>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-success rounded-25" id="btnSave"><i class="fa fa-floppy-o"></i> <span class="save">{{__('lang.save')}}</span><span class="update" style="display: none">{{__('lang.update')}}</span></button>
|
||||
<button type="button" class="btn btn-secondary rounded-25 ml-2" data-dismiss='modal'>{{__('lang.cancel')}}</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@include('layout.footer')
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@include('layout.common_script')
|
||||
|
||||
<script>
|
||||
var save_url = "{{url('concept.save')}}";
|
||||
var update_url = "{{url('concept.update')}}";
|
||||
var delete_url = "{{url('concept.delete')}}";
|
||||
var restore_url = "{{url('concept.restore')}}";
|
||||
var get_url = "{{url('concept.get')}}";
|
||||
|
||||
let modal_add_title = "Add Catalog";
|
||||
let modal_edit_title = "Edit Catalog";
|
||||
|
||||
</script>
|
||||
<script src="{{url(env("APP_URL").'storage/assets/js/admin/concept.js?_').time()}}"></script>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
|
||||
@@ -50,4 +50,6 @@
|
||||
.select2-container--default .select2-dropdown {
|
||||
font-size: {{ Config::get('app.locale') == 'kh' ? '1.1rem' : '0.875rem' }} !important;
|
||||
}
|
||||
|
||||
|
||||
</style>
|
||||
|
||||
@@ -61,15 +61,15 @@
|
||||
</div>
|
||||
</li>
|
||||
|
||||
<li class="nav-item {{ in_array(request()->segment(1), ['laboratory-profile', 'department', 'sample-type', 'test', 'comment', 'organism', 'antibiotic', 'quantity', 'sample-source', 'patient-type', 'physician', 'lab-users']) ? 'active' : '' }}">
|
||||
<li class="nav-item {{ in_array(request()->segment(1), ['building']) ? 'active' : '' }}">
|
||||
<a class="nav-link" data-toggle="collapse" href="#lab-manager" aria-expanded="false" aria-controls="lab_manager">
|
||||
<i class="fa fa-folder-open-o menu-icon"></i>
|
||||
<span class="menu-title text-uppercase">គ្រប់គ្រងសម្ភារៈ និងបរិក្ខារ</span>
|
||||
<i class="menu-arrow"></i>
|
||||
</a>
|
||||
<div class="collapse {{ in_array(request()->segment(1), ['laboratory-profile', 'department', 'sample-type', 'test', 'comment', 'organism', 'antibiotic', 'quantity', 'sample-source', 'patient-type', 'physician', 'lab-users']) ? 'show' : '' }}" id="lab-manager">
|
||||
<div class="collapse {{ in_array(request()->segment(1), ['building']) ? 'show' : '' }}" id="lab-manager">
|
||||
<ul class="nav flex-column sub-menu">
|
||||
<li class="nav-item"> <a class="nav-link" href="">អគារ</a></li>
|
||||
<li class="nav-item"> <a class="nav-link {{request()->segment(1)=='building' ? 'active':''}}" href="{{url('building')}}">អគារ</a></li>
|
||||
<li class="nav-item"> <a class="nav-link" href="">បន្ទប់</a></li>
|
||||
<li class="nav-item"> <a class="nav-link" href="">ទូរបង្កក</a></li>
|
||||
<li class="nav-item"> <a class="nav-link" href="">ធ្នើ</a></li>
|
||||
@@ -78,15 +78,15 @@
|
||||
</div>
|
||||
</li>
|
||||
|
||||
<li class="nav-item {{ in_array(request()->segment(1), ['laboratory-profile', 'department', 'sample-type', 'test', 'comment', 'organism', 'antibiotic', 'quantity', 'sample-source', 'patient-type', 'physician', 'lab-users']) ? 'active' : '' }}">
|
||||
<li class="nav-item {{ in_array(request()->segment(1), ['concept']) ? 'active' : '' }}">
|
||||
<a class="nav-link" data-toggle="collapse" href="#catalog" aria-expanded="false" aria-controls="catalog">
|
||||
<i class="mdi mdi-cards-variant menu-icon"></i>
|
||||
<span class="menu-title text-uppercase">គ្រប់គ្រងបញ្ជីគម្រូ</span>
|
||||
<i class="menu-arrow"></i>
|
||||
</a>
|
||||
<div class="collapse {{ in_array(request()->segment(1), ['laboratory-profile', 'department', 'sample-type', 'test', 'comment', 'organism', 'antibiotic', 'quantity', 'sample-source', 'patient-type', 'physician', 'lab-users']) ? 'show' : '' }}" id="catalog">
|
||||
<div class="collapse {{ in_array(request()->segment(1), ['concept']) ? 'show' : '' }}" id="catalog">
|
||||
<ul class="nav flex-column sub-menu">
|
||||
<li class="nav-item"> <a class="nav-link" href="">បញ្ជីគម្រូ</a></li>
|
||||
<li class="nav-item"> <a class="nav-link {{request()->segment(1)=='concept' ? 'active':''}}" href="{{url('concept')}}">បញ្ជីគម្រូ</a></li>
|
||||
<li class="nav-item"> <a class="nav-link" href="">ប្រភេទសារពាង្គកាយ/មេរោគ</a></li>
|
||||
<li class="nav-item"> <a class="nav-link" href="">ប្រភេទសំណាក</a></li>
|
||||
<li class="nav-item"> <a class="nav-link" href="">ប្រភពសំណាក</a></li>
|
||||
|
||||
@@ -2,7 +2,9 @@
|
||||
|
||||
use App\Http\Controllers\AntibioticController;
|
||||
use App\Http\Controllers\BaseController;
|
||||
use App\Http\Controllers\BuildingController;
|
||||
use App\Http\Controllers\CommentController;
|
||||
use App\Http\Controllers\ConceptController;
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Http\Controllers\DashboardController;
|
||||
use App\Http\Controllers\InvoiceController;
|
||||
@@ -102,7 +104,6 @@ Route::middleware(['auth'])->group(function () {
|
||||
Route::post('/laboratory-profile/alternative-footer/remove', [OrganizationController::class, 'removeAlternativeFooter']);
|
||||
|
||||
Route::get('laboratory', [OrganizationController::class, 'index'])->name('laboratory')->middleware(VerifyBaseLab::class);
|
||||
|
||||
Route::get('laboratory/search', [OrganizationController::class, 'index'])->name('laboratory.search')->middleware(VerifyBaseLab::class);
|
||||
Route::post('laboratory.save', [OrganizationController::class, 'save'])->middleware(VerifyBaseLab::class);
|
||||
Route::post('laboratory.get', [OrganizationController::class, 'get'])->middleware(VerifyBaseLab::class);
|
||||
@@ -110,6 +111,24 @@ Route::middleware(['auth'])->group(function () {
|
||||
Route::post('laboratory.delete', [OrganizationController::class, 'delete'])->middleware(VerifyBaseLab::class);
|
||||
Route::post('laboratory.restore', [OrganizationController::class, 'restore'])->middleware(VerifyBaseLab::class);
|
||||
|
||||
|
||||
Route::get('building', [BuildingController::class, 'index'])->name('building')->middleware(VerifyBaseLab::class);
|
||||
Route::get('building/search', [BuildingController::class, 'index'])->name('building.search')->middleware(VerifyBaseLab::class);
|
||||
Route::post('building.save', [BuildingController::class, 'save'])->middleware(VerifyBaseLab::class);
|
||||
Route::post('building.get', [BuildingController::class, 'get'])->middleware(VerifyBaseLab::class);
|
||||
Route::post('building.update', [BuildingController::class, 'update'])->middleware(VerifyBaseLab::class);
|
||||
Route::post('building.delete', [BuildingController::class, 'delete'])->middleware(VerifyBaseLab::class);
|
||||
Route::post('building.restore', [BuildingController::class, 'restore'])->middleware(VerifyBaseLab::class);
|
||||
|
||||
Route::get('concept', [ConceptController::class, 'index'])->name('concept')->middleware(VerifyBaseLab::class);
|
||||
Route::get('concept/search', [ConceptController::class, 'index'])->name('concept.search')->middleware(VerifyBaseLab::class);
|
||||
Route::post('concept.save', [ConceptController::class, 'save'])->middleware(VerifyBaseLab::class);
|
||||
Route::post('concept.get', [ConceptController::class, 'get'])->middleware(VerifyBaseLab::class);
|
||||
Route::post('concept.update', [ConceptController::class, 'update'])->middleware(VerifyBaseLab::class);
|
||||
Route::post('concept.delete', [ConceptController::class, 'delete'])->middleware(VerifyBaseLab::class);
|
||||
Route::post('concept.restore', [ConceptController::class, 'restore'])->middleware(VerifyBaseLab::class);
|
||||
|
||||
|
||||
Route::get('user', [UserController::class, 'index'])->name('user')->middleware(VerifyBaseLab::class);
|
||||
Route::get('lab-users', [UserController::class, 'labUsers'])->name('lab_user')->middleware(VerifyBaseLab::class);
|
||||
Route::get('user/search', [UserController::class, 'index'])->name('user.search')->middleware(VerifyBaseLab::class);
|
||||
|
||||
Reference in New Issue
Block a user