<?php 
$active = 'Sell Fuel';
$pageName = 'sellcoal step2';

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

include('hitCounter.php');
include('chkDirectoy.php');
include('checklogin.php');

$obj = new DBClass();
$obj4 = new DBClass();
//echo "SELECT * FROM ".TBL_DIRECTORY." WHERE (memberID = '".$_COOKIE['memberID']."' OR memberID = '".$_SESSION['memberID']."')";

$sql4 = "SELECT * FROM ".TBL_DIRECTORY." WHERE (memberID = '".$_COOKIE['memberID']."' OR memberID = '".$_SESSION['memberID']."')";
$rs4 = $obj4->executeQry($sql4,$link);
$row4 = $obj4->fetchrow();

if(strlen($row4['crn']) != '9') {
	@header('Location: sellcoal.php');
	exit;
}

if(isset($_POST['submit']) && $_POST['submit'] == 'Submit'){

        $valid = validmess($_POST['commodity'], "Commodity"); if(isset($valid) && $valid != ''){ $error[] = $valid;}
        $valid = validmess($_POST['origin'], "Origin"); if(isset($valid) && $valid != ''){ $error[] = $valid;}
        $valid = validmess($_POST['size'], "Size"); if(isset($valid) && $valid != ''){ $error[] = $valid;}        
        $valid = validmess($_POST['gcv'], "Gross Calorifie Value"); if(isset($valid) && $valid != ''){ $error[] = $valid;}        
        $valid = validmess($_POST['actual_gcv'], "Actual Gross Calorifie Value"); if(isset($valid) && $valid != ''){ $error[] = $valid;}
        $valid = validmess($_POST['tm'], "Total Moisture"); if(isset($valid) && $valid != ''){ $error[] = $valid;}        
        $valid = validmess($_POST['actual_tm'], "Actual Total Moisture"); if(isset($valid) && $valid != ''){ $error[] = $valid;}
        $valid = validmess($_POST['ash'], "ASh"); if(isset($valid) && $valid != ''){ $error[] = $valid;}        
        $valid = validmess($_POST['actual_ash'], "Actual ASH"); if(isset($valid) && $valid != ''){ $error[] = $valid;}
        $valid = validmess($_POST['sulpher'], "Sulphur"); if(isset($valid) && $valid != ''){ $error[] = $valid;}        
        $valid = validmess($_POST['actual_sulpher'], "Actual Sulphur"); if(isset($valid) && $valid != ''){ $error[] = $valid;}
		
		//********* To check actual vaue range of gcv..************
        // GCV
		if(isset($_POST['gcv']) && ($_POST['gcv'] != '')){
			 
			 if($_POST['gcv'] == '0-3500'){
				if(($_POST['actual_gcv'] > 3500)){
					 $error[] = "You have selected wrong gcv range";
				}
				else{
				}
			}
			if($_POST['gcv'] == '3501-4000'){
				if(($_POST['actual_gcv'] < 3501) || ( $_POST['actual_gcv'] > 4000)){
					 $error[] = "You have selected wrong gcv range";
				}
				else{
					}
			}
			
			if($_POST['gcv'] == "4001-4500"){
				if(($_POST['actual_gcv'] < 4001) || ( $_POST['actual_gcv'] > 4500)){
					$error[] = "You have selected wrong gcv range";
				}
			}
			
			 if($_POST['gcv'] == "4501-5000"){
				if(($_POST['actual_gcv'] < 4501) || ( $_POST['actual_gcv'] > 5000)){
				   $error[] = "You have selected wrong gcv range";
				}
			}
			
			if($_POST['gcv'] == "5001-5500"){
				if(($_POST['actual_gcv'] < 5001) || ( $_POST['actual_gcv'] > 5500)){
						   $error[] = "You have selected wrong gcv range";
				}
			}
			
			if($_POST['gcv'] == "Above 5500"){
				if(($_POST['actual_gcv'] < 5500) || ( $_POST['actual_gcv'] == 5500)){
						   $error[] = "You have selected wrong gcv range";
				}
			}
		}
		
		// end of gcv range...
				
				
		// end actual gcv validation chk
		// chk actual tm
		
		if(isset($_POST['tm']) && ($_POST['tm'] != '')){
			 
			 if($_POST['tm'] == "Less then 8%"){
				if(($_POST['actual_tm'] > 8) || ( $_POST['actual_tm'] == 8)){
					$error[] = "You have selected wrong total moisture range";
				}
			}
			
			if($_POST['tm'] == "8% to 14%"){
				if(($_POST['actual_tm'] < 8) || ( $_POST['actual_tm'] > 14)){
					$error[] = "You have selected wrong total moisture range";
				}
			}
			
			if($_POST['tm'] == "15% to 20%"){
				if(($_POST['actual_tm'] < 15) || ( $_POST['actual_tm'] > 20)){
					$error[] = "You have selected wrong total moisture range";
				}
			}
			
			 if($_POST['tm'] == "21% to 25%"){
				if(($_POST['actual_tm'] < 21) || ( $_POST['actual_tm'] > 25)){
					$error[] = "You have selected wrong total moisture range";
				}
			}
			
			if($_POST['tm'] == "Above 25%"){
				if(($_POST['actual_tm'] < 25) || ( $_POST['actual_tm'] == 25)){
					$error[] = "You have selected wrong total moisture range";
				}
			}
		}
		// End TM
		// ASH
		if(isset($_POST['ash']) && ($_POST['ash'] != '')){
			 
			 if($_POST['ash'] == "Less then 8%"){
				if(($_POST['actual_ash'] > 8) || ( $_POST['actual_ash'] == 8)){
					$error[] = "You have selected wrong ASH range";
				}
			}
			
			if($_POST['ash'] == "8% to 15%"){
				if(($_POST['actual_ash'] < 8) || ( $_POST['actual_ash'] > 15)){
					$error[] = "You have selected wrong ASH range";
				}
			}
			
			if($_POST['ash'] == "16% to 25%"){
				if(($_POST['actual_ash'] < 16) || ( $_POST['actual_ash'] > 25)){
					$error[] = "You have selected wrong ASH range";
				}
			}
			
			if($_POST['ash'] == "26% to 35%"){
				if(($_POST['actual_ash'] < 26) || ( $_POST['actual_ash'] > 35)){
					$error[] = "You have selected wrong ASH range";
				}
			}
			
			if($_POST['ash'] == "Above 35%"){
				if(($_POST['actual_ash'] < 35) || ( $_POST['actual_ash'] == 35)){
					$error[] = "You have selected wrong ASH range";
				}
			}        
		}
		// END ASH
		// Shulphur
		if(isset($_POST['sulpher']) && ($_POST['sulpher'] != '')){
			 
			 if($_POST['sulpher'] == "Less then 1%"){
				if(($_POST['actual_sulpher'] > 1) || ( $_POST['actual_sulpher'] == 1)){
					$error[] = "You have selected wrong actual sulpher range";
				}
			}
			
			if($_POST['sulpher'] == "1%"){
				if(($_POST['actual_sulpher'] > 1) || ( $_POST['actual_sulpher'] < 1)){
					$error[] = "You have selected wrong actual sulpher range";
				}
			}
			
			if($_POST['sulpher'] == "Above 1%"){
				if(($_POST['actual_sulpher'] < 1) || ( $_POST['actual_sulpher'] == 1)){
					$error[] = "You have selected wrong actual sulpher range";
				}
			}     
		}
		// END Shulphur
            
        if(($_POST['actual_gcv'] == 'Actual value') || ($_POST['actual_ash'] == 'Actual value') || ($_POST['actual_sulpher'] == 'Actual value') || ($_POST['actual_tm'] == 'Actual value')){
			  $error[] = "Please select correct the actual values";
		 }   
     
     if(($_POST['port'] == 'other')) {            
          $valid = validmess($_POST['otherport'], "port"); if(isset($valid) && $valid != ''){ $mess[] = $valid;} 
          $port = $_POST['otherport'];
        }
        else {
          $port = $_POST['port'];
        }
        
     
     if(($_POST['commodity'] == 'other')) {            
          $valid = validmess($_POST['othercommudity'], "Commudity"); if(isset($valid) && $valid != ''){ $mess[] = $valid;} 
          $commodity = $_POST['othercommudity'];
        }
        else {
          $commodity = $_POST['commodity'];
        }
	 

	if($error == ''){
		
		if($_REQUEST['commodity'] =='Coal') {
			if($_REQUEST['origin'] =='Indian') {
				// COAL INDIAN
				$port = '';
				$_POST['noncoal_state'] = '';
				$_POST['noncoal_district'] = '';
				$_POST['noncoal_port'] = '';				
			}
			else {
				// COAL IMPORTED
				$_POST['area'] = '';
				$_POST['mines_name'] = '';
				$_POST['noncoal_state'] = '';
				$_POST['noncoal_district'] = '';
				$_POST['noncoal_port'] = '';				
			}
		}
		else {
			if($_REQUEST['origin'] =='Indian') {
				// NON COAL INDIAN
				$_POST['area'] = '';
				$port = '';
				$_POST['mines_name'] = '';
				$_POST['noncoal_port'] = '';				
			}
			else {
				// NON COAL IMPORTED
				$_POST['area'] = '';
				$port = '';
				$_POST['mines_name'] = '';
			}			
		}
		$memberID = ($_SESSION['memberID']=='')?$_COOKIE['memberID']:$_SESSION['memberID'];
		
		$sql5 = "INSERT INTO ".TBL_LISTING." (crn, commodity, origin, area, mines_name, port, noncoal_state, noncoal_district, noncoal_port, size, gcv, actual_gcv, tm, actual_tm, ash, actual_ash, sulpher, actual_sulpher, base_rate, memberID, actdate) VALUES ('".trim($row4['crn'])."','".trim($commodity)."','".trim($_REQUEST['origin'])."','".trim($_REQUEST['area'])."','".trim($_REQUEST['mines_name'])."','".trim($port)."','".trim($_REQUEST['noncoal_state'])."','".trim($_REQUEST['city'])."','".trim($_REQUEST['noncoal_port'])."','".trim($_REQUEST['size'])."','".trim($_REQUEST['gcv'])."','".trim($_REQUEST['actual_gcv'])."','".trim($_REQUEST['tm'])."','".trim($_REQUEST['actual_tm'])."','".trim($_REQUEST['ash'])."','".trim($_REQUEST['actual_ash'])."','".trim($_REQUEST['sulpher'])."','".trim($_REQUEST['actual_sulpher'])."','".trim($_REQUEST['base_rate'])."','".trim($memberID)."','".date("Y-m-d")."')";
    	$rs5 = $obj->executeQry($sql5,$link);
        
        if($rs5){
				@header('Location: sellcoal_step2.php?action=done');
				exit;
		}
	}
}

?>
<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>


<script type="text/javascript">
function change_port(val){
    if(val=='other') {
		document.getElementById('otherport').style.display='';
	}
	else {
		document.getElementById('otherport').style.display='none';	
	}
}

function changeCommudity(val){
    if(val=='other') {
		document.getElementById('othercommudity').style.display='';
	}
	else {
		document.getElementById('othercommudity').style.display='none';	
	}
	
	if(val=='Coal') {
		document.getElementById('coalselection').style.display='';
		document.getElementById('coalselection1').style.display='';		
	}
	else {
		document.getElementById('coalselection').style.display='none';	
		document.getElementById('coalselection1').style.display='none';
	}
	
	if(val!='Coal') {
		document.getElementById('othercoal').style.display='';
		document.getElementById('othercoal1').style.display='';
		document.getElementById('othercoal2').style.display='';
	}
	else {
		document.getElementById('othercoal').style.display='none';	
		document.getElementById('othercoal1').style.display='none';
		document.getElementById('othercoal2').style.display='none';			
	}
}


function change_origin1(val) {
	if(val=='Indian') {
		document.getElementById('area').style.display='';
		document.getElementById('port').style.display='none';
        document.getElementById('area1').style.display='';
		document.getElementById('area3').style.display='';
		document.getElementById('port1').style.display='none';
		document.getElementById('noncoal').style.display='none';
		document.getElementById('noncoal1').style.display='none';		
        document.getElementById('area2').style.display='';
	}
	else {
		document.getElementById('area').style.display='none';
		document.getElementById('port').style.display='';
        document.getElementById('area1').style.display='none';
        document.getElementById('area3').style.display='none';		
		document.getElementById('port1').style.display='';	
        document.getElementById('area2').style.display='none';
		document.getElementById('noncoal').style.display='';
		document.getElementById('noncoal1').style.display='';			
	}
}
</script>
<script type="text/javascript" src="citySelection.js"></script>


<!--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:590px; float:left;">
			<div class="welcomediv">
			
                        <h2>Product Listing</h2>
<?php 
if(isset($_GET['action']) && $_GET['action'] == 'done') {
echo "Thanks, your listing is sent to administrator for approval.";
} else {
?>
<div id="preloader" style="margin-top:60px;"><img src="ajax-loader.gif"  style="border:none;"/></div>	



	<form action="" method="POST" >
			<table width="100%">
					<tr>
							<td colspan="2"><div class="err_msg"><?php ShowError($error); ShowInfo($info);?></div></td>
					</tr>
					<!-- Commodity -->
					<tr>
							<td width="44%">Commodity<span class="style1">*</span></td>
							<td width="55%">
								<select name="commodity" style="width:245px;" class="txt_box2" onchange="changeCommudity(this.value)">
										<option value="">--Select 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 } ?>
											<option value="other">Other</option>
								</select>
							</td>
					</tr>
					<tr id="othercommudity" <?php if(($_REQUEST['commodity']=='') || ($_REQUEST['commodity'] != 'other')) { ?> style="display:none;" <?php } ?>>					
							<td class="formtxt">Other Commodity Name</td>
							<td><input style="width:244px;" type="text" class="txt_box2" name="othercommudity" value="<?php echo $_POST['othercommudity']; ?>" /></td>
					</tr>
					
					<!-- Origin -->
					<tr>
							<td class="formtxt">Origin<span class="style1">*</span></td>
							<td>
								<select name="origin"  style="width:245px;" onchange="change_origin1(this.value)" class="txt_box2">
									<option value="">--Select Origin--</option>
										<?php
										$sql2 = "SELECT * FROM ".TBL_OPTIONS." where `option`='origin' 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['origin'] == $row2['value']) echo 'selected'; ?>><?php echo $row2['value'];?></option>
										<?php } ?>
								</select>
							</td>
					</tr>
					
					<!-- State -->
					<tr id="othercoal" <?php if(($_POST['commodity'] == 'Coal') || ($_POST['commodity'] == '')) { ?> style="display:none"<?php } ?>>
							<td>State<span class="style1">*</span></td>
							<td>
									<select name="noncoal_state"  style="width:245px;" class="txt_box2" id="state">
											<option value="">--Select State--</option>
											<?php 
												$obj1 = new DBClass();												
												$sql2 = "SELECT DISTINCT(State) as State FROM ".TBL_STATE." where State != '' ORDER BY State ASC";												
												$rs2 = $obj1->executeQry($sql2,$link);												
												while($row2 = $obj1->fetchrow()){ 												
											?>
											<option value="<?php echo $row2['State'];?>" <?php if($_POST['noncoal_state'] == $row2['State']) echo 'selected'; ?>><?php echo $row2['State'];?></option>
											<?php } ?>
									</select>
							</td>
					</tr>
					
					<!-- District-->
					<tr id="othercoal1" <?php if(($_POST['commodity'] == 'Coal') || ($_POST['commodity'] == '')) { ?> style="display:none"<?php } ?>>
							<td>District<span class="style1">*</span></td>
							<td>
									<select id="city"  style="width:245px;" name="city" class="txt_box2">
											<option value="">--Select District--</option>
											<?php
											$sql2 = "SELECT * FROM ".TBL_STATE." ORDER BY city ASC";											
											$rs2 = $obj1->executeQry($sql2,$link);											
											while($row2 = $obj1->fetchrow()){
											?>
											<option value="<?php echo $row2['city'];?>" <?php if($_POST['city'] == $row2['city']) echo 'selected'; ?>><?php echo $row2['city'];?></option>
											<?php } ?>
									</select>
							</td>
					</tr>
					<!-- Port -->
					<tr id="othercoal2" <?php if(($_POST['commodity'] == 'Coal') || ($_POST['commodity'] == '') || ($_POST['origin'] == 'Indian') || ($_POST['origin'] == '')) { ?> style="display:none"<?php } ?>>
							<td id="noncoal">Enter Port name</td>
							<td id="noncoal1"><input class="txt_box2" style="width:244px;" type="text" name="noncoal_port" value="<?php echo $_POST['noncoal_port']; ?>" /></td>
					</tr>
					<tr id="coalselection" <?php if($_POST['commodity'] != 'Coal') { ?> style="display:none"<?php } ?>>
						<td class="formtxt">
								<span id="area1" <?php if($_POST['origin']=='Imported') { ?> style="display:none"<?php } ?>>Area/Mines<span class="style1">*</span></span>
								<span id="port1" <?php if($_POST['origin']!='Imported') { ?> style="display:none"<?php } ?>>Port<span class="style1">*</span></span>
						</td>
						<td>
								<span id="area" <?php if($_POST['origin']=='Imported') { ?> style="display:none"<?php } ?>>
										<select name="area" style="width:245px;" class="txt_box2">
												<option value="">--Area/Mines--</option>
													<?php 
													$sql2 = "SELECT * FROM ".TBL_OPTIONS." where `option`='area' 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['area'] == $row2['value']) echo 'selected'; ?>><?php echo $row2['value'];?></option>
													<?php } ?>
										</select>
								</span>
								<span id="port" <?php if($_POST['origin']!='Imported') { ?> style="display:none"<?php } ?>>
										<select name="port"  style="width:245px;" onchange="change_port(this.value)" class="txt_box2">
												<option value="">--Ports--</option>
													<?php 													
													$sql2 = "SELECT * FROM ".TBL_OPTIONS." where `option`='Port' 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['port'] == $row2['value']) echo 'selected'; ?>><?php echo $row2['value'];?></option>
												<?php } ?>
												<option value="other">Other</option>
										</select>
								</span>
							</td>
					</tr>
					
					<tr id="otherport" <?php if(($_REQUEST['port']=='') || ($_REQUEST['port'] != 'other') || ($_REQUEST['origin']) != 'Imported') { ?> style="display:none" <?php } ?>>
							<td class="formtxt">Other Port Name</td>
							<td><input style="width:244px;" type="text" class="txt_box2" name="otherport" value="<?php echo $_POST['otherport']; ?>" /></td>
					</tr>
					<tr id="coalselection1" <?php if($_POST['commodity'] != 'Coal') { ?> style="display:none"<?php } ?>>
							<td id="area2" class="formtxt">Mines Name<span class="style1">*</span></td>
							<td  id="area3"><input style="width:241px;" class="txt_box2" type="text" name="mines_name" value="<?php echo $_POST['mines_name']; ?>" /></td>
					</tr>
					<tr>
							<td class="formtxt">Size<span class="style1">*</span></td>
							<td>
									<select name="size" style="width:245px;" class="txt_box2">
											<option value="">--Select Size--</option>
											<?php 												
												$sql2 = "SELECT * FROM ".TBL_OPTIONS." where `option`='size' 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['size'] == $row2['value']) echo 'selected'; ?>><?php echo $row2['value'];?></option>
											<?php } ?>
									</select>
							</td>
					</tr>
					<tr>
							<td colspan="2">
									<table width="100%" style="margin-left:-3px;">
											<tr>
													<td width="45%">Gross Calorifie Value(A.D.Basis)<span class="style1">*</span></td>
													<td width="20%">
															<select name="gcv" style="width:130px;" class="txt_box2">
																<option value="">--Select GCV--</option>
																<?php 
																$sql2 = "SELECT * FROM ".TBL_OPTIONS." where `option`='gcv' and `value`!='' and `status`=0 ORDER BY id ASC";																		
																$rs2 = $obj1->executeQry($sql2,$link);																		
																while($row2 = $obj1->fetchrow()){ 																		
																?>
																<option value="<?php echo $row2['value'];?>" <?php if($_POST['gcv'] == $row2['value']) echo 'selected'; ?>><?php echo $row2['value'];?></option>
																<?php } ?>
															</select>
													</td>
													<td><input type="text" name="actual_gcv" class="txt_box2" style="width:100px;" value="<?php echo $_POST['actual_gcv']; ?>" placeholder="Actual value"/></td>
											</tr>
											<tr>
													<td>Total Moisture(A.R.Basis)<span class="style1">*</span></td>
													<td>
															<select name="tm" style="width:130px;" class="txt_box2">
																	<option value="">--Select TM--</option>
																	<?php 
																	$sql2 = "SELECT * FROM ".TBL_OPTIONS." where `option`='tm' and `value`!='' and `status`=0 ORDER BY id ASC";																	
																	$rs2 = $obj1->executeQry($sql2,$link);																	
																	while($row2 = $obj1->fetchrow()){ 																	
																	?>
																	<option value="<?php echo $row2['value'];?>" <?php if($_POST['tm'] == $row2['value']) echo 'selected'; ?>><?php echo $row2['value'];?></option>
																	<?php } ?>
															</select>
													</td>
													<td><input type="text" name="actual_tm" class="txt_box2" style="width:100px;" value="<?php echo $_POST['actual_tm']; ?>"  placeholder="Actual value"/></td>
											</tr>
											<tr>
													<td>ASH(A.D.Basis)<span class="style1">*</span></td>
													<td>
															<select name="ash" style="width:130px;" class="txt_box2">
																	<option value="">--Select ASH--</option>
																	<?php 
																	$sql2 = "SELECT * FROM ".TBL_OPTIONS." where `option`='ash' and `value`!='' and `status`=0 ORDER BY id ASC";																	
																	$rs2 = $obj1->executeQry($sql2,$link);																	
																	while($row2 = $obj1->fetchrow()){ 																	
																	?>
																	<option value="<?php echo $row2['value'];?>" <?php if($_POST['ash'] == $row2['value']) echo 'selected'; ?>><?php echo $row2['value'];?></option>
																	<?php } ?>
															</select>
													</td>
													<td><input type="text" name="actual_ash" class="txt_box2" style="width:100px;" value="<?php echo $_POST['actual_ash']; ?>"  placeholder="Actual value"/></td>
											</tr>
											<tr>
													<td>Sulphur<span class="style1">*</span></td>
													<td>
															<select name="sulpher" style="width:130px;" class="txt_box2">
																	<option value="">--Select Sulphur--</option>
																	<?php 
																	$sql2 = "SELECT * FROM ".TBL_OPTIONS." where `option`='sulpher' and `value`!='' and `status`=0 ORDER BY id ASC";																	
																	$rs2 = $obj1->executeQry($sql2,$link);																	
																	while($row2 = $obj1->fetchrow()){ 																	
																	?>
																	<option value="<?php echo $row2['value'];?>" <?php if($_POST['sulpher'] == $row2['value']) echo 'selected'; ?>><?php echo $row2['value'];?></option>
																	<?php } ?>
															</select>
													</td>
													<td><input type="text"  class="txt_box2" style="width:100px;" name="actual_sulpher" value="<?php echo $_POST['actual_sulpher']; ?>"  placeholder="Actual value"/></td>
											</tr>
									</table>
							</td>
					</tr>
					<tr>
							<td>Base Rate (INR<b>/</b>Mt, Exclude Transport)</td>
							<td><input class="txt_box2" style="width:244px;" type="text" name="base_rate" value="<?php echo $_POST['base_rate']; ?>" /></td>
					</tr>
					<tr>
						<td height="10"></td>
					</tr>
					<tr>
							<td><input type="submit" name="submit" class="login_btn" value="Submit" /></td>
					</tr>
			</table>
	</form>

<?php } ?>



						</div>
				</div>
				<?php require_once(INCLUDES_DIR.'left_bar.php');?>
                <!--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');?>