-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvideodetails.php
237 lines (213 loc) · 13.5 KB
/
videodetails.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
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
<?php
require_once 'core/init.php';
$user = new User();
?>
<!doctype html>
<head>
<title>Imaguana | Video Details</title>
<?php
$elements = explode('/', $_SERVER['REQUEST_URI']);
$user = $elements[1];
echo "<BASE href=\"/\">";
?>
<!-- CSS, Meta, Ajax, etc. -->
<?php include 'view/head.php' ?>
</head>
<body>
<!-- Navigation Bar -->
<?php include 'view/nav-bar.php'; ?>
<!-- Product Content -->
<div class="container ws-page-container" style="margin-top: -40px;">
<div class="row">
<!-- Product Image Carousel -->
<div class="col-sm-7">
<h3 class="ws-item-title" style="color: black; margin-bottom: 10px; text-align: center; font-size: 30px;"><?php echo $video->data()->title; ?></h3><span class="ws-separator"></span>
<?php if($video->data()->source == "youtube"){ ?>
<iframe width="650" height="435" <?php echo 'src="https://www.youtube.com/embed/' . $video->data()->embeded . '"'; ?> frameborder='0' allowfullscreen></iframe>
<?php } else{ ?>
<iframe width="650" height="435" <?php echo 'src="https://player.vimeo.com/video/' . $video->data()->embeded . '"'; ?> frameborder='0' allowfullscreen></iframe>
<?php } ?>
</div>
<!-- Product Information -->
<div class="col-sm-5">
<div class="ws-product-content">
<header>
<div class="ws-product-details">
<!-- Author -->
<h3 style="text-decoration: underline; color: #D5AD92;"><span style="color: black;">Artist</span></h3><br>
<a style=" color: #0000EE;" href="<?php echo str_replace(' ', '', rawurldecode("user/" . $video->data()->username)); ?>" <p style="margin-top: 4px;"><?php echo $video->data()->user . " (" . $video->data()->username . " )" ?></p></a><br>
<h3 style="text-decoration: underline; color: #D5AD92;"><span style="color: black;">Description</span></h3><br>
<p style="margin-top: 5px; color: black;"><?php echo $video->data()->description; ?></p><br>
<h3 style="text-decoration: underline; color: #D5AD92;"><span style="color: black;">Category</span></h3><br>
<form action="video/results" method="POST">
<input hidden="true" name="search" type="text" value=<?php echo $video->data()->category ?> >
<input style="background-color: white; border-width: 0px; color: #0000EE;" type="submit" value=<?php echo $video->data()->category ?> >
</form><br>
<!-- Tags -->
<h3 style="text-decoration: underline; color: #D5AD92; margin-bottom: 15px;"><span style="color: black;">Tags</span></h3>
<p style="color: black; margin-top: 5px; margin-bottom: 15px;">
<?php $tags = preg_split('[, ]',$video->data()->tags);
foreach($tags as $tag)
echo '<a style="margin-top: 4px; color: #0000EE;" href=video/tag/'.$tag.' >'.$tag.', </a> '; ?>
</p><br>
<div class="row">
<div class="col-sm-6 col-sm-offset-4">
<h3 class="pull-left" style="text-decoration: underline; color: #D5AD92;"><span style="color: black;">License</span></h3>
<a data-toggle="modal" data-target="#License" >
<img style='height:16px; width:16px;' alt='assets/img/help.gif' src='assets/img/help.gif' >
</a>
</div>
</div>
<br>
<form class="ws-buy-form" action="transaction.php" method="POST">
<!-- Product Details -->
<div class="ws-product-details">
<div class="row">
<div class="col-sm-8 col-sm-offset-2">
<input type="radio" checked="true" name="license" value="web" class="radio pull-left">
<label style="color: black;" for="radio2">Web License</label>
<p style="color: black;" class="pull-right">$<?php echo $video->data()->web; ?></p>
</div>
</div>
</div>
<!-- Button -->
<input hidden="true" name="videoid" type="text" <?php echo 'value="' . $video->data()->id . '"' ?> >
<?php if ($user->isLoggedIn() && ($user->data()->id == $video->data()->user_id || $user->data()->group == 3)){ ?>
<a style="margin-top: -10px;" class="btn ws-btn-fullwidth" href="video/edit/<?php echo $video->data()->id; ?>">Edit Video Information</a>
<?php }else if ($user->isLoggedIn()){?>
<input style="margin-top: -10px;" class="btn ws-btn-fullwidth" type="submit" value="Buy License" name="submit" >
<input hidden="true" name="videoid" type="text" value="<?php echo $video->data()->id ?>" >
<input hidden="true" name="type" type="text" value="video" >
<?php }else if (!$user->isLoggedIn()){ $button = "<a href='#ws-buy-modal" . $video->data()->id . "' data-toggle='modal' ><span class='ws-shop-cart'><input style=' height: 50px; font-size:15px;' type='submit' class='btn ws-btn-fullwidth' value='Buy'></span></a> ";
$modal = '
<!-- Register Buy Modal -->
<div class="modal fade" id="ws-buy-modal' . $video->data()->id . '" tabindex="-1">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header" style="border: none;">
<a class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></a>
</div>
<div class="row" >
<div class="col-sm-10 col-sm-offset-1">
<div class="modal-body" style="color: black;>
<!-- Register Form -->
<form class="ws-buy-form" style="color: black;">
<h3 style="text-align: center;">Thank you for your interest!</h3>
<div class="ws-separator"></div>
<div class="form-group">
<h4>to complete your purchase, please contact CII at <b>(415)855-8555</b>. Image info is listed below: </h4><br>
<h4><b>Title:</b> ' . $video->data()->title . '<h4><br>
<h4 ><b>Category:</b> ' . $video->data()->category . '<h4><br>
<h4 ><b>Artist:</b> ' . $video->data()->username . '<h4><br>
<h4 ><b>ID:</b> ' . $video->data()->id . '<h4><br>
<h4><b>Licenses:</b> Web-$' . $video->data()->web . '</h4>
<br>
<h4>or you can <a href="login"><span>Login</span></a> to your account to save the transaction!</h4>
<br>
<h4>Dont have an account? <a href="signup"><span>Sign Up</span></a> today!</h4><br>
<div class="form-group">
<label class="col-md-3 control-label"></label>
<div class="col-md-8" style="margin-left: 300px">
<ul style="list-style: none;">
<li class="ws-shop-cart" style="display:inline;">
<a data-dismiss="modal" aria-label="Close" class="btn btn-sm" style="margin-right: 10px;">Close</a>
</ul>
</div>
</div>
</div>
</form>
</div>
</div>
</div>
</div>
</div>
</div>';
echo $button;
echo $modal;
} ?>
</form>
</div>
</header>
</div>
</div>
</div>
</div>
<!-- Product Content -->
<!-- Related Post -->
<div class="ws-related-section" style="margin-top: -100px">
<div class="container">
<!-- Title -->
<div class="ws-related-title">
<h3>Related Products</h3>
</div>
<?php
$count = 0;
$output = "";
$videolist = new Video();
if (!$videolist->search("category", $video->data()->category))
echo "<p>No related videos found: " . "</p>";
else
foreach ($videolist->data() as $img) {
if ($video->data()->id == $img->id)
continue;
$output .='
<div class="col-sm-4">
<!-- Item -->
<div class="ws-works-item">
<a href=video/show/' . $img->id . '>
<!-- Image -->
<figure>
<iframe width="350" height="200" src="https://www.youtube.com/embed/' . $img->embeded . '" frameborder="1" allowfullscreen></iframe>
</figure>
<div class="ws-works-caption text-center">
<!--Category -->
<div class="ws-item-category">' . $img->category . '</div>
<!-- Title -->
<div style = "margin-bottom: 10px;"><h3 class="ws-item-title">' . $img->title . '</h3></div>
<!-- Buttons -->
<a href="video/show/' . $img->id . '" ><span class="ws-shop-cart"><input style="margin-left: 5px; height: 41px;" type="submit" class="btn btn-lg" value="View"></span></a>
<div class="ws-item-separator"></div>
</div>
</a>
</div>
</div>';
$count += 1;
if ($count >= 3)
break;
}
echo $output;
?>
</div>
</div>
<!-- End Related Post -->
<!-- DEFINING WEB, Print, and Unlimited License -->
<div id="License" class="modal fade" role="dialog">
<div class="modal-dialog">
<!-- Modal content-->
<div class="modal-content">
<div class="modal-body">
<h3 style="text-align: center; color:black;">License Descriptions:</h3>
<div class="ws-separator"></div>
<h3 style="text-align: center; color:black;" ><u>Web</u></h3>
<p style="color:black;"> You will receive a URL that you can use on your website to display the video.</p>
<br>
<div class="form-group">
<label class="col-md-3 control-label"></label>
<div class="col-md-8" style="margin-left: 300px">
<ul style="list-style: none;">
<li class="ws-shop-cart" style="display:inline;">
<a data-dismiss="modal" aria-label="Close" class="btn btn-sm" style="margin-left: 25px;">Close</a>
</ul>
</div>
</div>
<br>
</div>
</div>
</div>
</div>
<!-- Foot Bar -->
<?php include 'view/foot-bar.php'; ?>
<!-- Scripts -->
<?php include 'view/scripts.php' ?>
</body>
</html>