plugin upload
This commit is contained in:
parent
00e60ec1b7
commit
c4905e952e
17 changed files with 1426 additions and 0 deletions
|
|
@ -0,0 +1,44 @@
|
|||
<?php
|
||||
// templates/datacenter-calculator.php
|
||||
$power_kw = isset($_POST['power_kw']) ? floatval($_POST['power_kw']) : 10;
|
||||
$cost_per_kwh = isset($_POST['cost_per_kwh']) ? floatval($_POST['cost_per_kwh']) : 0.1;
|
||||
$rack_space = isset($_POST['rack_space']) ? intval($_POST['rack_space']) : 5;
|
||||
|
||||
$datacenter_results = maple_calculate_datacenter($power_kw, $cost_per_kwh, $rack_space);
|
||||
?>
|
||||
<div class="maple-calc datacenter-calculator <?php echo isset($attributes['align']) ? 'align' . esc_attr($attributes['align']) : 'alignnone'; ?>">
|
||||
<h2>Data Center Costs Calculator</h2>
|
||||
<form method="post">
|
||||
<div class="form-group">
|
||||
<label for="power_kw">Power Usage (kW):</label>
|
||||
<input type="number" step="0.01" id="power_kw" name="power_kw" value="<?php echo isset($_POST['power_kw']) ? esc_attr($_POST['power_kw']) : '10'; ?>" required>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="cost_per_kwh">Cost per kWh ($):</label>
|
||||
<input type="number" step="0.01" id="cost_per_kwh" name="cost_per_kwh" value="<?php echo isset($_POST['cost_per_kwh']) ? esc_attr($_POST['cost_per_kwh']) : '0.1'; ?>" required>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="rack_space">Rack Space (units):</label>
|
||||
<input type="number" id="rack_space" name="rack_space" value="<?php echo isset($_POST['rack_space']) ? esc_attr($_POST['rack_space']) : '5'; ?>" required>
|
||||
</div>
|
||||
<button type="submit" class="calculate-button">Calculate</button>
|
||||
</form>
|
||||
|
||||
<?php if (isset($datacenter_results)): ?>
|
||||
<div class="results">
|
||||
<h3>Results</h3>
|
||||
<p><strong>Power Cost (Monthly):</strong> $<?php echo esc_html($datacenter_results['power_cost_per_month']); ?></p>
|
||||
<p><strong>Cooling Cost (Monthly):</strong> $<?php echo esc_html($datacenter_results['cooling_cost_per_month']); ?></p>
|
||||
<p><strong>Rack Cost (Monthly):</strong> $<?php echo esc_html($datacenter_results['rack_cost_per_month']); ?></p>
|
||||
<p><strong>Total Monthly Cost:</strong> $<?php echo esc_html($datacenter_results['total_monthly_cost']); ?></p>
|
||||
<p><strong>Total Annual Cost:</strong> $<?php echo esc_html($datacenter_results['total_annual_cost']); ?></p>
|
||||
<div class="chart-container">
|
||||
<canvas class="datacenter-chart"
|
||||
data-power="<?php echo esc_attr($datacenter_results['power_cost_per_month']); ?>"
|
||||
data-cooling="<?php echo esc_attr($datacenter_results['cooling_cost_per_month']); ?>"
|
||||
data-rack="<?php echo esc_attr($datacenter_results['rack_cost_per_month']); ?>">
|
||||
</canvas>
|
||||
</div>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
Loading…
Add table
Add a link
Reference in a new issue