コード例 #1
0
ファイル: payver.php プロジェクト: Britgo/Online-League
include 'php/checklogged.php';
include 'php/opendatabase.php';
include 'php/club.php';
include 'php/rank.php';
include 'php/player.php';
include 'php/team.php';
include 'php/teammemb.php';
// This is the module called when all goes OK with the initial transaction, we need to get details of the
// transaction from Paypal and set up to call the final confirmation.
function apiapp(&$arr, $k, $v)
{
    array_push($arr, "{$k}={$v}");
}
try {
    $player = new Player();
    $player->fromid($userid);
} catch (PlayerException $e) {
    $mess = $e->getMessage();
    include 'php/wrongentry.php';
    exit(0);
}
$ind = $_GET["ind"];
$tok = $_GET["token"];
if (strlen($ind) == 0 || strlen($tok) == 0) {
    $mess = "No indicator given ind={$ind} tok={$tok}???";
    include 'php/wrongentry.php';
    exit(0);
}
$ret = mysql_query("select league,descr1,descr2,token,amount from pendpay where ind={$ind}");
if (!$ret) {
    $mess = mysql_error();
コード例 #2
0
ファイル: dispmessage.php プロジェクト: Britgo/Online-League
$gid = $row["gameind"];
$subj = $row["subject"];
$hsubj = htmlspecialchars($subj);
$hasr = $row["hasread"];
$cont = $row["contents"];
try {
    $fp = new Player();
    $fp->fromid($fu);
} catch (PlayerException $e) {
    $mess = "Unknown sender id {$fu}";
    include 'php/wrongentry.php';
    exit(0);
}
try {
    $tp = new Player();
    $tp->fromid($tu);
} catch (PlayerException $e) {
    $mess = "Unknown recipient id {$tu}";
    include 'php/wrongentry.php';
    exit(0);
}
if (!$hasr && !$sent) {
    mysql_query("update message set hasread=1 where ind={$messid}");
}
if (preg_match("/(\\d+)-(\\d+)-(\\d+)\\s+(\\d+):(\\d+):(\\d+)/", $cr, $matches)) {
    $dat = $matches[3] . '/' . $matches[2] . '/' . $matches[1];
    $tim = $matches[4] . ':' . $matches[5] . ':' . $matches[6];
} else {
    $dat = $tim = $cr;
}
if ($mid != 0) {
コード例 #3
0
ファイル: messages.php プロジェクト: Britgo/Online-League
function listmessages($userid, $sent)
{
    if ($sent) {
        $searchid = 'touser';
        $fetchid = 'fromuser';
        $msgt = "Sent";
        $fl = "&sent=y";
        $th = "To";
    } else {
        $searchid = 'fromuser';
        $fetchid = 'touser';
        $msgt = "Received";
        $fl = "";
        $th = "From";
    }
    print "<h1>{$msgt} messages</h1>";
    $Sun = mysql_real_escape_string($userid);
    $ret = mysql_query("select {$searchid},created,matchind,gameind,subject,hasread,ind from message where {$fetchid}='{$Sun}' order by created,subject");
    if (!$ret || mysql_num_rows($ret) == 0) {
        print "<p>No messages found.</p>\n";
    } else {
        print <<<EOT
<table class="resultsb">
<tr>
\t<th>{$th}</th>
\t<th>Date</th>
\t<th>Time</th>
\t<th>Match</th>
\t<th>Game</th>
\t<th>Subject</th>
EOT;
        while ($row = mysql_fetch_assoc($ret)) {
            $fu = $row[$searchid];
            $cr = $row["created"];
            $mid = $row["matchind"];
            $gid = $row["gameind"];
            $subj = $row["subject"];
            $qsubj = htmlspecialchars($subj);
            $hasr = $row["hasread"];
            $ind = $row["ind"];
            $fp = new Player();
            $fp->fromid($fu);
            $pre = $post = "";
            if (!$hasr) {
                $pre = "<strong>";
                $post = "</strong>";
            }
            if (preg_match("/(\\d+)-(\\d+)-(\\d+)\\s+(\\d+):(\\d+):(\\d+)/", $cr, $matches)) {
                $dat = $matches[3] . '/' . $matches[2] . '/' . $matches[1];
                $tim = $matches[4] . ':' . $matches[5] . ':' . $matches[6];
            } else {
                $dat = $tim = $cr;
            }
            $am = $mid == 0 ? "-" : "About match";
            $ag = $gid == 0 ? "-" : "About game";
            print <<<EOT
<tr>
\t<td>{$pre}{$fp->display_name()}{$post}</td>
\t<td>{$pre}{$dat}{$post}</td>
\t<td>{$pre}{$tim}{$post}</td>
\t<td>{$pre}{$am}{$post}</td>
\t<td>{$pre}{$ag}{$post}</td>
\t<td><a href="dispmessage.php?msgi={$ind}{$fl}">{$pre}{$qsubj}{$post}</a></td>
</tr>

EOT;
        }
        print "</table>\n";
    }
}
コード例 #4
0
ファイル: sendreply.php プロジェクト: Britgo/Online-League
}
$messid = $_POST["msgi"];
$mid = $_POST["mi"];
$gid = $_POST["gn"];
$subj = $_POST["subject"];
$msgt = $_POST["mcont"];
$ret = mysql_query("select fromuser from message where ind={$messid}");
if (!$ret || mysql_num_rows($ret) == 0) {
    $mess = "Cannot find mess id {$messid}";
    include 'php/wrongentry.php';
    exit(0);
}
$row = mysql_fetch_array($ret);
$recipid = $row[0];
$recip = new Player();
$recip->fromid($recipid);
$qfrom = mysql_real_escape_string($player->Userid);
$qto = mysql_real_escape_string($recipid);
$qsubj = mysql_real_escape_string($subj);
$qmsgt = mysql_real_escape_string($msgt);
mysql_query("insert into message (fromuser,touser,created,gameind,matchind,subject,contents) values ('{$qfrom}','{$qto}',now(),{$gid},{$mid},'{$qsubj}','{$qmsgt}')");
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<?php 
$Qun = htmlspecialchars($username);
$Sun = mysql_real_escape_string($userid);
$Title = "Reply Sent";
include 'php/head.php';
?>
<body>
コード例 #5
0
ファイル: osmatches.php プロジェクト: Britgo/Online-League
include 'php/team.php';
include 'php/match.php';
include 'php/matchdate.php';
include 'php/game.php';
include 'php/params.php';
include 'php/hcp_message.php';
$asuser = $userid;
if ($admin && strlen($_GET["asuser"]) != 0) {
    $asuser = $_GET["asuser"];
}
// Get parameters to include handicap info
$pars = new Params();
$pars->fetchvalues();
$player = new Player();
try {
    $player->fromid($asuser);
} catch (PlayerException $e) {
    $mess = $e->getMessage();
    include 'php/wrongentry.php';
    exit(0);
}
// Get the teams this player is captain of
try {
    $captain_of = list_teams_captof($player);
} catch (TeamException $e) {
    $mess = $e->getMessage();
    include 'php/wrongentry.php';
    exit(0);
}
$unalloc_matches = array();
$oppunalloc_matches = array();
コード例 #6
0
ファイル: rempwbyuid.php プロジェクト: Britgo/Online-League
//   (at your option) any later version.
//   This program is distributed in the hope that it will be useful,
//   but WITHOUT ANY WARRANTY; without even the implied warranty of
//   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
//   GNU General Public License for more details.
//   You should have received a copy of the GNU General Public License
//   along with this program.  If not, see <http://www.gnu.org/licenses/>.
// This is invoked from a subwindow so we don't do the frame emulation stuff.
include 'php/session.php';
include 'php/opendatabase.php';
include 'php/rank.php';
include 'php/player.php';
include 'php/club.php';
try {
    $player = new Player();
    $player->fromid($_GET['uid']);
} catch (PlayerException $e) {
    $mess = $e->getMessage();
    include 'php/wrongentry.php';
    exit(0);
}
$em = $player->Email;
$pw = $player->get_passwd();
if (strlen($em) == 0) {
    $Title = "No email address";
    $Mess = "Player {$player->display_name(false)} has no email address set up.";
} elseif (strlen($pw) == 0) {
    $Title = "No password";
    $Mess = "Player {$player->display_name(false)} has no password set.";
} else {
    $Title = "Reminder sent";