-
Notifications
You must be signed in to change notification settings - Fork 3
/
function.php
51 lines (45 loc) · 1.27 KB
/
function.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
<?php
function getNextRank($programid)
{
// $sql = "SELECT TOP 1 raekkefoelge FROM programpunkt WHERE programid = ".$programid." ORDER BY raekkefoelge DESC";
$sql = "SELECT Raekkefoelge FROM ProgramPunkt WHERE ProgramID = ".$programid." ORDER BY Raekkefoelge DESC LIMIT 1";
$rs = doSQLQuery($sql);
if(db_fetch_array($rs))
return db_result($rs,"raekkefoelge") + 1;
else
return 0;
}
function getSangTitel($sangid)
{
$sql = "SELECT Titel FROM Sang WHERE SangId = ".$sangid;
$rs = doSQLQuery($sql);
if(db_fetch_array($rs))
return db_result($rs,"titel");
else
return "";
}
function getProgramNavn($programid)
{
$sql = "SELECT * FROM Program WHERE ProgramID = " . $programid;
$rs = doSQLQuery($sql);
if(db_fetch_array($rs))
return db_result($rs, "Arrangement")." ".convDate(db_result($rs, "dato"));
else
return "";
}
function isSongInProgram($songid, $programid)
{
if($songid == NULL || $programid == NULL)
return false;
$sql = "SELECT * FROM ProgramPunkt WHERE ProgramID = ".$programid." AND SangID = ".$songid;
$rs = doSQLQuery($sql);
return db_fetch_array($rs);
}
function dbDateTxt($dato)
{
$str = substr($dato,0,4);
$str = substr($dato,5,2) . "/" . $str;
$str = substr($dato,8,2) . "/" . $str;
return $str;
}
?>