<?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");
$current_month=date("m");
$today_slash = date("d/m/Y");
$query2job = "select * from check_month";
$resultjob = mysql_query($query2job,$conn);
while($rowmonth=mysql_fetch_array($resultjob))
{
$check_month = $rowmonth['check_month'];
}

?>

<? 										   
													   							  
$month1=date("m");
if($month1>$check_month)
  {
  $currentyear = date("Y");
 $curr_full_year=date("Y");
$curr_short_year=date("y");
$future=$curr_short_year+1;
} else {
$currentyear1 = date("Y");
$currentyear = $currentyear1-1;
$curr_full_year1=date("Y");
 $curr_full_year=$curr_full_year1-1;
 $curr_short_year1=date("y");

$curr_short_year=$curr_short_year1-1;
$future=$curr_short_year+1;
}
?>


<?   $curr_fy=$currentyear .'-'. $future;?>
<?php 

$query = "select * from users where username = '". $_SESSION["LOGIN_NAME"]."' AND password = '".$_SESSION["EMPLOYEE_PASSWORD"]."'";
//echo $query;
		                 $result = mysql_query($query,$conn);
						 while($row=mysql_fetch_array($result))
	                                              	{
													  $staff_name = $row['full_name'];
													  $full_name = $row['full_name'];
													   $full_name11 = $row['full_name'];
													  $avatar = $row['avatar'];
													  $department_name = $row['department_name'];
													  $staff_id  = $row['id'];
													  $username = $row['username'];
													  $our_company = $row['our_company'];
													  $designation = $row['designation'];
													  $sales_group = $row['sales_group'];
													  $head = $row['head'];
													  $region = $row['region'];
													  $district = $row['district'];
													  $email = $row['email'];
													  $mobile_no = $row['mobile_no'];
													  $staff_id_self  = $row['id'];
													  //echo $Branch;
													  }	
													   ?>			

<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <title>shigmoda.com</title>
  <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">
  <!-- daterange picker -->
  <link rel="stylesheet" href="plugins/daterangepicker/daterangepicker.css">
  <!-- bootstrap datepicker -->
  <link rel="stylesheet" href="plugins/datepicker/datepicker3.css">
  <!-- iCheck for checkboxes and radio inputs -->
  <link rel="stylesheet" href="plugins/iCheck/all.css">
  <!-- Bootstrap Color Picker -->
  <link rel="stylesheet" href="plugins/colorpicker/bootstrap-colorpicker.min.css">
  <!-- Bootstrap time Picker -->
  <link rel="stylesheet" href="plugins/timepicker/bootstrap-timepicker.min.css">
  <!-- Select2 -->
  <link rel="stylesheet" href="plugins/select2/select2.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">
 <link rel="stylesheet" href="public/css/default.css" type="text/css">
 <script src="jquery.min.js"></script>
<script src="jquery-ui.js"></script>

<link rel="stylesheet" href="jquery-ui.css">
<style>table {
  border: 1px solid #ccc;
  border-collapse: collapse;
  margin: 0;
  padding: 0;
  width: 100%;
  table-layout: fixed;
}
table caption {
  font-size: 1.2em;
  margin: .5em 0 .75em;
}
table tr {
  
  border: 1px solid #ddd;
  padding: .35em;
}
table th,
table td {
  padding: .625em;
  
}
table th {
  font-size: .85em;
  letter-spacing: .0em;
  text-transform: uppercase;
}
@media screen and (max-width: 600px) {
  table {
    border: 0;
  }
  table caption {
    font-size: 1.3em;
  }
  table thead {
    border: none;
    clip: rect(0 0 0 0);
    height: 1px;
    margin: -1px;
    overflow: hidden;
    padding: 0;
    position: absolute;
    width: 1px;
  }
  table tr {
    border-bottom: 3px solid #ddd;
    display: block;
    margin-bottom: .625em;
  }
  table td {
    border-bottom: 1px solid #ddd;
    display: block;
    font-size: .6em;
    text-align: right;
  }
  table td:before {
    /*
    * aria-label has no advantage, it won't be read inside a table
    content: attr(aria-label);
    */
    content: attr(data-label);
    float: left;
    font-weight: bold;
    text-transform: uppercase;
  }
  table td:last-child {
    border-bottom: 0;
  }
}

</style>												   


</head>
<body class="hold-transition skin-blue sidebar-mini"  onLoad="calendarSetup()">
<div class="wrapper">

<?php  include 'header.php'; ?>

 <?php


$uploadedStatus = 0;

if ( isset($_POST["submit"]) ) {
if ( isset($_FILES["file"])) {
//if there was an error uploading the file
if ($_FILES["file"]["error"] > 0) {
echo "Return Code: " . $_FILES["file"]["error"] . "<br />";
}
else {
if (file_exists($_FILES["file"]["name"])) {
unlink($_FILES["file"]["name"]);
}
$storagename = "discussdesk.xlsx";
move_uploaded_file($_FILES["file"]["tmp_name"],  $storagename);
$uploadedStatus = 1;
}
} else {
echo "No file selected <br />";
}
}

?>
<!-- Content Wrapper. Contains page content -->
  <div class="content-wrapper">
    <!-- Content Header (Page header) -->
    <section class="content-header">
      <h1>
        Welcome
        <small><?php echo $department_name?> Team</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 -->
		<?php if($department_name=='Import'){?>

	
	<section class="content">

      <div class="row">
	  <div class="col-md-6">
         

          
          <!-- /.box -->

          <!-- PRODUCT LIST -->
          <div class="box box-success">
            <div class="box-header with-border">
			
               <h3 class="box-title" style="color:#000; font-family:Calibri; font-weight:bold;">Upload Job Register Import</h3>

              <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">
               
				  
		<form method="POST" action="excel-upload/excelUpload_import.php" enctype="multipart/form-data">
		
		<div class="form-group">
			<label>For CHA</label>
			</div>
			<div class="form-group">
			<select class="form-control" name="our_company_name" required>
												<option value="" selected="selected"> Select </option>
												<option value="Aashirvadh">Aashirvadh Global Logistic Pvt. Ltd.</option>
												
												<option value="Threestar">Threestar Solutions & Services Pvt. Ltd.</option>
												<option value="Vector">Vector Freight Forwarders</option>
												<option value="None">None</option>
												</select></div>
		<div class="form-group">
			<label>Upload Excel File</label>
			<input type="file" name="file" class="form-control">
		</div>
		<div class="form-group">
			<button type="submit" name="Submit" class="btn btn-success">Upload</button>
		</div>
	</form>
		   
          
				  
	
              </div>
              <!-- /.table-responsive -->
            </div>
				  
				  </div></div>
	  </div></div></div>
          <!-- /.box -->
        </div>
	
        <div class="col-md-6">
          <div class="box box-danger">
            <div class="box-header with-border">
               <h3 class="box-title" style="color:#000; font-family:Calibri; font-weight:bold;">Select Job Import</h3>
            </div>
            <!-- /.box-header -->
            <div class="box-body">
              <div class="row">
			  
			  		<form action="import/job_import_form_01.php" method="post" enctype="multipart/form-data">

                <div class="col-md-12">
                  

                  <div class="widget-body">
				<?php $query2 = "select * from job_register_import where Job_No!='' and Job_No!='Job No.'  and status='' ORDER BY job_imp_reg_id ASC";
				//echo $query2;
		                 $result2 = mysql_query($query2,$conn);		?>
                      <select name="job_imp_reg_id" class="form-control"  id="myselect" style="color:#000000"> 
                        <option value=""  style="color:#000000">Select JOB</option>
                        <?php
													while($row=mysql_fetch_array($result2))
	                                              	{
													$Job_No = $row['Job_No'];
													$job_imp_reg_id = $row['job_imp_reg_id'];
													$main_job_no = $row['main_job_no'];
													$CHA_name = $row['CHA_name'];
													  ?>
                        <option value="<?php echo $job_imp_reg_id ?>"  style="color:#000000"><?php echo $main_job_no;?> - (<?php echo $CHA_name;?> ) - <?php echo $Job_No?></option>
                        <?php
														
														 } ?>
                      </select>
					  <br>
					  
					  		  <input type="submit" name="submit" class="button btn btn-large btn-primary btn-madmin"/>

                            <div id="calendar" class="has-toolbar"></div>
                        </div>
                  <!-- /.chart-responsive -->
                </div></form>
                <!-- /.col -->
                
                <!-- /.col -->
              </div>
              <!-- /.row -->
            </div>
            <!-- ./box-body -->
            
            <!-- /.box-footer -->
          </div>
          <!-- /.box -->
        </div>
		
		<div class="col-md-12">
          <div class="box box-danger">
            <div class="box-header with-border">
               <h3 class="box-title" style="color:#000; font-family:Calibri; font-weight:bold;">Import Today Reminder </h3>
            </div>
            <!-- /.box-header -->
            <div class="box-body">
              <div class="row">
			  
			  	
                <div class="col-md-12">
                  

                  <div class="widget-body"><table width="100%"  class="table table-bordered" style="border-collapse:collapse">
	          			<thead>
                <tr> <th scope="col" width="150">Job No</th>
                  <th  scope="col">Importer Name </th>
                  <th  scope="col">Import Process </th>
                 <th colspan="3" scope="col">Details  </th>
				 <th scope="col">Process Completed </th>
				 <th scope="col">Reminder Details </th>

</tr></thead>
				<?php $query2 = "select * from import_job_main_01 where next_reminder='$today_slash'   ";
				//echo $query2;
		                 $result2 = mysql_query($query2,$conn);		
                    while($row = mysql_fetch_array($result2))
{
$our_company_name = $row['our_company_name'];
$cha_name = $row['cha_name'];
$customer_id = $row['customer_id'];
$importer_name = $row['importer_name'];
$job_imp_reg_id=$row['job_imp_reg_id'];
$sub_party_name=$row['sub_party_name'];
$final_job_no=$row['final_job_no'];
$cha_job_no=$row['cha_job_no'];
$sub_party_name=$row['sub_party_name'];
$final_job_date=$row['final_job_date'];
$enq_job_no=$row['enq_job_no'];
$b_e_no = $row['b_e_no'];
$b_e_dt=$row['b_e_dt'];

$ass_value=$row['ass_value'];
$duty_value=$row['duty_value'];
$cleared_on=$row['cleared_on'];
$imp_job_main_id=$row['imp_job_main_id'];



	 ?><tbody>
          			<? 	$qry3z = "select * from import_job_followup where imp_job_main_id='$imp_job_main_id' ";
					//echo $qry3z;
$re3z= mysql_query($qry3z);
while($row=mysql_fetch_array($re3z))
		{  
			$import_process = $row['import_process'];
		$next_reminder = $row['next_reminder'];
		$details = $row['details'];
		$entry_date = $row['entry_date'];
		$entry_time=$row['entry_time'];
		$entry_by=$row['entry_by'];
		$process_complete=$row['process_complete'];
		$reason=$row['reason'];
		$rem_details=$row['rem_details'];
		
		
		}
		
?>	
				 <tr> 
				 <td ><? echo $final_job_no ?> </td>
				  <td><? echo $importer_name ?> </td>
				  <td><? echo $import_process;?></td>
				   <td colspan="3"><? echo $details;?></td>
				   <td ><? echo $process_complete;?><? if($reason!='') { ?><br> Reason : <? echo $reason?><? } ?> </td>
				    <td><? echo $rem_details;?><br>
					</td>
					 </tr>
					 <? } ?></tbody></table>
                            <div id="calendar" class="has-toolbar"></div>
                        </div>
                  <!-- /.chart-responsive -->
                </div></form>
                <!-- /.col -->
                
                <!-- /.col -->
              </div>
              <!-- /.row -->
            </div>
            <!-- ./box-body -->
            
            <!-- /.box-footer -->
          </div>
          <!-- /.box -->
        </div>
      </div>
    </section>
	<?php } ?>
	
	
				
	
	
	
	
	
	
	
			<?php if($department_name=='Export'){?>

	<section class="content">

      <div class="row">
	  <div class="col-md-6">
         

          
          <!-- /.box -->

          <!-- PRODUCT LIST -->
          <div class="box box-success">
            <div class="box-header with-border">
			
               <h3 class="box-title" style="color:#000; font-family:Calibri; font-weight:bold;">Upload Job Register Export</h3>

              <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">
               
				  
		<form method="POST" action="excel-upload/excelUpload_export.php" enctype="multipart/form-data">
		<div class="form-group">
			<label>For CHA</label>
			</div><div class="form-group">
			<select class="form-control" name="our_company_name" required>
												<option value="" selected="selected"> Select </option>
												<option value="Aashirvadh">Aashirvadh Global Logistic Pvt. Ltd.</option>
												
												<option value="Threestar">Threestar Solutions & Services Pvt. Ltd.</option>
												<option value="Vector">Vector Freight Forwarders</option>
												<option value="None">None</option>
												</select></div><div class="form-group">
			<label>Upload Excel File</label>
			<input type="file" name="file" class="form-control">
		</div>
		<div class="form-group">
			<button type="submit" name="Submit" class="btn btn-success">Upload</button>
		</div>
	</form>
		   
          
				  
	
              </div>
              <!-- /.table-responsive -->
            </div>
				  
				  </div></div>
	  </div></div></div>
          <!-- /.box -->
        </div>
	
        <div class="col-md-6">
          <div class="box box-danger">
            <div class="box-header with-border">
               <h3 class="box-title" style="color:#000; font-family:Calibri; font-weight:bold;">Select Job</h3>
            </div>
            <!-- /.box-header -->
            <div class="box-body">
              <div class="row">
			  
			  		<form action="export/job_export_form_01.php" method="post" enctype="multipart/form-data">

                <div class="col-md-12">
                  

                  <div class="widget-body">
				<?php $query2 = "select * from job_register_export where Job_No!='' and Job_No!='Job No.'  and status=''  ORDER BY job_exp_reg_id ASC";
				//echo $query2;
		                 $result2 = mysql_query($query2,$conn);		?>
                      <select name="job_exp_reg_id" class="form-control"  id="myselect" style="color:#000000"> 
                        <option value=""  style="color:#000000">Select JOB</option>
                        <?php
													while($row=mysql_fetch_array($result2))
	                                              	{
													$Job_No = $row['Job_No'];
													$job_exp_reg_id = $row['job_exp_reg_id'];
													$main_job_no = $row['main_job_no'];
													$CHA_name = $row['CHA_name'];
													  ?>
                        <option value="<?php echo $job_exp_reg_id ?>"  style="color:#000000"><?php echo $main_job_no;?> - (<?php echo $CHA_name;?> ) - <?php echo $Job_No?></option>
                        <?php
														
														 } ?>
                      </select>
					  <br>
					  
					  		  <input type="submit" name="submit" class="button btn btn-large btn-primary btn-madmin"/>

                            <div id="calendar" class="has-toolbar"></div>
                        </div>
                  <!-- /.chart-responsive -->
                </div></form>
                <!-- /.col -->
                
                <!-- /.col -->
              </div>
              <!-- /.row -->
            </div>
            <!-- ./box-body -->
            
            <!-- /.box-footer -->
          </div>
          <!-- /.box -->
        </div>
        <!-- /.col -->
		<div class="col-md-12">
          <div class="box box-danger">
            <div class="box-header with-border">
               <h3 class="box-title" style="color:#000; font-family:Calibri; font-weight:bold;">Today Reminder</h3>
            </div>
            <!-- /.box-header -->
            <div class="box-body">
              <div class="row">
			  
			  		
                <div class="col-md-12">
                  

                  <div class="widget-body"><table width="100%"  class="table table-bordered" style="border-collapse:collapse">
	          			<thead>
                <tr> <th scope="col" width="150">Job No</th>
                  <th  scope="col">Exporter Name </th>
                  <th  scope="col">Export Process </th>
                 <th colspan="3" scope="col">Details  </th>
				 <th scope="col">Process Completed </th>
				 <th scope="col">Reminder Details </th>

</tr></thead>
				<?php $query2 = "select * from export_job_main_01 where next_reminder='$today_slash'   ";
				//echo $query2;
		                 $result2 = mysql_query($query2,$conn);		
                    while($row = mysql_fetch_array($result2))
{
 $our_company_name = $row['our_company_name'];
$cha_name = $row['cha_name'];
$customer_id = $row['customer_id'];
$Expoter_Name = $row['expoter_name'];
$job_exp_reg_id=$row['job_exp_reg_id'];
$sub_party_name=$row['sub_party_name'];
$final_job_no=$row['final_job_no'];
$cha_job_no=$row['cha_job_no'];
$sub_party_name=$row['sub_party_name'];
$final_job_date=$row['final_job_date'];
$enq_job_no=$row['enq_job_no'];

$exp_job_main_id=$row['exp_job_main_id'];


	 ?><tbody>
          			<? 	$qry3z = "select * from export_job_followup where exp_job_main_id='$exp_job_main_id' and customer_id='$customer_id'";
					//echo $qry3z;
$re3z= mysql_query($qry3z);
while($row=mysql_fetch_array($re3z))
		{  
		$export_process = $row['export_process'];
		$next_reminder = $row['next_reminder'];
		$details = $row['details'];
		$entry_date = $row['entry_date'];
		$entry_time=$row['entry_time'];
		$entry_by=$row['entry_by'];
		$process_complete=$row['process_complete'];
		$reason=$row['reason'];
		$rem_details=$row['rem_details'];
		}
		
?>	
				 <tr> 
				 <td ><? echo $final_job_no ?> </td>
				  <td><? echo $Expoter_Name ?> </td>
				  <td><? echo $export_process;?></td>
				   <td colspan="3"><? echo $details;?></td>
				   <td ><? echo $process_complete;?><? if($reason!='') { ?><br> Reason : <? echo $reason?><? } ?> </td>
				    <td><? echo $rem_details;?><br>
					</td>
					 </tr>
					 <? } ?></tbody></table>
                            <div id="calendar" class="has-toolbar"></div>
                        </div>
                  <!-- /.chart-responsive -->
                </div></form>
                <!-- /.col -->
                
                <!-- /.col -->
              </div>
              <!-- /.row -->
            </div>
            <!-- ./box-body -->
            
            <!-- /.box-footer -->
          </div>
          <!-- /.box -->
        </div>
		
		
      </div>
    </section>
	
	
	<?php } ?>
	
	
	<?php if($department_name=='Admin' or $department_name=='Import' or $department_name=='Export'){?>

	
	
	<section class="content">
      <!-- Small boxes (Stat box) -->
      <div class="row">
        <div class="col-lg-3 col-xs-6">
          <!-- small box -->
          <div class="small-box bg-aqua">
        <div class="inner">
              <h3><?php
$queryacc = mysql_query("SELECT * FROM export_job_main_01 where export_process='Shipment Done'");
$num_rowacc = mysql_num_rows($queryacc);
echo $num_rowacc;
			?>  </h3>

               <a href="report/view_jobcompletion_report_exp.php" style="color:#FFFFFF"> <p>Job Wise Completion Report Exp</p></a>
            </div>
            <div class="icon">
              <i class="ion ion-android-list"></i>
            </div>
            
          </div>
        </div>
        <!-- ./col -->
        <div class="col-lg-3 col-xs-6">
          <!-- small box -->
          <div class="small-box bg-green">
            <div class="inner">
              <h3><?php
$queryacc01 = mysql_query("SELECT * FROM import_job_main_01 WHERE import_process='Delivery Done'");
$num_rowacc01 = mysql_num_rows($queryacc01);
echo $num_rowacc01;
			?>  </h3>

               <a href="report/view_jobcompletion_report_imp.php" style="color:#FFFFFF"> <p>Job Wise Completion Report Imp</p></a>
            </div>
            <div class="icon">
              <i class="ion ion-android-list"></i>
            </div>
            
          </div>
        </div>
        <!-- ./col -->
        <div class="col-lg-3 col-xs-6">
          <!-- small box -->
          <div class="small-box bg-yellow">
            <div class="inner">
              <h3><?php
$queryacc02 = mysql_query("SELECT * FROM import_job_main_01 where final_job_no!='' and import_process!='Delivery Done'");
$num_rowacc02 = mysql_num_rows($queryacc02);
echo $num_rowacc02;
			?>  </h3>

               <a href="report/view_daily_status_report_imp1.php" style="color:#FFFFFF"> <p>DSR IMP(NEW)</p></a>
            </div>
            <div class="icon">
              <i class="ion ion-ios-calendar-outline"></i>
            </div>
            
          </div>
        </div>
        <!-- ./col -->
		
        <div class="col-lg-3 col-xs-6">
          <!-- small box -->
          <div class="small-box bg-purple">
            <div class="inner">
              <h3><?php
$queryacc02 = mysql_query("SELECT * FROM import_job_main_01");
$num_rowacc02 = mysql_num_rows($queryacc02);
echo $num_rowacc02;
			?>  </h3>

               <a href="report/view_daily_status_report_imp.php" style="color:#FFFFFF"> <p>Daily Status Report IMP</p></a>
            </div>
            <div class="icon">
              <i class="ion ion-ios-calendar-outline"></i>
            </div>
            
          </div>
        </div>
        <!-- ./col -->
      </div>
      <!-- /.row -->
	  
	  
	  
	  
	  <div class="row">
	  <div class="col-lg-3 col-xs-6">
          <!-- small box -->
          <div class="small-box bg-yellow">
            <div class="inner">
              <h3><?php
$queryacc02 = mysql_query("SELECT * FROM export_job_main_01");
$num_rowacc02 = mysql_num_rows($queryacc02);
echo $num_rowacc02;
			?>  </h3>

               <a href="report/view_daily_status_report_exp.php" style="color:#FFFFFF"> <p>Daily Status Report EXP</p></a>
            </div>
            <div class="icon">
              <i class="ion ion-ios-calendar-outline"></i>
            </div>
            
          </div>
        </div>
        <div class="col-lg-3 col-xs-6">
          <!-- small box -->
          <div class="small-box bg-fuchsia">
        <div class="inner">
              <h3><?php
$queryacc05 = mysql_query("SELECT * FROM job_register_import  ");
$num_rowacc05 = mysql_num_rows($queryacc05);
echo $num_rowacc05;
			?>  </h3>

               <a href="report/view_jobpunch_report_imp.php" style="color:#FFFFFF"> <p>Job Wise Punched Report IMP</p></a>
            </div>
            <div class="icon">
              <i class="ion ion-android-list"></i>
            </div>
            
          </div>
        </div>
		  <div class="col-lg-3 col-xs-6">
          <!-- small box -->
          <div class="small-box bg-fuchsia">
        <div class="inner">
              <h3><?php
$queryacc05 = mysql_query("SELECT * FROM job_register_export  ");
$num_rowacc05 = mysql_num_rows($queryacc05);
echo $num_rowacc05;
			?>  </h3>

               <a href="report/view_jobpunch_report_exp.php" style="color:#FFFFFF"> <p>Job Wise Punched Report EXP</p></a>
            </div>
            <div class="icon">
              <i class="ion ion-android-list"></i>
            </div>
            
          </div>
        </div>
        <!-- ./col -->
		<!-- small box 
		
		<div class="col-lg-3 col-xs-6">
          
          <div class="small-box bg-teal">
            <div class="inner">
              <h3><?php
$queryacc06 = mysql_query("SELECT * FROM export_job_main_01 where export_process='Shipment Done'");
$num_rowacc06 = mysql_num_rows($queryacc06);
echo $num_rowacc06;
			?>  </h3>

               <a href="report/view_jobpunch_report_exp.php" style="color:#FFFFFF"> <p>Job Wise Punched Report EXP</p></a>
            </div>
            <div class="icon">
              <i class="ion ion-ios-calendar-outline"></i>
            </div>
            
          </div>
        </div>
        <!-- ./col -->
		
		
        <div class="col-lg-3 col-xs-6">
          <!-- small box -->
          <div class="small-box bg-red">
            <div class="inner">
              <h3><?php
$queryacc01 = mysql_query("SELECT * FROM import_job_main_01 where noof_inv=''");
$num_rowacc01 = mysql_num_rows($queryacc01);
echo $num_rowacc01;
			?>  </h3>

               <a href="report/view_pendinginv_report_imp.php" style="color:#FFFFFF"> <p>Pending Invoices Report IMP</p></a>
            </div>
            <div class="icon">
              <i class="ion ion-android-list"></i>
            </div>
            
          </div>
        </div>
        <!-- ./col -->
        
        <div class="col-lg-3 col-xs-6">
          <!-- small box -->
          <div class="small-box bg-lime">
            <div class="inner">
              <h3><?php
$queryacc02 = mysql_query("SELECT * FROM export_job_main_01 where noof_inv=''");
$num_rowacc02 = mysql_num_rows($queryacc02);
echo $num_rowacc02;
			?>  </h3>

               <a href="report/view_pendinginv_report_exp.php" style="color:#FFFFFF"> <p>Pending Invoices Report EXP</p></a>
            </div>
            <div class="icon">
              <i class="ion ion-ios-calendar-outline"></i>
            </div>
            
          </div>
        </div>
        <!-- ./col -->
      </div>
	  
	  
	  
      <!-- Main row -->
	     
      <!-- /.row (main row) -->

    </section>
	
	
	
	
	
	
	
	<?php } ?>
	
	<?php if($department_name=='Billing'){?>
    <section class="content">

      <div class="row">
	  
	
        
<div class="col-md-12">
          <div class="box box-danger">
            <div class="box-header with-border">
               <h3 class="box-title" style="color:#000; font-family:Calibri; font-weight:bold;">Import Jobs</h3>
            </div>
            <!-- /.box-header -->
            <div class="box-body">
              <div class="row">
                <div class="col-md-12">
                  <div class="widget-body">
					  <table class="table table-bordered" style="border-collapse:collapse">
								
						     	<tbody>
								 
								<tr><td bgcolor="#e6e6e6">Job No</td>
									<td bgcolor="#e6e6e6">Punch Job no.</td>
									<td bgcolor="#e6e6e6">Company Name</td>
									<td bgcolor="#e6e6e6">&nbsp;Importer Name</td>
									<td bgcolor="#e6e6e6" colspan="2">&nbsp;</td>
									
								  </tr>
							<? 
	//$sql = mysql_query("select * from job_register_export where job_imp_reg_id = '".$_REQUEST['job_imp_reg_id']."' "); 
$query2 = "select * from  import_job_main_01 where import_process = 'Delivery Done' and entry_date>'2020-01-01'";
//echo $query2;
$result2 = mysql_query($query2,$conn);	
while($row = mysql_fetch_array($result2))
{
$final_job_no = $row['final_job_no'];
$final_job_date = $row['final_job_date'];
$our_company_name = $row['our_company_name'];
$importer_name = $row['importer_name'];
$imp_job_main_id=$row['imp_job_main_id'];
$customer_id = $row['customer_id'];

?>		
<? 	
$query2a = "select * from company_info where name = '$our_company_name'";
				//echo $query2;our_company_name
$result2a = mysql_query($query2a,$conn);	
while($row = mysql_fetch_array($result2a))
{
 $full_name_com = $row['full_name_com'];
 $address_com=$row['address'];
 }
				?>	
				
<?php 
$query2tax = "select * from  tax_servicetax where final_job_no='$final_job_no' and customer_id= '$customer_id'";
$result2tax = mysql_query($query2tax,$conn);	
while($row=mysql_fetch_array($result2tax))
{
$inv_no = $row['inv_no'];
}


$querychk = "select * from  import_job_main_01 where final_job_no='$final_job_no' and customer_id= '$customer_id'";
//echo $querychk;
$resultchk = mysql_query($querychk,$conn);	
while($row=mysql_fetch_array($resultchk))
{
$invcreated = $row['invcreated'];
$cha_invcreated = $row['cha_invcreated'];
$trans_invcreated = $row['trans_invcreated'];
$cha_inv_no = $row['cha_inv_no'];
$trans_inv_no = $row['trans_inv_no'];
$our_company_name = $row['our_company_name'];
$cha_name = $row['cha_name'];
$trans_inv_date= $row['trans_inv_date'];
$cha_inv_date = $row['cha_inv_date'];
$inv_date = $row['inv_date'];
$transport_req = $row['transport_req'];
$trans_inv_noEdit = $row['trans_inv_noEdit'];
$noof_inv = $row['noof_inv'];
$enq_job_no = $row['enq_job_no'];
$unique_id = $row['unique_id'];
}


?>	  	<tr>
								  <td><?php echo $final_job_no?></td>
								  <td><?php echo $enq_job_no?></td>
								  <td><?php echo $full_name_com?></td>
								  <td><?php echo $importer_name?></td>
			<td colspan="2">
<?php 
//echo $invcreated;
if($invcreated=='' and ($transport_req=='' or $transport_req=='dont_no')) {?>


<a href="update_transport_req.php?imp_job_main_id=<?php echo $imp_job_main_id?>&&customer_id=<?php echo $customer_id?>&&our_company_name=<?php echo $our_company_name?>&&inv_type=IMP" class="btn btn-success">Update Transport</a>
<?php } else {?>

<?php if($noof_inv=='' and $transport_req!='') {?>

<a href="make_inv_series.php?imp_job_main_id=<?php echo $imp_job_main_id?>&&customer_id=<?php echo $customer_id?>&&our_company_name=<?php echo $our_company_name?>&&inv_type=IMP&&unique_id=<?php echo $unique_id?>" class="btn btn-success">Make Bill</a>
<?php } else { ?>
<a href="make_inv_series.php?imp_job_main_id=<?php echo $imp_job_main_id?>&&customer_id=<?php echo $customer_id?>&&our_company_name=<?php echo $our_company_name?>&&inv_type=IMP&&impinvstep=next" class="btn btn-success">Make Bill</a>


<?php } ?>

<?php } ?>

</td>
			
								  </tr>
								<?php } ?>
						   		</tbody>
				  	</table>

                            <div id="calendar" class="has-toolbar"></div>
                  </div>
                  <!-- /.chart-responsive -->
                </div>
                <!-- /.col -->
                
                <!-- /.col -->
              </div>
              <!-- /.row -->
            </div>
            <!-- ./box-body -->
            
            <!-- /.box-footer -->
          </div>
          <!-- /.box -->
        </div>		
		
		
      </div>
    </section>
	
	<?php }?>
	
		<?php if($department_name=='Billing'){?>

	
	<section class="content">

      <div class="row">
	  
	
        
<div class="col-md-12">
          <div class="box box-danger">
            <div class="box-header with-border">
               <h3 class="box-title" style="color:#000; font-family:Calibri; font-weight:bold;">Export Jobs</h3>
            </div>
            <!-- /.box-header -->
            <div class="box-body">
              <div class="row">
                <div class="col-md-12">
                  <div class="widget-body">
					  <table class="table table-bordered" style="border-collapse:collapse">
								
						     	<tbody>
								 
								<tr><td bgcolor="#e6e6e6">Job No</td>
									<td bgcolor="#e6e6e6">Punch Job no.</td>
									<td bgcolor="#e6e6e6" colspan="2">Company Name</td>
									<td bgcolor="#e6e6e6" colspan="2">&nbsp;Exporter Name</td>
									<td bgcolor="#e6e6e6" colspan="3">&nbsp;</td>
									
								  </tr>
							<? 
	//$sql = mysql_query("select * from job_register_export where job_imp_reg_id = '".$_REQUEST['job_imp_reg_id']."' "); 
 $query2E = "select * from  export_job_followup where export_process = 'Shipment Done' and entry_date>'2020-01-01'";
$result2E = mysql_query($query2E,$conn);	
while($row = mysql_fetch_array($result2E))
{
$final_job_no = $row['final_job_no'];
$final_job_date = $row['final_job_date'];
$our_company_name = $row['our_company_name'];
$expoter_name = $row['expoter_name'];
$exp_job_main_id=$row['exp_job_main_id'];
$customer_id = $row['customer_id'];

?>	

<? 	
$query3E = "select * from company_info where name = '$our_company_name'";
$result3E = mysql_query($query3E,$conn);	
while($row = mysql_fetch_array($result3E))
{
 $full_name_com = $row['full_name_com'];
 $address_com=$row['address'];
 }
				?>	
				
<?php 
$query2Etax = "select * from  tax_servicetax where final_job_no='$final_job_no' and customer_id= '$customer_id'";
$result2Etax = mysql_query($query2Etax,$conn);	
while($row=mysql_fetch_array($result2Etax))
{
$inv_no = $row['inv_no'];
}


$querychk = "select * from  export_job_main_01 where final_job_no='$final_job_no' and customer_id= '$customer_id'";
$resultchk = mysql_query($querychk,$conn);	
while($row=mysql_fetch_array($resultchk))
{
$invcreated = $row['invcreated'];
$cha_invcreated = $row['cha_invcreated'];
$trans_invcreated = $row['trans_invcreated'];
$cha_inv_no = $row['cha_inv_no'];
$trans_inv_no = $row['trans_inv_no'];
$trans_inv_date= $row['trans_inv_date'];
$cha_inv_date = $row['cha_inv_date'];
$our_company_name = $row['our_company_name'];
$cha_name = $row['cha_name'];
$inv_date= $row['inv_date'];
$transport_name = $row['transport_name'];
$transport_req = $row['transport_req'];
$enq_job_no = $row['enq_job_no'];
$trans_inv_noEdit = $row['trans_inv_noEdit'];
$unique_id = $row['unique_id'];
$noof_inv = $row['noof_inv'];
}

?>	
<?php 
$query2tm = "select * from transport_master where transport_id = '$transport_name'";
$result2tm = mysql_query($query2tm,$conn);	
while($row = mysql_fetch_array($result2tm))
{
$short_form = $row['short_form'];
}
?>



	  	<tr>
								  <td><?php echo $final_job_no?></td>
								  <td><?php echo $enq_job_no?></td>
								  <td colspan="2"><?php echo $full_name_com?></td>
								  <td colspan="2"><?php echo $expoter_name?></td>
			<td colspan="3">
<?php 
//echo $invcreated;
if($invcreated=='' and ($transport_req=='' or $transport_req=='dont_no')) {?>
<a href="update_transport_reqexp.php?exp_job_main_id=<?php echo $exp_job_main_id?>&&customer_id=<?php echo $customer_id?>&&our_company_name=<?php echo $our_company_name?>&&inv_type=EXP" class="btn btn-success">Update Transport</a>
<?php } else { ?>
<?php if($noof_inv=='' and $transport_req!='') {?>

<a href="make_inv_series.php?exp_job_main_id=<?php echo $exp_job_main_id?>&&customer_id=<?php echo $customer_id?>&&our_company_name=<?php echo $our_company_name?>&&inv_type=EXP&&unique_id=<?php echo $unique_id?>" class="btn btn-success">Make Bill</a>
<?php } else { ?>
<a href="make_inv_series.php?exp_job_main_id=<?php echo $exp_job_main_id?>&&customer_id=<?php echo $customer_id?>&&our_company_name=<?php echo $our_company_name?>&&inv_type=EXP&&impinvstep=next" class="btn btn-success">Make Bill</a>





<?php } ?>
<?php } ?>

</td>
			
								  </tr>
								<?php } ?>
						   		</tbody>
				  	</table>

                            <div id="calendar" class="has-toolbar"></div>
                  </div>
                  <!-- /.chart-responsive -->
                </div>
                <!-- /.col -->
                
                <!-- /.col -->
              </div>
			  
			  
            </div>
          </div>
          <!-- /.box -->
        </div>		
		
		
      </div>
    </section>
	<?php }?>
	
	
    <!-- /.content -->
  </div>
  <!-- /.content-wrapper -->

 
    <? include'footer.php'; ?>

