<?php 
session_start();
require_once("../../includes/display_internal_user_dryin.inc.php");
require_once("../../includes/functions_internal_user_dryin.inc.php");
$obj = new data();
$connect = $obj->funConnect();
$display = new display();
$display->logout_iu();
$mappingid = $_REQUEST['mappingid'];
$page  = $_REQUEST['page'];
if($page == 1){$page_link = "in_ops_at_glance.php";}else if($page == 2){$page_link = "vessel_in_post_ops.php";}else {$page_link = "vessel_in_history.php";}

$vessel_id = $obj->getVesselOpenEntryDeta($obj->getMappingData($mappingid,"OPEN_VESSEL_ID"),"VESSEL_IMO_ID");
$vessel_imo_id1 = $obj->getVesselOpenEntryDeta($obj->getMappingData($mappingid,"OPEN_VESSEL_ID"),"VESSEL_IMO_ID");

$sql1 = "select EXTERNAL_VESSEL_ID from vessel_imo_master where VESSEL_IMO_ID='".$vessel_imo_id1."'";
$res1 = mssql_query($sql1);
$rows1 = mssql_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';}

if($user == 'EXTERNAL_USER')
{$name = $obj->getExternalVesselData($vessel_imo_id,"VESSEL_NAME"); $type = $obj->getVesselTypeBasedOnID($obj->getExternalVesselData($vessel_imo_id,"VESSEL_TYPE"));}
else
{$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&mappingid='.$_REQUEST['mappingid'].'&page='.$page);
 }
 if (@$_REQUEST['action1'] == 'Generic_submit2')
 {
 	$msg = $obj->insertNomDetails();
	header('Location : ./'.$page_link.'?msg=2');
 }
 if (@$_REQUEST['action2'] == 'tccp_submit1')
 {
 	$msg = $obj->insertTC_CP_TERMS_Details();
	header('Location : ./edit_nominations1.php?msg='.$msg.'&tab=1&mappingid='.$_REQUEST['mappingid'].'&page='.$page);
 }
 if (@$_REQUEST['action2'] == 'tccp_submit2')
 {
 	$msg = $obj->insertTC_CP_TERMS_Details();
	header('Location : ./'.$page_link.'?msg=2');
 }
 
 if (@$_REQUEST['action3'] == 'cp_submit1')
 {
 	$msg = $obj->insertVesselCommercialParametersDetailsNominationWise(1);
	header('Location : ./edit_nominations1.php?msg='.$msg.'&tab=2&mappingid='.$_REQUEST['mappingid'].'&page='.$page);
 }
 if (@$_REQUEST['action3'] == 'cp_submit2')
 {
 	$msg = $obj->insertVesselCommercialParametersDetailsNominationWise(2);
	header('Location : ./'.$page_link.'?msg=2');
 }
$pagename = basename($_SERVER['PHP_SELF'])."?mappingid=".$mappingid."&vessel_id=".$vessel_id;
?>
<!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;Nominations at a glance</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>
				<form role="form" name="frm1" id="frm1" enctype="multipart/form-data" action="<?php echo $pagename;?>" method="post">			
				<div class="row">
                        <div class="col-xs-12">
                            <h2 class="page-header">
                             <?php echo $obj->getVesselIMOData($obj->getVesselOpenEntryDeta($obj->getMappingData($mappingid,"OPEN_VESSEL_ID"),"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="active"><a data-toggle="tab" href="#tab_1">NOM DETAILS</a></li>
                                    <li class=""><a data-toggle="tab" href="#tab_2">TC CP Terms</a></li>
									<li class=""><a data-toggle="tab" href="#tab_3">COMMERCIAL - PARAMETERS</a></li>
								</ul>
                                <div class="tab-content">
                                    <div id="tab_1" class="tab-pane active">
                                    <form role="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">
                                                Nomination ID
                                                <address>
                                                <strong>&nbsp;&nbsp;&nbsp;<?php echo $obj->getMappingData($mappingid,"NOMINATION_ID");?></strong>
                                                </address>
                                            </div><!-- /.col -->
                                        </div>
                                        
                                        <div class="row invoice-info">
                                            <div class="col-sm-4 invoice-col">
                                               Vessel
                                                <address>
                                                <strong>&nbsp;&nbsp;&nbsp;<?php echo $obj->getVesselIMOData($obj->getVesselOpenEntryDeta($obj->getMappingData($mappingid,"OPEN_VESSEL_ID"),"VESSEL_IMO_ID"),"VESSEL_NAME");?></strong>
                                                </address>
                                            </div><!-- /.col -->
                                            <div class="col-sm-4 invoice-col">
                                                 Fixture Type
                                                <address>
                                                    <select  name="selFixtureType" class="form-control" id="selFixtureType" >
													<?php
                                                    $_REQUEST['selFixtureType'] = $obj->getNomDetailsData($mappingid,"FIXTURETYPE_ID");
                                                    $obj->getFixtureTypeList();
                                                    ?>
                                                    </select>
                                                </address>
                                            </div><!-- /.col -->
                                            
                                        </div>
                                        
                                        <div class="row invoice-info">
                                            <div class="col-sm-4 invoice-col">
                                               Owner
                                                <address>
                                                <strong>&nbsp;&nbsp;&nbsp;<?php echo $obj->getVendorListNewBasedOnID($obj->getVesselOpenEntryDeta($obj->getMappingData($mappingid,"OPEN_VESSEL_ID"),"OWNER"));?></strong>
                                                </address>
                                            </div><!-- /.col -->
                                            <div class="col-sm-4 invoice-col">
                                                 Charterer
                                                <address>
                                                    <input type="text" name="txtCharterer" id="txtCharterer" class="form-control" autocomplete="off" placeholder="Charterer" value="<?php echo $obj->getNomDetailsData($mappingid,"CHARTERER");?>" />
                                                </address>
                                            </div><!-- /.col -->
                                             <div class="col-sm-4 invoice-col">
                                                 Freight Rate <span style="font-size:10px; font-style:italic; color:#999;">USD/MT</span>
                                                <address>
                                                    <input type="text" name="txtFRUsdMT" id="txtFRUsdMT" class="form-control" autocomplete="off" value="<?php echo $obj->getNomDetailsData($mappingid,"FREIGHT_RATE");?>" placeholder="Freight Rate" />
                                                </address>
                                            </div><!-- /.col -->
                                         </div>
                                        
                                        
                                        <div class="row invoice-info">
                                            <div class="col-sm-4 invoice-col">
                                               CP Ref
                                                <address>
                                               <input type="text" name="txtCPRef" id="txtCPRef" class="form-control" autocomplete="off" placeholder="CP Ref" value="<?php echo $obj->getNomDetailsData($mappingid,"CP_REF");?>" />
                                                </address>
                                            </div><!-- /.col -->
                                            <div class="col-sm-4 invoice-col">
                                                 CP Date
                                                <address>
                                                  <?php 
											      if(date("d-m-Y",strtotime($obj->getVesselOpenEntryDeta($obj->getMappingData($mappingid,"OPEN_VESSEL_ID"),"CP_DATE"))) == "01-01-1970")
													{
												echo '<input type="text" name="txtCPDate" id="txtCPDate" class="form-control" readonly  value="'.date("d-m-Y",time()).'" />';
													}
													else
													{
												echo '<input type="text" name="txtCPDate" id="txtCPDate" class="form-control" readonly  value="'.date("d-m-Y",strtotime($obj->getVesselOpenEntryDeta($obj->getMappingData($mappingid,"OPEN_VESSEL_ID"),"CP_DATE"))).'" />';
													}
													?>
                                                </address>
                                            </div><!-- /.col -->
                                             <div class="col-sm-4 invoice-col">
                                                Broker <span style="font-size:10px; font-style:italic; color:#999;">USD/MT</span>
                                                <address>
                                                    <strong>&nbsp;&nbsp;&nbsp;<?php echo $obj->getVendorListNewBasedOnID($obj->getVesselOpenEntryDeta($obj->getMappingData($mappingid,"OPEN_VESSEL_ID"),"BROKER"));?></strong><input type="hidden" name="txtBroker" id="txtBroker" value="<?php echo $obj->getVendorListNewBasedOnID($obj->getVesselOpenEntryDeta($obj->getMappingData($mappingid,"OPEN_VESSEL_ID"),"BROKER"));?>" />
                                                </address>
                                            </div><!-- /.col -->
                                         </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>&nbsp;&nbsp;&nbsp;<?php echo $obj->getContractLoadPortBasedOnID($obj->getMappingData($mappingid,"CARGO_IDS"),"LOADPORT");?></strong>
                                                </address>
                                            </div><!-- /.col -->
                                            <div class="col-sm-4 invoice-col">
                                                Cargo Name
                                                <address>
                                                    <strong>&nbsp;&nbsp;&nbsp;<?php echo $obj->getCargoContarctForMapping($obj->getMappingData($mappingid,"CARGO_IDS"),$obj->getMappingData($mappingid,"CARGO_POSITION"));?></strong>
                                                </address>
                                            </div><!-- /.col -->
                                             <div class="col-sm-4 invoice-col">
                                                 Cargo Qty MT
                                                <address>
                                                    <strong>&nbsp;&nbsp;&nbsp;<?php echo $obj->getCargoContarctQTYForMapping1($obj->getMappingData($mappingid,"CARGO_IDS"),$obj->getMappingData($mappingid,"CARGO_POSITION"));?></strong>
                                                </address>
                                            </div><!-- /.col -->
                                         </div>
                                         
                                         <div class="row invoice-info">
                                            <div class="col-sm-4 invoice-col">
                                              &nbsp;
                                            </div><!-- /.col -->
                                            <div class="col-sm-4 invoice-col">
                                                LayCan Starts
                                                <address>
                                                   <?php if(date("d-m-Y",strtotime($obj->getVesselOpenEntryDeta($obj->getMappingData($mappingid,"OPEN_VESSEL_ID"),"FROM_DATE"))) == "01-01-1970")
													{
														echo '<input type="text" name="txtDPLayCanStarts" id="txtDPLayCanStarts" class="form-control" value="" />';
													}
													else
													{
														echo '<input type="text" name="txtDPLayCanStarts" id="txtDPLayCanStarts" class="form-control" value="'.date("d-m-Y",strtotime($obj->getVesselOpenEntryDeta($obj->getMappingData($mappingid,"OPEN_VESSEL_ID"),"FROM_DATE"))).'" />';
													}
													?>	
                                                </address>
                                            </div><!-- /.col -->
                                             <div class="col-sm-4 invoice-col">
                                                 LayCan Finishes
                                                <address>
                                                  <?php if(date("d-m-Y",strtotime($obj->getVesselOpenEntryDeta($obj->getMappingData($mappingid,"OPEN_VESSEL_ID"),"TO_DATE"))) == "01-01-1970")
													{
														echo '<input type="text" name="txtDPLayCanFinishes" id="txtDPLayCanFinishes" class="form-control" value="" />';
													}
													else
													{
														echo '<input type="text" name="txtDPLayCanFinishes" id="txtDPLayCanFinishes" class="form-control" value="'.date("d-m-Y",strtotime($obj->getVesselOpenEntryDeta($obj->getMappingData($mappingid,"OPEN_VESSEL_ID"),"TO_DATE"))).'" />';
													}
													?>
                                                </address>
                                            </div><!-- /.col -->
                                         </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>&nbsp;&nbsp;&nbsp;<?php echo $obj->getContractLoadPortBasedOnID($obj->getMappingData($mappingid,"CARGO_IDS"),"DISPORT"); ?></strong>
                                                </address>
                                            </div><!-- /.col -->
                                            <div class="col-sm-4 invoice-col">
                                                Cargo Name
                                                <address>
                                                    <strong>&nbsp;&nbsp;&nbsp;<?php echo $obj->getCargoContarctForMapping($obj->getMappingData($mappingid,"CARGO_IDS"),$obj->getMappingData($mappingid,"CARGO_POSITION"));?></strong>
                                                </address>
                                            </div><!-- /.col -->
                                             <div class="col-sm-4 invoice-col">
                                                 Cargo Qty MT
                                                <address>
                                                    <strong>&nbsp;&nbsp;&nbsp;<?php echo $obj->getCargoContarctQTYForMapping1($obj->getMappingData($mappingid,"CARGO_IDS"),$obj->getMappingData($mappingid,"CARGO_POSITION"));?></strong>
                                                </address>
                                            </div><!-- /.col -->
                                         </div>
                                         
                                         <div class="row invoice-info">
                                            <div class="col-sm-4 invoice-col">
                                              Date of Delivery
                                              <address>
                                              <?php if(date("d-m-Y",strtotime($obj->getNomDetailsData($mappingid,"DATE_OF_DELIVERY"))) == "01-01-1970")
												{
													echo '<input type="text" name="txtDateofDelivery" id="txtDateofDelivery" placeholder="dd-mm-yyyy" class="form-control" value="" />';
												}
												else
												{
													echo '<input type="text" name="txtDateofDelivery" id="txtDateofDelivery" class="form-control" value="'.date("d-m-Y",strtotime($obj->getNomDetailsData($mappingid,"DATE_OF_DELIVERY"))).'" />';
												}
												?>
                                                </address>
                                            </div><!-- /.col -->
                                            <div class="col-sm-4 invoice-col">
                                                Place of Delivery
                                                <address>
                                                   <input type="text" name="txtPOD" id="txtPOD" class="form-control" placeholder="Place of Delivery" autocomplete="off" value="<?php echo $obj->getNomDetailsData($mappingid,"PLACE_OF_DELIVERY");?>" />
                                                </address>
                                            </div><!-- /.col -->
                                            <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($mappingid,"ALARM");?>" />
                                                </address>
                                            </div><!-- /.col -->
                                         </div>
                                         
                                         
                            <div class="box-footer" align="right">
							<button type="submit" class="btn btn-primary btn-flat" onclick="getSubmit1(1);">Submit</button>&nbsp;&nbsp;&nbsp;&nbsp;<button type="submit" class="btn btn-primary btn-flat" onclick="getSubmit1(2);">Submit & Close</button>
							<input type="hidden" name="action1" id="action1" value="submit" />
				              </div>
                                         
                                       
                                         
                                        </form>
                                        
                                    </div><!-- /.tab_1-pane -->
									
                                    <div id="tab_2" class="tab-pane">
                                    <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>
                                                  <strong>&nbsp;&nbsp;&nbsp; <?php echo $obj->getMappingData($mappingid,"NOMINATION_ID");?></strong>
                                                </address>
                                            </div><!-- /.col -->
                                         </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($mappingid,"CP_WIND_FORCE");?>" />
                                                </address>
                                            </div><!-- /.col -->
                                        
                                            <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($mappingid,"CP_SPEED_LADEN");?>" />
                                                </address>
                                            </div><!-- /.col -->
                                            <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($mappingid,"CP_SPEED_BALLAST");?>" />
                                                </address>
                                            </div><!-- /.col -->
                                            
                                        </div>
                                        
                                        <div class="row invoice-info">
                                            <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($mappingid,"CP_FO_CONSP_LADEN");?>" />
                                                </address>
                                            </div><!-- /.col -->
                                            <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($mappingid,"CP_DO_CONSP_LADEN");?>" />
                                                </address>
                                            </div><!-- /.col -->
                                             <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($mappingid,"CP_FO_CONSP_BALLAST");?>" />
                                                </address>
                                            </div><!-- /.col -->
                                         </div>
                                        
                                        
                                        <div class="row invoice-info">
                                            <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($mappingid,"CP_DO_CONSP_BALLAST");?>" />
                                                </address>
                                            </div><!-- /.col -->
                                            <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($mappingid,"CP_FO_TK_CLEANING");?>" />
                                                </address>
                                            </div><!-- /.col -->
                                             <div class="col-sm-4 invoice-col">
                                                FO Cons G Freeing ( MT/Day)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($mappingid,"CP_FO_GAS_FREEING");?>" />
                                                </address>
                                            </div><!-- /.col -->
                                         </div>
                                       
                                         <div class="row invoice-info">
                                            <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($mappingid,"CP_FO_INSERTING");?>" />
                                                </address>
                                            </div><!-- /.col -->
                                            <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($mappingid,"CP_FO_CARGO_HEATING");?>" />
                                                </address>
                                            </div><!-- /.col -->
                                             <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($mappingid,"CP_DO_TK_CLEANING");?>" />
                                                </address>
                                            </div><!-- /.col -->
                                         </div>
                                         
                                         <div class="row invoice-info">
                                           <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($mappingid,"CP_DO_GAS_FREEING");?>" />
                                                </address>
                                            </div><!-- /.col -->
                                             <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($mappingid,"CP_DO_INSERTING");?>" />
                                                </address>
                                            </div><!-- /.col -->
                                            <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($mappingid,"CP_DO_CARGO_HEATING");?>" />
                                                </address>
                                            </div><!-- /.col -->
                                         </div>
                                         
                                         <div class="row invoice-info">
                                           <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($mappingid,"CP_SPEED_ALLOWANCES");?>" />
                                                </address>
                                            </div><!-- /.col -->
                                             
                                         </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($mappingid,"CP_MAN_PRESSURE");?>" />
                                                </address>
                                            </div><!-- /.col -->
                                            <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($mappingid,"CP_LOAD_RATE");?>" />
                                                </address>
                                            </div><!-- /.col -->
                                             <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($mappingid,"CP_DISCH_RATE");?>" />
                                                </address>
                                            </div><!-- /.col -->
                                         </div>
                                         
                                         <div class="row invoice-info">
                                            <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($mappingid,"CP_FO_CONSP_LOADING");?>" />
                                                </address>
                                            </div><!-- /.col -->
                                            <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($mappingid,"CP_DO_CONSP_LOADING");?>" />
                                                </address>
                                            </div><!-- /.col -->
                                            <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($mappingid,"CP_FO_CONSP_DISCH");?>" />
                                                </address>
                                            </div><!-- /.col -->
                                         </div>
                                         
                                         <div class="row invoice-info">
                                            <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($mappingid,"CP_DO_CONSP_DISCH");?>" />
                                                </address>
                                            </div><!-- /.col -->
                                            <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($mappingid,"CP_FO_CONSP_IDLING");?>" />
                                                </address>
                                            </div><!-- /.col -->
                                            <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($mappingid,"CP_DO_CONSP_IDLING");?>" />
                                                </address>
                                            </div><!-- /.col -->
                                         </div>
                                         
                                         <div class="row invoice-info">
                                            <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($mappingid,"CP_LOAD_RATE_1");?>" />
                                                </address>
                                            </div><!-- /.col -->
                                            <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($mappingid,"CP_DISCH_RATE_1");?>" />
                                                </address>
                                            </div><!-- /.col -->
                                         </div>
                                    
                                     <div class="box-footer" align="right">
                                     
                                    <button type="submit" class="btn btn-primary btn-flat" onclick="getSubmit2(1);">Submit</button>&nbsp;&nbsp;&nbsp;&nbsp;<button type="submit" class="btn btn-primary btn-flat" onclick="getSubmit2(2);">Submit & Close</button>
							<input type="hidden" name="action2" id="action2" value="submit" />
				              </div>
                              </form>
                                    
                                    
                                    
                                    </div><!-- /.tab_2-pane -->
                                    
									
									<div id="tab_3" class="tab-pane">
                                    <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 MAPPINGID='".$mappingid."' and MODULEID='".$_SESSION['moduleid']."' and MCOMPANYID='".$_SESSION['company']."' and VESSEL_IMO_ID='".$vessel_id."'";
									
										$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>
                                                  <strong>&nbsp;&nbsp;&nbsp; <?php echo $obj->getMappingData($mappingid,"NOMINATION_ID");?></strong>
                                                </address>
                                            </div><!-- /.col -->
                                         </div>
                                        
                                        
                                        <div class="row">
											<div class="col-xs-12">
												<h2 class="page-header">
													COMMERCIAL - PARAMETERS
												</h2>                            
											</div><!-- /.col -->
										</div>
                                        
                                         <div class="row invoice-info">
                                            <div class="col-sm-4 invoice-col">
                                              Vessel Name
                                                <address>
                                               <input type="text" name="txtVName" id="txtVName" class="form-control" readonly value="<?php echo $name;?>" />
                                                </address>
                                            </div><!-- /.col -->
                                            <div class="col-sm-4 invoice-col">
                                                Vessel Type
                                                <address>
                                                    <input type="text" name="txtVType" id="txtVType" class="form-control" readonly value="<?php echo $type;?>" />
                                                </address>
                                            </div><!-- /.col -->
                                             
                                         </div>
                                         <div class="row invoice-info">
                                            <div class="col-sm-4 invoice-col">
                                              Date
                                                <address>
                                               <?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 }?>
                                                </address>
                                            </div><!-- /.col -->
                                            <div class="col-sm-4 invoice-col">
                                                DWT <span style="font-size:10px; font-style:italic;">(Summer)</span>
                                                <address>
                                                    <input type="text" name="txtDWTS" id="txtDWTS" class="form-control"  value="<?php echo $obj->getVesselIMOData($vessel_imo_id,"DWT");?>" readonly />
                                                </address>
                                            </div><!-- /.col -->
                                         </div>
                                         
                                         <div class="row invoice-info">
                                            <div class="col-sm-4 invoice-col">
                                             Draft <span style="font-size:10px; font-style:italic;">(Summer)</span>
                                                <address>
                                               <input type="text" name="txtDraft" id="txtDraft" class="form-control"  value="<?php echo $obj->getVesselIMOData($vessel_imo_id,"DRAFTM");?>" readonly />
                                                </address>
                                            </div><!-- /.col -->
                                            <div class="col-sm-4 invoice-col">
                                                TPC
                                                <address>
                                                    <input type="text" name="txtTPC" id="txtTPC" class="form-control"  value="<?php echo $obj->getVesselParticularData('SUMMER_3','vessel_master_1',$vessel_imo_id);?>" readonly />
                                                </address>
                                            </div><!-- /.col -->
                                         </div>
                                         
                                         <div class="row">
											<div class="col-xs-12">
												<h2 class="page-header">
													Speed Data
												</h2>                            
											</div><!-- /.col -->
										</div>
                                        
                                         <div class="box-body no-padding">
										   <table class="table table-striped">
                                            <thead>
                                            <tr>
                                            <td width="31%" align="left" ></td>
                                            <td width="23%" align="right" valign="top">Full Speed</td>
                                            <td width="23%" align="right" valign="top">Eco Speed 1</td>
                                            <td width="23%" align="right" valign="top">Eco Speed 2</td>
                                           
                                            </tr>
                                            </thead>
                                            <tbody>
                                            <tr>
                                            <td align="left">Ballast Speed <span style="font-size:10px; font-style:italic;">(Knots)</span></td>
                                            <td align="right" valign="top" ><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 align="right" valign="top"><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 align="right" valign="top"><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 align="left">Laden Speed <span style="font-size:10px; font-style:italic;">(Knots)</span></td>
                                            <td align="right" valign="top"><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 align="right" valign="top"><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 align="right" valign="top"><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 class="row">
											  <div class="col-xs-12">
												<h2 class="page-header">
													FO Consumption MT/Day
												</h2>                            
											  </div><!-- /.col -->
										   </div>
                                           <div class="row invoice-info">
                                            <div class="col-sm-4 invoice-col">
                                             FO Grade
                                                <address>
                                                 <input type="text" name="txtFOGrade" id="txtFOGrade" class="form-control" autocomplete="off" value="<?php echo $obj->getVesselParameterData($vessel_imo_id,"FO_GRADE",$user);?>" />
                                                </address>
                                            </div><!-- /.col -->
                                            
                                         </div>
                                           <div class="box-body no-padding">
										   <table class="table table-striped">
                                            <thead>
                                            <tr>
                                            <td width="31%" align="left" ></td>
                                            <td width="23%" align="right" valign="top">Full Speed</td>
                                            <td width="23%" align="right" valign="top">Eco Speed 1</td>
                                            <td width="23%" align="right" valign="top">Eco Speed 2</td>
                                           
                                            </tr>
                                            </thead>
                                            <tbody>
                                            <tr>
                                            <td align="left">Ballast Passage</td>
                                            <td align="right" valign="top" ><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 align="right" valign="top"><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 align="right" valign="top"><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 align="left">Laden Passage</td>
                                            <td align="right" valign="top"><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 align="right" valign="top"><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 align="right" valign="top"><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>
                                            </tbody>
                                            </table>
                                            </div>
                                            
                                           <div class="row invoice-info">
                                            <div class="col-sm-4 invoice-col">
                                             In Port - Idle
                                                <address>
                                               <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);?>" />
                                                </address>
                                            </div><!-- /.col -->
                                            <div class="col-sm-4 invoice-col">
                                                In Port - Working
                                                <address>
                                                    <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);?>" />
                                                </address>
                                            </div><!-- /.col -->
                                            <div class="col-sm-4 invoice-col">
                                                Others
                                                <address>
                                                    <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);?>" />
                                                </address>
                                            </div><!-- /.col -->
                                         </div>
                                         
                                         
                                         
                                         
                                         <div class="row">
											  <div class="col-xs-12">
												<h2 class="page-header">
													DO Consumption per MT/Day
												</h2>                            
											  </div><!-- /.col -->
										   </div>
                                           <div class="row invoice-info">
                                            <div class="col-sm-4 invoice-col">
                                             DO Grade
                                                <address>
                                                 <input type="text" name="txtDOGrade" id="txtDOGrade" class="form-control" autocomplete="off" value="<?php echo $obj->getVesselParameterData($vessel_imo_id,"DO_GRADE",$user);?>" />
                                                </address>
                                            </div><!-- /.col -->
                                            
                                         </div>
                                           <div class="box-body no-padding">
										   <table class="table table-striped">
                                            <thead>
                                            <tr>
                                            <td width="31%" align="left" ></td>
                                            <td width="23%" align="right" valign="top">Full Speed</td>
                                            <td width="23%" align="right" valign="top">Eco Speed 1</td>
                                            <td width="23%" align="right" valign="top">Eco Speed 2</td>
                                           
                                            </tr>
                                            </thead>
                                            <tbody>
                                            <tr>
                                            <td align="left">Ballast Passage</td>
                                            <td align="right" valign="top"><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 align="right" valign="top"><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 align="right" valign="top"><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 align="left">Laden Passage</td>
                                            <td align="right" valign="top"><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 align="right" valign="top"><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 align="right" valign="top"><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>
                                            </tbody>
                                            </table>
                                            </div>
                                            
                                           <div class="row invoice-info">
                                            <div class="col-sm-4 invoice-col">
                                             In Port - Idle
                                                <address>
                                               <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);?>" />
                                                </address>
                                            </div><!-- /.col -->
                                            <div class="col-sm-4 invoice-col">
                                                In Port - Working
                                                <address>
                                                    <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);?>" />
                                                </address>
                                            </div><!-- /.col -->
                                            <div class="col-sm-4 invoice-col">
                                                Others
                                                <address>
                                                    <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);?>" />
                                                </address>
                                            </div><!-- /.col -->
                                         </div>
                                         <div class="row">
											  <div class="col-xs-12">
												<h2 class="page-header">
													Source / Other Details
												</h2>                            
											  </div><!-- /.col -->
										   </div>
                                           <div class="row invoice-info">
                                            <div class="col-sm-4 invoice-col">
                                             Remarks
                                                <address>
                                               <textarea class="form-control areasize" name="txtRemarks" id="txtRemarks" cols="90%" rows="5"><?php echo $obj->getVesselParameterData($vessel_imo_id,"REMARKS",$user);?></textarea>
                                                </address>
                                            </div><!-- /.col -->
                                           
                                         </div>
                                         
                                         <?php }else{
										$myrows = mysql_fetch_assoc($myres);
										?>
                                         <div class="row invoice-info">
                                           <div class="col-sm-4 invoice-col">
                                               Nomination ID
                                                <address>
                                                  <strong>&nbsp;&nbsp;&nbsp; <?php echo $obj->getMappingData($mappingid,"NOMINATION_ID");?></strong>
                                                </address>
                                            </div><!-- /.col -->
                                         </div>
                                        
                                        
                                        <div class="row">
											<div class="col-xs-12">
												<h2 class="page-header">
													COMMERCIAL - PARAMETERS
												</h2>                            
											</div><!-- /.col -->
										</div>
                                        <div class="row">
											<div class="col-xs-12">
												<h2 class="page-header">
													Main Data
												</h2>                            
											</div><!-- /.col -->
										</div>
                                        <div class="row invoice-info">
                                            <div class="col-sm-4 invoice-col">
                                             Vessel Name
                                                <address>
                                                 <input type="text" name="txtVName" id="txtVName" class="form-control" readonly value="<?php echo $obj->getVesselIMOData($myrows['VESSEL_IMO_ID'],"VESSEL_NAME");?>" />
                                                </address>
                                            </div><!-- /.col -->
                                            <div class="col-sm-4 invoice-col">
                                                Vessel Type
                                                <address>
                                                    <input type="text" name="txtVType" id="txtVType" class="form-control" readonly value="<?php echo $obj->getVesselTypeBasedOnID($obj->getVesselIMOData($myrows['VESSEL_IMO_ID'],"VESSEL_TYPE"));?>" />
                                                </address>
                                            </div><!-- /.col -->
                                         </div>
                                         <div class="row invoice-info">
                                            <div class="col-sm-4 invoice-col">
                                             Date
                                                <address>
                                                <?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 }?>
                                                </address>
                                            </div><!-- /.col -->
                                            <div class="col-sm-4 invoice-col">
                                               DWT <span style="font-size:10px; font-style:italic;">(Summer)</span>
                                                <address>
                                                    <input type="text" name="txtDWTS" id="txtDWTS" class="form-control"  value="<?php echo $obj->getVesselIMOData($vessel_imo_id,"DWT");?>" readonly />
                                                </address>
                                            </div><!-- /.col -->
                                         </div>
                                         
                                         <div class="row invoice-info">
                                            <div class="col-sm-4 invoice-col">
                                             Draft <span style="font-size:10px; font-style:italic;">(Summer)</span>
                                                <address>
                                                <input type="text" name="txtDraft" id="txtDraft" class="form-control"  value="<?php echo $obj->getVesselIMOData($vessel_imo_id,"DRAFTM");?>" readonly />
                                                </address>
                                            </div><!-- /.col -->
                                            <div class="col-sm-4 invoice-col">
                                               TPC
                                                <address>
                                                    <input type="text" name="txtTPC" id="txtTPC" class="form-control"  value="<?php echo $obj->getVesselParticularData('SUMMER_3','vessel_master_1',$vessel_imo_id);?>" readonly />
                                                </address>
                                            </div><!-- /.col -->
                                         </div>
                                         <div class="box-body no-padding">
                                         <table width="100%" cellpadding="1" cellspacing="4" border="0">
                                            <thead>
                                            <tr>
                                            <td width="31%" align="left" ></td>
                                            <td width="23%" align="right" valign="top">Full Speed</td>
                                            <td width="23%" align="right" valign="top">Eco Speed 1</td>
                                            <td width="23%" align="right" valign="top">Eco Speed 2</td>
                                            </tr>
                                            </thead>
                                            <tbody>
                                            <tr>
                                            <td align="left" >Ballast Speed <span style="font-size:10px; font-style:italic;">(Knots)</span></td>
                                            <td align="right" valign="top"><input type="text" name="txtBFullSpeed" id="txtBFullSpeed" class="form-control" autocomplete="off" value="<?php echo $myrows['B_FULL_SPEED'];?>" /></td>
                                            <td align="right" valign="top" ><input type="text" name="txtBEcoSpeed1" id="txtBEcoSpeed1" class="form-control" autocomplete="off" value="<?php echo $myrows['B_ECO_SPEED1'];?>" /></td>
                                            <td align="right" valign="top"><input type="text" name="txtBEcoSpeed2" id="txtBEcoSpeed2" class="form-control" autocomplete="off" value="<?php echo $myrows['B_ECO_SPEED2'];?>" /></td>
                                            </tr>
                                            <tr>
                                            <td align="left" class="text" >Laden Speed <span style="font-size:10px; font-style:italic;">(Knots)</span></td>
                                            <td align="right" valign="top"><input type="text" name="txtLFullSpeed" id="txtLFullSpeed" class="form-control" autocomplete="off" value="<?php echo $myrows['L_FULL_SPEED'];?>" /></td>
                                            <td align="right" valign="top" ><input type="text" name="txtLEcoSpeed1" id="txtLEcoSpeed1" class="form-control" autocomplete="off" value="<?php echo $myrows['L_ECO_SPEED1'];?>" /></td>
                                            <td align="right" valign="top"><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 class="row">
											<div class="col-xs-12">
												<h2 class="page-header">
													FO Consumption MT/Day
												</h2>                            
											</div><!-- /.col -->
										</div>
                                        <div class="row invoice-info">
                                            <div class="col-sm-4 invoice-col">
                                             FO Grade
                                                <address>
                                                 <input type="text" name="txtFOGrade" id="txtFOGrade" class="form-control" autocomplete="off" value="<?php echo $myrows['FO_GRADE'];?>" />
                                                </address>
                                            </div><!-- /.col -->
                                         </div> 
                                         <div class="box-body no-padding">
                                         <table width="100%" cellpadding="1" cellspacing="4" border="0">
                                            <thead>
                                            <tr>
                                            <td width="31%" align="left" ></td>
                                            <td width="23%" align="right" valign="top">Full Speed</td>
                                            <td width="23%" align="right" valign="top">Eco Speed 1</td>
                                            <td width="23%" align="right" valign="top">Eco Speed 2</td>
                                            </tr>
                                            </thead>
                                            <tbody>
                                            <tr>
                                            <td align="left" >Ballast Passage</td>
                                            <td align="right" valign="top"><input type="text" name="txtFOBPassageFS" id="txtFOBPassageFS" class="form-control" autocomplete="off" value="<?php echo $myrows['BP_FO_FULL_SPEED'];?>" /></td>
                                            <td align="right" valign="top" ><input type="text" name="txtFOBPassageES1" id="txtFOBPassageES1" class="form-control" autocomplete="off" value="<?php echo $myrows['BP_FO_ECO_SPEED1'];?>" /></td>
                                            <td align="right" valign="top"><input type="text" name="txtFOBPassageES2" id="txtFOBPassageES2" class="form-control" autocomplete="off" value="<?php echo $myrows['BP_FO_ECO_SPEED2'];?>" /></td>
                                            </tr>
                                            <tr>
                                            <td align="left" class="text" >Laden Passage</td>
                                            <td align="right" valign="top"><input type="text" name="txtFOLPassageFS" id="txtFOLPassageFS" class="form-control" autocomplete="off" value="<?php echo $myrows['LP_FO_FULL_SPEED'];?>" /></td>
                                            <td align="right" valign="top" ><input type="text" name="txtFOLPassageES1" id="txtFOLPassageES1" class="form-control" autocomplete="off" value="<?php echo $myrows['LP_FO_ECO_SPEED1'];?>" /></td>
                                            <td align="right" valign="top"><input type="text" name="txtFOLPassageES2" id="txtFOLPassageES2" class="form-control" autocomplete="off" value="<?php echo $myrows['LP_FO_ECO_SPEED2'];?>" /></td>
                                            </tr>
                                            </tbody>
                                            </table>
                                            </div>
                                         <div class="row invoice-info">
                                            <div class="col-sm-4 invoice-col">
                                             In Port - Idle
                                                <address>
                                               <input type="text" name="txtFOIPIdleFS" id="txtFOIPIdleFS" class="form-control" autocomplete="off" value="<?php echo $myrows['PI_FO_FULL_SPEED'];?>" />
                                                </address>
                                            </div><!-- /.col -->
                                            <div class="col-sm-4 invoice-col">
                                                In Port - Working
                                                <address>
                                                    <input type="text" name="txtFOIPWorkingFS" id="txtFOIPWorkingFS" class="form-control" autocomplete="off" value="<?php echo $myrows['PW_FO_FULL_SPEED'];?>" />
                                                </address>
                                            </div><!-- /.col -->
                                            <div class="col-sm-4 invoice-col">
                                                Others
                                                <address>
                                                    <input type="text" name="txtFOOthersFS" id="txtFOOthersFS" class="form-control" autocomplete="off" value="<?php echo $myrows['OTH_FO_FULL_SPEED'];?>" />
                                                </address>
                                            </div><!-- /.col -->
                                         </div>
                                         
                                         
                                         <div class="row">
											<div class="col-xs-12">
												<h2 class="page-header">
													DO Consumption per MT/Day
												</h2>                            
											</div><!-- /.col -->
										</div>
                                        <div class="row invoice-info">
                                            <div class="col-sm-4 invoice-col">
                                             DO Grade
                                                <address>
                                                 <input type="text" name="txtDOGrade" id="txtDOGrade" class="form-control" autocomplete="off" value="<?php echo $myrows['DO_GRADE'];?>" />
                                                </address>
                                            </div><!-- /.col -->
                                         </div> 
                                         <div class="box-body no-padding">
                                         <table width="100%" cellpadding="1" cellspacing="4" border="0">
                                            <thead>
                                            <tr>
                                            <td width="31%" align="left" ></td>
                                            <td width="23%" align="right" valign="top">Full Speed</td>
                                            <td width="23%" align="right" valign="top">Eco Speed 1</td>
                                            <td width="23%" align="right" valign="top">Eco Speed 2</td>
                                            </tr>
                                            </thead>
                                            <tbody>
                                            <tr>
                                            <td align="left" >Ballast Passage</td>
                                            <td align="right" valign="top"><input type="text" name="txtDOBPassageFS" id="txtDOBPassageFS" class="form-control" autocomplete="off" value="<?php echo $myrows['BP_DO_FULL_SPEED'];?>" /></td>
                                            <td align="right" valign="top" ><input type="text" name="txtDOBPassageES1" id="txtDOBPassageES1" class="form-control" autocomplete="off" value="<?php echo $myrows['BP_DO_ECO_SPEED1'];?>" /></td>
                                            <td align="right" valign="top"><input type="text" name="txtDOBPassageES2" id="txtDOBPassageES2" class="form-control" autocomplete="off" value="<?php echo $myrows['BP_DO_ECO_SPEED2'];?>" /></td>
                                            </tr>
                                            <tr>
                                            <td align="left" class="text" >Laden Passage</td>
                                            <td align="right" valign="top"><input type="text" name="txtDOLPassageFS" id="txtDOLPassageFS" class="form-control" autocomplete="off" value="<?php echo $myrows['LP_DO_FULL_SPEED'];?>" /></td>
                                            <td align="right" valign="top" ><input type="text" name="txtDOLPassageES1" id="txtDOLPassageES1" class="form-control" autocomplete="off" value="<?php echo $myrows['LP_DO_ECO_SPEED1'];?>" /></td>
                                            <td align="right" valign="top"><input type="text" name="txtDOLPassageES2" id="txtDOLPassageES2" class="form-control" autocomplete="off" value="<?php echo $myrows['LP_DO_ECO_SPEED2'];?>" /></td>
                                            </tr>
                                            </tbody>
                                            </table>
                                            </div>
                                         <div class="row invoice-info">
                                            <div class="col-sm-4 invoice-col">
                                             In Port - Idle
                                                <address>
                                                <input type="text" name="txtDOIPIdleFS" id="txtDOIPIdleFS" class="form-control" autocomplete="off" value="<?php echo $myrows['PI_DO_FULL_SPEED'];?>" />
                                                </address>
                                            </div><!-- /.col -->
                                            <div class="col-sm-4 invoice-col">
                                                In Port - Working
                                                <address>
                                                    <input type="text" name="txtDOIPWorkingFS" id="txtDOIPWorkingFS" class="form-control" autocomplete="off" value="<?php echo $myrows['PW_DO_FULL_SPEED'];?>" />
                                                </address>
                                            </div><!-- /.col -->
                                            <div class="col-sm-4 invoice-col">
                                                Others
                                                <address>
                                                    <input type="text" name="txtDOOthersFS" id="txtDOOthersFS" class="form-control" autocomplete="off" value="<?php echo $myrows['OTH_DO_FULL_SPEED'];?>" />
                                                </address>
                                            </div><!-- /.col -->
                                         </div>
                                         
                                         <div class="row invoice-info">
                                            <div class="col-sm-4 invoice-col">
                                             Remarks
                                                <address>
                                                <textarea class="form-control areasize" name="txtRemarks" id="txtRemarks" cols="90%" rows="5"><?php echo $myrows["REMARKS"];?></textarea>
                                                </address>
                                            </div><!-- /.col -->
                                          </div>
                                        
                                        
                                        <?php if($myrows['SUBMITID'] != 2){?>
                                       <div class="box-footer" align="right"> 
                                        <button type="submit" class="btn btn-primary btn-flat" onclick="return getSubmit3(1);">Submit</button>&nbsp;&nbsp;&nbsp;&nbsp;<button type="submit" 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>	
               
              
				
				
					
				</form>
				
				<!--   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/plugins/datepicker/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(){ 
$("#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"});
$("#txtDateofDelivery").datepicker({
    format: 'dd-mm-yyyy'
});

$("#txtDate").datepicker({
    format: 'dd-mm-yyyy',
	maxDate:'+OD'
});

$(".areasize").autosize({append: "\n"});

});

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

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

function getSubmit3(var1)
{
	jConfirm('Are you sure you have checked each entry ?', 'Confirmation', 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>