function _schedule($eventid) { /* # // display nice schedule for an event - the list is clickable and leads to detailed matchresult / matchsheets # // sort order is done by the HOME / away flags of tblmatchteam # // works perfect v2 using the mkey as match link # // shows status ICON Green =0 OK, orange=1 part missing, red=0 all missing # // change v2 - user sees values only - rowclick takes user to matchdetails # // admins have no rowclick but 2 Buttons - save result - edit details * v4 ==> admin save btn is a POST back , response is entire MatchRow. */ global $dbi, $sctdcolor, $redpic, $greenpic, $orangepic, $bluepic, $greencrosspic, $event, $LS_LEVEL; if (!$eventid > 0) { die('E:LSDB1:NoEventSelected'); } if ($LS_LEVEL > 1) { echo '<script type=\'text/javascript\' src=\'code/MatchCode.js\'></script>'; } echo setPageTitle('Spielplan ' . $event['evname']); echo '<div id=\'maincontent\'>'; echo '<p>Jedes Match in diesem Spielplan funktioniert als Hyperlink und zeigt den detailierten Spielbericht an.</p>'; $sSQL = 'SELECT mid,mkey,mround,mdate,mlocation,mstatus,mthome,mtlegs,mtsets,T.id,T.tname, M.mcomment' . ' FROM tblevent E,tblmatch M,tblmatchteam MT,tblteam T' . ' WHERE E.ID=' . $eventid . ' AND E.ID=M.mevid and M.MKEY=MT.MTMKEY and MT.MTTID=T.ID' . ' ORDER by M.MROUND,M.MKEY,MT.MTHOME desc'; $precord = sql_query($sSQL, $dbi); $lastround = 0; $lastmid = 0; OpenTable(); while (list($mid, $mkey, $mround, $mdate, $mlocation, $mstatus, $mthome, $mvlegs, $mvsets, $tid, $tname, $mcomment) = sql_fetch_row($precord, $dbi)) { $jumptarget = 'ls_system.php?func=showmatch&vmkey=' . $mkey . '&eventid=' . $eventid; if ($lastround != $mround) { echo _roundhead($mround, 10); } if ($lastmid != $mid) { #// Home TEAM if ($LS_LEVEL < 2) { // user view echo '<tr class="clickcell" onMouseOver="mover(this)" onMouseOut="mout(this)">'; } else { // admin view echo '<tr bgcolor="white"><td><div id="trm' . $mid . '" name="trm' . $mid . '"><table><tr>'; } echo '<td width="100px">'; echo _editable_date($mdate, $mid) . '</td><td width="140px" onclick=\'document.location="' . $jumptarget . '"\'>' . $mlocation . '</td>'; echo '<td width="120px" onclick=\'document.location="' . $jumptarget . '"\'>' . $tname . '</td>'; if ($LS_LEVEL > 1) { // admin controls echo '<td onclick=\'document.location="' . $jumptarget . '"\'>' . _input(0, 'mkey' . $mid, $mkey) . _input(1, 'sh' . $mid, $mvsets, 3, 2) . '</td>'; echo '<td onclick=\'document.location="' . $jumptarget . '"\'>' . _input(1, 'lh' . $mid, $mvlegs, 3, 2) . '</td>'; } else { echo '<td>' . _input(2, '', $mvsets, 2) . '</td>'; echo '<td>' . _input(2, '', $mvlegs, 3) . '</td>'; } echo '<td>:</td>'; } else { # // AWAY TEAM if ($LS_LEVEL > 1) { // admin controls echo '<td onclick=\'document.location="' . $jumptarget . '"\'>' . _input(1, 'sa' . $mid, $mvsets, 3, 2) . '</td>'; echo '<td onclick=\'document.location="' . $jumptarget . '"\'>' . _input(1, 'la' . $mid, $mvlegs, 3, 2) . '</td>'; } else { echo '<td>' . _input(2, '', $mvsets, 2) . '</td>'; echo '<td>' . _input(2, '', $mvlegs, 3) . '</td>'; } echo '<td width=120px onclick=\'document.location="' . $jumptarget . '"\'>' . $tname . '</td>'; echo '<td>'; echo matchStatusToImage($mstatus); echo '</td>'; if ($LS_LEVEL > 1) { // admin controls // '<image src=\'images/save.png\' align=\'left\'>' '<image src=\'images/detail.png\' align=\'left\'>' echo '</tr></table></div></td>'; echo '<td>' . _imgButton('save', 'saveMatch(' . $mid . ')') . '</td>'; echo '<td><form action=\'ls_system.php\' method=\'post\'>' . _input(0, 'func', 'showmatch') . _input(0, 'vmkey', $mkey) . _input(0, 'eventid', $eventid) . _button('Detail') . '</form></td>'; } echo '<tr><td colspan="3" align="center">' . $mcomment . '</td></tr>'; echo '</tr><tr><td colspan="10" align="right"><div id="msg' . $mid . '"></div></td></tr>'; } $lastround = $mround; $lastmid = $mid; } CloseTable(); echo '</div>'; #close maincontent-DIV }
/** * purpose: fetch a complete match -> render as schedule ROW+active input boxes * params: match_key * returns: HTML TABLE * security: none -> public result view .... */ function _getMatchRow($match_key) { global $dbi; $RS = DB_listMatches($dbi, 1, 0, 0, '', '', '', '', 'logic', $match_key); if (!sizeof($RS) == 1) { die_red('E119:Match:Match not found'); } /* * structure = array 5 -> 13, identical to schedule Page,$R[2]= match ID */ foreach ($RS as $R) { $ROW = '<tr><td width="80px">' . $R[5] . '</td><td width="140px">' . $R[6] . '</td><td width="120px">' . $R[7] . '</td><td>' . _input(0, 'mkey' . $R[2], $match_key) . _input(1, 'sh' . $R[2], $R[8], 3, 2) . '</td><td>' . _input(1, 'lh' . $R[2], $R[9], 3, 2) . '</td>' . '<td>:</td><td>' . _input(1, 'sa' . $R[2], $R[10], 3, 2) . '</td><td>' . _input(1, 'la' . $R[2], $R[11], 3, 2) . '</td><td width="120px">' . $R[12] . '</td><td>' . matchStatusToImage($R[13]) . '</td></tr>'; } return '<table>' . $ROW . '</table>'; }