@extends('layouts.master') @section('title', 'Project Detail') @section('style') @endsection @section('script') @endsection @section('content') @include('layouts.header') @include('layouts.header-sub') @php $hasClassification = !empty($project->project_categories) || !empty($project->project_type) || !empty($project->project_nature) || !empty($project->project_type_research) || !empty($project->project_funding_through); $hasFunding = !empty($project->project_agency) || !empty($project->project_grant) || !empty($project->project_agency_type); $hasConference = !empty($project->project_fee) || !empty($project->project_venue) || !empty($project->project_organizer) || !empty($project->project_organization); $hasTimeline = !empty($project->project_signed) || !empty($project->project_from) || !empty($project->project_to) || $extended_dates->count() > 0; $hasBudget = !empty($project->project_budget_year) || !empty($project->project_currency) || !empty($project->project_total_currency) || !empty($project->project_total_thb) || !empty($project->project_overhead) || !empty($project->project_overhead_currency) || !empty($project->project_overhead_thb) || !empty($project->project_overhead_type) || !empty($project->project_overhead_remark) || !empty($project->project_receive_currency) || !empty($project->project_receive_thb); $hasAffiliation = $schools->count() > 0 || $centers->count() > 0 || $units->count() > 0; $hasResearchOverview = !empty($project->project_abstract) || $outputs->count() > 0 || $keywords->count() > 0; $formatDate = function($date){ if(empty($date)) return '-'; try{ return \Carbon\Carbon::parse($date)->format('d M Y'); } catch(\Exception $e){ return $date; } }; $formatMoney = function($value){ if($value === null || $value === '') return '-'; return is_numeric($value) ? number_format((float)$value, 2) : $value; }; @endphp

{{ $project->project_name_en }}
@foreach($researchers as $key => $researcher) {{ trim(($researcher->researcher_title ?? '').' '.($researcher->researcher_fullname ?? '')) ?: $researcher->project_researcher_user_id }} @php break; @endphp @endforeach

{{ $form_title }}
@if($project->project_form == '6.6a')

Conference Details

General information and classification of the conference.

@else

Project Details

General information and classification of the project.

@endif
@if($hasClassification)
@if($project->project_form == '6.6a') Conference Information @else Project Information @endif
@if(!empty($project->project_categories))
Funding Category
{{ $project->project_categories }}
@endif @if(!empty($project->project_type))
@if($project->project_form == '6.6a')
Type of Conference
@else
Type of Project
@endif
{{ $project->project_type }}
@endif @if(!empty($project->project_nature))
Project Nature
{{ $project->project_nature }}
@endif @if(!empty($project->project_type_research))
Type of Research
{{ $project->project_type_research }}
@endif @if(!empty($project->project_funding_through))
Funding Through
{{ $project->project_funding_through }}
@endif @if($hasConference) @if(!empty($project->project_fee))
Registration Fee
{{ $project->project_fee }}
@endif @if(!empty($project->project_venue))
Venue
{{ $project->project_venue }}
@endif @endif
@endif @if(!empty($project->project_name_th) || !empty($project->project_name_en))
@if($project->project_form == '6.6a') Conference Title @else Project Title @endif
@if(!empty($project->project_name_en))
@if($project->project_form == '6.6a')
Conference Title (EN)
@else
Project Title (EN)
@endif
{{ $project->project_name_en }}
@endif @if(!empty($project->project_name_th))
@if($project->project_form == '6.6a')
Conference Title (TH)
@else
Project Title (TH)
@endif
{{ $project->project_name_th }}
@endif
@endif @if($hasFunding)
Funding Agency
@if(!empty($project->project_agency))
Funding Agency
{{ $project->project_agency }}
@endif @if(!empty($project->project_grant))
Title of Grant
{{ $project->project_grant }}
@endif @if(!empty($project->project_agency_type))
Type of Funding Agency
{{ $project->project_agency_type }}
@endif
@endif
{{-- =============================== Research Team =============================== --}} @if($researchers->count() > 0)
@if($project->project_form == '6.6a')

SIIT Principal Organizer

@else

Principal Investigator

@endif

Principal investigator and co-researcher portion.

@foreach($researchers as $key => $researcher) @endforeach
No.ResearcherPositionPortion
{{ $key + 1 }} {{ trim(($researcher->researcher_title ?? '').' '.($researcher->researcher_fullname ?? '')) ?: $researcher->project_researcher_user_id }} {{ $researcher->project_researcher_position }} {{ $researcher->project_researcher_portion !== null ? $researcher->project_researcher_portion.'%' : '-' }}
@if($hasConference)
Organizer / Organization
@if(!empty($project->project_organizer))
Organizer
{{ $project->project_organizer }}
@endif @if(!empty($project->project_organization))
Organization
{{ $project->project_organization }}
@endif
@endif
@endif {{-- =============================== Timeline =============================== --}} @if($hasTimeline)
@if($project->project_form == '6.6a')

Conference Timeline

Contract date, conference period and approved extensions.

@else

Project Timeline

Contract date, project period and approved extensions.

@endif
@if(!empty($project->project_signed))
Signed Date
{{ $formatDate($project->project_signed) }}
@endif @if(!empty($project->project_from))
@if($project->project_form == '6.6a')
Conference From
@else
Project Start Date
@endif
{{ $formatDate($project->project_from) }}
@endif @if(!empty($project->project_to))
@if($project->project_form == '6.6a')
Conference To
@else
Project End Date
@endif
{{ $formatDate($project->project_to) }}
@endif
@if($extended_dates->count() > 0)
Extended Date
@foreach($extended_dates as $extended)
Extension #{{ $extended->project_extended_order }}
{{ $formatDate($extended->project_extended_date) }}
@endforeach
@endif
@endif {{-- =============================== Affiliation =============================== --}} @if($hasAffiliation)

School & Research Center & Research Unit

Affiliated academic and research units for this project.

@if($schools->count() > 0)
School
@foreach($schools as $school)
{{ $school->school_name }} @if(!empty($school->school_shortname)) ({{ $school->school_shortname }}) @endif
@endforeach
@endif @if($centers->count() > 0)
Research Center
@foreach($centers as $center)
{{ $center->research_center_name }}
@endforeach
@endif @if($units->count() > 0)
Research Unit
@foreach($units as $unit)
{{ $unit->research_unit_name }}
@endforeach
@endif
@endif {{-- =============================== Budget =============================== --}} @if($hasBudget)

Project Budget

Budget, overhead and net project amount.

Total Budget
@if(!empty($project->project_budget_year))
Budget Year
{{ $project->project_budget_year }}
@endif @if(!empty($currency_name))
Currency
{{ $currency_name }}
@endif @if($project->project_total_currency !== null && $project->project_total_currency !== '')
Total Budget
{{ $formatMoney($project->project_total_currency) }} {{ $currency_name }}
@endif @if($project->project_total_thb !== null && $project->project_total_thb !== '' && $currency_name != 'THB')
Total Budget (THB)
{{ $formatMoney($project->project_total_thb) }} THB
@endif
Overhead
@if($project->project_overhead !== null && $project->project_overhead !== '')
Overhead
{{ $project->project_overhead }}{{ is_numeric($project->project_overhead) ? '%' : '' }}
@endif @if(!empty($project->project_overhead_type))
Overhead Type
{{ $project->project_overhead_type }}
@endif @if($project->project_overhead_currency !== null && $project->project_overhead_currency !== '')
Overhead Amount
{{ $formatMoney($project->project_overhead_currency) }} {{ $currency_name }}
@endif @if($project->project_overhead_thb !== null && $project->project_overhead_thb !== '' && $currency_name != 'THB')
Overhead Amount (THB)
{{ $formatMoney($project->project_overhead_thb) }} THB
@endif @if(!empty($project->project_overhead_remark))
Overhead Remark
{{ $project->project_overhead_remark }}
@endif
Total Receive
@if($project->project_receive_currency !== null && $project->project_receive_currency !== '')
Total Receive
{{ $formatMoney($project->project_receive_currency) }} {{ $currency_name }}
@endif @if($project->project_receive_thb !== null && $project->project_receive_thb !== '' && $currency_name != 'THB')
Total Receive (THB)
{{ $formatMoney($project->project_receive_thb) }} THB
@endif
@endif {{-- =============================== Research Overview =============================== --}} @if($hasResearchOverview)

Research Overview

Project abstract, expected research output and keywords.

@if(!empty($project->project_abstract))
Abstract
{{ $project->project_abstract }}
@endif @if($outputs->count() > 0)
Research Output
@foreach($outputs as $key => $output)@endforeach
No.Research OutputQuantity
{{ $key + 1 }}{{ $output->project_output_type }}{{ $output->project_output_quantity }}
@endif @if($keywords->count() > 0)
Keyword(s)
@foreach($keywords as $keyword){{ $keyword->project_keyword_name }}@endforeach
@endif
@endif {{-- =============================== Documents =============================== --}} @if($documents->count() > 0)

Project Documents

Supporting documents uploaded for this project.

@foreach($documents as $document)
{{ $document->project_document_topic }}
{{ $document->project_document_original }}
Open File
@endforeach
@endif
@include('layouts.footer') @endsection