enquete_moto.php
3.38 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
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
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link href="/administrator/templates/isis/favicon.ico" rel="shortcut icon" type="image/vnd.microsoft.icon" />
<title>鹿屋体育大学</title>
<style type="text/css">
body {
margin: 0;
}
#contents {
padding: 0 15px;
}
h1 {
background: #1a3867;
color: #fff;
font-weight: normal;
padding: 10px 30px;
margin: 0 0 50px;
font-size: 1.8em;
}
h2 {
color: #1a3867;
font-weight: normal;
border-bottom: 1px solid #1a3867;
margin: 0 0 15px;
}
table {
width: 100%;
border-right: 1px solid #ccc;
border-bottom: 1px solid #ccc;
margin-bottom: 50px;
}
table th,
table td {
padding: 10px;
border-left: 1px solid #ccc;
border-top: 1px solid #ccc;
}
table th {
background: #1a3867;
color: #fff;
font-weight: normal;
}
table td {
text-align: center;
width: 25%;
}
</style>
</head>
<body>
<?php
$html_hyo = "";
$q1_ask = array("","良いね!","もう少し!");
$q2_ask = array("","見つけやすかった","見つけにくかった");
$q1_count_g = $q1_count_b = 0;
$q2_count_g = $q2_count_b = 0;
$total_count = 0;
//東京サテライトキャンパスのヘッダー表示
$db = new mysqli($app->get('db_hostname'),$app->get('user'),$app->get('password'),"ad1216tnc7_kanoya",$app->get('db_port'));
$db->set_charset('utf8');
$sql = 'SELECT * FROM d_feedback WHERE id > 9 ORDER BY id DESC';
$row = $db->query($sql);
//mysqli_query($db, $sql);
while( $data = $row->fetch_object()){
$q1_ans = $data->q1;
$q2_ans = $data->q2;
$page_id = $data-> page_id;
if($total_count < 100){
$html_hyo .= '<tr><td>';
if($page_id){
$sql_p = 'SELECT * FROM v4vfh_menu WHERE id = '.$page_id.' LIMIT 1';
$row_p = $db->query($sql_p);
$data_p = $row_p->fetch_object();
$html_hyo .= $data_p->title;
}
$html_hyo .= '</td><td>'.$q1_ask[$q1_ans].'</td><td>'.$q2_ask[$q2_ans].'</td><td>'.$data->input_date.'</td>';
$total_count ++;
if($q1_ans == 1) { $q1_count_g++; }elseif($q1_ans == 2) { $q1_count_b++; }
if($q2_ans == 1) { $q2_count_g++; }elseif($q2_ans == 2) { $q2_count_b++; }
$html_hyo .= '</tr>';
}
}
$db->close();
$q1_good_par = round($q1_count_g / $total_count * 100, 0);
$q1_bad_par = round($q1_count_b / $total_count * 100, 0);
$q2_good_par = round($q2_count_g / $total_count * 100, 0);
$q2_bad_par = round($q2_count_b / $total_count * 100, 0);
?>
<h1>フィードバック集計</h1>
<div id="contents">
<h2>割合</h2>
<table cellspacing="0" cellpadding="0" class="table1">
<tr>
<th colspan="2">情報について</th>
<th colspan="2">情報の見つけやすさ</th></tr>
<tr>
<th>良いね!</th><th>もう少し!</th>
<th>見つけやすかった</th><th>見つけにくかった</th></tr>
<tr>
<td><?php echo $q1_count_g; ?>(<?php echo $q1_good_par; ?> %)</td>
<td><?php echo $q1_count_b; ?>(<?php echo $q1_bad_par; ?> %)</td>
<td><?php echo $q2_count_g; ?>(<?php echo $q2_good_par; ?> %)</td>
<td><?php echo $q2_count_b; ?>(<?php echo $q2_bad_par; ?> %)</td>
</tr>
</table>
<h2>アンケート一覧</h2>
<table cellspacing="0" cellpadding="0" class="table2">
<tr><th>ページ</th><th>ページの情報について</th><th>情報の見つけやすさ</th><th>登録日</th></tr>
<?php echo $html_hyo; ?>
</table>
</div>
</body>
</html>