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

$process_claim_no = $_GET['num'];
$receiptno = $_GET['receipt'];
$typeofvisit = $_GET['visit'];
$print_options = $_GET['print_options'];

$patient_info_r = mysql_fetch_assoc(mysql_query("SELECT attending_officer, patient_no FROM process_claim_no WHERE process_claim_no='$process_claim_no'"));
$patient_no = $patient_info_r['patient_no'];


if ($typeofvisit != 'Guest') {
    $query_claim = "select * from claims_details where process_claim_no='$process_claim_no' AND item_service='Drugs' order by receipt_number";
    $patient_info = mysql_fetch_assoc(mysql_query("SELECT * FROM patient_information WHERE card_number='$patient_no'"));
} else {
    $query_claim = "select * from claims_details where process_claim_no='$process_claim_no'  AND item_service='Drugs' order by receipt_number";
    $patient_info = mysql_fetch_assoc(mysql_query("SELECT * FROM guest_patients WHERE card_number='$patient_no'"));
}
	$drugs_prescription = mysql_query($query_claim);
?>


<head>
        <meta charset="utf-8" />
        <title> Drug Prescription </title>
        <meta http-equiv="X-UA-Compatible" content="IE=edge">
        <meta content="width=device-width, initial-scale=0" name="viewport" />
        <meta content="" name="description" />
        <meta content="" name="author" />
        <link href="http://fonts.googleapis.com/css?family=Open+Sans:400,300,600,700&subset=all" rel="stylesheet" type="text/css" media="all" />
        <link href="../assets/global/plugins/bootstrap/css/bootstrap.min.css" rel="stylesheet" type="text/css" media="all"/>
</head>

<div class="col-md-12" id="print_button"><br></br>
		<button onclick="window.print();" class="btn green" style="float:right;">Print Prescription</button>
</div>
<style type="text/css" media="print">
	#print_button{
		display:none;
	}
	@page {
    margin: 0;
}
</style>

<style type="text/css" media="all">
body{
	margin:0px;
}
    .text-danger strong {
    		color: #9f181c;
		}
		.receipt-main {
			background: #ffffff none repeat scroll 0 0;
			border-bottom: 12px solid #333333;
			border-top: 12px solid #9f181c;
			/* margin-top: 50px; */
			/* margin-bottom: 50px; */
			/* padding: 40px 30px !important; */
			position: relative;
			/* box-shadow: 0 1px 21px #acacac; */
			color: #333333;
			font-family: open sans;
		}
		.receipt-main p {
			color: #333333;
			font-family: open sans;
			line-height: 1.42857;
		}
		.receipt-footer h1 {
			font-size: 15px;
			font-weight: 400 !important;
			margin: 0 !important;
		}
		.receipt-main::after {
			background: #414143 none repeat scroll 0 0;
			content: "";
			height: 5px;
			left: 0;
			position: absolute;
			right: 0;
			top: -13px;
		}
		.receipt-main thead {
			background: #414143 none repeat scroll 0 0;
		}
		.receipt-main thead th {
			color:#fff;
		}
		.receipt-main .amount {
                        text-align: right
		}
		.receipt-right h5 {
			font-size: 16px;
			font-weight: bold;
			margin: 0 0 7px 0;
		}
		.receipt-right p {
			font-size: 12px;
			margin: 0px;
		}
		.receipt-right p i {
			text-align: center;
			width: 18px;
		}
		.receipt-main td {
			padding: 9px 20px !important;
		}
		.receipt-main th {
			padding: 12px 15px !important;
		}
		.receipt-main td {
			font-size: 13px;
			font-weight: initial !important;
		}
		.receipt-main td p:last-child {
			margin: 0;
			padding: 0;
		}	
		.receipt-main td h2 {
			font-size: 20px;
			font-weight: 900;
			margin: 0;
			text-transform: uppercase;
		}
		.receipt-header-mid .receipt-left h1 {
			font-weight: 100;
			/* margin: 34px 0 0; */
			text-align: right;
			text-transform: uppercase;
		}
		.receipt-header-mid .receipt-left h3 {
			font-weight: 100;
			/* margin: 34px 0 0; */
			text-align: right;
			text-transform: uppercase;
		}
		.receipt-header-mid {
			/* margin: 24px 0; */
			/* overflow: hidden; */
		}
		
		#container {
			background-color: #dcdcdc;
		}
</style>




<div class="container-fluid">
	<div class="row">
		
	<div class="receipt-main col-xs-10 col-sm-10 col-md-8 col-xs-offset-1 col-sm-offset-1 col-md-offset-2">
	<div class="row">
		<div class="receipt-header">
			<div class="col-xs-6 col-sm-6 col-md-6">
				<div class="receipt-left">
					<img class="img-responsive" src="../images/app_pics/rns_logo.jpeg" style="width: 71px;">
				</div>
			</div>
			<div class="col-xs-6 col-sm-6 col-md-6 text-right">
				<div class="receipt-right">
					<h5>ROBERT AND SONS LTD.</h5>
					<p>(+233) 050 - 1519111 <i class="fa fa-phone"></i></p>
					<p>INFO@ROBERTANDSONOPTICAL.COM <i class="fa fa-envelope-o"></i></p>
					<p>ADABRAKA BRANCH <i class="fa fa-location-arrow"></i></p>
				</div>
			</div>
		</div>
	</div>
	
	<div class="row">
		<div class="receipt-header receipt-header-mid">
			<div class="col-xs-8 col-sm-8 col-md-8 text-left">
				<div class="receipt-right">
					<h5> <?php echo $patient_info['othernames'].' '.$patient_info['surname']; ?> <small>  |   Visit No : <?php echo $process_claim_no; ?> </small></h5>
					<p><b>Mobile :</b> <?php echo $patient_info['tel']; ?> </p>
					<!-- <p><b>Email :</b> <?php if(!empty($patient_info['email'])){echo $patient_info['email'];}else{echo 'N/A';} ?></p> -->
				</div>
			</div>
			<div class="col-xs-4 col-sm-4 col-md-4">
				<div class="receipt-left">
					<h3>Drug Prescription</h3>
				</div>
			</div>
		</div>
	</div>
			
            <div>
			<table class="table table-bordered">
                        <thead>
                            <tr>
                                <th>Drug Name</th>
                                <th> Dose </th>
                                <th> Unit </th>
                                <th> Freq </th>
                                <th> Days </th>
                            </tr>
                        </thead>
                        <tbody>
					<?php while($row = mysql_fetch_assoc($drugs_prescription)) { ?>
                            <tr>
                                <td> <label> <?php echo $row['item']; ?> </label> </td> 
                                <td><?php echo $row['dose']; ?> </td> 
                                <td> <?php echo $row['dosage_form']; ?> </td> 
                                <td> <?php echo $row['frequency']; ?> </td> 
                                <td> <?php echo $row['no_of_days']; ?> </td> 
							</tr>
					<?php } ?>
                        </tbody>
                    </table>
            </div>

			<div class="row">
				<div class="receipt-header receipt-header-mid receipt-footer">
					<div class="col-xs-8 col-sm-8 col-md-8 text-left">
						<div class="receipt-right">
                                                    <p><b>Date :</b> <?php echo date('jS F, Y g:ia'); ?> </p>
						</div>
					</div>
					<div class="col-xs-4 col-sm-4 col-md-4">
						<p style="white-space: nowrap"><b style="white-space: nowrap"><?php echo $patient_info_r['attending_officer']; ?> <p><b>
							<p>
							Sign:...........................
							</p>
					</div>
				</div>
            </div>
			
        </div>    
	</div>
</div>