<?php include 'connection.php';
session_start();
if (!isset($_SESSION['is_logged_in'])) {
    header("Location:login.php");
    die();
    }
$query2job = "select * from check_month";
$resultjob = mysql_query($query2job,$conn);
while($rowmonth=mysql_fetch_array($resultjob))
{
$check_month = $rowmonth['check_month'];
}

date_default_timezone_set('Asia/Calcutta');
$today = date("d-m-Y");
$time = date("h:i A"); 
$currentmonth = date("m");
date_default_timezone_set('Asia/Calcutta');
$today = date("d-m-Y");
$today8days = date("d-m-Y")+8;

$time = date("h:i A");
$currentmonth = date("m"); 
$currentyear = date("y"); 
if($currentmonth>$check_month) { 
$cuyear = date("Y");
$cuyear1 = date("y")+1;

} else { 
$cuyear = date("Y")-1;
$cuyear1 =  date("y");
 } 
 $fin_year = "$cuyear"."-"."$cuyear1";

?>

<? include('sahavas_dropdown_function.php');?>
<?php 
$query2job = "select * from auto_number_job where f_year='$fin_year'";
//echo $query2job;
$resultjob = mysql_query($query2job,$conn);
while($rowjob=mysql_fetch_array($resultjob))

{
$auto_number1 = $rowjob['auto_number'];
 }
 $auto_number=$auto_number1+1;
 $main_job_no= sprintf("%03d", $auto_number);
 if($currentmonth>$check_month) { 
 $datey=date("Y");
 $datey01 =date("y")+1;
  } 
 else {
 $datey=date("Y")-1;
 $datey01 =date("y");
 }
  $noc_type=$_REQUEST['noc_type'];
  

$job_no_series = "Job"."/"."$datey"."-"."$datey01"."/"."$main_job_no";


$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'];
													  $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;
													  }	
													   ?>	
													   
					
<script type="text/javascript" src="jquery.min.js"></script>
<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <title>shigmoda.com</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">
  <!-- 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">
<script src="jquery.min.js"></script>
   <script src="jquery-ui.js"></script>


<link rel="stylesheet" href="jquery-ui.css">

</head>
<body class="hold-transition skin-blue sidebar-mini">
<div class="wrapper">
<? depat_check($department_name,$designation);?>
<!-- Content Wrapper. Contains page content -->
  <div class="content-wrapper">
    <!-- Content Header (Page header) -->
     <section class="content-header">
      <h1>
    <? back_toindex($department_name,$designation);?>
        
      </h1>
    
    </section>

    <!-- Main content -->
	
	
	  <section class="content">
      <div class="row">
	  <form name="chkForm" id="chkForm"  action="insert_main_job.php" method="post">
			<input name="fin_year" value="<?php echo $fin_year?>" type="hidden">	  
        <!-- /.col -->
        <div class="col-md-6" >
        <div class="box" >
        <div class="box-header with-border" style="background:#3C8DBC; color:#FFFFFF;">
        <h3 class="box-title">Job No. <?php echo $job_no_series; ?><span style="float:right;"></span></h3>
         </div>
            <!-- /.box-header -->
           
              <div class="box-body">
			  
	
			   
			   
			   
			    <div class="form-group">
				<label for="scity">&nbsp;Customer Name &nbsp;</label>
                 <select class="form-control" name="customer_id"/>
									<option value="">Select Customer </option>
									 <? $query2c = "select * from customer_master order by customer_name";
		                 				$result2c = mysql_query($query2c,$conn);	
										while($row = mysql_fetch_array($result2c)){
													 $customer_name = $row['customer_name'];
													 $customer_id = $row['customer_id'];
												?>
												<option value="<? echo $customer_id?>"><? echo $customer_name?></option>
												<? } ?></select>
              </div>
			   
			   
			   			  <div class="form-group">
			   <label for="scity">&nbsp;Main Job No. &nbsp;</label>
               <input type="text" class="form-control"  name="main_job_no" value="<?php echo $job_no_series;?>">
               </div>
			    <div class="form-group">
			   <label for="scity">&nbsp;Ref. No &nbsp;</label>
               <input type="text" class="form-control"  name="ref_no" value="<?php echo $ref_no;?>">
               </div>
			   
			   <div class="form-group">
               <label for="acccode">A/C of</label>
<select class="form-control" id="" name="account_of"> 
<option value="">Select Accounts</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 for="acccode">Invoice type</label>
<select class="form-control" id="lsrc" name="inv_type"> 
<option value="">Select Invoice Type</option>
<option value="EXP">EXPORT</option>
<option value="IMP">IMPORT</option>
</select>
               
            </div>
			   
			   <div class="form-group">
			   <label for="scity">&nbsp;Date &nbsp;</label>
               <input type="text" class="datepicker1 form-control"  name="job_date" value="<?php echo $today?>">
               </div>
			   
                </div>
              <!-- /.box-body -->

              <div class="box-footer">
			  
			  
                <button type="submit" class="btn btn-primary">NEXT</button>
              </div>
            
            <!-- /.box-body -->
            
          </div>
          <!-- /.box -->

          
          <!-- /.box -->
        </div>
        <!-- /.col -->
     </form> </div>
      <!-- /.row -->
      
    </section>
	
	
	
	
	
	
	
	
	
	
	
	
    <!-- /.content -->
  </div>
  <!-- /.content-wrapper -->
   <? include'footer.php'; ?>

</body>
</html>
