<?php 


$query="SELECT a.id,a.name,username,email,b.name AS ugroup FROM ".$prefix."employee AS a,".$prefix."usergroup AS b WHERE a.usergroup=b.usergroupID";


$userType=mysqli_query($linkid,$query);


?>


<script type="text/javascript">
/*------------------------------------Delete Student---------------------------------------------*/
 function delUser(id)
	{
	   var row=confirm("Do you want to delete this?");
	   if(row==true)
	   {
		 deleteUser(id);	 
	   }
	   else 
	   return false;
	 }
	 
	function deleteUser(id)
	{
	  var param="id="+id;
	  //alert(param);
	  $.ajax({
		type: "POST",
		url: "modules/user/delUser.php",
		data:param,
		cache: false,
		success: function(html)
		{
		//alert(html)
		$(".bar"+id).slideUp('slow', function() {$(this).remove();});
		}
		});
	 }

</script>


<div id="contentwrapper">


  <div class="main_content">


    <nav>


      <div id="jCrumbs" class="breadCrumb module">


        <ul>


          <li> <a href="#"><i class="icon-home"></i></a> </li>


          <li> <a href="#">Account Manager</a> </li>


          <li> <a href="#">User Datagrid</a> </li>


        </ul>


      </div>


    </nav>


    <div class="row-fluid">


      <div class="span12">


        <h3 class="heading">User <span style="float:right; text-decoration:none; font-size:15px;"> <a href="index.php?tab=new-user"><img src="images/details_open.png" /> New User </a> </span></li></h3>


        <table class="table table-striped table-bordered dTableR" id="dt_a">


          <thead>


            <tr>


              <th>Name</th>


              <th>Username</th>


			  <th>Email</th>


              <th>Usergroup</th>


			  <th width="20%">Action</th>


            </tr>


          </thead>


          <tbody>


            <?php 


								  if($userType)


									{


									while($mydata = mysqli_fetch_assoc($userType))


									{


								  ?>


											<tr class="bar<?php echo $mydata['id']?>">


											  <td><?php echo $mydata['name']?></td>


											  <td><?php echo $mydata['username']?></td>


											  <td><?php echo $mydata['email']?></td>


											  <td><?php echo $mydata['ugroup'];


											  ?></td>


											  <td><table width="80%" border="0">


												  <tr>


													<!--<td align="center"><a style="color:#0066CC; float:left"><img src="images/edit.png" border="0"  alt="Edit" title="Edit" width="16" height="16"></a></td>-->


													<td align="center"><a href="javascript:void(0);" onclick="delUser('<?php echo $mydata['id']?>')"   class="delete_button"><i class="icon-trash"></i></a></td>


													<td width="33%"  align="center"><a href="javascript:void(0);">


													  <?php


													 if($mydata['active']==0) echo "<img src='images/unlocked.png' alt='Unlock' title='Unlock' border='0'>";


													 else echo "<img src='images/locked.png' alt='Lock' title='Lock'  border='0'>";


													?>


                      </a> </td>


                  </tr>


                </table></td>


											  


            </tr>


				<?php 


				 }


				 } 


?>


          </tbody>


        </table>


      </div>


    </div>


  </div>


</div>


