/
index_v.php
executable file
·123 lines (119 loc) · 3.03 KB
/
index_v.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
<!DOCTYPE html>
<html lang="ja">
<head>
<meta charset="UTF-8" />
<title></title>
<script src="js/jquery-1.11.2.min.js"></script>
<script type="text/javascript">
var loginFlg = <?=($userId)?1:0?>;
$(document).ready(function(){
if(loginFlg != 1){
$('.wannaSee').click(function(event){
event.preventDefault();
$(this).blur();
if($("#modal-overlay")[0]) return false ;
$("body").append('<div id="modal-overlay"></div>');
$("#modal-overlay").fadeIn("slow");
centeringModalSyncer();
$("#modal-content").fadeIn("slow");
$("#modal-overlay,#modal-close").unbind().click(function(){
$("#modal-content,#modal-overlay").fadeOut("slow",function(){
$("#modal-overlay").remove();
});
});
});
}
$(window).resize(centeringModalSyncer) ;
});
function centeringModalSyncer(){
var w = $(window).width() ;
var h = $(window).height() ;
var cw = $( "#modal-content" ).outerWidth( {margin:true} );
var ch = $( "#modal-content" ).outerHeight( {margin:true} );
$( "#modal-content" ).css( {"left": ((w - cw)/2) + "px","top": ((h - ch)/2) + "px"} ) ;
}
</script>
<style type="text/css">
.button{
width:150px;
font-size: 25px;
text-align: center;
background-color:#87CEEB;
border-radius:15px;
display:block;
}
.button:hover{
background-color:#478EAB;
color:#DFDFDF;
}
.button.gray{
background-color:gray;
}
.button.gray:hover{
background-color:gray;
}
.button a{
display:block;
height:100%;
width:100%;
text-decoration: none;
color:white;
}
#modal-content{
width: 50% ;
margin: 0 ;
padding: 10px 20px ;
border: 2px solid #aaa ;
background: #fff ;
position: fixed ;
display: none ;
z-index: 2 ;
}
#modal-overlay{
z-index: 1 ;
display: none ;
position: fixed ;
top: 0 ;
left: 0 ;
width: 100% ;
height: 120% ;
background-color: rgba( 0,0,0, 0.75 ) ;
}
</style>
</head>
<body>
<?=$login?><br>
<div id="modal-content">
<p>ログインしてください</p>
<p><a id="modal-close" class="button-link">閉じる</a></p>
</div>
<table>
<tr>
<th>順位</th>
<th> </th>
<th>映画名</th>
<th>今週の売上</th>
<th>累計売上</th>
<th>見たい!数</th>
<th> </th>
</tr>
<?php
$index = 0;
foreach($ranking as $key => $value) {
$index++;
?>
<tr>
<td><?=$index?></td>
<td><img src="img/<?=$value["movie_img"]?>"</td>
<td><a href="./movie_detail/movie_detail.php?movie_id=<?=$value["movie_id"]?>"><?=$value["original_name"]?></a></td>
<td><?=$value["sales"]?></td>
<td><?=$value["total_sales"]?></td>
<td><?=($value["wannasee"])?$value["wannasee"]:0?></td>
<td><div class="button <?php if($form["voted"][$value["movie_id"]]){?>gray<?php } ?>"><a href=<?php if($form["voted"][$value["movie_id"]]){?>"#" <?php }else{?>"./vote/vote.php?movie_id=<?=$value["movie_id"]?>" <?php }?> class="wannaSee">見たい!</a></div></td>
</tr>
<?php
if($index == 21){break;}
} ?>
</table>
</body>
</html>