<?php
$IIIIIIIIIl11 = file_get_contents('./includes/eggzie.json');
$IIIIIIIII1II = json_decode($IIIIIIIIIl11, true);
$IIIIIIIII1Il = $IIIIIIIII1II['info'];

$IIIIIIIIlI11 = $IIIIIIIII1Il['aa'];
$IIIIIIIII1ll = ($IIIIIIIII1Il['aa'] == '1' ? 'selected' : '');
$IIIIIIIIllII = ($IIIIIIIII1Il['aa'] == '2' ? 'selected' : '');
$IIIIIIIIllIl = ($IIIIIIIII1Il['aa'] == '3' ? 'selected' : '');
$IIIIIIIIllI1 = ($IIIIIIIII1Il['aa'] == '4' ? 'selected' : '');
$IIIIIIIIlllI = ($IIIIIIIII1Il['aa'] == '5' ? 'selected' : '');
$IIIIIIIIllll = ($IIIIIIIII1Il['aa'] == '6' ? 'selected' : '');
$IIIIIIIIlll1 = ($IIIIIIIII1Il['aa'] == '7' ? 'selected' : '');
$IIIIIIIIll1I = ($IIIIIIIII1Il['aa'] == '8' ? 'selected' : '');
$IIIIIIIIll1l = ($IIIIIIIII1Il['aa'] == '9' ? 'selected' : '');
$IIIIIIIIll11 = ($IIIIIIIII1Il['aa'] == '11' ? 'selected' : '');
$IIIIIIIIl1II = ($IIIIIIIII1Il['aa'] == '12' ? 'selected' : '');
$IIIIIIIIl1Il = ($IIIIIIIII1Il['aa'] == '13' ? 'selected' : '');
$IIIIIIIIl1I1 = ($IIIIIIIII1Il['aa'] == '14' ? 'selected' : '');
$IIIIIIIIl1lI = ($IIIIIIIII1Il['aa'] == '15' ? 'selected' : '');

$IIIIIIIIl1ll = '<div class="alert alert-primary" id="flash-msg"><h4><i class="icon fa fa-check"></i>Tema Atualizado!</h4></div>';

if (isset($_POST['submit'])) {
    $IIIIIIIIl1l1 = file_get_contents('./includes/eggzie.json');
    $date = date('d-m-Y H:i:s');
    $IIIIIIIIl11I = time();
    $IIIIIIIIl111 = base64_encode($date);
    $IIIIIIII1IIl = sha1($IIIIIIIIl111);
    $IIIIIIII1IlI = $IIIIIIIII1Il['ii'] + 1;
    $IIIIIIII1Ill = json_decode($IIIIIIIIl1l1, true);
    $IIIIIIII1Il1 = ['info' => ['aa' => $_POST['aa'], 'bb' => $date, 'cc' => $IIIIIIIIl11I, 'dd' => $IIIIIIIIl111, 'ff' => $IIIIIIII1IlI, 'gg' => $IIIIIIII1IIl]];
    $IIIIIIII1I1I = array_replace_recursive($IIIIIIII1Ill, $IIIIIIII1Il1);
    $IIIIIIII1I1l = json_encode($IIIIIIII1I1I, JSON_UNESCAPED_UNICODE);
    file_put_contents('./includes/eggzie.json', $IIIIIIII1I1l);
    header('Location: colour.php?m=' . $IIIIIIIIl1ll);
}

include 'includes/header.php';
?>

<!-- Begin Page Content -->
<div class="container-fluid">

<?php if (isset($_GET['m'])) { echo $_GET['m']; } ?>

<!-- Page Heading -->
<h1 class="h3 mb-1 text-gray-800">Alteração de Cores</h1>

<!-- Content Row -->
<div class="row">

    <!-- First Column -->
    <div class="col-lg-12">

        <!-- Custom codes -->
        <div class="card border-left-primary shadow h-100 card shadow mb-4">
            <div class="card-header py-3">
                <h6 class="m-0 font-weight-bold text-primary"><i class="fa fa-paintbrush"></i> Cores</h6>
            </div>
            <div class="card-body">
                <form method="post">
                    <div class="form-group">
                        <label class="control-label requiredField" for="aa">
                            <strong>Escolha Sua Cor</strong>
                        </label>
                        <select class="select form-control text-primary" id="select" name="aa">
                            <option value="1" <?= $IIIIIIIII1ll ?>>Roxo</option>
                            <option value="2" <?= $IIIIIIIIllII ?>>Azul</option>
                            <option value="3" <?= $IIIIIIIIllIl ?>>Vermelho</option>
                            <option value="4" <?= $IIIIIIIIllI1 ?>>Laranja</option>
                            <option value="13" <?= $IIIIIIIIl1Il ?>>Amarelo</option>
                            <option value="5" <?= $IIIIIIIIlllI ?>>Verde</option>
                            <option value="6" <?= $IIIIIIIIllll ?>>Verde-Água</option>
                            <option value="7" <?= $IIIIIIIIlll1 ?>>Ciano</option>
                            <option value="8" <?= $IIIIIIIIll1I ?>>Cinza</option>
                            <option value="9" <?= $IIIIIIIIll1l ?>>Cinza Escuro</option>
                            <option value="14" <?= $IIIIIIIIl1I1 ?>>Preto</option>
                            <option value="15" <?= $IIIIIIIIl1lI ?>>Cinza Escuro - Com Preto</option>
                            <option value="11" <?= $IIIIIIIIll11 ?>>Roxo-Preto</option>
                            <option value="12" <?= $IIIIIIIIl1II ?>>Preto-Cinza</option>
                        </select>
                    </div>

                    <button class="btn btn-success btn-icon-split" name="submit" type="submit">
                        <span class="icon text-white-50"><i class="fas fa-check"></i></span>
                        <span class="text">Enviar</span>
                    </button>
                </form>
            </div>
        </div>

    </div>
</div>

<br><br><br>

<?php
include 'includes/footer.php';
require 'includes/egz.php';
?>

</body>