<?php

$typeArray = array(
					'1'=>'Insurance Expired Assets List',
					'2'=>'Warranty Expired Assets List',
					
					);
?>
<link rel="stylesheet" href="css/new_mxerp.css">
<div class="body_contain">
<div class="tab_div">
<h1>Miscellaneous Asset Report</h1>
<form name="" id="" method="POST">
<table width="100%" cellpadding="3" cellspacing="0" border="0">
<tr class="row1">
	<td width="13%" align="right"><strong>Branch:</strong></td>
    <td width="35%"><select name="site" id="site"  style="width:98%;">
          <option value="0">Select Site</option>
         <?php
	$query5=DB_query("Select loccode, locationname from locations where CompanyId='".$_SESSION['ACGCompanyId']."'",$db);
	while($row5=DB_fetch_array($query5))
	{
	$s1='';
	if($_REQUEST['site']==$row5['loccode'])
	$s1="selected";
	?>
	<option value=<?php echo $row5['loccode'];?> <?php echo $s1;?>><?php echo $row5['locationname'];?></option>
	<?php }
	?>
          </select>
		  </td>
	<td width="13%" align="right"><strong>Report Description:</strong></td>
    <td><select name="type"  id="type"  style="width:98%;">
        	<option value="0">Select</option>
			<?php foreach($typeArray as $key=>$value){?>
        	<option value="<?php echo $key;?>" <?php echo ($_REQUEST['type']==$key) ? "selected" : ""; ?>><?php echo $value;?></option>
			<?php } ?>
        </select></td> 	 	
</tr>
 
<tr class="row1">
	<td style="text-align:center;" colspan="4"><input type="submit" name="Search" class="search" value="Search" onclick="return validate();" /></td>
</tr>
</table>
<br>
<?php if(isset($_POST['Search'])){?> 
<h3><?php echo "Search Result For ".$typeArray[$_REQUEST['type']];?></h3>
<?php }
?>

<?php
if(isset($_POST['Search']))
{
	if($_REQUEST['type']==1)
	{
		include("insurance_expired_asset_list.php");
	}elseif($_REQUEST['type']==2)
	{
		include("warranty_expired_asset_list.php");
	}


}?> 

</form>
</div>
</div>

<script type="text/javascript">

function validate()
{
	if(document.getElementById("site").value=='0')
	{
		alert("Select Site");
		document.getElementById("site").focus();
		return false;
	}
	if(document.getElementById("type").value=='0')
	{
		alert("Select Report Type");
		document.getElementById("type").focus();
		return false;
	}

}
</script>