<?php include 'connection.php';
session_start();
if (!isset($_SESSION['is_logged_in'])) {
    header("Location:login.php");
    die();
    }
date_default_timezone_set('Asia/Calcutta');
$today = date("Y-m-d");
$today2 = date("Y-m-d");
$currentmonth = date(m);

?>
<?php 
$querylogin = "select * from contact_person where email = '". $_SESSION["LOGIN_NAME"]."' AND password = '".$_SESSION["EMPLOYEE_PASSWORD"]."'";
//echo $querylogin;
$resultlogin = mysql_query($querylogin,$conn);
while($row=mysql_fetch_array($resultlogin))
{
$customer_id = $row['customer_id'];
$name = $row['name'];
}
?>	

<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <title>Threestar Solutions and Services Pvt. Ltd.</title>
  <!-- Tell the browser to be responsive to screen width -->
  <meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">
  <!-- Bootstrap 3.3.6 -->
  <link rel="stylesheet" href="../bootstrap/css/bootstrap.min.css">
  <!-- Font Awesome -->
  <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.5.0/css/font-awesome.min.css">
  <!-- Ionicons -->
  <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/ionicons/2.0.1/css/ionicons.min.css">
  <!-- Theme style -->
  <link rel="stylesheet" href="../dist/css/AdminLTE.min.css">
  <!-- AdminLTE Skins. Choose a skin from the css/skins
       folder instead of downloading all of them to reduce the load. -->
  <link rel="stylesheet" href="../dist/css/skins/_all-skins.min.css">
  <!-- iCheck -->
  <link rel="stylesheet" href="../plugins/iCheck/flat/blue.css">
  <!-- Morris chart -->
  <link rel="stylesheet" href="../plugins/morris/morris.css">
  <!-- jvectormap -->
  <link rel="stylesheet" href="../plugins/jvectormap/jquery-jvectormap-1.2.2.css">
  <!-- Date Picker -->
  <link rel="stylesheet" href="../plugins/datepicker/datepicker3.css">
  <!-- Daterange picker -->
  <link rel="stylesheet" href="../plugins/daterangepicker/daterangepicker.css">
  <!-- bootstrap wysihtml5 - text editor -->
  <link rel="stylesheet" href="../plugins/bootstrap-wysihtml5/bootstrap3-wysihtml5.min.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="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script>
  <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
  <![endif]-->
</head>
<body class="hold-transition skin-blue sidebar-mini">
<div class="wrapper">

  <?php include 'header.php';?>
  <!-- Left side column. contains the logo and sidebar -->
  

  <!-- Content Wrapper. Contains page content -->
  <div class="content-wrapper">
    <!-- Content Header (Page header) -->
    <section class="content-header">
      <h1>
        Welcome
        <small style="color:#FF0000"><?php echo $name?></small>
      </h1>
      <ol class="breadcrumb">
        <li><a href="#"><i class="fa fa-dashboard"></i> Home</a></li>
        <li class="active">Dashboard</li>
      </ol>
    </section>

    <!-- Main content -->
    <section class="content">
      <!-- Small boxes (Stat box) -->
      
      <!-- /.row -->
      <!-- Main row -->
      <div class="row">
      <div class="col-md-12">
          <!-- MAP & BOX PANE -->
          <div class="box box-success">
            <div class="box-header with-border">
              <h3 class="box-title">Job Status</h3>&nbsp;&nbsp;&nbsp;&nbsp;
<span style="color:#FF0000"><?php echo $_REQUEST['massage'];?></span>
              <div class="box-tools pull-right">
                <button type="button" class="btn btn-box-tool" data-widget="collapse"><i class="fa fa-minus"></i>
                </button>
                <button type="button" class="btn btn-box-tool" data-widget="remove"><i class="fa fa-times"></i></button>
              </div>
            </div>
            <!-- /.box-header -->
            <div class="box-body no-padding">
              <div class="row">
                <div class="col-md-12 col-sm-12">
                  <div style="padding-left:2px; padding-top:2px; padding-right:2px;">
				  
				 <div class="box-body">
              <div class="table-responsive">
		  <table class="table no-margin">
                  <thead>
                  <tr>
                   
                    <th>Job Date</th>
                    <th>Job No.</th>
                    <th>Customer Name</th>
					<th>Process stage</th>
					<th>Comments</th>
				   

                  </tr>
                  </thead>
                  <tbody>
<?php
$querylg = "select * from  export_job_followup where export_process !='Shipment Done' and customer_id = '$customer_id'";
//echo $querylg;
$resultlg = mysql_query($querylg,$conn);
while($row=mysql_fetch_array($resultlg))
{
$export_process = $row['export_process'];
$final_job_no = $row['final_job_no'];
$final_job_date = $row['final_job_date'];
$details= $row['details'];
?>
	
				      <tr>
                  <td><?php echo $final_job_date?></td>
                    <td><?php echo $final_job_no?></td>
                    <td> <?php 
$sql = "select * from customer_master where customer_id = '$customer_id' and comptype='3rd Party agents'"; 
//echo $sql;
$resulsql = mysql_query($sql,$conn);
$num_rowacc = mysql_num_rows($resulsql);
if($num_rowacc=='1') {
$sql01 = "select * from third_customer_master where customer_id = '$customer_id'"; 
$resulsql01 = mysql_query($sql01,$conn);
while($row = mysql_fetch_array($resulsql01))
{
$customer_name = $row['party_name'];

	}				
}else {
$sql02 = "select * from customer_master where customer_id = '$customer_id'"; 
$resulsql02 = mysql_query($sql02,$conn);

while($row = mysql_fetch_array($resulsql02))
{
$customer_name = $row['customer_name'];

	}				
					
}					echo $customer_name?></td>
                    <td><?php echo $export_process?></td>
					<td><?php echo $details?></td>
					
					
					</tr>
				<?php } ?>
				
				
				
				
				<?php
$queryli = "select * from  import_job_followup where import_process !='Delivery Done' and customer_id = '$customer_id'";
//echo $querylg;
$resultli = mysql_query($queryli,$conn);
$num_rowacc = mysql_num_rows($resultli);
while($row=mysql_fetch_array($resultli))
{
$import_process = $row['import_process'];
$final_job_no = $row['final_job_no'];
$final_job_date = $row['final_job_date'];
$details= $row['details'];
?>
	
				      <tr>
                  <td><?php echo $final_job_date?></td>
                    <td><?php echo $final_job_no?></td>
                    <td> <?php 
$sql = "select * from customer_master where customer_id = '$customer_id' and comptype='3rd Party agents'"; 
//echo $sql;
$resulsql = mysql_query($sql,$conn);
$num_rowacc = mysql_num_rows($resulsql);
if($num_rowacc=='1') {
$sql01 = "select * from third_customer_master where customer_id = '$customer_id'"; 
$resulsql01 = mysql_query($sql01,$conn);
while($row = mysql_fetch_array($resulsql01))
{
$customer_name = $row['party_name'];

	}				
}else {
$sql02 = "select * from customer_master where customer_id = '$customer_id'"; 
$resulsql02 = mysql_query($sql02,$conn);

while($row = mysql_fetch_array($resulsql02))
{
$customer_name = $row['customer_name'];

	}				
					
}					echo $customer_name?></td>
                    <td><?php echo $import_process?></td>
					<td><?php echo $details?></td>
					
					
					</tr>
				<?php } ?>
				
				
				
				</tbody></table>
                </div>
              </div>
				  
				  </div></div>
	  </div></div></div></div>
      </div>
      <!-- /.row (main row) -->

    </section>
    <!-- /.content -->
  </div>
  <!-- /.content-wrapper -->
      <? include'footer.php'; ?>
</body>
</html>
