This repository has been archived by the owner on Nov 28, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
adnsms.php
148 lines (121 loc) · 3.74 KB
/
adnsms.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
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
<?php
include ("connect.php");
include ("sessions_admin.php");
$msg = "";
if (isset($_POST['btn-upload'])) {
$target = "NASA/".basename($_FILES['filensms']['name']);
$filensms = $_FILES['filensms']['name'];
$error = $_FILES['filensms']['error'];
$title = mysqli_real_escape_string($db, $_POST['title']);
$msno = mysqli_real_escape_string($db, $_POST['msno']);
$dt = @date('Y-m-d');
$sql = "insert into nsms(filensms,msno,title,dt) values ('$filensms','$msno','$title','$dt')";
mysqli_query($db, $sql);
if (move_uploaded_file($_FILES['filensms']['tmp_name'],$target)) {
$msg = "The Missions were uploaded successfully";
echo "<script type='text/javascript'>alert('$msg');window.location.href='upload.php';</script>";
}
else{
$msg = "Failed to upload the Missons";
echo "<script type='text/javascript'>alert('$msg');window.location.href='upload.php';</script>";
}
}
?>
<html>
<head>
<title> NASA Missions </title>
<style>
body {
background-image:url("75.jpg");
background-repeat: no-repeat;
}
.button {
float: right;
color: black;
padding: 5px 10px;
border-radius: 12px;
margin-top: 1ex;
margin-right: 20px;
font-size: 15px;
cursor: pointer;
background-color: #ccc;
border: 2px solid black
}
</style>
</head>
<body bgcolor="black" text="white">
<a href="logout.php" class="button"> Logout</a>
<p> <h1 align=center><font color="orange"> NASA MISSIONS </font> </h1>
<p align=center> A list of NASA missions, both manned and unmanned, since its establishment in 1958.</p> <br>
<p align=center>
<font color="red"><b>Missions can be categorized into: </b></font>
<table border="2" width="100%" cellpadding="6" cellspacing="5">
<th>1 X-Plane program </th>
<th>2 Crewed missions </th>
<th>3 Robotic missions </th>
<th>4 Planned missions </th>
<th>5 Cancelled or undeveloped missions </th>
<tr>
<td></td>
<td>2.1 Human spaceflight<br>
2.2 Future </td>
<td>3.1 Suborbital <br>
3.2 Earth satellites<br>
3.3 Lunar <br>
3.4 Martian <br>
3.5 Asteroidal/cometary <br>
3.6 Other planets<br>
3.7 Solar </td>
<td></td>
<td></td>
</tr></table><br><br></p>
<h2 align="center">Know in detail <br>
<div id="demo">
<button type="button" onclick="loadDoc()"> See more </button>
</div></h2>
<script>
function loadDoc() {
var xhttp = new XMLHttpRequest();
xhttp.onreadystatechange = function() {
if (this.readyState == 4 && this.status == 200)
{
document.getElementById("demo").innerHTML = this.responseText;
}
};
xhttp.open("GET", "nasams.php", true);
xhttp.send();
}
function goBack() {
window.history.back();
}
</script>
<div><h2 align=center> Trending Now!</h2>
<br><br>
<?php
include("connect.php");
$sql = "select * from nsms order by id desc";
$result = mysqli_query($db, $sql); ?>
<table align="center" border="0" width=100%>
<tr>
<th> Title </th>
<th> Mission No</th>
<th> Uploaded on</th>
<th> Files</th>
</tr>
<tr>
<?php
while ($row = mysqli_fetch_array($result)) {
?>
<td> <?php echo $row['title'] ?> </td>
<td><?php echo $row ['msno']?></td>
<td><?php echo $row ['dt']?></td>
<td><a href="NASA/<?php echo $row ['filensms'] ?>">View File</a> <a href="delnsms.php?id=<?php echo $row['id']?>&filename=<?php echo $row['filensms'] ?>" onclick="return confirm('Are you sure you want to delete this item?');"> /Delete File </a></td>
</tr>
<?php
}
?>
</table>
</div>
<button onclick="goBack()">Go Back</button>
</body>
</html>