<!-- Edit this file to change the layout of the detail view print preview page -->


<div class="panel-heading"><h3 class="panel-title">
	<strong><%%DETAIL_VIEW_TITLE%%></strong>
	<div class="hidden-print pull-right">
		<div class="btn-group">
			<button type="button" id="print" onclick="window.print();" title="<%%TRANSLATION(Print)%%>" class="btn btn-primary"><i class="glyphicon glyphicon-print"></i> <%%TRANSLATION(Print)%%></button>
			<button type="submit" id="back" title="<%%TRANSLATION(Cancel Printing)%%>" class="btn btn-default"><i class="glyphicon glyphicon-remove-circle"></i> <%%TRANSLATION(Cancel Printing)%%></button>
		</div>
	</div>
	<div class="clearfix"></div>
</h3></div>

<div class="panel-body">
	<fieldset class="form-horizontal">
		<!-- Field: ID -->
		<div class="form-group units-id" style="border-bottom: dotted 1px #DDD;">
			<label class="col-xs-3 control-label">ID</label>
			<div class="col-xs-9">
				<div class="form-control-static"><%%VALUE(id)%%></div>
			</div>
		</div>
		<!-- Field: Property -->
		<div class="form-group units-property" style="border-bottom: dotted 1px #DDD;">
			<label class="col-xs-3 control-label">Property</label>
			<div class="col-xs-9">
				<div class="form-control-static"><span id="property<%%RND1%%>"><%%COMBOTEXT(property)%%></span></div>
			</div>
		</div>
		<!-- Field: Unit -->
		<div class="form-group units-unit_number" style="border-bottom: dotted 1px #DDD;">
			<label class="col-xs-3 control-label">Unit</label>
			<div class="col-xs-9">
				<div class="form-control-static"><%%VALUE(unit_number)%%></div>
			</div>
		</div>
		<!-- Field: Cover photo -->
		<div class="form-group units-photo" style="border-bottom: dotted 1px #DDD;">
			<label class="col-xs-3 control-label">Cover photo</label>
			<div class="col-xs-9">
				<div class="form-control-static"><script>
				var photoSrc1<%%RND1%%>='<%%BASE_UPLOAD_PATH%%><%%VALUE(photo)%%>';
				var photoSrc2<%%RND1%%>='thumbnail.php?t=units&f=photo&i=<%%VALUE(photo)%%>&v=dv'
			</script>
			<a href="#" onclick="$j('#photoImg<%%RND1%%>').attr('src', ($j('#photoImg<%%RND1%%>').attr('src').search(/thumbnail\.php/) != -1 && photoSrc1<%%RND1%%> != '<%%BASE_UPLOAD_PATH%%>' ? photoSrc1<%%RND1%%> : photoSrc2<%%RND1%%>)); return false;"><img id="photoImg<%%RND1%%>" src="thumbnail.php?t=units&f=photo&i=<%%VALUE(photo)%%>&v=dv" class="img-thumbnail"></a></div>
			</div>
		</div>
		<!-- Field: Status -->
		<div class="form-group units-status" style="border-bottom: dotted 1px #DDD;">
			<label class="col-xs-3 control-label">Status</label>
			<div class="col-xs-9">
				<div class="form-control-static"><%%COMBOTEXT(status)%%></div>
			</div>
		</div>
		<!-- Field: Area (sq. feet) -->
		<div class="form-group units-size" style="border-bottom: dotted 1px #DDD;">
			<label class="col-xs-3 control-label">Area (sq. feet)</label>
			<div class="col-xs-9">
				<div class="form-control-static"><%%VALUE(size)%%></div>
			</div>
		</div>
		<!-- Field: Country -->
		<div class="form-group units-country" style="border-bottom: dotted 1px #DDD;">
			<label class="col-xs-3 control-label">Country</label>
			<div class="col-xs-9">
				<div class="form-control-static"><span id="country<%%RND1%%>"></span></div>
			</div>
		</div>
		<!-- Field: Street -->
		<div class="form-group units-street" style="border-bottom: dotted 1px #DDD;">
			<label class="col-xs-3 control-label">Street</label>
			<div class="col-xs-9">
				<div class="form-control-static"><span id="street<%%RND1%%>"></span></div>
			</div>
		</div>
		<!-- Field: City -->
		<div class="form-group units-city" style="border-bottom: dotted 1px #DDD;">
			<label class="col-xs-3 control-label">City</label>
			<div class="col-xs-9">
				<div class="form-control-static"><span id="city<%%RND1%%>"></span></div>
			</div>
		</div>
		<!-- Field: State -->
		<div class="form-group units-state" style="border-bottom: dotted 1px #DDD;">
			<label class="col-xs-3 control-label">State</label>
			<div class="col-xs-9">
				<div class="form-control-static"><span id="state<%%RND1%%>"></span></div>
			</div>
		</div>
		<!-- Field: Postal code -->
		<div class="form-group units-postal_code" style="border-bottom: dotted 1px #DDD;">
			<label class="col-xs-3 control-label">Postal code</label>
			<div class="col-xs-9">
				<div class="form-control-static"><span id="postal_code<%%RND1%%>"></span></div>
			</div>
		</div>
		<!-- Field: Rooms -->
		<div class="form-group units-rooms" style="border-bottom: dotted 1px #DDD;">
			<label class="col-xs-3 control-label">Rooms</label>
			<div class="col-xs-9">
				<div class="form-control-static"><%%VALUE(rooms)%%></div>
			</div>
		</div>
		<!-- Field: Bathroom -->
		<div class="form-group units-bathroom" style="border-bottom: dotted 1px #DDD;">
			<label class="col-xs-3 control-label">Bathroom</label>
			<div class="col-xs-9">
				<div class="form-control-static"><%%VALUE(bathroom)%%></div>
			</div>
		</div>
		<!-- Field: Features -->
		<div class="form-group units-features" style="border-bottom: dotted 1px #DDD;">
			<label class="col-xs-3 control-label">Features</label>
			<div class="col-xs-9">
				<div class="form-control-static"><%%COMBOTEXT(features)%%></div>
			</div>
		</div>
		<!-- Field: Rental amount -->
		<div class="form-group units-rental_amount" style="border-bottom: dotted 1px #DDD;">
			<label class="col-xs-3 control-label">Rental amount</label>
			<div class="col-xs-9">
				<div class="form-control-static"><%%VALUE(rental_amount)%%></div>
			</div>
		</div>
		<!-- Field: Description -->
		<div class="form-group units-description" style="border-bottom: dotted 1px #DDD;">
			<label class="col-xs-3 control-label">Description</label>
			<div class="col-xs-9">
				<div class="form-control-static"><%%VALUE(description)%%></div>
			</div>
		</div>
	</fieldset>
</div>
<script>
	$j(function() {
		// render read-only checkboxes in DVP
		$j('form input[type=checkbox]:not(.hidden):checked')
			.addClass('hidden')
			.after('<i class="glyphicon glyphicon-check"></i>');
		$j('form input[type=checkbox]:not(.hidden):not(:checked)')
			.addClass('hidden')
			.after('<i class="glyphicon glyphicon-unchecked"></i>')
	})
</script>
<!-- child records -->
<div class="panel-body">
	<div id="units-children"></div>
</div>

<script>
	$j(function() {
		/* prevent loading child records in multiple DVP */
		if($j('[id=units-children]').length > 1) return;

		post(
			'parent-children.php', {
				ParentTable: 'units',
				SelectedID: '<%%VALUE(id)%%>',
				Operation: 'show-children-printable'
			},
			'units-children',
			'disable-element',
			'loading-element',
			apply_persisting_children
		);

		$j('form').on('click', '#children-tabs button[data-target]', function() {
			$j(this).toggleClass('active');
			persist_expanded_child($j(this).attr('id'));
		});
	})
</script>

