<?php session_start();?>
<?php include("../includes/connection.php"); ?>
<?php include("../includes/func.php");
include("categoryPopup_inc.php"); ?>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Administrative Panel : Category</title>
<link href="includes/style.css" rel="stylesheet" type="text/css">
<script language="javascript" type="text/javascript">
	function validate(frm) {
		if (frm.category_name.value == "") {
			alert("Please enter category name.");
			frm.category_name.focus();
			return (false);
		}
		
		return (true);
	}
</script>
</head>

<body>
<form name="frmCatPopup" method="post" onSubmit="return validate(this);">
<input type="hidden" name="category_id" value="<?php echo $_GET["category_id"]; ?>">
<table width="500" border="0" cellpadding="0" cellspacing="1" class="bgDarkGray">
    <tr>
        <td class="bgGray">&nbsp;</td>
    </tr>
    <tr>
        <td class="bgWhite"><table width="100%"  border="0">
            <tr align="center">
                <td colspan="2" class="note">&nbsp;<?php echo($errMsg); ?></td>
            </tr>
          
            <tr>
                <td width="38%" class="LabelBold">Category Name : </td>
                <td width="62%"><input type="text" size=60  name="category_name" value="<?php echo($rs["category_name"]); ?>"></td>
            </tr>
			 <tr>
                <td width="38%" class="LabelBold">Category Image : </td>
                <td width="62%"><input type="text" size=60  name="category_image" value="<?php echo($rs["category_image"]); ?>"></td>
            </tr>
			<tr>
                <td width="38%" class="LabelBold">Category Description : </td>
                <td width="62%"><textarea name="category_description" rows=8 cols=45 ><?php echo($rs["category_description"]); ?></textarea></td>
            </tr>
			<tr>
                <td class="LabelBold">Parent Category : </td>
                <td class=Label>
				<select name=category_parent_id>
				<option value=0>Top Lavel category</option>
				<?php generateCategoriesroot(1,0,$rs["category_parent_id"]); ?>
				</select>
               </td>
            </tr> 

            <tr>
                <td>&nbsp;</td>
                <td><input type="checkbox" name="active" value="1" <?php cbfx($rs["category_status"]); ?>>
                    <span class="LabelBold">Active</span></td>
            </tr>
			<tr>
                <td>&nbsp;</td>
                <td><input type="checkbox" name="category_sub_yes_no" value="1" <?php cbfx($rs["category_sub_yes_no"]); ?>>
                    <span class="LabelBold">Have Sub Categories?</span></td>
            </tr>
			<tr>
                <td width="38%" class="LabelBold">Category Lavel : </td>
                <td width="62%"><input type="text" size=2  name="category_level" value="<?php echo($rs["category_level"]); ?>"></td>
            </tr>
            <tr>
                <td colspan="2">&nbsp;</td>
            </tr>
        </table></td>
    </tr>
    <tr>
        <td align="right" class="bgGray"><input name="btnSave" type="submit" id="btnSave" value="Save">
        </td>
    </tr>
</table>
</form>
</body>
</html>
