-
Notifications
You must be signed in to change notification settings - Fork 0
/
name_list-h.php
75 lines (75 loc) · 1.93 KB
/
name_list-h.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 require 'base.php';?>
<html>
<head>
<link href='https://fonts.googleapis.com/css?family=Poppins:300' rel='stylesheet' type='text/css'>
<link rel="stylesheet" href="css/nl1.css" type="text/css" />
<script>
function res()
{
var clas=document.getElementById("class").value;
var obj=document.getElementsByClassName('sc');
var len=obj.length;
var temp2='['+clas+']';
var b=true;
for(i=0;i<len;i++)
{
temp=obj[i].getAttribute("data-classes");
if(temp.indexOf(temp2)>=0)
{
obj[i].disabled=false;
if(b)
{
document.getElementById('sec').value=obj[i].value;
b=false
}
}
else
obj[i].disabled=true;
}
}
</script>
</head>
<body onload="res()">
<div id ='nav'><a href='../homepage.php'><img src='css/home.png' width='70' height='70' /></a></br>
<a href='logout.php'><img width='80' height='80' src='css/lock.png' /></a></div>
<div id="bg"><center>
<div id="head"><?php echo $_SESSION['sfname'];?></div></br>
<p id="sp"> </p>
<div id="main">
</br>
<table id='cen'>
<form Action="name_list.php" method="get">
<tr>
<td><h1><x>C</x>lass:</td><td><select name="classs" onchange='res()' id='class'></h1>
<option value='1'>1</option>
<option value='2'>2</option>
<option value='3'>3</option>
<option value='4'>4</option>
<option value='5'>5</option>
<option value='6'>6</option>
<option value='7'>7</option>
<option value='8'>8</option>
<option value='9'>9</option>
<option value='10'>10</option>
<option value='11'>11</option>
<option value='12'>12</option>
</select></td></tr>
<tr><td>
<h1><x>S</x>ection:</h1></td><td><select name="sec" id='sec'>
<?php
$result=$conn->query("Select * from secinfo order by secname");
if($result===false)
die("Errror7");
while($row=$result->fetch_assoc())
{
$secname=$row['secname'];
$class=$row['class'];
echo "<option value='$secname' data-classes='$class' class='sc'>$secname</option>";
}
?>
</select></br></td></tr>
<tr><td colspan="2"><input type="submit" value="Go" id='sss'></td></tr>
</form></table></br>
</div></center></br></div>
</body>
</html>