<?php

$userid = $_SESSION['id'];

require ('connect_to_mysql.php');

$truckname = $_POST['stock'];
$truckdescription = $_POST['truckdescription'];
$year = $_POST['year'];
$type = $_POST['type'];
$vin = $_POST['vin'];
$chassis = $_POST['chassis'];
$gvw = $_POST['gvw'];
$odometer = $_POST['odometer'];
$engine = $_POST['engine'];
$trans = $_POST['trans'];
$suspension = $_POST['suspension'];
$brakes = $_POST['brakes'];
$tires = $_POST['tires'];
$color = $_POST['color'];
$radio = $_POST['radio'];
$body = $_POST['body'];
$winch = $_POST['winch'];
$wl = $_POST['wl'];
$tb = $_POST['tb'];
$pto = $_POST['pto'];
$price = $_POST['price'];
$fa = $_POST['fa'];
$ra = $_POST['ra'];
$wb = $_POST['wb'];
$it = $_POST['it'];
$ac = $_POST['ac'];
$jb = $_POST['jb'];
$glider = $_POST['glider'];
$sleeper = $_POST['sleeper'];
$pw = $_POST['pw'];
$pl = $_POST['pl'];
$cc = $_POST['cc'];
$bumper = $_POST['bumper'];
$ft = $_POST['ft'];
$stacks = $_POST['stacks'];
$ws = $_POST['ws'];
$eb = $_POST['eb'];
$ey = $_POST['ey'];
$ca = $_POST['ca'];
$bm = $_POST['bm'];
$sf = $_POST['sf'];
$wf = $_POST['wf'];
$ct = $_POST['ct'];
$tbar = $_POST['tbar'];
$dseat = $_POST['dseat'];
$ps = $_POST['ps'];
$ds = $_POST['ds'];
$rr = $_POST['rr'];
$rc = $_POST['rc'];
$pc = $_POST['pc'];
$sp = $_POST['sp'];
$lb = $_POST['lb'];
$tl = $_POST['tl'];
$cm = $_POST['cm'];
$dc = $_POST['dc'];
$chains = $_POST['chains'];
$hs = $_POST['hs'];
$out = $_POST['outrig'];
$sla = $_POST['sla'];
$ff = $_POST['ff'];
$fw = $_POST['fw'];
$ph = $_POST['ph'];
$TX = $_POST['TX'];
$TT = $_POST['TT'];
$TM = $_POST['TM'];
$TZ = $_POST['TZ'];
$TW = $_POST['TW'];
$TS = $_POST['TS'];
$TN = $_POST['TN'];
$TY = $_POST['TY'];
$TV = $_POST['TV'];
$TR = $_POST['TR'];
$TC = $_POST['TC'];
$TD = $_POST['TD'];
$TE = $_POST['TE'];
$TF = $_POST['TF'];

 

if ($truckdescription)
{
$sql = mysql_query("INSERT INTO trucks (userid, name, description, year, vin, count, cover, chassis, gvw, odometer, engine, trans, suspension, brakes, tires, color, radio, body, winch, wl, tb, pto, price, type, fa, ra, wb, it, dseat, ps, ac, jb, glider, sleeper, pw, pl, cc, bumper, ft, stacks, ws, eb, ey, ca, bm, sf, wf, ct, tbar, ds, rr, rc, pc, sp, lb, tl, cm, dc, chains, hs, outrig, sla, ff, fw, ph, TX, TT, TM, TZ, TW, TS, TN, TY, TV, TR, TC, TD, TE, TF) VALUES ('$userid', '$truckname', '$truckdescription', '$year', '$vin', '0', 'nocover.jpg', '$chassis', '$gvw', '$odometer', '$engine', '$trans', '$suspension', '$brakes', '$tires', '$color', '$radio', '$body', '$winch', '$wl', '$tb', '$pto', '$price', '$type', '$fa', '$ra', '$wb', '$it', '$dseat', '$ps', '$ac', '$jb', '$glider', '$sleeper', '$pw', '$pl', '$cc', '$bumper', '$ft', '$stacks', '$ws', '$eb', '$ey', '$ca', '$bm', '$sf', '$wf', '$ct', '$tbar', '$ds', '$rr', '$rc', '$pc', '$sp', '$lb', '$tl', '$cm', '$dc', '$chains', '$hs', '$outrig', '$sla', '$ff', '$fw', '$ph', '$TX', '$TT', '$TM', '$TZ', '$TW', '$TS', '$TN', '$TY', '$TV', '$TR', '$TC', '$TD', '$TE', '$TF')") or die (mysql_error());

die("Truck Added! <FORM METHOD='LINK' ACTION='Add_Truck_Pics.php'><label class='uiButton uiButtonConfirm uiButtonMedium'><INPUT TYPE='submit' VALUE='Click Here to Add Pictures' ></label> </FORM></td>
<td width='154' valign='top' ><h1>&nbsp;</h1>
<p>&nbsp; </p>
<p>&nbsp; </p></td>
</tr>
</table>
<p>&nbsp;</p> <br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /></td>
<td width='10' rowspan='2' valign='top'>&nbsp;</td>
</tr>
<tr > </tr>
</table></div><style type='text/css'>
<!--
body {
background-color: #4f4f4f;
}
body,td,th {
color: #000;
}
a:link {
color: #FFF;
text-decoration: none;
}
a:visited {
color: #FFF;
text-decoration: none;
}
a:hover {
color: #CCC;
text-decoration: none;
}
a:active {
color: #CCC;
text-decoration: none;
}
-->
</style>
<table width='984' border='0' align='center' bgcolor='#4f4f4f'>
<tr>
<td>
<div align='center'>
<br />
<br /><br />
<font color='#FFFFFF'>Copyright &copy;2009-TowSwap.com&nbsp; &nbsp;&nbsp; | &nbsp;&nbsp;
<!-- Please do not remove Core link -->
Powered By: </font><a href='http://www.NewTowTrucks.com' target='_blank'>NewTowTrucks.com</a>
<!-- End Please do not remove Core link -->
</div>
</td>
</tr>
</table>
<script type='text/javascript'>
<!--
var MenuBar1 = new Spry.Widget.MenuBar('MenuBar1', {imgDown:'SpryMenuBarDownHover.gif', imgRight:'SpryMenuBarRightHover.gif'});
//-->
</script>
</body>
</html>");
}

if ($truckname)
{
echo "
To upload your truck, please provide the following information and click the add button.
<form action='add.php' method='POST' enctype='multipart/form-data' name='form' id='form' onsubmit='return validate_form ( );'>
<table width='200' border='0'>
<tr>
<td nowrap style='text-align: right'>Description: </td>
<td nowrap style='text-align: left'><textarea name='truckdescription'></textarea></td>
</tr>
<tr>
<td nowrap style='text-align: right'>Equipment Type:</td>
<td style='text-align: left'><select name='type' id='type'>
<option id='Light Wrecker' value='1'>Light Wrecker</option>
<option id='Med Wrecker' value='2'>Med Wrecker</option>
<option id='HD Wrecker' value='3'>HD Wrecker</option>
<option id='Light Carrier' value='4'>Light Carrier</option>
<option id='Med Carrier' value='5'>Med Carrier</option>
<option id='Heavy Duty' value='6'>HD Carrier</option>
<option id='New Wrecker' value='7'>New Wrecker</option>
<option id='New Carrier' value='8'>New Carrier</option>
</select></td>
</tr>
<tr>
<td nowrap style='text-align: right'>Chassis:</td>
<td style='text-align: left'><input name='chassis' type='text' id='chassis'></td>
</tr>
<tr>
<td nowrap style='text-align: right'>Year:</td>
<td style='text-align: left'><select name='year' id='year'>
<option id='2013'>2013</option>
<option id='2012'>2012</option>
<option id='2011'>2011</option>
<option id='2010'>2010</option>
<option id='2009'>2009</option>
<option id='2008'>2008</option>
<option id='2007'>2007</option>
<option id='2006'>2006</option>
<option id='2005'>2005</option>
<option id='2004'>2004</option>
<option id='2003'>2003</option>
<option id='2002'>2002</option>
<option id='2001'>2001</option>
<option id='2000'>2000</option>
<option id='1999'>1999</option>
<option id='1998'>1998</option>
<option id='1997'>1997</option>
<option id='1996'>1996</option>
<option id='1995'>1995</option>
<option id='1994'>1994</option>
<option id='1993'>1993</option>
<option id='1992'>1992</option>
<option id='1991'>1991</option>
<option id='1990'>1990</option>
<option id='1989'>1989</option>
<option id='1988'>1988</option>
<option id='1987'>1987</option>
<option id='1986'>1986</option>
<option id='1985'>1985</option>
<option id='1984'>1984</option>
<option id='1983'>1983</option>
<option id='1982'>1982</option>
<option id='1981'>1981</option>
<option id='1980'>1980</option>
<option id='1979'>1979</option>
<option id='1978'>1978</option>
<option id='1977'>1977</option>
<option id='1976'>1976</option>
<option id='1975'>1975</option>
<option id='1974'>1974</option>
<option id='1973'>1973</option>
<option id='1972'>1972</option>
<option id='1971'>1971</option>
<option id='1970'>1970</option>
<option id='1969'>1969</option>
<option id='1968'>1968</option>
<option id='1967'>1967</option>
<option id='1966'>1966</option>
<option id='1965'>1965</option>
<option id='1964'>1964</option>
<option id='1963'>1963</option>
<option id='1962'>1962</option>
<option id='1961'>1961</option>
<option id='1960'>1960</option>
</select></td>
</tr>
<tr>
<td nowrap style='text-align: right'>Last 8 of Vin: </td>
<td style='text-align: left'><input type='text' name='vin' id='vin' maxlength='8'></td>
</tr>
<tr>
<td nowrap style='text-align: right'>Front Axle:</td>
<td style='text-align: left'><input type='text' name='fa' id='fa'></td>
</tr>
<tr>
<td nowrap style='text-align: right'>Rear Axle:</td>
<td style='text-align: left'><input type='text' name='ra' id='ra'></td>
</tr>
<tr>
<td nowrap style='text-align: right'>GVW:</td>
<td style='text-align: left'><input type='text' name='gvw' id='gvw'></td>
</tr>
<tr>
<td nowrap style='text-align: right'>Odometer:</td>
<td style='text-align: left'><input type='text' name='odometer' id='odometer'></td>
</tr>
<tr>
<td nowrap style='text-align: right'>Engine: </td>
<td style='text-align: left'><input type='text' name='engine' id='engine'></td>
</tr>
<tr>
<td nowrap style='text-align: right'>Transmission: </td>
<td style='text-align: left'><input type='text' name='trans' id='trans'></td>

</tr>
<tr>
<td nowrap style='text-align: right'>Suspension:</td>
<td style='text-align: left'><input type='text' name='suspension' id='suspension'></td>
</tr>
<tr>
<td nowrap style='text-align: right'>Brakes: </td>
<td style='text-align: left'><select name='brakes' id='brakes'>
<option id='Hydraulic'>Hydraulic</option>
<option id='Air'>Air</option>
</select>
</td>
</tr>
<tr>
<td nowrap style='text-align: right'>Tires:</td>
<td style='text-align: left'><input type='text' name='tires' id='tires'></td>
</tr>
<tr>
<td nowrap style='text-align: right'>Color:</td>
<td style='text-align: left'><input type='text' name='color' id='color'></td>
</tr>
<tr>
<td nowrap style='text-align: right'>Radio:</td>
<td style='text-align: left'><input type='text' name='radio' id='radio'></td>
</tr>
<tr>
<td nowrap style='text-align: right'>Winch:</td>
<td style='text-align: left'><input type='text' name='winch' id='winch'></td>
</tr>
<tr>
<td nowrap style='text-align: right'>Wheel Lift:</td>
<td style='text-align: left'><input type='text' name='wl' id='wl'></td>
</tr>
<tr>
<td nowrap style='text-align: right'>Tool Boxes:</td>
<td style='text-align: left'><input type='text' name='tb' id='tb'></td>
</tr>
<tr>
<td nowrap style='text-align: right'>PTO:</td>
<td style='text-align: left'><input type='text' name='pto' id='pto'></td>
</tr>

<tr>
<td nowrap style='text-align: right'>Wheel Base:</td>
<td style='text-align: left'><input type='text' name='wb' id='wb'></td>
</tr>
<tr>
<td nowrap style='text-align: right'>Interior:</td>
<td style='text-align: left'><select name='it' id='it'>
<option id='Excellent'>Excellent</option>
<option id='Good'>Good</option>
<option id='Bad'>Bad</option>
</select>
</td>
</tr>
<tr>
<td nowrap style='text-align: right'>Drivers Seat:</td>
<td style='text-align: left'><select name='dseat' id='dseat'>
<option id='Bench'>Bench</option>
<option id='Air Ride'>Air Ride</option>
<option id='40-20-40'>40-20-40</option>
</select>
</td>
</tr>
<tr>
<td nowrap style='text-align: right'>Passenger Seat:</td>
<td style='text-align: left'><select name='ps' id='ps'>
<option id='Bench'>Bench</option>
<option id='Air Ride'>Air Ride</option>
<option id='40-20-40'>40-20-40</option>
</select>
</td>
</tr>
<tr>
<td nowrap style='text-align: right'>Air Conditioning:</td>
<td style='text-align: left'><select name='ac' id='ac'>
<option id='Yes'>Yes</option>
<option id='No'>No</option>
</select>
</td>
</tr>
<tr>
<td nowrap style='text-align: right'>Jake Brake:</td>
<td style='text-align: left'><select name='jb' id='jb'>
<option id='Yes'>Yes</option>
<option id='No'>No</option>
</select>
</td>
</tr>
<tr>
<td nowrap style='text-align: right'>Glider:</td>
<td style='text-align: left'><select name='glider' id='glider'>
<option id='Yes'>Yes</option>
<option id='No'>No</option>
</select>
</td>
</tr>
<tr>
<td nowrap style='text-align: right'>Sleeper:</td>
<td style='text-align: left'><select name='sleeper' id='sleeper'>
<option id='Yes'>Yes</option>
<option id='No'>No</option>
</select></td>
</tr>
<tr>
<td nowrap style='text-align: right'>Power Windows:</td>
<td style='text-align: left'><select name='pw' id='pw'>
<option id='Yes'>Yes</option>
<option id='No'>No</option>
</select>
</td>
</tr>
<tr>
<td nowrap style='text-align: right'>Power Door Locks:</td>
<td style='text-align: left'><select name='pl' id='pl'>
<option id='Yes'>Yes</option>
<option id='No'>No</option>
</select>
</td>
</tr>
<tr>
<td nowrap style='text-align: right'>Cruise Control:</td>
<td style='text-align: left'><select name='cc' id='cc'>
<option id='Yes'>Yes</option>
<option id='No'>No</option>
</select></td>
</tr>
<tr>
<td nowrap style='text-align: right'>Bumper:</td>
<td style='text-align: left'><select name='bumper' id='bumper'>
<option id='Painted'>Painted</option>
<option id='Chrome'>Chrome</option>
<option id='Push'>Push</option>
</select>
</td>
</tr>
<tr>
<td nowrap style='text-align: right'>Fuel Tank(s):</td>
<td style='text-align: left'><input type='text' name='ft' id='ft'></td>
</tr>
<tr>
<td nowrap style='text-align: right'>Stack(s):</td>
<td style='text-align: left'><select name='stacks' id='stacks'>
<option id='None'>None</option>
<option id='1'>1</option>
<option id='2'>2</option>
</select>
</td>
</tr>
<tr>
<td nowrap style='text-align: right'>Wheels Simulators:</td>
<td style='text-align: left'><select name='ws' id='ws'>
<option id='Yes'>Yes</option>
<option id='No'>No</option>
</select>
</td>
</tr>
<tr>
<td nowrap style='text-align: right'>Equipment Brand:</td>
<td style='text-align: left'><input type='text' name='eb' id='eb'></td>
</tr>
<tr>
<td nowrap style='text-align: right'>Equipment Year:</td>
<td style='text-align: left'><input type='text' name='ey' id='ey'></td>
</tr>
<tr>
<td nowrap style='text-align: right'>Cab to Axle:</td>
<td style='text-align: left'><input type='text' name='ca' id='ca'></td>
</tr>
<tr>
<td nowrap style='text-align: right'>Body Material:</td>
<td style='text-align: left'><input type='text' name='bm' id='bm'></td>
</tr>
<tr>
<td nowrap style='text-align: right'>Subframe:</td>
<td style='text-align: left'><select name='sf' id='sf'>
<option id='Excellent'>Excellent</option>
<option id='Good'>Good</option>
<option id='Bad'>Bad</option>
</select>
</td>
</tr>
<tr>
<td nowrap style='text-align: right'>Winch Free Wheel:</td>
<td style='text-align: left'><select name='wf' id='wf'>
<option id='Yes'>Yes</option>
<option id='No'>No</option>
</select></td>
</tr>
<tr>
<td nowrap style='text-align: right'>Cable Tensioner:</td>
<td style='text-align: left'><select name='ct' id='ct'>
<option id='Yes'>Yes</option>
<option id='No'>No</option>
</select></td>
</tr>
<tr>
<td nowrap style='text-align: right'>Tow Bar:</td>
<td style='text-align: left'><select name='tbar' id='tbar'>
<option id='Yes'>Yes</option>
<option id='No'>No</option>
</select></td>
</tr>
<tr>
<td nowrap style='text-align: right'>Dock Stablizer:</td>
<td style='text-align: left'><select name='ds' id='ds'>
<option id='Yes'>Yes</option>
<option id='No'>No</option>
</select></td>
</tr>
<tr>
<td nowrap style='text-align: right'>Removable Rails:</td>
<td style='text-align: left'><select name='rr' id='rr'>
<option id='Yes'>Yes</option>
<option id='No'>No</option>
</select>
</td></tr>
<tr>
<td nowrap style='text-align: right'>Hydraulic Spades:</td>
<td style='text-align: left'><select name='hs' id='hs'>
<option id='Yes'>Yes</option>
<option id='No'>No</option>
</select>
</td>
</tr>
<tr>
<td nowrap style='text-align: right'>Outriggers / Jacks:</td>
<td style='text-align: left'><select name='outrig' id='outrig'>
<option id='Yes'>Yes</option>
<option id='No'>No</option>
</select>
</td>
</tr>
<tr>
<td nowrap style='text-align: right'>Remote Control:</td>
<td style='text-align: left'><select name='rc' id='rc'>
<option id='Yes'>Yes</option>
<option id='No'>No</option>
</select></td>
</tr>
<tr>
<td nowrap style='text-align: right'>Paint Condition:</td>
<td style='text-align: left'><select name='pc' id='pc'>
<option id='Excellent'>Excellent</option>
<option id='Good'>Good</option>
<option id='Bad'>Bad</option>
</select></td>
</tr>
<tr>
<td nowrap style='text-align: right'>Switch Panel:</td>
<td style='text-align: left'><input type='text' name='sp' id='sp'>
</td>
</tr>
<tr>
<td nowrap style='text-align: right'>Lightbar:</td>
<td style='text-align: left'><input type='text' name='lb' id='lb'></td>
</tr>
<tr>
<td nowrap style='text-align: right'>Tag Lights:</td>
<td style='text-align: left'><select name='tl' id='tl'>
<option id='Yes'>Yes</option>
<option id='No'>No</option>
</select></td>
</tr>
<tr>
<td nowrap style='text-align: right'>Spring Lift Attachment:</td>
<td style='text-align: left'><select name='sla' id='sla'>
<option id='Yes'>Yes</option>
<option id='No'>No</option>
</select>
</td>
</tr>
<tr>
<td nowrap style='text-align: right'>Frame Forks:</td>
<td style='text-align: left'><select name='ff' id='ff'>
<option id='Yes'>Yes</option>
<option id='No'>No</option>
</select>
</td></tr>
<tr>
<td nowrap style='text-align: right'>5th Wheel Attachment:</td>
<td style='text-align: left'><select name='fw' id='fw'>
<option id='Yes'>Yes</option>
<option id='No'>No</option>
</select>
</td></tr>
<tr>
<td nowrap style='text-align: right'>Pintle Hitch:</td>
<td style='text-align: left'><select name='ph' id='ph'>
<option id='Yes'>Yes</option>
<option id='No'>No</option>
</select>
</td></tr>
<tr>
<td nowrap style='text-align: right'>Crossmember Condition:</td>
<td style='text-align: left'><select name='cm' id='cm'><option id='Excellent'>Excellent</option>
<option id='Good'>Good</option>
<option id='Bad'>Bad</option>
</select></td>
</tr>
<tr>
<td nowrap style='text-align: right'>Deck Condition:</td>
<td style='text-align: left'><select name='dc' id='dc'><option id='Excellent'>Excellent</option>
<option id='Good'>Good</option>
<option id='Bad'>Bad</option>
</select></td>
</tr>
<tr>
<td nowrap style='text-align: right'>Chains:</td>
<td style='text-align: left'><select name='chains' id='chains'>
<option id='Yes'>Yes</option>
<option id='No'>No</option>
</select></td>
</tr>
<tr>
<td nowrap style='text-align: right'>Price:</td>
<td style='text-align: left'><font size='+2'><b>$</b></font><input type='text' name='price' id='price'></td>
</tr>
<tr>
<td nowrap style='text-align: right'>TIRES</td>
<td style='text-align: left'>
<table width='500' height='99' border='0' cellpadding='0' cellspacing='0'>
<tr>
<th width='122' scope='col'>&nbsp;</th>
<td width='139' scope='col'><div align='center' id='Tire'><input SIZE='2' type='text' name='TX' id='TX'>/32</div></td>
<td width='126' scope='col'><div align='center' id='Tire'><input SIZE='2' type='text' name='TT' id='TT'>/32</div></td>
<td width='113' scope='col'><div align='center' id='Tire'><input SIZE='2' type='text' name='TM' id='TM'>/32</div></td>
</tr>
<tr>
<td><div align='center' id='Tire'><input SIZE='2' type='text' name='TZ' id='TZ'>/32</div></td>
<td><div align='center' id='Tire'><input SIZE='2' type='text' name='TW' id='TW'>/32</div></td>
<td><div align='center' id='Tire'><input SIZE='2' type='text' name='TS' id='TS'>/32</div></td>
<td><div align='center' id='Tire'><input SIZE='2' type='text' name='TN' id='TN'>/32</div></td>
</tr>
<tr>
<td><div align='center' id='Tire'><input SIZE='2' type='text' name='TY' id='TY'>/32</div></td>
<td><div align='center' id='Tire'><input SIZE='2' type='text' name='TV' id='TV'>/32</div></td>
<td><div align='center' id='Tire'><input SIZE='2' type='text' name='TR' id='TR'>/32</div></td>
<td><div align='center' id='Tire'><input SIZE='2' type='text' name='TC' id='TC'>/32</div></td>
</tr>
<tr>
<td>&nbsp;</td>
<td><div align='center' id='Tire'><input SIZE='2' type='text' name='TD' id='TD'>/32</div></td>
<td><div align='center' id='Tire'><input SIZE='2' type='text' name='TE' id='TE'>/32</div></td>
<td><div align='center' id='Tire'><input SIZE='2' type='text' name='TF' id='TF'>/32</div></td>
</tr>
</table>
</td></tr><tr>
<td nowrap style='text-align: right'></td>
<td style='text-align: left'><label class='uiButton uiButtonConfirm uiButtonMedium'><input type='submit' name='submit' value='Add'></label>
<input type='hidden' name='stock' value='$truckname'></td>
</tr>
</table>

</form>";
}

?>