<?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("d-m-Y");
$time = date("h:i A"); 

?>
<? include('sahavas_dropdown_function.php');?>
<?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'];
													  $avatar = $row['avatar'];
													  $department_name = $row['department_name'];
													  $staff_id  = $row['id'];
													  $username = $row['username'];
													  $our_company = $row['active_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>Shipping :: CRM Software</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>	
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
<script type="text/javascript">
$(document).ready(function(){
$("#name").keyup(function() {
var name = $('#name').val();
if(name=="")
{
$("#disp").html("");
}
else
{
$.ajax({
type: "POST",
url: "user_check.php",
data: "name="+ name ,
success: function(html){
$("#disp").html(html);
}
});
return false;
}
});
});
</script>



<script type="text/javascript">
$(document).ready(function(){
$("#name1").keyup(function() {
var name1 = $('#name1').val();
if(name1=="")
{
$("#disp1").html("");
}
else
{
$.ajax({
type: "POST",
url: "user_check1.php",
data: "name="+ name1 ,
success: function(html){
$("#disp1").html(html);
}
});
return false;
}
});
});
</script>		



<script type="text/javascript">
$(document).ready(function(){
$("#name2").keyup(function() {
var name2 = $('#name2').val();
if(name2=="")
{
$("#disp2").html("");
}
else
{
$.ajax({
type: "POST",
url: "user_check2.php",
data: "name="+ name2 ,
success: function(html){
$("#disp2").html(html);
}
});
return false;
}
});
});
</script>													   
											   

</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">
<div class="row">
    <!-- Content Header (Page header) -->
    
						 
</div>
    <!-- Main content -->
	
	
	<section class="content">
      <div class="row">
	            

		 <div class="col-md-12">
		
		<div class="row">
           
           
            <div class="box-body">
              <table class="table table-bordered">
			  <form name="deptdetail" id="deptdetail" action="insert_service_master.php" method="post" enctype="multipart/form-data">
			  <div class="col-xs-12" style="background:#3C8DBC;">
			  
								<h5 style="color:#FFFFFF">
								<span class="glyphicon glyphicon-edit"></span>&nbsp;&nbsp;Serivce  Master</h5>
							</div>
			
  <tbody>

                <tr>
                  <td> <label style="font-weight:normal; font-size:15px;">Serivce Name </label>
				    <input name="services_name" type="text" class="form-control" required="required"> </td>
                  
				   <td>
				   <label style="font-weight:normal; font-size:15px;">HAN Code</label>
				   <input type="text" name="HSN_code" class="form-control"  required >
				   </td>
				   <td>
				   <label style="font-weight:normal; font-size:15px;">CHA Required</label>
				   <input type="text" name="CHA_required" class="form-control">
				   </td>
				    <td>
				   <label style="font-weight:normal; font-size:15px;">Transport Required</label>
				   <input type="text" name="transport_required" class="form-control">
				   </td>
				   <td>
				   <br>
				   <input type="submit" name="ADD" value="ADD" class="btn bg-btn-save"/>	 
				   </td>
				 
                 
                </tr>  
			   </tbody>
			   </form>
              </table>
			  <br>
			   <table class="table table-bordered"><div class="col-xs-12" style="background:#3C8DBC;">
								<h5 style="color:#FFFFFF">
								<span class="glyphicon glyphicon-edit"></span>&nbsp;&nbsp; Edit / Delete Serivce  Master Details </h5>
							</div>
  

			  <thead>
                <tr> <th scope="col" width="60">Del</th>
                 
                  <th scope="col">Service Name </th>
                <th scope="col">HSN Code</th>
				  <th scope="col">CHA Required</th>
				  <th scope="col">Transport Required</th>
				  <th scope="col" width="80">Edit</th>
				 
				  
				 
                </tr>
				</thead>
  <tbody>
<?php 
$i=1;
$query1 = "select * from services_master";
$result1 = mysql_query($query1,$conn);		
while($row=mysql_fetch_array($result1))
{
$services_name = $row['services_name'];
$id = $row['service_id'];// autogerated 

$HSN_code=$row['HSN_code'];
$CHA_required=$row['CHA_required'];
$transport_required = $row['transport_required'];

?>
                <form name="deptdetail" id="deptdetail" action="insert_service_master.php" method="post" enctype="multipart/form-data">
				
				 <tr><td><a href="insert_department_master.php?id=<?php echo $id?>&&del=YES" class="btn bg-btn-save" ><span title="Delete This Item" class="glyphicon glyphicon-remove"></span></a>
				</td>
                  <input type="hidden" name="id" value="<? echo $id?>">
				
                  <td data-label="Serivce"><textarea name="services_name" class="form-control"><? echo $services_name?></textarea></td>
                  <td>
				  
				   <input type="text" name="HSN_code" class="form-control" value="<? echo $HSN_code;?>">
				   </td>
				 <td>
				  
				   <input type="text" name="CHA_required" class="form-control" value="<? echo $CHA_required;?>">
				   </td>
				   
				    <td>
				  
				   <input type="text" name="transport_required" class="form-control" value="<? echo $transport_required;?>">
				   </td>
				   
				   
				  <td>  <input type="submit" name="Edit" value="Edit" class="btn bg-btn-save"/>	</td>
				  
				 
				 
                 
                </tr></form>
               <?php $i++;  }
			   
			   
			   ?>
			   <input type="hidden" name="counter" value="<? echo $i; ?>">
			   </tbody>
              </table>
			  <br>
			  
			  
			  
			  
			  
			  
			  
            </div>
            <!-- /.box-body -->
			
			 </div> </div>
			   
				
				
				
				
					
						
				
				
				
				
                
              </div>
			  
			  
			  
			  
			  
			  
			  </section>
            
         
	
	
	
	
	
	
	
	
	
	
    <!-- /.content -->
  </div>
  <!-- /.content-wrapper -->
    <? include'footer.php'; ?>


</body>
</html>
