-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.php
236 lines (186 loc) · 10.4 KB
/
index.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
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
<?php
require('./include/database.php');
require('./include/function.php');
require('./mailer.php');
if(isset($_POST['LoginInto'])){
$name=mysqli_real_escape_string($db,$_POST['name']);
$email=mysqli_real_escape_string($db,$_POST['email']);
$password=mysqli_real_escape_string($db,$_POST['password']);
$password=md5($password);
$profile_image_name=$_FILES['profile']['name'];
$profile_image_type=$_FILES['profile']['type'];
$profile_image_tmp=$_FILES['profile']['tmp_name'];
$profile_image_name=date('d-m-Y-H-i').$profile_image_name;
if ($profile_image_type=="image/jpeg" || $profile_image_type=="image/jpg" || $profile_image_type=="image/png") {
$query="SELECT * FROM user WHERE email='$email'";
$runQuery=mysqli_query($db,$query);
$totalRows=mysqli_num_rows($runQuery);
if($totalRows >=1){
echo"<script>alert('You have an account !');window.location.href = './userlogin.php';</script>";
}
else{
if(move_uploaded_file($profile_image_tmp,"./profile/$profile_image_name")){
$verifyKey=randPassNo();
$msg="Use ".$verifyKey." as your verification code";
$isMailSend=smtp_mailer($email,'Verify Career Cutm',$msg);
if ($isMailSend == "Sent") {
$query="INSERT INTO user (name,email,password,image,status,verifyCode) VALUES('$name','$email','$password','$profile_image_name','pending','$verifyKey')";
$run=mysqli_query($db,$query) or die(mysqli_error($db));
if ($run) {
echo"<script>alert('Your account created successfully please verify your email!');window.location.href = './verification.php?vemail=".$email."';</script>";
}
else {
echo"<script>alert('Insertion Error please ignore verify email!');</script>";
}
}else {
echo"<script>alert('We are sorry somthing wrong in my mailer!');</script>";
}
}
else {
echo"<script>alert('Insertion Error minimum size 100 KB !');</script>";
}
}
}else {
echo"<script>alert('Please Upload your sign as JPEG,JPG or PNG file Only');</script>";
}
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>CUTM Career</title>
<meta content="width=device-width, initial-scale=1.0" name="viewport">
<meta content="" name="keywords">
<meta content="" name="description">
<!-- Favicon -->
<link rel="icon" type="image/png" href="favicon.png" />
<meta property="og:site_name" content="CUTM Career">
<meta property="og:title" content="CUTM Career" />
<meta property="og:description" content="Centurion University Of Technology and Management" />
<meta property="og:image" itemprop="image" content="favicon.png">
<meta property="og:type" content="website" />
<!-- Google Web Fonts -->
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Open+Sans:wght@400;600&family=Roboto:wght@500;700&display=swap" rel="stylesheet">
<!-- Icon Font Stylesheet -->
<link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.10.0/css/all.min.css" rel="stylesheet">
<link href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.4.1/font/bootstrap-icons.css" rel="stylesheet">
<!-- Libraries Stylesheet -->
<link href="lib/owlcarousel/assets/owl.carousel.min.css" rel="stylesheet">
<link href="lib/tempusdominus/css/tempusdominus-bootstrap-4.min.css" rel="stylesheet" />
<!-- Customized Bootstrap Stylesheet -->
<link href="css/bootstrap.min.css" rel="stylesheet">
<!-- Template Stylesheet -->
<link href="css/style.css" rel="stylesheet">
</head>
<body>
<div class="particleImg"></div>
<div class="particleclass" id="particles-js"></div>
<div class="container-fluid position-relative d-flex p-0">
<!-- Spinner Start -->
<div id="spinner" class="show bg-dark position-fixed translate-middle w-100 vh-100 top-50 start-50 d-flex align-items-center justify-content-center">
<div class="spinner-border text-primary" style="width: 3rem; height: 3rem;" role="status">
<span class="sr-only">Loading...</span>
</div>
</div>
<!-- Spinner End -->
<!-- Sidebar Start -->
<div class="sidebar pe-4 pb-3 open">
<nav class="navbar bg-secondary navbar-dark">
<a href="index.php" class="navbar-brand mx-4 mb-3">
<h3 class="text-primary"><img src="./css/images/CUTM-logo.png" height="40px" width="30px"> CUTM Career</h3>
</a>
<div class="navbar-nav w-100">
<a href="./index.php" class="nav-item nav-link active"><i class="fa fa-id-card me-2"></i>Register</a>
<a href="./adminlogin.php" class="nav-item nav-link"><i class="fa fa-lock me-2"></i>Admin Login</a>
<a href="./userlogin.php" class="nav-item nav-link"><i class="fa fa-lock me-2"></i>User Login</a>
</div>
</nav>
</div>
<!-- Sidebar End -->
<!-- Content Start -->
<div class="content open">
<!-- Navbar Start -->
<nav class="navbar navbar-expand bg-secondary navbar-dark sticky-top px-4 py-0">
<a href="index.php" class="navbar-brand d-flex d-lg-none me-4">
<h2 class="text-primary mb-0"><img src="./css/images/CUTM-logo.png" height="40px" width="30px"></h2>
</a>
<a href="#" class="sidebar-toggler flex-shrink-0">
<i class="fa fa-bars"></i>
</a>
<div class="navbar-nav align-items-center ms-auto">
<div class="nav-item dropdown">
<a href="./adminlogin.php" class="nav-link">
<i class="fa fa-lock me-lg-2"></i>
<span class="d-none d-lg-inline-flex">Admin Login</span>
</a>
</div>
<div class="nav-item dropdown">
<a href="./userlogin.php" class="nav-link">
<i class="fa fa-lock me-lg-2"></i>
<span class="d-none d-lg-inline-flex">User Login</span>
</a>
</div>
</div>
</nav>
<!-- Navbar End -->
<div class="container-fluid">
<div class="row h-100 align-items-center justify-content-center" style="min-height: 100vh;">
<div class="col-12 col-sm-8 col-md-6 col-lg-5 col-xl-4">
<form action="" method="post" enctype="multipart/form-data">
<div class="bg-secondary rounded p-4 p-sm-5 my-4 mx-3">
<div class="d-flex align-items-center justify-content-between mb-3">
<a href="index.php" class="">
<h3 class="text-primary"><i class="fa fa-user-edit me-2"></i>CUTM Career</h3>
</a>
</div>
<div class="form-floating mb-3">
<input type="text" class="form-control" id="floatingInput" placeholder="Full Name" name="name" required>
<label for="floatingInput">Full Name</label>
</div>
<div class="form-floating mb-3">
<input type="email" class="form-control" id="floatingInputemail" placeholder="Email" name="email" required>
<label for="floatingInput">User Email address</label>
</div>
<div class="form-floating mb-4">
<input type="password" class="form-control" id="floatingPassword" placeholder="Password" name="password" required>
<label for="floatingPassword">Password</label>
</div>
<div class="mb-3">
<label for="formFile" class="form-label">Upload Profile Photos</label>
<input class="form-control bg-dark" type="file" id="formFile" name="profile" accept="image/*" >
</div>
<button type="submit" class="btn btn-primary py-3 w-100 mb-4" name="LoginInto">Create Account</button>
</div>
</form>
</div>
</div>
</div>
<!-- Footer Start -->
<?php
include_once('./include/footer.php')
?>
<!-- Footer End -->
</div>
<!-- Content End -->
<!-- Back to Top -->
<a href="#" class="btn btn-lg btn-primary btn-lg-square back-to-top"><i class="bi bi-arrow-up"></i></a>
</div>
<!-- JavaScript Libraries -->
<script src="https://code.jquery.com/jquery-3.4.1.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.0.0/dist/js/bootstrap.bundle.min.js"></script>
<script src="lib/chart/chart.min.js"></script>
<script src="lib/easing/easing.min.js"></script>
<script src="lib/waypoints/waypoints.min.js"></script>
<script src="lib/owlcarousel/owl.carousel.min.js"></script>
<script src="lib/tempusdominus/js/moment.min.js"></script>
<script src="lib/tempusdominus/js/moment-timezone.min.js"></script>
<script src="lib/tempusdominus/js/tempusdominus-bootstrap-4.min.js"></script>
<script src="./particles/particles.js"></script>
<script src="./particles/app.js"></script>
<!-- Template Javascript -->
<script src="js/main.js"></script>
</body>
</html>