function _saveComment($match_key, $match_comment) { global $dbi; $qry1 = 'UPDATE tblmatch set mcomment=\'' . $match_comment . '\' where mkey=\'' . $match_key . '\' limit 1'; $p1 = sql_query($qry1, $dbi); if ($p1 == 1) { die_green('Saved'); } else { die_red('Error'); } }
/** * 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>'; }
} 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.');