Exemplo n.º 1
0
/**
*	purpose:	add a membership record into the LSDB for a specific player
* 	params:		player_id (LSDB) , request object
*	returns:	0/1
*/
function wf_add_MembershipForPlayer($player_id, $obj)
{
    // returns Membership_record_id
    if (!$obj['verein_id'] > 0) {
        return 0;
    }
    debug('Adding Player:' . $player_id . ' to Verein:' . $obj['verein_id'] . ' as Member:' . $obj['ttypemember_id']);
    global $dbi, $usertoken;
    $p = new cPlayer();
    $p->setDB($dbi);
    $p->getbyID($player_id);
    $p->saveMembershipVerein($obj['verein_id'], $obj['ttypemember_id']);
    #debug('PERR: '.$p->pError);
    if (strlen($p->pError) > 1) {
        debug($p->pError);
        return 0;
    } else {
        return 1;
    }
}
Exemplo n.º 2
0
<?php

/**
*	purpose:	test player.clss and XML generator
* 	params:		pid=<number>
*	returns:	XML player record
*/
require_once "../code/config.php";
require_once "../includes/sql_layer.php";
require_once "../ORM/player.php";
if (isset($_REQUEST['id']) && is_numeric($_REQUEST['id'])) {
    $p_id = strip_tags($_REQUEST['id']);
}
if (!isset($p_id)) {
    die('X2');
}
$dbi = sql_connect($dbhost, $dbuname, $dbpass, $dbname);
$p = new cPlayer();
$p->setDB($dbi);
$p->getbyID($p_id);
$p->aDATA['pupd_user'] = '******';
#$p->save();
header('Content-Type: application/xml; charset=ISO-8859-1');
echo $p->returnXML();
echo $p->pError;