51 lines
1.9 KiB
PHP
51 lines
1.9 KiB
PHP
<?= $this->extend('layouts/main') ?>
|
|
|
|
<?= $this->section('styles') ?>
|
|
<link rel="stylesheet" href="<?= base_url('assets/css/query-builder.css') ?>">
|
|
<?= $this->endSection() ?>
|
|
|
|
<?= $this->section('content') ?>
|
|
<header class="cb-page-header cb-page-header--center">
|
|
<div>
|
|
<h1 class="cb-page-title">Create query</h1>
|
|
<p class="cb-page-subtitle mb-0">Define a new reusable query for charts and dashboards.</p>
|
|
</div>
|
|
<div class="d-flex flex-wrap align-items-center gap-3" id="test">
|
|
<a href="<?= base_url('query') ?>" class="qb-text-link">Back to list</a>
|
|
<button class="btn cb-page-primary-btn" type="submit" form="qbQueryForm">Save query</button>
|
|
</div>
|
|
</header>
|
|
|
|
<div class="cb-page-body">
|
|
<div class="qb-root">
|
|
<?php if (session()->getFlashdata('errors')): ?>
|
|
<div class="alert alert-danger">
|
|
<ul class="mb-0">
|
|
<?php foreach (session()->getFlashdata('errors') as $error): ?>
|
|
<li><?= esc($error) ?></li>
|
|
<?php endforeach; ?>
|
|
</ul>
|
|
</div>
|
|
<?php endif; ?>
|
|
<?php if (session()->getFlashdata('error')): ?>
|
|
<div class="alert alert-danger"><?= esc(session()->getFlashdata('error')) ?></div>
|
|
<?php endif; ?>
|
|
|
|
<form method="post" action="<?= base_url('query/store') ?>" id="qbQueryForm">
|
|
<?= csrf_field() ?>
|
|
<?= $this->include('query/_form', [
|
|
'savedQuery' => $savedQuery ?? null,
|
|
'visualConfig' => $visualConfig ?? [],
|
|
'fieldMapRows' => $fieldMapRows ?? [],
|
|
]) ?>
|
|
<div class="mt-3" id="queryAlert"></div>
|
|
<div class="mt-3" id="previewPanel" style="display:none;"></div>
|
|
</form>
|
|
</div>
|
|
</div>
|
|
<?= $this->endSection() ?>
|
|
|
|
<?= $this->section('scripts') ?>
|
|
<?= $this->include('query/_query_scripts', ['initialVariables' => $initialVariables ?? []]) ?>
|
|
<?= $this->endSection() ?>
|