-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtemplates.php
64 lines (59 loc) · 2.11 KB
/
templates.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
<?php
class templates{
function __construct($mysql){
$this->mysql = $mysql;
}
function home(){
$mysql = $this->mysql;
?>
<header class = "masthead text-center text-white">
<div class = "masthead-content">
<h1 class="masthead-heading mb-0">Micro Quiz Hour</h1>
<h2 class="masthead-subheading mb-0">Brought to You by Nanomaterials Chemistry</h2>
<h4 class="masthead-subheading mb-0" id="points" style="font-size: 30pt"></h4>
</div><!--masthead-content close-->
</header><!--header close-->
<div class="container">
<div class="game">
<div class="row">
<!--could create a function here that would select id, name from categories order by id and then would loop through answers and then would populate headings and then inside that loop could put buttons loop inside of that-->
<?php
$categories = $mysql->getCategories(); //gets all of the category names
foreach($categories as $category){ //cycles through all of the categories
?>
<div class="column">
<?php
$categoryName = $category['name'];
$categoryId = $category['id'];
?>
<h3><?=$categoryName?></h3>
<?php
$buttons = $mysql->getButtonInfo($categoryId); //button info gets the item info for each tile
$info = $buttons[0];
foreach($buttons as $button){
$imageId = $button['imageId'];
$overlay = $mysql->getOverlayImage($imageId); //will get the overlay image for each tile
$image = $overlay[0];
$overlayImage = $image['overlay_img'];
?>
<button type="button" class="btn btn-primary jeopardy" data-toggle="modal" data-target="#example" data-id="<?=$imageId?>"><img src="../images/<?=$overlayImage?>"></button>
<?php
}
?>
</div> <!--closes column-->
<?php
}//end of outer foreach
?>
</div><!--row close-->
<div class="modal" tabindex="-1" role="dialog" id="example">
<div class="modal-dialog modal-lg" role="document">
<div class="modal-content">
</div>
</div>
</div>
</div><!--game close-->
</div><!--container close-->
<?php
}
}
?>