MEDICATION : @php $mediwhere[] = array('caseuniq',$casedata->caseuniq); $mediwhere[] = array('comcreate',$casedata->comcreate); $tb_casemedication = DB::table('tb_casemedication')->where($mediwhere)->first(); $medijson = jsonDecode($tb_casemedication->medi_casejson); $arr = array(); foreach($medijson as $key=>$value){ $box = strpos($key,"box"); if($box>-1){ $ex = explode('box',$key); if(!isset($arr[end($ex)])){ $arr[end($ex)] = 0; } }else{ $arr[$key] = $value; } } $countarr = count($arr); @endphp @if($tb_casemedication->medi_casejson=="[]" && $tb_casemedication->medi_other=="") N/A @else @foreach($arr as $key=>$value) @php $anesthesis = DB::table('dd_anesthesis')->where('anesthesis_id',$key)->first(); @endphp @if($key=="box0") N/A @endif @if($value==0) {{@$anesthesis->anesthesis_name}}
@else {{@$anesthesis->anesthesis_name}} {{$value}} {{@$anesthesis->anesthesis_unit}}
@endif @endforeach @if($tb_casemedication->medi_other!="") {{$tb_casemedication->medi_other}} {{$tb_casemedication->medi_otherdose}} @php $dd_unitdose = DB::table('dd_unitdose')->where('id',$tb_casemedication->medi_otherunit)->first(); @endphp {{@$dd_unitdose->name}} @endif @endif