<?
include_once('mapcfg.php');

if($usepost == 1){
$shiptoview = $_POST["shiptoview"];
$shiplistrace = $_POST["shiplistrace"];
}

echo ("<html>");
echo ("<head>");
echo ("<meta http-equiv=Content-Style-Type content=text/css>");
echo ("<link rel=stylesheet href=$cssloc type=text/css>");
echo ("<title>$shiptoview Specifications</title>");
echo ("</head>");
echo ("<body>");
echo ("<br>");
echo ("<table width=60% cellspacing=0 cellpadding=0 border=0 align=center>");
  	echo ("<tr>");
    	echo ("<td width=100% align=center class=windowbg2>");

$shipdatalabel=array();
$shipdatalabel[2]="Ship: ";
$shipdatalabel[3]="Class: ";
$shipdatalabel[4]="BPV: ";
$shipdatalabel[5]="Special Role: ";
$shipdatalabel[6]="Year First Available: ";
$shipdatalabel[7]="Year Last Available: ";
$shipdatalabel[8]="Size Class: ";
$shipdatalabel[9]="Turn mode: ";
$shipdatalabel[10]="Move Cost: ";
$shipdatalabel[11]="HET +2 Turns & Nimble: ";
$shipdatalabel[12]="HET Breakdown: ";
$shipdatalabel[13]="Stealth (+ECM): ";
$shipdatalabel[14]="Regular Crew: ";
$shipdatalabel[15]="Boarding Parties Base: ";
$shipdatalabel[16]="Boarding Parties Max: ";
$shipdatalabel[17]="Deck Crews: ";
$shipdatalabel[18]="Total Crew: ";
$shipdatalabel[19]="Min Crew: ";
$shipdatalabel[20]="Shield 1: ";
$shipdatalabel[21]="Shield 2 _ 6: ";
$shipdatalabel[22]="Shield 3 _ 5: ";
$shipdatalabel[23]="Shield 4: ";
$shipdatalabel[24]="Shield Total: ";
$shipdatalabel[25]="Cloak: ";
$shipdatalabel[26]="Num: ";
$shipdatalabel[27]="Heavy Weapon 1: ";
$shipdatalabel[28]="Arc: ";
$shipdatalabel[29]="Num: ";
$shipdatalabel[30]="Heavy Weapon 2: ";
$shipdatalabel[31]="Arc: ";
$shipdatalabel[32]="Num: ";
$shipdatalabel[33]="Heavy Weapon 3: ";
$shipdatalabel[34]="Arc: ";
$shipdatalabel[35]="Num: ";
$shipdatalabel[36]="Heavy Weapon 4: ";
$shipdatalabel[37]="Arc: ";
$shipdatalabel[38]="Num: ";
$shipdatalabel[39]="Heavy Weapon 5: ";
$shipdatalabel[40]="Arc: ";
$shipdatalabel[41]="Num: ";
$shipdatalabel[42]="Heavy Weapon 6: ";
$shipdatalabel[43]="Arc: ";
$shipdatalabel[44]="Num: ";
$shipdatalabel[45]="Heavy Weapon 7: ";
$shipdatalabel[46]="Arc: ";
$shipdatalabel[47]="Num: ";
$shipdatalabel[48]="Heavy Weapon 8: ";
$shipdatalabel[49]="Arc: ";
$shipdatalabel[50]="Num: ";
$shipdatalabel[51]="Heavy Weapon 9: ";
$shipdatalabel[52]="Arc: ";
$shipdatalabel[53]="Num: ";
$shipdatalabel[54]="Heavy Weapon 10: ";
$shipdatalabel[55]="Arc: ";
$shipdatalabel[56]="Num: ";
$shipdatalabel[57]="Weapon 11: ";
$shipdatalabel[58]="Arc: ";
$shipdatalabel[59]="Num: ";
$shipdatalabel[60]="Weapon 12: ";
$shipdatalabel[61]="Arc: ";
$shipdatalabel[62]="Num: ";
$shipdatalabel[63]="Weapon 13: ";
$shipdatalabel[64]="Arc: ";
$shipdatalabel[65]="Num: ";
$shipdatalabel[66]="Weapon 14: ";
$shipdatalabel[67]="Arc: ";
$shipdatalabel[68]="Num: ";
$shipdatalabel[69]="Weapon 15: ";
$shipdatalabel[70]="Arc: ";
$shipdatalabel[71]="Num: ";
$shipdatalabel[72]="Weapon 16: ";
$shipdatalabel[73]="Arc: ";
$shipdatalabel[74]="Num: ";
$shipdatalabel[75]="Weapon 17: ";
$shipdatalabel[76]="Arc: ";
$shipdatalabel[77]="Num: ";
$shipdatalabel[78]="Weapon 18: ";
$shipdatalabel[79]="Arc: ";
$shipdatalabel[80]="Num: ";
$shipdatalabel[81]="Weapon 19: ";
$shipdatalabel[82]="Arc: ";
$shipdatalabel[83]="Num: ";
$shipdatalabel[84]="Weapon 20: ";
$shipdatalabel[85]="Arc: ";
$shipdatalabel[86]="Num: ";
$shipdatalabel[87]="Weapon 21: ";
$shipdatalabel[88]="Arc: ";
$shipdatalabel[89]="Num: ";
$shipdatalabel[90]="Weapon 22: ";
$shipdatalabel[91]="Arc: ";
$shipdatalabel[92]="Num: ";
$shipdatalabel[93]="Weapon 23: ";
$shipdatalabel[94]="Arc: ";
$shipdatalabel[95]="Num: ";
$shipdatalabel[96]="Weapon 24: ";
$shipdatalabel[97]="Arc: ";
$shipdatalabel[98]="Num: ";
$shipdatalabel[99]="Weapon 25: ";
$shipdatalabel[100]="Arc: ";
$shipdatalabel[101]="Probes: ";
$shipdatalabel[102]="T Bombs Base: ";
$shipdatalabel[103]="T Bombs Max: ";
$shipdatalabel[104]="Nuclear Mine Base: ";
$shipdatalabel[105]="Nuclear Mine Max: ";
$shipdatalabel[106]="Drone Control: ";
$shipdatalabel[107]="ADD_6: ";
$shipdatalabel[108]="ADD_12: ";
$shipdatalabel[109]="Shuttles Size: ";
$shipdatalabel[110]="Launch Rate: ";
$shipdatalabel[111]="General Base: ";
$shipdatalabel[112]="General Max: ";
$shipdatalabel[113]="Fighter Bay 1: ";
$shipdatalabel[114]="Fighter Type 1: ";
$shipdatalabel[115]="Fighter Bay 2: ";
$shipdatalabel[116]="Fighter Type 2: ";
$shipdatalabel[117]="Fighter Bay 3: ";
$shipdatalabel[118]="Fighter Type 3: ";
$shipdatalabel[119]="Fighter Bay 4: ";
$shipdatalabel[120]="Fighter Type 4: ";
$shipdatalabel[121]="Armor: ";
$shipdatalabel[122]="Forward Hull: ";
$shipdatalabel[123]="Center Hull: ";
$shipdatalabel[124]="Aft Hull: ";
$shipdatalabel[125]="Cargo: ";
$shipdatalabel[126]="Barracks: ";
$shipdatalabel[127]="Repair: ";
$shipdatalabel[128]="R_L_Warp: ";
$shipdatalabel[129]="C_Warp: ";
$shipdatalabel[130]="Impulse: ";
$shipdatalabel[131]="Apr: ";
$shipdatalabel[132]="Battery: ";
$shipdatalabel[133]="Bridge: ";
$shipdatalabel[134]="Security: ";
$shipdatalabel[135]="Lab: ";
$shipdatalabel[136]="Transporters: ";
$shipdatalabel[137]="Tractors: ";
$shipdatalabel[138]="Mech Tractors: ";
$shipdatalabel[139]="Special Sensors: ";
$shipdatalabel[140]="Sensors: ";
$shipdatalabel[141]="Scanners: ";
$shipdatalabel[142]="Explosion Strength: ";
$shipdatalabel[143]="Acceleration: ";
$shipdatalabel[144]="Damage Control: ";
$shipdatalabel[145]="Extra Damage: ";
$shipdatalabel[146]="Ship Cost: ";
$shipdatalabel[147]="Refit Base Class: ";
$shipdatalabel[148]="Geometry: ";
$shipdatalabel[149]="UI: ";
$shipdatalabel[150]="Full Name: ";
$shipdatalabel[151]="refits: ";
$shipdatalabel[152]="Balance: ";
$shipdatalabel[153]="End: ";
$shipdatalabel[154]=": ";
$shipdatalabel[155]="W1: ";
$shipdatalabel[156]="W2: ";
$shipdatalabel[157]="W3: ";
$shipdatalabel[158]="W4: ";
$shipdatalabel[159]="W5: ";
$shipdatalabel[160]="W6: ";
$shipdatalabel[161]="W7: ";
$shipdatalabel[162]="W8: ";
$shipdatalabel[163]="W9: ";
$shipdatalabel[164]="W10: ";
$shipdatalabel[165]="W11: ";
$shipdatalabel[166]="W12: ";
$shipdatalabel[167]="W13: ";
$shipdatalabel[168]="W14: ";
$shipdatalabel[169]="W15: ";
$shipdatalabel[170]="W16: ";
$shipdatalabel[171]="W17: ";
$shipdatalabel[172]="W18: ";
$shipdatalabel[173]="W19: ";
$shipdatalabel[174]="W20: ";
$shipdatalabel[175]="W21: ";
$shipdatalabel[176]="W22: ";
$shipdatalabel[177]="W23: ";
$shipdatalabel[178]="W24: ";
$shipdatalabel[179]="W25: ";
$shipdatalabel[180]="Weapon BPV: ";
$shipdatalabel[181]="FB1: ";
$shipdatalabel[182]="FB2: ";
$shipdatalabel[183]="FB3: ";
$shipdatalabel[184]="FB4: ";
$shipdatalabel[185]="Fighter Subtotal: ";
$shipdatalabel[186]="System BPV: ";
$shipdatalabel[187]="BPV Subtotal: ";
$shipdatalabel[188]="SFB Year First Available: ";
$shipdatalabel[189]="SFB Year Last Available: ";



	$filename = "shiplist.txt";
	$fp=fopen("$filename","rt");
	while (($shipdata = fgetcsv($fp, 1569, chr(9))) !== FALSE) {
		if ($shipdata[0] == $shiplistrace and $shipdata[2] == $shiptoview) {

			echo "<br><b>";
			echo $shipdata[2];
			echo "</b><br><br>";

			for ($i=3; $i<=189; $i++) {
				if ($shipdata[$i] <> "" and $shipdata[$i] <> "0") {
					echo $shipdatalabel[$i];
					echo $shipdata[$i];
					echo "<br><br>";
				}
			}
			echo "<br>";
		}
	}

	fclose($fp);
						
	echo ("</td>");
	echo ("</tr>");
echo ("</table>");
echo ("<br>");
echo ("</body>");
echo ("</html>");
?>