-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathModifyPortfolio.php
216 lines (206 loc) · 6.93 KB
/
ModifyPortfolio.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
203
204
205
206
207
208
209
210
211
212
213
214
215
216
<?php
// Connection to Database
$host="localhost";
$user="root";
$password="";
$db="User";
$connect=mysqli_connect($host,$user,$password,$db);
if(!$connect)
{
die(mysqli_connect_error());
}
session_start();
$emailCheck=$_SESSION['email'];
if(isset($_POST['submit']))
{
$pass="Select password from User where Email='$emailCheck'";
$result=$connect->query($pass);
$row=$result->fetch_array(MYSQLI_ASSOC);
$password=$row['password'];
echo $password;
$sql="DELETE from User where Email='$emailCheck'";
$connect->query($sql);
// Taking data into variables
$firstname=$_POST['inputFirstName'];
$lastname=$_POST['inputLastName'];
$school=$_POST['school'];
$per10=$_POST['Per10'];
$per12=$_POST['Per12'];
$university=$_POST['university'];
$graduation=$_POST['graduation'];
$html=$_POST['html'];
$css=$_POST['css'];
$java=$_POST['java'];
$bootstrap=$_POST['bootstrap'];
$c=$_POST['c'];
// // Inserting values in the database
$sql="INSERT INTO `User`.`User` (`First Name`, `Last Name`,`Email`, `School`,`10th %`, `12th %`,`University`, `Graduation Course`,`html`, `css`,`java`, `bootstrap`,`c`, `Password`) VALUES ( '$firstname','$lastname','$emailCheck', '$school', '$per10', '$per12', '$university', '$graduation', '$html', '$css', '$java', '$bootstrap', '$c', '$password')";
$connect->query($sql);
header('location:UserPortfolio.php');
}else{
// Taking data into variables
$sql="Select * from User where Email='$emailCheck'";
$query=mysqli_query($connect,$sql);
$passans=$query->fetch_array(MYSQLI_ASSOC);
$fName=$passans['First Name'];
$lName=$passans['Last Name'];
$sc=$passans['School'];
$p10=$passans['10th %'];
$p12=$passans['12th %'];
$uni=$passans['University'];
$cou=$passans['Graduation Course'];
$ht=$passans['html'];
$cs=$passans['css'];
$ja=$passans['java'];
$boot=$passans['bootstrap'];
$c1=$passans['c'];
}
$connect->close();
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:400,700">
<title>Portfolio Creater</title>
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.0/css/bootstrap.min.css">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css">
<script src="https://code.jquery.com/jquery-3.5.1.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/popper.js@1.16.0/dist/umd/popper.min.js"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.5.0/js/bootstrap.min.js"></script>
<!-- CSS -->
<style>
body {
color: #fff;
background: #4c535d;
font-family: 'Roboto', sans-serif;
}
.form-control {
min-height: 41px;
box-shadow: none;
border-color: #e1e4e5;
font-size: 14px;
}
.form-control, .btn {
border-radius: 3px;
}
.signup-form {
width: 600px;
margin: 0 auto;
padding: 30px 0;
}
.signup-form form {
color: #9ba5a8;
border-radius: 3px;
margin-bottom: 15px;
background: #fff;
box-shadow: 0px 2px 2px rgba(0, 0, 0, 0.3);
padding: 30px;
}
.signup-form h2 {
color: #333;
font-weight: bold;
margin-top: 0;
}
.signup-form hr {
margin: 0 -30px 20px;
}
.signup-form .form-group {
margin-bottom: 20px;
}
.signup-form label {
font-weight: normal;
font-size: 13px;
}
.signup-form .btn, .signup-form .btn:active {
font-size: 16px;
font-weight: bold;
background: #5fcaba !important;
border: none;
min-width: 140px;
}
.signup-form .btn:hover, .signup-form .btn:focus {
background: #3fc0ad !important;
}
.signup-form a {
color: #fff;
text-decoration: underline;
}
.signup-form a:hover {
text-decoration: none;
}
.signup-form form a {
color: #5fcaba;
text-decoration: none;
}
.signup-form form a:hover {
text-decoration: underline;
}
</style>
</head>
<body>
<!-- Content -->
<?php
?>
<div class="signup-form">
<form action="#" method="post">
<h2>Come Let's create your Portfolio</h2>
<p>It's free and only takes a minute.</p>
<hr>
<div class="row">
<div class="col-sm-6">
<div class="form-group">
<input type="text" class="form-control" name="inputFirstName" required placeholder="FirstName" value='<?php echo $fName ?>'>
</div>
</div>
<div class="col-sm-6">
<div class="form-group">
<input type="text" class="form-control" name="inputLastName" required placeholder="LastName" value='<?php echo $lName ?>'>
</div>
</div>
</div>
<div class="form-group">
<input type="text" class="form-control" name="school" placeholder="School" required="required" value='<?php echo $sc ?>'>
</div>
<div class="row">
<div class="col-sm-6">
<div class="form-group">
<input type="number" class="form-control" name="Per10" required placeholder="Xth %" value='<?php echo $p10 ?>'>
</div>
</div>
<div class="col-sm-6">
<div class="form-group">
<input type="number" class="form-control" name="Per12" required placeholder="XIIth %" value='<?php echo $p12 ?>'>
</div>
</div>
</div>
<div class="form-group">
<input type="text" class="form-control" name="university" placeholder="University" value='<?php echo $uni ?>'required="required">
</div>
<div class="form-group">
<input type="text" class="form-control" name="graduation" placeholder="Graduation Course" required="required" value='<?php echo $cou ?>'>
</div>
<h4 style="color:black;">Mention the knowledge of below given programming or Markup languages (in percentage)</h4>
<div class="form-group">
<input type="number" class="form-control" name="html" placeholder="HTML" required="required" min="0" max="100" value='<?php echo $ht ?>'>
</div>
<div class="form-group">
<input type="number" class="form-control" name="css" placeholder="CSS" required="required" min="0" max="100" value='<?php echo $cs ?>'>
</div>
<div class="form-group">
<input type="number" class="form-control" name="java" placeholder="JAVA" required="required" min="0" max="100" value='<?php echo $ja ?>'>
</div>
<div class="form-group">
<input type="number" class="form-control" name="bootstrap" placeholder="BOOTSTRAP" required="required" min="0" max="100" value='<?php echo $boot ?>'>
</div>
<div class="form-group">
<input type="number" class="form-control" name="c" placeholder="C" required="required" min="0" max="100" value='<?php echo $c1 ?>'>
</div>
<div class="form-group">
<button type="submit" class="btn btn-primary btn-block btn-lg" name="submit">Modify</button>
</div>
</form>
</div>
</body>
</html>