-
Notifications
You must be signed in to change notification settings - Fork 0
/
ad_edMedia.php
executable file
·171 lines (124 loc) · 3.61 KB
/
ad_edMedia.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
<?
include('_header.php');
if (isUserAtLeastAdmin()) {
$input_id = $_GET["id"];
if (trim($input_id)) {
?>
Admin - Edit Media
<ul>
<div class="green_content_div" id="apphelp">
<div class="innerdivspacer">
Use the Gallery to find media, and then select [Edit] to arrive here<br><br>
Edit Media Licenses or Sponsors<br><br>
Media does not have to have a sponsor...
</div></div>
<div class="blue_content_div" id="app1">
<div class="innerdivspacer">
<?
//mysql_connect() or die ("Problem connecting to DataBase");
db_connect();
$query = "
SELECT
m.id mid,
m.name mname,
(m.status_id = 4) AS islive,
(m.status_id = 5) AS isdeleted,
(m.rated) AS israted,
CONCAT('$symbolsPreview', mp.filename) imgpath
FROM
t_media m
INNER JOIN t_media_path mp
ON mp.mid=m.id
WHERE
m.id='".db_escape_string($input_id)."'
and mp.type='3'
";
//$result = mysql_db_query("strstr", $query);
$result = db_runQuery($query);
if ($result) {
if ($r = mysql_fetch_array($result)) {
echo "<b>".htmlenc($r["mname"])."</b> (".$r["mid"].")<br><br>";
echo "<img src=\"".$r["imgpath"]."\">";
?>
<br clear="all">
<p><a href='ad_addMedia.php?cmd=edit&id=<?=$r["mid"]?>'>Edit media details</a></p>
<p>
<input id='emdeleted' type='checkbox' <? if ($r['isdeleted']) echo 'checked'; ?>>Deleted
<input type="button" value="Save Change" onClick="media_UpdateDeleted(<?= $input_id; ?>, document.getElementById('emdeleted').checked)">
</p>
<p>
<input id='emrated' type='checkbox' <? if ($r['israted']) echo 'checked'; ?>>Rated
<input type="button" value="Save Change" onClick="media_UpdateRated(<?= $input_id; ?>, document.getElementById('emrated').checked)">
</p>
License for Media:<br>
<?
$query2 = "
SELECT
l.id,
l.caption,
licid
FROM
t_lic l
INNER JOIN (SELECT m.licid FROM t_media m WHERE m.id='".db_escape_string($input_id)."') m ON TRUE
ORDER BY
caption ASC";
//$result2 = mysql_db_query("strstr", $query2);
$result2 = db_runQuery($query2);
?>
<select id="mlic">
<?
if ($result2) {
while ($r2 = mysql_fetch_array($result2)) {
echo " <option ";
if ($r2["id"]==$r2["licid"]) { echo "selected='selected'"; }
echo " value=\"".$r2["id"]."\">".$r2["caption"]."</option> \n";
}
}
?>
</select>
<input type="button" value="Save Change" onClick="media_UpdateLic('<? echo $input_id; ?>',document.getElementById('mlic').value)">
<br><br>
Sponsor for Media:<br>
<select id="mspon">
<option value="null">None</option>
<?
$query2 = "
SELECT
s.id,
s.caption,
(SELECT m.sponid FROM t_media m WHERE m.id='".db_escape_string($input_id)."' sponid
FROM
t_sponsor s
ORDER BY
caption ASC";
//$result2 = mysql_db_query("strstr", $query2);
$result2 = db_runQuery($query2);
if ($result2) {
while ($r2 = mysql_fetch_array($result2)) {
echo " <option ";
if ($r2["id"]==$r2["sponid"]) { echo "SELECTED"; }
echo " value=\"".$r2["id"]."\">".htmlenc($r2["caption"])."</option> \n";
}
}
?>
</select>
<input type="button" value="Save Change" onClick="media_UpdateSpon('<? echo $input_id; ?>',document.getElementById('mspon').value)">
<?
} else {
echo "No Media found with that ID";
}
}
//mysql_free_result($result);
db_freeResult($result);
?>
</div></div>
<script type="text/javascript">
Rounded("div#app1","#FFFFFF","#ECECFF");
//Rounded("div#app2","#FFFFFF","#ECECFF");
Rounded("div#apphelp","#FFFFFF","#ECFFEC");
</script>
<?
}
}
include('_footer.php');
?>