include_once "config.php"; include_once "adminUser.php"; include_once "list.php"; include_once "client_functions.php"; if (isset($_POST['sub'])) { $myadmin = new AdminUser(); $myadmin->setAUserName($_POST['username']); $myadmin->setAPassword($_POST['password']); $myadmin->setPath($_POST['pathname']); $myadmin->save(); $list = new BookList($_POST['pathname']); $list->saveList(); echo '<div class="login-card">'; echo "Book list has been created<br/><br/>"; echo "Usernane : " . $myadmin->getAUserName() . "<br/>"; echo "Password : "******"<br/>"; echo "Pathname : " . $myadmin->getPath() . "<br/>"; echo '</div>'; direct('admin.php', 5); } else { $myconf = new Config(); $myconf->createDB(); echo '<div class="login-card">'; echo "Database Created<br/>"; $myconf->createUserTable(); echo "User table Created<br/>"; $myconf->createBooksTable(); echo "Books table Created<br/>"; $myconf->createAdminTable(); echo "Admin table Created<br/><br/>"; echo '<form action="" method="post">';