</ul> <div class="page-heading"> <h1>Add Role</h1> </div> <div class="form-container"> <?php $branch = new branch(); $all_branch = $branch->get_branches(); $branch_user_role = new branch_user_role(); $ID = isset($_GET['id']) ? $_GET['id'] : NULL; if (isset($_POST['add_branch_user_role'])) { // Update old record if (isset($ID)) { $results = $branch_user_role->update_branch_user_role($_POST, $ID); } else { // Insert new $results = $branch_user_role->insert_branch_user_role($_POST); } if ($results) { echo '<div class="alert alert-success" role="alert">'; echo isset($_GET['id']) ? 'Updated ' : 'Added '; echo 'branch user role Sucessfully </div>'; } else { echo '<div class="alert alert-danger" role="alert"> Error </div>'; } } if (isset($ID)) { $branch_user_role_result = $branch_user_role->get_branch_user_role($ID); }