<?php
require_once("header.php");
require_once("menu.php");
$databaseService = new DatabaseService();
$con = $databaseService->getConnection();

if(isset($_REQUEST['del']))
{
    $team_id = base64_decode($_REQUEST['del']);
    $team_status = '0';
    $ex = $obj->softdel_team($team_id,$team_status);
    echo '<script>window.location="team.php"</script>';
}

?>

<div id="layoutSidenav_content">
<main class="mt-4">
    <div class="container-fluid">        
        <div class="card mb-4">
            <div class="card-header">
                <i class="fas fa-users mr-1"></i>Team Member List
                <a href="add_team.php" class="btn btn-primary btn-sm float-right add_right">Add New Member</a>
            </div>
            <div class="card-body">
                <div class="table-responsive">
                    <table class="table table-bordered" id="dataTable" width="100%" cellspacing="0">
                        <thead>
                            <tr>
							    <th>Profile pic</th>
                                <th>Name</th>
								<th>Email</th>
								<th>Phone</th>
                                <th>Action</th>
                            </tr>
                        </thead>
                        <tbody>
                            <?php
                            $ex = $obj->view_team();
                            while($row=mysqli_fetch_array($ex))
                            {
                            ?>
                            <tr>
							    <td><img src="<?php echo ucwords($row['team_profile']);?>" style="width: 100px;"></td>
                                <td><?php echo ucwords($row['team_name']);?></td>
								<td><?php echo ucwords($row['team_email']);?></td>
								<td><?php echo ucwords($row['team_contact_no']);?></td>
								
                                <td>
                                    <a href="add_team.php?edit=<?php echo base64_encode($row['team_id']);?>" class="btn btn-primary btn-sm edit_right"><i class="fas fa-pencil-alt"></i></a>
                                    <a href="team.php?del=<?php echo base64_encode($row['team_id']);?>" class="btn btn-danger btn-sm delete_right"><i class="fas fa-trash"></i></a>
                                    <a href="view_team_details.php?id=<?php echo base64_encode($row['team_id']);?>" class="btn btn-info btn-sm " title="Edit"><i class="fa fa-eye"></i></a>
								</td>
                            </tr>
                            <?php } ?>
                        </tbody>
                    </table>
                </div>
            </div>
        </div>
    </div>
</main>



<?php require_once("footer.php");?>


