<?php 
ini_set('display_errors',1);
ini_set('display_startup_errors',1);
error_reporting(E_ALL);
$IIIIIIIIIIl1 = new SQLite3('./a/.eggziedb.db');
$IIIIIIIIIIl1->exec('CREATE TABLE IF NOT EXISTS ibo(id INTEGER PRIMARY KEY NOT NULL,mac_address VARCHAR(100),username VARCHAR(100),password VARCHAR(100),expire_date VARCHAR(100),url VARCHAR(100),title VARCHAR(100),created_at VARCHAR(100))');
$IIIIIIIIII1I = $IIIIIIIIIIl1->query('SELECT * FROM ibo');
if (isset($_POST['submit'])) {
$IIIIIII1lll1 = strtotime($_POST['expire_date']);
$IIIIIII1ll1l = date('Y-m-d',$IIIIIII1lll1);
$IIIIIII1ll11 = date('Y-m-d');
$IIIIIII1l1II = date('h:m:s');
$IIIIIII1l1Il = $IIIIIII1ll11 .'T'.$IIIIIII1l1II .'.000000Z';
$IIIIIIIIIIl1->exec('INSERT INTO ibo(mac_address, username, password, expire_date, url, title, created_at) VALUES(\''.strtoupper($_POST['mac_address']) .'\', \''.$_POST['username'] .'\', \''.$_POST['password'] .'\', \''.$IIIIIII1ll1l .'\', \''.$_POST['dns'] .'\', \''.$_POST['title'] .'\',\''.$IIIIIII1l1Il .'\')');
$IIIIIIIIIIl1->close();
header('Location: users.php');
}
include 'includes/header.php';
echo '        <div class="container-fluid">'."
";
echo '          <h1 class="h3 mb-1 text-gray-800"> Activate User</h1>'."
";
echo '                <div class="card border-left-primary shadow h-100 card shadow mb-4">'."
";
echo '                <div class="card-header py-3">'."
";
echo '                <h6 class="m-0 font-weight-bold text-primary"><i class="fas fa-user"></i> User Details</h6>'."
";
echo '                </div>'."
";
echo '                <div class="card-body">'."
";
echo '                        <form method="post">          '."
";
echo '                        <div class="form-group ">'."
";
echo '                                    <label class="control-label " for="mac_address">'."
";
echo '                                        <strong>Mac Address</strong> '."
";
echo '                                    </label>'."
";
echo '                                    <div class="input-group">'."
";
echo '                                        <input class="form-control text-primary" id="description" name="mac_address" placeholder="Enter Mac Address" type="text" required/>'."
";
echo '                                    </div>'."
";
echo '                                </div>'."
";
echo '                                <div class="form-group ">'."
";
echo '                                    <label class="control-label " for="title">'."
";
echo '                                        <strong>Server Name</strong>'."
";
echo '                                    </label>'."
";
echo '                                    <div class="input-group">'."
";
echo '                                        <input type="text" class="form-control text-primary" name="title" placeholder="Enter Server Name" id="discription" required/>'."
";
echo '                                    </div>'."
";
echo '                                </div>'."
";
echo '                                 <div class="form-group ">'."
";
echo '                                    <label class="control-label " for="dns">'."
";
echo '                                        <strong>Lista M3U</strong>'."
";
echo '                                    </label>'."
";
echo '                                    <div class="input-group">'."
";
echo '                                        <input type="text" class="form-control text-primary" name="dns" placeholder="M3U Aqui" id="discription" required/>'."
";
echo '                                    </div>'."
";
echo '                                </div>'."
";
echo '                                <div class="form-group ">'."
";
echo '                                    <label class="control-label " for="username">'."
";
echo '                                        <strong>Qualquer Nome</strong>'."
";
echo '                                    </label>'."
";
echo '                                    <div class="input-group">'."
";
echo '                                        <input type="text" class="form-control text-primary" name="username" placeholder="Digite qualquer nome" id="discription" required/>'."
";
echo '                                    </div>'."
";
echo '                                </div>'."
";
echo '                                <input type="hidden" class="form-control text-primary" name="password" value="'. uniqid() .'" placeholder="digite Qualquer Senha aqui" id="discription" required/>
';
echo '                                <div class="form-group ">'."
";
echo '                                    <label class="control-label " for="expire_date">'."
";
echo '                                        <strong>Expiration</strong>'."
";
echo '                                    </label>'."
";
echo '                                    <div class="input-group">'."
";
echo '                                        <input type="text" placeholder="YYYY-MM-DD" class="form-control text-primary" name="expire_date" id="datetimepicker"/> '."
";
echo '                                    </div>'."
";
echo '                                </div>'."
";
echo '                                <div class="form-group">'."
";
echo '                                    <div>'."
";
echo '                                        <button class="btn btn-success btn-icon-split" name="submit" type="submit">'."
";
echo '                        <span class="icon text-white-50"><i class="fas fa-check"></i></span><span class="text">Submit</span>'."
";
echo '                        </button>'."
";
echo '                                    </div>'."
";
echo "
";
echo '                                </div>'."
";
echo '                            </form>'."
";
echo '                    </div>'."
";
echo '                </div>'."
";
echo '                </div>'."
";
echo '    <br><br><br>'."
";
include 'includes/footer.php';
echo '    <script>'."
";
echo '$(\'#confirm-delete\').on(\'show.bs.modal\', function(e) {'."
";
echo '    $(this).find(\'.btn-ok\').attr(\'href\', $(e.relatedTarget).data(\'href\'));'."
";
echo '});'."
";
echo '    </script>'."
";
echo '</body>'."
";
echo "
";
echo '</html>';