-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathform.php
199 lines (174 loc) · 9.28 KB
/
form.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
<?php
require_once 'head.php';
function skillLevels($range, $name, $modifier, $initMod, $initDesc, $modType = '%', $override = null){
global $ghSkill, $director, $warfare, $capSkill, $ventureSkill;
echo "<select class='span1' name='".$name."' data-calc='".$name."Bonus' data-modifier='".$modifier."'>";
foreach ($range AS $i) {
echo " <option value='".$i."' ".($override !== null ? "data-override='".$override[$i-1]."' ":null). (${$name} == $i ? ' selected':null)." />".romanNumerals($i)."\n"; }
echo "</select> <small id='".$name."Bonus'><span>".$initMod."</span>".$modType." ".$initDesc."</small>";
}
?>
<script>
$(document).ready(function() {
// Custom DataTable Sorting
jQuery.extend( jQuery.fn.dataTableExt.oSort, {
"formatted-num-pre": function ( a ) {
a = (a==="-") ? 0 : a.replace( /[^\d\-\.]/g, "" );
return parseFloat( a );
},
"formatted-num-asc": function ( a, b ) {
return a - b;
},
"formatted-num-desc": function ( a, b ) {
return b - a;
}
} );
<?php if (strtolower($title) != 'wormhole'){ ?>
$('#siteTable').dataTable({
"bPaginate": false,
"bFilter": false,
"sDom": '<"top">rt<"bottom"flp><"clear">',
"aoColumns": [
null,
null,
null,
null,
{ "sType": 'formatted-num' },
{ "sType": 'formatted-num' },
{ "sType": 'formatted-num' },
{ "sType": 'formatted-num' },
{ "sType": 'formatted-num' }],
});
<?php } echo (!isset($_GET['frigate']) ? '$("#venture-inputs").hide();':null); ?>
/*
test capital ship selection, depending on which one, create data-modifier
on ship skill selection.
*/
$('#capShip').bind("change", function(){
var selected = $(this).find('option:selected');
$('#capSkill').data("modifier", selected.data('multiplier'));
// Update UI
$("#capSkill").trigger('change');
});
// !- Bind checkboxes to show more modifiers
$('input[type="checkbox"]').bind("change", function(){
if (typeof $(this).data('toggle') != 'undefined') {
if ($(this).is(":checked")) {
$("#"+$(this).data('toggle')).show(); }
else {
$("#"+$(this).data('toggle')).hide();
}
}
}).trigger('change');
// !- Selection modifier calculations
$("select").bind("change", function(){
var selected = $(this).find('option:selected');
if (typeof selected.data('override') != 'undefined'){
var update = parseFloat(selected.data('override')); }
else {
var modifier = parseFloat($(this).data('modifier'));
var update = $(this).val() * modifier; }
$("#"+$(this).data('calc')+" > span").text(update);
}).trigger('change');
});
</script>
<div class='wrapper'>
<h1 style='text-align: center;'><?php echo $title; ?> Gas Sites</h1>
<hr />
<form method='post' action='<?php echo BASE_PATH; ?>submit'>
<input type='hidden' name='redirect' value='<?php echo strtolower($title); ?>' />
<label>What level is your Gas Cloud Harvesting skill at?</label>
<?php skillLevels(range(1,5), 'ghSkill', 1, 1, "Gas Harvester(s)", null); ?>
<span class="help-block"><small>This assumes you're using as many gas harvesters that your level allows for and, if level V, will be using 5 GH IIs</small></span>
<label class='checkbox'>
<input type='checkbox' class='toggle' name='boolLinks' id='linkToggle' value='true' data-toggle='links' <?php echo ($boolLinks != 0 ? ' checked':null);?>>
Pimp My Fleet <small class='desc'>Mining Foreman Links, Capital Boosts, Mindlink</small>
</label>
<fieldset id='links'>
<label>Mining Foreman Link - Laser Optimization?</label>
<select class='span2' name='linkTech' data-calc='linkBonus'>
<option value='0' data-override='0'<?php echo ($linkTech == 0 ? ' selected':null);?> />None
<option value='1' data-override='-2'<?php echo ($linkTech == 1 ? ' selected':null);?> />Tech 1
<option value='2' data-override='-2.5'<?php echo ($linkTech == 2 ? ' selected':null);?> />Tech 2
</select><small id='linkBonus'><span>0</span>% Base Duration</small>
<!-- if we're using links, than Mining Director needs to be at least 1 (hence no `zero` option) -->
<label>Links: Mining Director skill level</label>
<?php skillLevels(range(1,5), 'director', 20, 20, "Effectiveness to Mining Foreman Links"); ?>
<label>Links: Warfare Link Specialist skill level</label>
<?php skillLevels(range(0,5), 'warfare', 10, 10, "Effectiveness to Mining Foreman Links"); ?>
<label class='checkbox'>
<input type='checkbox' name='boolMindlink' id='mindlink' value='true' <?php echo ($boolMindlink != 0 ? ' checked':null);?>>
Mining Foreman Mindlink <small>25% Effectiveness to Mining Foreman Links</small>
</label>
<label class='checkbox'>
<input type='checkbox' class='toggle' name='capital' id='capitalToggle' value='true' data-toggle='capital' <?php echo ($capShip != 0 ? ' checked':null);?>>
Capital Industrial Ship <small class='desc'>Orca; Rorqual</small>
</label>
<fieldset id='capital'>
<select class='span2' name='capShip' id='capShip'>
<option value='1' data-multiplier='3' <?php echo ($capShip == 1 ? ' selected':null);?> />Orca
<option value='2' data-multiplier='10' <?php echo ($capShip == 2 ? ' selected':null);?> />Rorqual
</select>
<label>Respective Ship Skill</label>
<select class='span1' name='capSkill' id='capSkill' data-calc='capBonus'>
<option value='1'<?php echo ($capSkill == 1 ? ' selected':null);?> />I
<option value='2'<?php echo ($capSkill == 2 ? ' selected':null);?> />II
<option value='3'<?php echo ($capSkill == 3 ? ' selected':null);?> />III
<option value='4'<?php echo ($capSkill == 4 ? ' selected':null);?> />IV
<option value='5'<?php echo ($capSkill == 5 ? ' selected':null);?> />V
</select> <small id='capBonus'>+<span>5</span>% Effectiveness of Mining Foreman Links</small>
</fieldset>
</fieldset>
<label class='checkbox'>
<input type='checkbox' class='toggle' name='implants' id='implantsToggle' value='true' data-toggle='implants' <?php echo ($implants != 0 ? ' checked':null);?>>
Eifyr and Co. 'Alchemist' Gas Harvesting
</label>
<fieldset id='implants'>
<label class="radio">
<input type="radio" name="ghImplant" id="ghImplant1" value="1" <?php echo ($implants == 1 || $implants == 0 ? ' checked':null); ?>>GH-801
<small>1% reduction to cycle time</small>
</label>
<label class="radio">
<input type="radio" name="ghImplant" id="ghImplant3" value="2" <?php echo ($implants == 2 ? ' checked':null); ?>>GH-803
<small>3% reduction to cycle time</small>
</label>
<label class="radio">
<input type="radio" name="ghImplant" id="ghImplant3" value="3" <?php echo ($implants == 3 ? ' checked':null); ?>>GH-805
<small>5% reduction to cycle time</small>
</label>
</fieldset>
<label class='checkbox'>
<input type='checkbox' class='toggle' name='boolVenture' id='ventureToggle' value='true' data-toggle='venture-inputs' <?php echo ($ventureSkill != 0 ? ' checked':null);?>>
I'm using a Venture, yo! <small>100% Bonus to Gas Yield</small>
</label>
<fieldset id='venture-inputs'>
<label>What level is your Mining Frigate skill at?</label>
<?php skillLevels(range(1,5), 'ventureSkill', -5, 5, "Duration"); ?>
<span class="help-block"><small>The Venture has 2 turret slots - assuming all slots are filled with Gas Harvesters or what is allowed by Gas Cloud Harvesting skill, whichever is lower.</small></span>
</fieldset>
<br />
<button class="btn btn-small btn-primary" type='submit'>Submit</button>
<?php if (DEBUG === true){ ?>
<input type='hidden' name='debug' value='true' />
<?php } ?>
</form>
<?php
if (DEBUG == true) { ?>
<div id='debug'>
<h3>Debug</h3>
Link base and multipliers:
<?php var_dump($lBonuses); ?>
Durration modifiers:
<?php var_dump($dBonuses); ?>
Default variables:
<pre>
Mining Amount: <strong><?php echo $mine_amount; ?></strong> m3 / cycle / module
Default Cycle: <strong><?php echo $duration; ?></strong> seconds / module</pre>
Resultant data:
<pre>
Mining Amount: <strong><?php echo MINE_AMOUNT; ?></strong> m3 / cycle / module
Cycle Time: <strong><?php echo CYCLE_TIME; ?></strong> seconds / module
# of GH's: <strong><?php echo LEVEL; ?></strong> (tech <strong><?php echo (MINE_AMOUNT == 10 ? '1':'2') ?>)</strong> harvesters</pre>
</pre>
</div>
<?php } ?>