
<patTemplate:tmpl name="pageoutput" unusedvars="strip">
<script language="JavaScript" type="text/javascript">
	<!--
	jomresJquery(document).ready(function () {
		make_datatable('admin_listproperties', '{PAGETITLE}', '{LIVESITE}', '{AJAX_URL}');
		column_ids = new Array(1,3,4,5,6,7,9,11,12,13,14);
		dataTableSetHiddenColumns('admin_listproperties', column_ids);
		
		var $content = jomresJquery('#filter_properties').html();
		jomresJquery('#jomres_admin_toolbar').html($content);
		jomresJquery('#filter_properties').empty();
		
		if (jomresJquery('#jomres_admin_toolbar').html().trim() != '')
			jomresJquery('#jomres_admin_toolbar').css("display", "block");
		});
	
	function savecrates(property_uid, crate_id) 
		{
		cmd = '{JOMRES_SITEPAGE_URL_ADMIN_AJAX}&task=savecrates_ajax&property_uid=' + property_uid + '&crate_id=' + crate_id;
		jomresJquery.get(cmd, function (data) {
			//alert "OK"
			});
		}
	
	function setApproval(property_uid, approved) 
		{
		cmd = '{JOMRES_SITEPAGE_URL_ADMIN_AJAX}&task=ajax_list_properties_approve&property_uid=' + property_uid + '&approved=' + approved;
		jomresJquery.get(cmd, function (data) {
			//alert "OK"
			});
		}
</script>

<h2 class="page-header">{PAGETITLE}</h2>

<div class="alert alert-warning">{WARNING}</div>

<div id="filter_properties" class="btn-toolbar">
	<a href="#list_properties_filters" role="button" data-toggle="modal" class="btn"><i class="icon-filter"></i> {HFILTER}</a>
</div>

<table width="100%" id="admin_listproperties" class="table table-striped">
	<thead>
		<tr>
			<th>{HSTATUS}</th>
			<th>{HPROPERTYUID}</th>
			<th>{HPROPERTYNAME}</th>
			<th>{HPROPERTY_STREET}</th>
			<th>{HPROPERTY_TOWN}</th>
			<th>{HPROPERTY_REGION}</th>
			<th>{HPROPERTY_POSTCODE}</th>
			<th>{HPROPERTY_COUNTRY}</th>
			<th>{HPROPERTY_TEL}</th>
			<th>{HPROPERTY_FAX}</th>
			<th>{HPROPERTY_EMAIL}</th>
			<th>{HPROPERTY_STARS}</th>
			<th>{HPROPERTY_SUPERIOR}</th>
			<th>{HPROPERTY_LAT}</th>
			<th>{HPROPERTY_LONG}</th>
			<th>{HAPPROVED}</th>
			<th>{HLASTCHANGED}</th>
			<th>{HCRATE}</th>
		</tr>
	</thead>
	<tbody>
	</tbody>
</table>

<h5>{HLEGEND}</h5>
<span class="label label-red">{HNOTCOMPLETED}</span>
<span class="label label-orange">{HWAITINGAPPROVAL}</span>

<form action="" method="post" name="filterProperties" class="form-horizontal">
<div id="list_properties_filters" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
	<div class="modal-header">
		<button type="button" class="close" data-dismiss="modal" aria-hidden="true">x</button>
		<h3 id="myModalLabel">{HFILTER}</h3>
	</div>
	<div class="modal-body">
		<div class="control-group">
			<div class="control-label">
				{HPUBLISHED_STATUS}
			</div>
			<div class="controls">
				{PUBLISHED_STATUS}
			</div>
		</div>
		<div class="control-group">
			<div class="control-label">
				{HAPPROVED}
			</div>
			<div class="controls">
				{APPROVED_STATUS}
			</div>
		</div>
		<div class="control-group">
			<div class="control-label">
				{HPTYPE}
			</div>
			<div class="controls">
				{PTYPE}
			</div>
		</div>
	</div>
	<div class="modal-footer">
		<a class="btn" data-dismiss="modal" aria-hidden="true">{COMMON_CLOSE}</a>
		<input type="submit" value="{HFILTER}" class="btn btn-primary" />
	</div>
</div>
<input type="hidden" name="task" value="listproperties" />
{CSRF_TOKEN}
</form>
</patTemplate:tmpl>