inital template

This commit is contained in:
2021-01-23 23:11:19 +01:00
commit 083337b7d6
40 changed files with 22633 additions and 0 deletions

60
index.php Normal file
View File

@@ -0,0 +1,60 @@
<?php
#=========================
#
# name: index.php
# version: 2.1.0
# from: 2021-01-23
# developer: 4nima
# tested with: nginx, php7
# requirements: php, bootstrap, jQuery, ajax
#
#=========================
# Default index.php
# includs all other
#
#=========================
session_start();
?>
<!DOCTYPE html>
<html>
<head>
<?php
#> inlcude config
include_once('sources/config.php');
#> include sidecontrol
include_once('sources/sides.php');
echo '<title>'.$sideTitle.'</title>';
?>
<!-- metadata -->
<meta charset="utf-8">
<meta name="viewpoint" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<!-- include style -->
<link rel="stylesheet" href="<?php echo $cssPath; ?>lib/bootstrap/bootstrap.min.css">
<link rel="stylesheet" href="<?php echo $cssPath; ?>lib/font-awesome/font-awesome.min.css">
<link rel="stylesheet" href="<?php echo $cssPath; ?>custom.css">
<!-- set favicon -->
<link rel="shortcut icon" type="image/png" href="<?php echo $imgPath; ?>favicon.ico">
<!-- include js -->
<script src="<?php echo $jsPath; ?>lib/jquery.js"></script>
<script src="<?php echo $jsPath; ?>lib/bootstrap/bootstrap.min.js"></script>
<script src="<?php echo $jsPath; ?>functions.js"></script>
<script src="<?php echo $jsPath; ?>custom.js"></script>
</head>
<body class="bg-<?php echo $colorTwo; ?>">
<?php
include($structurePath.'nav.php');
echo '<section id="window" class="pt-5 pb-3 mt-3 container mr-auto">';
include($frontendPath.$side);
echo '</section>';
include($structurePath.'footer.php');
?>
</body>
</html>

31
sources/backend/ajax.php Normal file
View File

@@ -0,0 +1,31 @@
<?php
#--------------------#
#----- by 4nima -----#
#----- v. 1.0.0 -----#
#-- coding@4nima.de -#
#--------------------#
session_start();
include_once('/volume1/web/sources/config.php');
switch ($_POST['side']) {
case 'netStatus':
include($ajaxPath.'network_status.php');
break;
case 'input':
include($ajaxPath.'db_input.php');
break;
case 'priview':
include($ajaxPath.'pokePriview.php');
break;
case 'dex':
include($ajaxPath.'pokeInsertDex.php');
break;
default:
# code...
break;
}

View File

@@ -0,0 +1,78 @@
<?php
#--------------------#
#----- by 4nima -----#
#----- v. 1.0.0 -----#
#-- coding@4nima.de -#
#--------------------#
// session_start();
// Generate Navigation
function genNav($nav) {
foreach ($nav as $item) {
if (is_array($item[1])) {
echo '
<li class="nav-item dropdown">
<a class="nav-link dropdown-toggle" href="#" id="gamedrop" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
'.$item[0].'
</a>
<div class="dropdown-menu" aria-labelledby="gamedrop">
';
foreach ($item[1] as $dropdown) {
if ($dropdown[0] == "---") {
echo '<div class="dropdown-divider"></div>';
} else {
echo '<a class="dropdown-item" href="'.$dropdown[1].'">'.$dropdown[0].'</a>';
}
}
echo '
</div>
</li>
';
} else {
echo '
<li class="nav-item">
<a class="nav-link" href="'.$item[1].'">'.$item[0].'</a>
</li>
';
}
}
}
// Setzt Login Cookie und Session
function setLogin($usr, $hash, $lvl, $stay) {
if ($stay) {
setcookie('usr', $usr, time()+18144000);
setcookie('hash', $hash, time()+18144000);
}
$_SESSION['usr'] = $usr;
$_SESSION['hash'] = $hash;
$_SESSION['lvl'] = $lvl;
}
// Login Prüfung
function checkLogin($usr, $lvl, $hash) {
$db = new Database();
$db->query('
SELECT *
FROM user
WHERE username = :usr
AND lvl = :lvl
AND pwdhash = :hash
');
$db->bind(':usr', $usr);
$db->bind(':lvl', $lvl);
$db->bind(':hash', $hash);
$user = $db->resultset();
if ($user[0]['username'] == $usr && $user[0]['lvl'] == $lvl && $user[0]['pwdhash'] == $hash) {
$login = TRUE;
} else {
$_SESSION = array();
}
return $login;
}
?>

View File

@@ -0,0 +1,372 @@
<?php
#--------------------#
#----- by 4nima -----#
#----- v. 1.3.1 -----#
#-- coding@4nima.de -#
#--------------------#
#>> Verbessungsideen
#> Errorcodes einbauen
#> DB in Eigenschaften einbinden
class Account {
#> Usergrunddaten (änderbar)
public $username;
public $uid;
public $permit;
public $email;
public $token;
#> Usergrunddaten (unveränderbar)
private $password;
private $userip = USER_IP;
#> Login Einstellungen
public $maxLoginTime = LOGIN_FAIL_TIME;
#> Mail Einstellungen (für neue User Mails)
// Mail-Text in Konfig einplfegen (Bei Mail muss der Token angehabgen werden)
public $mailFrom = MAIL_FROM;
public $mailSubject = MAIL_SUBJECT;
public $mailText = MAIL_TEXT;
public $mailPage = MAIL_PAGE;
public $mailFooter = MAIL_FOOTER;
// public $db;
public function __construct() {
}
# >>> static functions <<<
#>> Liest Accounts aus der DB entsprechend der Einstellung aus und gibt diese zurück
public static function accountList($db, $type = '') {
$db->query('
SELECT *
FROM accounts
WHERE active = :active
');
switch ($type) {
case 'All':
$db->query('
SELECT *
FROM accounts
');
break;
case 'Deactivate':
$db->bind(':active', 0);
break;
case 'Active':
$db->bind(':active', 1);
break;
case 'Not Active':
$db->bind(':active', 2);
break;
default:
$db->query('
SELECT *
FROM accounts
WHERE active > 0
');
break;
}
$accounts = $db->resultset();
if ($accounts) {
return $accounts;
} else {return FALSE;}
}
# >>> public functions <<<
#>> (Zwischen)Speichert einen User wenn alle Vorgaben erfüllt sind
public function newUser($user, $pass, $mail = '') {
if ($user != '' && $pass != '') {
if ($this->checkUser($user) && $this->checkPass($pass)) {
$this->username = $user;
$this->password = $this->hashPass($pass);
if ($mail == '' || $this->checkMail($mail)) {
$this->email = $mail;
return TRUE;
} else {return FALSE;}
} else {return FALSE;}
} else {return FALSE;}
}
#>> Speichert den User in der Datenbank und versendet bei Hinterlegter E-Mail eine bestätigung
public function saveUser($db, $permit = 100) {
if ($this->username != '' && $this->password != '') {
$db->query('
SELECT username
FROM accounts
WHERE username = :user
');
$db->bind(':user', $this->username);
$checkUsername = $db->resultset();
if ($checkUsername[0]['username'] == '') {
$time = time();
$this->token = md5($time.$this->username);
$db->query('
INSERT INTO accounts
(username, uid, email, passHash, permit, created, tokenTime, token, active)
VALUES
(:user, :uid, :mail, :pass, :permit, :time, :time, :token, 2)
');
$db->bind(':user', $this->username);
$db->bind(':mail', $this->email);
$db->bind(':pass', $this->password);
$db->bind(':permit', $permit);
$db->bind(':time', $time);
$db->bind(':token', $this->token);
$db->execute();
if ($this->email != '') {
$mailContent = 'Hallo '.$this->usernmae;
$mailContent .= '<br>';
$mailContent .= $this->mailText;
$mailContent .= '<br>';
$mailContent .= $this->mailPage;
$mailContent .= $this->token;
$mailContent .= '<br>';
$mailContent .= $this->mailFooter;
mail($this->email,
$this->mailSubject,
$mailContent,
$this->mailFrom
);
}
return TRUE;
} else {return FALSE;}
} else {return FALSE;}
}
#>> Prüft ob von dieser IP mehr als X fehlgeschlagene Login versuche kamen
public function notBlocked($db, $trys = 5) {
$db->query('
SELECT result
FROM logLogin
WHERE result = 0
AND fromIp = :ip
AND time > :time
');
$db->bind(':ip', $this->userip);
$db->bind(':time', $this->maxLoginTime);
$loginFails = $db->resultset();
if (count($loginFails[0]['result']) <= $trys) {
// Versuche und Zeit in Config aufnehmen
return TRUE;
} else {return FALSE;}
}
#>> Prüft die Eingaben und gleicht diese dann mit der Datenbank ab
public function login($db, $user, $pass) {
$loginTry = FALSE;
if ($this->notBlocked($db)) {
if ($this->checkUser($user) && $this->checkPass($pass)) {
$db->query('
SELECT uid, passHash, permit
FROM accounts
WHERE active = 1
AND username = :user
');
$db->bind(':user', $user);
$login = $db->resultset();
if (password_verify($pass, $login[0]['passHash'])) {
$this->username = $user;
$this->uid = $login[0]['uid'];
$this->permit = $login[0]['permit'];
$loginTry = TRUE;
}
}
}
$db->query('
INSERT INTO logLogin
(usedName, time, fromIp, result)
VALUES
(:user, :time, :ip, :result)
');
$db->bind(':user', $user);
$db->bind(':time', time());
$db->bind(':ip', $this->userip);
$db->bind(':result', $loginTry);
$db->execute();
if ($loginTry) {
return TRUE;
} else {return FALSE;};
}
#>> Prüft ob die UID mit der in der DB übereinstimmen und setzt den Permit neu
public function checkLogin($db) {
$uid = $this->uid;
$db->query('
SELECT username, permit
FROM accounts
WHERE active = 1
AND uid = :uid
');
$db->bind(':uid', $uid);
$login = $db->resultset();
if ($login[0]['permit'] > 0) {
$this->username = $login[0]['username'];
$this->permit = $login[0]['permit'];
return TRUE;
} else {return FALSE;}
}
#>> Prüft den Eingetragenen Token mit in der DB ab und setzt bei erfolg den Account auf Aktiv (1)
public function confirmAcc($db) {
if ($this->uid != '' || $this->token != '') {
$db->query('
SELECT token
FROM accounts
WHERE active = 2
AND uid = :uid
');
$db->bind(':uid', $this->uid);
$token = $db->resultset();
if ($token[0]['token'] == $this->token) {
$db->query('
UPDATE accounts
SET token = "",
active = 1
WHERE uid = :uid
');
$db->bind(':uid', $this->uid);
$db->execute();
return TRUE;
} else {return FALSE;}
} else {return FALSE;}
}
#>> Prüft ob das alte Passwort (in Eigenschaft gespeichert) dem in der DB entspricht und Prüft neues Passwort auf anforderungen, danach Ientrag in DB
public function switchPass($db, $newPass) {
if ($this->password != '' && $newPass != '') {
if (checkPass($this->password) && checkPass($newPass)) {
$db->query('
SELECT password
FROM accounts
WHERE uid = :uid
');
$db->bind(':uid', $this->uid);
$db->bind(':pass', $this->password);
$pass = $db->resultset();
if (password_verify($this->password, $login[0]['passHash'])) {
$newPass = hashPass($newPass);
$db->query('
UPDATE accounts
SET passHash = :pass
WHERE uid = :uid
');
$db->bind(':uid', $this->uid);
$db->bind(':pass', $newPass);
$db->execute();
return TRUE;
} else {return FALSE;}
} else {return FALSE;}
} else {return FALSE;}
}
#>> Deaktiviert einen Account dessen UID in den Eigenschfaten gespeichert ist
public function deactivateAccount($db) {
if ($this->uid != '') {
$db->query('
UPDATE accounts
SET active = 0
WHERE uid = :uid
');
$db->bind(':uid', $this->uid);
$db->execute();
return TRUE;
} else {return FALSE;}
}
# >>> private functions <<<
#>> Prüft einen String auf bestimmte Inhalte und gibt ihn entsprechend Formatiert zurück
private function checkString($string) {
$string = htmlentities($string);
return $string;
}
#>> Prüft ob der Username keine Sonderzeichen enthält
private function checkUser($user) {
if (!preg_match('#[!-/:-@\[-`{-~]#', $this->checkString($user)) && strlen($user) <= 50) {
return TRUE;
} else {return FALSE;}
}
#>> Prüft das Passwort auf ausreichende Komplexität
private function checkPass($pass) {
if ($this->checkString($pass) === $pass) {
if (strlen($pass) > 8
&& preg_match('`[A-Z]`',$pass)
&& preg_match('`[a-z]`',$pass)
&& preg_match('`[0-9]`',$pass)
&& preg_match('#[!-/:-@\[-`{-~]#',$pass)
) {
return TRUE;
} else {return FALSE;}
} else {return FALSE;}
}
#>> hasht das Passwort
private function hashPass($pass) {
return password_hash($pass, PASSWORD_DEFAULT);
}
#>> Prüft E-Mail auf korrekte Syntax & den Host auf existenz
private function checkMail($mail) {
if (filter_var($mail, FILTER_VALIDATE_EMAIL)) {
$hostname = preg_replace('/^.*@/', '', $mail);
if (count(dns_get_record($hostname))) {
return TRUE;
// Eriwetung: Prüfung ob E-Mails tatsächlich existieren
} else {return FALSE;}
} else {return FALSE;}
}
# >> Firststeps <<
public static function createDB($db) {
//
// $db->query('
// CREATE TABLE `network`.`accounts` (
// `idAcc` INT NOT NULL AUTO_INCREMENT,
// `username` VARCHAR(50) NOT NULL,
// `uid` VARCHAR(256) NOT NULL,
// `email` VARCHAR(50) NULL,
// `passHash` VARCHAR(256) NOT NULL,
// `permit` INT(3) NOT NULL DEFAULT 100,
// `tokenTime` INT(25) NULL DEFAULT 0,
// `token` VARCHAR(256) NULL,
// `created` INT(25) NOT NULL DEFAULT 0,
// `active` INT(1) NOT NULL DEFAULT 0 COMMENT '0 = Deaktiviert\n1 = Aktiv \n2 = Warte auf AKtivierung\n3 = PW wechel Reset',
// PRIMARY KEY (`idAcc`))
// COMMENT = 'Userverwaltung by 4nima, coding@4nima.de';
// ');
// CREATE TABLE `network`.`logLogin` (
// `idLogin` INT NOT NULL AUTO_INCREMENT,
// `usedName` VARCHAR(50) NOT NULL COMMENT 'Welcher Username genutzt wurde',
// `fromIp` VARCHAR(15) NOT NULL COMMENT 'Von welcher IP kam der Versuch\n',
// `time` VARCHAR(25) NOT NULL COMMENT 'wann war der Versuch\n',
// `success` INT(1) NOT NULL COMMENT 'Hatte der Versuch erfolg\n',
// PRIMARY KEY (`idLogin`))
// COMMENT = 'Accountverwaltung by 4nima, coding@4nima.de';
}
}
?>

View File

@@ -0,0 +1,72 @@
<?php
class Database {
private $host = DB_HOST;
private $user = DB_USER;
private $pass = DB_PASS;
private $dbname = DB_NAME;
private $dbh;
private $error;
private $stmt;
public function __construct(){
// Set DSN
$dsn = 'mysql:host=' . $this->host . ';dbname=' . $this->dbname . ';charset=utf8';
// Set options
$options = array(
PDO::ATTR_PERSISTENT => true,
PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION
);
// Create a new PDO instanace
try{
$this->dbh = new PDO($dsn, $this->user, $this->pass, $options);
}
// Catch any errors
catch(PDOException $e){
$this->error = $e->getMessage();
}
}
public function query($query){
$this->stmt = $this->dbh->prepare($query);
}
public function bind($param, $value, $type = null){
if (is_null($type)) {
switch (true) {
case is_int($value):
$type = PDO::PARAM_INT;
break;
case is_bool($value):
$type = PDO::PARAM_BOOL;
break;
case is_null($value):
$type = PDO::PARAM_NULL;
break;
default:
$type = PDO::PARAM_STR;
}
}
$this->stmt->bindValue($param, $value, $type);
}
public function execute(){
return $this->stmt->execute();
}
public function resultset(){
$this->execute();
return $this->stmt->fetchAll(PDO::FETCH_ASSOC);
}
public function single(){
$this->execute();
return $this->stmt->fetch(PDO::FETCH_ASSOC);
}
public function rowCount(){
return $this->stmt->rowCount();
}
}

33
sources/backend/login.php Normal file
View File

@@ -0,0 +1,33 @@
<?php
// Auf Login Prüfen
if (isset($_GET['login']) && $_POST['pass'] != '' && $_POST['user'] != '') {
$user = $_POST['user'];
$pass = $_POST['pass'];
if ($acc->login($db, $user, $pass)) {
$_SESSION['uid'] = $acc->uid;
$alertMsg = 'Willkommen zurück '.$acc->username;
} else {
$alertMsg = 'Login Fehleschlagen!';
}
} elseif (isset($_GET['logout'])) {
session_destroy();
$alertMsg = 'Erfolgreich Ausgelogt!';
} elseif (isset($_SESSION['uid'])) {
$acc->uid = $_SESSION['uid'];
if (!$acc->checkLogin($db)) {
session_destroy();
}
}
// Auf neuen Account prüfen
if (isset($_GET['newAcc']) && $_POST['pass1'] == $_POST['pass2'] && $acc->permit > 700) {
// $newUser = ;
$newPass = $_POST['pass1'];
// $newMail = ;
if ($acc->newUser($newUser, $newPass, $newMail)) {
$acc->saveUser($db);
} else {
$alertMsg = 'Die Daten für den neuen Account sind Fehlerhaft';
}
}
?>

108
sources/config.php Normal file
View File

@@ -0,0 +1,108 @@
<?php
#=========================
#
# name: nav.php
# version: 2.1.0
# from: 2021-01-23
# developer: 4nima
# tested with: nginx, php7
# requirements: php
#
#=========================
# dir, color settings
# used functions
# lib includes
#=========================
#> database config (database.php)
/*
define("DB_HOST", "SERVERIP");
define("DB_USER", "DBUSER");
define("DB_PASS", 'DBPW');
define("DB_NAME", "DBNAME");
*/
#> mail config (accounts.php)
/*
define(LOGIN_FAIL_TIME, time()-60*60);
define(MAIL_FROM, 'noreply@example.com');
define(MAIL_SUBJECT, 'SUBJECT');
define(MAIL_TEXT, 'MAIL');
define(MAIL_PAGE, 'LINK');
define(MAIL_FOOTER, 'FOOTER');
*/
#> Webpage Name
$webname = "Template";
#> dir path
#> server dir
$server = '';
#> backend scripts
$backendPath = $server.'sources/backend/';
#> ajax scripts
$ajaxPath = $backendPath.'ajax/';
#> frontend scripts
$frontendPath = $server.'sources/frontend/';
#> structure skripts
$structurePath = $frontendPath.'structure/';
#> JavaScript (js)
$jsPath = $server.'sources/js/';
#> Cascading Style Sheet (css)
$cssPath = $server.'sources/css/';
#> Bilder
$imgPath = $server.'sources/img/';
#> function control
$login = false;
#> color control (primary, secondary, success, warning, info, light, dark, muted, white)
#> main color one (navbar & footer)
$colorOne = "dark";
#> main color two (background)
$colorTwo = "secondary";
#> main color three
$colorThree = "light";
#> main color three (login button)
$colorSuccess = "primary";
#> main color three (logout button)
$colorFailed = "primary";
#> text colorsw
$colorText = "muted";
#> navbar style (light, dark)
$navBarSytle = "dark";
#> default Includes
include_once($backendPath.'functions.php');
#> Libs
// include_once($libPath.'database.php');
// include_once($libPath.'account.php');
#> default Objekte iniziren
// $db = new Database();
// $acc = new Account();
#> Login verarbeitung und prüfung
// include_once($backendPath.'login.php');
#> Prüfen ob ein DB eintrag gemacht werden soll und einbinden der entsprechenden Datei
/*
if (isset($_GET['new']) || isset($_GET['login'])) {
include_once($backendPath.'db_input.php');
}
*/

57
sources/css/custom.css Normal file
View File

@@ -0,0 +1,57 @@
/*#--------------------#*/
/*#----- by 4nima -----#*/
/*#----- v. 1.0.0 -----#*/
/*#-- coding@4nima.de -#*/
/*#--------------------#*/
/* own colors define */
:root {
--own-color-one: #00FFFF;
--own-color-two: #FF00FF;
--own-color-three: #FFFF00;
}
/* own colors one */
.bg-own-one, .btn-own-one {
background-color: var(--own-color-one);
}
.text-own-one {
color: var(--own-color-one);
}
/* own colors two */
.bg-own-two, .btn-own-two {
background-color: var(--own-color-two);
}
.text-own-two {
color: var(--own-color-two);
}
/* own colors three */
.bg-own-three, .btn-own-three {
background-color: var(--own-color-three);
}
.text-own-three {
color: var(--own-color-three);
}
.footer {
position: fixed;
bottom: 0;
width: 100%;
height: 30px;
padding-left: 25px;
line-height: 30px;
z-index: 90;
}
#window {
margin-bottom: 35px;
}

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,330 @@
/*!
* Bootstrap Reboot v4.0.0 (https://getbootstrap.com)
* Copyright 2011-2018 The Bootstrap Authors
* Copyright 2011-2018 Twitter, Inc.
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
* Forked from Normalize.css, licensed MIT (https://github.com/necolas/normalize.css/blob/master/LICENSE.md)
*/
*,
*::before,
*::after {
box-sizing: border-box;
}
html {
font-family: sans-serif;
line-height: 1.15;
-webkit-text-size-adjust: 100%;
-ms-text-size-adjust: 100%;
-ms-overflow-style: scrollbar;
-webkit-tap-highlight-color: transparent;
}
@-ms-viewport {
width: device-width;
}
article, aside, dialog, figcaption, figure, footer, header, hgroup, main, nav, section {
display: block;
}
body {
margin: 0;
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
font-size: 1rem;
font-weight: 400;
line-height: 1.5;
color: #212529;
text-align: left;
background-color: #fff;
}
[tabindex="-1"]:focus {
outline: 0 !important;
}
hr {
box-sizing: content-box;
height: 0;
overflow: visible;
}
h1, h2, h3, h4, h5, h6 {
margin-top: 0;
margin-bottom: 0.5rem;
}
p {
margin-top: 0;
margin-bottom: 1rem;
}
abbr[title],
abbr[data-original-title] {
text-decoration: underline;
-webkit-text-decoration: underline dotted;
text-decoration: underline dotted;
cursor: help;
border-bottom: 0;
}
address {
margin-bottom: 1rem;
font-style: normal;
line-height: inherit;
}
ol,
ul,
dl {
margin-top: 0;
margin-bottom: 1rem;
}
ol ol,
ul ul,
ol ul,
ul ol {
margin-bottom: 0;
}
dt {
font-weight: 700;
}
dd {
margin-bottom: .5rem;
margin-left: 0;
}
blockquote {
margin: 0 0 1rem;
}
dfn {
font-style: italic;
}
b,
strong {
font-weight: bolder;
}
small {
font-size: 80%;
}
sub,
sup {
position: relative;
font-size: 75%;
line-height: 0;
vertical-align: baseline;
}
sub {
bottom: -.25em;
}
sup {
top: -.5em;
}
a {
color: #007bff;
text-decoration: none;
background-color: transparent;
-webkit-text-decoration-skip: objects;
}
a:hover {
color: #0056b3;
text-decoration: underline;
}
a:not([href]):not([tabindex]) {
color: inherit;
text-decoration: none;
}
a:not([href]):not([tabindex]):hover, a:not([href]):not([tabindex]):focus {
color: inherit;
text-decoration: none;
}
a:not([href]):not([tabindex]):focus {
outline: 0;
}
pre,
code,
kbd,
samp {
font-family: monospace, monospace;
font-size: 1em;
}
pre {
margin-top: 0;
margin-bottom: 1rem;
overflow: auto;
-ms-overflow-style: scrollbar;
}
figure {
margin: 0 0 1rem;
}
img {
vertical-align: middle;
border-style: none;
}
svg:not(:root) {
overflow: hidden;
}
table {
border-collapse: collapse;
}
caption {
padding-top: 0.75rem;
padding-bottom: 0.75rem;
color: #6c757d;
text-align: left;
caption-side: bottom;
}
th {
text-align: inherit;
}
label {
display: inline-block;
margin-bottom: .5rem;
}
button {
border-radius: 0;
}
button:focus {
outline: 1px dotted;
outline: 5px auto -webkit-focus-ring-color;
}
input,
button,
select,
optgroup,
textarea {
margin: 0;
font-family: inherit;
font-size: inherit;
line-height: inherit;
}
button,
input {
overflow: visible;
}
button,
select {
text-transform: none;
}
button,
html [type="button"],
[type="reset"],
[type="submit"] {
-webkit-appearance: button;
}
button::-moz-focus-inner,
[type="button"]::-moz-focus-inner,
[type="reset"]::-moz-focus-inner,
[type="submit"]::-moz-focus-inner {
padding: 0;
border-style: none;
}
input[type="radio"],
input[type="checkbox"] {
box-sizing: border-box;
padding: 0;
}
input[type="date"],
input[type="time"],
input[type="datetime-local"],
input[type="month"] {
-webkit-appearance: listbox;
}
textarea {
overflow: auto;
resize: vertical;
}
fieldset {
min-width: 0;
padding: 0;
margin: 0;
border: 0;
}
legend {
display: block;
width: 100%;
max-width: 100%;
padding: 0;
margin-bottom: .5rem;
font-size: 1.5rem;
line-height: inherit;
color: inherit;
white-space: normal;
}
progress {
vertical-align: baseline;
}
[type="number"]::-webkit-inner-spin-button,
[type="number"]::-webkit-outer-spin-button {
height: auto;
}
[type="search"] {
outline-offset: -2px;
-webkit-appearance: none;
}
[type="search"]::-webkit-search-cancel-button,
[type="search"]::-webkit-search-decoration {
-webkit-appearance: none;
}
::-webkit-file-upload-button {
font: inherit;
-webkit-appearance: button;
}
output {
display: inline-block;
}
summary {
display: list-item;
cursor: pointer;
}
template {
display: none;
}
[hidden] {
display: none !important;
}
/*# sourceMappingURL=bootstrap-reboot.css.map */

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,8 @@
/*!
* Bootstrap Reboot v4.0.0 (https://getbootstrap.com)
* Copyright 2011-2018 The Bootstrap Authors
* Copyright 2011-2018 Twitter, Inc.
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
* Forked from Normalize.css, licensed MIT (https://github.com/necolas/normalize.css/blob/master/LICENSE.md)
*/*,::after,::before{box-sizing:border-box}html{font-family:sans-serif;line-height:1.15;-webkit-text-size-adjust:100%;-ms-text-size-adjust:100%;-ms-overflow-style:scrollbar;-webkit-tap-highlight-color:transparent}@-ms-viewport{width:device-width}article,aside,dialog,figcaption,figure,footer,header,hgroup,main,nav,section{display:block}body{margin:0;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol";font-size:1rem;font-weight:400;line-height:1.5;color:#212529;text-align:left;background-color:#fff}[tabindex="-1"]:focus{outline:0!important}hr{box-sizing:content-box;height:0;overflow:visible}h1,h2,h3,h4,h5,h6{margin-top:0;margin-bottom:.5rem}p{margin-top:0;margin-bottom:1rem}abbr[data-original-title],abbr[title]{text-decoration:underline;-webkit-text-decoration:underline dotted;text-decoration:underline dotted;cursor:help;border-bottom:0}address{margin-bottom:1rem;font-style:normal;line-height:inherit}dl,ol,ul{margin-top:0;margin-bottom:1rem}ol ol,ol ul,ul ol,ul ul{margin-bottom:0}dt{font-weight:700}dd{margin-bottom:.5rem;margin-left:0}blockquote{margin:0 0 1rem}dfn{font-style:italic}b,strong{font-weight:bolder}small{font-size:80%}sub,sup{position:relative;font-size:75%;line-height:0;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}a{color:#007bff;text-decoration:none;background-color:transparent;-webkit-text-decoration-skip:objects}a:hover{color:#0056b3;text-decoration:underline}a:not([href]):not([tabindex]){color:inherit;text-decoration:none}a:not([href]):not([tabindex]):focus,a:not([href]):not([tabindex]):hover{color:inherit;text-decoration:none}a:not([href]):not([tabindex]):focus{outline:0}code,kbd,pre,samp{font-family:monospace,monospace;font-size:1em}pre{margin-top:0;margin-bottom:1rem;overflow:auto;-ms-overflow-style:scrollbar}figure{margin:0 0 1rem}img{vertical-align:middle;border-style:none}svg:not(:root){overflow:hidden}table{border-collapse:collapse}caption{padding-top:.75rem;padding-bottom:.75rem;color:#6c757d;text-align:left;caption-side:bottom}th{text-align:inherit}label{display:inline-block;margin-bottom:.5rem}button{border-radius:0}button:focus{outline:1px dotted;outline:5px auto -webkit-focus-ring-color}button,input,optgroup,select,textarea{margin:0;font-family:inherit;font-size:inherit;line-height:inherit}button,input{overflow:visible}button,select{text-transform:none}[type=reset],[type=submit],button,html [type=button]{-webkit-appearance:button}[type=button]::-moz-focus-inner,[type=reset]::-moz-focus-inner,[type=submit]::-moz-focus-inner,button::-moz-focus-inner{padding:0;border-style:none}input[type=checkbox],input[type=radio]{box-sizing:border-box;padding:0}input[type=date],input[type=datetime-local],input[type=month],input[type=time]{-webkit-appearance:listbox}textarea{overflow:auto;resize:vertical}fieldset{min-width:0;padding:0;margin:0;border:0}legend{display:block;width:100%;max-width:100%;padding:0;margin-bottom:.5rem;font-size:1.5rem;line-height:inherit;color:inherit;white-space:normal}progress{vertical-align:baseline}[type=number]::-webkit-inner-spin-button,[type=number]::-webkit-outer-spin-button{height:auto}[type=search]{outline-offset:-2px;-webkit-appearance:none}[type=search]::-webkit-search-cancel-button,[type=search]::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{font:inherit;-webkit-appearance:button}output{display:inline-block}summary{display:list-item;cursor:pointer}template{display:none}[hidden]{display:none!important}
/*# sourceMappingURL=bootstrap-reboot.min.css.map */

File diff suppressed because one or more lines are too long

8975
sources/css/lib/bootstrap/bootstrap.css vendored Normal file

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,6 @@
<h1>Template</h1>
<div class="bg-<?php echo $colorThree; ?> container mr-sm-2" >
Hier ist einiges an Inhalt
</div>

View File

@@ -0,0 +1,5 @@
<footer class="footer bg-<?php echo $colorOne; ?>">
<span class="text-<?php echo $colorText; ?>">
Style v.3.0.0
</span>
</footer>

View File

@@ -0,0 +1,65 @@
<?php
#=========================
#
# name: login.php
# version: 2.1.0
# from: 2021-01-23
# developer: 4nima
# tested with: nginx, php7
# requirements: php, bootstrap, jQuery, ajax
#
#=========================
# login form
#
#
#=========================
if (isset($_COOKIE['uid'])) {
} elseif (isset($_SESSION['uid'])) {
echo '
<div class="dropdown">
<button class="btn btn-'.$colorTwo.' dropdown-toggle" type="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
'.$acc->username.'
</button>
<div class="dropdown-menu" aria-labelledby="login" style="right: 0; left: auto; width: 250px;">
<h6 class="dropdown-header">Seiten Login</h6>
<a class="dropdown-item" href="?logout">Ausloggen</a>
</div>
</div>
';
} else {
echo '
<div class="dropdown">
<button class="btn btn-'.$colorTwo.' dropdown-toggle" type="button" id="login" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
Login
</button>
<div class="dropdown-menu" aria-labelledby="login" style="right: 0; left: auto; width: 250px;">
<h6 class="dropdown-header">Seiten Login</h6>
<form class="px-4 py-3" action="?login" method="POST" id="loginform">
<div class="form-group">
<input type="text" name="user" class="form-control" id="username" placeholder="Benutzername">
</div>
<div class="form-group">
<input type="password" name="pass" class="form-control" id="password" placeholder="Passwort">
</div>
<div class="form-check">
<input type="checkbox" name="stay" class="form-check-input" id="staylogin">
<label class="form-check-label" for="staylogin">
Login merken
</label>
</div>
<button type="submit" class="btn btn-'.$colorSuccess.'">Anmelden</button>
</form>
</div>
</div>
';
}
?>
<!-- <form class="form-inline my-2 my-lg-0">
<input class="form-control mr-sm-2" type="search" placeholder="Search" aria-label="Search">
<button class="btn btn-outline-success my-2 my-sm-0" type="submit">Search</button>
</form> -->

View File

@@ -0,0 +1,45 @@
<?php
#=========================
#
# name: nav.php
# version: 2.1.0
# from: 2021-01-23
# developer: 4nima
# tested with: nginx, php7
# requirements: php, bootstrap, jQuery, ajax
#
#=========================
# auto genereated navbar
# config links: /sources/sides.php
#
#=========================
?>
<nav class="navbar navbar-expand-lg navbar-<?php echo $navBarSytle; ?> bg-<?php echo $colorOne; ?> fixed-top">
<a class="navbar-brand" href="/">
<img src="<?php echo $imgPath; ?>logo.png" width="30" height="30" class="d-inline-block align-top" alt="">
<?php echo $webname; ?>
</a>
<a class="navbar-toggler" href="#">Home</a>
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navContent" aria-controls="navContent" aria-expanded="false" aria-label="Toggle navigation">
<i class="navbar-toggler-icon"></i>
</button>
<div class="collapse navbar-collapse" id="navContent">
<ul class="navbar-nav mr-auto">
<?php gennav($navbar); ?>
</ul>
<?php
if ($login == true) {
?>
<div id="userMenu">
<?php include($structurePath.'login.php'); ?>
</div>
<?php
}
?>
</div>
</nav>

BIN
sources/img/favicon.ico Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

BIN
sources/img/logo.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1009 B

15
sources/js/custom.js Normal file
View File

@@ -0,0 +1,15 @@
// #--------------------#
// #----- by 4nima -----#
// #----- v. 1.0.0 -----#
// #-- coding@4nima.de -#
// #--------------------#
// Direkt mit laden
// Erst laden wenn rest geladen ist
$( function() {
console.log("Ready");
});

6
sources/js/functions.js Normal file
View File

@@ -0,0 +1,6 @@
// #--------------------#
// #----- by 4nima -----#
// #----- v. 1.0.0 -----#
// #-- coding@4nima.de -#
// #--------------------#

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

3894
sources/js/lib/bootstrap/bootstrap.js vendored Normal file

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

2
sources/js/lib/jquery.js vendored Normal file

File diff suppressed because one or more lines are too long

47
sources/sides.php Normal file
View File

@@ -0,0 +1,47 @@
<?php
#=========================
#
# name: sides.php
# version: 2.1.0
# from: 2021-01-23
# developer: 4nima
# tested with: nginx, php7
# requirements: php, jQuery, ajax
#
#=========================
# sides control
# navbar control
#
#=========================
#> Side control
if (isset($_GET['page1'])) {
$side = 'page1.php';
$sideTitle = 'Page1';
} elseif (isset($_GET['page2'])) {
$side = 'page2.php';
$sideTitle = 'Page2';
} else {
$side = 'default.php';
$sideTitle = 'TITLE';
}
#> Navbar control
$navbar = array(
array("Link1", "https://"),
array("Link2", "https://"),
array("Dropdown1", array(
array("Dlink1", "https://"),
array("Dlink2", "https://"),
array("---"),
array("Dlink3", "https://")
)
),
array("Dropdown2", array(
array("Dlink4", "https://"),
array("Dlink5", "https://")
)
)
);
?>