-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathStudentdataOneStepF.php
75 lines (62 loc) · 2.63 KB
/
StudentdataOneStepF.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
<?php
session_start();
$server = "localhost";
$username = "root";
$password = "";
$dbname = "job_vacancy_management";
$conn = mysqli_connect($server, $username, $password, $dbname);
if (!$conn) {
die("Connection failed: " . mysqli_connect_error());
}
echo "Connected successfully";
$studentID = 0;
if (isset($_POST['submitFinal'])){
// echo
$fname = $_POST['fname'];
$mname = $_POST['mname'];
$lname = $_POST['lname'];
$studentID = $_POST['studentID'];
$phone = $_POST['phone'];
$location = $_POST['location'];
// echo
$degreecode = $_POST['degreecode'];
$degreename = $_POST['degreename'];
$class = $_POST['class'];
$graduatedyear = $_POST['graduatedyear'];
$gpa = $_POST['gpa'];
// echo
$talents = $_POST['talents'];
$preferredcompanies = $_POST['preferredcompanies'];
$salaryexpected = $_POST['salaryexpected'];
$projects = $_POST['projects'];
$query4 = "INSERT INTO DEGREE (DegreeCode, Name, Class, GraduatedYear, GPA) VALUES ('$degreecode', '$degreename', '$class', '$graduatedyear', '$gpa')";
$run4 = mysqli_query($conn, $query4);
$query1 = "INSERT INTO GRADUATED_STUDENT (StudentID, FirstName, MiddleName, LastName, ContactNumber, SalaryExpected, DegreeCode) VALUES
('$studentID', '$fname', '$mname', '$lname', '$phone', '$salaryexpected', '$degreecode')";
$run1 = mysqli_query($conn, $query1);
// MULTI VALUE attribute >>>>>>>>>> check
$query2 = "INSERT INTO TALENT (StudentID, Talent) VALUES ('$studentID', '$talents')";
$run2 = mysqli_query($conn, $query2);
// ID not given should be auto increment or any?????
$query3 = "INSERT INTO LOCATION (Location) VALUES ('$location')";
$run3 = mysqli_query($conn, $query3);
$query5 = "INSERT INTO project (StudentID, Project) VALUES ('$studentID', '$projects')";
$run5 = mysqli_query($conn, $query5);
$query6 = "INSERT INTO project (StudentID, Project) VALUES ('$studentID', '$projects')";
$run6 = mysqli_query($conn, $query6);
$query7 = "INSERT INTO project (StudentID, Project) VALUES ('$studentID', '$projects')";
$run7 = mysqli_query($conn, $query7);
$user = $_SESSION['username'];
$query8 = "UPDATE logindetails SET StudentID = " . $studentID . " WHERE UserName = '" .$user. "'";
$run8 = mysqli_query($conn, $query8);
$query9 = "INSERT INTO About (AboutMe,ImgName,StudentID) VALUES ('About Me','image','$studentID')";
$run9 = mysqli_query($conn, $query9);
//
if ($run8 ){
echo "Form submitted successfully !";
header('location: LOGIN/login.php');
}else{
echo "Form not submitted !";
}
}
?>