<?php

include 'load.php';

?>


<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=0">
<meta name="description" content="POS - Payroll | Pos & Invetory System | Dashboard

">
<meta name="keywords" content="Payroll | Pos & Invetory System | Dashboard

">
<meta name="author" content="Payroll | Pos & Invetory System | Dashboard

">
<meta name="robots" content="noindex, nofollow">

<title>Appointment Receipt | Payroll | Pos & Invetory System | Dashboard

</title>


<?php
require_once 'headercss.php';
?>
</head>
<body>
<div id="global-loader">
<div class="whirly-loader"> </div>
</div>

<div class="main-wrapper">
<?php
require_once 'header.php';
?>

<?php
require_once 'navbar.php';
?>

<div class="page-wrapper">
<div class="content">
<div class="page-header">
<div class="page-title">
<h4>Appointment Receipt</h4>
<h6>your Appointment Receipt</h6>
</div>
</div>

<div class="container" style="max-width: 50rem;">
				<div class="card">
				<div class="card-body">
				<div class="row">

					<?php 
	
					if (isset($_GET['appno']))	
					{
						
					
					$appno=$_GET['appno'];

					$stmt = $DB_con->prepare('SELECT * FROM mobileappointment WHERE appno="'.$_GET['appno'].'"');

					$stmt->execute();

					if($stmt->rowCount() > 0)

					{

					while($row=$stmt->fetch(PDO::FETCH_ASSOC))

					{

					extract($row);
				
					?>
					<?php

								$stmt2 = $DB_con->prepare('SELECT * FROM mobilesettings where status="1" ORDER BY stid');

								$stmt2->execute();

								if($stmt2->rowCount() > 0)

								{

								while($row2=$stmt2->fetch(PDO::FETCH_ASSOC))

								{

								extract($row2);

								?>
								<div class="col-lg-4 col-sm-4 col-12">			
								<p class="text-center" style="font-weight;color:#2ecc40;"><?php if($row2['systemlogo']==""){$pro_img="assets/img/empty.png";}else{$pro_img="images/settings/".$row2['systemlogo'];} ?>
								<img src="<?php echo $pro_img; ?>" alt="<?php echo $row2['systemname']; ?>" style="width:120px;" /></p>
								</div>
								<div class="col-lg-8 col-sm-8 col-12">			
								<h2 class="text-center" style="font-weight:bold;color:#000000;">Friendly Paws - Animal Hostpital</h2>
								</div>
								<div class="col-lg-12 col-sm-12 col-12">
								<hr>
								<h3 class="text-center" style="font-weight:bold;color:#2ecc40;">APPOINTMENT REQUEST</h3>
								</div>
<?php 
								} 
								}
								?>
								<hr>
								<div class="col-lg-4 col-sm-4 col-12">			
								<h6 class="text-center" style="font-weight:600;color:#000000;">Appointment No : <?php echo $row['appno']; ?></h6>
								</div>
								<div class="col-lg-8 col-sm-8 col-12">			
								<h6 class="text-center" style="font-weight:600;color:#000000;">Appointment Date/Time : <?php echo date_format(date_create($row['appdate']),"M d, Y"); ?> <?php echo date_format(date_create($row['apptime']),"h:i:s A"); ?></h6>
								</div>
								<hr>
								<div class="col-lg-5 col-sm-5 col-12">			
								<h5 class="text-left" style="font-weight:bold;color:#000000;text-decoration: underline;">Patient</h5>
								<h5 class="text-left" style="font-weight:bold;color:#000000;"><?php

											  $id = $row['patient'];

											  $query = $DB_con->prepare('SELECT ptname,phonenumber,address FROM mobilepatient WHERE paid='.$id);

											  $query->execute();

											  $result = $query->fetch();

											  echo $result['ptname']."<br>".$result['phonenumber']."<br>".$result['address'];

								?></h5>
								</div>
								<div class="col-lg-4 col-sm-4 col-12">	
								<h5 class="text-right" style="font-weight:bold;color:#000000;text-decoration: underline;">Channel Doctor</h5>
								<h5 class="text-right" style="font-weight:bold;color:#000000;"><?php

											  $id = $row['doctor'];

											  $query = $DB_con->prepare('SELECT doname,position FROM mobiledoctors WHERE doid='.$id);

											  $query->execute();

											  $result = $query->fetch();

											  echo $result['doname'];

											  ?>
											  <br>
											  <?php

											  $id2 = $result['position'];

											  $query2 = $DB_con->prepare('SELECT poid,pname FROM mobileposition WHERE poid='.$id);

											  $query2->execute();

											  $result2 = $query2->fetch();

											  echo $result2['pname'];

											  ?></h5>
								</div>
								<div class="col-lg-3 col-sm-3 col-12">			
								<h6 class="text-center" style="font-weight:bold;color:#000000;text-decoration: underline;">Type Of Pets</h6>
								<h6 class="text-center" style="font-weight:bold;color:#000000;"><?php echo $row['typeofpets']; ?></h6>
								</div>
								<hr>
								<div class="col-lg-4 col-sm-4 col-12">			
								<h6 class="text-left" style="font-weight:bold;color:#000000;">Species : <?php

											  $id = $row['species'];

											  $query = $DB_con->prepare('SELECT spname FROM mobilespecies WHERE spid='.$id);

											  $query->execute();

											  $result = $query->fetch();

											  echo $result['spname'];

											  ?></h6>
								</div>
								<div class="col-lg-4 col-sm-4 col-12">			
								<h6 class="text-left" style="font-weight:bold;color:#000000;">Breed : <?php

											  $id = $row['breed'];

											  $query = $DB_con->prepare('SELECT brname FROM mobilebreed WHERE brid='.$id);

											  $query->execute();

											  $result = $query->fetch();

											  echo $result['brname'];

											  ?></h6>
								</div>
								<div class="col-lg-4 col-sm-4 col-12">			
								<h6 class="text-center" style="font-weight:bold;color:#000000;">Services : <?php

											  $id = $row['services'];

											  $query = $DB_con->prepare('SELECT sname FROM mobileservices WHERE seid='.$id);

											  $query->execute();

											  $result = $query->fetch();

											  echo $result['sname'];

											  ?></h6>
								</div>
								<hr>
								<div class="col-lg-12 col-sm-12 col-12">			
								<h5 class="text-center" style="font-weight:bold;color:#000000;text-decoration: underline;">Reason For Visit</h5>
								<p class="text-center" style="font-weight:bold;color:#000000;"><?php echo $row['message']; ?></p>
								</div>
								<hr>
								<div class="col-lg-12 col-sm-12 col-12">			
								<h6 class="text-center" style="font-weight:600;color:#000000;">Bill Date/Time : <?php echo date_format(date_create($row['add_date']),"M d, Y | h:i:s A"); ?> </h6>
								<br>
								<h2 class="text-center">THANK YOU!</h2>
								</div>
					

					<div class="row mt-4">
						<a class="btn btn-secondary col-md-4" href="home.php">BACK TO HOME</a>
						<button class="btn btn-success col-md-8" onclick="printDiv('printableArea')">PRINT POS</button>
					</div>
					
					<div id="printableArea" style="display:none;">
					
					<?php

								$stmt2 = $DB_con->prepare('SELECT * FROM mobilesettings where status="1" ORDER BY stid');

								$stmt2->execute();

								if($stmt2->rowCount() > 0)

								{

								while($row2=$stmt2->fetch(PDO::FETCH_ASSOC))

								{

								extract($row2);

								?>
								<div class="col-lg-4 col-sm-4 col-12">			
								<p class="text-center" style="font-weight;color:#2ecc40;"><?php if($row2['systemlogo']==""){$pro_img="assets/img/empty.png";}else{$pro_img="images/settings/".$row2['systemlogo'];} ?>
								<img src="<?php echo $pro_img; ?>" alt="<?php echo $row2['systemname']; ?>" style="width:120px;" /></p>
								</div>
								<div class="col-lg-8 col-sm-8 col-12">			
								<h2 class="text-center" style="font-weight:bold;color:#000000;">Friendly Paws - Animal Hostpital</h2>
								</div>
								<div class="col-lg-12 col-sm-12 col-12">
								<hr>
								<h3 class="text-center" style="font-weight:bold;color:#2ecc40;">APPOINTMENT REQUEST</h3>
								</div>
<?php 
								} 
								}
								?>
								<hr>
								<div class="col-lg-4 col-sm-4 col-12">			
								<h6 class="text-center" style="font-weight:600;color:#000000;">Appointment No : <?php echo $row['appno']; ?></h6>
								</div>
								<div class="col-lg-8 col-sm-8 col-12">			
								<h6 class="text-center" style="font-weight:600;color:#000000;">Appointment Date/Time : <?php echo date_format(date_create($row['appdate']),"M d, Y"); ?> <?php echo date_format(date_create($row['apptime']),"h:i:s A"); ?></h6>
								</div>
								<hr>
								<div class="col-lg-5 col-sm-5 col-12">			
								<h5 class="text-left" style="font-weight:bold;color:#000000;text-decoration: underline;">Patient</h5>
								<h5 class="text-left" style="font-weight:bold;color:#000000;"><?php

											  $id = $row['patient'];

											  $query = $DB_con->prepare('SELECT ptname,phonenumber,address FROM mobilepatient WHERE paid='.$id);

											  $query->execute();

											  $result = $query->fetch();

											  echo $result['ptname']."<br>".$result['phonenumber']."<br>".$result['address'];

								?></h5>
								</div>
								<div class="col-lg-4 col-sm-4 col-12">	
								<h5 class="text-right" style="font-weight:bold;color:#000000;text-decoration: underline;">Channel Doctor</h5>
								<h5 class="text-right" style="font-weight:bold;color:#000000;"><?php

											  $id = $row['doctor'];

											  $query = $DB_con->prepare('SELECT doname,position FROM mobiledoctors WHERE doid='.$id);

											  $query->execute();

											  $result = $query->fetch();

											  echo $result['doname'];

											  ?>
											  <br>
											  <?php

											  $id2 = $result['position'];

											  $query2 = $DB_con->prepare('SELECT poid,pname FROM mobileposition WHERE poid='.$id);

											  $query2->execute();

											  $result2 = $query2->fetch();

											  echo $result2['pname'];

											  ?></h5>
								</div>
								<div class="col-lg-3 col-sm-3 col-12">			
								<h6 class="text-center" style="font-weight:bold;color:#000000;text-decoration: underline;">Type Of Pets</h6>
								<h6 class="text-center" style="font-weight:bold;color:#000000;"><?php echo $row['typeofpets']; ?></h6>
								</div>
								<hr>
								<div class="col-lg-6 col-sm-6 col-12">			
								<h6 class="text-left" style="font-weight:bold;color:#000000;">Species : <?php

											  $id = $row['species'];

											  $query = $DB_con->prepare('SELECT spname FROM mobilespecies WHERE spid='.$id);

											  $query->execute();

											  $result = $query->fetch();

											  echo $result['spname'];

											  ?></h6>
								</div>
								<div class="col-lg-6 col-sm-6 col-12">			
								<h6 class="text-center" style="font-weight:bold;color:#000000;">Services : <?php

											  $id = $row['services'];

											  $query = $DB_con->prepare('SELECT sname FROM mobileservices WHERE seid='.$id);

											  $query->execute();

											  $result = $query->fetch();

											  echo $result['sname'];

											  ?></h6>
								</div>
								<hr>
								<div class="col-lg-12 col-sm-12 col-12">			
								<h5 class="text-center" style="font-weight:bold;color:#000000;text-decoration: underline;">Reason For Visit</h5>
								<p class="text-center" style="font-weight:bold;color:#000000;"><?php echo $row['message']; ?></p>
								</div>
								<hr>
								<div class="col-lg-12 col-sm-12 col-12">			
								<h6 class="text-center" style="font-weight:600;color:#000000;">Bill Date/Time : <?php echo date_format(date_create($row['add_date']),"M d, Y | h:i:s A"); ?> </h6>
								<br>
								<h2 class="text-center">THANK YOU!</h2>
								</div>
					</div>
					
					<?php 
					} 
					}
					}
					?>
			</div>
			</div>
			</div>	
        </div>

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


<script src="https://cdnjs.cloudflare.com/ajax/libs/Dropify/0.2.2/js/dropify.min.js" integrity="sha512-8QFTrG0oeOiyWo/VM9Y8kgxdlCryqhIxVeRpWSezdRRAvarxVtwLnGroJgnVW9/XBRduxO/z1GblzPrMQoeuew==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>

<script>

function printDiv(printableArea){
	
var printContents = document.getElementById(printableArea).innerHTML;
var originalContents = document.body.innerHTML;

document.body.innerHTML = printContents;

window.print();

document.body.innerHTML = originalContents;

}

</script>

<script src="assets/js/jquery-3.6.0.min.js"></script>

<script src="assets/js/feather.min.js"></script>

<script src="assets/js/jquery.slimscroll.min.js"></script>

<script src="assets/js/jquery.dataTables.min.js"></script>
<script src="assets/js/dataTables.bootstrap4.min.js"></script>

<script src="assets/js/bootstrap.bundle.min.js"></script>

<script src="assets/plugins/select2/js/select2.min.js"></script>

<script src="assets/plugins/sweetalert/sweetalert2.all.min.js"></script>
<script src="assets/plugins/sweetalert/sweetalerts.min.js"></script>

<script src="assets/js/script.js"></script>
</body>
</html>