/** * purpose: typical child table, listing of all active teams for a specific Player * params: player * returns: HTML Table */ function LSTable_PlayerToTeams($idname, $player_id, $btnCaption = '', $btnAction = '') { global $dbi; $ROWS = ''; $HEAD = ''; $RS1 = DB_listEventWFTeamPlayers($dbi, 1, $player_id); $RS2 = DB_listEventTeamWFPlayers($dbi, 1, $player_id); $RS3 = DB_listEventTeamPlayers($dbi, '', 0, '', 0, '', 1, 0, 'team', '', $player_id); $RS = array_merge($RS1, $RS2); $RS = array_merge($RS, $RS3); if (!sizeof($RS) > 0) { $ROWS = '<tr><td><font color=green>Keine Mannschaftsmeldungen für Spieler:' . $player_id . '</font></td></tr>'; } else { $aTH = array('LigaGruppe', 'Bewerb / Liga', 'Saison', 'Teamname', 'Vorname', 'Nachname'); if (strlen($btnAction) > 1) { $aTH[] = 'Aktion'; } $HEAD = ArrayToTableHead($aTH); if (strlen($btnAction) > 1) { $ROWS = RecordsetToDataTable($RS, array(1, 3, 4, 6, 8, 9), array($btnAction), array(array(7)), array($btnCaption)); } else { $ROWS = RecordsetToDataTable($RS, array(1, 3, 4, 6, 8, 9)); } } return '<table class="tchild" id="' . $idname . '" name="' . $idname . '">' . $HEAD . $ROWS . '</table>'; }
$event_active = strip_tags($_POST['eventactive']); } else { $event_active = 1; } if (isset($_POST['vereinid']) && intval($_POST['vereinid']) > 0) { $verein_id = strip_tags($_POST['vereinid']); } else { $verein_id = 0; } if (isset($_POST['paction']) && $_POST['paction'] != "undefined") { $client_action = strip_tags(urldecode($_POST['paction'])); } else { $client_action = ""; } $dbi = sql_connect($dbhost, $dbuname, $dbpass, $dbname); $RS = DB_listEventTeamPlayers($dbi, $event_type_id, $event_stat_id, $event_type_name, $event_id, $event_name, $event_active, $verein_id, 'team'); if (sizeof($RS) < 1) { debug("Search criteria returns nothing ..."); return; } // we return a table here + costum button box .. $strRET = "<table class=\"tchild\" id=\"qryresult\" name=\"qryresult\">"; foreach ($RS as $a) { $strRET = $strRET . "<tr>"; foreach ($a as $val) { $strRET = $strRET . "<td class=\"dcell\">" . $val . "</td>"; } if (strlen($client_action) > 1) { $strRET = $strRET . "<td class=\"dcell\"><button id=\"" . $a[7] . "\" onClick=\"{$client_action}(this," . $a[2] . ")\">Detail</button></td>"; } else { $strRET = $strRET . "</tr>";
function _showWonLostStat($eventid) { // simple WON / LOST statistic per team - per player for an event // this is valid for all events , even without legdata ... // A ListAllPlayers // B RenderGraphRow per Player global $dbi, $tdbg, $tdLost, $tdWon, $event; echo _MakeStatPageHeader($eventid, 0); # read event configuration singles ...and determine when a game is won ... $WonOUT = intval($event['evsgllegs'] / 2) + 1; $RP = DB_listEventTeamPlayers($dbi, '', 0, '', $eventid); // for each Player(7,8,9): $max = 400; $factor = 10; echo '<table width="100%">'; foreach ($RP as $R) { echo '<tr><td>' . $R[8] . '</td><td>' . $R[9] . '</td><td><table width="' . $max . 'px" cellspacing=0><tr>'; $RES = DB_retPlayerWonLostNumbers($dbi, $eventid, $R[7]); foreach ($RES as $V) { switch ($V[3]) { case 0: $color = '#FF0000'; break; case $WonOUT - 2: $color = '#CC5500'; break; case $WonOUT - 1: $color = '#AAAA00'; break; case $WonOUT: $color = '#00FF00'; break; } echo '<td width="' . $V[4] * $factor . 'px" bgcolor="' . $color . '">' . $V[4] . '</td>'; } echo '</tr></table></td></tr>'; } echo '</table>'; }
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ürfen so werden sie auch 2x angezeigt. Der Stichtag fü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>"; }