Example #1
0
function _mainStatsDate()
{
    #
    # Show a typical Master/Detail view with toppane showing a browse list + delete buttons for each entry
    # New button loads empty Detail View + Save button --> reloads _browseDate
    # Click on a Master row shows editable details form + save button --> reloads _browseDate
    # uses: fretAllFedaDates.php for the browselist
    global $dbi, $event, $tdbg;
    echo setPageTitle('Manage Dates for Static Statistic Lists');
    echo '<p>Die hier angezeigten Stichtage sind in den <i>SELECT BOXEN</i> auf den unterschiedlichen statistik seiten sichtbar und anw&auml;hlbar. Wird ein Datum gel&ouml;scht so werden damit <b>keine</b> Werte oder Spiele gel&ouml;scht, sondern lediglich die mit diesem Datum assozierte statische Werteliste.<br>Ein Klick auf einen Datumseintrag ladet dieses zum Bearbeiten. Der Datums-Statistik Typ ist zwingend erforderlich.</p>';
    # SECTION 0 Navigation
    echo '<table bgcolor="' . $tdbg . '" cellpadding="2" cellspacing="1"><tr><td id="btnrefresh" bgcolor="white" onclick="initdatepage()" onMouseOver="mover(this)" onMouseOut="mout(this)">Tabelle neu laden</td>' . '<td></td><td bgcolor="white" id="datebrowseActivity"><i>Ready</i></td>' . '<td></td><td bgcolor="white" id="datesaveActivity"><i>Ready</i></td>' . '</tr></table><br>';
    # SECTION 1 BROWSELIST HEADER
    $aTH = array('ID', 'Datum', 'Comment', 'Creator', 'SyS', 'Ranking Name');
    $HEAD = ArrayToTableHead($aTH);
    echo '<table id="browseheader"><col width="20"><col width="90"><col width="310"><col width="90"><col width="30"><col width="170">' . $HEAD . '</table>';
    # Section 1.1 Browselist Body
    echo '<DIV class="tableroll">';
    echo '<table bgcolor="' . $tdbg . '" name="browsetable" id="browsetable" border="0" cellpadding="2" cellspacing="1" width="100%"><tbody></tbody></table></div><br/>';
    # SECTION 2 DETAIL VIEW
    echo '<div id="frmdate"><form name="dateentry" action="lsdb/statdate.php?opcode=save" method="post" target="_blank" onSubmit="submitForm(this);return false;"><fieldset><legend>Datum Bearbeiten</legend>';
    echo include 'forms/date.php';
    echo '</fieldset></form></div>';
    # // call the page initialisation at last make sure all DOM stuff is in place ....
    echo '<script language="javascript">initdatepage();</script>';
}
Example #2
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 #3
0
function _listverein($findstr = '')
{
    /*
     * List is a Meldewesen Public function, no restrictions here ...
     * all Meldewesen accounts can see this List here ... + Vereinsaccount his own Verein
     * TODO generate snippet listing ...
     */
    global $dbi, $vereinsdb, $sctdcolor, $dartred, $dartgreen, $imgdetail, $imgedit, $usertoken;
    if (sizeof($usertoken['registermap']) < 1) {
        if (!$usertoken['verein_id'] > 0) {
            die('E:Type:0');
        }
        $precord = sql_query('select vid,verband_id,vbundesland,vOrt,vname,vemail,vwebsite,vsoft,vsteel from tverein where vid=' . $usertoken['verein_id'], $dbi);
    } else {
        $precord = sql_query("select vid,verband_id,vbundesland,vOrt,vname,vemail,vwebsite,vsoft,vsteel from tverein where vname like '%{$findstr}%' order by verband_id desc,vname asc", $dbi);
    }
    if (strlen($findstr) > 0) {
        $pageheader = 'Ergebniss der Suchanfrage ' . $findstr;
    } else {
        $pageheader = 'Liste aller Vereine';
    }
    $aTH = array('Bundesland', 'Verein', 'email', 'WWW', 'Soft', 'Steel');
    setPageTitle($pageheader);
    OpenTable('tblverein');
    echo '<div id="lstverein"><table width="100%" cellpadding="2" cellspacing="2">';
    echo ArrayToTableHead($aTH);
    $i = 0;
    $target = $vereinsdb . '?func=edit&amp;vvid=';
    $onClick = 'vereinedit(vid)';
    while (list($vid, $verband_id, $varea, $vOrt, $vname, $vemail, $vwebsite, $vsoft, $vsteel) = sql_fetch_row($precord, $dbi)) {
        // $i=$i+1;
        echo '<tr>' . '<td>' . $imgdetail . ' ' . $varea . '<br>' . $vOrt . '</td>' . '<td><a href="' . $target . $vid . '"><b>' . $vname . '</b></a></td>' . '<td>' . $vemail . '</td>' . '<td><a href="http://' . $vwebsite . '" target="_blank">' . $vwebsite . '</a></td>';
        if ($vsoft == 1) {
            echo '<td>' . $dartgreen . '</td>';
        } else {
            echo '<td></td>';
        }
        if ($vsteel == 1) {
            echo '<td>' . $dartgreen . '</td>';
        } else {
            echo '<td></td>';
        }
        echo '</tr>';
    }
    # // END WHILE LOOP
    echo '</table></div>';
    CloseTable();
    /*
    debug("Anzahl der Vereine: $i");
    $RS=DB_listVereine($dbi,0,$usertoken['realm'],$findstr);
    $ROWS=RecordsetToClickTable($RS,1,$target."%P1%",0);
    // OUTPUT
    echo "<div id=\"lstverein\"><table>$ROWS</table></div>";
    */
}
Example #4
0
function _teampage($team_id)
{
    /*
     * generate the teampage
     */
    global $dbi;
    $RS = DB_listMatches($dbi, 1, 0, $team_id, '', '', '', '', 'raw');
    $aTH = array('Liga', 'Runde', 'Datum', 'Location', 'Sets', 'Legs', 'Team');
    $ROWS = RecordsetToDataTable($RS, array(1, 4, 5, 6, 9, 10, 12));
    /*
     * Output
     */
    echo '<h3>Team Schedule</h3>';
    echo '<p><table>' . ArrayToTableHead($aTH) . $ROWS . '</table></p>';
    echo '<h3>Team Averages</h3>';
    echo '<p>Chronologische Darstellung der erzielten Averages in allen Legs aller eingesetzen Spieler eines Teams. Aus dieser Kurve lassen sich Leistungssteigerungen und Einbr&uuml;che ableiten.<i>Falls Spieler gemeldet aber nie eingesetzt wurden so werden NULL werte angezeigt ...</i></p>';
    echo getTeamAvgHist($team_id);
}
Example #5
0
/**
*	purpose:	list specific players according to searchstring 
* 	params:		findstring, findpassnr
*	returns:	renders Page with Browsebar+PlayerTable
*/
function listall($findstr = '', $findpass = '', $firstLetter = '')
{
    # zeigt einen Table mit einer SpielerListe an
    global $dbi, $realm_id, $playercode, $usertoken;
    if (sizeof($usertoken['registermap']) < 1) {
        die_red('Err58:RegisterMap');
    }
    if (strlen($findstr) < 1 && strlen($findpass) < 1 && strlen($firstLetter) < 1) {
        $findstr = 'A';
    }
    $aTH = array('Aktiv', 'Vorname', 'Nachname', 'Key-1', 'Key-2', 'PLZ', 'Wohnsitz');
    $RS = DB_listPlayers($dbi, 0, $findstr, '', $findpass, '', '', $firstLetter);
    $target = $playercode . '?func=edit&amp;vpid=%P1%';
    $ROWS = RecordsetToClickTable($RS, 0, $target, 0);
    // OUTPUT //
    echo setPageTitle('<h3>Liste::Spielereintr&auml;ge ' . $findstr . '</h3>');
    echo LastNameBrowseBar($firstLetter);
    OpenTable('browse');
    echo ArrayToTableHead($aTH);
    echo $ROWS;
    CloseTable();
    debug('Anzahl der gefundenen Spieler = ' . sizeof($RS));
}
Example #6
0
/**
*	purpose	generate a detailed statcodelist breakdown per Player for a specific event
*	params		eventid,playerid
*	returns		HTML Table page
*/
function _showStatCodeListForEventDetail($player_id)
{
    global $event, $dbi;
    $aTH = array('Vorname', 'Nachname', 'Runde', 'Datum', 'Legs+', 'Sets+', 'Matches+', 'Punkte');
    $target = 'ls_system.php?func=showmatch&vmkey=%P1%&eventid=' . $event['id'];
    /* 
     * supported for different type of statcodelists (9,13,16,17)
     *	the default is to return a detailed game list without any points or calculations
     * if special calcs are needed use the switch clause on stat_code
     */
    switch ($event['evstatcode_id']) {
        case 16:
            // BDSO Punkte 7,6,3,0
            // retrieve all games -> for each game get game data
            $RS = lsdb_stat_ReturnGamePointsForPlayer($dbi, $event, $player_id, 1);
            break;
        default:
            $RS = DB_retStatQueryArrayDetail($dbi, $player_id, $event);
    }
    // OUTPUT
    $OUT = _MakeStatPageHeader($event['id'], 0);
    $OUT = $OUT . '<h3>Detailed List</h3>';
    $OUT = $OUT . OpenTable('statlistdetail', 1);
    $OUT = $OUT . ArrayToTableHead($aTH);
    // skip fields: pid,gid
    $OUT = $OUT . RecordsetToClickTable($RS, 2, $target, 4);
    $OUT = $OUT . CloseTable(1);
    echo $OUT;
}
 * 	file	:	showMatchChangeHistory.php
*	purpose:	return request history DATA
* 	params:		matchkey
*	returns:	HTML Table
*/
foreach ($_POST as $secvalue) {
    if (eregi("<[^>]*script*\"?[^>]*>", $secvalue) or eregi("\\([^>]*.*\"?[^>]*\\)", $secvalue)) {
        die("Err11:Sec");
    }
}
require_once "../code/config.php";
require_once "../includes/sql_layer.php";
#require_once("../theme/Lite/theme.php");
require_once "../lsdbcontroller.php";
require_once '../api_rs.php';
require_once '../api_format.php';
if (isset($_POST['matchkey']) && substr($_POST['matchkey'], 0, 1) == 'e' && $_POST['matchkey'] != "undefined") {
    $mkey = $_POST['matchkey'];
} else {
    $mkey = '';
}
if (strlen($mkey) < 8) {
    die('ErrX1:Matchkey');
}
$dbi = sql_connect($dbhost, $dbuname, $dbpass, $dbname);
$ROWS = DB_listMatchHistory($dbi, $mkey);
$aTH = array('', 'User', 'Datum', 'Eintrag', 'Client');
$OUT = '<table width=\'100%\'>' . ArrayToTableHead($aTH);
$OUT = $OUT . $ROWS;
header('Content-Type: application/html; charset=ISO-8859-1');
echo $OUT . '</table>';
Example #8
0
    $client_action = "";
}
$dbi = sql_connect($dbhost, $dbuname, $dbpass, $dbname);
/*
 * no security here this is used for some public lineUp displays ...
$usertoken=initLsdbSec($dbi);
$ac=$usertoken['eventmap'][$event_ID];
if ($ac<3) die("<b>X2</b>");
*/
$RS = DB_listTeamLineUp($dbi, $team_id, $team_name, $player_type);
$aTH = array('Team', 'Vorname', 'Nachname', '&Ouml;DSO', '&Ouml;DV', 'Aufstellung');
if (strlen($client_action) > 1) {
    $aTH[] = 'Aktion';
}
$OUT = "<table class=\"tchild\" id=\"lineupT{$team_id}\" name=\"lineupT{$team_id}\">";
$OUT = $OUT . ArrayToTableHead($aTH);
if (strlen($client_action) > 1) {
    # this is an adm request -> inject the lineup selector and modify out RS
    $RSOUT = array();
    foreach ($RS as $r) {
        $r_out = array();
        $r_out = $r;
        $r_out[10] = Select_LineUpType('ltype', $r[10], 'changetype(' . $r[0] . ',this)') . '<div id=\'l_' . $r[0] . '\'></div>';
        $RSOUT[] = $r_out;
    }
    $OUT = $OUT . RecordsetToDataTable($RSOUT, array(2, 4, 5, 6, 7, 10), array($client_action), array(array(0, 1)), array('Remove'));
} else {
    $OUT = $OUT . RecordsetToDataTable($RS, array(2, 4, 5, 6, 7, 8));
}
$OUT = $OUT . "</table>";
header('Content-Type: application/html; charset=ISO-8859-1');
Example #9
0
function LegTableRounds($leg_dist, $gid, $gppid)
{
    global $dbi, $event;
    $legtable = '';
    $aTH = array('Score', 'Rest', 'Check');
    $precord = sql_query('select lroundscore,lroundcheck,lscore from tbllegrounds where lgid=' . $gid . ' and lpid=' . $gppid, $dbi);
    $legtable = '<table cellspacing="1" border="0">' . ArrayToTableHead($aTH, 'theadbold');
    while (list($rscore, $rcheck, $score) = sql_fetch_row($precord, $dbi)) {
        if ($score == $leg_dist) {
            $legtable = $legtable . '<tr><td class="legwon">' . $rscore . '</td><td class="legwon">' . ($leg_dist - $score) . '</td><td class="legwon">' . $rcheck . '</td></tr>';
        } else {
            $legtable = $legtable . '<tr><td>' . $rscore . '</td><td>' . ($leg_dist - $score) . '</td><td>' . $rcheck . '</td></tr>';
        }
    }
    return $legtable . '</table>';
}
Example #10
0
function _listTeamPlayers($eventgroup)
{
    #
    #// List all Players with their teams for the actual eventgroup
    #// Hyperlinked list ???
    #
    global $dbi, $tdbg;
    #TODO replaye by event-config
    $LigaStichtag = "2008-09-01";
    echo form_EventGroupSelect('ls_debug.php?func=allplayers', '', $eventgroup);
    if (!$eventgroup > 0) {
        return;
    }
    $RS = DB_listEventTeamPlayers($dbi, $eventgroup, 0, '', 0, '', 1, 0, 'team', $LigaStichtag);
    // field(12) is the day count if positive than youth player <18J else return 1
    /*
     foreach($RS as $r){
    	#echo $r[12];
    	if ($r[12]>0) {
    		$r[12]=0;
    	}else {
    		$r[12]=1;
    	}
    }
    */
    $FIELDS = array(3, 4, 5, 6, 7, 8, 9, 10, 11, 12);
    $ROWS = RecordsetToDataTable($RS, $FIELDS);
    $aTH = array("Bewerb", "Saison", "tid", "Teamname", "pid", "Vorname", "Nachname", "PassNr", "PassNr", "18J+");
    // OUTPUT
    echo '<h3>Alle gemeldeten Spieler/Teams der Liga-Gruppe ' . $eventgroup . '</h3>';
    echo "<p>Alphabetische Liste aller Teams - <b>aller</b> aktiven Ligen einer Liga Gruppe mit allen gemeldeten Spieler. Falls Spieler innerhalb einer Liga Gruppe in 2 Teams spielen d&uuml;rfen so werden sie auch 2x angezeigt. Der Stichtag f&uuml;r die Altersgrenze ist der {$LigaStichtag}.</p>";
    OpenTable();
    echo ArrayToTableHead($aTH);
    echo "<tr height=5px></tr>";
    echo $ROWS;
    CloseTable();
    echo "<p>Anzahl der Spieler: " . count($RS) . "</p>";
}
Example #11
0
function showpersonal($vpid)
{
    # displays dialog + personal chances against other SSI players
    # displays only registered players with more than $mingames (4)
    global $dbi, $user, $sipgoback, $lastdate, $predpic, $pgreenpic, $porangepic, $minsip;
    $trecords = sql_query("select pid,pfname,plname,psipstatus,statval,sipcount from tplayer,tblstat" . " where pid=statpid and sipcount>{$minsip} and statdate = '{$lastdate}' and statcode=2 order by plname asc", $dbi);
    $optionstring = "";
    while (list($pid, $pfname, $plname, $psipstatus, $sippoints, $sipcount) = sql_fetch_row($trecords, $dbi)) {
        if ($vpid == $pid) {
            $strplayer = $plname . ' ' . $pfname . ' (' . number_format($sippoints, 2, '.', '') . ')';
            $sipplayer = $sippoints;
            $optionstring = $optionstring . '<option selected value=' . $pid . '>' . $plname . ' ' . $pfname . '</option>';
        } else {
            $optionstring = $optionstring . '<option value=' . $pid . '>' . $plname . ' ' . $pfname . '</option>';
        }
    }
    #OpenTable();
    echo '<h3>Pers&ouml;nliche SSI +/- Tabelle</h1>' . "<p>Gew&uuml;nschten Spieler aussuchen. F&uuml;r diesen Spieler werden die SSI +/- gegen alle anderen Spieler berechnet, die bereits einen g&uuml;ltige SSI Wert besitzen. Die SSI Zahl ist vom Stichtag {$lastdate}.</p>";
    echo "<form action=\"?func=personal\" method=\"post\"><table><tr>" . '<td><select name=vpid>' . $optionstring . '</select></td>' . '<td>' . _button('SSI +/- Werte berechnen') . '</td>' . '</tr></table></form>';
    #CloseTable();
    if (strlen($strplayer) > 0) {
        echo "<h3>SSI Tabelle f&uuml;r {$strplayer}</h3>";
    } else {
        die("<i>Einen Spieler aussuchen und auf Berechnen klicken.</i>");
    }
    # // execute this block only if a player has been selected ..
    mysql_data_seek($trecords, 0);
    #// move record pointer
    $aTH = array('Status', 'Gegner', 'Wert', 'Verlieren', 'Gewinnen', 'Gewinnwahrscheinlichkeit');
    OpenTable();
    echo ArrayToTableHead($aTH);
    while (list($pid, $pfname, $plname, $psipstatus, $sippoints, $sipcount) = sql_fetch_row($trecords, $dbi)) {
        echo '<tr><td>';
        switch ($psipstatus) {
            case "0":
                echo $predpic;
                break;
            case "1":
                echo $porangepic;
                break;
            case "2":
                echo $pgreenpic;
                break;
        }
        echo '</td><td>' . $pfname . ' ' . $plname . '</td><td>' . number_format($sippoints, 2, '.', '') . '</td>';
        # calculate Player Loses //////////
        $valLost = ReturnSSIChangePlayer($sipplayer, $sippoints, 0);
        echo '<td><font color="red">-' . number_format($valLost, 2, '.', '') . '</font></td>';
        # calculate PLAYER Winner /////////
        $valWin = ReturnSSIChangePlayer($sipplayer, $sippoints, 1);
        $expWin = ReturnWinExpectancy($sipplayer, $sippoints);
        echo '<td>+' . number_format($valWin, 2, '.', '') . '</td><td>' . number_format($expWin, 2, '.', '') . '%</td></tr>';
    }
    echo '</table>';
    CloseTable();
}
Example #12
0
function _showallgroup($eventid)
{
    // this function returns the standings for the entire group a selected event is member of
    global $dbi, $event, $tdbg;
    $evgrp = $event['evtypecode_id'];
    $ES = DB_listEvents($dbi, 1, 0, '', $evgrp);
    $aTH = array('Team', 'Set+', 'Set-', 'Diff', 'Leg+', 'Leg-', 'Diff', 'Matches', 'Points');
    echo setPageTitle('Alle Tabellen der Liga Gruppe ' . $event['typdesc']);
    echo _tabellenav($eventid);
    OpenTable();
    foreach ($ES as $ev) {
        echo '<tr><td colspan="9" bgcolor="' . $tdbg . '">' . $ev[1] . '</td></tr>';
        echo ArrayToTableHead($aTH);
        // this is for point-standings
        if ($event['evtabpoints'] == 1) {
            $RS = DB_getTabelle($dbi, $ev[0], 0, 'point', 'small');
        }
        // this is for the set-standings
        if ($event['evtabsets'] == 1) {
            $RS = DB_getTabelle($dbi, $ev[0], 0, 'set', 'small');
        }
        //$fields=array(4,5,6,7,8,9,10,11,12);
        //$ROWS=RecordsetToDataTable($RS,$fields);
        $target = '';
        $ROWS = RecordsetToClickTable($RS, 4, $target, 1, 3);
        echo $ROWS;
    }
    CloseTable();
    echo '</div>';
}
Example #13
0
} else {
    $player_id = 0;
}
# this is either 'true' or 'undefined'
if (isset($_POST['mactive']) && strip_tags($_POST['mactive']) == 'true') {
    $m_active = 1;
} else {
    $m_active = 0;
}
/*
 * security check on the length of params ...
 */
if ($m_code > 0) {
    $type_comp = '=' . $m_code;
} else {
    $type_comp = '>0';
}
$dbi = sql_connect($dbhost, $dbuname, $dbpass, $dbname);
$RS = DB_listMemberShips($dbi, $player_id, $verein_id, $type_comp, $m_active, $m_realm);
if (sizeof($RS) > 2000) {
    die_red('Selection returns more than 2000 rows (' . sizeof($RS) . ')');
}
if (sizeof($RS) < 1) {
    die_green('Search criteria returns nothing ...');
}
$aTH = array('Verein', 'Meldeart', 'PassNr', 'Meldung Ende', 'Vorname', 'Nachname');
$ROWS = RecordsetToDataTable($RS, array(2, 3, 4, 5, 7, 8));
$HEAD = ArrayToTableHead($aTH);
header('Content-Type: application/html; charset=ISO-8859-1');
echo '<table class="tchild" id="tmembers" name="tmembers">' . $HEAD . $ROWS . '</table>';
debug('Search criteria returned ' . sizeof($RS) . ' records.');
Example #14
0
/**
*	purpose	this is the system outbox, all messages send by the system
*	params	
*	returns		HTML table with action buttons per row
*/
function _showOutbox()
{
    global $dbi, $usertoken;
    if ($usertoken['usertype_id'] < 5) {
        die_red('Err:Msg95:WrongUser');
    }
    $RS = DB_listMessage($dbi);
    $HEAD = '';
    $ROWS = '';
    $ROWS = RecordsetToDataTable($RS, array(1, 2, 3, 5, 6, 7, 8), array('delmessage', 'setmessage'), array(array(0), array(0)), array('Del', 'Chg'));
    $aTH = array('Status', 'Absender', 'Datum', 'Gruppe', 'Empf&auml;nger', 'Link', 'Nachricht', 'Aktion', 'Aktion');
    $HEAD = ArrayToTableHead($aTH);
    // OUTPUT //
    echo '<script type="text/javascript">$("#pagetitle").html("Outbox");</script>';
    echo '<div id=\'mailadm\'>';
    echo '<table><tr><td>' . _button('Send Pending Liga', 'msgsendall()') . '</td><td>' . _button('Purge All', 'delall()') . '</td></tr></table>';
    echo '</div>';
    echo OpenTable('maillist', 1);
    echo $HEAD . $ROWS;
    echo CloseTable(1);
}
Example #15
0
if (strlen($pass_nr) + strlen($last_name) < 4) {
    die('X');
}
$dbi = sql_connect($dbhost, $dbuname, $dbpass, $dbname);
$RS = DB_listPlayers($dbi, $player_id, $last_name, '', $pass_nr);
if (sizeof($RS) > 15) {
    debug('Selection returns more than 15 rows ...');
    return;
}
if (sizeof($RS) < 1) {
    debug('Search criteria returns nothing ...');
    return;
}
if ($team_id > 0) {
    // this is a lineup manipulation request ... override active field by Team_id into RecordSet
    $RSOUT = array();
    foreach ($RS as $R) {
        $r_out = $R;
        $r_out[1] = $team_id;
        $RSOUT[] = $r_out;
    }
} else {
    $RSOUT =& $RS;
}
// we return a table here + costum button box ..
$aTH = array('ID', 'Vorname', 'Nachname', '&Ouml;DSO', '&Ouml;DV', 'Wohnort', 'Aktion');
$strRET = '<table class=\'tchild\' id=\'qryresult\' name=\'qryresult\'>';
$strRET = $strRET . ArrayToTableHead($aTH);
$strRET = $strRET . RecordsetToDataTable($RSOUT, array(0, 2, 3, 4, 5, 7), array($client_action, 'chkplayerteam'), array(array(0, 1), array(0)), array($client_caption, 'Check'));
header('Content-Type: application/html; charset=ISO-8859-1');
echo $strRET . '</table>';
Example #16
0
/**
*	purpose:	render table with active memberships for specified player
* 	params:		player_id
*	returns:	TABLE
*/
function LSTable_PlayerActiveMemberShips($idname, $player_id)
{
    global $dbi;
    $ROWS = '';
    $HEAD = '';
    $RS = DB_listMemberShips($dbi, $player_id, 0, '>0', 1);
    $aTH = array('id', 'Verein', 'Art', 'PassNr', 'Ende', 'Vorname', 'Nachname', 'Aktion');
    $HEAD = ArrayToTableHead($aTH);
    $ROWS = RecordsetToDataTable($RS, array(0, 2, 3, 4, 5, 7, 8), array('memberedit', 'memberdel'), array(array(0, 6), array(0, 6)), array('Edit', 'Del'));
    return '<table class="tchild" id="' . $idname . '" name="' . $idname . '">' . $HEAD . $ROWS . '</table>';
}
Example #17
0
/**
*	purpose	security controlled membership listing + action buttons for non public access
*	params		
*	returns		HTML Table with rows
*/
function _listMemberShip($player_id, $verein_id, $mtype_id, $verband_ID, $m_active)
{
    global $dbi, $usertoken;
    /* create a meaningful type_comparison string */
    if ($mtype_id > 0) {
        $type_comp = '=' . $mtype_id;
    } else {
        die_red('Err157:MemberTypeRequired');
    }
    $RS = DB_listMemberShips($dbi, $player_id, $verein_id, $type_comp, $m_active, $verband_ID);
    if (sizeof($RS) > 2000) {
        die_red('Selection returns more than 2000 rows (' . sizeof($RS) . ')');
    }
    if (sizeof($RS) < 1) {
        die_green('Search criteria returns nothing ...');
    }
    /*
     * no actions for non-registermap members ...
     */
    if (sizeof($usertoken['registermap']) < 1) {
        $aTH = array('Verein', 'Meldeart', 'PassNr', 'Meldung Ende', 'ID', 'Vorname', 'Nachname');
        $ROWS = RecordsetToDataTable($RS, array(2, 3, 4, 5, 6, 7, 8));
    } else {
        $aTH = array('Verein', 'Meldeart', 'PassNr', 'Meldung Ende', 'ID', 'Vorname', 'Nachname', 'Aktion');
        $ROWS = RecordsetToDataTable($RS, array(2, 3, 4, 5, 6, 7, 8), array('playeredit', 'memberdel'), array(array(6), array(0, 6)), array('Edit Player', 'Del'));
    }
    $HEAD = ArrayToTableHead($aTH);
    $sum = '<div>Search criteria returned ' . sizeof($RS) . ' records.</div>';
    return $sum . '<table class="tchild" id="tmembers" name="tmembers">' . $HEAD . $ROWS . '</table>';
}
Example #18
0
/**
	# this calculates the ranking points of all players who belong
	# to a specific LEAGUE-Group $fedagroup FEDA (MIXED or DAMEN)
	# a) retrieve all legs belonging to this listnumber form all events for the specified period
	# b) check on legacy table and include data
	# v2.6 incl current league in report
	*	v3 changed to fit into ls_statsadmin - produce minimal output ...
	*	v4 changed and removed the team - event strings ...
	*			includes all events of this statgroup not only active events
	* v5  extended by the API_RS model
	* v5 reM: works only on 501 legs !!
	**/
function generateStaticFEDAStatisticEntries($feda_stat_group, $indexdate, $writeToDB = 'no')
{
    global $user, $dbi;
    $fromdate = fnc_date_calc($indexdate, -365);
    /*
     * Rangliste berechnet aus allen Spielen von $fromdate bis $indexdate
     * we query after all players from all events belonging to this statgroup ...
     * this returns really ALL players who have ever played in this group (active + non-active events ..)
     * No sense to include the teams+events here, since there could be multiple ...
     * this returns multiple records for each player ....
     */
    $RS = DB_listEventStatGroupPlayers($dbi, $feda_stat_group);
    $aTH = array("Vorname", "Nachname", "Scorezahl", "Checkzahl", "Gesamtzahl", "Legs", "Spiele");
    debug("Calculating actual stat values for " . count($RS) . " Players");
    OpenTable();
    echo ArrayToTableHead($aTH);
    foreach ($RS as $p) {
        #
        # get legs per player - calc - and sum up, att. here we can have multiple player entries
        #	the recordset is sorted by PID ...
        #
        $sumScore = 0;
        $sumCheck = 0;
        $CountScore = 0;
        $CountCheck = 0;
        $scoreindex = 0;
        $checkindex = 0;
        #######################
        # LEGACY data from pre system times
        #######################
        $legqry = "select lxid,lxdate,lxrscore,lxrest,lxrcheck from tbllegx where lxpid={$p['0']} and lxevlist={$feda_stat_group} and lxdate<'{$indexdate}' and lxdate>'{$fromdate}' and lxrscore>0 order by lxdate asc";
        $Lrecord = sql_query($legqry, $dbi);
        while (list($lxid, $lxdate, $lxrscore, $lxrest, $lxrcheck) = sql_fetch_row($Lrecord, $dbi)) {
            $idx = "";
            $idx = retFEDAIndexZahlperLeg(501, $lxrscore, $lxrest, $lxrcheck, $iTEST);
            list($a, $b, $c) = split(":", $idx);
            # values of -1 indicate failure
            if ($a > -1) {
                $sumScore = $sumScore + $a;
                $CountScore = $CountScore + 1;
            }
            if ($b > -1) {
                $sumCheck = $sumCheck + $b;
                $CountCheck = $CountCheck + 1;
            }
        }
        #######################
        # structured data from League-System
        #######################
        $LEGS = DB_listLegsFromPeriod($dbi, 0, 0, $feda_stat_group, $fromdate, $indexdate, $p[0]);
        #debug(count($LEGS));
        # lid,lroundscore,lscore,lroundcheck,gid,mid,mround,mdate ##
        $gamecount = 0;
        $lastgid = 0;
        foreach ($LEGS as $L) {
            if ($lastgid != $L[4]) {
                $gamecount = $gamecount + 1;
            }
            $idx = "";
            $idx = retFEDAIndexZahlperLeg(501, $L[1], 501 - $L[2], $L[3]);
            list($a, $b, $c) = split(":", $idx);
            # values of -1 indicate failure
            if ($a > -1) {
                $sumScore = $sumScore + $a;
                $CountScore = $CountScore + 1;
            }
            if ($b > -1) {
                $sumCheck = $sumCheck + $b;
                $CountCheck = $CountCheck + 1;
            }
            $lastgid = $L[4];
        }
        /*
         * calculate index by division with countvalues
         */
        if ($CountScore > 0) {
            $scoreindex = $sumScore / $CountScore;
        }
        if ($CountCheck > 0) {
            $checkindex = $sumCheck / $CountCheck;
        }
        /*
         * Finally Output into TABLEROW or OUTVAR
         */
        /*
         * V3.1 change, since we have ALL players here we have a lot of cases where no actual statval is compiled in this case its zero and
         * we cont store anything ..
         */
        if ($gamecount > 0) {
            echo "<tr><td>{$p['1']}</td><td>{$p['2']}</td><td>" . number_format($scoreindex, 2, '.', '') . "</td><td>" . number_format($checkindex, 2, '.', '') . "</td><td>" . number_format($scoreindex + $checkindex, 2, '.', '') . "</td><td>{$CountScore}</td><td>{$gamecount}</td></tr>";
            if ($writeToDB == 'yes') {
                $qry = "insert into tblstat(statid,statdate,statcode,statval,statpid,statgames,statlegs) values(0,'{$indexdate}',{$feda_stat_group}," . number_format($scoreindex + $checkindex, 2, '.', '') . ",{$p['0']},{$gamecount},{$CountScore})";
                $res = sql_query($qry, $dbi);
            }
        } else {
            echo "<tr style=\"color:#ff0000;\"><td>{$p['1']}</td><td>{$p['2']}</td><td>NO DATA</td><td>NO DATA</td><td>NO DATA</td><td></td><td></td></tr>";
        }
    }
    #//  END FOR EACH PLAYER
    CloseTable();
}
<?php

/**
 * 	file	:	showWFRequestHistory.php
*	purpose:	return request history DATA
* 	params:		wfid from WF
*	returns:	HTML Table
*/
foreach ($_POST as $secvalue) {
    if (eregi("<[^>]*script*\"?[^>]*>", $secvalue) or eregi("\\([^>]*.*\"?[^>]*\\)", $secvalue)) {
        die("X");
    }
}
require_once "../code/config.php";
require_once "../includes/sql_layer.php";
require_once "../theme/Lite/theme.php";
require_once "../lsdbcontroller.php";
require_once '../api_rs.php';
require_once '../api_format.php';
if (isset($_POST['wfid']) && is_numeric($_POST['wfid']) && $_POST['wfid'] != "undefined") {
    $wfid = $_POST['wfid'];
} else {
    $wfid = 0;
}
$dbi = sql_connect($dbhost, $dbuname, $dbpass, $dbname);
$RS = DB_listWFRequestHistory($dbi, $wfid);
$aTH = array('ID', 'Request', 'Date', 'User', 'Status', 'Message');
$OUT = '<table>' . ArrayToTableHead($aTH);
$OUT = $OUT . RecordsetToDataTable($RS, array(0, 1, 2, 3, 4, 5));
header('Content-Type: application/html; charset=ISO-8859-1');
echo $OUT . '</table>';