<?php
$pageName = "View Product";

require_once('config/config.php');
require_once(CLASS_DIR.'dbClass.php');

include('hitCounter.php');

$obj = new DBClass();

$sql = "SELECT * FROM ".TBL_LISTING." WHERE id = '".$_GET['id']."'";
$rs = $obj->executeQry($sql,$link);
$row = $obj->fetchrow();

$odate = date("d-m-Y",strtotime($row['added_on']));
?>
<table width="500" border="0" cellspacing="0" cellpadding="0" class="example_f">
	<tr>
		<td style="padding:10px;">
			<table width="500" align="center" cellpadding="0" cellspacing="0"  >
				<tr>
					<td>
						<table width="100%" cellspacing="0" cellpadding="0">			
							<tr>
								<td class="form_head" style="color:#000000;font-size:20px;text-align:center;">COAL DETAILS</td>
							</tr>
							<tr>
								<td>
									<table width="100%" cellspacing="2" cellpadding="2" >
										<tr>
											<td><b>Commodity</b></td>
											<td><?php echo $row['commodity'] ?></td>
											<td><b>Origin</b></td>
											<td><?php echo $row['origin'] ?></td>
										</tr>
										<tr>
											<td><b>Location</b></td>
											<td><?php if($row['commodity'] == 'Coal') { echo ($row['origin']=='Indian')?$row['area'].' ('.$row['mines_name'].')':$row['port']; } else { echo ($row['origin']=='Indian')?$row['noncoal_state']:$row['noncoal_state'].' ('.$row['noncoal_port'].')'; }?></td>
											<td><b>Size</b></td>
											<td><?php echo $row['size'] ?></td>
										</tr>
										<tr>
											
											<td><b>Sub Location</b></td>
											<td><?php if($row['commodity'] == 'Coal') {  if($row['origin']=='Indian') { echo $row['mines_name']; } } else { echo ($row['origin']=='Indian')?$row['noncoal_district']:$row['noncoal_district']; }?></td>
											<td><b>GCV</b></td>
											<td><?php echo $row['actual_gcv'] ?></td>
										</tr>
										<tr>
											
											<td><b>TM</b></td>
											<td><?php echo $row['actual_tm'] ?></td>
											<td><b>ASH</b></td>
											<td><?php echo $row['actual_ash'] ?></td>
										</tr>
										<tr>
											
											<td><b>Sulphur</b></td>
											<td><?php echo $row['actual_sulpher'] ?></td>
											<td><b>Base Rate</b></td>
											<td><?php echo $row['base_rate'] ?></td>
										</tr>
										<tr>
											<td><b>Order Date</b></td>
											<td><?php echo date("d-m-Y",strtotime($row['added_on'])); ?></td>
											<td><b>Status</b></td>
											<td><?php echo ($row['status'] == '0')? 'Active' : 'Inactive' ?></td>        
										</tr>
										<tr>
											<td><b>Activated On</b></td>
											<td><?php echo date("d-m-Y",strtotime($row['actdate'])); ?></td>
										</tr>
									</table>
								</td>
							</tr>
						</table>
					</td>
				</tr>
			</table>
		</td>
	</tr>
</table>