-
Notifications
You must be signed in to change notification settings - Fork 0
/
admin.php
121 lines (88 loc) · 3.67 KB
/
admin.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
<!DOCTYPE html>
<html>
<head>
<title>Admin</title>
<link rel="stylesheet" href="bootstrap.min.css">
<script src="jquery.min.js"></script>
<script src="bootstrap.min.js"></script>
</head>
<body>
<!-- Navbar -->
<nav class="navbar navbar-default navbar-inverse navbar-fixed-top">
<div class="container">
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#myNavbar">
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="mrgreen.php">Me</a>
</div>
<div class="collapse navbar-collapse" id="myNavbar">
<ul class="nav navbar-nav navbar-right">
<li><a href="mrgreen.php#who">WHO</a></li>
<li><a href="mrgreen.php#what">WHAT</a></li>
<li><a href="mrgreen.php#where">WHERE</a></li>
<li><a href="activity.php">ACTIVITY</a></li>
<li><a href="cv.php">ABOUT ME</a></li>
</ul>
</div>
</div>
</nav>
<h1 align="center">ADMIN PANEL</h1>
<h4>
<a href="admin.php#activitycontrol">Activity Control</a><br>
<a href="homeadmin.php">Home Page Control</a> <br><br><br>
</h4>
<div class="row" style="margin-left:180px; margin-right:130px;" id="activitycontrol">
<div class="col-lg-6">
<h2 align="center"><b>Activity Control:</h2>
<h3><u>Activity Page Image Upload: </u></h3>
<form action="file.php" method="post" enctype="multipart/form-data">
<b> Select image to upload: <br><br> </b> <input type="file" name="fileToUpload" id="fileToUpload"><br>
Image Title: <input type="text" name="imgname"><br> <br>
Image Details: <textarea name="imagedetails" rows="3" cols="50" placeholder="Write your Image Details."></textarea><br> <br>
<input type="submit" value="Upload Image" name="submit"><br><br>
</form>
<h3><u>Activity Page Image Delete:</u></h3>
<form action="delete.php" method="post">
<b> Image Title to Delete: <br><br> </b> <input type="text" name="imgtitle" placeholder="Write Exect title of Image"><br><br>
<b> Image ID to Delete: <br><br> </b> <input type="number" name="imgid" placeholder="Write the Image ID"><br><br>
<input type="submit" value="Delete Image" name="delete"><br><br>
</form>
</div>
<div class="col-lg-6">
<?php
$DBconnect = mysqli_connect("localhost","root","","blog");
/* if($DBconnect)
{echo "<h1>DB CONNECTED</h1><br>";}*/
echo "<h2> Images ID and Title List </h2>";
$sql = "SELECT * FROM image";
$result = $DBconnect->query($sql);
if ($result->num_rows > 0) {
// output data of each row
while($row = $result->fetch_assoc()) {
$id = $row["id"];
$title = $row["imgname"];
echo $id." <br> ".$title."<br><br>";
}
}
?>
</div>
</div>
<div class="row" style="margin-left:180px; margin-right:130px;">
<div class="col-lg-6">
<h2 align="center"><b>Home Page Control:</h2>
<h3><u>Home Profile Image Upload: </u></h3>
<form action="homeimage.php" method="post" enctype="multipart/form-data">
<b> Select image to upload: <br><br> </b> <input type="file" name="homefile"><br>
Image Title: <input type="text" name="imgname" placeholder="Short Title"><br> <br>
Image Details: <textarea name="imagedetails" rows="3" cols="50" placeholder="Write your Image Details."></textarea><br> <br>
<input type="submit" value="Upload Image" name="submit"><br><br>
</form>
</div>
<div class="col-lg-6">
</div>
</div>
</body>
</html>