<script src="https://code.jquery.com/jquery-3.7.1.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/5.3.0/js/bootstrap.bundle.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>
<link href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/5.3.0/css/bootstrap.min.css">
<link href="https://cdn.datatables.net/2.2.2/css/dataTables.bootstrap5.css">
<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">Project List of <b><?php echo get_username($user_id);?></b></p>
                  </span>
                </div>
              </div>
            </div>
			<div class="col-lg-12 grid-margin stretch-card">
                <div class="card">
                  <div class="card-body">
				  <?php if($this->session->flashdata('message_name') !='') { ?>
					<div class="page-header card" id="flash_data">
						<div class="row align-items-end">
							<div class="col-lg-12">
								<div class="page-header-title">
									<div class="d-inline">
										<h4><font color="red"><center><?php echo $this->session->flashdata('message_name');?></center></font></h4>
									</div>
								</div>
							</div>
						</div>
					</div>
					<?php } ?>
                    <table id="example" class="table table-bordered">
                      <thead>
						<tr>
							<th><b>Sr.no</b></th>
							<th><b>Project Name</b></th>
							<th><b>Sensors</b></th>
							
						</tr>
                      </thead>
                      <tbody>
							<?php $i=1;?>
							<?php foreach($project_list as $project) { 
							?>
							<tr>
								<td><?php echo $i;?></td>
								<td><?php echo $project['project_name'];?></td>
								<td><?php echo get_sensor_array($project['sensor_id']);?></td>
								
							</tr><?php $i++; } ?>
						</tbody>
                    </table>
                  </div>
                </div>
              </div>
             
		</div>
		<script>
		setTimeout(function() {
			$('#flash_data').fadeOut('slow');
		}, 5000);
		</script>
<script>
new DataTable('#example');
</script>		