<input type="hidden" name="report_id" value="[{$report_id}]">
<input type="hidden" name="querybuilder" id="querybuilder" value='[{$querybuilder|escape:"javascript"}]'>

<div class="p10 display-flex align-items-start" id="reportHeader">
	<div>
        <h2 [{if $reportDescription}]class="mb10"[{/if}]>
            <span id="report-title">[{$reportTitle}]</span>
            <span class="ml10 text-grey report-matches" data-count="[{$rowcount}]">[[{$rowcount}] [{isys type="lang" ident="LC__REPORT__MATCHES"}]]</span>
        </h2>
        <p>[{$reportDescription|nl2br}]</p>
    </div>

    <div class="ml-auto export-report [{if $showReportExport === false}]hide[{/if}]">
        [{if $allowedObjectGroup}]
        <button type="button" id="createObjectGroup" class="btn btn-secondary">
            <img class="mr5" src="[{$dir_images}]axialis/basic/symbol-add.svg" /><span>[{isys type="lang" ident="LC__CMDB__OBJECT_BROWSER__CREATE_NEW_OBJECT_GROUP_FROM_REPORT"}]</span>
        </button>
        [{/if}]
        <button type="button" class="btn btn-secondary ml5 export-btn" data-object-id="[{$objectId}]" data-report-id="[{$report_id}]" data-export-type="txt">
            <img class="mr5" src="[{$dir_images}]axialis/documents-folders/document-format-txt.svg" /><span>TXT</span>
        </button>
        <button type="button" class="btn btn-secondary ml5 export-btn" data-object-id="[{$objectId}]" data-report-id="[{$report_id}]" data-export-type="csv">
            <img class="mr5" src="[{$dir_images}]axialis/documents-folders/document-format-csv.svg" /><span>CSV</span>
        </button>
        <button type="button" class="btn btn-secondary ml5 export-btn" data-object-id="[{$objectId}]" data-report-id="[{$report_id}]" data-export-type="xml">
            <img class="mr5" src="[{$dir_images}]axialis/documents-folders/document-format-xml.svg" /><span>XML</span>
        </button>
        <button type="button" class="btn btn-secondary ml5 export-btn" data-object-id="[{$objectId}]" data-report-id="[{$report_id}]" data-export-type="pdf">
            <img class="mr5" src="[{$dir_images}]axialis/documents-folders/document-type-pdf.svg" /><span>PDF</span>
        </button>
    </div>
</div>

<script type="text/javascript">
	[{include file="./report.js"}]
</script>

[{if is_array($listing.headers)}]
	[{if $listing.grouped}]
		[{include file="./listing_group.tpl"}]
	[{else}]
		[{include file="./listing.tpl"}]
	[{/if}]
[{elseif $listing.num eq 0}]
	<div class="p5">
		<p>[{isys type="lang" ident="LC__REPORT__EMPTY_RESULT"}]</p>
	</div>
[{else}]
	<div class="p5">
		<p>[{isys type="lang" ident="LC__REPORT__EXCEPTION_TRIGGERED"}]</p>
	</div>
[{/if}]

