@php $w[0] = array('billing_hn',$_GET['hn']); $w[1] = array('billing_date',$_GET['date']); $tb_casebilling = DB::table('tb_casebilling')->where($w)->first(); @endphp @if($tb_casebilling!=null) @php $d = DB::table('users')->where('user_code',$tb_casebilling->billing_doctor)->first(); $doctorname = $d->user_prefix.$d->user_firstname." ".$d->user_lastname; $p = DB::table('patient')->where('hn',$tb_casebilling->billing_hn)->first(); $patientname = $p->prefix.$p->firstname." ".$p->lastname; @endphp