Ejemplo n.º 1
0
function printRawReq($Str, $Msg)
{
    global $product_id_list;
    $Raw = getRaw($Str);
    if ($Raw[0] == 0) {
        return;
    }
    echo $Msg;
    echo "<div style='width: 100%'><table align=left>";
    $i = 0;
    foreach ($product_id_list as $p_id => $p_name) {
        if ($Raw[$p_id] == 0) {
            continue;
        }
        if ($i == 0) {
            echo '<tr>';
        }
        echo "<td align=right width=60>{$p_name}:&nbsp;</td><td width=40>{$Raw[$p_id]} 個</td>";
        if ($i == 1) {
            echo '</tr>';
            $i = 0;
        } else {
            $i++;
        }
    }
    echo "</table></div>";
}
Ejemplo n.º 2
0
function printBPTable($Bin, $pIdList)
{
    //$Bin: 1 Based Array, 21 should be Raw Materials
    $format = "<tr><td style='width: 5%%;'>%d:</td><td style='width: 45%%; text-align: center;'>%s</td><td style='width: 5%%;'>%d:</td><td style='width: 45%%; text-align: center;'>%s</td></tr>";
    $formatb = "<tr><td style='width: 45%%; text-align: center;' colspan=2>%s</td><td style='width: 45%%; text-align: center;' colspan=2>%s</td></tr>";
    echo "<table style='width: 75%; text-align: center;' align=center>";
    echo "<tr><td colspan=4 style='font-weight: Bold;'>藍圖:</td></tr>";
    for ($i = 1; $i <= 10; $i++) {
        $a = $Bin[$i] ? getWeaponName($Bin[$i]) : '沒有';
        $b = $Bin[$i + 10] ? getWeaponName($Bin[$i + 10]) : '沒有';
        printf($format, $i, $a, $i + 10, $b);
    }
    echo "<tr><td colspan=4 style='font-weight: Bold;'>原料: </td></tr>";
    $raws = getRaw($Bin[21]);
    for ($i = 1; $i <= 4; $i++) {
        $a = $pIdList[$i] . ": " . $raws[$i];
        $b = $pIdList[$i + 4] . ": " . $raws[$i + 4];
        printf($formatb, $a, $b);
    }
    echo "</table>";
}
Ejemplo n.º 3
0
     $SafeOUT = explode('<#>', $Bank['sh_outb']);
     $OutS = 'sh_outb';
 } elseif ($actionc == 'c') {
     $SafeOUT = explode('<#>', $Bank['sh_outc']);
     $OutS = 'sh_outc';
 } else {
     echo "抱歉, 未能找到需要的資訊。1";
     postFooter();
     exit;
 }
 if (!$SafeOUT || !$SafeOUT[0] || !$SafeOUT[2] || !$SafeOUT[3]) {
     echo "<center>抱歉, 未能找到需要的資訊。2";
     postFooter();
     exit;
 }
 $Raw = getRaw($SafeOUT[4]);
 $Storage = getMiningStorage($Game['username']);
 $sqlStorage = array();
 $SQL_Format = 'UPDATE `' . $GLOBALS['DBPrefix'] . 'phpeb_mining_storage` SET `quantity` = %d WHERE `m_store_user` = \'%s\' AND `item` = %d ;';
 $j = 0;
 if ($Raw[0] > 0) {
     for ($i = 1; $i <= 8; $i++) {
         if ($Raw[$i] > 0) {
             $Storage[$i] += $Raw[$i];
             //SQL to Update Offeree's Storage
             $sqlStorage[$j] = sprintf($SQL_Format, $Storage[$i], $Game['username'], $i);
             $j++;
         }
     }
 }
 if ($SafeOUT[2] != '0<!>0') {
Ejemplo n.º 4
0
<?php

include 'getData.php';
$move_url = $_GET['move_url'];
$output = getRaw("http://pokeapi.co/" . $move_url);
$move_data_raw = parseJSON($output, '');
$move_name = $move_data_raw['name'];
?>

<!DOCTYPE html> 
<html>
<head>
	<title><?php 
echo ucfirst($move_name) . "Pokemon Database";
?>
></title>
	<link rel="stylesheet" type="text/css" href="style/style.css" />
	<meta charset="UTF-8">
</head>
<body>

	<?php 
include 'navbar.php';
echo "<h1>" . $move_name . "</h1>";
echo $move_data_raw['description'];
echo "<div class='attr_title'>";
echo "<table>";
echo "<tr>";
echo "<th>Power</th>";
echo "<td>" . $move_data_raw['power'] . "</td>";
echo "</tr>";
Ejemplo n.º 5
0
         if ($TactFactory[$mc] != $Tacticals[$mc]) {
             $WrongFlag = true;
             break;
         }
     }
     //Analysed right or wrong
     if (!$WrongFlag) {
         $ChosenTact = $Tacticals['wep_id'];
         $RawReq = $Tacticals['raw_materials'];
         break;
         // Prevent Further Analysis
     }
 }
 //Analysed attempt tact/weapon ID
 //Analyse Sufficiency of Raw Materials
 $RawReqs = getRaw($RawReq);
 if ($RawReqs[0] > 0) {
     if ($raw[0] <= 0) {
         $ChosenTact = 0;
     } else {
         for ($i = 1; $i <= 8; $i++) {
             if ($raw[$i] < $RawReqs[$i]) {
                 $ChosenTact = 0;
                 break;
             }
         }
     }
 }
 //Grant Chosen Weapon
 if ($ChosenTact) {
     $sql = "UPDATE `" . $GLOBALS['DBPrefix'] . "phpeb_user_game_info` SET `{$TargetGrant}` = '" . $ChosenTact . "<!>0' WHERE `username` = '{$Pl_Value['USERNAME']}' LIMIT 1;";