-
Notifications
You must be signed in to change notification settings - Fork 5
/
addDetails.php
executable file
·202 lines (156 loc) · 8.53 KB
/
addDetails.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
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
<!--
This website is Developed by Parshuram Reddy (parshuram.sudda@gmail.com && VishnuVardhanReddy(vishnurapuru10@gmail.com)
This can be edited for free
For More details and decsription contact Authors
This is Useful for Engineering Colleges Respectivly
-->
<?php
include'config.php';
//Getting values from previous page
$roll=$_SESSION["rollsession"];
$sname=$_SESSION["sname"];
$fname=$_SESSION["fname"];
//Code completed for retrieving values
////////Image Upload PHP code Starts here ////////
function GetImageExtension($imagetype)
{
if(empty($imagetype)) return false;
switch($imagetype)
{
case 'image/bmp': return '.bmp';
case 'image/gif': return '.gif';
case 'image/jpeg': return '.jpg';
case 'image/png': return '.png';
default: return false;
}
}
if (!empty($_FILES["uploadedimage"]["name"])) {
$file_name=$_FILES["uploadedimage"]["name"];
$temp_name=$_FILES["uploadedimage"]["tmp_name"];
$imgtype=$_FILES["uploadedimage"]["type"];
$ext= GetImageExtension($imgtype);
///Code to use image name with new customized image name .
$imagename=$roll.$ext;
$target_path = "images/".$imagename;
if(move_uploaded_file($temp_name, $target_path))
{
$query_upload=" UPDATE `student` SET `imgpath` = '".$target_path."' WHERE `student`.`id` = '$roll'";
mysqli_query($conn,$query_upload);
if ($conn->query($query_upload) === TRUE){
echo "<script type=\"text/javascript\">
alert('".$roll." Pic has been Added Successfully.')
</script>";
}
else
{
echo "Error: " . $query_upload . "<br>" . $conn->error;
}
}
else{
exit("Error While uploading image on the server");
}
}
////////Image upload PHP code ends here ////////
?>
<!DOCTYPE html>
<html style="background-color:#3c4141;">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>SriInduDepartmentalWebsite-Final (1)</title>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.1.0/css/bootstrap.min.css">
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=ABeeZee">
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Acme">
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Actor">
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Adamina">
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Advent+Pro">
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Allerta">
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Bitter:400,700">
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto">
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:300,400,700">
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Titillium+Web:400,600,700">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/animate.css/3.5.2/animate.min.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/aos/2.1.1/aos.css">
<link rel="stylesheet" href="assets/css/styles.min.css">
<link rel="stylesheet" href="assets/css/buttoncss.css">
</head>
<body style="padding:0px;">
<nav class="navbar navbar-dark navbar-expand-md navigation-clean-search" style="color:rgb(159,158,158);background-color:#545555;">
<div class="container-fluid"><a class="navbar-brand" href="#" style="font-family:ABeeZee, sans-serif;font-size:16px;color:#d7d4d4;">Sri Indu College Of Engineering & Technology</a><button class="navbar-toggler" data-toggle="collapse" data-target="#navcol-1"><span class="sr-only">Toggle navigation</span><span class="navbar-toggler-icon"></span></button>
<div
class="collapse navbar-collapse" id="navcol-1">
<form class="form-inline mr-auto" target="_self">
<div class="form-group"><label for="search-field"></label></div>
</form><a class="btn btn-outline-dark" role="button" href="HodIndex.php" style="color:rgb(250,252,255);width:79px;margin:12px;border:none;">Home</a><a class="btn btn-outline-dark" role="button" href="index.php" style="color:rgb(250,252,255);width:79px;margin:12px;">Logout</a>
<span
class="navbar-text"><a href="Developer.php" class="login" style="font-size:20px;"> About Dev</a></span>
</div>
</div>
</nav>
<div>
<div id="img" class="col" data-aos="fade-right" data-aos-duration="1450" style="margin:30px 0px 100px 0px;padding:39px;height:163px;"><label style="font-size:27px;">Upload <?php echo $sname ; ?> photo here:</label>
<form action="addDetails.php" id=" picform" method="post" action="addDetails.php" enctype="multipart/form-data" method="post" >
<input name="uploadedimage" type="file">
<input name="Upload Now" type="submit" value="Upload Image">
</form>
</div>
</div>
<div class="container" tyle="height:20px;">
<p class="text-center" >Click here and enter <?php echo $sname;?> Academic Results. You can also add or edit them in EditDetailsPage <b>Link</b> </p>
</div>
<!-- Form sumit line -->
<!-- <button id="formsubmit"class="btn btn-dark btn-block btn-lg" onclick="submitForms()" value="clickme">Submit</button>-->
<div>
<div class="container">
<div class="row">
<div class="col-md-3"><a href="addfirstYear.php" class="button" id="clickMe" target="_blank">First Year </a></div>
<div class="col-md-3"><a href="addSecondyear.php" class="button" id="clickMe" target="_blank">Second Year</a></div>
<div class="col-md-3"><a href="addThirdyear.php" class="button" id="clickMe" target="_blank">Third Year</a></div>
<div class="col-md-3"><a href="addFourthyear.php" class="button" id="clickMe" target="_blank">Fourth Year</a></div>
</div>
</div>
</div>
<div style="height:20px;"></div>
<div class="footer-clean" style="background-color:rgb(49,55,58);">
<footer>
<div class="container">
<div class="row justify-content-center">
<div class="col-sm-4 col-md-3 item"><img data-bs-hover-animate="pulse" style="background-image:url("assets/img/36929706_1044434599064256_6289139470734196736_n.png");background-size:cover;height:69px;width:397px;background-color:#31373a;"></div>
<div class="col-sm-4 col-md-3 item" style="width:50px;"></div>
<div class="col-sm-4 col-md-3 item" style="width:147px;"></div>
<div class="col-lg-3 item social" data-bs-hover-animate="pulse" style="width:313px;">
<h3 style="color:rgb(231,231,231);">E-mail Developers @</h3>
<ul>
<li><a href="mailto:parshuram.sudda@gmail.com" style="color:rgb(225,226,227);width:160px;">Parshuram[dot]sudda[at]gmail[dot]com</a></li>
<li style="width:274px;"><a href="mailto:vishnurapuru10@gmail.com" style="color:rgb(215,215,215);width:47px;">Vishnurapuru[(2+3)+5][at]gmail[dot]com</a></li>
</ul>
<p class="copyright" style="color:rgb(251,252,252);">AiPlus © 2018</p>
</div>
</div>
</div>
</footer>
</div>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.1.0/js/bootstrap.bundle.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/aos/2.1.1/aos.js"></script>
<script src="assets/js/script.min.js">
</script>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.0/jquery.min.js"></script>
<script>
$(document).ready(function(){
$("#formsubmit").click(function(){
$.post($(this).attr("action"), $(this).serialize(), function (response) {
alert(response);
});
});
</script>
<!-- One time calling script for alerting-->
<script type="text/javascript">
// var alerted = localStorage.getItem('alerted') || '';
// if (alerted != 'yes') {
// alert("My alert.");
// localStorage.setItem('alerted','yes');
// }
</script>
</body>
</html>