<?php 
include_once('../libs/functions.php');
if($cdoctorDetails && $cdoctorDetails > 0 )
{ 
    foreach ($cdoctorDetails as $key => $value)
    {  ?>
        <div class="breadcrumb">
            <h1><a href="<?php echo SITE_URL.ADMIN_DIR ?>/doctorlist.php">Doctor</a></h1>
            <ul>
                <li><a href="">Dashboard</a></li>
                <li>Doctor Details</li>
            </ul>
        </div>
        <div class="separator-breadcrumb border-top"></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">
                                    <div class="row">
                                        <div class="col-md-4">
                                            <h5 class="font-weight-bold">Docotr Certificate</h5>
                                            <?php
                                            $cdoctorcertificate = json_decode($value->cdoctor_certificate,1);  
                                            if($cdoctorcertificate && $cdoctorcertificate > 0 ){
                                                
                                                foreach ($cdoctorcertificate as $cdckey => $certificate_data) 
                                                {
                                                    echo '<b>Degree : </b>'.$certificate_data['degree'].'<br/><b>College : </b>'.$certificate_data['college'].'<br/><b>Year : </b>'.$certificate_data['year'];
                                                }
                                            ?>
                                            <?php } ?>
                                        </div>
                                        <div class="col-md-2">
                                            <h5 class="font-weight-bold">Docotr ShareData</h5>
                                            <?php
                                            $cdoctorsharedata = json_decode($value->cdoctor_sharedata,1); 

                                            if($cdoctorsharedata && $cdoctorsharedata > 0 ){
                                                echo $value->cdoctor_sharedata;
                                                /*foreach ($cdoctorsharedata as $srkey => $sharedata) 
                                                {
                                                    $doc_sharedata.= '<b>existing : </b>'.$sharedata['existing'];
                                                    '<br/><b>new : </b>'.$sharedata['new'].'<br/><b>Insured : </b>'.$sharedata['newPatientCriteria']['insured'].'<br/><b>Cash</b>'.$sharedata['newPatientCriteria']['cash'].'<br/><b>SocialAsstistance</b>'.$sharedata['newPatientCriteria']['socialAsstistance'];
                                                }*/
                                                
                                            ?>
                                            <?php } ?>
                                        </div>
                                        <!-- <p><b>share Data</b> : <?php //echo $value->cdoctor_sharedata; ?></p> -->
                                        <div class="col-md-6 text-sm-right">
                                            <p><b>onBoard</b> : <?php echo $value->cdoctor_onBoard; ?></p>
                                            <p><b>Createdat</b> : <?php echo $value->cdoctor_created_at; ?></p>
                                            <p><b>Updatedat</b> : <?php echo $value->cdoctor_updated_at; ?></p>
                                            
                                        </div>

                                    </div>
                                    <div class="mt-3 mb-4 border-top"></div>
                                    <?php 
                                    //print_r($appointmentDetails);exit;
                                 
                                    //$all_requestdata = json_decode($value->appointment_requestData,1);
                                    $cdoctorhours = json_decode($value->cdoctor_hours,1);
                                    
                                    $cdoctoreducation = json_decode($value->cdoctor_education,1);
                                    ?>
                                    <div class="row mb-5">
                                        <div class="col-md-4 mb-3 mb-sm-0">
                                            <h5 class="font-weight-bold">Services</h5>
                                            <?php
                                                $ServiceName = "";
                                                $servicesObj =  new  service();
                                                $where = "service_id IN (".$value->cdoctor_services.")";
                                                $servicesArg = array('where'=>$where);
                                                $servicesdata = $servicesObj->getAllRecords($servicesArg);
                                                
                                                foreach ($servicesdata as $skey => $service_data) {
                                                     $ServiceName .= $service_data->service_name.",";    
                                                }
                                                echo $ServiceName;
                                            ?>
                                        </div> 
                                        
                                        <div class="col-md-4">
                                            <h5 class="font-weight-bold">Docotr Hours</h5>
                                            <?php
                                            //print_r($all_metadata);exit;
                                            //echo json_encode($value->cdoctor_hours,JSON_PRETTY_PRINT);
                                            if($cdoctorhours && $cdoctorhours > 0 )
                                            { 
                                                
                                                foreach ($cdoctorhours as $cdkey => $doc_hours) 
                                                {

                                                    echo $doc_hours['id']." : ".$doc_hours['startHour']." To ".$doc_hours['endHour'].'<br/>';
                                                }
                                            }
                                            ?>
                                            
                                        </div>

                                        <!-- <div class="col-md-4">
                                            <h5 class="font-weight-bold">Docotr Certificate</h5>
                                            <?php  if($cdoctorcertificate && $cdoctorcertificate > 0 ){
                                                
                                                foreach ($cdoctorcertificate as $cdckey => $certificate_data) 
                                                {
                                                    //echo '<b>Degree : </b>'.$certificate_data['degree'].'<br/><b>College : </b>'.$certificate_data['college'].'<br/><b>Year : </b>'.$certificate_data['year'];
                                                }
                                            ?>
                                            <?php } ?>
                                        </div> -->

                                        <div class="col-md-4">
                                            <h5 class="font-weight-bold">Docotr Education</h5>
                                            <?php  if($cdoctoreducation && $cdoctoreducation > 0 ){
                                                
                                                foreach ($cdoctoreducation as $cdckey => $education_data) 
                                                {
                                                    echo '<b>AssociationName : </b>'.$education_data['associationName'].'<br/><b>Recevie Date : </b>'.$education_data['receviedDate'].'<br/><b>Registration Number : </b>'.$education_data['registrationNumber'];
                                                }
                                            ?>
                                            <?php } ?>
                                        </div>   
                                    </div>
                        </div>
                    </div>
                </div>
            </div>
           </div> 
        </div>
<?php
    }  
} ?>