<?php include 'header1.php';
include'config.php';
?>
<style>
	.switch {
		position: relative;
		display: inline-block;
		width: 30px;
		height: 17px;
	}

	.switch input { 
		opacity: 0;
		width: 0;
		height: 0;
	}

	.slider {
		position: absolute;
		cursor: pointer;
		top: 0;
		left: 0;
		right: 0;
		bottom: 0;
		background-color: #ccc;
		-webkit-transition: .4s;
		transition: .4s;
	}

	.slider:before {
		position: absolute;
		content: "";
		height: 12px;
		width: 12px;
		left: 3px;
		bottom: 3px;
		background-color: white;
		-webkit-transition: .4s;
		transition: .4s;
	}

	input:checked + .slider {
		background-color: #2196F3;
	}
	input:disabled + .slider {
		background-color: #ffb2b2;
	}
	input:focus + .slider {
		box-shadow: 0 0 1px #2196F3;
	}

	input:checked + .slider:before {
		-webkit-transform: translateX(12px);
		-ms-transform: translateX(12px);
		transform: translateX(12px);
	}

	/* Rounded sliders */
	.slider.round {
		border-radius: 10px;
	}

	.slider.round:before {
		border-radius: 50%;
	}
</style>
<div class="content-wrapper">
	<section class="content-header">
		<h1>
			Pump Manager
		</h1>
		<ol class="breadcrumb">
			<li>
				<a href="#">
					<i class="fa fa-dashboard">
					</i> Home
				</a>
			</li>
			<li>
				<a href="#">Pump Manager
				</a>
			</li>
			<li class="active">Feature List
			</li>
		</ol>
	</section>
	<section class="content">
		<div class="row">
			<div class="col-xs-12">
				<div class="box">
					<div class="box-header">
						<h3 class="box-title"> Client Permission
						</h3>
					</div>
					<div class="box-body">
						<div class="container-fluid">  
							<div class="table-responsive">  
								<div align="right">  
									<form name="dataAdd" method="POST" class="form-horizontal">
										Client NAME :	
										<select  id="cuname" name="cuname" readonly placeholder="Enter Parent">
											<?php
											include('config.php');
											$sql1 = "SELECT * FROM tbl_login where status='Active' order by Usr_Name";
											$result1 = mysqli_query($con, $sql1);
											if (mysqli_num_rows($result1) > 0) {
												while($row1 = mysqli_fetch_assoc($result1)) {
													?>
													<option id="cuname" value="<?php echo '18 HR-'.$row1['Usr_Name'];?>"><?php echo '18 HR - '.$row1['Usr_Name'];?></option>
													<?php             
												}
											}else{ 
												?>
												<option value="0">No Clients Found</option>
											<?php }?>
											<?php
											$sql1 = "SELECT * FROM tbl_login2 where status='Active' order by Usr_Name";
											$result1 = mysqli_query($con, $sql1);
											if (mysqli_num_rows($result1) > 0) {
												while($row1 = mysqli_fetch_assoc($result1)) {
													?>
													<option id="cuname" value="<?php echo '24 HR-'.$row1['Usr_Name'];?>"><?php echo '24 HR - '.$row1['Usr_Name'];?></option>
													<?php             
												}
											}else{ 
												?>
												<option value="0">No Clients Found</option> 
											<?php }?>
										</select>
										<button type="button" onclick="Go()"  class="btn btn-primary btn-md btn_go">Go
										</button> 
										<input type="hidden" name="request_type" value='5'> 
									</form>
									<div id="list_view">
									</div>
								</div>								
							</div>  
						</div>  
					</div>
				</div>
			</div>
		</div>
	</section>
</div>
<footer class="main-footer">
	<div class="pull-right hidden-xs">
		<b>Version
		</b> 2.4.18
	</div>
	<strong>Copyright &copy; 2019 
		<a href="https://adminlte.io">Pump Manager
		</a>.
	</strong> All rights
	reserved.
	<span> Powered by 
		<a href="http://qisystems.in/"> QI Systems
		</a>
	</span>
</footer>
<script src="bower_components/jquery/dist/jquery.min.js"></script>
<script src="bower_components/bootstrap/dist/js/bootstrap.min.js"></script>
<script src="bower_components/datatables.net/js/jquery.dataTables.min.js"></script>
<script src="bower_components/datatables.net-bs/js/dataTables.bootstrap.min.js"></script>
<script src="bower_components/jquery-slimscroll/jquery.slimscroll.min.js"></script>
<script src="bower_components/fastclick/lib/fastclick.js"></script>
<script src="dist/js/adminlte.min.js"></script>
<script src="dist/js/demo.js"></script>
<script>
	function Go()  
	{  
		var e = document.getElementById("cuname");
		var user='ADMIN'
		var cuname = e.options[e.selectedIndex].value;
		$.ajax({
			url:"clientpermission2.php",
			method:"POST",
			cache:false,
			async:false,
			data:{cuname:cuname},
			dataType:'html',
			success:function(data)
			{
				$('#list_view').html(data);
				Go2(user,cuname);
			},
			error :function(data)
			{
				$('#list_view').html(data);
				alert("failed");
			}
		});
	} 
	$(document).on('click', '.status_data', function(){
		var id= $(this).data("index");
		var id2= $(this).data("index2");
		var id3= $(this).data("index3");
		var id4= $(this).data("index4");
		$.ajax({
			url:"feature_insert.php",
			method:"POST",
			data:{Version:id,cuname:id2,user:id3,fnid:id4,request_type:4},
			success:function(data){
				Go2(id3,id2);
			}
		});
	});
</script>
