<?php 
$active = 'Buy Fuel';
$pageName = "View Listing";

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

include('hitCounter.php');

$obj = new DBClass();
$obj1 = new DBClass();
$obj4 = new DBClass();

?>

<!--workarea start------------------------->
<div class="workarea">
	<div class="workareatop">
		<img src="images/workareatopcorner_03.PNG" alt="" />
	</div>
	<!--workareamid start--------------------->
	<div class="workareamid">
		<div id="floatleft" style="width:100%; float:left;">
			<div class="welcomediv">
						
			<?php 
			$sql = "SELECT * FROM ".TBL_LISTING." WHERE id = '".$_GET['id']."'";
			$rs = $obj->executeQry($sql,$link);
			$row = $obj->fetchrow();
			
			$sql4 = "SELECT * FROM ".TBL_DIRECTORY." WHERE memberID = ".$row['memberID'];
			$rs4 = $obj4->executeQry($sql4,$link);
			$row4 = $obj4->fetchrow();
			?>
			
			<h2><?php echo $row4['organisation_name'] ?></h2>
			<br />
<table  class="main" width="100%" border="0" cellspacing="0" cellpadding="0">
		<tr>
				<td class="bdr1">
						<table width="100%" border="0" cellspacing="0" cellpadding="0">
								<tr>
										<td bgcolor="#990066" class="form_head" style="padding-left:5px"><span style="font-size: small;font-family: Tahoma;color:#000000;"><b>Product Details:</b></span><span style="float:right;padding-top:5px;padding-right:10px;font-size:10px;"><?php echo date("j-F-Y, h:i:s A",strtotime($row['added_on']));?></span></td>
								</tr>
								<tr>
									 <td height="2"></td>
							   </tr>
							   <tr>
									<td>
											<table width="98%" align="center" border="0" cellspacing="0" cellpadding="0">
												   <tr>
													  <td width="25%" class="contain"><b>Commodity</b></td> 
													  <td width="65%" class="contain"><?php echo $row['commodity'] ?></td>
												   </tr>
												   <tr>
													  <td class="contain"><b>Origin</b></td> 
													  <td class="contain"><?php echo $row['origin'] ?></td>
												   </tr>
												   <tr>
													  <td class="contain"><b>Location</b></td> 
													  <td class="contain"><?php if($row['commodity'] == 'Coal') { echo ($row['origin']=='Indian')?$row['area']:$row['port']; } else { echo ($row['origin']=='Indian')?$row['noncoal_state']:$row['noncoal_state'].' ('.$row['noncoal_port'].')'; }?></td>
												   </tr>
												   <tr>
													  <td class="contain"><b>Sub Location</b></td> 
													  <td class="contain"><?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>
												   </tr>
												   <tr>
													  <td class="contain"><b>Size</b></td> 
													  <td class="contain"><?php echo $row['size'] ?></td>
												   </tr>
												   <tr>
													  <td class="contain"><b>Gross Calorific Value(A.D.Basis)</b></td> 
													  <td class="contain"><?php echo $row['actual_gcv'] ?></td>
												   </tr>
												   <tr>
													  <td class="contain"><b>Total Moisture(A.R.Basis)</b></td> 
													  <td class="contain"><?php echo $row['actual_tm'] ?></td>
												   </tr>
												   <tr>
													  <td class="contain"><b>ASH(A.D.Basis)</b></td> 
													  <td class="contain"><?php echo $row['actual_ash'] ?></td>
												   </tr>
												   <tr>
													  <td class="contain"><b>Sulphur</b></td> 
													  <td class="contain"><?php echo $row['actual_sulpher'] ?></td>
												   </tr>
												   <tr>
													  <td class="contain"><b>Base Rate (INR<b>/</b>Mt, Exclude Transport)</b></td> 
													  <td class="contain"><?php echo $row['base_rate'] ?></td>
												   </tr>
												   <tr>
													 <td colspan="2" style="height:10px;"></td>
												   </tr>       
												 <tr>
												   <td colspan="2"><div style="text-align: left;"><span style="font-size: small;"><span style="font-family: Tahoma;"><span style="color: rgb(0, 0, 0);"><b>Contact Person : <?php echo $row['person_name'];?></b></span></span></span></div></td>
												 </tr>
												 <tr>
													 <td colspan="2"  style="height:10px;"></td>
												   </tr>
												 <tr>
													<td class="contain" valign="top"><b>Address</b></td>
													<td class="contain"><?php echo $row4['address'];?>, <?php echo $row4['city'];?>, <?php echo $row4['state'];?> - <?php echo $row4['pincode'];?></td>
												</tr>
												<tr>
													<td class="contain"><b>Phone</b></td>
													<td class="contain"><?php echo $row4['phone'];?></td>
												</tr>
												<tr>
													<td class="contain"><b>Fax</b></td>
													<td class="contain"><?php echo $row4['fax'];?></td>
												</tr>
												<tr>
													<td class="contain"><b>Mobile</b></td>
													<td class="contain"><?php echo $row4['mobile1'];?>, <?php echo $row4['mobile2'];?></td>
												</tr>
												<tr>
													<td class="contain"><b>Email</b></td>
													<td class="contain"><?php echo $row4['email1'];?> , <?php echo $row4['email2'];?></td>
												</tr>
												<tr>
													<td class="contain"><b>Website</b></td>
													<td class="contain"><?php echo $row4['website'];?></td>
												</tr>
												<tr>
			<td colspan="2"><span style="text-align:right !important; float:right"><a href="showListing.php?id=<?php echo $row['memberID'] ?>">Show all product of same trader </a></span></td>
												</tr>
											</table>
									</td>
								</tr>
						</table>
				</td>
		</tr>
</table>
<!--  Hot Offers-->
<h2><img src="images/new_animated.gif" alt="hot offer" width="60" height="30" style="border:none;"/>Hot Offers</h2>
<table  class="main" width="100%" border="0" cellspacing="0" cellpadding="0">
		<tr>
				<td class="bdr1">
						<marquee scrollamount="3" onMouseOver="this.scrollAmount=0" onMouseOut="this.scrollAmount=2"  behavior="alternate">
								<table class="sub" width="100%" border="0" cellspacing="0" cellpadding="0">
										<tr>
												<?php
												$sql1 = "SELECT * FROM ".TBL_LISTING." WHERE status = '0' AND popular = '1' order by id DESC";
												$rs1 = $obj1->executeQry($sql1,$link);
												while($row1 = $obj1->fetchrow()) { 
												
												$sql4 = "SELECT * FROM ".TBL_DIRECTORY." WHERE memberID = ".$row1['memberID'];
												$rs4 = $obj4->executeQry($sql4,$link);
												$row4 = $obj4->fetchrow();
												?>
												<td width="250" valign="top" >
														<table class="coal" width="100%" border="0" cellspacing="0" cellpadding="0">
															   <tr>
																  <td colspan="2" class="form_head" style="padding-left:5px"><?php echo $row4['organisation_name'];?></td>
															   </tr>
															   <tr style="padding:2px;">
																<td width="40%" class="contain"><b>Commodity</b></td>
																<td width="60%" class="contain"><?php echo $row1['commodity'] ?></td>
															   </tr>
															  <tr style="padding:2px;">
																<td width="40%" class="contain"><b>Origin</b></td>
																<td width="60%" class="contain"><?php echo $row1['origin'] ?></td>
															 </tr>
															 <tr style="padding:2px;">
																<td width="40%" class="contain"><b>Location</b></td>
																<td width="60%" class="contain"><?php if($row1['commodity'] == 'Coal') { echo ($row1['origin']=='Indian')?$row1['area'].' ('.$row1['mines_name'].')':$row1['port']; } else { echo ($row1['origin']=='Indian')?$row1['noncoal_state']:$row1['noncoal_state'].' ('.$row1['noncoal_port'].')'; }?></td>
															 </tr>
															  <tr style="padding:2px;">
																<td width="40%" class="contain"><b>Sub Location</b></td>
																<td width="60%" class="contain"><div style="text-align: left;"><span style="font-size: x-small;"><span style="font-family: Tahoma;"><?php if($row1['commodity'] == 'Coal') {  if($row1['origin']=='Indian') { echo $row1['mines_name']; } } else { echo ($row1['origin']=='Indian')?$row1['noncoal_district']:$row1['noncoal_district']; }?></td>
															 </tr>
															 <tr style="padding:2px;">
																<td width="40%" class="contain"><b>GCV(A.D.Basis)</b></td>
																<td width="60%" class="contain"><?php echo $row1['actual_gcv'] ?></td>
															 </tr>
															 <tr>
																<td colspan="2" align="right" style="padding-right:5px;"><a href="viewlisting.php?id=<?php echo $row1['id'] ?>">More Details</a></td>
															 </tr>
														</table>
												</td>
												<?php 	}	?>
										</tr>
								</table>
						</marquee>
				</td>
		</tr>
</table>
<br />
<!-- New Arrivals-->

<h2><img src="images/New.gif" alt="hot offer" width="60" height="30" style="border:none;"/>New Arrivals</h2>
<table  class="main" width="100%" border="0" cellspacing="0" cellpadding="0">
		<tr>
				<td class="bdr1">
						<table class="sub" width="100%" border="0" cellspacing="0" cellpadding="0">
								<tr>
										<?php
										$sql1 = "SELECT * FROM ".TBL_LISTING." WHERE status = '0' order by id DESC limit 0,4";
										$rs1 = $obj1->executeQry($sql1,$link);
										while($row1 = $obj1->fetchrow()) { 
										
										$sql4 = "SELECT * FROM ".TBL_DIRECTORY." WHERE memberID = ".$row1['memberID'];
										$rs4 = $obj4->executeQry($sql4,$link);
										$row4 = $obj4->fetchrow();
										?>
										<td width="250" valign="top" >
												<table class="coal" width="100%" border="0" cellspacing="0" cellpadding="0">
													   <tr>
														  <td colspan="2" class="form_head" style="padding-left:5px"><?php echo $row4['organisation_name'];?></td>
													   </tr>
													   <tr style="padding:2px;">
														<td width="40%" class="contain"><b>Commodity</b></td>
														<td width="60%" class="contain"><?php echo $row1['commodity'] ?></td>
													   </tr>
													  <tr style="padding:2px;">
														<td width="40%" class="contain"><b>Origin</b></td>
														<td width="60%" class="contain"><?php echo $row1['origin'] ?></td>
													 </tr>
													 <tr style="padding:2px;">
														<td width="40%" class="contain"><b>Location</b></td>
														<td width="60%" class="contain"><?php if($row1['commodity'] == 'Coal') { echo ($row1['origin']=='Indian')?$row1['area'].' ('.$row1['mines_name'].')':$row1['port']; } else { echo ($row1['origin']=='Indian')?$row1['noncoal_state']:$row1['noncoal_state'].' ('.$row1['noncoal_port'].')'; }?></td>
													 </tr>
													  <tr style="padding:2px;">
														<td width="40%" class="contain"><b>Sub Location</b></td>
														<td width="60%" class="contain"><div style="text-align: left;"><span style="font-size: x-small;"><span style="font-family: Tahoma;"><?php if($row1['commodity'] == 'Coal') {  if($row1['origin']=='Indian') { echo $row1['mines_name']; } } else { echo ($row1['origin']=='Indian')?$row1['noncoal_district']:$row1['noncoal_district']; }?></td>
													 </tr>
													 <tr style="padding:2px;">
														<td width="40%" class="contain"><b>GCV(A.D.Basis)</b></td>
														<td width="60%" class="contain"><?php echo $row1['actual_gcv'] ?></td>
													 </tr>
													 <tr>
														<td colspan="2" align="right" style="padding-right:5px;"><a href="viewlisting.php?id=<?php echo $row1['id'] ?>">More Details</a></td>
													 </tr>
												</table>
										</td>
										<?php 	}	?>
								</tr>
						</table>
				</td>
		</tr>
</table>
<br />



						</div>
				</div>
				                <!--floatright close-------------------->
                <div style="clear:both;"></div>
            </div>
            <!--workareamid close--------------------->
            <div class="workareabottom">
                <img src="images/workareabottomcorner_03.PNG" alt="" />
            </div>
        </div>
    <!--workarea close------------------------->
<?php require_once(INCLUDES_DIR.'footer.php');?>