<?php 
$sql_query=DB_query("select * from machine_center where id='".$_REQUEST['Id']."'",$db);
$rowresult=DB_fetch_array($sql_query);
?>
<h2 align="center"> View Machine Center Master</h2>
<form action="" method="post" enctype="multipart/form-data">
<table width="90%" border="0" cellspacing="2" cellpadding="1">
  <tr>
    <td valign="top"><fieldset><legend><strong>Machine Details</strong></legend><table width="100%" border="0" cellspacing="2" cellpadding="1" style="background-color:#FFF; border:solid 1px #CCC" align="center">
      <tr>
        <th width="55%" scope="row">Code</th>
        <td width="45%"><label>
          <input type="text" name="code" id="code" style="width:100%" value="<?php echo $rowresult['code']; ?>" />
        </label></td>
      </tr>
      <tr>
        <th scope="row">Name</th>
        <td><input type="text" name="name" id="name" style="width:100%" value="<?php echo $rowresult['name']; ?>"/></td>
      </tr>
      <tr>
        <th scope="row">Under Group</th>
        <td>
        <select name="under_group"  id="under_group" style="width:100%" >
          <?php $sql="select * from machine_group_master where  id='".$rowresult['under_group']."'";
		$query=DB_query($sql,$db);
		while($row1=DB_fetch_array($query))
		{	
		?>
			<option value="<?php echo $row1['id']; ?>"><?php echo $row1['machine_gp_location']; ?></option>
		<?php }	?>        	
        </select>   	
        	</td></tr>
      <tr>
        <th scope="row">Sr. No.</th>
        <td><input type="text" name="sr_no" id="sr_no" style="width:100%" value="<?php echo $rowresult['sr_no']; ?>"/></td>
      </tr>
      <tr>
        <th scope="row">Model No.</th>
        <td><input type="text" name="model_no" id="model_no" style="width:100%" value="<?php echo $rowresult['model_no']; ?>"/></td>
      </tr>
      <tr>
        <th scope="row">Chesis No.</th>
        <td><input type="text" name="chesis_no" id="Chesis_no" style="width:100%" value="<?php echo $rowresult['chesis_no']; ?>"/></td>
      </tr>
    </table></fieldset></td>
    <td><fieldset><legend><strong>Warranty</strong></legend><table width="100%" border="0" cellspacing="2" cellpadding="1" style="background-color:#FFF; border:solid 1px #CCC" align="right">
      <tr>
        <th width="30%" scope="row">Warranty Type</th>
        <td width="70%"><label>
        <input type="text" readonly="readonly" name="warranty_type" id="warranty_type" style="width:100%" value="<?php echo $rowresult['warranty_type']; ?>">
        </label></td>
      </tr>
      <tr>
        <th scope="row">View  File</th>
        <td><strong><a href="index.php?route=machinecenter_download&id=<?php echo $rowresult['id']; ?>&modid=<?php echo $_REQUEST['modid'];?>&frmid=<?php echo $_REQUEST['frmid'];?>">Download</a></strong></td>
      </tr>
      <tr>
        <th scope="row">Start Period</th>
        <td><input type="text" name="start_period" id="start_period" style="width:40%" value="<?php echo $rowresult['start_period']; ?>"/> 
          <strong>End Period</strong>
          <input type="text" name="end_period" id="end_period" style="width:36%" value="<?php echo $rowresult['end_period']; ?>"/></td>
      </tr>
      <tr>
        <th scope="row">Status</th>
        <td><input type="text" name="status" id="status" style="width:100%" value="<?php echo $rowresult['status']; ?>"/></td>
      </tr>
      <tr>
        <th scope="row">AMC On Value</th>
        <td><input type="text" name="amc_on_value" id="amc_on_value" style="width:100%" value="<?php echo $rowresult['amc_on_value']; ?>"/></td>
      </tr>
      <tr>
        <th scope="row">AMC %</th>
        <td><input type="text" name="amc_per" id="amc_per" style="width:100%" value="<?php echo $rowresult['amc_per']; ?>"/></td>
      </tr>
      <tr>
        <th scope="row">EMI Of Year</th>
        <td><input type="text" name="emi_year" id="emi_year" style="width:100%" value="<?php echo $rowresult['emi_year']; ?>"/></td>
      </tr>
    </table></fieldset></td>
  </tr>
  <tr>
    <td valign="top"><fieldset><legend><strong>Running Capacity</strong></legend><table width="100%" border="0" cellspacing="2" cellpadding="1" style="background-color:#FFF; border:solid 1px #CCC" align="center">
      <tr>
        <th width="55%" scope="row">Fuel Type</th>
        <td width="45%"><label>
        	<input type="text" name="fuel_type" style="width:100%" id="fuel_type" value="<?php echo $rowresult['fule_type']; ?>">
        	 </label></td>
      </tr>
      <tr>
        <th scope="row">One Day</th>
        <td><input type="text" name="one_day_capacity" id="one_day" style="width:100%" value="<?php echo $rowresult['one_day_capacity']; ?>"/></td>
      </tr>
      <tr>
        <th scope="row">Setup Time</th>
        <td><input type="text" name="setup_time" id="setup_time" style="width:100%" value="<?php echo $rowresult['setup_time']; ?>"/>
        	
        	
        </td>
      </tr>
      <tr>
        <th scope="row">Average Production Qty</th>
        <td><input type="text" name="average_production_qty" id="average_production_qty" style="width:100%" value="<?php echo $rowresult['average_production_qty']; ?>"/></td>
      </tr>
    </table></fieldset></td>
    <td rowspan="2" valign="top"><fieldset><legend><strong>Asset Manager</strong></legend><table width="100%" border="0" cellspacing="2" cellpadding="1" style="background-color:#FFF; border:solid 1px #CCC" align="right">
      <tr>
        <th width="55%" scope="row">Accounting Group</th>
        <td width="45%"><label>
        <select name="accounting_group" id="accounting_group" style="width:100%" >
              <?php 
       		$sqlassect="select * from accountgroupmaster where GroupId='".$rowresult['accounting_group']."'";
		$sqlquery=DB_query($sqlassect,$db);
		while($row2=DB_fetch_array($sqlquery))
		{?>
			<option value="<?php echo $row2['GroupId']; ?>"><?php echo $row2['GroupName']; ?></option>	
        <?php }?>	 	
        	
        </select>	      	
         
        </label></td>
      </tr>
      <tr>
        <th scope="row">Depriciation Account GL Link</th>
        <td>
        	 <select name="depriciation_ac_gl" id="depriciation_ac_gl" style="width:100%" >
             <?php 
      	$sqlassect="select * from accountgroupmaster where GroupId='".$rowresult['depriciation_ac_gl']."'";
		$sqlquery=DB_query($sqlassect,$db);
		while($row2=DB_fetch_array($sqlquery))
		{?>
			<option value="<?php echo $row2['GroupId']; ?>"><?php echo $row2['GroupName']; ?></option>	
        <?php } ?>	 	        	
        </select>	    	
        </td>
      </tr>
      <tr>
        <th scope="row">Sale Status</th>
        <td><input type="text" name="sale_status" id="sale_status" style="width:100%" value="<?php echo $rowresult['sale_status']; ?>"/></td>
      </tr>
      <tr>
        <th scope="row">Sale Amount</th>
        <td><input type="text" name="sale_amount" id="sale_amount" style="width:100%" value="<?php echo $rowresult['sale_amount']; ?>"/></td>
      </tr>
      <tr>
        <th scope="row">Sale Date</th>
        <td><input type="text" name="sale_date" id="sale_date" style="width:100%" value="<?php echo $rowresult['sale_date']; ?>"/></td>
      </tr>
      <tr>
        <th scope="row">Sale Party</th>
        <td>
        <select name="sale_party" id="sale_party" style="width:100%">
              <?php
        $vendor=DB_query("select vendor_code,vendor_name from suppliers where vendor_code='".$rowresult['sale_party']."'",$db);
        while($vendor_row=DB_fetch_array($vendor))
		{       
         ?>
         <option value="<?php echo $vendor_row['vendor_code']; ?>"><?php echo $vendor_row['vendor_name']; ?></option>	
        <?php } ?>  
        </select>	
        	</td>
      </tr>
      <tr>
        <th scope="row">Accumulative Depriciation Amt.</th>
        <td><input type="text" name="accumulative_depriciation" id="accumulative_depriciation" style="width:100%" value="<?php echo $rowresult['accumulative_depriciation']; ?>"/></td>
      </tr>
      <tr>
        <th scope="row">Total Till Date Net Gross Block Amt.</th>
        <td><input type="text" name="total_till_date" id="total_till_date" style="width:100%" value="<?php echo $rowresult['total_till_date']; ?>"/></td>
      </tr>
    </table></fieldset></td>
  </tr>
  <tr>
    <td valign="top"><fieldset><legend><strong>Location</strong></legend><table width="100%" border="0" cellspacing="2" cellpadding="1" style="background-color:#FFF; border:solid 1px #CCC" align="center">
      <tr>
        <th width="55%" scope="row">Location</th>
        <td width="45%"><label>
        <select name="location" id="location" style="width:100%">
        <?php 
		$site_sql = "SELECT prefix,loccode, locationname from locations where loccode='".$rowresult['location']."'";
		$site_result = DB_query($site_sql,$db);
		while($site_row = DB_fetch_array($site_result))
		{
		?>
         <option value="<?php echo $site_row['loccode']; ?>" ><?php echo $site_row['locationname']; ?></option>
            <?php } ?>
    </select>	   	
        	
        
        </label></td>
      </tr>
      <tr>
        <th scope="row">Installation By</th>
        <td><input type="text" name="insatallation_by" id="insatallation_by" style="width:100%" value="<?php echo $rowresult['insatallation_by']; ?>"/></td>
      </tr>
      <tr>
        <th scope="row">Date</th>
        <td><input type="text" name="date" id="date" style="width:100%" value="<?php echo $rowresult['date']; ?>"/></td>
      </tr>
    </table></fieldset></td>
  </tr>
</table>

</form>