<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> <?php if (isset($_SESSION['company_id'])) { $company_details = $company->get_companies($_SESSION['company_id']); $company_name = $company_details->company_name; $company_id = $company_details->company_id; } else { echo $company_name = ""; } ?> <div class="form-group"> <label for="branch_company_name" class="col-sm-3 control-label">Company</label> <div class="col-sm-8"> <input type="text" class="form-control" name="branch_company_name" id="branch_company_name" value="<?php echo $company_name; ?> " placeholder="Company name" readonly> </div>
if (isset($ID)) { $results = $company->update_company($_POST, $ID); } else { // Insert new $results = $company->insert_company($_POST); } if ($results) { echo '<div class="alert alert-success" role="alert">'; echo isset($_GET['id']) ? 'Updated ' : 'Added '; echo 'company Sucessfully </div>'; } else { echo '<div class="alert alert-danger" role="alert"> Error </div>'; } } if (isset($ID)) { $company_result = $company->get_companies($ID); } ?> <form class="form-horizontal" action="" method="post"> <div class="col-sm-6"> <div class="form-group"> <label for="company_name" class="col-sm-4 control-label">Name</label> <div class="col-sm-8"> <input type="text" class="form-control" name="company_name" id="company_name" value="<?php echo isset($ID) ? $company_result->company_name : ''; ?> " placeholder="Name" required> </div>
if (!isset($_SESSION['company_id'])) { ?> <ul class="breadcrumb"> <li><a href="#">Home</a></li> <li><a class="active" href="#">Companies</a></li> </ul> <div class="page-heading"> <h1>View Companies</h1> </div> <div class="table-responsive custom-table"> <?php $company = new company(); $results = $company->get_companies(); if ($results) { } ?> <table id="myTable"> <thead> <tr> <th>Name</th> <th>Location</th> <th>Details</th> <th>Total Branches</th> <th></th> </tr> </thead> <tbody>