<h1>Add Table</h1> </div> <div class="form-container"> <?php $branch = new branch(); $all_branch = $branch->get_branches(); $branch_table = new branch_table(); $ID = isset($_GET['id']) ? $_GET['id'] : NULL; if (isset($_POST['add_branch_table'])) { // Update old record if (isset($ID)) { $results = $branch_table->update_branch_table($_POST, $ID); } else { // Insert new $results = $branch_table->insert_branch_table($_POST); } if ($results) { echo '<div class="alert alert-success" role="alert">'; echo isset($_GET['id']) ? 'Updated ' : 'Added '; echo 'Tables Sucessfully </div>'; } else { echo '<div class="alert alert-danger" role="alert"> Error </div>'; } } if (isset($ID)) { $branch_table_result = $branch_table->get_branch_table($ID); } ?> <form class="form-horizontal" action="" method="post">