List of Employees with related Office information

This page uses a Hashtag List to show records for all Employees, and their related Office information.   The table is styled using Bootstrap 3 default theme classes.   Methods are provided to Edit or Delete any Employee record.  

No Employees




Processed this Hashtag Markup:
<# start list for employees;
	relate office_id to offices.id;
	sort by offices.country_iso_code desc, offices.name, employees.name;
	hide bottom pager;
#>

<# start header #>
<table class="table table-striped table-hover">
	<thead>
	<tr>
		<th>Employee Name</th>
		<th>Title</th>
		<th>Office</th>
		<th>Action</th>
	</tr>
	</thead>
<# end header #>

<# start row #>
	<tr>
		<td><# name as html #></td>
		<td><# title as html #></td>
		<td><# if "<# offices.name #>"!="" #>
				<# offices.name as html #> (<# offices.country_iso_code as html #>)
			<# else #>
				<span class="text-danger">No Office</span>
			<# end if #>
		</td>
		<td><a href="employee?edit=<# id #>" class="label label-primary">Edit</a>
			<a href="delete-employee?id=<# id #>&index=<#[url.index as html]#>" 
				onclick="return confirm('Delete Employee record?')"
				class="label label-primary">Delete</a>	
		</td>
	</tr>
<# end row #>

<# start footer #>
</table>
<# end footer #>

<# start no results #>
<h4 class="alert alert-warning text-center">No Employees Found</h4>
<# end no results #>

<# end list #>
Hashtag Markup for Delete Action: /company/delete-employee
<# delete record for "employees.<#[url.id]#>"; 
	redirect to "/company/employees?index=<#[url.index as url]#>";
#>

The Company Mini-App uses the Hashtag Markup Language to maintain multiple sets of records that relate to each other.

Records for Employees, Offices, and Countries are stored in an SQL Database.   Methods are provided to create, update, and delete any record.