예제 #1
0
/**
*	purpose:	returns player names from DB in select box
* 	params:		default name = vpid, default selected = pid=0
*	returns:	HTML select box
* 	webservice:	snippets/retPlayerSelect.php
*/
function Select_Player($name_id = 'vpid', $pidsel = 0)
{
    global $dbi, $user;
    $RS = DB_listPlayers($dbi);
    # we return -- pid,pfname,plname,pfkey1 --
    $SEL = RecordsetToSelectOptionList($RS, array(0, 3, 2, 4), $name_id, $pidsel);
    return $SEL;
}
예제 #2
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));
}
예제 #3
0
} else {
    $client_action = '';
}
if (isset($_POST['pcaption']) && $_POST['pcaption'] != 'undefined') {
    $client_caption = strip_tags(utf8_decode(urldecode($_POST['pcaption'])));
} else {
    $client_caption = 'Add';
}
/*
 * security check on the length of params ...
 */
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;