-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgetstudent.php
More file actions
53 lines (50 loc) · 1.95 KB
/
Copy pathgetstudent.php
File metadata and controls
53 lines (50 loc) · 1.95 KB
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
<?php
session_start();
include 'dbconnect.php';
if($_SERVER["REQUEST_METHOD"] == "POST"){
$id=$_POST['id'];
$sub_id=$_SESSION['sub_id'];
// var_dump($_SESSION);
$_SESSION['Student_id']=$id;
// $sql1="Select subject_id from relation where teacher_id=".$_SESSION['teacher_id']." and class_name = ".$_SESSION['class_name'];
// $pass_class="'".$class."'";
$sql="Select Marks1,Marks2 from stu_marks where Student_id= ".$id." and Subject_id = (Select subject_id from relation where teacher_id=".$_SESSION['teacher_id']." and class_name = '".$_SESSION['class_name']."')";
// echo $sql;
$result=mysqli_query($con,$sql);
if($result){
$row=mysqli_fetch_array($result);
if(isset($row["Marks1"])){
// echo $sub_id;
echo 'Marks in Ut1: '.$row["Marks1"].'<br>Marks in Ut2 :'.$row["Marks2"].'<br>';
// $_SESSION['avaialavle_marks']="True";
echo '<button type="button"
class="btn btn-primary btn-sm"
style="float: right;"
onclick="predict('.$id.','.$sub_id.')">
Predict
</button>';
}
else{
$sql1="Select Email from student where Student_Id=".$id;
$result1=mysqli_query($con,$sql1);
$row1=mysqli_fetch_array($result1);
$to="'".$row1["Email"]."'";
echo "Student has not entered his/her marks.<br>Send mail to the student <br>";
// $_SESSION['avaialavle_marks']="False";
echo '<button type="button"
class="btn btn-primary btn-md"
style="float: right;"
data-toggle="modal"
data-target="#exampleModal" onclick="mail_stud('.$to.')">
Mail
</button>';
}
}
else{
echo "NOPE";
}
}
else{
echo "No";
}
?>