<?php

	$base_url = base_url ( 'admin/device_management/index' );
	
	if ( ! empty ( $_GET ) ) {
		$query_string = $_GET;
		
		if ( isset ( $query_string['order_by'] ) ) {
			unset ( $query_string['order_by'] );
		}
		
		if ( isset ( $query_string['order'] ) ) {
			unset ( $query_string['order'] );
		}
		
		if ( ! empty ( $query_string ) ) {
			$query_string = http_build_query ( $query_string );
			$base_url = $base_url . '?' . $query_string;
		}
	}
?>
<div class="row">
    <div class="col-md-12 m-b-30">
        <div class="d-block flex-nowrap align-items-center">
            <div class="page-title ">
                <h1>
                    <strong>Team Profile Details</strong>
                </h1>
               
            </div>
        </div>
    </div>
</div>
<!-- Notification -->
<div class="row">
                <div class="col-12 col-lg-4">
                    <div class="card Shadow_01 cardPrimary">
                        <div class="card-body">
                          <div class="m-auto profile_img mt-2">
                              <?php
        							   
        							    $upload_dir_path = $this->config->item( 'upload_dir_path' );
        							    if( ! empty( $user['photo'] ) && file_exists ( $upload_dir_path . 'user_images/thumb/' . $user['photo'] ) ) {
        							        $profile_img_url = base_url ( 'public/uploads/user_images/thumb/' . $user['photo'] ); 
        							        
        							    } else {
        							        $profile_img_url = base_url( 'public/admin/assets/img/default-user.pn' );
        							    }
        							    ?>
        							    <img src="<?php echo $profile_img_url; ?>" alt="" class="img-fluid">
                                
                         </div>
                           <div class="content text-center pt-3">
                                <h6 class="colorBlack mb-1">Company Name</h6>
                             <p class="colorBlack mb-1 fs-18">
                                <strong><?php echo $team['company'] ?></strong>
                        </p>
                              </div>
                    </div>
                </div>
                      </div>
                      
                <div class="col-12 col-lg-8">
                     <div class="card Shadow_01 cardPrimary">
                          <div class="card-body">
                        <h4 class="colorBlack mb-1">Personal Detail</h4>
                      <hr>
                      <ul class="list-group">
                        <li class="list-group-item d-flex justify-content-between align-items-center border-top-0 border-bottom border-left-0 border-right-0 px-0 text-black">
                         Email ID
                        <span class="fw-700 titlebrown"><strong><?php echo $team['email'] ?></strong></span>
                      </li>
                        <li class="list-group-item d-flex justify-content-between align-items-center border-top-0 border-bottom border-left-0 border-right-0 px-0">
                          Number of Employee
                          <span class="fw-700"><strong><?php echo count($members)?></strong></span>
                        </li>
                         <li class="list-group-item d-flex justify-content-between align-items-center border-top-0 border-bottom border-left-0 border-right-0 px-0">
                          Description
                        </li>
                         <li class="list-group-item d-flex justify-content-between align-items-center border-top-0 border-bottom border-left-0 border-right-0 px-0">
                          <p class="fw-700 text-black"><?php echo $team['description'] ?></p>
                        </li>
                      </ul> 
                  </div>
              </div>
        </div>        
</div>

<div class="row">
     <div class="col-lg-12">
        <div class="card">
            <div class="card-header">
                <h4 class="card-title">Emoplyee Detail</h4>
            </div>
            <div class="card-body">
                <div class="datatable-wrapper table-responsive">
                    <table class="dataTable display compact table">
                        <thead>
                            <tr>
                                <th>Image</th>
                                <th>Name</th>
                                <th>Email</a></th>
                            </tr>
                        </thead>
                       <tbody>
                             <?php
        				    foreach ( $members as $key => $user ) { ?>
                                 <tr>
                                     <td>
        							    <?php
        							   
        							    $upload_dir_path = $this->config->item( 'upload_dir_path' );
        							    if( ! empty( $user['photo'] ) && file_exists ( $upload_dir_path . 'user_images/thumb/' . $user['photo'] ) ) {
        							        $profile_img_url = base_url ( 'public/uploads/user_images/thumb/' . $user['photo'] ); 
        							    } else {
        							        $profile_img_url = base_url( 'public/admin/assets/img/default-user.png' );
        							    }
        							    ?>
        							    <img class="rounded-circle" width="35" src="<?php echo $profile_img_url; ?>" alt="">
        							</td>
        							
        							<td><?php echo $user['full_name'] ?></td>
        							<td><?php echo $user['email'] ?></td>
        						</tr>
        						<?php
        				    } ?>     
        				               
                        </tbody>
                    </table>
                </div>
            </div>
        
        </div>
    </div>
</div>

