<?php

include 'Aheader.php';
?>
<form enctype="multipart/form-data" action="addProduct.php" method="post">	
<div id="inside">
	<table  width="500px" align="center">
		<tr>
			<th>subcategory name</th>
			<td><select name="scatname">
			<?php 
include 'subcategoryclass.php';
$scat = new subcategory();
$c = $scat->subcategory();
foreach ($c as $key => $value) {
    $scat_id = $value['id'];
    $name = $value['name'];
    echo "<option value='{$scat_id}'>{$name}</option> ";
}
?>
			</select></td>
		</tr>
		<tr>
			<th>product name</th>
			<td><input type="text" name="pname"/></td>
		</tr>
		<tr>
			<th>description</th>
			<td><input type="text" name="desc"/></td>
		</tr>
		<tr>
<?php 
include 'header1.php';
include 'subcategoryclass.php';
$subcateg = new subcategory();
$c = $subcateg->subcategory();
?>
	<div id="inside">
    <table class="table table-bordered table-hover table-striped table-responsive">
<?php 
foreach ($c as $key => $value) {
    $name = $value['name'];
    ?>
	
	<tr >
			<td><?php 
    echo $name;
    ?>
</td>
			<td><a href="editSubcategory.php?id=<?php 
    echo $value['id'];
    ?>
">edit</a></td>
			<td><a href="removeSubcategory.php?id=<?php 
    echo $value['id'];
    ?>
">delete</a></td>
	</tr>

<?php 
}