<?php
require_once 'functions/functions.php';
$query_rsodest = "SELECT
	a.*,b.surname, b.othernames, b.id as patient_id,
	DATE_FORMAT(
		a.datetimeadded,
		'%e %b %Y %r'
	) AS datenew
FROM process_claim_no a INNER JOIN patient_information b ON a.patient_no = b.card_number WHERE b.id = '$id' ORDER BY a.datetimeadded DESC";
$rsodest = mysql_query($query_rsodest, $courier) or die(mysql_error());
$totalRows_rsodest = mysql_num_rows($rsodest);
$row_rsodest = mysql_fetch_assoc($rsodest);

 list($row_rsodest['picpath'], $row_rsodest['insurance_no1'], $row_rsodest['insurance_company1']) = patient_sub_info($row_rsodest['patient_no'], $courier);
 $picpath="../".FOLDER_NAME.$row_rsodest['picpath']; 
										  if(!$picpath){ 
											if($row_rsodest['insurance_no1']){
											$inspicpath=getpicpath($row_rsodest['insurance_company1']);
											if($inspicpath){
											$member_id=preg_replace("/[^0-9]/","",$row_rsodest['insurance_no1']);
											$picpath="../".FOLDER_NAME.$inspicpath."/".ltrim($member_id,0).".jpg";
											}else{
											$picpath="../".FOLDER_NAME."images/profile.gif";		
											}
											}else{
											$picpath="../".FOLDER_NAME."images/profile.gif";	
											}
										  }?> 
<div id="img_patient" style="cursor: pointer;" class="row" onclick="$(this).hide();$('#img_patient_2').show();">
    <div class="col-md-12 col-sm-12 col-xs-12">
        <div class="mt-widget-1">
            <div class="mt-img" style="margin-top: -20px;">
                <img style="height:80px;width: 80px;" src="<?php echo $picpath;?>"> 
            </div>
            <div class="mt-body" style="margin-top: -25px;">
                <h3 class="mt-username"><?php echo strtoupper($row_rsodest['surname']." ".$row_rsodest['othernames']); ?></h3>
                <p class="mt-user-title"> <?php echo 'VISIT NO : '. $row_rsodest['process_claim_no'];?> </p>
            </div>
        </div>
    </div>
</div>

<div id="img_patient_2" style="cursor: pointer;display: none;" class="row" onclick="$(this).hide();$('#img_patient').show();">
    <div class="col-md-12 col-sm-12 col-xs-12">
        <div class="mt-widget-1">
            <div class="mt-body">
                <h3 class="mt-username"><?php echo strtoupper($row_rsodest['surname']." ".$row_rsodest['othernames']); ?></h3>
            </div>
        </div>
    </div>
</div>
<br>