load->helper('url'); $this->load->helper('form'); $link_back = 'admin/building_tool'; $attr_drop = 'class="drop"'; $attr_name = array( 'name' => 'name', 'class' => 'input'); $attr_description = array( 'name' => 'description', 'rows' => '5', 'cols' => '50', 'class' => 'textarea'); $attr_icon = array( 'name' => 'icon', 'class' => 'input'); $attr_rank = array( 'name' => 'rank', 'class' => 'input'); $name_next_rank = 'next_rank'; $attr_next_rank = 'class="drop"'; $attr_time_to_build = array( 'name' => 'time_to_build', 'class' => 'input'); $name_creates = 'creates'; $attr_creates = 'class="drop"'; $attr_num_creates = array( 'name' => 'num_creates', 'class' => 'input'); $attr_score = array( 'name' => 'score', 'class' => 'input'); $attr_defense = array( 'name' => 'defense', 'class' => 'input'); $opt_ability = array( '0' => 'Nothing', '1' => "Enemy can't steal resources"); $attr_cost_food = array( 'name' => 'cost_food', 'class' => 'input'); $attr_cost_wood = array( 'name' => 'cost_wood', 'class' => 'input'); $attr_cost_stone = array( 'name' => 'cost_stone', 'class' => 'input'); $attr_cost_iron = array( 'name' => 'cost_iron', 'class' => 'input'); $attr_cost_mana = array( 'name' => 'cost_mana', 'class' => 'input'); $attr_mod_max_food = array( 'name' => 'mod_max_food', 'class' => 'input'); $attr_mod_max_wood = array( 'name' => 'mod_max_wood', 'class' => 'input'); $attr_mod_max_stone = array( 'name' => 'mod_max_stone', 'class' => 'input'); $attr_mod_max_iron = array( 'name' => 'mod_max_iron', 'class' => 'input'); $attr_mod_max_mana = array( 'name' => 'mod_max_mana', 'class' => 'input'); $attr_mod_rate_food = array( 'name' => 'mod_rate_food', 'class' => 'input'); $attr_mod_rate_wood = array( 'name' => 'mod_rate_wood', 'class' => 'input'); $attr_mod_rate_stone = array( 'name' => 'mod_rate_stone', 'class' => 'input'); $attr_mod_rate_iron = array( 'name' => 'mod_rate_iron', 'class' => 'input'); $attr_mod_rate_mana = array( 'name' => 'mod_rate_mana', 'class' => 'input'); $attr_mod_percent_food = array( 'name' => 'mod_percent_food', 'class' => 'input'); $attr_mod_percent_wood = array( 'name' => 'mod_percent_wood', 'class' => 'input'); $attr_mod_percent_stone = array( 'name' => 'mod_percent_stone', 'class' => 'input'); $attr_mod_percent_iron = array( 'name' => 'mod_percent_iron', 'class' => 'input'); $attr_mod_percent_mana = array( 'name' => 'mod_percent_mana', 'class' => 'input'); $name_assign1 = 'assign1'; $name_assign2 = 'assign2'; $name_assign3 = 'assign3'; $name_assign4 = 'assign4'; $name_assign5 = 'assign5'; $attr_assign = 'class="drop"'; $name_req_tech = 'req_tech'; $attr_req_tech = 'class="drop"'; $name_tech_group = 'tech_group'; $attr_tech_group = 'class="drop"'; $name_tech_secondary_group = 'tech_secondary_group'; $attr_tech_secondary_group = 'class="drop"'; $attr_submit = array( 'name' => 'submit', 'value' => 'Submit', 'class' => 'submit'); if ($new) { //set every value with set_value() $link_form = 'admin/building'; $attr_name['value'] = set_value('name'); $attr_description['value'] = set_value('description'); $attr_icon['value'] = set_value('icon'); $attr_rank['value'] = set_value('rank'); //next rank goes from controller $attr_time_to_build['value'] = set_value('time_to_build'); $attr_num_creates['value'] = set_value('num_creates'); $attr_score['value'] = set_value('score'); $attr_defense['value'] = set_value('defense'); $attr_cost_food['value'] = set_value('cost_food'); $attr_cost_wood['value'] = set_value('cost_wood'); $attr_cost_stone['value'] = set_value('cost_stone'); $attr_cost_iron['value'] = set_value('cost_iron'); $attr_cost_mana['value'] = set_value('cost_mana'); $attr_mod_max_food['value'] = set_value('mod_max_food'); $attr_mod_max_wood['value'] = set_value('mod_max_wood'); $attr_mod_max_stone['value'] = set_value('mod_max_stone'); $attr_mod_max_iron['value'] = set_value('mod_max_iron'); $attr_mod_max_mana['value'] = set_value('mod_max_mana'); $attr_mod_rate_food['value'] = set_value('mod_rate_food'); $attr_mod_rate_wood['value'] = set_value('mod_rate_wood'); $attr_mod_rate_stone['value'] = set_value('mod_rate_stone'); $attr_mod_rate_iron['value'] = set_value('mod_rate_iron'); $attr_mod_rate_mana['value'] = set_value('mod_rate_mana'); $attr_mod_percent_food['value'] = set_value('mod_percent_food'); $attr_mod_percent_wood['value'] = set_value('mod_percent_wood'); $attr_mod_percent_stone['value'] = set_value('mod_percent_stone'); $attr_mod_percent_iron['value'] = set_value('mod_percent_iron'); $attr_mod_percent_mana['value'] = set_value('mod_percent_mana'); } else { //set every value from data sent $link_form = 'admin/building/' . $building['id']; $attr_name['value'] = $building['name']; $attr_description['value'] = $building['description']; $attr_icon['value'] = $building['icon']; $attr_rank['value'] = $building['rank']; $nextr = $building['next_rank']; $attr_time_to_build['value'] = $building['time_to_build']; $screate = $building['creates']; $attr_num_creates['value'] = $building['num_creates']; $attr_score['value'] = $building['score']; $attr_defense['value'] = $building['defense']; $sability = $building['ability']; $attr_cost_food['value'] = $building['cost_food']; $attr_cost_wood['value'] = $building['cost_wood']; $attr_cost_stone['value'] = $building['cost_stone']; $attr_cost_iron['value'] = $building['cost_iron']; $attr_cost_mana['value'] = $building['cost_mana']; $attr_mod_max_food['value'] = $building['mod_max_food']; $attr_mod_max_wood['value'] = $building['mod_max_wood']; $attr_mod_max_stone['value'] = $building['mod_max_stone']; $attr_mod_max_iron['value'] = $building['mod_max_iron']; $attr_mod_max_mana['value'] = $building['mod_max_mana']; $attr_mod_rate_food['value'] = $building['mod_rate_food']; $attr_mod_rate_wood['value'] = $building['mod_rate_wood']; $attr_mod_rate_stone['value'] = $building['mod_rate_stone']; $attr_mod_rate_iron['value'] = $building['mod_rate_iron']; $attr_mod_rate_mana['value'] = $building['mod_rate_mana']; $attr_mod_percent_food['value'] = $building['mod_percent_food']; $attr_mod_percent_wood['value'] = $building['mod_percent_wood']; $attr_mod_percent_stone['value'] = $building['mod_percent_stone']; $attr_mod_percent_iron['value'] = $building['mod_percent_iron']; $attr_mod_percent_mana['value'] = $building['mod_percent_mana']; $assign1 = $building['assignment1']; $assign2 = $building['assignment2']; $assign3 = $building['assignment3']; $assign4 = $building['assignment4']; $assign5 = $building['assignment5']; $selreqtech = $building['req_tech']; $seltechgroup = $building['tech_group']; $seltechsecgroup = $building['tech_secondary_group']; } ?>
<-- Back
Creating! Editing!
Name:
Description:
Icon:
Rank:
Next Rank:
Time to Build:
Score:
Defense:
Ability:
Cost Food:
Cost Wood:
Cost Stone:
Cost Iron:
Cost Mana:
Creates:
X (max)
Mod Max Food:
Mod Max Wood:
Mos Max Stone:
Mod Max Iron:
Mod Max Mana:
Mod Rate Food:
Mod rate Wood:
Mod Rate Stone:
Mod Rate Iron:
Mod Rate Mana:
Mod Percent Food:
Mod Percent Wood:
Mod Percent Stone:
Mod Percent Iron:
Mod Percent Mana:
Assignment 1:
Assignment 2:
Assignment 3:
Assignment 4:
Assignment 5:
Required Technology:
Technology Group:
Secondary Technology Group: