@php $today = array('case_dateappointment','like',date("Y-m-d").'%'); $status = array('case_status',0); $case = DB::table('tb_case') ->join('users','users.id','tb_case.case_physicians01') ->join('patient','patient.hn','tb_case.case_hn') ->join('tb_procedure','tb_procedure.procedure_code', 'tb_case.case_procedurecode') ->where([$today,$status]) ->orderBy('case_id', 'desc') ->get(); $status = array('case_status',1); $case_doing = DB::table('tb_case') ->join('users','users.id','tb_case.case_physicians01') ->join('patient','patient.hn','tb_case.case_hn') ->join('tb_procedure','tb_procedure.procedure_code', 'tb_case.case_procedurecode') ->where([$today,$status]) ->orderBy('case_id', 'desc') ->get(); $status = array('case_status',2); $case_complete = DB::table('tb_case') ->join('users','users.id','tb_case.case_physicians01') ->join('patient','patient.hn','tb_case.case_hn') ->join('tb_procedure','tb_procedure.procedure_code', 'tb_case.case_procedurecode') ->where([$today,$status]) ->orderBy('case_id', 'desc') ->get(); $count_today = DB::table('tb_case') ->where([$today]) ->count(); $status = array('case_status',0); $count_regis = DB::table('tb_case') ->where([$today,$status]) ->count(); $status = array('case_status',1); $count_operation = DB::table('tb_case') ->where([$today,$status]) ->count(); $status = array('case_status',2); $count_finish = DB::table('tb_case') ->where([$today,$status]) ->count(); @endphp
โรงพยาบาลมหาราชนครราชสีมา
MAHARAT NAKHON RATCHASIMA HOSPITAL

ศูนย์ส่องกล้องระบบทางเดินอาหาร

@php $wait = count($case); $do = count($case_doing); $pust = count($case_complete); $max = max($wait,$do,$pust); foreach($case as $c){ $lastname = mb_substr($c->lastname,0,1,'UTF-8'); $s_wait[] = $c->firstname." ".$lastname; } foreach($case_doing as $c){ $lastname = mb_substr($c->lastname,0,1,'UTF-8'); $s_do[] = $c->firstname." ".$lastname; } foreach($case_complete as $c){ $lastname = mb_substr($c->lastname,0,1,'UTF-8'); $s_pust[] = $c->firstname." ".$lastname; } @endphp
@for($i=0;$i<$max;$i++) @endfor @for($x=$max;$x<=10;$x++) @endfor
รอส่องกล้อง กำลังส่องกล้อง พักพื้น
{{@$s_wait[$i]}} {{@$s_do[$i]}} {{@$s_pust[$i]}}
     
จำนวน = {{$wait}} จำนวน = {{$do}} จำนวน = {{$pust}}