<?php
session_start();
if(!isset ($_SESSION['user_id'])){
    header("Location:../index.php?msg=Log in first");
    exit();
}else{
	//include('../Server/connection.php');
	include('includes/session.php');
?>

<!DOCTYPE html>
<html lang="en">
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <!-- Meta, title, CSS, favicons, etc. -->
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">

     <title>
	<?php
	include('includes/title.php');
	?>
	</title>
	
	
	<link type = "image/jpg" rel="icon" href="../images/cuamm.jpg" />

    <!-- Bootstrap -->
    <link href="../vendors/bootstrap/dist/css/bootstrap.min.css" rel="stylesheet">
    <!-- Font Awesome -->
    <link href="../vendors/font-awesome/css/font-awesome.min.css" rel="stylesheet">
    

    <!-- Custom Theme Style -->
    <link href="../build/css/custom.min.css" rel="stylesheet">
	
	<!-- DataTables must-->
  <link rel="stylesheet" href="assests/plugins/datatables/jquery.dataTables.min.css">

  <!-- file input must-->
  <link rel="stylesheet" href="assests/plugins/fileinput/css/fileinput.min.css">
	

	
   </head>

  <body class="nav-md">
    <div class="container body">
	
	
	
      <div class="main_container">
        <div class="col-md-3 left_col">
          <div class="left_col scroll-view">
		  
          <?php  
		include 'includes/admin.php';
               ?>

            <div class="clearfix"></div>

            <?php
            include 'includes/profile.php';
			print '</br></br>';
			include 'includes/menu.php';
			?>

            <!-- page content -->
        <div class="right_col" role="main">
          <div class="">

            <div class="clearfix"></div>
			
			
			<div class="row">
			
			 
			
			 <div class="col-md-12 col-sm-12 col-xs-12">
                <div class="x_panel">
                  <div class="x_title">
				  
				
				 <a href="index.php">  <h2><span class="glyphicon glyphicon-step-backward"></span> Back</h2></a> </br></br>
				 
				 <?php
							$sql = "SELECT pos_id,name FROM positions";
                            $result = $connect12->query($sql);
							$m = $result->num_rows;
                                 ?>
                 
                      <b>List Of Positions:</b>&nbsp&nbsp<font color="green"><?php echo $m; ?></font>

                    <ul class="nav navbar-right panel_toolbox">
                      <li><a class="collapse-link"><i class="fa fa-chevron-up"></i></a>
                      </li>
					  
                      
					  
                      <li><a class="close-link"><i class="fa fa-close"></i></a>
                      </li>
                    </ul>
                    <div class="clearfix"></div>
                  </div>
                  <div class="x_content" style="overflow: auto;">
                 
				  <div class="remove-messages"></div>
					
				<table class="table" id="manageCategoriesTable">
					<thead>
						<tr>
							<th>No:</th>							
							<th>Position Name</th>					
							<th>View</th>
							<th>Edit</th>
							<th>Delete</th>
						</tr>
					</thead>
				</table>
				
					
				
					
                  </div>
                </div>
              </div>

            </div>
			
			<div id="MyModal" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="myLargeModalLabel" aria-hidden="true">
	
<!--<div id="view-modal" class="modal fade printable" tabindex="-1" role="dialog" /*aria-labelledby="myModalLabel"*/ aria-labelledby="exampleModalLabel" aria-hidden="true" style="display: none;">-->
             <div class="modal-dialog"> 
                  <div class="modal-content"> 
                  
                       <!--<div id="printThis">-->
				  
                       <div class="modal-header"> 
                            <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button> 
                            <h4 class="modal-title">
                            	<center><i class="glyphicon glyphicon-user"></i> View Position Details</center>
                            </h4> 
							
							
                       </div> 
                       <div class="modal-body"> 
                       
                       	   <div id="modal-loader" style="display: none; text-align: center;">
                       	   	<img src="ajax-loader.gif">
                       	   </div>
                            
                           <!-- content will be load here -->                          
                           <div id="dynamic-content"></div>
						   
						   <div class="well well-lg">
                          
                           </div>
                             
                        </div>

						<!--</div>-->
                        <div class="modal-footer"> 
                              <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>  
							  <!--<button id="btnPrint" type="button" class="btn btn-default">Print</button>-->
							  
                        </div> 
                        
                 </div> 
              </div>
       </div><!-- /.modal -->

<!-- edit categories brand -->
<div class="modal fade" id="editCategoriesModal" tabindex="-1" role="dialog">
  <div class="modal-dialog">
    <div class="modal-content">
    	
    	<form class="form-horizontal" id="editCategoriesForm" action="php_action/editPos.php" method="POST">
	      <div class="modal-header">
	        <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
	        <h4 class="modal-title"><i class="fa fa-edit"></i> Edit Position Details</h4>
	      </div>
	      <div class="modal-body">

	      	<div id="edit-categories-messages"></div>

	      	<!--<div class="modal-loading div-hide" style="width:50px; margin:auto;padding-top:50px; padding-bottom:50px;">
						<i class="fa fa-spinner fa-pulse fa-3x fa-fw"></i>
						<span class="sr-only">Loading...</span>
					</div>-->

		      <div class="edit-categories-result">
		      	<div class="form-group">
		        	<label for="editCategoriesName" class="col-sm-4 control-label">Position Name: </label>
		        	<label class="col-sm-1 control-label">: </label>
					    <div class="col-sm-7">
					      <input type="text" class="form-control" id="editPositionName" placeholder="Position Name" name="editPositionName" autocomplete="off">
					    </div>
		        </div> <!-- /form-group-->
				
		       
				
		      </div>         	        
		      <!-- /edit brand result -->

	      </div> <!-- /modal-body -->
	      
	      <div class="modal-footer editCategoriesFooter">
	        <button type="button" class="btn btn-default" data-dismiss="modal"> <i class="glyphicon glyphicon-remove-sign"></i> Close</button>
	        
	        <button type="submit" class="btn btn-success" id="editCategoriesBtn" data-loading-text="Loading..." autocomplete="off"> <i class="glyphicon glyphicon-ok-sign"></i> Save Changes</button>
	      </div>
	      <!-- /modal-footer -->
     	</form>
	     <!-- /.form -->
    </div>
    <!-- /modal-content -->
  </div>
  <!-- /modal-dailog -->
</div>
<!-- /categories brand -->


<!-- categories brand -->
<div class="modal fade" tabindex="-1" role="dialog" id="removeCategoriesModal">
  <div class="modal-dialog">
    <div class="modal-content">
      <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
        <h4 class="modal-title"><i class="glyphicon glyphicon-trash"></i> Delete Position</h4>
      </div>
      <div class="modal-body">
        <p>Do you really want to remove This Position?</p>
      </div>
      <div class="modal-footer removeCategoriesFooter">
        <button type="button" class="btn btn-default" data-dismiss="modal"> <i class="glyphicon glyphicon-remove-sign"></i> Close</button>
        <button type="button" class="btn btn-primary" id="removeCategoriesBtn" data-loading-text="Loading..."> <i class="glyphicon glyphicon-ok-sign"></i> Save changes</button>
      </div>
    </div><!-- /.modal-content -->
  </div><!-- /.modal-dialog -->
</div><!-- /.modal -->
<!-- /categories brand -->
			
			
			
          </div>
        </div>
        <!-- /page content -->

        <?php
		include 'footer.php';
		?>
		
		
      </div>
    </div>
	
	

    <!-- jQuery -->
    <!--<script src="../vendors/jquery/dist/jquery.min.js"></script>-->
	
	
	<script src="../vendors/jquery/dist/jquery.min.js"></script>
	
	
    <!-- Bootstrap -->
    <!--<script src="../vendors/bootstrap/dist/js/bootstrap.min.js"></script>-->
	
	<!-- Bootstrap -->
    <script src="../vendors/bootstrap/dist/js/bootstrap10.min.js"></script>
    
    <!-- Custom Theme Scripts -->
    <script src="../build/js/custom.min.js"></script>
	
	<!-- file input must-->
	<script src="assests/plugins/fileinput/js/plugins/canvas-to-blob.min.js'); ?>" type="text/javascript"></script>	
	<script src="assests/plugins/fileinput/js/plugins/sortable.min.js" type="text/javascript"></script>	
	<script src="assests/plugins/fileinput/js/plugins/purify.min.js" type="text/javascript"></script>
	<script src="assests/plugins/fileinput/js/fileinput.min.js"></script>	


	<!-- DataTables must-->
	<script src="assests/plugins/datatables/jquery.dataTables.min.js"></script>
	
	<!--must-->
	<script src="custom/js/pendingCustomerFile.js"></script>
	
			  <script>
$(document).ready(function(){
	
	$(document).on('click', '#getUser11', function(e){
		
		e.preventDefault();
		
		var uid = $(this).data('id');   // it will get id of clicked row
		//var uid1 = $(this).data('id1');   // it will get id of clicked row
		//var uid1 = $(this).data('leave');   // it will get id of clicked row
		
		$('#dynamic-content').html(''); // leave it blank before ajax call
		$('#modal-loader').show();      // load ajax loader
		
		$.ajax({
			url: 'get_pos_details.php',
			type: 'POST',
			//data: 'id='+uid+'&id1='+uid1,
			//data: 'id='+uid+'&id1='+uid1+'&date='+date,
			data: 'id='+uid,
			dataType: 'html'
		})
		.done(function(data){
			console.log(data);	
			$('#dynamic-content').html('');    
			$('#dynamic-content').html(data); // load response 
			$('#modal-loader').hide();		  // hide ajax loader	
		})
		.fail(function(){
			$('#dynamic-content').html('<i class="glyphicon glyphicon-info-sign"></i> Something went wrong, Please try again...');
			$('#modal-loader').hide();
		});
		
	});
	
});

</script>
	
	
		
		
  </body>
</html>



<?php
}

?>