<div class="breadcrumb">
    <h1>PMS Patient</h1>
    <ul>
        <li><a href="<?php echo SITE_URL.ADMIN_DIR ?>/patientlist.php">Dashboard</a></li>
        <li>PMS Patient Details</li>
    </ul>
</div>
<div class="separator-breadcrumb border-top"></div>
<!-- <div class="widget-body">
    <div class="portlet-body">
                        
    <?php //echo ($clinicDetails->clinic_onBoard=='1') ? "<div class='alert alert-success'><button data-dismiss='alert' class='close' type='button'>×</button>Clinic OnBoard done.</div>" : '' ; ?>
    <?php //echo ($clinicDetails->clinic_onBoard=='0') ? "<div class='alert alert-danger'><button data-dismiss='alert' class='close' type='button'>×</button>Clinic OnBoard pending.</div>" : '' ; ?>
    
   </div>
</div> -->
<div class="row">
   <div class="col-md-12">
       <div class="card">
        <div class="tab-content" id="myTabContent">
            <div class="tab-pane fade show active" id="invoice" role="tabpanel" aria-labelledby="invoice-tab">
                <div id="print-area">
                    <?php
                    if(count($pmspatientDetails) > 0)
                    { 
                        foreach($pmspatientDetails as $pkey => $pvalue){ ?>
                        <div class="row mb-5">
                            <div class="col-md-4 mb-3 mb-sm-0">
                                
                                <h5 class="font-weight-bold">Info</h5>
                                <b>Id</b> : <?php echo $pvalue->pmsPatient_id ?><br/>
                                <b>PracticeId</b> : <?php echo $pvalue->pmsPatient_practice_id ?><br/>
                                <b>First Name</b> : <?php echo $pvalue->pmsPatient_fname ?><br/>
                                <b>Last Name</b> : <?php echo $pvalue->pmsPatient_lname ?><br/>
                                <b>Gender</b> : <?php echo $pvalue->pmsPatient_gender ?><br/>
                                <b>Relationship</b> : <?php echo $pvalue->pmsPatient_relationship ?><br/>
                                <b>DOB</b> : <?php echo $pvalue->pmsPatient_dob ?><br/>
                                <b>Email</b> : <?php echo $pvalue->pmsPatient_email ?><br/>
                                <b>Phone</b> : <?php echo $pvalue->pmsPatient_cell ?><br/>
                                <b>WorkPhone</b> : <?php echo $pvalue->pmsPatient_workphone ?><br/>
                                <b>HomePhone</b> : <?php echo $pvalue->pmsPatient_homephone ?><br/>
                            </div>
                            

                            <div class="col-md-4">
                                <h5 class="font-weight-bold">Clinic Info</h5>
                                <?php
                                    $clinicObj = new clinic();
                                    $where = array('clinic_id='=>$pvalue->pmsPatient_clinic_id);
                                    $data = array('where'=>$where);
                                    $clinicDetails = $clinicObj->fromFields($data);

                                ?>
                                <b>Id</b> : <?php echo $clinicDetails->clinic_id ?> <br/>
                                <b>External Id</b> : <?php echo $clinicDetails->clinic_unique_id ?> <br/>
                                <b>Name</b> : <?php echo $clinicDetails->clinic_name?> <br/>
                                <b>Email</b> : <?php echo $clinicDetails->clinic_email ?>
                                <br/>
                                <b>Phone</b> : <?php echo $clinicDetails->clinic_phone ?>
                                <br/>
                                <b>Website</b> : <?php echo $clinicDetails->clinic_website ?><br/>
                                <b>Domain</b> : <?php
                                            $domainObj = new domain();
                                            $where = array('domain_id='=>$clinicDetails->clinic_domain);
                                            $data = array('where'=>$where);
                                            $domainDetails = $domainObj->fromFields($data);
                                            echo $domainDetails->domain_title;
                                 ?>
                                <br/>
                                <b>Specality</b> : <?php
                                if($clinicDetails->clinic_primary_speciality != '')
                                {
                                            $specialityObj = new speciality();
                                            $where = "speciality_id IN (".$clinicDetails->clinic_primary_speciality.") ";
                                            $data = array('where'=>$where);
                                            $specialityDetails = $specialityObj->getAllRecords($data);

                                            foreach($specialityDetails as $skey => $svalue){
                                                $specality .= $svalue->speciality_name.",";
                                            }
                                            echo rtrim($specality,",");
                                }
                                 ?>
                                <br/>
                                <b>Hygiene</b> : <?php
                                if($clinicDetails->clinic_hygiene != '')
                                {
                                            $hygieneObj = new hygiene();
                                            $where = "hygiene_id IN (".$clinicDetails->clinic_hygiene.") ";
                                            $data = array('where'=>$where);
                                            $hygieneDetails = $hygieneObj->getAllRecords($data);

                                            foreach($hygieneDetails as $hkey => $hvalue){
                                                $hygiene .= $hvalue->hygiene_title.",";
                                            }
                                            echo rtrim($hygiene,",");
                                }
                                 ?>
                                <br/>
                                <b>PmsStatus</b> : <?php echo $clinicDetails->clinic_pmsStatus;
                                 ?>
                                <br/>

                                <b>MapPms Status</b> : <?php echo $clinicDetails->clinic_mapPmsStatus;
                                 ?>
                                <br/>

                                <b>Meta data</b> : <?php echo $clinicDetails->clinic_metadata;
                                 ?>
                                <br/>

                                <b>Seo data</b> : <?php echo $clinicDetails->clinic_seodata;
                                 ?>
                                <br/>

                                <b>Setting</b> : <?php echo $clinicDetails->clinic_setting;
                                 ?>
                                <br/>
                                
                                <p></p>
                            </div>

                            <div class="col-md-4">
                                <h5 class="font-weight-bold">Practice Info</h5>
                                <?php
                                    $practiceObj = new practice();
                                    $where = array('practice_office_id='=>$pvalue->pmsPatient_practice_id);
                                    $data = array('where'=>$where);
                                    $practiceDetails = $practiceObj->fromFields($data);

                                ?>
                                <b>Id</b> : <?php echo $practiceDetails->practice_id ?> <br/>
                                <b>Name</b> : <?php echo $practiceDetails->practice_name ?> <br/>
                                <b>OfficeId</b> : <?php echo $practiceDetails->practice_office_id?> <br/>
                                <b>PMS</b> : <?php echo $practiceDetails->practice_pms ?>
                                <br/>
                                <b>Appointment Refersh Date</b> : <?php echo $practiceDetails->practice_refresh_date ?>
                                <br/>
                                <b>Patient Refersh Date</b> : <?php echo $practiceDetails->practice_prefresh_date ?><br/>

                                <b>Gurantor Refersh Date</b> : <?php echo $practiceDetails->practice_grefresh_date ?><br/>

                                <b>Writeback Status</b> : <?php echo $practiceDetails->practice_writeback ?><br/>

                                <b>Patient Writeback</b> : <?php echo $practiceDetails->practice_patientwriteback ?><br/>

                                <b>Appointment Writeback</b> : <?php echo $practiceDetails->practice_appointmentwriteback ?><br/>

                                <b>Status Writeback</b> : <?php echo $practiceDetails->practice_statuswriteback ?><br/>

                                <b>Temp Writeback</b> : <?php echo $practiceDetails->practice_tempwriteback ?><br/>

                                <b>Sync</b> : <?php echo $practiceDetails->practice_sync ?><br/>

                                <p></p>
                            </div>
                        </div>
                    <?php }    
                    }else{ 
                          echo "No records found";  
                    } ?>
    </div>
   </div> 
</div>
