コード例 #1
0
ファイル: content.php プロジェクト: bjh7242/ISTS14-Stuff
function get_content($page)
{
    if (!isset($page)) {
        $page = "";
    }
    switch ($page) {
        case 'transfer_money':
            transfer_money();
            break;
        case 'transaction_history':
            transaction_history();
            break;
        case 'schedule_transfer':
            schedule_transfer();
            break;
        case 'check_transfer_schedule':
            check_transfer_schedule();
            break;
        case 'change_pin':
            change_pin();
            break;
        default:
            echo "Please Select Choice.";
    }
}
コード例 #2
0
ファイル: fight.php プロジェクト: dapfru/gladiators
 }
 $score1 = reset($ar[Score]);
 $score2 = next($ar[Score]);
 if ($score1 > $score2) {
     transfer_money($ar[Money], 1, $user1, 26, $id);
     $rst1[Win]++;
     $rst2[Lose]++;
 } elseif ($score1 < $score2) {
     transfer_money($ar[Money], 1, $user2, 26, $id);
     $rst2[Win]++;
     $rst1[Lose]++;
 } else {
     $rst1[Tie]++;
     $rst2[Tie]++;
     transfer_money(round($ar[Money] / 2), 1, $user1, 26, $id);
     transfer_money(round($ar[Money] / 2), 1, $user2, 26, $id);
 }
 foreach ($ar[Gladiators] as $k => $v) {
     if ($v[Stamina] < 0) {
         $v[Stamina] = 0;
     }
     //print	"$k $v[Stamina] $v[Morale] $v[Injury] $v[Exp]<br>";
     if ($rst1[Gladiators][$k]) {
         $rst1[Gladiators][$k][Morale] = $v[Morale];
         $rst1[Gladiators][$k][Injury] = $v[Injury];
         $rst1[Gladiators][$k][Stamina] = $v[Stamina];
         $rst1[Gladiators][$k][Exp] += round($v[Exp], 3);
         //print "[$k][Morale]=$v[Morale]<br>";
         //print "[$k][Injury]=$v[Injury]<br>";
         //print "[$k][Stamina]=$v[Stamina]<br>";
         //print "[$k][Exp]=$v[Exp]<br>";
コード例 #3
0
ファイル: hippo.php プロジェクト: dapfru/gladiators
                $mes = icon("green", "Вы уже сделали ставку на этот заезд. Результаты гонки - через {$wait} минут.");
            } else {
                $mes = icon("green", "Заезд завершен.<a href=\"/xml/city/hippo.php\">Ознакомьтесь с результатами.</a>");
            }
        } else {
            $coef = explode("/", $q[Horses_Coefficients]);
            $koef = $coef[$num - 1];
            if (date("i", $q[Date]) == 30) {
                $wait = date("i", $q[Date]) - date("i", $tm);
            } else {
                $wait = 60 - date("i", $tm);
            }
            mysql_query("insert into ut_stakes(RaceID,UserID,Date,Sum,Coefficient,HorseNumber,Paid,IP)\n\t\t values('{$race}','{$auth->user}',unix_timestamp(),'{$sum}','{$koef}','{$num}','0','{$REMOTE_ADDR}')");
            $r1 = select("select StakeID from ut_stakes where UserID='{$auth->user}'");
            lock_rst($auth->user);
            transfer_money($sum, $auth->user, 1, 3, $r1[0]);
            unlock_rst($auth->user);
            $auth->rst = read_rst($auth->user);
            $mes = icon("green", "Ставка принята.");
        }
    }
}
require $site_path . "up.php";
require $site_path . "left.php";
?>
<center><img src="/images/art/hippo.jpg" width=500px height=300px></center>
<?php 
if ($mes) {
    print $mes;
}
$tm = time();
コード例 #4
0
ファイル: display.php プロジェクト: vooratarun/bank
    case "loan":
        loan();
        break;
    case "loan_money":
        loan_money();
        break;
    case "cloan":
        cloan();
        break;
    case "clear_loan":
        clear_loan();
        break;
    case "chacdetails":
        chacdetails();
        break;
    case "transaction":
        transaction();
        break;
    case "transfer_money":
        transfer_money();
        break;
    case "delete":
        delete();
        break;
    default:
        echo "wrong option";
}
?>
</body>
</html>
コード例 #5
0
ファイル: config.php プロジェクト: dapfru/gladiators
function sell_building($user, $id, $level, $price)
{
    global $REMOTE_ADDR;
    $q = select("select BuildingID, max(LeveL) from tm_buildings where BuildingID='{$id}' and UserID='{$user}' group by BuildingID");
    if ($q[1] != $level) {
        return 0;
    }
    if (!$id || !$level || !$user || !$price) {
        return 0;
    }
    lock_rst($user);
    transfer_money($price, 1, $user, 22, 0);
    runsql("delete from tm_buildings where BuildingID='{$id}' and Level='{$level}'  and UserID='{$user}'");
    unlock_rst($user);
}