forked from tgc-dk/Musikteam
-
Notifications
You must be signed in to change notification settings - Fork 1
/
editSong.php
363 lines (306 loc) · 13.8 KB
/
editSong.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
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
<?php
session_start();
if (isset($_SESSION['logget_ind'])) {
include("db.php");
include("function.php");
openDB();
$intSongId = $_GET['song'];
if ($intSongId > -1) {
$query = "SELECT Titel,Identifikation,Udgave,ProTekst,CommentsOver,CommentsUnder,Lydfil,Kilde,Slides2 FROM Sang WHERE (SangId = " . $intSongId . ") ORDER BY Titel";
$result = doSQLQuery($query);
$res_arr = db_fetch_array($result);
$strTitle = stripslashes($res_arr["Titel"]);
$strAuthor = stripslashes($res_arr["Identifikation"]);
$strEdition = stripslashes($res_arr["Udgave"]);
$strProText = stripslashes($res_arr["ProTekst"]);
$strCommentsOver = stripslashes($res_arr["CommentsOver"]);
$strCommentsUnder = stripslashes($res_arr["CommentsUnder"]);
$strLydfil = stripslashes($res_arr["Lydfil"]);
$strSource = stripslashes($res_arr["Kilde"]);
$strSlides = stripslashes($res_arr["Slides2"]);
}
include("popupHeader.php");
?>
<script language="JavaScript" type="text/javascript" src="js/ajax.js"></script>
<script language="JavaScript" type="text/javascript" src="js/func.js"></script>
<script type="text/javascript">
window.onload = init;
function init() {
if (window.Event) {
document.captureEvents(Event.MOUSEMOVE);
}
document.onmousemove = getXY;
}
function getXY(e) {
x = (window.Event) ? e.pageX : event.clientX;
y = (window.Event) ? e.pageY : event.clientY;
// Use x and y to do what ever you want
}
<!--
function NewWindow(mypage, myname, scroll)
{
var w=400;
var h=200;
var winl = x - 500;
var wint = y;
winprops = 'height='+h+',width='+w+',top='+wint+',left='+winl+',scrollbars='+scroll+',resizable'
win = window.open(mypage, myname, winprops)
}
function addSong(sangid)
{
ajaxRequest('','program_ajax.php','sangid='+sangid+'&mode=add');
document.getElementById("setlist").innerHTML = "<a href=\"javascript:removeSong(" + sangid + ");\">Fjern sangen fra setlisten</a>";
}
function removeSong(sangid)
{
ajaxRequest('','program_ajax.php','sangid='+sangid+'&mode=remove');
document.getElementById("setlist").innerHTML = "<a href=\"javascript:addSong(" + sangid + ");\">Tilføj sangen til setlisten</a>";
}
function hideSetlistMenu()
{
divSetlist.style.display = 'none';
}
var timerSetlisteMenu
function hideSetlistMenuOut()
{
cancelHideSetlistMenu();
timerSetlisteMenu = setTimeout("hideSetlistMenu()",2000);
}
function cancelHideSetlistMenu()
{
clearTimeout(timerSetlisteMenu);
}
var divSetlist;
var divSetlistOpacity;
function selectSetlist(sangid)
{
cancelHideSetlistMenu();
if(divSetlist == null)
divSetlist = document.getElementById('divSetlist');
divSetlist.style.left = (X+15) +'px';
divSetlist.style.top = Y + 'px';
if (divSetlist.addEventListener) {
divSetlist.addEventListener ("mouseout",hideSetlistMenuOut,false);
divSetlist.addEventListener ("mouseover",cancelHideSetlistMenu,false);
}
else if(divSetlist.attachEvent) {
divSetlist.attachEvent ("onmouseout",hideSetlistMenuOut);
divSetlist.attachEvent ("onmouseover",cancelHideSetlistMenu);
}
else {
divSetlist.onmouseout = hideSetlistMenuOut;
divSetlist.onmouseover = cancelHideSetlistMenu;
}
divSetlist.style.display = 'block';
createBackground(divSetlist);
ajaxRequest('divSetlist','program_ajax.php','sangid=' + sangid+'&mode=Setlist&from=edit');
hideSetlistMenuOut();
}
function setSetlist(setlistid, sangid)
{
createShadow(divSetlist);
ajaxRequest('setListBar','program_ajax.php','setlist='+setlistid+'&from=edit&sangid='+sangid);
}
var X, Y;
function getMouseXY(e)
{
if (e.pageX || e.pageY) {
X = e.pageX;
Y = e.pageY;
}
else if (e.clientX || e.clientY) {
X = e.clientX + document.body.scrollLeft
+ document.documentElement.scrollLeft;
Y = e.clientY + document.body.scrollTop
+ document.documentElement.scrollTop;
}
}
if (document.addEventListener)
document.addEventListener ("mousemove",getMouseXY,false);
else if (document.attachEvent)
document.attachEvent ("onmousemove",getMouseXY);
else
document.onmouseout = getMouseXY;
// -->
</script>
<style type="text/css">
<!--
.style2 {font-style: italic}
.style3 {
font-size: 9px;
font-style: italic;
}
.divSetlist th
{
height: 21px;
text-align: center;
cursor: default;
}
.divSetlist td
{
cursor: pointer;
}
.divSetlist
{
width: 150px;
height: 150px;
position: absolute;
display: none;
border: 1px outset gray;
border-collapse: collapse;
font-size: 12px;
}
.divSetlist table div
{
overflow-y: auto;
overflow-x: hidden;
height: 129px;
}
-->
</style>
<body class="home" onload = "first_load()">
<div id="divSetlist" class="divSetlist"></div>
<div class="wrapper_2">
<div id="header_2">
<div id="skriv_sang_nav">
<a href="#" onClick="javascript:text_input();"><img src="img/tekst_down.gif" width="101" height="27" border="0" id="text_img" /></a><a onClick="javascript:layout_edit();" href="#"><img src="img/layout_up.gif" width="101" height="27" border="0" id="layout_img" /></a><a href="#" onClick="javascript:slides_edit();"><img src="img/slides_up.gif" width="101" height="27" border="0" id="slides_img" /></a>
</div>
</div>
<div class="block_1 flex-container">
<div id="sidebar_2">
<div class="sidebar_top"> Stamdata </div>
<div class="sidebar_bg">
<div align="left" class="stamdata">
<p>
<strong>Titel:</strong><br>
<input name="Titel" id="Titel" type="text" value="<?php echo $strTitle; ?>" size="18" />
</p>
<p>
<strong>Forfatter:</strong><br>
<input name="Forfatter" id="Forfatter" type="text" value="<?php echo $strAuthor; ?>" size="18" />
</p>
<p>
<strong>Udgave: </strong><br>
<input name="Udgave" id="Udgave" type="text" value="<?php echo $strEdition; ?>" size="18" />
</p>
<p>
<strong>Kilde: </strong><br>
<input name="Kilde" id="Kilde" type="text" value="<?php echo $strSource; ?>" size="18" />
</p>
<strong>Lydfil:</strong>
<div id="audiofile">
<?php
if ($strLydfil=="") {
echo "Ingen lydfil tilknyttet.";
} else {
if (strrpos($strLydfil,"mp3") == (strlen($strLydfil)-3)) {
echo "<object type=\"application/x-shockwave-flash\" data=\"player_mp3_maxi.swf\" width=\"150\" height=\"20\">";
echo "<param name=\"movie\" value=\"player_mp3_maxi.swf\" />";
echo "<param name=\"FlashVars\" value=\"mp3=".$strLydfil."\" /></object><br/>";
}
echo '<a href="'.$strLydfil.'" target="_new" style="text-decoration:none">Download: <img src="img/mp3.gif" alt="Lyt" border="0"></a>';
}
?>
</div>
<button name="send" value="Upload lydfil" class="submit_btn_2" onClick="javascript:uploadAudio();return false;"> Upload lydfil </button>
<button name="send" value="Indtast URL" class="submit_btn_2" onClick="javascript:giveAudioURL();return false;"> Indtast URL </button>
</p>
<p>
<?php
if ($_SESSION['setlist'] != NULL){
echo "<span id=\"setListBar\">Aktuel setliste: <a target=\"_new\" href=\"main.php?page=program&eventId=".$_SESSION['setlist']."\">".getProgramNavn($_SESSION['setlist'])."</a>";
if (isSongInProgram($sangid, $_SESSION['setlist'])) {
echo "<br/><span id=\"setlist\"><a href=\"javascript:removeSong(".$sangid.");\">Fjern sangen fra setlisten</a></span>";
} else {
echo "<br/><span id=\"setlist\"><a href=\"javascript:addSong(".$sangid.");\">Tilføj sangen til setlisten</a></span>";
}
echo "</span>";
} else {
echo "<span id=\"setListBar\"></span>";
}
echo "<br/><a href=\"javascript:selectSetlist(".$intSongId.");\">Vælg setliste</a>";
?>
<!--<p><button name="send" value="Gem stamdata" class="submit_btn_2" onClick="javascript:saveMeta();return false;"> Gem stamdata </button></p>-->
</p>
<p>
<button type="submit" name="send" value="Udskriv" class="submit_btn" onClick="javascript:printSong();return false;"> <img src="img/udskriv_lille.gif" alt="Udskriv" width="18" height="19" border="0" align="absmiddle" /> Udskriv sang </button>
</p>
<p><button name="send" value="Slet denne sang" class="submit_btn_2" onClick="javascript:deleteSong();return false;"> Slet denne sang </button></p>
<p><button name="send" value="Opret ny version af denne" class="submit_btn_2" onClick="javascript:copyToNew();return false;"> Opret ny version af denne </button></p>
<p><button name="send" value="Gem alt" class="submit_btn_2" onClick="javascript:saveAll();return false;"> Gem alt </button></p>
<p><strong>Sidste ændringer:</strong><br/>
<?php
$query = "SELECT Bruger.Brugernavn,Historik.Dato FROM Historik INNER JOIN Bruger ON Historik.BrugerId=Bruger.BrugerId WHERE (Historik.SangId = " . $intSongId . ") ORDER BY Historik.Dato";
$result = doSQLQuery($query);
while ($res_arr = db_fetch_array($result)) {
echo $res_arr["Brugernavn"]. " " .$res_arr["Dato"]."<br/>";
}
?>
</p>
</div>
</div>
<div class="sidebar_bund"></div>
</div> <!-- sidebar_2 -->
<div class="tekst">
<div id="text_input">
<span class="stamdata">Kommentar over tekst: </span><br />
<textarea cols="60" rows="2" id="commentOver"><?php print($strCommentsOver); ?></textarea><br />
<span class="stamdata"><strong>Tekst med akkorder: </strong></span>
<span style="position:relative;">
<span id="term1" class="help_popup">Her er det muligt at indtaste sangen med akkorder (i "pro" format). Eventuelle kommentarer skal skrives i feltet over eller under sangteksten.
<ul>
<li> Hvis teksten allerede findes i systemet kan den hentes ved tryk på
<button name="send" value="Kopier tekst fra slides" class="submit_btn" onClick="#"> Hent tekst fra slides </button>
Det er muligt at ændre tonearten på sangens akkorder ved at trykke på <img src="img/plus.gif" alt="+" width="12" height="16" align="absbottom"> eller <img src="img/minus.gif" alt="-" width="12" height="16" align="absbottom"> under teksten</li>
</ul>
<strong>Skriv akkorder:</strong> Akkorden angives i kantede parenteser ( <strong>[</strong> og <strong>]</strong> ). (Genvejstast til <strong>[ ] : Ctrl+Alt+T</strong> )<img src="img/above-all---pro-html.png" alt="above all - pro - html format" width="374" height="60"><br>
Akkorden skal indsættes i sangteksten lige <strong>før</strong> det bogstav akkorden skal stå over. <br>
Klik på
<button name="send" value="Opdatér" class="submit_btn_2" onClick="#"><img src="img/refresh_firefox.gif" alt="Opdatér" width="18" height="19" align="absmiddle"/> Opdatér </button> for at se resultatet.<br><br>
<strong>Tabulator:</strong> Hvis man ønsker at sangen vises sådan at bestemte elementer (f.eks akkorder) står lige under hinanden kan man benytte en lodret streg ( <strong>| </strong>). Dette vil fungere som tabulator. Det er muligt at indsætte flere lodrette streger på en linje.<br>
Genvejstast til <strong>| </strong>: <strong>Ctrl+Alt+D</strong>.<br><br>
<strong>Lydfil:</strong> Under "Stamdata" kan der tilknyttes en lydfil til hver sang. Det sker enten ved at uploade en .mp3 eller ved at linke til lydfilen et andet sted på internettet. </span><a href="javascript:void(0);" onMouseover="ShowPop('term1');" onMouseout="HidePop('term1');"><img src="img/help_22x22.png" alt="Hjælp!" width="20" height="22" border="0" class="help_btn"></a></span>
<br />
<textarea cols="60" rows="25" id="editArea"><?php print($strProText); ?></textarea><br />
<span class="stamdata">Kommentar under tekst: </span><br />
<textarea cols="60" rows="2" id="commentUnder"><?php print($strCommentsUnder); ?></textarea>
</div>
<?php
include("layout.php");
include("slides.php");
?>
<div id="modpro_txt">
<div id="refresh">
<span id="Btn1">
<!--<button name="send" value="Gem sangtekst" class="submit_btn_2" onClick="javascript:saveLyrics();return false;"> Gem sangtekst </button>-->
<button name="send" value="Opdatér" class="submit_btn_2" onClick="javascript:update();return false;"><img src="img/refresh_firefox.gif" alt="Opdatér" width="18" height="19" align="absmiddle"/> Opdatér </button>
<button name="send" value="Kopier tekst fra slides" class="submit_btn_2" onClick="javascript:copyFromSlides();return false;"> Hent tekst fra slides </button>
<button name="send" value="Kopier tekst fra slides" class="submit_btn_2" onClick="javascript:chordConverter();return false;"> Konverter akkorder </button>
<strong>Toneart:</strong>
<a href="javascript:changeTone('lower')"><img src="img/minus.gif" name="skalam" width="16" height="23" border="0" align="top" id="skalam" /></a>
<a href="javascript:changeTone('higher')"><img src="img/plus.gif" name="skalap" width="16" height="23" border="0" align="top" id="skalap" /></a>
</span>
</div>
<div id="tekst_m_akk" onload = "update()">
</div>
<div id="refresh">
<p><button type="submit" name="send" value="Udskriv" class="submit_btn" onClick="javascript:printSong();return false;"> <img src="img/udskriv_lille.gif" alt="Udskriv" width="18" height="19" border="0" align="absmiddle" /> Udskriv sang </button>
</p>
<p>asdf<br />
</p>
</div>
</div> <!-- modpro_txt -->
</div> <!-- tekst -->
</div> <!-- block_1 -->
</div> <!-- wrapper_2 -->
<p> </p>
</body>
</html>
<?php
closeDB();
} // session
?>