<h1>Add Category</h1>
</div>

<div class="form-container">
<?php 
    $branch = new branch();
    $all_branch = $branch->get_branches();
    $branch_category = new branch_category();
    $ID = isset($_GET['id']) ? $_GET['id'] : NULL;
    if (isset($_POST['add_branch_category'])) {
        // Update old record
        if (isset($ID)) {
            $results = $branch_category->update_branch_category($_POST, $ID);
        } else {
            // Insert new
            $results = $branch_category->insert_branch_category($_POST);
        }
        if ($results) {
            echo '<div class="alert alert-success" role="alert">';
            echo isset($_GET['id']) ? 'Updated ' : 'Added ';
            echo 'branch category Sucessfully </div>';
        } else {
            echo '<div class="alert alert-danger" role="alert"> Error </div>';
        }
    }
    if (isset($ID)) {
        $branch_category_result = $branch_category->get_branch_category($ID);
    }
    ?>

<form class="form-horizontal" action="" method="post">