-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathexample.php
executable file
·98 lines (91 loc) · 2.94 KB
/
example.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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
<?php
require_once dirname ( __FILE__ ) . '/services/ExampleTypeService.class.php';
$exampleTypeService = new ExampleTypeService();
$exampleTypes = $exampleTypeService->selectAllExampleTypes();
$totalCount = 0;
foreach($exampleTypes as $exampleType) {
$totalCount = $totalCount + $exampleType['typecount'];
}
if(isset($_GET['id'])) {
$typeId = $_GET['id'];
$selectedType = $exampleTypeService->selectExampleTypeById($typeId);
}
?>
<!DOCTYPE html>
<head>
<title>Phaser小站</title>
<meta charset="utf-8" />
<meta name="Keywords" content="Phaser,Phaser小站,HTML5,游戏,HTML5游戏,游戏引擎,游戏框架,HTML5游戏引擎,HTML5游戏框架" />
<meta name="Description" content="Phaser小站是一个为phaser而生的网站,以宣传和发展Phaser为使命。本站提供一切关于Phaser的案例、源码、教程、教学视频。" />
<link href="css/global.css" rel="stylesheet" />
<link href="css/common.css" rel="stylesheet" />
<link href="css/example.css" rel="stylesheet" />
<script src="js/lib/jquery.js"></script>
<script src="js/lib/handlebars.js"></script>
<script id="exTypes-template" type="text/x-handlebars-template">
<ul>
{{#each this}}
<li data-id="{{id}}" data-name="{{typename}}">
<img src="{{type_big_pic_url}}" />
<div class="name">{{typename}}</div>
<div class="discription">{{discription}}</div>
</li>
{{/each}}
</ul>
</script>
<script id="exs-template" type="text/x-handlebars-template">
<ul>
{{#each this}}
<li data-id="{{id}}">
<img src="{{pic_url}}" />
<div class="name">{{ex_name}}</div>
<div class="discription">{{discription}}</div>
</li>
{{/each}}
</ul>
</script>
<?php
if(isset($selectedType)) {
?>
<script>
var TYPE_ID = '<?php echo $selectedType[0]['id'];?>';
var TYPE_NAME = '<?php echo $selectedType[0]['typename'];?>';
</script>
<?php
}
?>
<script src="js/handleLogin.js"></script>
<?php include_once 'partials/statistics.php';?>
</head>
<body>
<?php include_once 'partials/header.php'; ?>
<div class="middleDiv">
<div class="exampleTitle">
<div class="title" id="title">SELECT A CATEGORY</div>
</div>
<div class="leftDiv" id="exTypes">
<ul>
<li data-id="0">
<span class="exampleCategory">ALL</span>
<span class="exampleNum"><?php echo $totalCount;?></span>
</li>
<?php
foreach($exampleTypes as $exampleType) {
?>
<li data-id="<?php echo $exampleType['id'];?>" data-name="<?php echo $exampleType['typename'];?>">
<span class="exampleCategory"><?php echo $exampleType['typename'];?></span>
<span class="exampleNum"><?php echo $exampleType['typecount'];?></span>
</li>
<?php
}
?>
</ul>
</div>
<div id="exams" class="rightDiv">
</div>
<div class="clear h100"></div>
</div>
<?php include_once 'partials/footer.php'; ?>
<?php include_once 'partials/bottomFixed.php'; ?>
<script src="js/example.js"></script>
</body>