$inv_subcategory = new Inv_subcategory($_POST['key']);
            $inv_subcategory->populate();
            $inv_subcategory->store();
        } catch (fExpectedException $e) {
            echo $e->printMessage();
        }
    } else {
        if ($_POST['type'] == "delete") {
            try {
                $inv_subcategory = new Inv_subcategory($_POST['key']);
                $inv_subcategory->delete();
            } catch (fExpectedException $e) {
                echo $e->printMessage();
            }
        } else {
            if ($_POST['type'] == "add") {
                try {
                    $inv_subcategory = new Inv_subcategory();
                    $inv_subcategory->populate();
                    $inv_subcategory->store();
                } catch (fExpectedException $e) {
                    echo $e->printMessage();
                }
            } else {
                if ($_POST['type'] == "option") {
                    Inv_subcategory::findOptionByMainCategoryCode($_POST['key']);
                }
            }
        }
    }
}
				<tr id="newItem">
					<td>
						<span id="Classificationcode">
							<input type="text" name="classification_code" value="Input Classification Code" />
						</span>
					</td>
					<td>
						<span id="Description">
							<input type="text" name="description" value="Input Description" />
						</span>
					</td>
					<td>
						<span id="SubCategorycode">
							<select name="sub_category_code">
								<?php 
    Inv_subcategory::findOptionByMainCategoryCode($_GET['maincc']);
    ?>
							</select>
						</span>
					</td>
					<td>
						<span id="Status">
							<select>
								<option value="1">Active</option>
								<option value="0">Inactive</option>
							</select>
						</span>
					</td>
					<td id="iconCell">
						<ul id="icons" class="ui-widget ui-helper-clearfix">
							<li id="add" title="Save" class="ui-state-default ui-corner-all"><span class="ui-icon ui-icon-circle-check"></span></li>