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"> <div class="col-sm-12"> <div class="col-sm-6"> <input type="hidden" class="form-control" name="branch_table_company" id="branch_table_company" value="<?php echo isset($ID) ? $branch_table_result->branch_table_company : $_SESSION["company_id"]; ?> " placeholder="Name" required> <div class="form-group"> <label for="branch_table_branch" class="col-sm-4 control-label">Select Branch</label>
if (isset($_SESSION['company_id'])) { ?> <ul class="breadcrumb"> <li><a href="#">Home</a></li> <li><a class="active" href="#">Branches Tables</a></li> </ul> <div class="page-heading"> <h1>View Tables</h1> </div> <div class="table-responsive custom-table"> <?php $branch = new branch(); $branch_table = new branch_table(); $results = $branch_table->get_branch_table(); ?> <table id="myTable"> <thead> <tr> <th>Name</th> <th>Branch</th> <th>Status</th> <th></th> </tr> </thead> <tbody> <?php foreach ($results as $res) { if ($res->branch_table_company == $_SESSION['company_id']) {