<?php 
session_start();
require_once("../../includes/display_internal_user_dryout.inc.php");
require_once("../../includes/functions_internal_user_dryout.inc.php");
$obj = new data();
$connect = $obj->funConnect();
$display = new display();
$display->logout_iu();

$comid 		= $_REQUEST['comid'];
$page  			= $_REQUEST['page'];
//$fcaid = $obj->getCompareEstimateData($comid,"FCAID");
if($page == 1){$page_link = "in_ops_at_glance.php"; $page_bar="In Ops at a glance";}else if($page == 2){$page_link = "vessel_in_post_ops.php"; $page_bar="Vessels in Post Ops";}else {$page_link = "vessel_in_history.php"; $page_bar="Vessels in History";}

$vessel_id 		= $obj->getCompareEstimateData($comid,"VESSEL_IMO_ID");
$vessel_imo_id1 = $obj->getCompareEstimateData($comid,"VESSEL_IMO_ID");

$sql1 			= "select EXTERNAL_VESSEL_ID from vessel_imo_master where VESSEL_IMO_ID='".$vessel_imo_id1."'";
$res1 			= mysql_query($sql1);
$rows1 			= mysql_fetch_assoc($res1);
if(is_null($rows1['EXTERNAL_VESSEL_ID'])){$vessel_imo_id = $vessel_imo_id1; $user = '';}else{ $vessel_imo_id = $rows1['EXTERNAL_VESSEL_ID']; $user = 'EXTERNAL_USER';}

$name = $obj->getVesselIMOData($vessel_imo_id,"VESSEL_NAME"); $type = $obj->getVesselTypeBasedOnID($obj->getVesselIMOData($vessel_imo_id,"VESSEL_TYPE"));

if (@$_REQUEST['action1'] == 'Generic_submit1')
 {
 	$msg = $obj->insertNomDetails();
	header('Location:./edit_nominations1.php?msg='.$msg.'&tab=0&comid='.$_REQUEST['comid'].'&page='.$page);
 }
 if (@$_REQUEST['action1'] == 'Generic_submit2')
 {
 	$msg = $obj->insertNomDetails();
	header('Location:./'.$page_link);
 }
 if (@$_REQUEST['action2'] == 'tccp_submit1')
 {
 	$msg = $obj->insertTC_CP_TERMS_Details();
	header('Location:./edit_nominations1.php?msg='.$msg.'&tab=1&comid='.$_REQUEST['comid'].'&page='.$page);
 }
 if (@$_REQUEST['action2'] == 'tccp_submit2')
 {
 	$msg = $obj->insertTC_CP_TERMS_Details();
	header('Location:./'.$page_link);
 }
 
 if (@$_REQUEST['action3'] == 'cp_submit1')
 {
 	$msg = $obj->insertVesselCommercialParametersDetailsNominationWise(1);
	header('Location:./edit_nominations1.php?msg='.$msg.'&tab=2&comid='.$_REQUEST['comid'].'&page='.$page);
 }
 if (@$_REQUEST['action3'] == 'cp_submit2')
 {
 	$msg = $obj->insertVesselCommercialParametersDetailsNominationWise(2);
	header('Location:./'.$page_link);
 }
$pagename = basename($_SERVER['PHP_SELF'])."?comid=".$comid."&page=".$page."&vessel_id=".$vessel_imo_id1;
$uid	  = $_SESSION['uid'];
$moduleid = $_SESSION['moduleid'];

if($page == 1)
{
	$linkid = 4;
}
else
{
	$linkid = 5;
}

$rights = $obj->getUserRights($uid,$moduleid,$linkid);
?>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title><?php $display->title(); ?></title>
<?php $display->favicon(); ?>
<meta content='width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no' name='viewport'>
<?php $display->css(); ?>
<!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
<!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
<!--[if lt IE 9]>
  <script src="../js/html5shiv.js"></script>
  <script src="../js/respond.min.js"></script>
<![endif]-->
<style>
.animated {
	vertical-align: top; 
	transition: height 0.2s;
	-webkit-transition: height 0.2s; 
	-moz-transition: height 0.2s; 
}
form.cmxform label.error, label.error {
	/* remove the next line when you have trouble in IE6 with labels in list */
	font-family:Verdana, Arial, Helvetica, sans-serif;
	font-size:10px;
	color: red;
	font-style:normal;
	font-weight:lighter;
	margin:5px;
	vertical-align:top;
}
</style>
</head>
    <body class="skin-blue fixed">
        <!-- header logo: style can be found in header.less -->
        <?php $display->header_tag(); ?>
		<div class="wrapper row-offcanvas row-offcanvas-left">
            <?php $display->leftmenu(5); ?>
			<aside class="right-side">                
                <!-- Content Header (Page header) -->
                 <section class="content-header">
                    <h1>
                        <i class="fa fa-book"></i>&nbsp;Daily Tasks&nbsp;&nbsp;&nbsp;&nbsp;<small><div class="headline text-center" id="time" style="color:#000; font-weight:bold; font-size:12px;"></div></small>
                    </h1>
                    <ol class="breadcrumb">
                        <li><a href="../"><i class="fa fa-home"></i> Home</a></li>
                        <li class="active">Daily Tasks&nbsp;&nbsp;&nbsp;>&nbsp;&nbsp;&nbsp;<?php echo $page_bar; ?></li>
                    </ol>
                </section>
                <!-- Main content -->
                <section class="content invoice">
					<!--   content put here..................-->
					<div align="right"><a href="<?php echo $page_link; ?>"><button class="btn btn-info btn-flat">Back</button></a></div>
					<div style="height:10px;">&nbsp;</div>
						
						<?php 
							if(isset($_REQUEST['msg'])){
								$msg = $_REQUEST['msg'];
								if($msg == 0){?>
									<div class="alert alert-success alert-dismissable">
										<i class="fa fa-check"></i>
										<button type="button" class="close" data-dismiss="alert" aria-hidden="true">&times;</button>
										<b>Congratulations!</b> Nom Details added/updated successfully.
									</div>
								<?php }?>
								<?php if($msg == 1){?>
								<div class="alert alert-success alert-dismissable">
									<i class="fa fa-ban"></i>
									<button type="button" class="close" data-dismiss="alert" aria-hidden="true">&times;</button>
									<b>Congratulations!</b> TC CP Terms added/updated successfully.
								</div>
								<?php }?>
								<?php if($msg == 2){?>
								<div class="alert alert-success alert-dismissable">
									<i class="fa fa-check"></i>
									<button type="button" class="close" data-dismiss="alert" aria-hidden="true">&times;</button>
									<b>Congratulations!</b> Commercial Parameters added/updated successfully.
								</div>
								<?php }?>
						<?php }?>
						<div class="row">
							<div class="col-xs-12">
								<h2 class="page-header" style="text-align:center;">
								 <?php echo $obj->getVesselIMOData($obj->getCompareEstimateData($comid,"VESSEL_IMO_ID"),"VESSEL_NAME");?> : CREATE NOMINATIONS
								</h2>                            
							</div><!-- /.col -->
						</div>			
						<div class="row invoice-info">
							<div class="col-md-12">
								<!-- Custom Tabs -->
								<div class="nav-tabs-custom">
									<ul class="nav nav-tabs">
										<li class="<?php if($_REQUEST['tab']== 0){ echo 'active';} ?>"><a data-toggle="tab" href="#tab_1">NOM DETAILS</a></li>
										<li class="<?php if($_REQUEST['tab']== 1){ echo 'active';} ?>"><a data-toggle="tab" href="#tab_2">TC CP Terms</a></li>
										<li class="<?php if($_REQUEST['tab']== 2){ echo 'active';} ?>"><a data-toggle="tab" href="#tab_3">COMMERCIAL - PARAMETERS</a></li>                                    
									 </ul>
									<div class="tab-content">										
										<div id="tab_1" class="tab-pane <?php if($_REQUEST['tab']== 0){ echo 'active';} ?>">
											<form name="frm1" id="frm1" enctype="multipart/form-data" action="<?php echo $pagename;?>" method="post"/>
												<div class="row invoice-info">
													<div class="col-sm-4 invoice-col">
														Vessel
														<address>
															<strong><?php echo $obj->getVesselIMOData($obj->getCompareEstimateData($comid,"VESSEL_IMO_ID"),"VESSEL_NAME");?></strong>
														</address>
													</div>
													
													<div class="col-sm-4 invoice-col">
														Fixture Type
														<address>
															<select  name="selFixtureType" class="select form-control" id="selFixtureType">
																<?php 
																	$_REQUEST['selFixtureType'] = $obj->getNomDetailsData($comid,"FIXTURETYPE_ID");
																	$obj->getFixtureTypeList();
																?>
															</select>
														</address>
													</div>
												</div>
												
												<div class="row invoice-info">
													<div class="col-sm-4 invoice-col">
														Owner
														<address>
															<strong><?php echo $obj->getVendorListNewBasedOnID($obj->getCompareEstimateData($comid,"OWNER"));?></strong>
														</address>
													</div>
													
													<div class="col-sm-4 invoice-col">
														Charterer
														<address>
															<input type="text" name="txtCharterer" id="txtCharterer" class="form-control" autocomplete="off" value="<?php echo $obj->getNomDetailsData($comid,"CHARTERER");?>" placeholder="Charterer" />
														</address>
													</div>
													
													<div class="col-sm-4 invoice-col">
														Freight Rate <span style="font-size:10px; font-style:italic; color:#ccc;">USD/MT</span>
														<address>
															<input type="text" name="txtFRUsdMT" id="txtFRUsdMT" class="form-control" autocomplete="off" value="<?php echo $obj->getNomDetailsData($comid,"FREIGHT_RATE");?>" placeholder="Freight Rate USD/MT"/>
														</address>
													</div>
													
													<div class="col-sm-4 invoice-col">
														CP Ref
														<address>
															<input type="text" name="txtCPRef" id="txtCPRef"class="form-control" autocomplete="off" value="<?php echo $obj->getNomDetailsData($comid,"CP_REF");?>" placeholder="CP Ref" />
														</address>
													</div>
													
													<div class="col-sm-4 invoice-col">
														CP Date
														<address>
															<?php if(date("d-m-Y",strtotime($obj->getCompareEstimateData($comid,"CP_DATE"))) == "01-01-1970")
															{
																echo '<input type="text" name="txtCPDate" id="txtCPDate" class="form-control" readonly="true" value="'.date("d-m-Y",time()).'" placeholder="dd-mm-yyyy" />';
															}
															else
															{
																echo '<input type="text" name="txtCPDate" id="txtCPDate" class="form-control" readonly="true" value="'.date("d-m-Y",strtotime($obj->getCompareEstimateData($comid,"CP_DATE"))).'" placeholder="dd-mm-yyyy" />';
															}
															?>
														</address>
													</div>
													
													<div class="col-sm-4 invoice-col">
														Broker
														<address>
															<strong><?php echo $obj->getVendorListNewBasedOnID($obj->getCompareEstimateData($comid,"BROKER"));?></strong><input type="hidden" name="txtBroker" id="txtBroker" class="form-control" readonly value="<?php echo $obj->getVendorListNewBasedOnID($obj->getCompareEstimateData($comid,"BROKER"));?>" />
														</address>
													</div>
												</div>
												<div class="row">
													<div class="col-xs-12">
														<h2 class="page-header">
															Load Port
														</h2>                            
													</div><!-- /.col -->
												</div>
												
												<div class="row invoice-info">
													<div class="col-sm-4 invoice-col">
														Load Port
														<address>
															<strong><?php echo $obj->getPortNameBasedOnID($obj->getCompareEstimateData($comid,"LPID"));?></strong>
														</address>
													</div>
													
													<div class="col-sm-4 invoice-col">
														Cargo Name
														<address>
															<strong><?php echo $obj->getMaterialCodeDesBasedOnCode($obj->getCompareEstimateData($comid,"CARGO_ID"));?></strong>
														</address>
													</div>
													
													<div class="col-sm-4 invoice-col">
														Cargo Qty MT
														<address>
															<strong><?php echo $obj->getCompareEstimateData($comid,"QUANTITY");?></strong>
														</address>
													</div>
													
													<div class="col-sm-4 invoice-col">
														&nbsp;
														<address>
															<strong>&nbsp;</strong>
														</address>
													</div>
													
													<div class="col-sm-4 invoice-col">
														LayCan Starts
														<address>
															<?php if(date("d-m-Y",strtotime($obj->getCompareEstimateData($comid,"LAYCAN_CARGO_START_DATE"))) == "01-01-1970")
															{
																echo '<input type="text" name="txtDPLayCanStarts" id="txtDPLayCanStarts" class="form-control" readonly="true" value="" autocomplete="off" />';
															}
															else
															{
																echo '<input type="text" name="txtDPLayCanStarts" id="txtDPLayCanStarts" class="form-control" readonly="true" value="'.date("d-m-Y",strtotime($obj->getCompareEstimateData($comid,"LAYCAN_START_DATE"))).'" autocomplete="off" />';
															}
															?>
														</address>
													</div>
													
													<div class="col-sm-4 invoice-col">
														LayCan Finishes
														<address>
															<?php if(date("d-m-Y",strtotime($obj->getCompareEstimateData($comid,"LAYCAN_CARGO_FINISH_DATE"))) == "01-01-1970")
															{
																echo '<input type="text" name="txtDPLayCanFinishes" id="txtDPLayCanFinishes" class="form-control" readonly="true" value="" placeholder="dd-mm-yyyy" autocomplete="off" />';
															}
															else
															{
																echo '<input type="text" name="txtDPLayCanFinishes" id="txtDPLayCanFinishes" class="form-control" readonly="true" value="'.date("d-m-Y",strtotime($obj->getCompareEstimateData($comid,"LAYCAN_FINISH_DATE"))).'" placeholder="dd-mm-yyyy" autocomplete="off" />';
															}
															?>
														</address>
													</div>
												</div>
												
												<div class="row">
													<div class="col-xs-12">
														<h2 class="page-header">
															Discharge Port
														</h2>                            
													</div><!-- /.col -->
												</div>
												
												<div class="row invoice-info">
													<div class="col-sm-4 invoice-col">
														Discharge Port
														<address>
															<strong><?php echo $obj->getPortNameBasedOnID($obj->getCompareEstimateData($comid,"DPID"));?></strong>
														</address>
													</div>
													
													<div class="col-sm-4 invoice-col">
														Cargo Name
														<address>
															<strong><?php echo $obj->getMaterialCodeDesBasedOnCode($obj->getCompareEstimateData($comid,"CARGO_ID"));?></strong>
														</address>
													</div>
													
													<div class="col-sm-4 invoice-col">
														Cargo Qty MT
														<address>
															<strong><?php echo $obj->getCompareEstimateData($comid,"QUANTITY");?></strong>
														</address>
													</div>
													
													<div class="col-sm-4 invoice-col">
														Date of Delivery
														<address>
															<?php if(date("d-m-Y",strtotime($obj->getNomDetailsData($comid,"DATE_OF_DELIVERY"))) == "01-01-1970")
															{
																echo '<input type="text" name="txtDateofDelivery" id="txtDateofDelivery" class="form-control" value="" placeholder="dd-mm-yyyy" autocomplete="off"/>';
															}
															else
															{
																echo '<input type="text" name="txtDateofDelivery" id="txtDateofDelivery" class="form-control" value="'.date("d-m-Y",strtotime($obj->getNomDetailsData($comid,"DATE_OF_DELIVERY"))).'" placeholder="dd-mm-yyyy" autocomplete="off"/>';
															}
															?>
														</address>
													</div>
													
													<div class="col-sm-4 invoice-col">
														Place of Delivery
														<address>
															<input type="text" name="txtPOD" id="txtPOD" class="form-control" autocomplete="off" value="<?php echo $obj->getNomDetailsData($comid,"PLACE_OF_DELIVERY");?>" placeholder="Place of Delivery"/>
														</address>
													</div>
													
													<div class="col-sm-4 invoice-col">
														Alarm <span style="font-size:10px; font-style:italic; color:#ccc;">(No. of Days before Re-Del)</span>
														<address>
															<input type="text" name="txtAlarm" id="txtAlarm" class="form-control" autocomplete="off" value="<?php echo $obj->getNomDetailsData($comid,"ALARM");?>" placeholder="Alarm (No. of Days before Re-Del)"/>
														</address>
													</div>
												</div>
												
												<?php if($rights == 1){ ?>
												<div class="box-footer" align="right"> 
													<button type="button" class="btn btn-primary btn-flat" onClick="getSubmit1(1);">Submit</button>&nbsp;&nbsp;&nbsp;&nbsp;
													<button type="button" class="btn btn-primary btn-flat" onClick="getSubmit1(2);">Submit & Close</button>
													<input type="hidden" name="action1" id="action1" value="submit" />
												</div>
												<?php } ?>
												
											</form>
										</div><!-- /.tab_1-pane -->
										
										<div id="tab_2" class="tab-pane <?php if($_REQUEST['tab']== 1){ echo 'active';} ?>">
											<form role="form" name="frm2" id="frm2" enctype="multipart/form-data" action="<?php echo $pagename;?>" method="post"/>
												
												<div class="row invoice-info">
													<div class="col-sm-4 invoice-col">
														Nomination ID
														<address>
															&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong><?php echo $obj->getCompareTableData($comid,"MESSAGE");?></strong>
														</address>
													</div>
												</div>
												
												<div class="row">
													<div class="col-xs-12">
														<h2 class="page-header">
															TC CP Terms : Sea Passage
														</h2>                            
													</div><!-- /.col -->
												</div>
												
												<div class="row invoice-info">
													<div class="col-sm-4 invoice-col">
														Wind Force
														<address>
															<input type="text" name="txtCPWindForce" id="txtCPWindForce" class="form-control" autocomplete="off" value="<?php echo $obj->getTC_CP_TERMS_Data($comid,"CP_WIND_FORCE");?>" placeholder="Wind Force"/>
														</address>
													</div>
													
													<div class="col-sm-4 invoice-col">
														Speed Laden(Kts)
														<address>
															<input type="text" name="txtCPSpeedLaden" id="txtCPSpeedLaden" class="form-control" autocomplete="off" value="<?php echo $obj->getTC_CP_TERMS_Data($comid,"CP_SPEED_LADEN");?>" placeholder="Speed Laden(Kts)"/>
														</address>
													</div>
													
													<div class="col-sm-4 invoice-col">
														Speed Ballast (Kts)
														<address>
															<input type="text" name="txtCPSpeedBallast" id="txtCPSpeedBallast" class="form-control" autocomplete="off" value="<?php echo $obj->getTC_CP_TERMS_Data($comid,"CP_SPEED_BALLAST");?>" placeholder="Speed Ballast (Kts)" />
														</address>
													</div>
													
													<div class="col-sm-4 invoice-col">
														FO Cons Laden ( MT/Day)
														<address>
															<input type="text" name="txtCPFOConspLaden" id="txtCPFOConspLaden" class="form-control" autocomplete="off" value="<?php echo $obj->getTC_CP_TERMS_Data($comid,"CP_FO_CONSP_LADEN");?>" placeholder="FO Cons Laden ( MT/Day)" />
														</address>
													</div>
													
													<div class="col-sm-4 invoice-col">
														DO Cons Laden ( MT/Day)
														<address>
															<input type="text" name="txtCPDOConspLaden" id="txtCPDOConspLaden" class="form-control" autocomplete="off" value="<?php echo $obj->getTC_CP_TERMS_Data($comid,"CP_DO_CONSP_LADEN");?>" placeholder="DO Cons Laden ( MT/Day)" />
														</address>
													</div>
													
													<div class="col-sm-4 invoice-col">
														FO Cons Ballast ( MT/Day)
														<address>
															<input type="text" name="txtCPFOConspBallast" id="txtCPFOConspBallast" class="form-control" autocomplete="off" value="<?php echo $obj->getTC_CP_TERMS_Data($comid,"CP_FO_CONSP_BALLAST");?>" placeholder="FO Cons Ballast ( MT/Day)"/>
														</address>
													</div>
													
													<div class="col-sm-4 invoice-col">
														DO Cons Ballast ( MT/Day)
														<address>
															<input type="text" name="txtCPDOConspBallast" id="txtCPDOConspBallast" class="form-control" autocomplete="off" value="<?php echo $obj->getTC_CP_TERMS_Data($comid,"CP_DO_CONSP_BALLAST");?>" placeholder="DO Cons Ballast ( MT/Day)"/>
														</address>
													</div>
													
													<div class="col-sm-4 invoice-col">
														FO Cons Cleaning( MT/Day)
														<address>
															<input type="text" name="txtCPFOTkCleaning" id="txtCPFOTkCleaning" class="form-control" autocomplete="off" value="<?php echo $obj->getTC_CP_TERMS_Data($comid,"CP_FO_TK_CLEANING");?>" placeholder="FO Cons Cleaning( MT/Day)"/>
														</address>
													</div>
													
													<div class="col-sm-4 invoice-col">
														FO Cons G Freeing ( MT/Day)
														<address>
															<input type="text" name="txtCPFOGasFreeing" id="txtCPFOGasFreeing" class="form-control" autocomplete="off" value="<?php echo $obj->getTC_CP_TERMS_Data($comid,"CP_FO_GAS_FREEING");?>" placeholder="FO Cons G Freeing ( MT/Day)" />
														</address>
													</div>
													
													<div class="col-sm-4 invoice-col">
														FO Cons Inerting ( MT/Day)
														<address>
															<input type="text" name="txtCPFOInerting" id="txtCPFOInerting" class="form-control" autocomplete="off" value="<?php echo $obj->getTC_CP_TERMS_Data($comid,"CP_FO_INSERTING");?>" placeholder="FO Cons Inerting ( MT/Day)"/>
														</address>
													</div>
													
													<div class="col-sm-4 invoice-col">
														FO Cons Heating( MT/Day)
														<address>
															<input type="text" name="txtCPFOCargoHeating" id="txtCPFOCargoHeating" class="form-control" autocomplete="off" value="<?php echo $obj->getTC_CP_TERMS_Data($comid,"CP_FO_CARGO_HEATING");?>" placeholder="FO Cons Heating( MT/Day)"/>
														</address>
													</div>
													
													<div class="col-sm-4 invoice-col">
														DO Cons Cleaning( MT/Day)
														<address>
															<input type="text" name="txtCPDOTkCleaning" id="txtCPDOTkCleaning" class="form-control" autocomplete="off" value="<?php echo $obj->getTC_CP_TERMS_Data($comid,"CP_DO_TK_CLEANING");?>" placeholder="DO Cons Cleaning( MT/Day)"/>
														</address>
													</div>
													
													<div class="col-sm-4 invoice-col">
														DO Cons G Freeing ( MT/Day)
														<address>
															<input type="text" name="txtCPDOGasFreeing" id="txtCPDOGasFreeing" class="form-control" autocomplete="off" value="<?php echo $obj->getTC_CP_TERMS_Data($comid,"CP_DO_GAS_FREEING");?>" placeholder="DO Cons G Freeing ( MT/Day)" />
														</address>
													</div>
													
													<div class="col-sm-4 invoice-col">
														DO Cons Inerting ( MT/Day)
														<address>
															<input type="text" name="txtCPDOInerting" id="txtCPDOInerting" class="form-control" autocomplete="off" value="<?php echo $obj->getTC_CP_TERMS_Data($comid,"CP_DO_INSERTING");?>" placeholder="DO Cons Inerting ( MT/Day)" />
														</address>
													</div>
													
													<div class="col-sm-4 invoice-col">
														DO Cons Heating( MT/Day)
														<address>
															<input type="text" name="txtCPDOCargoHeating" id="txtCPDOCargoHeating" class="form-control" autocomplete="off" value="<?php echo $obj->getTC_CP_TERMS_Data($comid,"CP_DO_CARGO_HEATING");?>" placeholder="DO Cons Heating( MT/Day)" />
														</address>
													</div>
													
													<div class="col-sm-4 invoice-col">
														Speed Allowance(Kts)
														<address>
															<input type="text" name="txtSpeedAllowances" id="txtSpeedAllowances" class="form-control" autocomplete="off" value="<?php echo $obj->getTC_CP_TERMS_Data($comid,"CP_SPEED_ALLOWANCES");?>" placeholder="Speed Allowance(Kts)" />
														</address>
													</div>
												</div>
												
												<div class="row">
													<div class="col-xs-12">
														<h2 class="page-header">
															TC CP Terms : Port
														</h2>                            
													</div><!-- /.col -->
												</div>
												
												<div class="row invoice-info">
													<div class="col-sm-4 invoice-col">
														Man Pressure(Kg/sq cm)
														<address>
															<input type="text" name="txtCPManPressure" id="txtCPManPressure" class="form-control" autocomplete="off" value="<?php echo $obj->getTC_CP_TERMS_Data($comid,"CP_MAN_PRESSURE");?>" placeholder="Man Pressure(Kg/sq cm)"/>
														</address>
													</div>
													
													<div class="col-sm-4 invoice-col">
														Load Rate (MT/Hr)
														<address>
															<input type="text" name="txtCPLoadRate" id="txtCPLoadRate" class="form-control" autocomplete="off" value="<?php echo $obj->getTC_CP_TERMS_Data($comid,"CP_LOAD_RATE");?>" placeholder="Load Rate (MT/Hr)"/>
														</address>
													</div>
													
													<div class="col-sm-4 invoice-col">
														Disch Rate (MT/Hr)
														<address>
															<input type="text" name="txtCPDischRate" id="txtCPDischRate" class="form-control" autocomplete="off" value="<?php echo $obj->getTC_CP_TERMS_Data($comid,"CP_DISCH_RATE");?>" placeholder="Disch Rate (MT/Hr)"/>
														</address>
													</div>
													
													<div class="col-sm-4 invoice-col">
														FO Cons Ldg ( MT/Day)
														<address>
															<input type="text" name="txtCPFOConspLoading" id="txtCPFOConspLoading" class="form-control" autocomplete="off" value="<?php echo $obj->getTC_CP_TERMS_Data($comid,"CP_FO_CONSP_LOADING");?>" placeholder="FO Cons Ldg ( MT/Day)"/>
														</address>
													</div>
													
													<div class="col-sm-4 invoice-col">
														DO Cons Ldg ( MT/Day)
														<address>
															<input type="text" name="txtCPDOConspLoading" id="txtCPDOConspLoading" class="form-control" autocomplete="off" value="<?php echo $obj->getTC_CP_TERMS_Data($comid,"CP_DO_CONSP_LOADING");?>" placeholder="DO Cons Ldg ( MT/Day)"/>
														</address>
													</div>
													
													<div class="col-sm-4 invoice-col">
														FO Cons Disch ( MT/Day)
														<address>
															<input type="text" name="txtCPFOConspDisch" id="txtCPFOConspDisch" class="form-control" autocomplete="off" value="<?php echo $obj->getTC_CP_TERMS_Data($comid,"CP_FO_CONSP_DISCH");?>" placeholder="FO Cons Disch ( MT/Day)"/>
														</address>
													</div>
													
													<div class="col-sm-4 invoice-col">
														DO Cons Disch ( MT/Day)
														<address>
															<input type="text" name="txtCPDOConspDisch" id="txtCPDOConspDisch" class="form-control" autocomplete="off" value="<?php echo $obj->getTC_CP_TERMS_Data($comid,"CP_DO_CONSP_DISCH");?>" placeholder="DO Cons Disch ( MT/Day)"/>
														</address>
													</div>
													
													<div class="col-sm-4 invoice-col">
														FO Cons Idle ( MT/Day)
														<address>
															<input type="text" name="txtCPFOConspIdling" id="txtCPFOConspIdling" class="form-control" autocomplete="off" value="<?php echo $obj->getTC_CP_TERMS_Data($comid,"CP_FO_CONSP_IDLING");?>" placeholder="FO Cons Idle ( MT/Day)" />
														</address>
													</div>
													
													<div class="col-sm-4 invoice-col">
														DO Consp Idle (MT/Day)
														<address>
															<input type="text" name="txtCPDOConspIdling" id="txtCPDOConspIdling" class="form-control" autocomplete="off" value="<?php echo $obj->getTC_CP_TERMS_Data($comid,"CP_DO_CONSP_IDLING");?>" placeholder="DO Consp Idle (MT/Day)"/>
														</address>
													</div>
													
													<div class="col-sm-4 invoice-col">
														Load Rate ( MT/Day)
														<address>
															<input type="text" name="txtCPLoadRate_1" id="txtCPLoadRate_1" class="form-control" autocomplete="off" value="<?php echo $obj->getTC_CP_TERMS_Data($comid,"CP_LOAD_RATE_1");?>" placeholder="Load Rate ( MT/Day)"/>
														</address>
													</div>
													
													<div class="col-sm-4 invoice-col">
														Disch Rate ( MT/Day)
														<address>
															<input type="text" name="txtDischRate_1" id="txtDischRate_1" class="form-control" autocomplete="off" value="<?php echo $obj->getTC_CP_TERMS_Data($comid,"CP_DISCH_RATE_1");?>" placeholder="Disch Rate ( MT/Day)" />
														</address>
													</div>
												</div>	
												
												<?php if($rights == 1){ ?>
												<div class="box-footer" align="right"> 
													<button type="button" class="btn btn-primary btn-flat" onClick="getSubmit2(1);">Submit</button>&nbsp;&nbsp;&nbsp;&nbsp;
													<button type="button" class="btn btn-primary btn-flat" onClick="getSubmit2(2);">Submit & Close</button>
													<input type="hidden" name="action2" id="action2" value="submit" />
												</div>
												<?php } ?>
												
											</form>
										</div><!-- /.tab_2-pane -->
								
										<div id="tab_3" class="tab-pane <?php if($_REQUEST['tab']== 2){ echo 'active';} ?>">
											<form role="form" name="frm3" id="frm3" enctype="multipart/form-data" action="<?php echo $pagename;?>" method="post">
												<?php 
												$mysql = "select * from commercial_parameters_nomnation_wise where COMID='".$comid."' and MODULEID='".$_SESSION['moduleid']."' and MCOMPANYID='".$_SESSION['company']."' and VESSEL_IMO_ID='".$vessel_imo_id1."'";
												$myres = mysql_query($mysql);
												$myrec = mysql_num_rows($myres);
												if($myrec == 0)
												{
												
												?>
										
													<div class="row invoice-info">
														<!--<div class="col-sm-4 invoice-col">
															Nomination ID
															<address>
																&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong><?php echo $obj->getCompareEstimateData($comid,"NOMINATION_ID");?></strong>
															</address>
														</div>-->
													</div>
													<div class="row">
														<div class="col-xs-12">
															<h2 class="page-header">
																COMMERCIAL - PARAMETERS
															</h2>                            
														</div><!-- /.col -->
													</div>
													<div class="box">
														<div class="box-header">
															<h3 class="box-title">Main Data</h3>
														</div><!-- /.box-header -->	
														<div class="box-body no-padding">
														   <table class="table table-striped">
															<thead>
																<tr>
																	<th align="left">&nbsp;</th>
																	<th align="left">&nbsp;</th>
																	<th align="left">&nbsp;</th>
																	<th align="left">&nbsp;</th>
																</tr>
															</thead>
															<tbody>
																<tr>
																	<td>Vessel Name</td>
																	<td><input type="text" name="txtVName" id="txtVName" class="form-control" readonly value="<?php echo $name;?>" /></td>
																	<td>Vessel Type</td>
																	<td><input type="text" name="txtVType" id="txtVType" class="form-control" readonly value="<?php echo $type;?>" /></td>
																</tr>
																
																<tr>
																	<td>Date</td>
																	<td><?php if($obj->getVesselParameterData($vessel_imo_id,"MAIN_DATA_DATE",$user) != ""){?>
																			<input type="text" name="txtDate" id="txtDate" class="form-control" readonly value="<?php echo date("d-m-Y",strtotime($obj->getVesselParameterData($vessel_imo_id,"MAIN_DATA_DATE",$user)));?>" />
																		<?php }else{?>
																			<input type="text" name="txtDate" id="txtDate" class="form-control" readonly value="<?php echo date("d-m-Y",time())?>" />
																		<?php }?></td>
																	<td>DWT <span style="font-size:10px; font-style:italic;">(Summer)</span></td>
																	<td><input type="text" name="txtDWTS" id="txtDWTS" class="form-control" value="<?php echo $obj->getVesselIMOData($vessel_imo_id,"DWT");?>" readonly /></td>
																</tr>
																
																<tr>
																	<td>Draft <span style="font-size:10px; font-style:italic;">(Summer)</span></td>
																	<td><input type="text" name="txtDraft" id="txtDraft" class="form-control"  value="<?php echo $obj->getVesselIMOData($vessel_imo_id,"DRAFTM");?>" readonly /></td>
																	<td>TPC</td>
																	<td><input type="text" name="txtTPC" id="txtTPC" class="form-control" value="<?php echo $obj->getVesselParticularData('SUMMER_3','vessel_master_1',$vessel_imo_id);?>" readonly /></td>
																</tr>
																
																
															</tbody>
															</table>
														</div>
													</div>
											   
													<div class="box">
														<div class="box-header">
															<h3 class="box-title">Speed Data</h3>
														</div><!-- /.box-header -->	 
														<div class="box-body no-padding">
															<table class="table table-striped">
																<thead>
																	<tr>
																		<th align="left"></th>
																		<th align="right" class="text-right">Full Speed&nbsp;&nbsp;</th>
																		<th align="right" class="text-right">Eco Speed 1&nbsp;&nbsp;</th>
																		<th align="right" class="text-right">Eco Speed 2&nbsp;&nbsp;</th>
																	</tr>
																</thead>
																<tbody>
																	<tr>
																		<td>Ballast Speed <span style="font-size:10px; font-style:italic;">(Knots)</span></td>
																		<td><input type="text" name="txtBFullSpeed" id="txtBFullSpeed" class="form-control" autocomplete="off" value="<?php echo $obj->getVesselParameterData($vessel_imo_id,"B_FULL_SPEED",$user);?>" /></td>
																		<td><input type="text" name="txtBEcoSpeed1" id="txtBEcoSpeed1" class="form-control" autocomplete="off" value="<?php echo $obj->getVesselParameterData($vessel_imo_id,"B_ECO_SPEED1",$user);?>" /></td>
																		<td><input type="text" name="txtBEcoSpeed2" id="txtBEcoSpeed2" class="form-control" autocomplete="off" value="<?php echo $obj->getVesselParameterData($vessel_imo_id,"B_ECO_SPEED2",$user);?>" /></td>
																	</tr>
																	<tr>
																		<td>Laden Speed <span style="font-size:10px; font-style:italic;">(Knots)</span></td>
																		<td><input type="text" name="txtLFullSpeed" id="txtLFullSpeed" class="form-control" autocomplete="off" value="<?php echo $obj->getVesselParameterData($vessel_imo_id,"L_FULL_SPEED",$user);?>" /></td>
																		<td><input type="text" name="txtLEcoSpeed1" id="txtLEcoSpeed1" class="form-control" autocomplete="off" value="<?php echo $obj->getVesselParameterData($vessel_imo_id,"L_ECO_SPEED1",$user);?>" /></td>
																		<td><input type="text" name="txtLEcoSpeed2" id="txtLEcoSpeed2" class="form-control" autocomplete="off" value="<?php echo $obj->getVesselParameterData($vessel_imo_id,"L_ECO_SPEED2",$user);?>" /></td>
																	</tr>
																</tbody>
															</table>
														</div>
													</div>

													<div class="box">
														<div class="box-header">
															<h3 class="box-title">FO Consumption MT/Day</h3>
														</div><!-- /.box-header -->
													   <div class="box-body no-padding">
															<table class="table table-striped">
																<thead>
																	<tr>
																		<th align="left" width="25%">&nbsp;</th>
																		<th align="right" width="25%">&nbsp;</th>
																		<th align="right" width="25%">&nbsp;</th>
																		<th align="right" width="25%">&nbsp;</th>
																	</tr>
																</thead>
																<tbody>
																	<tr>
																		<td>&nbsp;&nbsp;</td>
																		<td>&nbsp;&nbsp;</td>
																		<td>FO Grade</td>
																		<td><input type="text" name="txtFOGrade" id="txtFOGrade" class="form-control" autocomplete="off" value="<?php echo $obj->getVesselParameterData($vessel_imo_id,"FO_GRADE",$user);?>" /></td>
																	</tr>
																	<tr>
																		<td>&nbsp;&nbsp;</td>
																		<td align="right" class="text-right" style="font-weight:bold;">Full Speed&nbsp;&nbsp;</td>
																		<td align="right" class="text-right" style="font-weight:bold;">Eco Speed 1&nbsp;&nbsp;</td>
																		<td align="right" class="text-right" style="font-weight:bold;">Eco Speed 2&nbsp;&nbsp;</td>
																	</tr>
																	<tr>
																		<td>Ballast Passage</td>
																		<td><input type="text" name="txtFOBPassageFS" id="txtFOBPassageFS" class="form-control" autocomplete="off" value="<?php echo $obj->getVesselParameterData($vessel_imo_id,"BP_FO_FULL_SPEED",$user);?>" /></td>
																		<td><input type="text" name="txtFOBPassageES1" id="txtFOBPassageES1" class="form-control" autocomplete="off" value="<?php echo $obj->getVesselParameterData($vessel_imo_id,"BP_FO_ECO_SPEED1",$user);?>" /></td>
																		<td><input type="text" name="txtFOBPassageES2" id="txtFOBPassageES2" class="form-control" autocomplete="off" value="<?php echo $obj->getVesselParameterData($vessel_imo_id,"BP_FO_ECO_SPEED2",$user);?>" /></td>
																	</tr>
																	
																	<tr>
																		<td>Laden Passage</td>
																		<td><input type="text" name="txtFOLPassageFS" id="txtFOLPassageFS" class="form-control" autocomplete="off" value="<?php echo $obj->getVesselParameterData($vessel_imo_id,"LP_FO_FULL_SPEED",$user);?>" /></td>
																		<td><input type="text" name="txtFOLPassageES1" id="txtFOLPassageES1" class="form-control" autocomplete="off" value="<?php echo $obj->getVesselParameterData($vessel_imo_id,"LP_FO_ECO_SPEED1",$user);?>" /></td>
																		<td><input type="text" name="txtFOLPassageES2" id="txtFOLPassageES2" class="form-control" autocomplete="off" value="<?php echo $obj->getVesselParameterData($vessel_imo_id,"LP_FO_ECO_SPEED2",$user);?>" /></td>
																	</tr>
																	<tr>
																		<td>&nbsp;&nbsp;</td>
																		<td align="right" class="text-right" style="font-weight:bold;">In Port - Idle&nbsp;&nbsp;</td>
																		<td align="right" class="text-right" style="font-weight:bold;">In Port - Working&nbsp;&nbsp;</td>
																		<td align="right" class="text-right" style="font-weight:bold;">Others &nbsp;&nbsp;</td>
																	</tr>
																	
																	<tr>
																		<td>&nbsp;&nbsp;</td>
																		<td><input type="text" name="txtFOIPIdleFS" id="txtFOIPIdleFS" class="form-control" autocomplete="off" value="<?php echo $obj->getVesselParameterData($vessel_imo_id,"PI_FO_FULL_SPEED",$user);?>" /></td>
																		<td><input type="text" name="txtFOIPWorkingFS" id="txtFOIPWorkingFS" class="form-control" autocomplete="off" value="<?php echo $obj->getVesselParameterData($vessel_imo_id,"PW_FO_FULL_SPEED",$user);?>" /></td>
																		<td><input type="text" name="txtFOOthersFS" id="txtFOOthersFS" class="form-control" autocomplete="off" value="<?php echo $obj->getVesselParameterData($vessel_imo_id,"OTH_FO_FULL_SPEED",$user);?>" /></td>
																	</tr>
																	
																</tbody>
															</table>
														</div>
													</div>
										
													<div class="box">
														<div class="box-header">
															<h3 class="box-title">DO Consumption per MT/Day</h3>
														</div><!-- /.box-header -->
													   <div class="box-body no-padding">
															<table class="table table-striped">
																<thead>
																	<tr>
																		<th align="left" width="25%">&nbsp;</th>
																		<th align="right" width="25%">&nbsp;</th>
																		<th align="right" width="25%">&nbsp;</th>
																		<th align="right" width="25%">&nbsp;</th>
																	</tr>
																</thead>
																<tbody>
																	<tr>
																		<td>&nbsp;&nbsp;</td>
																		<td>&nbsp;&nbsp;</td>
																		<td>DO Grade</td>
																		<td><input type="text" name="txtDOGrade" id="txtDOGrade" class="form-control" autocomplete="off" value="<?php echo $obj->getVesselParameterData($vessel_imo_id,"DO_GRADE",$user);?>" /></td>
																	</tr>
																	<tr>
																		<td>&nbsp;&nbsp;</td>
																		<td align="right" class="text-right" style="font-weight:bold;">Full Speed&nbsp;&nbsp;</td>
																		<td align="right" class="text-right" style="font-weight:bold;">Eco Speed 1&nbsp;&nbsp;</td>
																		<td align="right" class="text-right" style="font-weight:bold;">Eco Speed 2&nbsp;&nbsp;</td>
																	</tr>
																	<tr>
																		<td>Ballast Passage</td>
																		<td><input type="text" name="txtDOBPassageFS" id="txtDOBPassageFS" class="form-control" autocomplete="off" value="<?php echo $obj->getVesselParameterData($vessel_imo_id,"BP_DO_FULL_SPEED",$user);?>" /></td>
																		<td><input type="text" name="txtDOBPassageES1" id="txtDOBPassageES1" class="form-control" autocomplete="off" value="<?php echo $obj->getVesselParameterData($vessel_imo_id,"BP_DO_ECO_SPEED1",$user);?>" /></td>
																		<td><input type="text" name="txtDOBPassageES2" id="txtDOBPassageES2" class="form-control" autocomplete="off" value="<?php echo $obj->getVesselParameterData($vessel_imo_id,"BP_DO_ECO_SPEED2",$user);?>" /></td>
																	</tr>
																	
																	<tr>
																		<td>Laden Passage</td>
																		<td><input type="text" name="txtDOLPassageFS" id="txtDOLPassageFS" class="form-control" autocomplete="off" value="<?php echo $obj->getVesselParameterData($vessel_imo_id,"LP_DO_FULL_SPEED",$user);?>" /></td>
																		<td><input type="text" name="txtDOLPassageES1" id="txtDOLPassageES1" class="form-control" autocomplete="off" value="<?php echo $obj->getVesselParameterData($vessel_imo_id,"LP_DO_ECO_SPEED1",$user);?>" /></td>
																		<td><input type="text" name="txtDOLPassageES2" id="txtDOLPassageES2" class="form-control" autocomplete="off" value="<?php echo $obj->getVesselParameterData($vessel_imo_id,"LP_DO_ECO_SPEED2",$user);?>" /></td>
																	</tr>
																	<tr>
																		<td>&nbsp;&nbsp;</td>
																		<td align="right" class="text-right" style="font-weight:bold;">In Port - Idle&nbsp;&nbsp;</td>
																		<td align="right" class="text-right" style="font-weight:bold;">In Port - Working&nbsp;&nbsp;</td>
																		<td align="right" class="text-right" style="font-weight:bold;">Others &nbsp;&nbsp;</td>
																	</tr>
																	
																	<tr>
																		<td>&nbsp;&nbsp;</td>
																		<td><input type="text" name="txtDOIPIdleFS" id="txtDOIPIdleFS" class="form-control" autocomplete="off" value="<?php echo $obj->getVesselParameterData($vessel_imo_id,"PI_DO_FULL_SPEED",$user);?>" /></td>
																		<td><input type="text" name="txtDOIPWorkingFS" id="txtDOIPWorkingFS" class="form-control" autocomplete="off" value="<?php echo $obj->getVesselParameterData($vessel_imo_id,"PW_DO_FULL_SPEED",$user);?>" /></td>
																		<td><input type="text" name="txtDOOthersFS" id="txtDOOthersFS" class="form-control" autocomplete="off" value="<?php echo $obj->getVesselParameterData($vessel_imo_id,"OTH_DO_FULL_SPEED",$user);?>" /></td>
																	</tr>
																	
																</tbody>
															</table>
														</div>
													</div>									
										
													<div class="box">
														<div class="box-header">
															<h3 class="box-title">Source / Other Details</h3>
														</div><!-- /.box-header -->	 
														<div class="box-body no-padding">
															<table class="table table-striped">
																<thead>
																	<tr>
																		<th align="left" class="text-right">&nbsp;&nbsp;</th>
																		<th align="right" class="text-right">&nbsp;&nbsp;</th>
																	</tr>
																</thead>
																<tbody>
																	<tr>
																		<td>Remarks</td>
																		<td><textarea class="form-control areasize" name="txtRemarks" id="txtRemarks"><?php echo $obj->getVesselParameterData($vessel_imo_id,"REMARKS",$user);?></textarea></td>
																	</tr>
																	
																</tbody>
															</table>
														</div>
													</div>
													<?php if($rights == 1){ ?>
													<div class="box-footer" align="right"> 
														<button type="button" class="btn btn-primary btn-flat" onclick="return getSubmit3(1);">Submit</button>&nbsp;&nbsp;&nbsp;&nbsp;
														<button type="button" class="btn btn-primary btn-flat" onclick="return getSubmit3(2);">Submit & Close</button>
														<input type="hidden" name="action3" id="action3" value="submit" />
													</div>
													<?php } ?>
													<!-------------------------------------------------------->
													<!-----------------------ELSE PART------------------------>
													<!-------------------------------------------------------->
													<?php }else{
														$myrows = mysql_fetch_assoc($myres);
													?>
													<div class="row invoice-info">
														<div class="col-sm-4 invoice-col">
															Nomination ID
															<address>
																&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong><?php echo $obj->getCompareTableData($comid,"MESSAGE");?></strong>
															</address>
														</div>
													</div>
													<div class="row">
														<div class="col-xs-12">
															<h2 class="page-header">
																COMMERCIAL - PARAMETERS
															</h2>                            
														</div><!-- /.col -->
													</div>
										
													<div class="box">
														<div class="box-header">
															<h3 class="box-title">Main Data</h3>
														</div><!-- /.box-header -->	
														<div class="box-body no-padding">
														   <table class="table table-striped">
															<thead>
																<tr>
																	<th align="left">&nbsp;</th>
																	<th align="left">&nbsp;</th>
																	<th align="left">&nbsp;</th>
																	<th align="left">&nbsp;</th>
																</tr>
															</thead>
															<tbody>
																<tr>
																	<td>Vessel Name</td>
																	<td><input type="text" name="txtVName" id="txtVName" class="form-control" readonly value="<?php echo $obj->getVesselIMOData($myrows['VESSEL_IMO_ID'],"VESSEL_NAME");?>" /></td>
																	<td>Vessel Type</td>
																	<td><input type="text" name="txtVType" id="txtVType" class="form-control" readonly value="<?php echo $obj->getVesselTypeBasedOnID($obj->getVesselIMOData($myrows['VESSEL_IMO_ID'],"VESSEL_TYPE"));?>" /></td>
																</tr>
																
																<tr>
																	<td>Date</td>
																	<td><?php if($myrows['MAIN_DATA_DATE'] != ""){?>
																			<input type="text" name="txtDate" id="txtDate" class="form-control" readonly value="<?php echo date("d-m-Y",strtotime($myrows['MAIN_DATA_DATE']));?>" />
																		<?php }else{?>
																			<input type="text" name="txtDate" id="txtDate" class="form-control" readonly value="<?php echo date("d-m-Y",time())?>" />
																		<?php }?></td>
																	<td>DWT <span style="font-size:10px; font-style:italic;">(Summer)</span></td>
																	<td><input type="text" name="txtDWTS" id="txtDWTS" class="form-control" value="<?php echo $obj->getVesselIMOData($vessel_imo_id,"DWT");?>" readonly /></td>
																</tr>
																
																<tr>
																	<td>Draft <span style="font-size:10px; font-style:italic;">(Summer)</span></td>
																	<td><input type="text" name="txtDraft" id="txtDraft" class="form-control" value="<?php echo $obj->getVesselIMOData($vessel_imo_id,"DRAFTM");?>" readonly /></td>
																	<td>TPC</td>
																	<td><input type="text" name="txtTPC" id="txtTPC" class="form-control" value="<?php echo $obj->getVesselParticularData('SUMMER_3','vessel_master_1',$vessel_imo_id);?>" readonly /></td>
																</tr>
																
															</tbody>
															</table>
														</div>
													</div>
											   
													<div class="box">
														<div class="box-header">
															<h3 class="box-title">Speed Data</h3>
														</div><!-- /.box-header -->	 
														<div class="box-body no-padding">
															<table class="table table-striped">
																<thead>
																	<tr>
																		<th align="left"></th>
																		<th align="right" class="text-right">Full Speed&nbsp;&nbsp;</th>
																		<th align="right" class="text-right">Eco Speed 1&nbsp;&nbsp;</th>
																		<th align="right" class="text-right">Eco Speed 2&nbsp;&nbsp;</th>
																	</tr>
																</thead>
																<tbody>
																	<tr>
																		<td>Ballast Speed <span style="font-size:10px; font-style:italic;">(Knots)</span></td>
																		<td><input type="text" name="txtBFullSpeed" id="txtBFullSpeed" class="form-control" autocomplete="off" value="<?php echo $myrows['B_FULL_SPEED'];?>" /></td>
																		<td><input type="text" name="txtBEcoSpeed1" id="txtBEcoSpeed1" class="form-control" autocomplete="off" value="<?php echo $myrows['B_ECO_SPEED1'];?>" /></td>
																		<td><input type="text" name="txtBEcoSpeed2" id="txtBEcoSpeed2" class="form-control" autocomplete="off" value="<?php echo $myrows['B_ECO_SPEED2'];?>" /></td>
																	</tr>
																	<tr>
																		<td>Laden Speed <span style="font-size:10px; font-style:italic;">(Knots)</span></td>
																		<td><input type="text" name="txtLFullSpeed" id="txtLFullSpeed" class="form-control" autocomplete="off" value="<?php echo $myrows['L_FULL_SPEED'];?>" /></td>
																		<td><input type="text" name="txtLEcoSpeed1" id="txtLEcoSpeed1" class="form-control" autocomplete="off" value="<?php echo $myrows['L_ECO_SPEED1'];?>" /></td>
																		<td><input type="text" name="txtLEcoSpeed2" id="txtLEcoSpeed2" class="form-control" autocomplete="off" value="<?php echo $myrows['L_ECO_SPEED2'];?>" /></td>
																	</tr>
																</tbody>
															</table>
														</div>
													</div>

													<div class="box">
														<div class="box-header">
															<h3 class="box-title">FO Consumption MT/Day</h3>
														</div><!-- /.box-header -->
													   <div class="box-body no-padding">
															<table class="table table-striped">
																<thead>
																	<tr>
																		<th align="left" width="25%">&nbsp;</th>
																		<th align="right" width="25%">&nbsp;</th>
																		<th align="right" width="25%">&nbsp;</th>
																		<th align="right" width="25%">&nbsp;</th>
																	</tr>
																</thead>
																<tbody>
																	<tr>
																		<td>&nbsp;&nbsp;</td>
																		<td>&nbsp;&nbsp;</td>
																		<td>FO Grade</td>
																		<td><input type="text" name="txtFOGrade" id="txtFOGrade" class="form-control" autocomplete="off" value="<?php echo $myrows['FO_GRADE'];?>" /></td>
																	</tr>
																	<tr>
																		<td>&nbsp;&nbsp;</td>
																		<td align="right" class="text-right" style="font-weight:bold;">Full Speed&nbsp;&nbsp;</td>
																		<td align="right" class="text-right" style="font-weight:bold;">Eco Speed 1&nbsp;&nbsp;</td>
																		<td align="right" class="text-right" style="font-weight:bold;">Eco Speed 2&nbsp;&nbsp;</td>
																	</tr>
																	<tr>
																		<td>Ballast Passage</td>
																		<td><input type="text" name="txtFOBPassageFS" id="txtFOBPassageFS" class="form-control" autocomplete="off" value="<?php echo $myrows['BP_FO_FULL_SPEED'];?>" /></td>
																		<td><input type="text" name="txtFOBPassageES1" id="txtFOBPassageES1" class="form-control" autocomplete="off" value="<?php echo $myrows['BP_FO_ECO_SPEED1'];?>" /></td>
																		<td><input type="text" name="txtFOBPassageES2" id="txtFOBPassageES2" class="form-control" autocomplete="off" value="<?php echo $myrows['BP_FO_ECO_SPEED2'];?>" /></td>
																	</tr>
																	
																	<tr>
																		<td>Laden Passage</td>
																		<td><input type="text" name="txtFOLPassageFS" id="txtFOLPassageFS" class="form-control" autocomplete="off" value="<?php echo $myrows['LP_FO_FULL_SPEED'];?>" /></td>
																		<td><input type="text" name="txtFOLPassageES1" id="txtFOLPassageES1" class="form-control" autocomplete="off" value="<?php echo $myrows['LP_FO_ECO_SPEED1'];?>" /></td>
																		<td><input type="text" name="txtFOLPassageES2" id="txtFOLPassageES2" class="form-control" autocomplete="off" value="<?php echo $myrows['LP_FO_ECO_SPEED2'];?>" /></td>
																	</tr>
																	<tr>
																		<td>&nbsp;&nbsp;</td>
																		<td align="right" class="text-right" style="font-weight:bold;">In Port - Idle&nbsp;&nbsp;</td>
																		<td align="right" class="text-right" style="font-weight:bold;">In Port - Working&nbsp;&nbsp;</td>
																		<td align="right" class="text-right" style="font-weight:bold;">Others &nbsp;&nbsp;</td>
																	</tr>
																	
																	<tr>
																		<td>&nbsp;&nbsp;</td>
																		<td><input type="text" name="txtFOIPIdleFS" id="txtFOIPIdleFS" class="form-control" autocomplete="off" value="<?php echo $myrows['PI_FO_FULL_SPEED'];?>" /></td>
																		<td><input type="text" name="txtFOIPWorkingFS" id="txtFOIPWorkingFS" class="form-control" autocomplete="off" value="<?php echo $myrows['PW_FO_FULL_SPEED'];?>" /></td>
																		<td><input type="text" name="txtFOOthersFS" id="txtFOOthersFS" class="form-control" autocomplete="off" value="<?php echo $myrows['OTH_FO_FULL_SPEED'];?>" /></td>
																	</tr>
																	
																</tbody>
															</table>
														</div>
													</div>
										
													<div class="box">
														<div class="box-header">
															<h3 class="box-title">DO Consumption per MT/Day</h3>
														</div><!-- /.box-header -->
													   <div class="box-body no-padding">
															<table class="table table-striped">
																<thead>
																	<tr>
																		<th align="left" width="25%">&nbsp;</th>
																		<th align="right" width="25%">&nbsp;</th>
																		<th align="right" width="25%">&nbsp;</th>
																		<th align="right" width="25%">&nbsp;</th>
																	</tr>
																</thead>
																<tbody>
																	<tr>
																		<td>&nbsp;&nbsp;</td>
																		<td>&nbsp;&nbsp;</td>
																		<td>DO Grade</td>
																		<td><input type="text" name="txtDOGrade" id="txtDOGrade" class="form-control" autocomplete="off" value="<?php echo $myrows['DO_GRADE'];?>" /></td>
																	</tr>
																	<tr>
																		<td>&nbsp;&nbsp;</td>
																		<td align="right" class="text-right" style="font-weight:bold;">Full Speed&nbsp;&nbsp;</td>
																		<td align="right" class="text-right" style="font-weight:bold;">Eco Speed 1&nbsp;&nbsp;</td>
																		<td align="right" class="text-right" style="font-weight:bold;">Eco Speed 2&nbsp;&nbsp;</td>
																	</tr>
																	<tr>
																		<td>Ballast Passage</td>
																		<td><input type="text" name="txtDOBPassageFS" id="txtDOBPassageFS" class="form-control" autocomplete="off" value="<?php echo $myrows['BP_DO_FULL_SPEED'];?>" /></td>
																		<td><input type="text" name="txtDOBPassageES1" id="txtDOBPassageES1" class="form-control" autocomplete="off" value="<?php echo $myrows['BP_DO_ECO_SPEED1'];?>" /></td>
																		<td><input type="text" name="txtDOBPassageES2" id="txtDOBPassageES2" class="form-control" autocomplete="off" value="<?php echo $myrows['BP_DO_ECO_SPEED2'];?>" /></td>
																	</tr>
																	
																	<tr>
																		<td>Laden Passage</td>
																		<td><input type="text" name="txtDOLPassageFS" id="txtDOLPassageFS" class="form-control" autocomplete="off" value="<?php echo $myrows['LP_DO_FULL_SPEED'];?>" /></td>
																		<td><input type="text" name="txtDOLPassageES1" id="txtDOLPassageES1" class="form-control" autocomplete="off" value="<?php echo $myrows['LP_DO_ECO_SPEED1'];?>" /></td>
																		<td><input type="text" name="txtDOLPassageES2" id="txtDOLPassageES2" class="form-control" autocomplete="off" value="<?php echo $myrows['LP_DO_ECO_SPEED2'];?>" /></td>
																	</tr>
																	<tr>
																		<td>&nbsp;&nbsp;</td>
																		<td align="right" class="text-right" style="font-weight:bold;">In Port - Idle&nbsp;&nbsp;</td>
																		<td align="right" class="text-right" style="font-weight:bold;">In Port - Working&nbsp;&nbsp;</td>
																		<td align="right" class="text-right" style="font-weight:bold;">Others &nbsp;&nbsp;</td>
																	</tr>
																	
																	<tr>
																		<td>&nbsp;&nbsp;</td>
																		<td><input type="text" name="txtDOIPIdleFS" id="txtDOIPIdleFS" class="form-control" autocomplete="off" value="<?php echo $myrows['PI_DO_FULL_SPEED'];?>" /></td>
																		<td><input type="text" name="txtDOIPWorkingFS" id="txtDOIPWorkingFS" class="form-control" autocomplete="off" value="<?php echo $myrows['PW_DO_FULL_SPEED'];?>" /></td>
																		<td><input type="text" name="txtDOOthersFS" id="txtDOOthersFS" class="form-control" autocomplete="off" value="<?php echo $myrows['OTH_DO_FULL_SPEED'];?>" /></td>
																	</tr>
																	
																</tbody>
															</table>
														</div>
													</div>									
										
													<div class="box">
														<div class="box-header">
															<h3 class="box-title">Source / Other Details</h3>
														</div><!-- /.box-header -->	 
														<div class="box-body no-padding">
															<table class="table table-striped">
																<thead>
																	<tr>
																		<th align="left" class="text-right">&nbsp;&nbsp;</th>
																		<th align="right" class="text-right">&nbsp;&nbsp;</th>
																	</tr>
																</thead>
																<tbody>
																	<tr>
																		<td>Remarks</td>
																		<td><textarea class="form-control areasize" name="txtRemarks" id="txtRemarks"><?php echo $myrows["REMARKS"];?></textarea></td>
																	</tr>
																	
																</tbody>
															</table>
														</div>
													</div>
										
													<?php if($rights == 1){ if($myrows['SUBMITID'] != 2){?>
														<div class="box-footer" align="right"> 
															<button type="button" class="btn btn-primary btn-flat" onClick="return getSubmit3(1);">Submit</button>&nbsp;&nbsp;&nbsp;&nbsp;
															<button type="button" class="btn btn-primary btn-flat" onClick="return getSubmit3(2);">Submit & Close</button>
															<input type="hidden" name="action3" id="action3" value="submit" />
														</div> 
													<?php }}?>
												<?php }?>
											</form>
										</div>
										<!-- /.tab_3-pane -->
									</div><!-- /.tab-content -->
								</div><!-- nav-tabs-custom -->
							</div>
						</div>
					<!--   content ends here..................-->
                </section><!-- /.content -->
            </aside><!-- /.right-side -->
        </div><!-- ./wrapper -->
<?php $display->footer(); ?>
<?php $display->js(); ?>
<link href="../../css/jquery.alerts.css" rel="stylesheet" type="text/css" />
<script src='../../js/jquery.autosize.js'></script>
<script language="JavaScript" type="text/javascript" src="../../js/jquery.alerts.js"></script>
<script src="../../js/timer.js" type="text/javascript"></script>
<link href="../../css/datepicker/datepicker.css" rel="stylesheet" type="text/css" />
<script src="../../js/bootstrap-datepicker.js" type="text/javascript"></script>
<script language="JavaScript" type="text/javascript" src="../../js/jquery.numeric.js"></script>
<script type="text/javascript">
$(document).ready(function(){
	$('.areasize').autosize({append: "\n"});
	$("#txtAlarm,#txtFRUsdMT,#txtCPWindForce,#txtCPSpeedLaden,#txtCPSpeedBallast,#txtCPFOConspLaden,#txtCPDOConspLaden,#txtCPFOConspBallast,#txtCPDOConspBallast,#txtCPFOTkCleaning,#txtCPFOGasFreeing,#txtCPFOInerting,#txtCPFOCargoHeating,#txtCPDOTkCleaning,#txtCPDOGasFreeing,#txtCPDOInerting,#txtCPDOCargoHeating,#txtCPManPressure,#txtCPLoadRate,#txtCPDischRate,#txtCPFOConspLoading,#txtCPDOConspLoading,#txtCPFOConspDisch,#txtCPDOConspDisch,#txtCPFOConspIdling,#txtSpeedAllowances,#txtCPDOConspIdling,#txtCPLoadRate_1,#txtDischRate_1, #txtBFullSpeed,#txtBEcoSpeed1,#txtBEcoSpeed2,#txtLFullSpeed,#txtLEcoSpeed1,#txtLEcoSpeed2,#txtFOBPassageFS,#txtFOBPassageES1,#txtFOBPassageES2,#txtFOLPassageFS,#txtFOLPassageES1,#txtFOLPassageES2,#txtFOIPIdleFS,#txtFOIPIdleES1,#txtFOIPIdleES2,#txtFOIPWorkingFS,#txtFOIPWorkingES1,#txtFOIPWorkingES2,#txtFOOthersFS,#txtFOOthersES1,#txtFOOthersES2,#txtDOBPassageFS,#txtDOBPassageES1,#txtDOBPassageES2,#txtDOLPassageFS,#txtDOLPassageES1,#txtDOLPassageES2,#txtDOIPIdleFS,#txtDOIPIdleES1,#txtDOIPIdleES2,#txtDOIPWorkingFS,#txtDOIPWorkingES1,#txtDOIPWorkingES2,#txtDOOthersFS,#txtDOOthersES1,#txtDOOthersES2").numeric();
	
	$("#txtBFullSpeed,#txtBEcoSpeed1,#txtBEcoSpeed2,#txtLFullSpeed,#txtLEcoSpeed1,#txtLEcoSpeed2,#txtFOBPassageFS,#txtFOBPassageES1,#txtFOBPassageES2,#txtFOLPassageFS,#txtFOLPassageES1,#txtFOLPassageES2,#txtFOIPIdleFS,#txtFOIPIdleES1,#txtFOIPIdleES2,#txtFOIPWorkingFS,#txtFOIPWorkingES1,#txtFOIPWorkingES2,#txtFOOthersFS,#txtFOOthersES1,#txtFOOthersES2,#txtDOBPassageFS,#txtDOBPassageES1,#txtDOBPassageES2,#txtDOLPassageFS,#txtDOLPassageES1,#txtDOLPassageES2,#txtDOIPIdleFS,#txtDOIPIdleES1,#txtDOIPIdleES2,#txtDOIPWorkingFS,#txtDOIPWorkingES1,#txtDOIPWorkingES2,#txtDOOthersFS,#txtDOOthersES1,#txtDOOthersES2").css({"direction":"rtl"});
	
	
	$('#txtDate,#txtDateofDelivery').datepicker({
		format: 'dd-mm-yyyy',
		autoclose: true
	});
	
});

function getSubmit1(var1)
{
	if(var1 == 1){$("#action1").val("Generic_submit1");}
	if(var1 == 2){$("#action1").val("Generic_submit2");}
	document.frm1.submit();
}

function getSubmit2(var1)
{
	if(var1 == 1){$("#action2").val("tccp_submit1");}
	if(var1 == 2){$("#action2").val("tccp_submit2");}
	document.frm2.submit();
}

function getSubmit3(var1)
{
	jConfirm('Are you sure you have checked each entry ?', 'Confirmion', function(r) {
	if(r){ 
			if(var1 == 1){$("#action3").val("cp_submit1");}
			if(var1 == 2){$("#action3").val("cp_submit2");}
			document.frm3.submit();
	}
	else{return false;}
	});	
}

</script>
    </body>
</html>