<?php
// Include main file
include_once('../libs/main.php');
// Check admin Login
include_once('checkLogin.php');
// Logical section of page
$practiceObj =  new  practice();
    
if(isset($_REQUEST['act']) && $_REQUEST['act']=='healthcheck' && isset($_REQUEST['practice_office_id']))
{
    $evnt_type = "health_check";
    $app = array(
          "app_id"=>sikka::APPID,
          "app_key"=>sikka::APPKEY
        );
    
    $param = array_merge($app);
    $curlParam =array(
        "endpoint" =>sikka::ENDPOINT_AUTH,
        "event"=>$evnt_type,
        "healthcheck"=>$_REQUEST['practice_office_id'],
        "query_data"=>$param
        );
    
    $status = sikka::curlRequestSikka($curlParam);
    
    if(!empty($status))
    {
        /*$status_data = json_decode(json_encode($status),true); 
            
        echo '<div style="float:right;"><b>Total Count</b> :'.$status_data[0]['total_count'].'</div>';
        echo "<pre>";
        print_r($status_data);
        echo "</pre>";
        exit;     */

        //print_r($status[0]['items']);
        foreach ($status[0]['items'][0] as $key => $value) 
        {
            echo "<b>".$key."</b> : ".$value."<br/>";
            
        }
        exit;
    }else{
        echo "No records found";
        exit;
    }

}

// Include Template 
include_once('../libs/routs.php');
?>