<?php 
include('../config/config.php');
include("../classes/classShift.php");
include("../classes/classDoctor.php");
include("../classes/classVisits.php");
include('../classes/classPatient.php');
include("../classes/classImages.php");
include('../classes/classTransaction.php');




if(isset($_GET['visitid'])&&$_GET['visitid']!='')
{
	$_SESSION['temp']['visit_id'] = base64_decode($_GET['visitid']);
}
if(isset($_GET['patientid'])&&$_GET['patientid']!='')
{
	$_SESSION['temp']['patient_id'] = base64_decode($_GET['patientid']);
}
if(isset($_GET['doctorid'])&&$_GET['doctorid']!='')
{
	$_SESSION['temp']['doctorid'] = base64_decode($_GET['doctorid']);
}


if(isset($_SESSION['temp']['doctorid'])&&$_SESSION['temp']['doctorid']!='')
{
	$doctor_id = $_SESSION['temp']['doctorid'];
}
if(isset($_SESSION['temp']['patient_id'])&&$_SESSION['temp']['patient_id']!='')
{
	$patient_id = $_SESSION['temp']['patient_id'];
}
if(isset($_SESSION['temp']['visit_id'])&&$_SESSION['temp']['visit_id']!='')
{
	$visit_id = $_SESSION['temp']['visit_id'];
}





///////////// retrieve things ////////////////////////////////////////

try
{

	
	///////////// retrieve patient single data ///////////////////////////////
	
	$retrievePatientOb = new classPatient;
	$retrievePatientOb->setPatientAutoID($patient_id);
	$patient_single_detail = $retrievePatientOb->retrievePatientByPatientID();
	
	$patient_age = $retrievePatientOb->age_from_dob($patient_single_detail[0]['dob']);
	
	
///////////// retrieve doctor Detail ////////////////////////////////////////

/*try
{
	$doctorOb = new classDoctor;
	$doctorOb->setDoctorID($doctor_id);
	$doctor_detail = $doctorOb->retrieveDoctorByDoctorID();
	
	$doctor_name = $doctor_detail[0]['title'].'. '.$doctor_detail[0]['doc_fname'].' '.$doctor_detail[0]['doc_lname'];
	
	$doctor_acc_id = $doctor_detail[0]['account_id'];
	
}
catch (MyException $e)
{
	$error_message = $e->getUserMsg();
}	*/

	///////////// retrieve patient image ///////////////////////////////
	
	$imageRetrieveOb = new classImages;
	$imageRetrieveOb->setPatientAutoID($patient_id);
	$image_id = $imageRetrieveOb->fetchImageOfPatient();
	
}
catch (MyException $e)
{
	$error_message = $e->getUserMsg();
}	


/*echo '<pre>';
print_r($_POST);
echo '</pre>';*/

?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

    <link rel="shortcut icon" href="../images/favicon.png">
    <title>Med2TEC Hospital Management Information System</title> 
    <link href="../css/print.css" rel="stylesheet">
    <link rel="stylesheet" href="../datepicker/jquery-ui.css">  
    <script type="text/javascript" src="../datepicker/jquery-1.9.1.js"></script>
	<script type="text/javascript" src="../datepicker/jquery-ui.js"></script> 
</head>
<body> 
<div align="right">
 <SCRIPT LANGUAGE="JavaScript">  
if (window.print) {
document.write('<form class="no-print"><input type=button name=print value="Print" onClick="window.print()"></form>');
}
</script></div>

<section class="wrapper">
<img alt="" src="../images/org_print_logos/<?php echo $_SESSION['security']['org_id']?>.png" style="width:100%;">

	<div class="row">
    <section class="panel">
    <header class="panel-heading">
    </header>

    <br />
    <!-- page start-->
    <div class="row">
    <h2>DISCHARGE SLIP</h2>
      <header class="panel-heading"></header>
        <?php
        if(isset($error_message)&&$error_message!='')
        {
            ?>
            <br /><span class="message_red"><?php echo $error_message;?></span>
            <?php
        }
        ?>
      
        <table width="100%" border="0" cellpadding="10" cellspacing="10">
        <tr>
        <td>Discharging Doctor: <br />
        	Discharging Unit: <br><br>
            
            Admitted at: <br>
            Discharge Date/Time:</td>
            </tr>
        
        <tr>
          <td><table width="100%" border="0"  cellpadding="0" cellspacing="0" style="border-bottom:1px solid #999; border-top:1px solid #999; font-size:14px;">
            <tr>
              <td width="20%">Patient ID:</td>
              <td width="30%"><?php echo $patient_single_detail[0]['patient_id']; ?></td>
               <td width="20%">Gender:</td>
                <td width="30%"><?php echo $patient_single_detail[0]['gender'];?></td>
              </tr>
            <tr>
              <td>Patient Name:</td>
              <td><?php echo $patient_single_detail[0]['patient_fname'].' '.$patient_single_detail[0]['patient_lname'];?></td>
              <td width="16%">Date:</td>
              <td width="23%"><?php //echo date('d M Y',$visit_array[0]['visit_date']); ?></td>
              </tr>
            <tr>
              <td>s/d/w of:</td>
              <td><?php echo $patient_single_detail[0]['parent_name'];?></td>
              <td>Visit ID:</td>
              <td>OPD-<?php //echo $visit_id;?></td>
              </tr>
            <tr>
              <td>Age:</td>
              <td><?php echo $patient_age;?></td>
              <td>Phone:</td>
              <td><?php echo $patient_single_detail[0]['phone'];?></td>
              </tr>
            </table></td>
          </tr>
          
        <tr>
          <td><table width="100%" border="0" cellspacing="5" cellpadding="5">
  <tr>
    <td>Final Diagnosis:</td>
  </tr>
  
  <tr>
    <td>Referred to:</td>
  </tr>
  
  <tr>
    <td>Follow up Required:</td>
  </tr>
  
  <tr>
    <td>Discharging Doctor:</td>
  </tr>
  
  <tr>
    <td>Discharging Unit:</td>
  </tr>
  
  
</table>

          
          </td>
          </tr>
          
        </table>
        
    </div>
      <!-- page end-->
    </section>
	</div>

</section>
<p align="center" style="font-size:12px; font-family:Arial, Helvetica, sans-serif; margin-top:260px;">
<br />For Appointment call at 042-35151666 (bring your Patient ID Card)</p>

<style>


#block{
    display:block;
    margin:auto;
    position:absolute;
	float:right;
    }

#text {
    padding:0;
    margin:0;
    position:relative;
    font-size:9px;
    -webkit-transform: rotate(-90deg);
    -moz-transform: rotate(-90deg);
    -ms-transform: rotate(-90deg);
    -o-transform: rotate(-90deg);
	left: 880px; top: 348px;
}
</style>
<!--<div class="sidepop" style="float:right;">
    <div class="sidepopbutton stemp"><div style="color:#000; text-align:right; font-size:9px;">© Software designed by Softusion Inc. Contact us at 0322 6155 219</div>   
    </div>
</div>-->


          
</body>
</html>

