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
/
Copy pathadisms.php
144 lines (116 loc) · 3.8 KB
/
adisms.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
<?php
include ("connect.php");
include ("sessions_admin.php");
$msg = "";
if (isset($_POST['btn-upload'])) {
$target = "ISRO/".basename($_FILES['fileisms']['name']);
$fileisms = $_FILES['fileisms']['name'];
$error = $_FILES['fileisms']['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 isms(fileisms,msno,title,dt) values ('$fileisms','$msno','$title','$dt')";
mysqli_query($db, $sql);
if (move_uploaded_file($_FILES['fileisms']['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> ISRO Missions </title>
<style>
body {
background-image:url("75.jpg");
background-repeat: no-repeat;
background-position: right top;
}
.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"> ISRO MISSIONS </font> </h1>
<p align=center> The Indian Space Research Organisation has carried out <b> 84 spacecraft missions, 59 launch missions</b> and planned many missions including Chandrayaan-2, and Aditya (spacecraft).</p> <br>
<p align=center>
<font color="red">Missions can be categorized into: </font>
<table border="1" width="50%" cellpadding="4" cellspacing="5">
<th> 1.Lunar</th>
<th> 2.Interplanetary</th>
<th>3.Astronomy</th>
<th> 4.Earth satellites </th> </table> <br> <br>
<font color="red"> Planned Missions<br> </font>
<table border="1" width="70%" cellpadding="4" cellspacing="5">
<th>1. Chandrayaan-2 </th>
<th> 2. Aditya </th>
<th>3. AVATAR </th>
<th>4. GSAT-11 </th>
<th> 5. RISAT-1A </th>
<th> 6. NISAR </th>
<th>7. Indian Venusian Orbiter Mission</th> <table> <br> </p>
<h2>Know in detail </h2> <br>
<div id="demo">
<button type="button" onclick="loadDoc()"> See more </button>
</div>
<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", "isroms.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 isms 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="ISRO/<?php echo $row ['fileisms'] ?>">View File</a> <a href="delisms.php?id=<?php echo $row['id']?>&filename=<?php echo $row['fileisms'] ?>" 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>