NotesWhat is notes.io?

Notes brand slogan

Notes - notes.io

<?php
include 'auth.php';
include '../includes/config.php';


$msg = "";
$deleteMsg = "";

// If upload button is clicked ...
if (isset($_POST['upload'])) {
$name = $_POST['name'];
$filename = $_FILES["uploadfile"]["name"];
$tempname = $_FILES["uploadfile"]["tmp_name"];
$folder = "../assets/others/".$filename;

$db = mysqli_connect("localhost", "undefinedxik", "N25oo4205e457DE8", "undefinedxik");


// Get all the submitted data from the form
$sql = "INSERT INTO others (name,filename) VALUES ('$name','$filename')";

// Execute query
mysqli_query($db, $sql);


// Now let's move the uploaded image into the folder: image
if (move_uploaded_file($tempname, $folder)) {
$msg = "Image uploaded successfully";
}else{
$msg = "Failed to upload image";
}
}

if (isset($_POST['deleteArt'])) {

$deleteId = $_POST['id'];
$deletePath = $_POST['path'];

$servername = "localhost";
$username = "undefinedxik";
$password = "N25oo4205e457DE8";
$dbname = "undefinedxik";

// Create connection
$conn = new mysqli($servername, $username, $password, $dbname);
// Check connection
if ($conn->connect_error) {
die("Connection failed: " . $conn->connect_error);
}

$sql = "SELECT * FROM others where filename='$deletePath'";
$result = $conn->query($sql);

if ($result->num_rows < 2) {
$unLinkPath = '../assets/others/'.$deletePath.'';
unlink($unLinkPath);
}

$sql = "SELECT * FROM others where id='$deleteId'";
$result = $conn->query($sql);

if ($result->num_rows > 0) {
// output data of each row
while($row = $result->fetch_assoc()) {
$deleteQuery = "DELETE FROM others WHERE id=$deleteId";
$conn->query($deleteQuery);
$deleteMsg = 'Removed';

}
} else {
$deleteMsg = "Error";
}



}


?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no" />
<meta name="description" content="" />
<meta name="author" content="" />
<title>UndefinedXik</title>
<!-- Favicon-->
<link rel="icon" type="image/x-icon" href="../assets/favicon.ico" />
<!-- Font Awesome icons (free version)-->
<script src="https://use.fontawesome.com/releases/v5.15.3/js/all.js" crossorigin="anonymous"></script>
<!-- Google fonts-->
<link href="https://fonts.googleapis.com/css?family=Montserrat:400,700" rel="stylesheet" type="text/css" />
<link href="https://fonts.googleapis.com/css?family=Lato:400,700,400italic,700italic" rel="stylesheet" type="text/css" />
<!-- Core theme CSS (includes Bootstrap)-->
<link href="../css/styles.css" rel="stylesheet" />
<style>
.coverart {
border-radius: 5px;
background-color: #2c3e50;
color:white;
padding: 20px;
margin-bottom:20px;
}
</style>
</head>
<body id="page-top">
<!-- Navigation-->
<nav class="navbar navbar-expand-lg bg-secondary text-uppercase fixed-top" id="mainNav">
<div class="container">
<a class="navbar-brand" href="#page-top">undefinedxik</a>
<button class="navbar-toggler text-uppercase font-weight-bold bg-primary text-white rounded" type="button" data-bs-toggle="collapse" data-bs-target="#navbarResponsive" aria-controls="navbarResponsive" aria-expanded="false" aria-label="Toggle navigation">
Menu
<i class="fas fa-bars"></i>
</button>
<div class="collapse navbar-collapse" id="navbarResponsive">
<ul class="navbar-nav ms-auto">
<li class="nav-item mx-0 mx-lg-1"><a class="nav-link py-3 px-0 px-lg-3 rounded" href="index.php">Home</a></li>
<li class="nav-item mx-0 mx-lg-1"><a class="nav-link py-3 px-0 px-lg-3 rounded" href="orders.php">Orders</a></li>
<li class="nav-item mx-0 mx-lg-1"><a class="nav-link py-3 px-0 px-lg-3 rounded" href="others.php">Other</a></li>
</ul>
</div>
</div>
</nav>




<!-- Portfolio Section-->
<section class="page-section portfolio mt-0 " id="portfolio">
<div class="container">
<!-- Portfolio Section Heading-->

<h2 class="page-section-heading text-center text-uppercase text-secondary mb-0">Admin</h2>
<!-- Icon Divider-->

</div>
<div class="container">
<form class="coverart" method="POST" enctype="multipart/form-data">
<?php if(!empty($msg)){ echo $msg;}?><br />
Add cover art
<br />
<div class="row">
<div class="form-group col-lg-3">
<label for="code">Name</label>
<input type="text" name="name" class="form-control" />
</div>
</div>
<br />
<div class="row">
<div class="custom-file form-group col-lg-1 ">
<input type="file" class="custom-file-input" id="customFile" name="uploadfile">
</div>
</div>
<br />

<div class="row">
<div class="form-group col-lg-3">
<input style="color:white;" type="submit" class="btn btn-default" name="upload" value="submit">
</div>
</div>
</form>
<br /><br />
<style>
.img-container {
position: relative;
}
.img-container .deleteButton {
position: absolute;
top: auto;
left: auto;
bottom: 0;
right: 0;

}

</style>
<div class="row justify-content-start">

<?php

$path = "../assets/others/";
$sql = "SELECT * FROM others ORDER BY created_at DESC";
$result = $conn->query($sql);

if ($result->num_rows > 0) {
// output data of each row
while($row = $result->fetch_assoc()) {
$fullPath = ''.$path.'/'.$row['filename'].'';
?>

<div class="col-md-6 col-lg-2 mb-5">
<div class="portfolio-item mx-auto" >

<div id="<?php echo $row['id'];?>">
<div class="img-container">
<img src="<?php echo $fullPath;?>" alt="" class="img-fluid">
<form method="POST">
<input type="hidden" name="id" value="<?php echo $row['id'];?>" />
<input type="hidden" name="path" value="<?php echo $row['filename'];?>" />
<button type="submit" name="deleteArt" class="deleteButton btn btn-danger btn-sm" style="margin:5px;" >Delete</button></img>
</form>
</div>
</div>
</div>
</div>
<?php
}
} else {
echo "we are not feeling creative yet";
}
?>
</div>

</div>




</div>
</section>




<!-- Bootstrap core JS-->
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js"></script>
<!-- Core theme JS-->
<script src="../js/scripts.js"></script>
<!-- * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *-->
<!-- * * SB Forms JS * *-->
<!-- * * Activate your form at https://startbootstrap.com/solution/contact-forms * *-->
<!-- * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *-->
<script src="https://cdn.startbootstrap.com/sb-forms-latest.js"></script>
</body>
</html>
     
 
what is notes.io
 

Notes.io is a web-based application for taking notes. You can take your notes and share with others people. If you like taking long notes, notes.io is designed for you. To date, over 8,000,000,000 notes created and continuing...

With notes.io;

  • * You can take a note from anywhere and any device with internet connection.
  • * You can share the notes in social platforms (YouTube, Facebook, Twitter, instagram etc.).
  • * You can quickly share your contents without website, blog and e-mail.
  • * You don't need to create any Account to share a note. As you wish you can use quick, easy and best shortened notes with sms, websites, e-mail, or messaging services (WhatsApp, iMessage, Telegram, Signal).
  • * Notes.io has fabulous infrastructure design for a short link and allows you to share the note as an easy and understandable link.

Fast: Notes.io is built for speed and performance. You can take a notes quickly and browse your archive.

Easy: Notes.io doesn’t require installation. Just write and share note!

Short: Notes.io’s url just 8 character. You’ll get shorten link of your note when you want to share. (Ex: notes.io/q )

Free: Notes.io works for 12 years and has been free since the day it was started.


You immediately create your first note and start sharing with the ones you wish. If you want to contact us, you can use the following communication channels;


Email: [email protected]

Twitter: http://twitter.com/notesio

Instagram: http://instagram.com/notes.io

Facebook: http://facebook.com/notesio



Regards;
Notes.io Team

     
 
Shortened Note Link
 
 
Looding Image
 
     
 
Long File
 
 

For written notes was greater than 18KB Unable to shorten.

To be smaller than 18KB, please organize your notes, or sign in.