echo $itemName; ?> " data-content="<?php echo htmlspecialchars($mouseoverText); ?> "><?php echo $itemName; ?> </a> </td> <td class="<?php echo $class; ?> " align="right"> <?php echo formatAsISK($netIncome); ?> <form class="form-inline" style="display:inline" name="submitForm" method="POST" action="scenario.php"> <input type="hidden" name="re" value="<?php echo $reactionID; ?> "> <input type="image" src="include/images/report.svg" width="16" height="16"> </form> <form class="form-inline" style="display:inline" name="submitForm" method="POST" action="history.php"> <input type="hidden" name="re" value="<?php echo $reactionID; ?> "> <input type="image" src="include/images/graph.svg" width="16" height="16"> </form>
public function generateIncomeStatement() { switch ($this->timeframe) { case "d": $timeframeStr = "Daily"; break; case "w": $timeframeStr = "Weekly"; break; case "m": $timeframeStr = "Monthly"; break; } $reactionType = $this->reaction->getReactionType(); if ($this->chain) { if ($reactionType == 1) { $this->chain = 0; } else { $chainStr = " Chain"; } } $numCycles = $this->calc->getNumCycles(); $numTowers = $this->calc->getNumTowers(); $revenue = $this->calc->getHourlyRevenue(); $totalIncome = $revenue; $inputCost = $this->calc->getHourlyInputCost(); $inputVolume = round($this->calc->getHourlyInputVolume()); $outputVolume = round($this->calc->getHourlyOutputVolume()); $fuelBlock = $this->factory->create(ObjectFactory::TYPE, $this->dbMgr->getFuelBlockID($this->race)); $fuelBlockName = $fuelBlock->getName(); $fuelVolume = $this->calc->getHourlyFuelVolume(); $fuelCost = $this->calc->getHourlyFuelCost(); $inputBrokerFee = 0; if ($this->inputPrice == "b") { $inputBrokerFee = $inputCost * $this->brokerFee; } $outputBrokerFee = 0; if ($this->outputPrice == "s") { $outputBrokerFee = $revenue * $this->brokerFee; } $fuelBrokerFee = 0; if ($this->fuelPrice == "b") { $fuelBrokerFee = $fuelCost * $this->brokerFee; } $gsfMoonTax = 0; if ($this->gsf) { $gsfMoonTax = 1000000 / 24 * ceil($numTowers); } $outputSalesTax = $revenue * $this->salesTax; $totalTaxAndFees = $inputBrokerFee + $fuelBrokerFee + $outputBrokerFee + $outputSalesTax + $gsfMoonTax; $totalShipping = round(($inputVolume + $outputVolume + $fuelVolume) * 300); $totalExpenses = $inputCost + $fuelCost + $totalShipping; $profit = $totalIncome - ($totalExpenses + $totalTaxAndFees); $profitMargin = round($profit / $totalIncome, 4) * 100; echo "<table class=\"table table-condensed table-striped table-bordered\">"; echo "<thead>"; echo "<tr><th colspan='2'>Revenue</th></tr></thead>"; echo "<tbody><tr><td>Production</td><td style=\"text-align:right\">" . formatAsISK($revenue * $numCycles) . "</td></tr>"; echo "<tr><th>Total Revenue</th><th style=\"text-align:right\">" . formatAsISK($totalIncome * $numCycles) . "</th></tr></tbody>"; echo "<thead><tr><th colspan='2'><b>Expenses</b></th></tr></thead>"; echo "<tbody><tr><td>{$fuelBlockName}s</td><td style=\"text-align:right\">" . formatAsISK($fuelCost * $numCycles) . "</td></tr>"; echo "<tr><td>Fuel Block Shipping</td><td style=\"text-align:right\">" . formatAsISK($fuelVolume * $numCycles * 300) . "</td></tr>"; echo "<tr><td>Input Materials</td><td style=\"text-align:right\">" . formatAsISK($inputCost * $numCycles) . "</td></tr>"; echo "<tr><td>Input Shipping</td><td style=\"text-align:right\">" . formatAsISK($inputVolume * 300 * $numCycles) . "</td></tr>"; echo "<tr><td>Output Shipping</td><td style=\"text-align:right\">" . formatAsISK($outputVolume * 300 * $numCycles) . "</td></tr>"; echo "<tr><th>Total Expenses</th><th style=\"text-align:right\">" . formatAsISK($totalExpenses * $numCycles) . "</th></tr></tbody>"; echo "<thead><tr><th colspan='2' align=left><b>Sales Tax and Broker's Fees</b></th></tr></thead>"; if ($this->fuelPrice == "b") { echo "<tbody><tr><td>Fuel Block Broker's Fee (" . $this->brokerFee * 100 . "%)</td><td style=\"text-align:right\">" . formatAsISK($fuelBrokerFee * $numCycles) . "</td></tr>"; } if ($this->inputPrice == "b") { echo "<tr><td>Input Broker's Fee (" . $this->brokerFee * 100 . "%)</td><td style=\"text-align:right\">" . formatAsISK($inputBrokerFee * $numCycles) . "</td></tr>"; } if ($this->outputPrice == "s") { echo "<tr><td>Output Broker's Fee (" . $this->brokerFee * 100 . "%)</td><td style=\"text-align:right\">" . formatAsISK($outputBrokerFee * $numCycles) . "</td></tr>"; } echo "<tr><td>Output Sales Tax (" . $this->salesTax * 100 . "%)</td><td style=\"text-align:right\">" . formatAsISK($outputSalesTax * $numCycles) . "</td></tr>"; if ($this->gsf) { echo "<tr><td>GSF Moon Tax</td><td style=\"text-align:right\">" . formatAsISK($gsfMoonTax * $numCycles) . "</td></tr>"; } echo "</tbody><thead><tr><th>Total Tax and Fees</th><th style=\"text-align:right\">" . formatAsISK($totalTaxAndFees * $numCycles) . "</th></tr>"; if ($profitMargin >= 10) { $class = "success"; } else { if ($profitMargin > 0) { $class = "warning"; } else { $class = "danger"; } } echo "<tr><th align=left>Profit</th><th class='{$class}' style=\"text-align:right\">" . formatAsISK($profit * $numCycles) . "</th></tr>"; echo "<tr><th align=left>Profit Margin</th><th class='{$class}' style=\"text-align:right\">{$profitMargin}%</th></tr></thead>"; echo "</table>"; }