<script src="//netdna.bootstrapcdn.com/bootstrap/3.0.0/js/bootstrap.min.js"></script>
<script src="//code.jquery.com/jquery-1.11.1.min.js"></script>
<script src="https://cdn.datatables.net/2.2.2/js/dataTables.js"></script>
<script src="https://cdn.datatables.net/2.2.2/js/dataTables.bootstrap5.js"></script>
  <script src="https://cdn.jsdelivr.net/npm/sweetalert2@11"></script>
<style>
td img {
  width: 20px;
  height: 20px;
  border-radius: 100%;
}
.dropdown .dropdown-menu .dropdown-item {
  font-size: 1rem;
  padding: 0.9rem 1.5rem;
}
</style>
<div class="main-panel">
	<div class="content-wrapper">
			<div class="row purchace-popup">
              <div class="col-12 stretch-card grid-margin">
                <div class="card card-secondary">
                  <span class="card-body d-lg-flex align-items-center">
                    <p class="mb-lg-0"><b>Sensor Data of "<?php echo $sensor_id;?>"</b></p>
                    <button class="close popup-dismiss ml-2">
                    </button>
                  </span>
                </div>
              </div>
            </div>
			<div class="col-lg-12 grid-margin stretch-card">
                <div class="card">
                  <div class="card-body">
				 
                    <table id="example" class="table table-bordered">
                      <thead>
						<tr>
							<th><b>Node</b></th>
							<th><b>Server Timestamp</b></th>
							<th><b>Timestamp</b></th>
							<?php $data = get_type_id($sensor_id);?>
							<?php foreach($data as $d) { ?>
							<th><?php echo $d['notes'];?></th>
							<?php } ?>
							
							
						</tr>
                      </thead>
                      <tbody>
							<?php $i=1;?>
							<?php foreach($sensor_list as $user) { ?>
							<tr>
								<td><?php echo $sensor_id;?></td>
								<td><?php echo  date("m/d/Y h:i:s A T",$user['server_timestamp']);?></td>
								<td><?php echo date("m/d/Y h:i:s A T",$user['timestamp']);?></td>
								<?php $data = get_type_id_num($sensor_id);?>
								<?php foreach($data as $d) { ?>
									<td><?php echo get_value_of_sensor($d['type_id'],$user['server_timestamp']);?></td>
									<?php } ?>
								
							</tr>
							<?php $i++; } ?>
						</tbody>
                    </table>
                  </div>
                </div>
              </div>
             
		</div>
<script src="https://cdn.datatables.net/buttons/3.2.3/js/dataTables.buttons.js"></script>
<script src="https://cdn.datatables.net/buttons/3.2.3/js/buttons.dataTables.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jszip/3.10.1/jszip.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.2.7/pdfmake.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.2.7/vfs_fonts.js"></script>
<script src="https://cdn.datatables.net/buttons/3.2.3/js/buttons.html5.min.js"></script>
<script src="https://cdn.datatables.net/buttons/3.2.3/js/buttons.print.min.js"></script>	
<script>	
new DataTable('#example', {
    layout: {
        topStart: {
            buttons: ['csv', 'excel', 'pdf']
        }
    }
});		
</script>