<?php
session_start();

include('accesscheck2.php');
require_once('Connections/courier.php');
require_once 'functions/functions.php';

list($patient_no, $id) = explode("@@@", mysql_real_escape_string($_POST['id']));
$process_claim_no = mysql_real_escape_string($_POST['no']);
$medical_note_id = mysql_real_escape_string($_POST['medical_note_id']);
$PROVIDERID = $_SESSION['provider_id'];

$visit_info = mysql_fetch_assoc(mysql_query("SELECT * FROM process_claim_no WHERE process_claim_no = '$process_claim_no'"));

//echo"SELECT * FROM patient_file_attachments WHERE patient_id = '".$visit_info['patient_id']."'";
$fileAttachment = mysql_query("SELECT * FROM patient_file_attachments WHERE patient_id = '".$visit_info['patient_id']."'");

 $path = "consultation/patients_consultation_uploads/";
?>




<div class="page-bar">
 <ul class="page-breadcrumb">
  <li>
   <i class="icon-home"></i>
   <a href="index.html">Home</a>
   <i class="fa fa-angle-right"></i>
  </li>
  <li>
   <span>Dashboard</span>
  </li>
 </ul>
 <div class="page-toolbar">
  <div class="btn-group pull-right">
   <button type="button" class="btn btn-fit-height grey-salt dropdown-toggle" data-toggle="dropdown" data-hover="dropdown" data-delay="1000" data-close-others="true"> Actions
    <i class="fa fa-angle-down"></i>
   </button>
   <ul class="dropdown-menu pull-right" role="menu">
    <li onclick="process_information('view_medical_history_details_specialist','<?php echo $patient_no.'@@@'. $id;?>', '<?php echo $process_claim_no;?>', 'currentarea','<?php echo $medical_note_id;?>');">
     <a href="#">
      <i class="icon-refresh"></i> Refresh </a>
     </li>
     <li onclick="$('#patient_consultation_div').show();animationMethod('bounceInDown', '#patient_consultation_div', '#patient_medical_history_div'); $('#patient_medical_history_div_folder').hide()">
      <a href="#">
       <i class="fa fa-user-md"></i> Back to Consultation Page </a>
      </li>
      <li onclick="$('#patient_medical_history_div').show();animationMethod('bounceInDown', '#patient_medical_history_div', '#patient_consultation_div'); $('#patient_medical_history_div_folder').hide()">
       <a href="#">
        <i class="fa fa-folder-open"></i> Medical History Page</a>
       </li>

       <li onclick="$('#patient_medical_history_div_folder').show();animationMethod('bounceInDown', '#patient_medical_history_div_folder', '#patient_consultation_div'); $('#patient_consultation_div').hide()">
        <a href="#">
         <i class="fa fa-folder-open"></i> View Patient Folder</a>
        </li>
       </ul>
      </div>
     </div>
    </div>


    <div class="portlet light tasks-widget bordered" id="patient_medical_history_div" style="display: none;">
     <div class="portlet-title">
      <div class="caption">
       <i class="icon-share font-dark hide"></i>
       <span class="caption-subject font-dark bold uppercase"> 
        <span class="badge badge-info"> <i class="fa fa-user"></i> </span> PATIENT MEDICAL HISTORY 
       </span>
      </div>
     </div>
     <div class="portlet-body">
      <div id="medical_history_all" style="display:block;">
       <?php
       include 'patient_header_details.php'; 
       include ('medical_history_page.php');
       ?>
      </div>
     </div>
    </div>

    <div class="portlet light tasks-widget bordered" id="patient_medical_history_div_folder" style="display: none;">
     <div class="portlet-title">
      <div class="caption">
       <i class="icon-share font-dark hide"></i>
       <span class="caption-subject font-dark bold uppercase"> 
        <span class="badge badge-info"> <i class="fa fa-user"></i> </span> PATIENT SCANNED FOLDER 
       </span>
      </div>
     </div>
     <div class="portlet-body">
      <div id="medical_history_all">
       

        <div class="row">
         <div class="demo-gallery">
          <ul id="lightgallery" class="list-unstyled row">
           <?php  
              
           $i = 1;
           while ($mysql_fetch_assoc  = mysql_fetch_assoc($fileAttachment)) {
           $resultsImage11 = $mysql_fetch_assoc['filename'];
            $resultsImage1 = $path.$resultsImage11
            ?>
            <li class="col-xs-6 col-sm-4 col-md-3" data-responsive="<?php echo $resultsImage1 ?> 375, <?php echo $resultsImage1 ?> 480, <?php echo $resultsImage1 ?> 800" data-src="<?php echo $resultsImage1 ?>" data-sub-html="<h4>Patient Scanned Folder <?php echo $i; ?></h4><p></p>">
             <a href="">
              <img style="height:120px" class="img-responsive" src="<?php echo $resultsImage1 ?>">
             </a>
            </li>
            <?php
            $i++;
           }
           ?>


          </ul>
         </div>
        </div>

       
      </div>
     </div>
    </div>


    <form name="form" method="POST" id="patient_consultation_div">
     <div style="margin-top: -10px;" class="row">
      <div class="col-md-12 col-sm-12" id="patient_sub_page">
       <div class="portlet light tasks-widget bordered" style="min-height: 400px;" id="">
        <div class="portlet-title">
         <div class="caption">
          <i class="icon-share font-dark hide"></i>
          <span class="caption-subject font-dark bold uppercase"> <span class="badge badge-info"> 
           <?php if ($action == 'view_medical_history_details') {
            echo '<i class="fa fa-user"></i>';
           } else {
            echo '<i class="fa fa-plus-square"></i>';
           } ?>  </span> PATIENT CONSULTATION </span>
          </div>

          <div class="caption" style="float: right; display: none;" onclick="$('#patient_medical_history_div_folder').show();animationMethod('bounceInDown', '#patient_medical_history_div_folder', '#patient_consultation_div'); $('#patient_consultation_div').hide()">
          <i class="icon-share font-dark hide"></i>
          <span class="caption-subject font-dark bold uppercase"> 
           <button class="btn btn-primary"> View Patient Folder</button>
         </span>
          </div>

         </div>
         <div class="portlet-body">
          <div id="medical_history_all" style="display:block;">
           <?php
           include 'patient_header_details.php';
          include ('medical_history_symptoms_specialist.php');
           include ('medical_history_query_diagnosis_specialist.php');
           ?>
          </div>
         </div>
        </div>
       </div>
      </div>
     </form>


     <script type="text/javascript">
      $(document).ready(function(){
       $('#lightgallery').lightGallery({
        cssEasing: 'cubic-bezier(0.680, -0.550, 0.265, 1.550)'
       });
      });
     </script>