Location: PHPKode > projects > SWG Resource Tracker > distro/upload/schematicedit.php
<?php
/*
 *	SWG Resource Tracker
 *	Copyright (C) 2004 Enigma
 *
 *	This program is free software; you can redistribute it and/or
 *	modify it under the terms of the GNU General Public License
 *	as published by the Free Software Foundation; either version 2
 *	of the License, or (at your option) any later version.
 *	
 *	This program is distributed in the hope that it will be useful,
 *	but WITHOUT ANY WARRANTY; without even the implied warranty of
 *	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *	GNU General Public License for more details.
 *	
 *	You should have received a copy of the GNU General Public License
 *	along with this program; if not, write to the Free Software
 *	Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 */

if (LOGGED_IN)
{
	$idx = new SchematicEdit();
}

class SchematicEdit
{
	var $output = "";
	
	function SchematicEdit()
	{
		global $DB, $display, $baseurl, $filter, $equation;
		
		
		switch ($_REQUEST['field'])
		{
			case "name":
				$this->editName();
				break;
			case "skill":
				$this->editSkill();
				break;
			case "complexity":
				$this->editComplexity();
				break;
			case "size":
				$this->editSize();
				break;
			case "exp":
				$this->editExp();
				break;
			case "description":
				$this->editDescription();
				break;
			case "components":
				$this->editComponents();
				break;
			case "experimental":
				$this->editExperimental();
				break;
		}
		
		$display['title'] = "Resource Tracker - Schematic Edit";
		$display['output'] = $this->output;
	}
	
	function printCategoryList($name, $q)
	{
		global $DB;
		
		$query = "SELECT `long_name`, `id` FROM `categories` ORDER BY `long_name` ASC";
		$DB->query($query);
		
		$results = $DB->fetchAll();
		
		$s = "<select name=\"{$name}\" style=\"font-size: 7px;\">
				<option value=\"-1\"> </option>\n";
		
		for ($i = 0; $i < count($results); $i++)
		{
			$sel = "";
			if ($q == $results[$i]['id'])
			{
				$sel = " selected=\"selected\"";
			}
			
			$s .= "<option value=\"{$results[$i]['id']}\"{$sel}>{$results[$i]['long_name']}</option>\n";
		}
		
		$s .= "</select>\n";
		
		return $s;
	}
	
	function printSchematicList($name, $q)
	{
		global $DB;
		
		$query = "SELECT `name`, `id` FROM `schematic` ORDER BY `name` ASC";
		$DB->query($query);
		
		$results = $DB->fetchAll();
		
		$s = "<select name=\"{$name}\" style=\"font-size: 7px;\">
				<option value=\"-1\"> </option>\n";
		
		for ($i = 0; $i < count($results); $i++)
		{
			$sel = "";
			if ($q == $results[$i]['id'])
			{
				$sel = " selected=\"selected\"";
			}
			
			$s .= "<option value=\"{$results[$i]['id']}\"{$sel}>{$results[$i]['name']}</option>\n";
		}
		
		$s .= "</select>\n";
		
		return $s;
	}
	
	function printLootList($name, $q)
	{
		global $DB;
		
		$query = "SELECT `name`, `id` FROM `loot` ORDER BY `name` ASC";
		$DB->query($query);
		
		$results = $DB->fetchAll();
		
		$s = "<select name=\"{$name}\" style=\"font-size: 7px;\">
				<option value=\"-1\"> </option>\n";
		
		for ($i = 0; $i < count($results); $i++)
		{
			$sel = "";
			if ($q == $results[$i]['id'])
			{
				$sel = " selected=\"selected\"";
			}
			
			$s .= "<option value=\"{$results[$i]['id']}\"{$sel}>{$results[$i]['name']}</option>\n";
		}
		
		$s .= "</select>\n";
		
		return $s;
	}
	
	function printCollectionList($name, $q)
	{
		global $DB;
		
		$query = "SELECT `name`, `id` FROM `collection` ORDER BY `name` ASC";
		$DB->query($query);
		
		$results = $DB->fetchAll();
		
		$s = "<select name=\"{$name}\" style=\"font-size: 7px;\">
				<option value=\"-1\"> </option>\n";
		
		for ($i = 0; $i < count($results); $i++)
		{
			$sel = "";
			if ($q == $results[$i]['id'])
			{
				$sel = " selected=\"selected\"";
			}
			
			$s .= "<option value=\"{$results[$i]['id']}\"{$sel}>{$results[$i]['name']}</option>\n";
		}
		
		$s .= "</select>\n";
		
		return $s;
	}
	
	function editName()
	{
		global $DB, $display, $baseurl;
		
		$schem = intval($_REQUEST['schem']);
		$value = addslashes(ereg_replace("[^a-zA-Z0-9\ \'&:\(\)\,\.-]", "", $_REQUEST['value']));
		
		if (isset($_REQUEST['sbtn']))
		{
			$query = "UPDATE `schematic` SET `name`='{$value}' WHERE `id`={$schem}";
			$DB->query($query);
		}
		
		
		$query = "SELECT `name` FROM `schematic` WHERE `id`={$schem}";
		$DB->query($query);
		$row = $DB->fetchRow();
		
		$this->output .= "<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" class=\"ltb\">
				<tr>
					<th class=\"rbb\">Name</th>
					<td class=\"rbb\"><form action=\"{$baseurl}\" method=\"post\">
											<input type=\"text\" name=\"value\" value=\"{$row[0]}\" />
											<br />
											&nbsp;&nbsp;&nbsp;
											<input type=\"submit\" name=\"sbtn\" value=\"Change\" />
											<input type=\"hidden\" name=\"act\" value=\"schematicedit\" />
											<input type=\"hidden\" name=\"field\" value=\"name\" />
											<input type=\"hidden\" name=\"schem\" value=\"{$schem}\" />
										</form>
					</td>
				</tr>
			</table>";
	}
	
	function editSkill()
	{
		global $DB, $display, $baseurl;
		
		$schem = intval($_REQUEST['schem']);
		$value = addslashes(ereg_replace("[^0-9]", "", $_REQUEST['value']));
		
		if (isset($_REQUEST['sbtn']))
		{
			$query = "UPDATE `schematic` SET `skill`={$value} WHERE `id`={$schem}";
			$DB->query($query);
		}
		
		$query = "SELECT `skill` FROM `schematic` WHERE `id`={$schem}";
		$DB->query($query);
		$row = $DB->fetchRow();
		
		$query = "SELECT CONCAT(p.`name`, ' - ', s.`name`) AS `menuname`, s.`id` FROM `profession` AS p, `profession_skills` AS ps, `skill` AS s WHERE ps.`profession_id`=p.`id` AND s.`id`=ps.`skill_id` ORDER BY `menuname` ASC";
		$DB->query($query);
		
		$results = $DB->fetchAll();
	
		$s = "<select name=\"value\">
				<option value=\"-1\"> </option>\n";
		
		for ($i = 0; $i < count($results); $i++)
		{
			if ($row[0] == $results[$i]['id'])
			{
				$sel = " selected";
			}
			else
			{
				$sel = "";
			}
			
			$s .= "<option value=\"{$results[$i]['id']}\"{$sel}>{$results[$i]['menuname']}</option>\n";
		}
		
		$s .= "</select>\n";
		
		$this->output .= "<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" class=\"ltb\">
				<tr>
					<th class=\"rbb\">Skill</th>
					<td class=\"rbb\"><form action=\"{$baseurl}\" method=\"post\">
											{$s}
											<br />
											&nbsp;&nbsp;&nbsp;
											<input type=\"submit\" name=\"sbtn\" value=\"Change\" />
											<input type=\"hidden\" name=\"act\" value=\"schematicedit\" />
											<input type=\"hidden\" name=\"field\" value=\"skill\" />
											<input type=\"hidden\" name=\"schem\" value=\"{$schem}\" />
										</form>
					</td>
				</tr>
			</table>";
	}
	
	function editComplexity()
	{
		global $DB, $display, $baseurl;
		
		$schem = intval($_REQUEST['schem']);
		$value = intval($_REQUEST['value']);
		
		if (isset($_REQUEST['sbtn']))
		{
			$query = "UPDATE `schematic` SET `complexity`={$value} WHERE `id`={$schem}";
			$DB->query($query);
		}
		
		
		$query = "SELECT `complexity` FROM `schematic` WHERE `id`={$schem}";
		$DB->query($query);
		$row = $DB->fetchRow();
		
		$this->output .= "<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" class=\"ltb\">
				<tr>
					<th class=\"rbb\">Complexity</th>
					<td class=\"rbb\"><form action=\"{$baseurl}\" method=\"post\">
											<input type=\"text\" name=\"value\" value=\"{$row[0]}\" />
											<br />
											&nbsp;&nbsp;&nbsp;
											<input type=\"submit\" name=\"sbtn\" value=\"Change\" />
											<input type=\"hidden\" name=\"act\" value=\"schematicedit\" />
											<input type=\"hidden\" name=\"field\" value=\"complexity\" />
											<input type=\"hidden\" name=\"schem\" value=\"{$schem}\" />
										</form>
					</td>
				</tr>
			</table>";
	}
	
	function editSize()
	{
		global $DB, $display, $baseurl;
		
		$schem = intval($_REQUEST['schem']);
		$value = intval($_REQUEST['value']);
		
		if (isset($_REQUEST['sbtn']))
		{
			$query = "UPDATE `schematic` SET `size`={$value} WHERE `id`={$schem}";
			$DB->query($query);
		}
		
		
		$query = "SELECT `size` FROM `schematic` WHERE `id`={$schem}";
		$DB->query($query);
		$row = $DB->fetchRow();
		
		$this->output .= "<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" class=\"ltb\">
				<tr>
					<th class=\"rbb\">Size</th>
					<td class=\"rbb\"><form action=\"{$baseurl}\" method=\"post\">
											<input type=\"text\" name=\"value\" value=\"{$row[0]}\" />
											<br />
											&nbsp;&nbsp;&nbsp;
											<input type=\"submit\" name=\"sbtn\" value=\"Change\" />
											<input type=\"hidden\" name=\"act\" value=\"schematicedit\" />
											<input type=\"hidden\" name=\"field\" value=\"size\" />
											<input type=\"hidden\" name=\"schem\" value=\"{$schem}\" />
										</form>
					</td>
				</tr>
			</table>";
	}
	
	function editExp()
	{
		global $DB, $display, $baseurl;
		
		$schem = intval($_REQUEST['schem']);
		$value = intval($_REQUEST['value']);
		
		if (isset($_REQUEST['sbtn']))
		{
			$query = "UPDATE `schematic` SET `xp`={$value} WHERE `id`={$schem}";
			$DB->query($query);
		}
		
		
		$query = "SELECT `xp` FROM `schematic` WHERE `id`={$schem}";
		$DB->query($query);
		$row = $DB->fetchRow();
		
		$this->output .= "<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" class=\"ltb\">
				<tr>
					<th class=\"rbb\">Experience</th>
					<td class=\"rbb\"><form action=\"{$baseurl}\" method=\"post\">
											<input type=\"text\" name=\"value\" value=\"{$row[0]}\" />
											<br />
											&nbsp;&nbsp;&nbsp;
											<input type=\"submit\" name=\"sbtn\" value=\"Change\" />
											<input type=\"hidden\" name=\"act\" value=\"schematicedit\" />
											<input type=\"hidden\" name=\"field\" value=\"exp\" />
											<input type=\"hidden\" name=\"schem\" value=\"{$schem}\" />
										</form>
					</td>
				</tr>
			</table>";
	}
	
	function editDescription()
	{
		global $DB, $display, $baseurl;
		
		$schem = intval($_REQUEST['schem']);
		$value = addslashes($_REQUEST['value']);
		
		if (isset($_REQUEST['sbtn']))
		{
			$query = "UPDATE `schematic` SET `description`='{$value}' WHERE `id`={$schem}";
			$DB->query($query);
		}
		
		
		$query = "SELECT `description` FROM `schematic` WHERE `id`={$schem}";
		$DB->query($query);
		$row = $DB->fetchRow();
		
		$this->output .= "<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" class=\"ltb\">
				<tr>
					<th class=\"rbb\">Description</th>
					<td class=\"rbb\"><form action=\"{$baseurl}\" method=\"post\">
											<textarea rows=\"10\" cols=\"40\" name=\"value\">" . htmlentities($row[0]) . "</textarea>
											<br />
											&nbsp;&nbsp;&nbsp;
											<input type=\"submit\" name=\"sbtn\" value=\"Change\" />
											<input type=\"hidden\" name=\"act\" value=\"schematicedit\" />
											<input type=\"hidden\" name=\"field\" value=\"description\" />
											<input type=\"hidden\" name=\"schem\" value=\"{$schem}\" />
										</form>
					</td>
				</tr>
			</table>";
	}
	
	function editComponents()
	{
		global $DB, $baseurl;
		
		$schem = intval($_REQUEST['schem']);
		
		if (isset($_REQUEST['sbtn']) && !empty($_REQUEST['required']))
		{
			for ($i = 0; $i < count($_REQUEST['quantity']); $i++)
			{
				$id = intval($_REQUEST['id'][$i]);
				$required = isset($_REQUEST['required'][$i]) ? 1 : 0;
				$identical = isset($_REQUEST['identical'][$i]) ? 1 : 0;
				$quantity = intval($_REQUEST['quantity'][$i]);
				$catname = addslashes($_REQUEST['catname'][$i]);
				$resource = intval($_REQUEST['resource'][$i]);
				$schematic = intval($_REQUEST['schematic'][$i]);
				$loot = intval($_REQUEST['loot'][$i]);
				$collection = intval($_REQUEST['collection'][$i]);
				
				$valid = $resource > 0 || $schematic > 0 || $loot > 0 || $collection > 0;
				$type = "";
				$r = 0;
				
				if ($resource > 0)
				{
					$type = "Resource";
					$r = $resource;
				}
				else if ($schematic > 0)
				{
					$type = "Schematic";
					$r = $schematic;
				}
				else if ($loot > 0)
				{
					$type = "Loot";
					$r = $loot;
				}
				else if ($collection > 0)
				{
					$type = "Collection";
					$r = $collection;
				}
				
				if ($valid && $id == 0 && $quantity > 0)
				{
					$query = "INSERT INTO `components` (`schematic`, `cat_name`, `type`, `resource`, `quantity`, `required`, `identical`) VALUES ({$schem}, '{$catname}', '{$type}', {$r}, {$quantity}, {$required}, {$identical})";
					$DB->query($query);
				}
				else if ($valid && $id > 0 && $quantity > 0)
				{
					$query = "UPDATE `components` SET `schematic`={$schem}, `cat_name`='{$catname}', `type`='{$type}', `resource`={$r}, `quantity`={$quantity}, `required`={$required}, `identical`={$identical} WHERE `id`={$id}";
					$DB->query($query);
				}
				else if ($id > 0 && $quantity == 0)
				{
					$query = "DELETE FROM `components` WHERE `id`={$id}";
					$DB->query($query);
				}
			}
		}
		
		
		$query = "SELECT * FROM `components` WHERE `schematic`={$schem} ORDER BY `type` ASC";
		$DB->query($query);
		$results = $DB->fetchAll();
		
		$this->output .= "<em>Change quantity to 0 to remove</em>
		<form action=\"{$baseurl}\" method=\"post\">
		<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" class=\"ltb\">
									<tr>
										<th class=\"rbb\" style=\"font-size: 8px;\">Required</th>
										<th class=\"rbb\" style=\"font-size: 8px;\">Identical</th>
										<th class=\"rbb\" style=\"font-size: 8px;\">Quantity</th>
										<th class=\"rbb\" style=\"font-size: 8px;\">Category Name</th>
										<th class=\"rbb\" style=\"font-size: 8px;\">Resource</th>
										<th class=\"rbb\" style=\"font-size: 8px;\">Schematic</th>
										<th class=\"rbb\" style=\"font-size: 8px;\">Loot</th>
										<th class=\"rbb\" style=\"font-size: 8px;\">Collection</th>
									</tr>\n";
		
		for ($i = 0; $i < count($results) + 3; $i++)
		{
			$c = $results[$i];
			$category = ($c['type'] == "Resource" ? $c['resource'] : -1);
			$schematic = ($c['type'] == "Schematic" ? $c['resource'] : -1);
			$loot = ($c['type'] == "Loot" ? $c['resource'] : -1);
			$collection = ($c['type'] == "Collection" ? $c['resource'] : -1);
			
			$required = ($c['required'] == 1 ? " checked" : "");
			$identical = ($c['identical'] == 1 ? " checked" : "");
			
			$this->output .= "<tr>
				<td class=\"rbb\"><input type=\"checkbox\" name=\"required[{$i}]\"{$required} /><input type=\"hidden\" name=\"id[{$i}]\" value=\"{$c['id']}\" /></td>
				<td class=\"rbb\"><input type=\"checkbox\" name=\"identical[{$i}]\"{$identical} /></td>
				<td class=\"rbb\"><input type=\"text\" name=\"quantity[{$i}]\" value=\"{$c['quantity']}\" size=\"4\" style=\"font-size: 8px;\" /></td>
				<td class=\"rbb\"><input type=\"text\" name=\"catname[{$i}]\" value=\"{$c['cat_name']}\" style=\"font-size: 8px;\" /></td>
				<td class=\"rbb\">" . $this->printCategoryList("resource[{$i}]", $category) . "</td>
				<td class=\"rbb\">" . $this->printSchematicList("schematic[{$i}]", $schematic) . "</td>
				<td class=\"rbb\">" . $this->printLootList("loot[{$i}]", $loot) . "</td>
				<td class=\"rbb\">" . $this->printCollectionList("collection[{$i}]", $collection) . "</td>
			</tr>\n";
		}
		
		$this->output .= "<tr>
				<th class=\"rbb\" colspan=\"8\" align=\"left\">
					<input type=\"hidden\" name=\"act\" value=\"schematicedit\" />
					<input type=\"hidden\" name=\"field\" value=\"components\" />
					<input type=\"hidden\" name=\"schem\" value=\"{$schem}\" />
					<input type=\"submit\" name=\"sbtn\" value=\"Change\" />
				</th>
			</tr>
		</table>\n";
	}
	
	function editExperimental()
	{
		global $DB, $baseurl;
		
		$schem = intval($_REQUEST['schem']);
		
		if (isset($_REQUEST['sbtn']) && !empty($_REQUEST['expmain']))
		{
			for ($i = 0; $i < count($_REQUEST['expmain']); $i++)
			{
				$expmain = addslashes($_REQUEST['expmain'][$i]);
				$expsub = addslashes($_REQUEST['expsub'][$i]);
				$stats = array(	"ER" => intval($_REQUEST["ER"][$i]),
								"CR" => intval($_REQUEST["CR"][$i]),
								"CD" => intval($_REQUEST["CD"][$i]),
								"DR" => intval($_REQUEST["DR"][$i]),
								"FL" => intval($_REQUEST["FL"][$i]),
								"HR" => intval($_REQUEST["HR"][$i]),
								"MA" => intval($_REQUEST["MA"][$i]),
								"PE" => intval($_REQUEST["PE"][$i]),
								"OQ" => intval($_REQUEST["OQ"][$i]),
								"SR" => intval($_REQUEST["SR"][$i]),
								"UT" => intval($_REQUEST["UT"][$i]));
				
				if (array_sum($stats) == 0 && $_REQUEST['id'][$i] > 0)
				{
					$query = "DELETE FROM `experimental_properties` WHERE `id`={$_REQUEST['id'][$i]}";
					$DB->query($query);
				}
				else if (intval($_REQUEST['id'][$i]) > 0 && $expmain != "" && $expsub != "")
				{
					$query = "UPDATE `experimental_properties` SET `main_name`='{$expmain}', `sub_name`='{$expsub}', `ER`={$stats['ER']}, `CR`={$stats['CR']}, `CD`={$stats['CD']}, `DR`={$stats['DR']}, `FL`={$stats['FL']}, `HR`={$stats['HR']}, `MA`={$stats['MA']}, `PE`={$stats['PE']}, `OQ`={$stats['OQ']}, `SR`={$stats['SR']}, `UT`={$stats['UT']} WHERE `id`={$_REQUEST['id'][$i]}";
					$DB->query($query);
				}
				else if (array_sum($stats) > 0 && $expmain != "" && $expsub != "")
				{
					$query = "INSERT INTO `experimental_properties` (`schematic`, `main_name`, `sub_name`, `ER`, `CR`, `CD`, `DR`, `FL`, `HR`, `MA`, `PE`, `OQ`, `SR`, `UT`) VALUES ({$schem}, '{$expmain}', '{$expsub}', {$stats['ER']}, {$stats['CR']}, {$stats['CD']}, {$stats['DR']}, {$stats['FL']}, {$stats['HR']}, {$stats['MA']}, {$stats['PE']}, {$stats['OQ']}, {$stats['SR']}, {$stats['UT']})";
					$DB->query($query);
				}
			}
		}
		
		
		$query = "SELECT * FROM `experimental_properties` WHERE `schematic`={$schem}";
		$DB->query($query);
		$results = $DB->fetchAll();
		
		$this->output .= "<em>Change all stat fields to 0 to remove</em>
		<form action=\"{$baseurl}\" method=\"post\">
		<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\" class=\"ltb\">
									<tr>
										<th class=\"rbb\">Main Category</th>
										<th class=\"rbb\">Sub Category</th>
										<th class=\"rbb\">ER</th>
										<th class=\"rbb\">CR</th>
										<th class=\"rbb\">CD</th>
										<th class=\"rbb\">DR</th>
										<th class=\"rbb\">FL</th>
										<th class=\"rbb\">HR</th>
										<th class=\"rbb\">MA</th>
										<th class=\"rbb\">PE</th>
										<th class=\"rbb\">OQ</th>
										<th class=\"rbb\">SR</th>
										<th class=\"rbb\">UT</th>
									</tr>\n";
		
		for ($i = 0; $i < count($results) + 3; $i++)
		{
			$s = $results[$i];
			
			$this->output .= "<tr>
				<td class=\"rbb\"><input type=\"hidden\" name=\"id[{$i}]\" value=\"{$s['id']}\" />" . $this->printExperimentationCategoryList("expmain[{$i}]", $s['main_name']) . "</td>
				<td class=\"rbb\"><input type=\"text\" name=\"expsub[{$i}]\" value=\"" . $s["sub_name"] . "\"></td>
				<td class=\"rbb\"><input type=\"text\" name=\"ER[{$i}]\" size=\"3\" maxlength=\"3\" value=\"" . intval($s["ER"]) . "\"></td>
				<td class=\"rbb\"><input type=\"text\" name=\"CR[{$i}]\" size=\"3\" maxlength=\"3\" value=\"" . intval($s["CR"]) . "\"></td>
				<td class=\"rbb\"><input type=\"text\" name=\"CD[{$i}]\" size=\"3\" maxlength=\"3\" value=\"" . intval($s["CD"]) . "\"></td>
				<td class=\"rbb\"><input type=\"text\" name=\"DR[{$i}]\" size=\"3\" maxlength=\"3\" value=\"" . intval($s["DR"]) . "\"></td>
				<td class=\"rbb\"><input type=\"text\" name=\"FL[{$i}]\" size=\"3\" maxlength=\"3\" value=\"" . intval($s["FL"]) . "\"></td>
				<td class=\"rbb\"><input type=\"text\" name=\"HR[{$i}]\" size=\"3\" maxlength=\"3\" value=\"" . intval($s["HR"]) . "\"></td>
				<td class=\"rbb\"><input type=\"text\" name=\"MA[{$i}]\" size=\"3\" maxlength=\"3\" value=\"" . intval($s["MA"]) . "\"></td>
				<td class=\"rbb\"><input type=\"text\" name=\"PE[{$i}]\" size=\"3\" maxlength=\"3\" value=\"" . intval($s["PE"]) . "\"></td>
				<td class=\"rbb\"><input type=\"text\" name=\"OQ[{$i}]\" size=\"3\" maxlength=\"3\" value=\"" . intval($s["OQ"]) . "\"></td>
				<td class=\"rbb\"><input type=\"text\" name=\"SR[{$i}]\" size=\"3\" maxlength=\"3\" value=\"" . intval($s["SR"]) . "\"></td>
				<td class=\"rbb\"><input type=\"text\" name=\"UT[{$i}]\" size=\"3\" maxlength=\"3\" value=\"" . intval($s["UT"]) . "\"></td>
			</tr>\n";
		}
		
		$this->output .= "<tr>
				<th class=\"rbb\" colspan=\"13\" align=\"left\">
					<input type=\"hidden\" name=\"act\" value=\"schematicedit\" />
					<input type=\"hidden\" name=\"field\" value=\"experimental\" />
					<input type=\"hidden\" name=\"schem\" value=\"{$schem}\" />
					<input type=\"submit\" name=\"sbtn\" value=\"Change\" />
				</th>
			</tr>
		</table>\n";
	}
	
	function printExperimentationCategoryList($name, $m)
	{
		$s = "<select name=\"{$name}\">
				<option value=\"\"> </option>\n";
		
		$l = array(	"Ammunition Quantity",
					"Chaff Maximum Effectiveness",
					"Chaff Minimum Effectiveness",
					"Experimental Absorption",
					"Experimental Armor Hitpoints",
					"Experimental Armor Effectiveness",
					"Experimental Back Hitpoints",
					"Experimental Booster Acceleration",
					"Experimental Booster Consumption",
					"Experimental Booster Energy",
					"Experimental Booster Energy Consumption",
					"Experimental Booster Recharge Rate",
					"Experimental Booster Speed",
					"Experimental Capacitor Energy",
					"Experimental Charges",
					"Experimental Damage",
					"Experimental Damage Max",
					"Experimental Damage Minimum",
					"Experimental Droid Command Speed",
					"Experimental Droid Speed",
					"Experimental Durability",
					"Experimental Duration",
					"Experimental Ease of Use",
					"Experimental Effectiveness",
					"Experimental Efficiency",
					"Experimental Energy Generation Rate",
					"Experimental Energy Per Shot",
					"Experimental Energy Maintenance",
					"Experimental Filling",
					"Experimental Firing Rate",
					"Experimental Flavor",
					"Experimental Front Hitpoints",
					"Experimental Hitpoints",
					"Experimental Maintenance",
					"Experimental Mass",
					"Experimental Maximum Hitpoints",
					"Experimental Nutritional Value",
					"Experimental Pitch",
					"Experimental Quality",
					"Experimental Quantity",
					"Experimental Range",
					"Experimental Recharge Rate",
					"Experimental Resistance",
					"Experimental Roll",
					"Experimental Shield Effectiveness",
					"Experimental Shield Recharge Rate",
					"Experimental Speed",
					"Experimental Storage",
					"Experimental Yaw",
					"Misc" );
		
		for ($i = 0; $i < count($l); $i++)
		{
			$sel = "";
			if ($m == $l[$i])
			{
				$sel = " selected";
			}
			
			$s .= "<option value=\"{$l[$i]}\"{$sel}>{$l[$i]}</option>\n";
		}
		
		$s .= "</select>\n";
		
		return $s;
	}
}
?>
Return current item: SWG Resource Tracker