File cleanup in progress 2

This commit is contained in:
Michał 2022-08-01 11:20:00 +01:00
parent 47aa830771
commit 41667bff0a
10 changed files with 17 additions and 28 deletions

View file

@ -12,7 +12,6 @@
<body>
<?php
include("../ui/header.php");
include("../ui/conn.php");
?>
<div class="account-root default-window">

View file

@ -12,7 +12,6 @@
<body>
<?php
include("../ui/header.php");
require_once("../ui/conn.php");
// Initialize the session
session_start();

View file

@ -12,7 +12,6 @@
<body>
<?php
include("../ui/header.php");
include_once("../ui/conn.php");
// Initialize the session
session_start();

View file

@ -12,7 +12,6 @@
<body>
<?php
include("../ui/header.php");
include_once("../ui/conn.php");
// Validate susness of Username
if (isset($_POST['signup'])) {

View file

@ -101,11 +101,6 @@ body {
border-radius: var(--rad);
box-shadow: var(--shadow);
text-overflow: ellipsis;
overflow-wrap: break-word;
word-wrap: break-word;
word-break: break-all;
}
.password-reset-root {

View file

@ -284,19 +284,24 @@
echo "<p>ID: ".$image['id']."</p>";
// File name
echo "<p>File Name: ".$image['imagename']."</p>";
if (strlen($image['imagename']) > 30) {
echo "<p>File Name: ".trim(substr($image['imagename'], 0, 30))."...</p>";
} else {
echo "<p>File Name: ".$image['imagename']."</p>";
}
// Image Upload date
echo "<p>Last updated: ".$image['upload']." (+0)</p>";
// File extention
echo "<p>File Type: ".pathinfo($image['imagename'], PATHINFO_EXTENSION)."</p>";
// Image resolution
list($width, $height) = getimagesize($image_path);
echo "<p>Image resolution: ".$width."x".$height."</p>";
// Image Upload date
echo "<p>Last updated: ".$image['upload']." (+0)</p>";
// Image download
echo "<a class='btn alert-high space-top' href='images/".$image['imagename']."' download='".$image['imagename']."'><img class='svg' src='assets/icons/download.svg'>Download image</a>";
// Flyout test button
?>
</div>

View file

@ -68,8 +68,6 @@
<div class="gallery-root flex-left">
<?php
include_once("ui/conn.php");
// Reading images from table
$image_request = mysqli_query($conn, "SELECT * FROM swag_table");

View file

@ -1,8 +0,0 @@
<?php
// Attempt database connection
$conn = mysqli_connect("localhost", "uwu", "fennec621", "swag");
// If connecton failed, notify user
if ($conn->connect_error) {
echo "<p class='alert alert-low'>Could not connect to database</p>";
}
?>

View file

@ -1,14 +1,18 @@
<?php
// Include required files by every page on header
// Include required files and commands by every page on header
session_start();
if (is_dir("ui/")) {
include("ui/conn.php");
include_once("ui/functions.php");
} else {
include("../ui/conn.php");
include_once("../ui/functions.php");
}
$conn = mysqli_connect("localhost", "uwu", "fennec621", "swag");
if ($conn->connect_error) {
echo "<p class='alert alert-low'>Could not connect to database</p>";
}
// Check which directory icons are in
if (is_dir("assets/icons/")) {
$dir = "assets/icons/";

View file

@ -12,7 +12,6 @@
<body>
<?php
include("ui/header.php");
include_once("ui/conn.php");
// Check if user is logged in
if (loggedin()) {