Example #1
0
function _vereinteammatchlist($vid, $show = 'home')
{
    global $dbi;
    // step 1 collect the teams for this verein
    // step 2 for each team we collect the schedule and create click-rows to the matchsheet
    echo '<h3>Alle Vereins Teams und ihre Heim Spiele</h3>';
    $RS = DB_listTeams($dbi, 0, 0, "", 1, "", $vid);
    foreach ($RS as $row) {
        if ($show == 'home') {
            $MATCHLIST = DB_listMatches($dbi, 1, 0, $row[4], "", "", 1);
        } elseif ($show = 'away') {
            $MATCHLIST = DB_listMatches($dbi, 1, 0, $row[4], "", "", 0);
        } elseif ($show = 'all') {
            // this doesn't work ...
            $MATCHLIST = DB_listMatches($dbi, 1, 0, $row[4], "", "", "", "", "logic");
        }
        $aTH = array("Runde", "Datum", "Spielort", "Status", "", "Sets", "Legs", "Team", "Teamname");
        echo "<div class=\"sectionhead\">Team {$row['5']} in {$row['2']} (" . sizeof($MATCHLIST) . " Matches)</div><br/>";
        echo '<div class="child">';
        OpenTable();
        echo ArrayToTableHead($aTH);
        echo RecordsetToClickTable($MATCHLIST, 4, "ls_system.php?func=showmatch&vmkey=%P1%&eventid=%P2%", 3, 0);
        CloseTable();
        echo '</div><br/>';
    }
}
Example #2
0
/**
*	purpose: returns select box of TeamNames, if event=0 return all active
* 	params:	 id/name,change_action,id_selected,eventid
*	returns:	HTML select Box
*/
function Select_Team($idname, $selchangeaction = '', $tid = 0, $eventid = 0)
{
    global $dbi;
    $RS = DB_listTeams($dbi, $eventid);
    $OUT = RecordsetToSelectOptionList($RS, array(4, 2, 5), $idname, $tid, $selchangeaction);
    return $OUT;
}
Example #3
0
function retAccessThisMatchKey($thismatchkey)
{
    /*
     * purpose:v4 this is for the enhanced access model where special verein-accounts
     * can be used to write-save Games & matchsheets (similar to AC:2) of selected teams
     * returns: false / 1 
     */
    /*
     * v4: release, add check on the location accounts.
     */
    global $dbi, $usertoken;
    if (sizeof($usertoken) < 5) {
        return FALSE;
    }
    $ret = FALSE;
    $userverein = 0;
    $hometeamid = 0;
    /* if user.type <> verein exit 0
     * extract hometeam from matchkey
     * get verein for hometeam
     * get location for hometeam
     * compare against user.verein - return 0/1
     * compare against user.location - return 0/1
     * 	*/
    $userverein = $usertoken['verein_id'];
    $userlocation = $usertoken['location_id'];
    $hometeamid = retTeamFromMatchkey($thismatchkey, "h");
    #debug('V'.$userverein.'-T:'.$hometeamid.'-L'.$userlocation);
    if ($userverein > 0) {
        $TEAMS = DB_listTeams($dbi, 0, 0, "", 1, "", $userverein);
        # the teamid is in the 5th element - cycle to match against hometeam
        # here we have a max of 6-8 teams no need for early break ...
        foreach ($TEAMS as $a) {
            #debug("Verein ".$userverein." HomeTeam: ".$hometeamid." Team: $a[4] $a[5]");
            if ($a[4] == $hometeamid) {
                $ret = 1;
            }
        }
    }
    #
    # compare the team-locationID against the user.location
    if ($userlocation > 0) {
        $TEAMS = DB_listTeams($dbi, 0, 0, "", 1, "", 0, "", $userlocation);
        # the teamid is in the 5th element - cycle to match against hometeam
        # here we have a max of 6-8 teams no need for early break ...
        foreach ($TEAMS as $a) {
            #debug("Verein ".$userverein." HomeTeam: ".$hometeamid." Team: $a[4] $a[5]");
            if ($a[4] == $hometeamid) {
                $ret = 1;
            }
        }
    }
    return $ret;
}
Example #4
0
function _editverein($vvid)
{
    //
    // v02 BH 09.2005
    // added homepagelink 02.2007
    //
    /*
     * added user.verein access layer ...
     */
    global $dbi, $vereinsdb, $sctdcolor, $dartred, $dartgreen, $usertoken;
    /*
     * fetch Verein DATA
     */
    $precord = mysql_query('select * from tverein where vid=' . $vvid);
    $vereininfo = mysql_fetch_array($precord);
    // this is a case sensitive array !!!
    if (mysql_num_rows($precord) == 0) {
        die('<h3>Error:V0:VereinNotFound=' . $vvid . '</h3>');
    }
    /*
     * check ACCESS
     */
    switch ($usertoken['usertype_id']) {
        case '1':
            die('<h3>Error:V1:Type=' . $usertoken['usertype_id']) . '</h3>';
            break;
        case '2':
            if (!$usertoken['verein_id'] == $vvid) {
                die('<h3>Error:V2:WrongVerein</h3>');
            }
            break;
        default:
            if (sizeof($usertoken['registermap']) < 1) {
                die('<h3>Error:V3:Size:0</h3>');
            }
            if ($usertoken['registermap'][$vereininfo['verband_id']] < 2) {
                die('<h3>No rights in ' . $vereininfo['verband_id'] . '...</h3>');
            }
            if ($usertoken['usertype_id'] == 5 || $usertoken['usertype_id'] == 6) {
                echo '<script language=\'JavaScript\' src=\'code/account.js\'></script>';
            }
            break;
    }
    /*
     * Start OUTPUT
     */
    setPageTitle('Vereins Eintrag Bearbeiten');
    // Vereinsformular
    OpenTable();
    echo '<form action="' . $vereinsdb . '?func=save&amp;vvid=' . $vvid . '" method="post">';
    echo form_Verein($vereininfo);
    echo '</form>';
    CloseTable();
    // Account Line + Button
    if ($usertoken['usertype_id'] == 5 || $usertoken['usertype_id'] == 6) {
        echo '<div id="pnladmin">';
        OpenTable();
        echo include 'forms/vereinsaccount.php';
        CloseTable();
        echo '</div>';
    }
    // CHILD INFO
    echo '<h3>Aktive Teams</h3><div class="child">';
    $RS = DB_listTeams($dbi, 0, 0, '', 1, '', $vereininfo['vid']);
    echo RecordsetToSelectOptionList($RS, array(4, 2, 5), 'teamid', 0, 'getlineup(this.value)') . ' W&auml;hle ein Team um die Aufstellung anzuzeigen.';
    echo '<div id="lineUp"></div></div>';
    echo '<h3>Aktuelle Mitglieder</h3><div class="child">';
    echo Select_Membertype('mtype', 1, 'listmemberv(this.value)', 0) . ' W&auml;hle eine Mitgliedsart um die aktuellen Mitglieder anzuzeigen.';
    echo '<div id="frmMember"></div>';
    echo '<div id="memberv"></div></div>';
}
Example #5
0
/**
*	purpose:	functional edit page or stages stuff
* 	params:		obj of request + child, this is a named array of a request+object view
*	returns:	html page, form,process buttons
*/
function _editobject($obj)
{
    # IF USER = Y and STATE = other than create or rejected (1,4) than this should be READ ONLY
    global $usertoken, $dbi;
    echo setPageTitle('Antrag Bearbeiten Benutzer: ' . $usertoken['uname']);
    echo '<div class=\'child\'>';
    echo include 'forms/request.php';
    echo '</div>';
    #debug($obj);
    switch ($obj['wfobject']) {
        case 'wflineup':
            // step 1 collect and SHOW the teams for this verein
            echo '<h3>Team w&auml;hlen</h3><div class=\'child\'><p>* Das Team w&auml;hlen zu dem ein Spieler hinzugef&uuml;gt werden soll. Die aktuelle Aufstellung wird dann unterhalb abgezeigt. F&uuml;r <b>jeden</b> Spieler ist ein eigener Antrag auszuf&uuml;llen.</p>';
            $RS = DB_listTeams($dbi, 0, 0, '', 1, '', $usertoken['verein_id']);
            echo RecordsetToSelectOptionList($RS, array(4, 2, 5), 'teamid', $obj['team_id'], 'getlineup(this.value)');
            echo '</div>';
            echo '<h3>Aktuelle Aufstellung</h3><div class=\'child\'><div id=\'lineUp\'></div></div>';
            echo '<h3>Aufstellung erweitern</h3><div class=\'child\'>';
            echo _input(0, 'wflineupid', $obj['wflineup_id']);
            echo '<p>Hier kannst einen existierenden Spieler aus der Datenbank suchen und diesen in das Formular &uuml;bernehmen. Kann der Spieler nicht gefunden werden so muss das Formular ausgef&uuml;llt werden.</p>';
            echo form_SearchPlayer('searchplayer("loadplayer")');
            echo '<div id=\'qry\'></div>';
            // Only show the LOAD Button if the wfplayer record does not exists
            if (!($obj['wfplayer_id'] + $obj['player_id']) > 0) {
                echo '<p>Ein neues, leeres Spieler Melde Formular laden: ' . _button('Spieler neu', 'loadplayer(this)') . '</p>';
            }
            echo '</div>';
            echo '<h3>Spieler Bearbeiten</h3><div class="child">';
            echo '<div id="requestdata">';
            // only show the form if there is a saved wfplayer record - else show LOAD Button ?
            if ($obj['wfplayer_id'] + $obj['player_id'] > 0) {
                echo include 'forms/wfplayer.php';
            } else {
                echo '<div id="check"></div>';
            }
            echo '</div>';
            echo '</div>';
            echo '<h3>Prozess</h3><div class="child">';
            echo _show_process_buttons('lineup', $obj);
            echo '</div>';
            break;
        case 'wfplayer':
            echo '<h3>Suchen</h3><div class=\'child\'>';
            echo '<p id=\'explain\'>1. Einen existierenden Spieler in der aktuellen Datenbank nach Passnummer suchen und die Suchergebnisse anzeigen.</p>';
            echo form_SearchPlayer('searchplayer("loadplayer")');
            echo '<p id=\'explain\'>2. Hast du richtigen Spieler gefunden, so kannst du mit dem Load Button die bekannten Daten dieses Spielers aus der Datenbank in das Formular &uuml;bernehmen. Die Daten k&ouml;nnen nun ge&auml;ndert bzw erg&auml;nzt werden.<br>Konnte der betreffende Spieler nicht gefunden werden oder es handelt sich um einen neuen Spieler so sind alle mit (*) gekennzeichneten Felder auszuf&uuml;llen.</p>';
            echo '<div id=\'qry\'></div></div>';
            echo '<h3>Bearbeiten</h3><div class=\'child\'>';
            echo '<div id=\'requestdata\'>';
            echo include 'forms/wfplayer.php';
            echo '</div></div>';
            echo '<h3>Prozess</h3><div class=\'child\'>';
            echo _show_process_buttons('player', $obj);
            echo '</div>';
            break;
        case 'wfteam':
            #debug($obj);
            echo "<h3>Team</h3><div class=\"child\">";
            echo "<div id=\"requestdata\">";
            echo include 'forms/wfteam.php';
            echo '</div></div>';
            echo '<h3>Aufstellung</h3><div class=\'child\'><div id=\'lineUp\'></div></div>';
            echo '<h3>Aufstellung erweitern</h3><div class=\'child\'>';
            echo form_SearchPlayer('searchplayer("addwflineup")');
            echo '<div id=\'qry\'></div><div id="check"></div></div>';
            echo '<script>getwflineup(' . $obj['wfteam_id'] . ')</script>';
            echo '<h3>Prozess</h3><div class=\'child\'>';
            echo _show_process_buttons('team', $obj);
            echo '</div>';
            break;
        case 'wfmessage':
            #debug($obj);
            echo '<h3>Unstrukturierte freie Meldung</h3><div class=\'child\'>';
            echo '<div id=\'requestdata\'>';
            echo include 'forms/wfmessage.php';
            echo '</div></div>';
            echo '<h3>Prozess</h3><div class=\'child\'>';
            echo _show_process_buttons('message', $obj);
            echo '</div>';
            break;
        default:
            echo '<div class=\'child\'>E:WF23:UnknownRequestType</div>';
    }
}
Example #6
0
    $location_name = strip_tags($_GET['location']);
} else {
    $location_name = "";
}
if (isset($_GET['locationid']) && is_numeric($_GET['locationid'])) {
    $location_id = strip_tags($_GET['locationid']);
} else {
    $location_id = 0;
}
if (isset($_GET['vereinid']) && is_numeric($_GET['vereinid'])) {
    $verein_id = strip_tags($_GET['vereinid']);
} else {
    $verein_id = 0;
}
if (isset($_GET['eventtype']) && is_numeric($_GET['eventtype'])) {
    $evtype_id = strip_tags($_GET['eventtype']);
} else {
    $evtype_id = 0;
}
if (isset($_GET['eventid']) && is_numeric($_GET['eventid'])) {
    $event_id = strip_tags($_GET['eventid']);
} else {
    $event_id = 0;
}
$dbi = sql_connect($dbhost, $dbuname, $dbpass, $dbname);
$RS = DB_listTeams($dbi, $event_id, $evtype_id, $event_name, $event_active, $team_name, $verein_id, $verein_name, $location_id, $location_name);
$OUT = "<table class=\"tchild\" id=\"teamtable\" name=\"teamtable\">";
$OUT = $OUT . RecordsetToDataTable($RS, array(2, 3, 5, 7, 9));
$OUT = $OUT . "</table>";
header('Content-Type: application/xhtml+xml; charset=ISO-8859-1');
echo $OUT;
Example #7
0
function _listTeams($eventgroup)
{
    #
    # // List all active teams for the actual eventgroup
    # // get eventgroup - list teams with hyperlinks into the schedule page for this league
    #
    global $dbi, $tdbg;
    /*
     * we have no global event struct here ... retieve based on passed param
     * show selector for change of eventgroup ....
     */
    echo form_EventGroupSelect('ls_debug.php?func=allteams', '', $eventgroup);
    if (!$eventgroup > 0) {
        return;
    }
    $aTH = array('Bewerb', 'Saison', 'Team-id', 'Teamname', 'Verein-id', 'Vereinsname', 'Spielort-id', 'Heimspielort');
    $target = 'ls_system.php?func=schedule&eventid=%P1%';
    $RS = DB_listTeams($dbi, 0, $eventgroup, '', 1);
    $ROWS = RecordsetToClickTable($RS, 2, $target, 0);
    // OUTPUT
    echo '<h3>Alle Teams der Liga-Gruppe ' . $eventgroup . '</h3>';
    echo '<p>Hier werden alle Teams die in <b>allen</b> aktiven Ligen dieser Liga Gruppe spielen alphabetisch gelistet. Ein Klick auf einen Teameintrag f&uuml;hrt direkt in die Seite mit allen Spielberichten (Spielplan) der betreffenden Liga oder Klasse.</p>';
    OpenTable();
    echo ArrayToTableHead($aTH);
    echo "<tr height=5px></tr>";
    echo $ROWS;
    CloseTable();
    echo "<p>Anzahl der Teams: " . count($RS) . "</p>";
}