<?php echo $this->extend('template/admin/main') ?>

<?php echo $this->section('content') ?>

<?php echo $this->include('common/message') ?>

<div class="card mb-4">
    <div class="card-body">

        <form action="<?php echo base_url(route_to('update-geidea', $geideawave->id)) ?>" id="geideawaveedit" method="post" class="row g-3" accept-charset="utf-8" enctype="multipart/form-data">
            <?php echo $this->include('common/securityupdate') ?>

            <div class="row">
                <div class="col-12 col-md-6 col-lg-4 offset-md-4">
                    <div class="row">
                        <div class="col-12 mt-3">
                            <label for="live_public_key" class=""><?php echo lang("Localize.live") . " " . lang("Localize.public") . " " . lang("Localize.key") ?></label>
                            <input type="text" id="live_public_key" name="live_public_key" value="<?php echo esc(old('live_public_key')) ?? $geideawave->live_public_key  ?>" class="form-control" placeholder="<?php echo lang("Localize.live") . " " . lang("Localize.public") . " " . lang("Localize.key") ?>">
                        </div>

                        <div class="col-12 mt-3">
                            <label for="live_api_pass" class=""><?php echo lang("Localize.live") . " " . lang("Localize.secret") . " " . lang("Localize.key") ?></label>
                            <input type="text" id="live_api_pass" name="live_api_pass" value="<?php echo esc(old('live_api_pass')) ?? $geideawave->live_api_pass ?>" class="form-control" placeholder="<?php echo lang("Localize.live") . " " . lang("Localize.secret") . " " . lang("Localize.key") ?>">
                        </div>

                        <div class="col-12 mt-3">
                            <label for="test_public_key" class=""><?php echo lang("Localize.test") . " " . lang("Localize.public") . " " . lang("Localize.key") ?></label>
                            <input type="text" id="test_public_key" name="test_public_key" value="<?php echo esc(old('test_public_key')) ?? $geideawave->test_public_key ?>" class="form-control" placeholder="<?php echo lang("Localize.test") . " " . lang("Localize.public") . " " . lang("Localize.key") ?>">
                        </div>

                        <div class="col-12 mt-3">
                            <label for="test_api_pass" class=""><?php echo lang("Localize.test") . " " . lang("Localize.secret") . " " . lang("Localize.key") ?></label>
                            <input type="text" id="test_api_pass" name="test_api_pass" value="<?php echo esc(old('test_api_pass')) ?? $geideawave->test_api_pass ?>" class="form-control" placeholder="<?php echo lang("Localize.test") . " " . lang("Localize.secret") . " " . lang("Localize.key") ?>">
                        </div>

                        <div class="col-12 mt-3 environment-radio">
                            <label><?php echo lang("Localize.environment") ?></label>

                            <div class="form-check">
                                <input class="form-check-input" type="radio" name="environment" id="env-live" value="1" <?php echo $geideawave->environment ? 'checked' : '' ?> />
                                <label class="form-check-label" for="env-live">
                                    <?php echo lang("Localize.live") ?>
                                </label>
                            </div>

                            <div class="form-check">
                                <input class="form-check-input" type="radio" name="environment" id="env-test" value="0" <?php echo !$geideawave->environment ? 'checked' : '' ?> />
                                <label class="form-check-label" for="env-test">
                                    <?php echo lang("Localize.test") ?>s
                                </label>
                            </div>
                        </div>

                        <div class="text-danger">
                            <?php if (isset($validation)) : ?>
                                <?= $validation->listErrors(); ?>
                            <?php endif ?>
                        </div>
                    </div>

                    <div class="col-12 text-center">
                        <button type="submit" class="btn btn-success"><?php echo lang("Localize.submit") ?></button>
                    </div>
                </div>
            </div>
        </form>
    </div>
</div>

<?php echo $this->endSection(); ?>