<?php 
require("../connection.php");
include("../user.php");
$user_id=$_SESSION['user'];
$username=$_SESSION['user_name'];
$branch_id=$_SESSION['branch_id'];
$ho_access=$_SESSION['ha'];

$id=$_REQUEST['id'];

//echo $config_id;
//echo $branch;
?>


<table class="table table-hover" style="font-family:'Times New Roman', Times, serif">
	<tr>
		<th>BRANCH</th>
		<th>ASSET-ID</th>
		<th>CATEGORY</th>
	</tr>
	<?php
		$cnf=mysqli_query($con,"select * from item_master im join branch_master bm on im.branch_id=bm.id left join category_master cm on cm.id=im.category_id where im.asset_id='$id'");
		while($r=mysqli_fetch_array($cnf))
		{	
			$branch_n=$r['branch_name'];
			$asset_ids=$r['asset_id'];
			$categorys=$r['category'];
	?>
	<tr>								
		<td style="text-transform: uppercase;"><?php echo $branch_n;?></td>
		<td style="text-transform: uppercase;"><?php echo $asset_ids;?></td>
		<td style="text-transform: uppercase;"><?php echo $categorys;?></td>
	</tr>
</table>
<?php
// Use array() function 
	$string = $r['header']; 
	$value1 = $r['value']; 
	
	
// Get the counts inside an array
	$schools_value = explode(",", $value1);
	$schools_array = explode(",", $string);
		$result = count($schools_array); 
		$result1 = count($schools_value); 
		$r=$result; //Count
			?>			
<table class="table table-hover" style="font-family:'Times New Roman', Times, serif">
		<tr>
			<th>CONFIGURATION</th>
			<th>CONFIG-VALUES</th>
		</tr>
		 <?php
		 $j=0;
	for($k=0;$k<$r;$k++)
	{
		$ch=$schools_array[$k];  // get the value of array
		$item_name=mysqli_fetch_array(mysqli_query($con,"select configuration from configuration_master where id='$ch'"));
		?> 
	
		<tr>
		<td><?php echo $config_name=$item_name['configuration']; ?></td>
		<td><?php echo $ch1=$schools_value[$j]; ?></td> 
	<?php 
		$j++;
	}	}  ?>
		</tr>
</table> 


