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

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

$cupage = 'order';

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

$sql1 = "SELECT * FROM ".TBL_DIRECTORY." WHERE memberID = '".$row['memberID']."'";
$rs1 = $obj1->executeQry($sql1,$link);
$row1 = $obj1->fetchrow();

?>
 <table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
                        <tr>
                            <td valign="top" class="bdr4">
                                <table width="100%" border="0" cellspacing="0" cellpadding="0">
                                    <tr>
                                        <td width="100%" height="35" class="pagehead">View Order</td>
                                    </tr>
                                    <tr>
                                        <td bgcolor="#990066" class="form_head">Contact Details</td>
                                    </tr>
                                    <tr>
                                        <td valign="top" class="form_bg">
                                            <table width="100%" border="0" cellpadding="0" cellspacing="0" class="userdetails">
                                                <tr>
                                                    <td width="14%" valign="top"><strong>Name :</strong> </td>
                                                    <td width="35%"><?php echo $row1['person_name'].'('.$row1['organisation_name'].')';?></td>
                                                    <td width="2%">&nbsp;</td>
                                                    <td width="14%"  valign="top"><strong>Address:</strong></td>
                                                    <td width="35%"><?php echo $row1['address'] ?></td>
                                                </tr>
                                                <tr>
                                                    <td  valign="top"><strong>Email :</strong> </td>
                                                    <td><?php echo $row1['email1'];?></td>
                                                    <td>&nbsp;</td>
                                                    <td  valign="top"><strong>City :</strong></td>
                                                    <td><?php echo $row1['district'];?></td>
                                                </tr>
                                                <tr>
                                                    <td  valign="top"><strong>Phone :</strong> </td>
                                                    <td><?php echo $row1['phone'];?></td>
                                                    <td>&nbsp;</td>
                                                    <td  valign="top"><strong>State :</strong></td>
                                                    <td><?php echo $row1['state'];?></td>
                                                </tr>
                                                <tr>
                                                     <td  valign="top"><strong>Fax :</strong> </td>
                                                     <td><?php echo $row1['fax'];?></td>
                                                     <td>&nbsp;</td>
                                                     <td  valign="top"><strong>Country:</strong></td>
                                                     <td><?php echo $row1['country'];?></td>
                                                </tr>
                                                <tr>
                                                     <td  valign="top"><strong>Zip Code :</strong></td>
                                                     <td><?php echo $row1['pincode'];?></td>
                                                     <td>&nbsp;</td>
                                                     <td  valign="top"><strong>CRN# :</strong></td>
                                                     <td><?php echo $row['crn'];?></td>
                                                </tr>
    
                                            </table>
			                             </td>
                                    </tr>
                                     <tr>
                                        <td bgcolor="#990066" class="form_head">Coal Details</td>
                                     </tr>
                                     <tr>
                                        <td valign="top" class="form_bg">
                                            <table width="100%" class="userdetails">
                                              <tr>
                                                <td width="20%"  valign="top"><b>Commodity : </b></td>
                                                <td width="30%"><?php echo $row['commodity'] ?></td>
                                                <td width="2%">&nbsp;</td>
                                                <td width="18%"  valign="top"><b>Origin : </b></td>
                                                <td width="30%"><?php echo $row['origin'] ?></td>
                                              </tr>
                                              <tr>
                                                <td  valign="top"><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>&nbsp;</td>
                                                <td  valign="top"><b>Size : </b></td>
                                                <td><?php echo $row['size'] ?></td>
                                              </tr>
                                              <tr>
                                                <td  valign="top"><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>&nbsp;</td>
                                                <td  valign="top"><b>TM : </b></td>
                                                <td><?php echo $row['tm'] ?></td>
                                              </tr>
                                              <tr>
                                                <td  valign="top"><b>ASH : </b></td>
                                                <td><?php echo $row['ash'] ?></td>
                                                <td>&nbsp;</td>
                                                <td  valign="top"><b>Sulpher : </b></td>
                                                <td><?php echo $row['sulpher'] ?></td>
                                              </tr>
                                              <tr>
                                                <td  valign="top"><b>GCV : </b></td>
                                                <td><?php echo $row['gcv'] ?></td>
                                                <td>&nbsp;</td>
                                                <td  valign="top"><b>Base Rate :</b> </td>
                                                <td><?php echo $row['base_rate'] ?></td>
                                              </tr>
                                              <tr>
                                                <td  valign="top"><b>Order Date : </b></td>
                                                <td><?php echo date("d-m-Y",strtotime($row['added_on'])); ?></td>
                                                <td>&nbsp;</td>
                                                <td  valign="top"><b>Activated On : </b></td>
                                                <td><?php echo date("d-m-Y",strtotime($row['actdate'])); ?></td>
                                              </tr>
                                            </table>
                                        </td>
                                     </tr>
                                     <tr>
                                        <td bgcolor="#990066" class="form_head">&nbsp;</td>
                                     </tr>
                                </table>
                            </td>
                        </tr>
                    </table>