<? $area='admin'; include ('include/functions.php');?>
<?
    $matchUser = new user();
    $matchUser->ersteller='0';


    /* get matching users */
    $myusers = $matchUser->getUsers($sortfield, $dir);

    $users = array();
    foreach ($myusers as $user)
    {
        if ( strtolower($user->email) != 'fake@fake.de')
        {
            array_push ($users, $user);
        }
       # else {
       #     echo $user->name . ", " . $user->email . "<br />\n";
       # }
    }
            


    echo "Anzahl: " . count($users) . "<br />\n";
    foreach ($users as $user)
    {
        echo "Name: " . $user->name . ", ";
        echo "Email: " . $user->email. "<br />\n";
        $descr= "Gutschrift für Anmeldung über das Internet";
        $user->konto = new konto($user->userId);
        $row = array();
        $row['userId'] = $user->userId;
        $row['datum'] = time();
        $row['beschreibung'] = $descr;
        $row['wert'] = 50;
        $kontoBewegung = new kontobewegung($row);
        $user->konto->addKontobewegung($kontoBewegung);
    }
?>
