<?php 

require_once('config/config.php');

require_once(CLASS_DIR.'dbClass.php');

require_once(INCLUDES_DIR.'header.php');

$pageName = 'Buy Fuel';

include('hitCounter.php');


$obj = new DBClass();

$dat = date('Y-m-j');


?>
<script type="text/javascript" src="http://ajax.googleapis.com/
ajax/libs/jquery/1.4.2/jquery.min.js"></script>
<script src="JqueryLoader.js" type="text/javascript"></script>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/mootools/1.2.5/mootools-yui-compressed.js"></script>


        <div class="workarea">

            <div class="workareatop">

                <img src="images/workareatopcorner_03.PNG" alt="" />

            </div>

            

            <div class="workareamid">

                <div id="floatleft" style="width:590px; float:left;">

                    <div class="welcomediv">

                        <h2>Services as per Port basis</h2>
   <div id="preloader" style="margin-top:35px;margin-left:50px;"><img src="ajax_loader.gif" /></div>	
                        <div class="err_msg"><?php ShowError($error); ShowInfo($info);?></div>
<form name="liasoning" action="" method="post">
<table border="0" cellspacing="0" cellpadding="0">
  <tr>
    <!--<td><select name="commodity" class="txt_box2" style="width:140px;">

					<option value="">Commodity</option>

<?php 

$obj1 = new DBClass();

$sql2 = "SELECT * FROM ".TBL_OPTIONS." where `option`='Commodity' and `value`!='' and `status`=0 ORDER by value ASC";

$rs2 = $obj1->executeQry($sql2,$link);

while($row2 = $obj1->fetchrow()){ 

?>          

					<option value="<?php echo $row2['value'];?>" <?php if($_POST['commodity'] == $row2['value']) echo 'selected'; ?>><?php echo $row2['value'];?></option>

<?php } ?>

				</select></td> -->
    <td><select name="origin" class="txt_box2" style="width:140px;">
					<option selected="selected">--Select Origin--</option>
					<option value="Imported">Imported</option>					

				</select></td>
    <td><select name="mines" class="txt_box2" style="width:140px;">

					<option value="">--Select Ports--</option>

<?php 

$sql2 = "SELECT DISTINCT(mines) as mines FROM liasoning where `mines`!='' order by mines ASC";

$rs2 = $obj1->executeQry($sql2,$link);

while($row2 = $obj1->fetchrow()){ 

?>          

			<option value="<?php echo $row2['mines'];?>"><?php echo $row2['mines'];?></option>

<?php } ?>

    <td width="100" align="center"><input type="submit" name="submit" class="login_btn" style="width:60px;height: 25px;" value="Find"/></td>
  </tr>
</table>
</form>
<br />
<br />

<?php 

if(isset($_POST['submit']) && $_POST['submit'] == 'Find'){
    
   $valid = validmess($_POST['mines'], "Port"); if(isset($valid) && $valid != ''){ $error[] = $valid;}
    
	if($mess != '') { $error[] = 'Please fill all required fields with correct values.';}
    
    if($error != ''){ ?>
            <div class="err_msg"><?php ShowError($error); ShowInfo($info);?></div>
      <?php  } else {
    
if(isset($_POST['submit'])) {
$con = "";	

if($_POST['origin']!='') {
	$con = " AND origin = '".$_POST['origin']."' ";	
}

if($_POST['mines']!='') {
	$con .= " AND mines = '".$_POST['mines']."' ";	
}

	
							$sql = "SELECT * FROM liasoning WHERE status = '0' AND servicetype = '1' $con limit 0,4";

							$rs = $obj->executeQry($sql,$link);
							$i=1;
}							?>
           <table class="main" width="100%" border="0" cellspacing="0" cellpadding="0">
   <tr>
     <td class="bdr1" >
        <table width="100%"  border="0" cellspacing="0" cellpadding="0">
           <?php 
				if($i==1) { ?>
			<div class="err_msg"><?php ShowError($error); ShowInfo($info);?></div>
            <tr>
              <td bgcolor="#990066" colspan="2" class="form_head" style="padding-left:5px"><div style="text-align: left;"><span style="font-size: small;"><span style="font-family: Tahoma;"><span style="color: rgb(0, 0, 0);"><strong>Liasoner and Lifter</strong></span></span></span></div></td>
            </tr>
				<?php }
					if($obj->getrow()>0) { 	
				?>
            <tr  class="bg_td1"  >
                <?php
					while($row = $obj->fetchrow()) { 
				?>
				<td class="list_link" width="49%" align="left" valign="top" style="margin:5px;padding:5px;">
					<table>
					<tr>
						<td colspan="2"><div style="text-align: left;"><a href="<?php echo $row['website'];?>" target="_blank"><span style="font-size: small;"><span style="font-family: Tahoma;"><span style="color: rgb(0, 0, 0);"><strong><?php echo $row['person_name'].' ('.$row['organisation_name'].')';?></strong></span></span></span></a></div></td>
					</tr>
					<tr style="height:2px;">
          				<td><div style="text-align: left;"><span style="font-size: x-small;"><span style="font-family: Tahoma;"><span style="color: rgb(128, 128, 128);"><strong>Address</strong></span></span></span></div></td>
          				<td><div style="text-align: left;"><span style="font-size: x-small;"><span style="font-family: Tahoma;"><span style="color: rgb(128, 128, 128);"><?php echo $row['address'];?>, <?php echo $row['district'];?>, <?php echo $row['state'];?> - <?php echo $row['pincode'];?></span></span></span></div></td>
          			</tr>
          			<tr style="height:2px;">
          				<td><div style="text-align: left;"><span style="font-size: x-small;"><span style="font-family: Tahoma;"><span style="color: rgb(128, 128, 128);"><strong>Phone</strong></span></span></span></div></td>
          				<td><div style="text-align: left;"><span style="font-size: x-small;"><span style="font-family: Tahoma;"><span style="color: rgb(128, 128, 128);"><?php echo $row['phone'];?></span></span></span></div></td>
          			</tr>
          			<tr style="height:2px;">
          				<td><div style="text-align: left;"><span style="font-size: x-small;"><span style="font-family: Tahoma;"><span style="color: rgb(128, 128, 128);"><strong>Fax</strong></span></span></span></div></td>
          				<td><div style="text-align: left;"><span style="font-size: x-small;"><span style="font-family: Tahoma;"><span style="color: rgb(128, 128, 128);"><?php echo $row['fax'];?></span></span></span></div></td>
          			</tr>
          			<tr style="height:2px;">
          				<td><div style="text-align: left;"><span style="font-size: x-small;"><span style="font-family: Tahoma;"><span style="color: rgb(128, 128, 128);"><strong>Mobile</strong></span></span></span></div></td>
          				<td><div style="text-align: left;"><span style="font-size: x-small;"><span style="font-family: Tahoma;"><span style="color: rgb(128, 128, 128);"><?php echo $row['mobile1'];?>, <?php echo $row['mobile2'];?></span></span></span></div></td>
          			</tr>
          			<tr style="height:2px;">
          				<td><div style="text-align: left;"><span style="font-size: x-small;"><span style="font-family: Tahoma;"><strong><span style="color: rgb(128, 128, 128);">Email</strong></span></span></span></div></td>
          				<td><div style="text-align: left;"><a href="mainto:<?php echo $row['email1'];?>"><span style="font-size: x-small;"><span style="font-family: Tahoma;"><span style="color: rgb(128, 128, 128);"><?php echo $row['email1'];?></span></span></a>, <a href="mainto:<?php echo $row['email2'];?>"><span style="font-size: x-small;"><span style="font-family: Tahoma;"><?php echo $row['email2'];?></span></span></span></a></div></td>
          			</tr>
          			<tr style="height:2px;">
          				<td><div style="text-align: left;"><span style="font-size: x-small;"><span style="font-family: Tahoma;"><span style="color: rgb(128, 128, 128);"><strong>Website</strong></span></span></span></div></td>
          				<td><div style="text-align: left;"><a href="<?php echo $row['website'];?>" target="_blank"><span style="font-size: x-small;"><span style="font-family: Tahoma;"><span style="color: rgb(128, 128, 128);"><?php echo $row['website'];?></span></span></span></a></div></td>
          			</tr>
					</table>
				</td>
                		<?php 
							if($i%2==0) {
								echo '</tr><tr>';	
							}
							else {
								//echo '<td width="5" style="background:none; border:none">&nbsp;</td>';	
							}
							$i++;
							} ?></tr>
                            <?php }
							else {
								echo '<tr>
                            <td colspan="2" align="center" style="padding-left:5px">No Record found!</td></tr>';
							}
						?>
   
</table>
</td>
                            </tr>
 </table>
 <table>							
 <tr style="height:5px;">
                            <td height="5" style="border:none">&nbsp;</td>
                            </tr>
 </table>
 
 
<?php } } ?>                  
                   
						<div style="clear:both;"></div>





                        <div style="clear:both;"></div>

                    </div>

                </div>

                

                <?php require_once(INCLUDES_DIR.'left_bar.php');?>

                <div style="clear:both;"></div>

            </div>

            

            <div class="workareabottom">

                <img src="images/workareabottomcorner_03.PNG" alt="" />

            </div>

        </div>

<?php require_once(INCLUDES_DIR.'footer.php');?>