-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathadmin_students_manage.php
38 lines (23 loc) · 1.32 KB
/
admin_students_manage.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
<?php
$mysqli = new mysqli('localhost','root','','greendale') or die(mysqli_error($mysqli));
$targetDir = "studentImage/";
$picture = basename($_FILES["picture"]["name"]);
$targetFilePath = $targetDir . $picture;
$fileType = pathinfo($targetFilePath,PATHINFO_EXTENSION);
if (isset($_POST['submit'])){
$student_id = $_POST['student_id'];
$batch_id = $_POST['batch_id'];
$student_fname = $_POST['student_fname'];
$student_lname = $_POST['student_lname'];
$email = $_POST['email'];
$birthday =$_POST['birthday'];
$contactnumber = $_POST['contactnumber'];
$password = $_POST['password'];
$NIC = $_POST['NIC'];
move_uploaded_file($_FILES["picture"]["tmp_name"], $targetFilePath);
$mysqli->query("INSERT INTO students ( student_id, batch_id, student_fname, student_lname, email, birthday, contactnumber, password, NIC, picture) VALUES('$student_id','$batch_id','$student_fname','$student_lname','$email','$birthday','$contactnumber','$password','$NIC','$picture')") or die($mysqli->error);
$mysqli->query("INSERT INTO students_payments (student_id, batch_id) VALUES('$student_id','$batch_id')") or die($mysqli->error);
$mysqli->query("INSERT INTO students_results (student_id, batch_id) VALUES('$student_id','$batch_id')") or die($mysqli->error);
header("location:admin_students.php");
}
?>