61 lines
2.5 KiB
PHP
61 lines
2.5 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">Edit query</h1>
|
|
<p class="cb-page-subtitle mb-0">Update and test your SQL definitions.</p>
|
|
</div>
|
|
<div class="d-flex flex-wrap align-items-center gap-3" id="test">
|
|
<a href="<?= base_url('query/view/' . (int) $savedQuery['id']) ?>" class="qb-text-link">View</a>
|
|
<a href="<?= base_url('query') ?>" class="qb-text-link">Back to list</a>
|
|
<button class="btn cb-page-primary-btn" type="submit" form="qbQueryForm">Update query</button>
|
|
</div>
|
|
</header>
|
|
|
|
<div class="cb-page-body">
|
|
<div class="qb-root">
|
|
<?php if (session()->getFlashdata('success')): ?>
|
|
<div class="qb-flash qb-flash-success d-flex align-items-center gap-2 mb-3" role="status">
|
|
<span class="material-symbols-outlined qb-flash-icon">check_circle</span>
|
|
<span><?= esc(session()->getFlashdata('success')) ?></span>
|
|
</div>
|
|
<?php endif; ?>
|
|
<?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/update/' . (int) $savedQuery['id']) ?>" id="qbQueryForm">
|
|
<?= csrf_field() ?>
|
|
<input type="hidden" name="saved_query_id" value="<?= (int) $savedQuery['id'] ?>">
|
|
|
|
<?= $this->include('query/_form', [
|
|
'savedQuery' => $savedQuery,
|
|
'visualConfig' => $visualConfig ?? [],
|
|
'fieldMapRows' => $fieldMapRows ?? [],
|
|
'apiHeaderRows' => $apiHeaderRows ?? [],
|
|
]) ?>
|
|
<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() ?>
|