<?
session_start();
include("opendb.php");
if($wh)
{
wh();
}
if($hy)
{
print "<script> document.location='hydrinput.php' </script>";
}


function wh()
{
print "<center>"
?>
<link rel="stylesheet" href="style.css" type="text/css" />
<style>
tr{background-color:white}
</style>

<script>
function valid()
{
 if(document.f1.msno.value.length<=0)
 { alert ('Invalid Machine Serial No.'); return false;}
 if(confirm('Do you want to save?'))
  return true;
 else
  return false;
}
function popwar()
{
 if(document.f1.war.selectedIndex==2)
   window.open('popwar.php',menubar=false,resizable=false);
}

</script>
<center>
<form name='f1' action='svwh.php' onSubmit="return valid()"> 
<input type=hidden name='mtype' value='WH'>
<table cellspacing=1 cellpadding=5 bgcolor=lightsteelblue>
<th colspan=6 style={background-color:lightsteelblue}><h3>TURBO CHARGER DETAILS</h3>
TurboCharger</th>
<tr><td>Branch </td><td colspan=6><select name='brcode1'>
<?
$rrr=mysqli_query($db,"select brcode,brname from branch order by brname");
while($rr=mysqli_fetch_array($rrr))
{
 print "\n<option value='$rr[0]'>$rr[1]</option>";
}
?>
</select>
<tr><td>Type</td><td><select name='optype'><option value='op'>Opening</option>
<option value='-'>New</option>
<option value='os'>Out Station</option>
</select></td>
<td>Warranty </td><td><select name='war' onChange="popwar()">
		 	<option>Warranty</option>
		 	<option>Out_Warranty</option>
		 	<option>ASC</option>
			</select>
	</td>
<td>Engineer</td><td><select name='engineer'>
<option></option>
<?
 $re=mysqli_query($db,"select empcode,empname from empmaster where design like '%Engineer%'");
  while($row=mysqli_fetch_array($re))
  {
    print "\n<option value='$row[0]'>$row[1]</option>";
  }
?>
</select>

</tr>
<tr>
  <td>T.Serial No.</td><td><input type=text name='msno'></td>
  <td>Customer Type</td><td><select name='model'>
<?
 $re=mysqli_query($db,"select code,maname from machmaster where mtype='Wheeled Equipment'");
  while($row=mysqli_fetch_array($re))
  {
    print "\n<option value='$row[0]'>$row[1]</option>";
  }
?>
</select>
</td>
<td>Assembly No. </td><td><input type=text name='esno'></td></tr>
<tr><td>Engine Model </td><td><input type=text name='emodel'></td>
<td>Cust</td><td colspan=3>
<select name='cust'>
<option></option>
<?
 $re=mysqli_query($db,"select code,acname,dist1 from customer order by acname")or die(mysqli_error());
  while($row=mysqli_fetch_array($re))
  {
    print "\n<option value='$row[0]'>$row[1] - $row[dist1]</option>";
  }
?>
</select>
</td>
</tr>
<tr><td>Date of Sale</td><td colspan=2>dd<input type=text name='d' size=2 value='11'>
mm<input type=text name='m' size=2 value='11'>
dd<input type=text name='y' size=4 value='<?print date("Y")?>'></td>
<td>KMS  <input type=text name='hmr' size=5></td>
<td colspan=2>Entry Dt. dd <input type=text name='d1' size=2 value='<?print date("d")?>'>
		mm <input type=text name='m1' size=2 value='<?print date("m")?>'>
		yy <input type=text name='y1' size=4 value='<?print date("Y")?>'></td>
</tr>

</table>
<br>

<!--

<table align="center" cellpadding=2 cellspacing=1 bgcolor='lightsteelblue'>
<tr><td colspan=8 bgcolor='steelblue'><center><font color=white>SERVICE CODE AND DUE DATES</td></tr>

<tr bgcolor='lightsteelblue'>
<td colspan=1 align=center >S0</td>
<td colspan=1 align=center >S1</td>
<td colspan=1 align=center >S2</td>
<td colspan=1 align=center >S3</td>
<td colspan=1 align=center >S4</td>
<td colspan=1 align=center >S5</td>
</tr>
<tr align=right>
<TD>Days <input type=text name='s0d' size=2 value='7'><br>Hrs <input type=text name='s0h' size=2 value='50'></td>
<TD>Month <input type=text name='s1m' size=2 value='1'><br>Hrs <input type=text name='s1h' size=3 value='250'></td>
<TD>Month <input type=text name='s2m' size=2 value='2'><br>Hrs <input type=text name='s2h' size=3 value='500'></td>
<TD>Month <input type=text name='s3m' size=2 value='4'><br>Hrs <input type=text name='s3h' size=4 value='1000'></td>
<TD>Month <input type=text name='s4m' size=2 value='6'><br>Hrs <input type=text name='s4h' size=4 value='1500'></td>
<TD>Month <input type=text name='s5m' size=2 value='12'><br>Hrs <input type=text name='s5h' size=4 value='2000'></td></tr>

<tr bgcolor='lightsteelblue'>
<td colspan=1 align=center >S6</td>
<td colspan=1 align=center >S7</td>
<td colspan=1 align=center >S8</td>
<td colspan=1 align=center >S9</td>
<td colspan=1 align=center >S10</td>
<td colspan=1 align=center >S11</td>
</tr>
<tr align=right>
<TD>Month <input type=text name='s6m' size=2 value='7'><br>Hrs <input type=text name='s6h' size=4 value='2500'></td>
<TD>Month <input type=text name='s7m' size=2 value='1'><br>Hrs <input type=text name='s7h' size=4 value='3000'></td>
<TD>Month <input type=text name='s8m' size=2 value='2'><br>Hrs <input type=text name='s8h' size=4 value='3500'></td>
<TD>Month <input type=text name='s9m' size=2 value='4'><br>Hrs <input type=text name='s9h' size=4 value='4000'></td>
<TD>Month <input type=text name='s10m' size=2 value='6'><br>Hrs <input type=text name='s10h' size=4 value='4500'></td>
<TD>Month <input type=text name='s11m' size=2 value='12'><br>Hrs <input type=text name='s11h' size=4 value='5000'></td></tr>

</table>
&nbsp;
<table width="691" height="480" border="0" align="center" cellpadding="4" cellspacing="1" bgcolor='lightsteelblue'>
    <tr>
      <td colspan="8" align="center" height="21" bgcolor="#B0C4DE">MACHINE DETAILS</td>
    </tr>
    <tr>
      <td>1</td>
      <td height="12">Hydraulic Pump Sr.no</td>
      <td height="12" align="center"><input type="text" name='hpump' size="15" /></td>
      <td height="12">Make</td>
      <td height="12" align="center"><input type="text" name='hmake' size="15" /></td>
      <td height="12" align="center">&nbsp;</td>
      <td height="12" align="center">&nbsp;</td>
    </tr>
    
    <tr>
      <td width="18">2</td>
      <td height="20" width="146">Trans Sr NO.</td>
      <td height="20" width="115" align="center"><input type=text name='trsno' size="15"></td>
      <td height="20" width="68">&nbsp;</td>
      <td height="20" width="115" align="center">&nbsp;</td>
      <td height="20" width="57" align="center">&nbsp;</td>
      <td height="20" width="108" align="center">&nbsp;</td>
    </tr>
    <tr>
      <td width="18">3</td>
      <td height="21" width="146">Rear Axle Sr.no</td>
      <td height="21" width="115" align="center"><input type=text name='raxilsno' size="15"></td>
      <td height="21" width="68">Make</td>
      <td height="21" width="115" align="center"><input type=text name='rmake' size="15"></td>
      <td height="21" width="57" align="center"></td>
      <td height="21" width="108" align="center"></td>
    </tr>
    <tr>
      <td width="18">4</td>
      <td height="30" width="146">Front Axle Sr.no</td>
      <td height="30" width="115" align="center"><input type=text name='faxilno' size="15"></td>
      <td height="30" width="68">Make</td>
      <td height="30" width="115" align="center"><input type=text name='fmake' size="15"></td>
      <td height="30" width="57" align="center"></td>
      <td height="30" width="108" align="center">&nbsp;</td>
    </tr>
    <tr>
      <td width="18">5</td>
      <td height="28" width="146">Fuel Injection Pump No.</td>
      <td height="28" width="115" align="center"><input type=text name='fpump' size="15"></td>
      <td height="12" width="68">Make</td>
      <td height="12" width="115" align="center"><input type=text name='fumake' size="15"></td>
      <td height="28" width="57" align="center">&nbsp;</td>
      <td height="28" width="108" align="center">&nbsp;</td>
    </tr>
    <tr>
      <td>6</td>
      <td height="12">Loader Control Valve Sr.No</td>
      <td height="12" align="center"><input type="text" name='lvalve' size="15" /></td>
      <td height="12">Make</td>
      <td height="12" align="center"><input type="text" name='lvmake' size="15" /></td>
      <td height="12" align="center">&nbsp;</td>
      <td height="12" align="center">&nbsp;</td>
    </tr>
    <tr>
      <td>7</td>
      <td height="12">Escavator&nbsp; Control Valve Sr.No.</td>
      <td height="12" align="center"><input type="text" name='esvalve' size="15" /></td>
      <td height="12">Make</td>
      <td height="12" align="center"><input type="text" name='esmake' size="15" /></td>
      <td height="12" align="center">&nbsp;</td>
      <td height="12" align="center">&nbsp;</td>
    </tr>
    <tr>
      <td>8</td>
      <td height="19">Stabilizer&nbsp; Control Valve Sr.no</td>
      <td height="19" align="center"><input type="text" name='stavalve' size="15" /></td>
      <td height="19">Make</td>
      <td height="19" align="center"><input type="text" name='stamake' size="15" /></td>
      <td height="19" align="center">&nbsp;</td>
      <td height="19" align="center">&nbsp;</td>
    </tr>
    <tr>
      <td>9</td>
      <td height="20">Battery No</td>
      <td height="20" align="center"><input type="text" name='batno' size="15" />
      </td>
      <td height="20" align="center"><div align="left">Make</div></td>
      <td height="20" align="center"><input type="text" name='batmake' size="15" /></td>
      <td height="29" align="center"></td>
      <td height="29" align="center"></td>
    </tr>
    <tr>
      <td>10</td>
      <td height="20">Boom Cylinder </td>
      <td height="19" align="center"><input name='boocyl' type="text" id="boocyl" size="15" /></td>
      <td height="19">Make</td>
      <td height="19" align="center"><input name='boocylmk' type="text" id="boocylmk" size="15" /></td>
      <td height="29" align="center"></td>
      <td height="29" align="center"></td>
    </tr>
    
    <tr>
      <td width="18">11</td>
      <td height="23" width="146">Arm Cylinder</td>
      <td height="23" width="115" align="center"><input type=text name='acylin' size="15"></td>
     <td>Make </td><td><center>
       <input type=text name='acylmk' size=15>
     </center>
     </td><td></td><td></td></tr> 
<tr>
  <td width="18">12</td>
     <td height="23" width="146">Bucket Cylinder</td>
      <td height="23" width="115" align="center"><input type=text name='bucylin' size="15"></td>
      <td height="23" width="68" >Make</td>
      <td height="23" width="115"><center>
        <input type=text name='bucylmk' size=15>
      </center>      </td><td></td><td></td>
  </tr>
    <tr>
      <td width="18">13</td>
      <td height="8" width="146">Lift cylinder (LH)</td>
      <td height="8" width="115" align="center"><input type=text name='lcylinlh' size="15"></td>
	<td height="8" width="68">Make</td>
      <td height="8" width="115"><center>
        <input type=text name='lcylinlhmk' size="15">
      </center>      </td><td></td>
	<td></td>
    </tr>

<tr>
  <td width="18">14</td>
      <td height="8" width="146">Lift cylinder (RH)</td>
      <td height="8" width="115" align="center"><input type=text name='lcylinrh' size="15"></td>
      <td height="8" width="68" >Make</td>
      <td height="8" width="115" align="center"><input type=text name='lcylinrhmk' size="15"></td>
	<td></td>	<td></td>
  </tr>
    <tr>
      <td width="18">15</td>
      <td height="31" width="146">Tilt Cylinder(LH)</td>
      <td height="31" width="115" align="center"><input type=text name='ticylin' size="15"></td>
      <td height="31" width="68">Make</td>
      <td align=center><input type=text name='ticylinmk' size="15"></td><td></td><td></td>
  <tr>
    <td>16</td>
    <td height="31">Tilt Cylinder(RH)</td>
    <td height="31" align="center"><input name='ticylinrh' type="text" id="ticylinrh" size="15" /></td>
    <td height="31">Make</td>
    <td align="center"><input name='ticylinrhmk' type="text" id="ticylinrhmk" size="15" /></td>
    <td></td>
    <td></td>
  </tr>
    <tr>
      <td>17</td>
      <td height="9">Steering Cylinder </td>
      <td height="31" align="center"><input name='steecylin' type="text" id="steecylin" size="15" /></td>
      <td height="31">Make</td>
      <td align="center"><input name='steecylinmk' type="text" id="steecylinmk" size="15" /></td>
      <td></td>
      <td></td>
    <tr>
      <td width="18">18</td>
      <td height="9" width="146">Slew Cylinder (LH)</td>
      <td height="9" width="115" align="center"><input name='slewcylin' type=text id="slewcylin" size="15"></td>
      <td>Make</td><td align=center><input name='slewcylinmk' type=text id="slewcylinmk" size="15"></td><td></td>	
	<td></td>
 <tr>
      <td width="18">19</td>
      <td height="9" width="146">Slew Cylinder (RH)</td>
      <td height="9" width="115" align="center"><input name='slewcylinrh' type=text id="slewcylinrh" size="15"></td>
      <td height="9" width="68">Make</td>
      <td height="9" width="115" align="center"><input name='slewcylinrhmk' type=text id="slewcylinrhmk" size="15"></td>
	<td></td><td></td>
  </tr>
    <tr>
      <td width="18">20</td>
      <td height="27" width="146">Stabilizer(LH)</td>
      <td height="27" width="115" align="center"><input type=text name='stablh' size="15"></td>
      <td height="27" width="68">Make</td>
      <td height="27" width="115" align="center"><input name='stablhmk' type=text id="stablhmk" size="15"></td>
      <td height="27" width="57" align="center">&nbsp;</td>
      <td height="27" width="108" align="center">&nbsp;</td>
    </tr>
    <tr>
      <td>21</td>
      <td height="27">Stabilizer(RH)</td>
      <td height="27" align="center"><input name='stabrh' type="text" id="stabrh" size="15" /></td>
      <td height="27">Make</td>
      <td height="27" align="center"><input name='stabrhmk' type="text" id="stabrhmk" size="15" /></td>
      <td height="27" align="center">&nbsp;</td>
      <td height="27" align="center">&nbsp;</td>
    </tr>
    <tr>
      <td>22</td>
      <td height="23">Bucket Escavator Capacity </td>
      <td height="23" align="center"><input name='bukexc' type="text" id="bukexc" size="15" /></td>
      <td height="27">Make</td>
      <td height="27" align="center"><input name='bukexcmk' type="text" id="bukexcmk" size="15" /></td>
      <td height="23" align="center">&nbsp;</td>
      <td height="23" align="center">&nbsp;</td>
    </tr>
    <tr>
      <td>23</td>
      <td height="23">Bucket Loader Capacity </td>
      <td height="23" align="center"><input name='buklodcapa' type="text" id="buklodcapa" size="15" /></td>
      <td height="27">Make</td>
      <td height="27" align="center"><input name='bukloadmk' type="text" id="bukloadmk" size="15" /></td>
      <td height="23" align="center">&nbsp;</td>
      <td height="23" align="center">&nbsp;</td>
    </tr>
    <tr>
      <td width="18">24</td>
      <td height="23" width="146">Front (RH) Tyre Sr.no</td>
      <td height="23" width="115" align="center"><input type=text name='frrh' size="15"></td>
      <td height="23" width="68">Make</td>
      <td height="23" width="115" align="center"><input type=text name='frrhmake' size="15"></td>
      <td height="23" width="57" align="center">Size</td>
      <td height="23" width="108" align="center"><input type=text name='frrhsize' size="15"></td>
    </tr>
    <tr>
      <td width="18">25</td>
      <td height="23" width="146">Rear (LH) Tyre Sr.no</td>
      <td height="23" width="115" align="center"><input type=text name='rrlh' size="15"></td>
      <td height="23" width="68">Make</td>
      <td height="23" width="115" align="center"><input type=text name='rrlhmake' size="15"></td>
      <td height="23" width="57" align="center">Size</td>
      <td height="23" width="108" align="center"><input type=text name='rrlhsize' size="15"></td>
    </tr>
    <tr>
      <td width="18">26</td>
      <td height="23" width="146">Rear (RH) Tyre Sr.no</td>
      <td height="23" width="115" align="center"><input type=text name='rrrh' size="15"></td>
      <td height="23" width="68">Make</td>
      <td height="23" width="115" align="center"><input type=text name='rrrhmake' size="15"></td>
      <td height="23" width="57" align="center">Size</td>
      <td height="23" width="108" align="center"><input type=text name='rrrhsize' size="15"></td>
    </tr>
--> 
<tr><td colspan=8 align=center bgcolor='steelblue'><input type=submit value='Save'></td></tr>
</table>

<?
} // END FUNCTION WH
?>
