olap/templates/default/admin_olap.tpl

168 lines
7.0 KiB
Smarty
Raw Blame History

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

<!-- SET title -->Статистика<!-- END -->
<!-- INCLUDE admin_header.tpl -->
<!-- IF NOT srcid -->
<p>Добро пожаловать в простую OLAPообразную статистику. Выберите источник данных:</p>
<form action="?" method="GET">
<select style="width:100px" name="datasource">
<!-- FOR s = sources -->
<option value="{s s.id}">{s s.name}</option>
<!-- END -->
</select>
<input type="submit" value=" Продолжить " />
</form>
<!-- ELSE -->
<p>Выбранный источник данных: <b>{s src.name}</b>. <a href="?">Выбрать другой источник данных</a>.</p>
<p>Настройте желаемый отчёт:</p>
<form action="?" method="GET">
<input type="hidden" name="datasource" value="{s src.id}" />
<input type="hidden" name="build" value="1" />
<p style="margin-top: 16px">Показатель:</p>
<p style="margin-left: 20px">
<select style="width:100px" name="cell_aggr">
<!-- FOR f = aggregates -->
<option value="{s f.id}"<!-- IF eq(cell.aggr, f.id) --> selected="selected"<!-- END -->>{s f.name}</option>
<!-- END -->
</select>
<select style="width:100px" name="cell_field">
<option value="">---</option>
<!-- FOR f = fielddescs -->
<option value="{s f.id}"<!-- IF eq(cell.field, f.id) --> selected="selected"<!-- END -->>{s f.name}</option>
<!-- END -->
</select>
<select style="width:100px" name="cell_func">
<option value="">без преобразования</option>
<!-- FOR f = functions -->
<option value="{s f.id}"<!-- IF eq(cell.func, f.id) --> selected="selected"<!-- END -->><!-- IF f.time -->(время) <!-- END -->{s f.name}</option>
<!-- END -->
</select>
</p>
<p style="margin-top: 16px">Группировка: &nbsp; &nbsp; количество полей: <input type="text" name="field_count" value="{field_count}" /></p>
<ol>
<!-- FOR fld = range(0,sub(field_count,1)) -->
<li>
<!-- SET gf = get(group_fields,fld) -->
<p><select name="group-type-{fld}">
<option value="">---</option>
<!-- FOR g = group_types -->
<option value="{g.id}"<!-- IF eq(gf.type,g.id) --> selected="selected" <!-- END -->>{g.name/s}</option>
<!-- END -->
</select>
<!-- INCLUDE admin_olap_field.tpl -->
</p>
<p><select style="width:100px" name="group-sort_dir-{fld}">
<option value="asc">По возрастанию</option>
<option value="desc"<!-- IF eq(gf.sort_dir, 'desc') --> selected="selected"<!-- END -->>По убыванию</option>
</select>
<select style="width:100px" name="group-sort_aggr-{fld}">
<option value="">по значениям поля</option>
<!-- FOR f = aggregates -->
<!-- IF NOT f.cell_only -->
<option value="{s f.id}"<!-- IF eq(gf.sort_aggr, f.id) --> selected="selected"<!-- END -->>{s f.name} другого поля:</option>
<!-- END -->
<!-- END -->
</select>
<!-- SET ft = 'sort_' --><!-- INCLUDE admin_olap_field.tpl --><!-- SET ft = '' -->
</p>
</li>
<!-- END -->
</ol>
<p style="margin-top: 16px">Условия выборки данных:</p>
<table style="margin-left: 20px">
<!-- FOR f = fielddescs -->
<tr><th style="text-align: left; vertical-align: top">{s f.name}</th>
<td style="text-align: left; vertical-align: top">
=
<!-- IF f.options -->
<select style="width: 100px" name="where-eq-{f.id}">
<option value="">любой</option>
<!-- FOR o = f.options -->
<option value="{s o.id}"<!-- IF o.selected --> selected="selected"<!-- END -->>{s o.name}</option>
<!-- END -->
</select>
<!-- ELSE -->
<input style="width: 100px" type="text" name="where-eq-{f.id}" value="{s get(wh,concat('where-eq-',f.id))}" />
<!-- END -->
<!-- IF f.le_ge -->
или &ge; <input style="width: 100px" type="text" name="where-ge-{f.id}" value="{s get(wh,concat('where-ge-',f.id))}" />
и &le; <input style="width: 100px" type="text" name="where-le-{f.id}" value="{s get(wh,concat('where-le-',f.id))}" />
<!-- END -->
<!-- IF f.is_time --> (YYYY-MM-DD HH:MM:SS)<!-- END -->
{f.comment}
</td></tr>
<!-- END -->
</table>
<p style="margin-top: 16px"><input type="submit" style="width: 200px" value=" Построить отчёт " /></p>
</form>
<!-- IF build -->
<h1>Отчёт</h1>
<p><a href="{s rpt_link}">Ссылка на данный отчёт</a> | <a href="{s csv_link}">В формате CSV</a></p>
<!-- IF and(not tables, not graphs) -->
<p>Нет данных для показа.</p>
<!-- ELSIF graphs -->
<!-- FOR graph = graphs -->
<!-- IF graph.desc -->
<!-- SET o = 0 -->
<!-- FOR d = graph.desc -->
<!-- SET o = or(o, not(graph#), ne(get(get(get(get(graphs,sub(graph#,1)),'desc'),d#),'value'),d.value)) -->
<!-- IF o -->
<p style="margin-left: {mul(d#,20)}px">{d.field}<!-- IF d.func --> ({lc d.func})<!-- END -->: {d.value}</p>
<!-- END -->
<!-- END -->
<div style="margin-left: {mul(count(table.desc),20)}px">
<!-- END -->
<table>
<!-- IF graph.bi_sign -->
<tr><th colspan="4">- {graph.field}<!-- IF graph.func --> ({lc graph.func})<!-- END --> +</th></tr>
<!-- FOR g = graph.data -->
<tr>
<td><div style="float: right; background: red; height: 7px; width: {g.3}px"></div></td>
<td>{s g.0}:&nbsp;</td><td>{s g.1}</td>
<td><div style="background: blue; height: 7px; width: {g.2}px"></div></td>
</tr>
<!-- END -->
<!-- ELSE -->
<tr><th style="text-align: left" colspan="2">{graph.field}<!-- IF graph.func --> ({lc graph.func})<!-- END --></th></tr>
<!-- FOR g = graph.data -->
<tr><td>{s g.0}:&nbsp;</td><td>{s g.1}</td><td><div style="background: blue; height: 7px; width: {g.2}px"></div></td></tr>
<!-- END -->
<!-- END -->
</table>
<!-- IF graph.desc -->
</div>
<!-- END -->
<!-- END -->
<!-- ELSE -->
<!-- FOR table = tables -->
<!-- IF table.desc -->
<!-- SET o = 0 -->
<!-- FOR d = table.desc -->
<!-- SET o = or(o, not(table#), ne(get(get(get(get(tables,sub(table#,1)),'desc'),d#),'value'),d.value)) -->
<!-- IF o -->
<p style="margin-left: {mul(d#,20)}px">{d.field}<!-- IF d.func --> ({lc d.func})<!-- END -->: {d.value}</p>
<!-- END -->
<!-- END -->
<div style="margin-left: {mul(count(table.desc),20)}px">
<!-- END -->
<table class="simpletable center">
<!-- FOR row = table.rows -->
<tr>
<!-- FOR c = row -->
<!-- IF is_array(c) -->
<th<!-- IF c.colspan --> colspan="{c.colspan}"<!-- END --><!-- IF c.rowspan --> rowspan="{c.rowspan}"<!-- END --><!-- IF c.class --> class="{c.class}"<!-- END -->>{c.text}</th>
<!-- ELSE -->
<td>{c}</td>
<!-- END -->
<!-- END -->
</tr>
<!-- END -->
</table>
<!-- IF table.desc -->
</div>
<!-- END -->
<!-- END -->
<p>Отчёт занял {time_elapsed} сек. Использовано {memory} памяти для работы.</p>
<!-- END -->
<!-- END -->
<!-- END -->
<!-- INCLUDE admin_footer.tpl -->