  <?php
include 'include/config.php';
include 'check.php';
?>      

<!DOCTYPE html>
<html >
  <head>
    <meta charset="UTF-8">
    <title>DataXylo Admin|Admin</title>
	<link rel="stylesheet" href="asset/sweetalert.css"/>
      <link rel='stylesheet prefetch' href='http://netdna.bootstrapcdn.com/bootstrap/3.0.2/css/bootstrap.min.css'>
      <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.6.2/css/font-awesome.min.css">
      <link rel="stylesheet"  href="https://maxcdn.bootstrapcdn.com/font-awesome/4.5.0/css/font-awesome.min.css">

      <link href="https://rawgit.com/wenzhixin/bootstrap-table/master/src/bootstrap-table.css">
      <link rel="stylesheet" href="asset/style.css">
      <link rel="stylesheet"  href="css/left.css">
      <link rel="stylesheet" href="asset/editor.css">
      <link rel="stylesheet" href="asset/export/examples.css">
      <link rel="stylesheet" href="asset/export/bootstrap-table.css">
    <!--for mobile views --->
  <script src="asset/sweetalert.js"></script>


  </head>

  <body>

  <?php 
include 'include/config.php';
if(isset($_GET['id']))
{
  $id=$_GET['id'];
  if(isset($_POST['update']))
  {
  $job_id=$_POST['job_id'];
  $job_title=$_POST['job_title'];
  $job_type=$_POST['job_type'];
  $work_exp=$_POST['work_exp'];
  $job_location=$_POST['job_location'];
  $job_description=$_POST['editor1'];
  $updated=mysqli_query($conn,"UPDATE job_list SET job_id='$job_id', job_title='$job_title', job_type='$job_type',work_exp='$work_exp',job_location='$job_location',job_description='$job_description' WHERE id='$id'")or die();
  if($updated)
  {
 
 
  	?>
		
			<script>
     
       swal({ 
    title: "Successfully",
    text: "Your JobList Has Been Successfully Updated",
    type: "success" 
   },
     function(){
    window.location.href = 'JobPost.php';
    });
        
        </script>
		<?php

  }
}
}  //update ends here
ob_end_flush();
?>
    
<?php 
  if(isset($_GET['id']))
  {
  $id=$_GET['id'];
  $getselect=mysqli_query($conn,"SELECT * FROM job_list WHERE id='$id'");
  while($profile=mysqli_fetch_array($getselect))
  {
    $job_id=$profile['job_id'];
    $job_title=$profile['job_title'];
    $job_type=$profile['job_type'];
	$work_exp=$profile['work_exp'];
    $job_location=$profile['job_location'];
	$job_description=$profile['job_description'];
?>

<div class="navbar-xs" >
   <div class="navbar-primary">
       <nav class="navbar navbar-static-top" role="navigation">
          <!-- Brand and toggle get grouped for better mobile display -->
          <div class="navbar-header">
              <a class="navbar-brand" href="Experiences.php"><img class="img-logo" src="images/logo.png"></a>
              <a href="#" class="rad-toggle-btn top-icon"><i class="glyphicon glyphicon-th-large"></i></a>


          </div>
          <!-- Collect the nav links, forms, and other content for toggling -->

          <ul class="nav navbar-nav navbar-right" style="padding-top: 7px;">
             <li><a title="John" href="logout.php"><span style="color: red;" class="glyphicon glyphicon-off"></span> <span class="sr-only">(current)</span></a></li>
           </ul>

      </nav>
  </div>
</div>
      <div id="wrapper" class="toggled-2">
        <!-- Sidebar -->
       <aside>
		<nav class="rad-sidebar rad-nav-min ">
            <ul style="  margin-left: -40px;">
                <li><a href="Experiences.php" class="inbox"><i class="fa fa-tachometer"><span class="icon-bg rad-bg-success"></span></i><span class="rad-sidebar-item"> Dashboard</span></a></li>

                <li><a href="Experiences.php" class="snooz"><i class="fa fa-user-plus"><span class="icon-bg rad-bg-primary"></span></i><span class="rad-sidebar-item">Applicant</span></a></li>
                <li><a href="JobPost.php" class="done"><i class="fa fa-recycle"><span class="icon-bg rad-bg-warning"></span></i><span class="rad-sidebar-item">Jobs post</span></a></li>
                <li><a href="settings.php"><i class="fa fa-wrench"><span class="icon-bg rad-bg-violet"></span></i><span class="rad-sidebar-item">Settings</span></a></li>
				</ul>
		</nav>
    </aside>
        <!-- Page Content -->
         <div class="rad-body-wrapper rad-nav-min">
            <div class="container-fluid">
                 

                    
<div class="col-md-12">
    <form  method="post" >
    <p>
	<ul class="list-inline">
	<li><label for="name"  id="preinput"> Job ID </label>
      <input style="color: #ff9000!important; font-weight:bold" type="text" name="job_id" class="form-control from1" required  
      value="<?php echo $job_id; ?>" id="inputid" /></li>
	<li>
	
	  </li>
	<li>
	 <label for="mobile" id="preinput"> Job Type: </label>
      <input style="color: #ff9000!important; font-weight:bold" type="text" name="job_type" required class="form-control from1" 
      value="<?php echo $job_type; ?>" id="inputid" />
	</li>
	<li>
	 <label for="mobile" id="preinput"> Work Experience: </label>
      <input style="color: #ff9000!important; font-weight:bold" type="text" name="work_exp" required class="form-control from1" 
      value="<?php echo $work_exp; ?>" id="inputid" />
	</li>
	<li>
	 <label for="mobile" id="preinput"> Location: </label>
      <input style="color: #ff9000!important; font-weight:bold" type="text" name="job_location" required class="form-control from1" 
      value="<?php echo $job_location; ?>" id="inputid" />
	</li>
	
	</ul>
      <ul class="list-inline">
	  
	  </ul>
	   <label  for="email"  id="preinput"> Job Title: </label>
      <input style="color: #ff9000!important; font-weight:bold" type="text" name="job_title" required class="form-control " 
      value="<?php echo $job_title; ?>" id="inputid" />
	   <label id="preinput" >Job Description:</label>
	   
        <textarea  type="text" class="form-control"  rows="5"  name="editor1"  <?php echo $job_description; ?>/></textarea>
		
   <br>
      <input class="btn btn-success pull-right" type="submit" name="update" value="Update" id="inputid1"/>
    </p>
  </form>
</div>

<?php } } ?>
                  


                      </div>


              
            </div>
        <!-- /#page-content-wrapper -->
    </div></div>
	
	
	
	
	
	
	


	
	
	






      <!----CDN------>
  <script src="//cdn.ckeditor.com/4.5.10/standard/ckeditor.js"></script><!----text editor cdn------>

    <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
	<script src="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/js/bootstrap.min.js"></script>
	<script src="http://cdnjs.cloudflare.com/ajax/libs/bootstrap-table/1.9.1/bootstrap-table.min.js"></script>

    <script src="asset/admin.js"></script>
            <script src="http://rawgit.com/hhurz/tableExport.jquery.plugin/master/tableExport.js"></script>
            <script src="https://rawgit.com/wenzhixin/bootstrap-table/master/src/bootstrap-table.js"></script>
            <script src="https://rawgit.com/wenzhixin/bootstrap-table/master/src/extensions/export/bootstrap-table-export.js"></script>
            <script src="https://cdnjs.cloudflare.com/ajax/libs/lodash.js/3.10.0/lodash.min.js"></script>
            <script src="asset/export/ga.js"></script>
             <script src="asset/editor.js"></script>




<script>
            CKEDITOR.replace( 'editor1' );
        </script>


<script>
    	$(document).on("click", function(e){
		var $item = $(".rad-dropmenu-item");
		if($item.hasClass("active")){
			$item.removeClass("active");
		}
	});

	$(".rad-toggle-btn").on('click', function(){
		$(".rad-sidebar").toggleClass("rad-nav-min");
		$(".rad-body-wrapper").toggleClass("rad-nav-min");
		setTimeout(200);
	});

	$(".rad-dropdown >.rad-menu-item").on('click', function(e){
		e.stopPropagation();
		$(".rad-dropmenu-item").removeClass("active");
		$(this).next(".rad-dropmenu-item").toggleClass("active");
	});


</script>






 <style>
     .rad-body-wrapper {
          position: absolute;
    left: 177px;
    top: 59px;
    width: auto;
    right: 14px;
    -webkit-transition: all .2s ease-in-out;
    transition: all .2s ease-in-out;
      }
	  
	  
	  .from1{
		   width: 335px;

	  }
  </style>

  </body>

</body>
</html>