~dani.behzi/pfcm/pfcm

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
<!DOCTYPE HTML>
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">

<head>
	<title>FSUG Movie Manager - Movie Page</title>
	<meta http-equiv="content-type" content="text/html;charset=utf-8" />
	<meta name="creator" content="Danial Behzadi" />
	<link rel="stylesheet" type="text/css" href="css.css" />
</head>

<body>
	<script type="text/javascript">
		function validateForm()
		{
			var x=document.forms["comment"]["name"].value;
			if (x==null || x=="")
			{
				alert("Name Field must be filled out");
				return false;
			}
			x=document.forms["comment"]["comment"].value;
			if (x==null || x=="")
			{
				alert("You should enter a comment");
				return false;
			}
		}
	</script>
	<table style="width:100%">
		<tr>
			<th><a href="index.php"><img title="Home" src="media/images/home.png"></a></th>
			<th><a href="search.php?query=ID"><img title="All movies" src="media/images/movies.png"></a></th>
			<th><a href="LISENCE"><img title="Lisence" src="media/images/lisence.png"></a></th>
			<th><a href="about.php"><img title="About…" src="media/images/about.png"></a></th>
		</tr>
	</table>
	<p></p>
	
	<?php
		// Create Connection
		include 'connect.php';		
		mysql_select_db("collection", $con);
		
		$id=$_GET[id];
		$result = mysql_query("SELECT * FROM Movies
			WHERE ID = $id");
		$movie = mysql_fetch_array($result);
		
		$director=$movie['Director'];
		$year=$movie['Year'];
		$genre=$movie['Genre'];
		
		echo "<h1>" . $movie['Name'] . "
			<a href='edit.php?id=$id&field=Name&ref=movie'>
			<img src='media/images/edit.gif' title='Edit'></a>
			<font style='color:gray'> by </font>
			<a href='search.php?query=Director&phrase=$director'>$director</a>
			<a href='edit.php?id=$id&field=Director&ref=movie'>
			<img src='media/images/edit.gif' title='Edit'></a>
			<font style='color:gray'> in </font>
			<a href='search.php?query=Year&phrase=$year'>$year</a>
			<a href='edit.php?id=$id&field=Year&ref=movie'>
			<img src='media/images/edit.gif' title='Edit'></a>
			<font style='color:gray'> - </font>
			<a href='search.php?query=Genre&phrase=$genre'>$genre</a>
			<a href='edit.php?id=$id&field=Genre&ref=movie'>
			<img src='media/images/edit.gif' title='Edit'></a></h1>";
		
		echo "<div>";
		echo "<div id='left' class='bar' >
		<table style='width:200px'>
			<tr>
				<th>Poster</th>
			</tr>
			<tr>
				<td>
					" . "<p>poster here</p>" . "
				</td>
			</tr>
		</table>
		<br />
		<table style='width:200px'>
			<tr>
				<th>Tags</th>
			</tr>
			<tr>
				<td>
					<p>" . $movie['Tags'] . "</p>
					<a href='edit.php?id=$id&field=Tags&ref=movie'>
					<img src='media/images/edit.gif' title='Edit'></a>
				</td>
			</tr>
		</table>
		<br />
		<table style='width:200px'>
			<tr>
				<th>Actors</th>
			</tr>
			<tr>
				<td>" . "Actors list here" . "</td>
			</tr>
		</table>
		</div>";
		
		echo "<div id='right' class='bar' >
		<table style='width:200px'>
			<tr>
				<th>Format</th>
				<td>" . "Format here" . "</td>
			</tr>
			<tr>
				<th>Size</th>
				<td>" . "Size here" . "</td>
			</tr>
			<tr>
				<th>subtitles</th>
				<td>" . "subtitles here" . "</td>
			</tr>
			<tr>
				<th>Available</th>
				<td>" . "Availablity here" . "</td>
			</tr>
		</table>
		<br />
		<table style='width:200px'>
			<tr>
				<th>Support this</th>
			</tr>
			<tr>
				<td>" . "Instructions here" . "</td>
			</tr>
		</table>
		</div>";
		
		echo "<div id='center' class='bar' >";
		echo "<div id='myText'>
			<table style='width:100%'>
				<tr>
					<th>Summary</th>
				</tr>
				<tr>
					<td>" . "<p style='text-align:justify'>Summary here</p>" . "</td>
				</tr>
			</table>
			<br />
			<table style='width:100%'>
				<tr>
					<th>Articles</th>
				</tr>
				<tr>
					<td>" . "<p style='text-align:justify'>Articles list here</p>" . "</td>
				</tr>
			</table>
			<br />
			<table style='width:100%'>
				<tr>
					<th>Comments</th>
				</tr>
				<tr>
					<td>";
						$comment = mysql_query("SELECT * FROM Moviescomments
							WHERE ID = $id");
						$movie = mysql_fetch_array($result);
						
						echo "<table style='width:100%'>";
						while($row = mysql_fetch_array($comment))
						{
							echo "<tr><th style='padding: 0px'>";
							if ( $row['Website'] != false){
								if ( $row['Email'] != false){
									echo "<a href='" . $row['Website'] . "'>" . $row['Name'] . "</a> 
									<a href=mailto:" . $row['Email'] . ">
									<img src='media/images/mail.png' tile='Mail'></a></th></tr>";
								}
								else{
									echo "<a href='" . $row['Website'] . "'>" . $row['Name'] . "</a></th></tr>";
								}
							}
							else{
								if ( $row['Email'] != false){
									echo  $row['Name'] . " <a href=mailto:" . $row['Email'] . ">
									<img src='media/images/mail.png' tile='Mail'></a></th></tr>";
								}
								else{
									echo $row['Name'] . "</th></tr>";
								}
							}
									
								echo "<tr><td>" . $row['Comment'] . "</td></tr>";
						}
						echo "</table>
						<p></p>
						<form name='comment' action='insertcomment.php' 
							method='post' onsubmit='return validateForm()'>
							<input type='hidden' name='id' value = '$id'/>
							<table style='width:100%'>
								<tr>
									<td><font style='color:red'>*</font>Name </td>
									<td> <input type='text' name='name' /></td>
								</tr>
								<tr>
									<td>E-mail </td>
									<td> <input type='email' name='email' /> </td>
								</tr>
								<tr>
									<td>Website </td>
									<td> <input type='url' name='website' /> </td>
								</tr>
								<tr>
									<td><font style='color:red'>*</font>Comment </td>
									<td> <textarea id='comment_content' name='comment'
									 rows='7' cols='44' ></textarea>
									 <input type='submit' value='Comment' /></td>
								</tr>
							</table>
						</form>
					</td>
				</tr>
			</table>
		</div></div></div>";
		
		echo "<p><form action='delete.php' method='post' style='text-align:center;'>
			<input type='hidden' name='ID' value='$id' />
			<input type='hidden' name='sure' value='nope' />
			<input type='hidden' name='from' value='movie' />
			<input type='submit' value='Delete Movie' />
			</form></p>";
		echo "<p><a href='javascript:history.go(-1)'>
			Go back<img src='media/images/back.gif'></a></p>";
		mysql_close($con);
	?>
	
</body>

</html>