<?php include('session.php'); ?>
<!DOCTYPE html>
<html>
<head>

	<title>Chat</title>
	
	
	 <meta content="width=device-width, initial-scale=1.0" name="viewport">
	
	<link rel="icon" href="../upload/Bicol_University.png" type="image/ico">
    <!-- Bootstrap 3.3.5 -->
 <!-- Bootstrap 3.3.5 -->
<link href="../css/dataTables.bootstrap.css" rel="stylesheet">
	<link href="../css/dataTables.responsive.css" rel="stylesheet">
	
	 <meta content="width=device-width, initial-scale=1.0" name="viewport">
	
	<link href="../css/dataTables.bootstrap.css" rel="stylesheet">
	<link href="../css/dataTables.responsive.css" rel="stylesheet">
<link rel="stylesheet" href="../bootstrap/css/bootstrap.min.css">
    <!-- Font Awesome -->
    <link rel="stylesheet" href="../plugins/datatables/dataTables.bootstrap.css">
    <link rel="stylesheet" href="../dist/css/AdminLTE.min.css">
    <link rel="stylesheet" href="../plugins/select2/select2.min.css">
	
	
	 <script src="https://unpkg.com/boxicons@2.1.4/dist/boxicons.js"></script>
	<link href='https://unpkg.com/boxicons@2.1.4/css/boxicons.min.css' rel='stylesheet'>
	
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
    <link rel="stylesheet" href="font-awesome.min.css">
	
		<script src="jquery.min.js"></script>
	<script src="bootstrap.min.js"></script>
		
		<?php include('../dist/includes/nice.php'); ?>
	
   
</head>
<body style="background-color: #ECF0F5;">
<style>
    
.show-menu {
    font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
    text-decoration: none;
    color: #fff;
   
    text-align: center;
    padding: 10px 0;
    display: none;
}
/*Hide checkbox*/
input[type=checkbox]{
    display: none;
}
/*Show menu when invisible checkbox is checked*/
input[type=checkbox]:checked ~ #menu{
    display: block;
}
/*Responsive Styles*/
@media screen and (max-width : 760px){
    /*Make dropdown links appear inline*/
    #menu {
        position: static;
        display: none;
    }
    ul {
        position: static;
        display: block;
    }
    /*Create vertical spacing*/
    li {
        margin-bottom: 1px;
    }
    /*Make all menu links full width*/
    ul li, li a {
        width: 100%;
    }
    /*Display 'show menu' link*/
    .show-menu {
        display:block;
    }
	
	
	
}
</style>


<style>

						ul li ul li a {display:block !important;} 
						ul li ul li:hover {
							background-color:#337AB7;
							color:black;
							}
						#kid {
background-color:#3C8DBC;
							color:black;
						}							
							.navbar-nav li a:hover
{
    background-color: #337AB7;
	color:black;
}

 .dropdown-menu li a:hover
{
    background-color: #337AB7;
	color:black;
}

#menu li a:hover{
	background-color:#337AB7;
							
}

#tarzan li ul li a:hover{
	background-color:#337AB7;
							
}

#walk:not(:hover{
	
	background-color:yellow;
)}

  .newstyle {
            color: white;
        }

						</style>



           <header class="main-header" style="background-color: #3C8DBC;">
        <nav class="navbar navbar-static-top" style="background-color: #3C8DBC;">
		
          <div class="container" style="background-color: yellow;width:100%; margin-left:-50px;">
            <a href="home.php" class="navbar-brand" style="margin-left:5px">     <b><i  class="glyphicon glyphicon-user"></i> <?php echo $branch_name;?> </b></a>
             
            <div class="navbar-header" style="padding-left:25"> <img src="../dist/img/bulogo.png" alt="avatar" width="52" style="border-radius:50%;" height="52" >
            
            <span>&nbsp </span> <span>&nbsp </span> 
            </div>
  
            <!-- Navbar Right Menu -->
              <div class="navbar-custom-menu-left">
                <label for="show-menu"  class="show-menu" style="margin-left:300px;margin-top:-45px;position:absolute;"><i class="fa fa-bars"></i></label>
    <input type="checkbox" id="show-menu" role="button">
	
                <ul class="nav navbar-nav" id="menu">
				
				
				      <li class="" >
             <a href="../pages/home.php" style="color:white;font-size:12px; " class="dropdown-toggle">
                             <i href="../pages/home.php" class="glyphicon glyphicon-home text-orange"></i> Home
                            </a>
                          </li>
						  <li>
						 <a href="../pages/addannouncement.php" style="color:white;font-size:12px;" class="dropdown-toggle">
                              <i class="glyphicon glyphicon-envelope text-orange"></i> Add Announcements
                            </a>
                          </li>
				   
				   
				   
				   <li >
                    <!-- Menu toggle button -->
                    <a href="../pages/professorsetschedule.php" style="color:white;font-size:12px;" class="dropdown-toggle">
                      <i class="glyphicon glyphicon-stats text-orange"></i> Schedule
                     
                    </a>
                    
						  
						
						  
				
                  </li>
                  <!-- Tasks Menu -->
				  
				  
				    <li class="">
                
                    <a href="../pages/professordrive.php" class="dropdown-toggle" style="color:white;font-size:12px;">
                      <i class="glyphicon glyphicon-th-list text-orange"></i>
       Drive
                    </a>
                  </li>
				  
				  
				  
				    <li class="">
                
                    <a href="../admin/user.php" class="dropdown-toggle" style="color:white;font-size:12px;">
                      <i class="glyphicon glyphicon-list-alt text-orange"></i>
                      Add Users
                    </a>
                  </li>
				  
				  
				  
				     <li class="">
                
                    <a href="../pages/professorsetgroup.php" class="dropdown-toggle" style="color:white;font-size:12px;">
                      <i class="glyphicon glyphicon-list-alt text-orange"></i>
                      Set Group
                    </a>
                  </li>
				  
				     <li class="">
                
                    <a href="../pages/professorassignlistadd.php" class="dropdown-toggle" style="color:white;font-size:12px;">
                      <i class="glyphicon glyphicon-list-alt text-orange"></i>
                      Assign List
                    </a>
                  </li>
				  
				  
                 
				  				  
				  <?php
include('../dist/includes/dbcon.php');

$idko=$_SESSION['id'];
$query=mysqli_query($con,"select * from user where user_id='$idko'")or die(mysqli_error($con));
  $row=mysqli_fetch_array($query);
           $access=$row['access'];
		   
		   if($access == 1){
			   $love="admin";
		   }elseif($access == 2){
			    $love="user";
		   }
?>
                  <!-- Notifications Menu -->
                  <li class="dropdown notifications-menu">
                    <!-- Menu toggle button -->
                    <a href="../<?php echo ($love); ?>" style="color:white;font-size:12px;">
                      <i class="glyphicon glyphicon-envelope text-orange"></i> Chats
                     
                    </a>
              
                  </li>
				  
				 
				  
				  
				  
                
				  
				  
				  <li class="">
                    <!-- Menu Toggle Button -->
                    <a href="../pages/profile.php" class="dropdown-toggle" style="color:white;font-size:12px;">
                      <i class="glyphicon glyphicon-cog text-orange"></i>
                      <?php echo "My Profile";?>
                    </a>
                  </li>
                  <li class="">
                    <!-- Menu Toggle Button -->
                    <a class="dropdown-toggle logout" style="color:white; font-size:12px;"><i class="glyphicon glyphicon-off text-orange"></i> Logout</a>
					
					
                  </li>
                  
                </ul>
              </div><!-- /.navbar-custom-menu -->
          </div><!-- /.container-fluid -->
        </nav>
      </header>
		
		


  <div class="content-wrapper">
        <div class="container">

<style>
         #example1 {
  font-family: Arial, Helvetica, sans-serif;
  border-collapse: collapse;
  width: 100%;
}

#example1 td, #example1 th {
  border: 1px solid black;
  padding: 8px;
   color: black;
}

#example1 tr:nth-child(even){background-color: #7FFFD4;}

#example1 tr:hover {background-color: #ddd;}

#example1 th {
  padding-top: 12px;
  padding-bottom: 12px;
  text-align: left;
  background-color: #008B8B;
  color: white;
}


    </style>			


     <!-- Full Width Column -->
      <div class="content-wrapper">
        <div class="container">
          <!-- Content Header (Page header) -->
          <section class="content-header">
            <h1>
              <a class="btn btn-lg btn-warning" href="../pages/home.php" style="border-radius:2px">Back</a>
            
            </h1>
            <ol class="breadcrumb" style="margin-right: -8px">
              <li><a href="../pages/home.php"> Home</a></li>
              <li class="active">User Forms</li>
            </ol>
          </section>
		  
		  
		  
		   <section class="content-header">
         
            <ol class="breadcrumb" style="margin-right: -8px;margin-top:-25px;">
                <a class = "btn btn-primary btn-print" href="#adduser" data-target="#adduser" data-toggle="modal" style="border-radius:2px"  ><i class ="glyphicon glyphicon-arrow-right"></i> Add User </a> 
            </ol>
          </section>
<br>
          <!-- Main content -->
          <section class="content">
            <div class="row">
	          
			
            <div class="col-xs-17">
              <div class="box box-primary">
       
                <div class="box-header">
                  <h3 class="box-title" style="text-align: right">User Lists</h3>
                 
                
                </div><!-- /.box-header -->
				
				 <div style="overflow-x:auto;">   
				 <!-- add this for scroll and table layout -->
                <div class="box-body">
	<table width="100%" class="table table-bordered table-hover" id="example1">
        <thead>
            <tr style="background-color:#008B8B;color:white;">
                <th style="min-width: 200px; max-width: 200px; font-size:11px; text-align:left;">Name</th>
				<th style="min-width: 90px; max-width: 90px; font-size:11px; text-align:left;">Username</th>
				<th style="min-width: 90px; max-width: 90px; font-size:11px; text-align:left;">Password</th>
				<th style="min-width: 220px; max-width: 220px; font-size:11px; text-align:left;">Gmail</th>
				<th style="min-width: 80px; max-width: 80px; font-size:11px; text-align:left;">Photo</th>
				<th style="min-width: 80px; max-width: 80px; font-size:11px; text-align:left;">Access</th>
				<th style="min-width: 200px; max-width: 200px; font-size:11px; text-align:left;">Action</th>
			</tr>
		</thead>
		<tbody>
		<?php
		
	$lopez=	$_SESSION['id'];
	$profid=	$_SESSION['profid'];
			$query=mysqli_query($conn,"select * from `user` where branch_id='2' or branch_id='3' or  branch_id='1' and  branch_id!='4' and profid='$profid' order by name asc");
			while($row=mysqli_fetch_array($query)){
				
				$mypass=md5($row['password']);
				
				
			?>
			<tr>
				<td style="min-width: 200px; max-width: 200px; font-size:11px; text-align:left;"><input type="hidden" id="ename<?php echo $row['user_id']; ?>" value="<?php echo $row['name']; ?>"><?php echo $row['name']; ?></td>
				<td style="min-width: 90px; max-width: 90px; font-size:11px; text-align:left;"><input type="hidden" id="eusername<?php echo $row['user_id']; ?>" value="<?php echo $row['username']; ?>"><?php echo $row['username']; ?></td>
				<td style="min-width: 90px; max-width: 90px; font-size:11px; text-align:left;"><input type="hidden" id="epassword<?php echo $row['user_id']; ?>" value="<?php echo $row['password']; ?>">*********</td>
				<td style="min-width: 230px; max-width: 230px; font-size:11px; text-align:left;"><input type="hidden" id="egmail<?php echo $row['user_id']; ?>" value="<?php echo $row['gmail']; ?>"><?php echo $row['gmail']; ?></td>
				<td style="min-width: 80px; max-width: 80px; font-size:11px; text-align:left;"><img src="../pages/upload/<?php if(empty($row['file_name'])){echo "profile.png";}else{echo $row['file_name'];} ?>" height="30px;" width="30px;"></td>
				<td style="min-width: 80px; max-width: 80px; font-size:11px; text-align:left;">
					<?php 
						if ($row['branch_id']==1){
							echo "Student";
						}
						elseif ($row['branch_id']==3){
							echo "Adviser";
						}
						elseif ($row['branch_id']==2){
							echo "Panelist";
						}
						else{
							echo "Professor";
						}
					?>
				</td>
				<td> 
					<a class="btn btn-lg btn-warning" style="font-size: 9px;border-radius:0%"" style="font-size:20px;" href="#updateordinance<?php echo $row['user_id'];?>" data-target="#updateordinance<?php echo $row['user_id'];?>" data-toggle="modal">Edit <i class='bx bx-edit'></i></a>  
					<button class="btn btn-lg btn-warning" style="font-size: 9px;border-radius:0%" type="button" style="font-size:20px;" href="#delete<?php echo $row['user_id'];?>" data-target="#delete<?php echo $row['user_id'];?>" data-toggle="modal" value="<?php echo $row['user_id']; ?>"  >Delete <i class="bx bx-trash"></i></button>
				</td>
			</tr>
			
			
<!-- Edit User -->
   	<div  id="updateordinance<?php echo $row['user_id'];?>" class="modal fade in" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true" style="display: none; ">
	<div class="modal-dialog"  >
	  <div class="modal-content" style="height:330px;width:530px; margin-top:110px;">
              <div class="modal-header" style="background-color: #5CB85C">
                <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                   <button type="button" class="close" data-dismiss="modal" aria-label="Close" style=" font-size:35px">
                  <span aria-hidden="true">&times;</span></button>
                <h2 class="modal-title" style="color:white" style="margin-top:10px;">Edit User Account</h2>
              </div>
              <div class="modal-bodyko" style="width:1200px;">
				
				<form method="POST" action="update_user.php" class="form-horizontal">
				    
				
				<div class="container-fluid">
					<div class="form-group input-group">
						<span class="input-group-addon" style="width:150px;">Name:</span>
						<input type="text" style="width:350px;" class="form-control" value="<?php echo $row['name']; ?>" name="user_name" required />
						<input type="hidden" style="width:350px;" class="form-control" value="<?php echo $row['user_id']; ?>" name="myidko" required />
					</div>
					<div class="form-group input-group">
						<span class="input-group-addon" style="width:150px;">Gmail:</span>
						<input type="email" style="width:350px;" class="form-control" value="<?php echo $row['gmail']; ?>"  name="user_gmail" required />
					</div>
					<div class="form-group input-group">
						<span class="input-group-addon" style="width:150px;">Username:</span>
						<input type="text" style="width:350px;" class="form-control" value="<?php echo $row['username']; ?>"  name="user_user" required />
					</div>
					<div class="form-group input-group">
						<span class="input-group-addon" style="width:100px;">Enter New Password if not make it blank:</span>
						<input type="text" style="width:220px;" class="form-control" name="user_pass" />
					</div>
                </div> 
				</div>
                <div class="modal-footer">
                    
                    <button  onclick="return confirm('Are you sure you want to update?');" name="submit" class="btn btn-primary" type="submit" id="confirm_update"><span class="glyphicon glyphicon-check"></span> Update</button>
				
                </div>
				</form>
            </div>
            <!-- /.modal-content -->
        </div>
        <!-- /.modal-dialog -->
    </div>
<!-- /.modal -->

			
			
			
			
			
			
			
			
<!-- Delete User -->
    <div class="modal fade" id="delete<?php echo $row['user_id'];?>" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
        <div class="modal-dialog">
            <div class="modal-content">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                    <center><h4 class="modal-title" id="myModalLabel">Deleting User...</h4></center>
                </div>
                <div class="modal-body">
				<form method="POST" action="deleteuser.php" class="form-horizontal">
				<div class="container-fluid">
				<div class="form-group input-group">
				<input type="hidden" name="deleteid" value="<?php echo $row['user_id'];?>">
					<h3><center>Are you sure?</center></h3>
                </div> 
				</div>
                <div class="modal-footer">
                    <button type="button" class="btn btn-default" data-dismiss="modal"><span class="glyphicon glyphicon-remove"></span> Cancel</button>
                    <button type="submit" class="btn btn-danger" name="del" ><span class="glyphicon glyphicon-check"></span> Delete</button>
                </div>
            </div>
			</form>
            <!-- /.modal-content -->
        </div>
        <!-- /.modal-dialog -->
    </div>
<!-- /.modal -->

			
			
			<?php
			}
		?>
        </tbody>
    </table>                 
</div><!-- /.box-body -->
				</div>
 
            </div><!-- /.col -->
			
			
          </div><!-- /.row -->
	 
            
          </section><!-- /.content -->
        </div><!-- /.container -->
      </div><!-- /.content-wrapper -->

</div>


</div>
</div>


<!-- Add User -->
    <div  class="modal fade" id="adduser" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
        <div class="modal-dialog" style="width:500px">
            <div class="modal-content" style="margin-top: 100px;">
                <div class="modal-header" style="background-color: #5CB85C;">
                    <button style="font-size:40px" type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                    <center><h2 class="modal-title" id="myModalLabel" style="color: white; text-align: left">Add New User Account</h4></center>
                </div>
                <div class="modal-body">
				<div class="container-fluid">
				<form method="POST" action="add_user.php" class="form-horizontal">
				    <?php
				   $done= $_SESSION['id'];
				    ?>
					<div class="form-group input-group">
					    	<input type="hidden" style="width:350px;" class="form-control" name="id" id="cid" value="<?php echo "$done";?>">
						<span class="input-group-addon" style="width:150px;">Name:<a style="color:red;">*</a></span>
						<input type="text" style="width:350px;" name="name" class="form-control" id="name" required>
					</div>
					<div class="form-group input-group">
						<span class="input-group-addon" style="width:150px;">Username:<a style="color:red;">*</a></span>
						<input type="text" style="width:350px;" class="form-control" name="username" id="username" required>
					</div>
					<div class="form-group input-group">
						<span class="input-group-addon" style="width:150px;">Password:<a style="color:red;">*</a></span>
						<input type="text" style="width:350px;" class="form-control" name="password" id="password" required >
					</div>
					
					<div class="form-group input-group">
						<span class="input-group-addon" style="width:150px;">Access:<a style="color:red;">*</a></span>
						<select style="width:350px;" class="form-control select" name="access" id="access" required>
						<option value="">Select</option>
							<option value="1">Students</option>
							<option value="2">Panelist</option>
							<option value="3">Adviser</option>
						</select>
					</div>
					
					
					<div class="form-group input-group">
						<!--<span class="input-group-addon" style="width:150px;">Position:</span> -->
						<input type="hidden" style="width:350px;" value="user" name="position" class="form-control" id="position" >
					</div>
						<div class="form-group input-group">
						<span class="input-group-addon" style="width:150px;">Email Address:<a style="color:red;">*</a></span>
						<input type="email" style="width:350px;" placeholder="example: example@gmail.com" name="gmail" class="form-control" id="gmail" required>
					</div>
					
                </div> 
				</div>
                <div class="modal-footer">

                    <button type="submit" name="adduserko" class="btn btn-primary" id="adduser"><span class="glyphicon glyphicon-check"></span> Add</button>
				</form>
                </div>
            </div>
            <!-- /.modal-content -->
        </div>
        <!-- /.modal-dialog -->
    </div>
<!-- /.modal -->






<!-- Update Photo-->
    <div class="modal fade" id="photo" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
        <div class="modal-dialog">
            <div class="modal-content">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                    <center><h4 class="modal-title" id="myModalLabel">Uploading Photo...</h4></center>
                </div>
                <div class="modal-body">
				<div class="container-fluid">
					<form method="POST" enctype="multipart/form-data" action="update_photo.php">
					<div class="form-group input-group">
						<span class="input-group-addon" style="width:150px;">Photo:</span>
						<input type="file" style="width:350px;" class="form-control" name="image">
					</div>
                </div> 
				</div>
                <div class="modal-footer">
                    <button type="button" class="btn btn-default" data-dismiss="modal"><span class="glyphicon glyphicon-remove"></span> Cancel</button>
                    <button type="submit" class="btn btn-success"><span class="glyphicon glyphicon-upload"></span> Upload</button>
					</form>
                </div>
            </div>
            <!-- /.modal-content -->
        </div>
        <!-- /.modal-dialog -->
    </div>
<!-- /.modal -->

<!-- Account-->
    <div class="modal fade" id="account" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
        <div class="modal-dialog">
            <div class="modal-content">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                    <center><h4 class="modal-title" id="myModalLabel">My Account</h4></center>
                </div>
                <div class="modal-body">
				<div class="container-fluid">
				<form method="POST" action="update_account.php">
					<div style="height: 10px;"></div>
					<div class="form-group input-group">
						<span class="input-group-addon" style="width:150px;">Name:</span>
						<input type="text" style="width:350px;" class="form-control" name="mname" value="<?php echo $srow['name']; ?>">
					</div>
					<div class="form-group input-group">
						<span class="input-group-addon" style="width:150px;">Username:</span>
						<input type="text" style="width:350px;" class="form-control" name="musername" value="<?php echo $srow['username']; ?>">
					</div>
					<div class="form-group input-group">
						<span class="input-group-addon" style="width:150px;">Password:</span>
						<input type="password" style="width:350px;" class="form-control" name="mpassword" value="<?php echo $srow['password']; ?>">
					</div>
					<hr>
					<span>Enter current password to save changes:</span>
					<div style="height: 10px;"></div>
					<div class="form-group input-group">
						<span class="input-group-addon" style="width:150px;">Password:</span>
						<input type="password" style="width:350px;" class="form-control" name="cpassword">
					</div>
					<div class="form-group input-group">
						<span class="input-group-addon" style="width:150px;">Again:</span>
						<input type="password" style="width:350px;" class="form-control" name="apassword">
					</div>
                </div> 
				</div>
                <div class="modal-footer">
                    <button type="button" class="btn btn-default" data-dismiss="modal"><span class="glyphicon glyphicon-remove"></span> Cancel</button>
                    <button type="submit" class="btn btn-success"><span class="glyphicon glyphicon-check"></span> Update</button>
				</form>
                </div>
            </div>
            <!-- /.modal-content -->
        </div>
        <!-- /.modal-dialog -->
    </div>
<!-- /.modal -->
 
<script src="../js/jquery.dataTables.min.js"></script>
<script src="../js/dataTables.bootstrap.min.js"></script>
<script src="../js/dataTables.responsive.js"></script>

<!-- jQuery 2.1.4 -->
    <script src="../plugins/jQuery/jQuery-2.1.4.min.js"></script>
	<script src="../dist/js/jquery.min.js"></script>
    <!-- Bootstrap 3.3.5 -->
    <script src="../bootstrap/js/bootstrap.min.js"></script>
    <script src="../plugins/select2/select2.full.min.js"></script>
    <!-- SlimScroll -->
    <script src="../plugins/slimScroll/jquery.slimscroll.min.js"></script>
    <!-- FastClick -->
    <script src="../plugins/fastclick/fastclick.min.js"></script>
    <!-- AdminLTE App -->
    <script src="../dist/js/app.min.js"></script>
    <!-- AdminLTE for demo purposes -->
    <script src="../dist/js/demo.js"></script>
    <script src="../plugins/datatables/jquery.dataTables.min.js"></script>
    <script src="../plugins/datatables/dataTables.bootstrap.min.js"></script>
    
    

<script>
  $(function () {
        $("#example2").DataTable();
        $('#example1').DataTable({
          "paging": true,
          "lengthChange": true,
          "searching": true,
          "ordering": false,
          "info": true,
		  "lengthMenu": [5, 10, 25, 50, 100],
          "autoWidth": true,
        });
      });
    </script>	
<script>
$(document).ready(function(){
	
	
	$('#userList').DataTable({
	"bLengthChange": true,
	"bInfo": true,
	"bPaginate": true,
	"bFilter": true,
	"bSort": false,
	"pageLength": 8
	});
	
	//$(document).on('click', '#adduser', function(){
	   // 	id=$('#cid').val();
		//name=$('#uname').val();
		//username=$('#uusername').val();
		//password=$('#upassword').val();
		//access=$('#uaccess').val();
		//position=$('#uposition').val();
		//gmail=$('#ugmail').val();
		//	$.ajax({
				//.url:"add_user.php",
				//method:"POST",
				//data:{
				 //   	id: id,
				//	name: name,
				//	username: username,
				//	password: password,
					//access: access,
					//position: position,
				//	gmail: gmail,
				//	adduser: 1,
				//},
				//success:function(){
					//window.location.href='user.php';
				//}
			//});
		
	//});
	//
	$(document).on('click', '.deleteuser', function(){
		var rid=$(this).val();
		$('#delete_user').modal('show');
		$('.modal-footer #confirm_delete').val(rid);
	});
	
	$(document).on('click', '#confirm_delete', function(){
		var nrid=$(this).val();
		$('#delete_user').modal('hide');
		$('body').removeClass('modal-open');
		$('.modal-backdrop').remove();
			$.ajax({
				url:"deleteuser.php",
				method:"POST",
				data:{
					id: nrid,
					del: 1,
				},
				success:function(){
					window.location.href='user.php';
				}
			});
	});
	

 
});

</script>	

</body>
</html>