Skip to content

Commit

Permalink
chnge
Browse files Browse the repository at this point in the history
  • Loading branch information
divyanshugarg36 committed Oct 5, 2019
1 parent c63a1d9 commit f51c055
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 2 deletions.
File renamed without changes.
10 changes: 10 additions & 0 deletions config.php
Original file line number Diff line number Diff line change
Expand Up @@ -87,3 +87,13 @@ function getData($table, $offset)
}
$departments = getData('departments', 3);
$subjects = getData('subjects', 5);

function getSubjectName($code)
{
global $subjects;
foreach ($subjects as $subject) {
if ($subject[2] == $code) {
return $subject[1];
}
}
}
11 changes: 9 additions & 2 deletions index.php
Original file line number Diff line number Diff line change
Expand Up @@ -194,17 +194,24 @@
<tr>
<th>Name</th>
<th>Department</th>
<th>Email</th>
<th>Email</th>
<th>Paper ID</th>
<th>Max. Marks</th>
<th>Semester</th>
<th>Year</th>
<th>Add Questions</th>
</tr>
<?php
$paperData = getdata("paper", "6");
foreach ($paperData as $paper_data) {
$paper_data[1] = getSubjectName($paper_data[1]);
echo "<tr>
<td>$paper_data[0]</td>
<td>$paper_data[1]</td>
<td>$paper_data[2]</td>
<td>$paper_data[3]</td>
<td>$paper_data[4]</td>
<td>$paper_data[5]</td>
<td><a href='./addQuestion.php?paperid=$paper_data[2]'>ADD</a></td>
</tr>";
}
?>
Expand Down

0 comments on commit f51c055

Please sign in to comment.