<?php session_start();?>
<?php require_once('open_connection.php');?>
<!--link href='blue/style.css' rel='stylesheet' type='text/css' /-->
<link href='css/imagetable.css' rel='stylesheet' type='text/css' />
<!DOCTYPE html>
<html>
<head>
       <title>PICCSB e-Directory System</title>
</head>
<body bgcolor="#333333"> 

<table width="100%" border="0" align="center">
<tr>
<td width="15%" bgcolor="#333333">&nbsp;</td>
<td width="70%" align="center" bgcolor="#FFFFFF" > 

<table width="100%" border="0" align="center">

<!-- row for header picc 1 -->
<tr>  
     <th width="100%" colspan="4"><img src="images/header-cox.jpg" width="100%" height="15%"></th>
</tr>

<!-- row for header picc 2 -->
<tr>
     <th width="100%" colspan="4"><img src="images/eoffice-cox.jpg" width="100%" height="30%"></th>
</tr>

<!-- calling frame -->	
<tr>
    <td colspan="1" width="10%" align="center"><?php include("header.php");?></td>
	
</tr>
<tr>

<td colspan="3" width="90%" align="center" >
<tr><td>&nbsp;</td></tr>
<tr><td align="left">
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
							<?php
							$user_id=$_SESSION['user_id'];
							echo 'Welcome: ' . $_SESSION['user_name'];
							?>
							<a href="administrator_login.php"><img src="images/logout3.gif" align="right"></a>
							</td>
</tr>
<tr><td>&nbsp;</td></tr>
<tr><td>&nbsp;</td></tr>
<tr><td>
<h2 align="center">CREATE CATEGORY</h2> 
<form  method="post">
<table align="center"  class="imagetable">
 <!--tr>
   		     <!--td width="128">Category ID</td>
    <td width="7">:</td>
    <td width="199"><input type="text" name="category_id" class="input-xlarge" id="input01"  placeholder="category_id"></td>
  </tr-->
   <tr>
    <td width="128">Category Name</td>
    <td width="7">:</td>
    <td width="199"><input type="text" name="category_name"required class="input-xlarge" id="input01"  placeholder="category_name"></td>
   </tr>
<!--<tr><td>Assign Name</td><td> : </td><td><input type="text" size="20" maxlength="20" name="staff_assign"></td></tr>-->
<tr><td colspan="4" align="center"><input type="submit" value="INSERT" name="save" id="save" class="myButton">
<input type="button" class="myButton" value="CATEGORY LIST" onClick="window.location.href='administrator_category_view.php'"> 
<!--input type="button" class="myButton" value="ADD SUB CATEGORY" onClick="window.location.href='administrator_subcategory.php'"-->
<input type="button" class="myButton" value="ADMINISTRATOR MENU" onClick="window.location.href='administrator_menu.php'"></td></tr>

</table>
</form>

<?php
                                                include('open_connection.php');
                if (isset($_POST['save'])){
 
                    $category_id=$_POST['category_id'];
                    $category_name=$_POST['category_name'];
                    //$section_id=$_POST['section_id'];
                    //$section_name=$_POST['section_name'];
                    //$user_access=$_POST['user_access'];
                    
                    mysql_query("insert into tbl_ref_ecategory (category_id,category_name)
                        values ('$category_id','$category_name')
                        ") or die(mysql_error());
                   echo "successful";
                }
            ?>
			<tr><td>&nbsp;</td></tr>
			<tr><td>&nbsp;</td></tr>
			<tr><td>&nbsp;</td></tr>
			<tr><td>&nbsp;</td></tr>
			<tr><td>&nbsp;</td></tr>
			<tr><td>&nbsp;</td></tr>
			<tr><td>&nbsp;</td></tr>
<!-- row for footer -->	
<tr>
	<th align="center" colspan="4">
	<?php include('footer.php');?>
		
	</th>
</tr>

<!--- end for ruang kerja 80% -->
</table>

</td>

<td width="20%" bgcolor="#333333">&nbsp;</td>

</tr>

<!--- end for ruang kerja 100% -->
</table>

</body>
</html>