<!doctype html>
<?php 
include("../connection.php");
include("../user.php");
?>
<html class="no-js" lang=""> 
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title><?php echo TITLE;?></title>
    <meta name="description" content="Ela Admin - HTML5 Admin Template">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <link rel="apple-touch-icon" href="../images/bluebase.png">
    <link rel="shortcut icon" href="../images/bluebase.png">
<style>
input[type=text] 
{
	text-transform:uppercase;
}
</style>  
</head>
<body>
<div class="col-lg-8">
<div class="card">
	<div class="card-header">
	<strong style="float:left;">New Role</strong>
	<a href="role_master.php"><button class="btn btn-primary" style="width:50px;float:right;"onclick=""><i class="fa fa-backward"></i></button></a>	
	</div>
<div class="card-body card-block">
		<form action="role_submit.php" method="post" enctype="multipart/form-data" class="form-horizontal">
		
				<div class="row form-group">
					<div class="col col-md-3"><label for="text-input" class=" form-control-label">Role name</label><span style="color:red;">*</span></div>
					<div class="col-12 col-md-9"><input type="text" id="role_name" name="role_name" placeholder="Enter role name" class="form-control" autocomplete="off" required></div>
				</div>
				<div class="row form-group">
		<div class="col col-md-3"><label class=" form-control-label" style="color:red;">H/O-Access</label></div>
		<div class="col col-md-9">
		<div class="form-check">
		<div class="radio-inline">
			<label class="filled">
				<input type="radio" name="ho_admin" id="ho_admin" value="yes" checked  />YES</label>
				<label class="filled">
				<input type="radio" name="ho_admin" id="ho_admin" value="no"  />NO</label>
		</div>
		</div>
		</div>
		</div>
				<?php
				$menu=mysqli_query($con,"select id,menu_code from menu_master order by id");
				$r=1;
				while($menu_code=mysqli_fetch_array($menu)) 
				{
				?>
				<b style="padding: 5px 0px;color:blue;"><?php echo $menu_code['menu_code']; ?></b><br>
				<?php
					$men=$menu_code['id']; 
					$submenu=mysqli_query($con,"select id,submenu_code from submenu_master where menu_id=' $men' order by id ");
					while($sub_menu_code=mysqli_fetch_array($submenu)) 
					{
					$s=1;
				?>                 
	<div style="width:100%;float:left;padding: 5px 0px;">
			<input class="checkbox" style="width:2%;float:left;margin-top: 6px;" type="checkbox" name="checkbox<?php echo $r;?>" id="checkbox<?php echo $r;?>" onclick="enablebox(this.id)">
			<input type="hidden"  id="menu" name="menu[]" class="form-control"  value="<?php echo $menu_code['id'].":".$sub_menu_code['id'];?>">
			<input type="hidden"  id="submenu" name="submenu[]" class="form-control"  value="<?php echo $sub_menu_code['submenu_code'];?>">
			<div style="width:30%;float:left;">&emsp;<?php echo $sub_menu_code['submenu_code']; ?></div>
			<div class="radio-inline">
				<label class="filled">
				<input type="radio" name="new<?php echo $r ; ?>" id="new<?php echo $r.$s++ ; ?>" value="View" disabled />VIEW</label>
				<label class="filled">
				<input type="radio" name="new<?php echo $r ; ?>" id="new<?php echo $r.$s++ ; ?>" value="Edit" disabled />EDIT </label> 
				<label class="filled">
				<input type="radio" name="new<?php echo $r ; ?>" id="new<?php echo $r.$s++ ; ?>" value="All" disabled />ALL</label>
			</div>
	</div>
	<?php
		$r++;
		}
		}
	?>							
	<div style="">
		<button type="submit" name="submit" class="btn btn-success" ><i class="fa fa-dot-circle-o"></i> Submit</button>
	</div>       
	</form>
</div>
</div>
<div class="clearfix"></div>
    <footer class="site-footer">     
    </footer>
</div><!-- /#right-panel -->

<!-- Right Panel -->

<!-- Scripts -->



</body>
</html>
<?php
			require ("checkbox.js");
	?> 
