97 lines
4.6 KiB
PHP
97 lines
4.6 KiB
PHP
<?php
|
|
|
|
use api\classes\API;
|
|
use bin\php\Classes\pageNavbar;
|
|
|
|
if (!defined('APP_INIT')) {
|
|
exit;
|
|
}
|
|
# IDE Section
|
|
|
|
|
|
# Includes Section
|
|
include_once($_SERVER['DOCUMENT_ROOT'] . '/bin/php/Classes/pageNavbar.php');
|
|
include_once($_SERVER['DOCUMENT_ROOT'] . '/api/classes/API.php');
|
|
|
|
# Check permissions
|
|
$API = new API();
|
|
$API->checkPermissions('admin-sources', 'RO');
|
|
|
|
# Page functions
|
|
|
|
|
|
# JS Scripts to load for this page
|
|
$jsScriptLoadData['activeTabOnRefresh'] = true;
|
|
$jsScriptLoadData['copyInputValue'] = true;
|
|
$jsScriptLoadData['updateToggle'] = true;
|
|
$jsScriptLoadData['breadCrumbs'] = true;
|
|
$jsScriptLoadData['inserve_source'] = true;
|
|
$jsScriptLoadData['validateJson'] = true;
|
|
|
|
# PageClasses Setup
|
|
$pageNavbar = new pageNavbar(true);
|
|
|
|
# Retrieve Information for the page
|
|
$inserve_settings = $GLOBALS['conn']->query("SELECT * FROM system_sources WHERE source_name = 'inserve'")->fetch_assoc();
|
|
|
|
# Set breadcrumb data
|
|
array_push($GLOBALS['breadCrumbArray'], array('display' => __('portal_management'), 'href' => '/systemconfig'));
|
|
array_push($GLOBALS['breadCrumbArray'], array('display' => __('sources'), 'href' => '/systemconfig#sources'));
|
|
array_push($GLOBALS['breadCrumbArray'], array('display' => 'Inserve', 'href' => ''));
|
|
|
|
|
|
# Start page output
|
|
$pageNavbar->outPutNavbar();
|
|
?>
|
|
<div class="card-body activeTabOnRefresh" style="opacity: 0; transition: opacity 10ms;">
|
|
<div class="row">
|
|
<div class="col-md-12 col-lg-12">
|
|
<div class="tab-content" id="v-pills-with-icon-tabContent">
|
|
<div class="card">
|
|
<div class="mx-2 pb-0 card-body">
|
|
<h1 class="">Inserve settings</h1>
|
|
<p>
|
|
Enter the necessary API details to set up and configure your connection to the Inserve API. This allows Sentri to communicate with Inserve and retrieve the data it needs. </p>
|
|
<hr>
|
|
</div>
|
|
|
|
<form id="FormValidation" method="post" action="/api/v1/system/sources/inserve/">
|
|
<input type="hidden" name="_method" value="POST">
|
|
<input type="hidden" name="_return" value="/system/sources/inserve">
|
|
<input type="hidden" name="source_name" value="inserve">
|
|
<div class="card-body">
|
|
|
|
<div class="form-group form-show-validation row">
|
|
<label for="source_url" class="col-lg-3 col-md-3 col-sm-4 mt-sm-2"><?php echo __('inserve_url') ?></label>
|
|
<div class="col-lg-9 col-md-12 col-sm-10">
|
|
<input type="text" class="form-control" id="source_url" name="source_url" value="<?php echo ($inserve_settings) ? $inserve_settings['source_url'] : '' ?>" placeholder="" required/>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="form-group form-show-validation row">
|
|
<label for="source_auth_token" class="col-lg-3 col-md-3 col-sm-4 mt-sm-2"><?php echo __('api_token') ?></label>
|
|
<div class="col-lg-9 col-md-12 col-sm-10">
|
|
<input type="text" class="form-control" id="source_auth_token" name="source_auth_token" value="" autocomplete="off" placeholder="<?php echo ($inserve_settings) ? substr($inserve_settings['source_auth_token'], 0, 6) . str_repeat('*', max(0, strlen($inserve_settings['source_auth_token']) - 6)) : ''; ?>" required/>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="card-footer py-4">
|
|
<div class="row">
|
|
<div class="col d-flex justify-content-end">
|
|
<button class="btn btn-success mx-2 test-inserve-connection-btn">
|
|
<i class="fa-solid fa-spell-check"></i> <?php echo __('test_connection') ?>
|
|
</button>
|
|
<?php if ($API->checkPermissions('admin-sources', 'RW', true)) { ?>
|
|
<button type="submit" class="btn btn-primary">
|
|
<i class="fa-solid fa-floppy-disk"></i> <?php echo __('save') ?>
|
|
</button>
|
|
<?php } ?>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</form>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|