
<patTemplate:tmpl name="pageoutput" unusedvars="strip">
	<script type="text/javascript">
		<!--
		var publish_image = "{PUBLISH_IMAGE}";
		var unpublish_image = "{UNPUBLISH_IMAGE}";

		function publish_review(rating_id, state) {
			div_name = '#publish_icon' + rating_id;
			curr_img = jomresJquery(div_name).attr("src") == publish_image ? unpublish_image : publish_image;
			if (curr_img == unpublish_image)
				cmd = '{JOMRES_SITEPAGE_URL_ADMIN_AJAX}&task=review_publish&rating_id=' + rating_id + '&state=0';
			else
				cmd = '{JOMRES_SITEPAGE_URL_ADMIN_AJAX}&task=review_publish&rating_id=' + rating_id + '&state=1';
			jomresJquery.get(cmd, function (data) {
				if (data == 1) {

					jomresJquery(div_name).attr("src", curr_img);
				}
			});
		}

		function delete_review(rating_id) {
			jomresJquery.get('{JOMRES_SITEPAGE_URL_ADMIN_AJAX}&task=review_delete&rating_id=' + rating_id, function (data) {
				if (data == 1) {
					row_id = '#rating_id' + rating_id;
					jomresJquery(row_id).fadeOut();
				}
			});
		}
		jomresJquery(document).ready(function () {
			make_datatable('view_property_reviews', '{HPROPERTYNAME}: {PROPERTY_NAME}', '{LIVESITE}');
		});
		//-->
	</script>
	<h2 class="page-header">{HPROPERTYNAME}: {PROPERTY_NAME}</h2>

	<p>{_JOMRES_REVIEWS_REPORT_INSTRUCTIONS}</p>
	<table id="view_property_reviews" width="100%" class="table table-striped">
		<thead>
		<tr>
			<th class="hidden-phone">&nbsp;</th>
			<th><!--{_JOMRES_REVIEWS_ADMIN_PUBLISHREVIEW}--></th>
			<!--<th>{_JOMRES_REVIEWS_ADMIN_DELETEREVEIEW}</th>-->
			<th>{_JOMRES_MR_AUDIT_LISTING_USER}</th>
			<th class="hidden-phone">{_JOMRES_REVIEWS_SUBMITTEDDATE}</th>
			<th>{_JOMRES_REVIEWS_TITLE}</th>
			<th class="hidden-phone">{_JOMRES_REVIEWS_REVIEWBODY_SAID}</th>
			<th class="hidden-phone">{_JOMRES_REVIEWS_PROS}</th>
			<th class="hidden-phone">{_JOMRES_REVIEWS_CONS}</th>
			<th class="hidden-phone">{_JOMRES_REVIEWS_RATING}</th>
			<th class="hidden-phone">{_JOMRES_REVIEWS_REPORT_REVIEW_TITLE}</th>
		</tr>
		</thead>
		<tbody>
		<patTemplate:tmpl name="rows" unusedvars="nbsp" type="simpleCondition" requiredVars="rating_id">
			<tr id="{ROW_ID}">
				<td class="hidden-phone">{RATING_ID}</td>
				<td><a href="javascript:void(0);" style="outline: none;"
					   onClick="publish_review({RATING_ID},{PUBLISHED});"><img id="publish_icon{RATING_ID}"
																			   src="{PUBLISH_ICON}"/></a> <a
						href="javascript:void(0);" style="outline: none;" onClick="delete_review({RATING_ID});"><img
						src="{DELETE_ICON}"/></a></td>
				<td>{USER_ID}</td>
				<td class="hidden-phone">{RATING_DATE}</td>
				<td>{REVIEW_TITLE}</td>
				<td class="hidden-phone">{REVIEW_DESCRIPTION}</td>
				<td class="hidden-phone">{PROS}</td>
				<td class="hidden-phone">{CONS}</td>
				<td class="hidden-phone">{RATING}</td>
				<td class="hidden-phone">{REPORTS}</td>
			</tr>
		</patTemplate:tmpl>
		</tbody>
	</table>
</patTemplate:tmpl>