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); } ?> <form class="form-horizontal" action="" method="post"> <div class="col-sm-6"> <input type="hidden" class="form-control" name="branch_user_role_company" id="branch_user_role_company" value="<?php echo isset($ID) ? $branch_user_role_result->branch_user_role_company : $_SESSION["company_id"]; ?> " placeholder="Name" required> <div class="form-group"> <label for="branch_category_name" class="col-sm-4 control-label">Name</label>
<ul class="breadcrumb"> <li><a href="#">Home</a></li> <li><a href="view_branch_user.php">Branch Users</a></li> <li><a class="active" href="#" >Add</a></li> </ul> <div class="page-heading"> <h1>Add Branch Users</h1> </div> <div class="form-container"> <?php $branch = new branch(); $all_branch = $branch->get_branches(); $branch_user_role = new branch_user_role(); $all_branch_user_role = $branch_user_role->get_branch_user_role(); $branch_user = new branch_user(); $ID = isset($_GET['id']) ? $_GET['id'] : NULL; if (isset($_POST['add_branch_user'])) { // Update old record if (isset($ID)) { $results = $branch_user->update_branch_user($_POST, $ID); } else { // Insert new $results = $branch_user->insert_branch_user($_POST); } if ($results) { echo '<div class="alert alert-success" role="alert">'; echo isset($_GET['id']) ? 'Updated ' : 'Added '; echo 'branch user Sucessfully </div>'; } else {
if (isset($_SESSION['company_id'])) { ?> <ul class="breadcrumb"> <li><a href="#">Home</a></li> <li><a class="active" href="#">Branch User Roles</a></li> </ul> <div class="page-heading"> <h1>View Categories</h1> </div> <div class="table-responsive custom-table"> <?php $branch = new branch(); $branch_user_role = new branch_user_role(); $results = $branch_user_role->get_branch_user_role(); ?> <table id="myTable"> <thead> <tr> <th>Name</th> <th>Status</th> <th></th> </tr> </thead> <tbody> <?php foreach ($results as $res) { if ($res->branch_user_role_company == $_SESSION['company_id']) { echo '<tr>';