?> <ul class="breadcrumb"> <li><a href="#">Home</a></li> <li><a href="view_branch_item.php">Items</a></li> <li><a class="active" href="#" >Add</a></li> </ul> <div class="page-heading"> <h1>Add Item</h1> </div> <div class="form-container"> <?php $branch = new branch(); $all_branch = $branch->get_branches(); $branch_category = new branch_category(); $all_branch_category = $branch_category->get_branch_category(); $branch_menu_type = new branch_menu_type(); $all_branch_menu_type = $branch_menu_type->get_branch_menu_type(); $branch_spice = new branch_spice(); $all_branch_spice = $branch_spice->get_branch_spice(); $branch_item = new branch_item(); $ID = isset($_GET['id']) ? $_GET['id'] : NULL; if (isset($_POST['add_branch_item'])) { // Update old record if (isset($ID)) { $results = $branch_item->update_branch_item($_POST, $ID); } else { // Insert new $results = $branch_item->insert_branch_item($_POST);
<div class="container-fluide"> <ul class="breadcrumb"> <li><a href="#">Home</a></li> <li><a class="active" href="#">Branches</a></li> </ul> <div class="page-heading"> <h1>View Branches</h1> </div> <div class="table-responsive custom-table"> <?php $branch = new branch(); $results = $branch->get_branches(); if ($results) { } ?> <table id="myTable"> <thead> <tr> <th>ID</th> <th>Company</th> <th>Name</th> <th>Location</th> <th>Desc</th> <th></th> </tr> </thead> <tbody>
<tr> <th>Name</th> <th>Branch</th> <th>Category</th> <th>Menu Type</th> <th>Status</th> <th></th> </tr> </thead> <tbody> <?php foreach ($results as $res) { if ($res->branch_item_company == $_SESSION['company_id']) { //get branch name by id $branch_detail = $branch->get_branches($res->branch_item_branch); echo '<tr>'; echo '<td>' . $res->branch_item_name . '</td>'; echo '<td>' . $branch_detail->branch_name . '</td>'; echo '<td>' . $res->branch_item_category . '</td>'; echo '<td>' . $res->branch_item_menu_type . '</td>'; echo '<td>' . $res->item_status . '</td>'; echo '<td><a class="edit_btn" href="add_branch_item.php?id=' . $res->branch_item_id . '"><i class="fa fa-pencil edit-icon"></i>'; echo '<i class="fa fa-ban hold-icon"></i>'; echo '<i class="fa fa-trash-o delete-icon"></i>'; echo '</td>'; echo '</tr>'; } } ?>
if (isset($ID)) { $results = $branch->update_branch($_POST, $ID); } else { // Insert new $results = $branch->insert_branch($_POST); } if ($results) { echo '<div class="alert alert-success" role="alert">'; echo isset($_GET['id']) ? 'Updated ' : 'Added '; echo 'branch Sucessfully </div>'; } else { echo '<div class="alert alert-danger" role="alert"> Error </div>'; } } if (isset($ID)) { $branch_result = $branch->get_branches($ID); } ?> <form class="form-horizontal" action="" method="post"> <div class="col-sm-6"> <div class="form-group"> <label for="branch_code" class="col-sm-3 control-label">ID</label> <div class="col-sm-8"> <input type="text" class="form-control" name="branch_code" id="branch_code" value="<?php echo isset($ID) ? $branch_result->branch_code : ''; ?> " placeholder="Id" > </div> </div>
<tr> <th>Name</th> <th>Branch</th> <th>Email</th> <th>Phone</th> <th>Status</th> <th></th> </tr> </thead> <tbody> <?php foreach ($results as $res) { if ($res->branch_user_company_id == $_SESSION['company_id']) { //get branch name by id $branch_detail = $branch->get_branches($res->branch_user_branch_id); echo '<tr>'; echo '<td>' . $res->branch_user_name . '</td>'; echo '<td>' . $branch_detail->branch_name . '</td>'; echo '<td>' . $res->branch_user_email . '</td>'; echo '<td>' . $res->branch_user_phone . '</td>'; echo '<td>' . $res->branch_user_status . '</td>'; echo '<td><a class="edit_btn" href="add_branch_user.php?id=' . $res->branch_user_id . '"><i class="fa fa-pencil edit-icon"></i>'; echo '<i class="fa fa-ban hold-icon"></i>'; echo '<i class="fa fa-trash-o delete-icon"></i>'; echo '</td>'; echo '</tr>'; } } ?>
?> <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']) { $branch_detail = $branch->get_branches($res->branch_table_branch); echo '<tr>'; echo '<td>' . $res->branch_table_name . '</td>'; echo '<td>' . $branch_detail->branch_name . '</td>'; echo '<td>' . $res->branch_table_status . '</td>'; echo '<td><a class="edit_btn" href="add_branch_table.php?id=' . $res->branch_table_id . '"><i class="fa fa-pencil edit-icon"></i>'; echo '<i class="fa fa-ban hold-icon"></i>'; echo '<i class="fa fa-trash-o delete-icon"></i>'; echo '</td>'; echo '</tr>'; } } ?> </tbody>