<div class="content">
  <div class="container-fluid">
	<div class="row">
	  <div class="col-lg-6">
		<?
			$today_date = date("Y-m-d");
			$query = "SELECT * FROM appointment ORDER BY appointment_date DESC LIMIT 3 ";
			$sql=mysqli_query($conn,$query);
			$result=mysqli_num_rows($sql);
			$total_no_of_appointment = mysqli_num_rows(mysqli_query($conn,$query));
			if($result>0){
		?>
		<div class="card">
		  <div class="card-header border-0">
			<div class="d-flex justify-content-between">
			  <h3 class="card-title">Latest Appointment(<?=$total_no_of_appointment;?>)</h3>
			</div>
		  </div>
		  <div class="card-body table-responsive p-0">
			
			<table class="table table-striped table-valign-middle">
			  <thead>
			  <tr>                    
				<th>Description</th>
				<th>Consultant</th>
				<th>Date</th>
			  </tr>
			  </thead>
			  <tbody>
			  <?
				while($row = mysqli_fetch_array($sql)){
			  ?>
			  <tr>                    
				<td>
					<?php 
						$appointtextchar = utility::ellipsis(ucfirst($row['appointment_text']),50);
						echo '<span title="'.ucfirst($row['appointment_text']).'">'.$appointtextchar.'</span>';
						//echo $appointtextchar;
						//echo strlen($appointtextchar);	
						if(strlen($appointtextchar) >= 15){
					?>
					<a class="hide" href="<?php echo $siteURL ?>/appointment/index?page=view_appointment_for_admin">View More</a>
					<?}?>
				</td>
				<td><?php echo Admin::getAdminsById($row['admin_id']); ?></td>
				<td><?php echo utility::getFormatedDateReturn($row['appointment_date']); ?></td>
			  </tr>
			  <? } ?>
			  </tbody>
			</table>
			
		  </div>
		</div>
		<? } ?>
        <!-- /.card -->
	  </div>
	</div>
  </div>
</div>