-
Notifications
You must be signed in to change notification settings - Fork 3
/
video.php
133 lines (115 loc) · 4.29 KB
/
video.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
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
<!DOCTYPE html>
<html>
<head>
<title>Aktiva-Archive</title>
<meta charset="UTF-8" />
<meta name="keywords" content="Global Studios, グローバルスタジオ" />
<meta name="description" content="" />
<meta name="author" content="Global Studios" />
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="shortcut icon" href="img/favicon.ico" />
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.5.0/css/font-awesome.min.css">
<link rel = "stylesheet" type = "text/css" href = "css/style.css">
</head>
<body>
<?php
session_start();
$connectionInfo = [
"UID" => "atsushi@aktiva-archive",
"pwd" => "Shigoto4510",
"Database" => "aktiva-archive-db",
"CharacterSet" => "UTF-8"
];
$serverName = "tcp:aktiva-archive.database.windows.net,1433";
$conn = sqlsrv_connect($serverName, $connectionInfo);
if($conn === false) {
print('<p>データベースへの接続に失敗しました。</p>');
foreach(sqlsrv_errors() as $error)
print("Error: " . $error["message"]);
sqlsrv_close($conn);
exit();
}
$userid = utf8_encode($_SESSION["USERID"]);
$historyid = utf8_encode($_GET["id"]);
echo '
<header>
<div class="siteheader shadow1">
<a href=""><img src="img/logo.png"></a>
<nav>
<ul id="menu">
<li><a href="">USER ID: '. $userid .'</a></li>
<li><a href="">アーカイブリスト</a></li>
<li><a href="">Aktiva-Archiveについて</a></li>
<li><a href="logout.php">ログアウト</a></li>
</ul>
<button id="menubutton"><span></span></button>
</nav>
</div>
</header>
<section id="header-back"></section>';
$query = "SELECT * FROM \"history\" WHERE history_id LIKE '" . $historyid ."' AND user_id LIKE '". $userid ."';";
$result = sqlsrv_query($conn, $query);
if($result === false) {
print('<p>クエリーが失敗しました。</p>');
foreach(sqlsrv_errors() as $error)
print("Error: " . $error["message"]);
sqlsrv_close($conn);
exit();
}
$row = sqlsrv_fetch_array($result);
$query = "SELECT * FROM \"music\" WHERE music_id LIKE '" . $row["music_id"] ."';";
$result = sqlsrv_query($conn, $query);
if($result === false) {
print('<p>クエリーが失敗しました。</p>');
foreach(sqlsrv_errors() as $error)
print("Error: " . $error["message"]);
sqlsrv_close($conn);
exit();
}
$row = sqlsrv_fetch_array($result);
echo '<section class="each_menu"><div class="wrap">';
echo '<a href="./music.php?id='. $row["music_id"] .'"></a>';
echo '<h1>< '.$row["artist"].' - ' . $row["song"] .'</h1>';
echo '</div></section>';
$query = "SELECT * FROM \"history\" WHERE history_id LIKE '" . $historyid ."' AND user_id LIKE '". $userid ."';";
$result = sqlsrv_query($conn, $query);
if($result === false) {
print('<p>クエリーが失敗しました。</p>');
foreach(sqlsrv_errors() as $error)
print("Error: " . $error["message"]);
sqlsrv_close($conn);
exit();
}
$row = sqlsrv_fetch_array($result);
echo '<section class="each_menu"><div class="wrap">';
// echo '<div class="youtube_video">
// <iframe src="https://www.youtube.com/embed/' . $row["video_url"] .'" frameborder="0" allowfullscreen></iframe>
// </div>';
echo '</div></section>';
echo '<section class="each_menu"><div class="wrap">';
echo '<h1>Total Score: '.$row["score"].'</h1>';
echo '<h1>'.$row["comment"].'</h1>';
echo '</div></section>';
echo '<section class="each_menu"><div class="wrap">';
$pieces = explode("/", $row["part"]);
for ($i=0; $i < sizeof($pieces) - 1 ; $i+=2) {
echo "<h1>".$pieces[$i].": ".$pieces[$i+1]."</h1>";
}
echo '</div></section>';
echo '<section class="each_menu"><div class="wrap">';
$pieces = explode("/", $row["body"]);
$body = array("右腕", "左腕", "右足", "左足");
for ($i=0; $i < sizeof($pieces); $i++) {
echo "<h1>".$body[$i].": ".$pieces[$i]."</h1>";
}
echo '</div></section>';
echo '<section class="each_menu"><div class="wrap">';
echo '<h1>タイミング: '.$row["timing"].'</h1>';
echo '<h1>表情: '.$row["expression"].' / 8 </h1>';
echo '</div></section>';
?>
<!-- Script -->
<script src="js/lib/jquery.min.js"></script>
<script src="js/drawerNav.js"></script>
</body>
</html>