
<?php include_once('header.php'); ?>
<?php include_once('sidebar.php'); ?>
	 <!-- Content Wrapper. Contains page content -->
  <div class="content-wrapper ">
	<section class="content-header">
      <h1>Job Categories</h1>
    </section>
  
 
		<section class="content">
			
		<div class="backf pt30">
		
			<!-- <div class="row mb20">
				<div class="col-sm-10 col-sm-offset-1 col-md-8 ">
					<div class="form-group">
					  <label for="usr">Email Name:</label>
					  <input type="text" class="form-control" id="usr">
					</div>
					 <div class="form-group">
					  <label for="usr">Grade:</label>
					 <select class="form-control"><option>A</option></select>
					</div>
					
					<div class="mb20">
						<button class="btn btn-success" >SAVE</button>
					</div>
					<div class="mb20">
						<button class="btn btn-info upoadldbtn" >Upload Button</button>
						<input type="file" id="my_file" style="display: none;" multiple /> 
					</div>
					
				</div>
			</div> -->
		
			
			<div class="mb20">
				<button class="btn btn-warning mb20" data-toggle="modal" data-target="#add-job-categories">Add Job Categories</button>
			</div>
			
			<div class="table-responsive">
				<table  class="table table-striped datatble">
					<thead>
					  <tr>
						<th>Category Name</th>
						<th>Qualification</th>
						<th>Address</th>
						<th>Salary</th>
						<th>Company</th>
						<th></th>
					  </tr>
					</thead>
					<tbody>
					<?php foreach($data as $d){ ?>
					  <tr>
						<td><?php echo $d->job_type; ?></td>
						<td><?php echo $d->qualification; ?></td>
						<td><?php echo $d->address; ?></td>
						<td><?php echo $d->salary; ?></td>
						<td><?php echo $d->company_name; ?></td>
						<td>
							<button class="btn btn-info" data-toggle="modal" data-target="#edit-job-categories" onclick="set_data('<?php echo $d->id; ?>','<?php echo $d->job_type; ?>','<?php echo $d->qualification; ?>','<?php echo $d->address; ?>','<?php echo $d->salary; ?>','<?php echo $d->company_name; ?>')">Edit</button>
							<button class="btn btn-danger" data-toggle="modal" data-target="#delete-client" onclick="del_data('<?php echo $d->id; ?>')">Delete</button>
						</td>
					  </tr>
					<?php } ?>
					 
					  
					</tbody>
				  </table>
			</div>

      </div>
		
		</section>
		
		
		
  </div>
  
  
  
  
  <!-- Modal -->
<div id="add-job-categories" class="modal fade" role="dialog">
  <div class="modal-dialog">
<form method="post" action="<?php echo base_url(); ?>main_controller/add_jobcats">
    <!-- Modal content-->
    <div class="modal-content">
      <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal">&times;</button>
        <h4 class="modal-title">Add Job Categories</h4>
      </div>
      <div class="modal-body">
        <div class="form-group">
		  <label for="usr">Category Name:</label>
		  <input type="text" class="form-control" id="usr" name="cat_name">
		</div>
		<div class="form-group">
		  <label for="usr">Qualification:</label>
		  <input type="text" class="form-control" id="usr" name="cat_qualification">
		</div>
		<div class="form-group">
		  <label for="usr">Address:</label>
		  <input type="text" class="form-control" id="usr" name="cat_add">
		</div>
		<div class="form-group">
		  <label for="usr">Salary:</label>
		  <input type="text" class="form-control" id="usr" name="cat_sal">
		</div>
		<div class="form-group">
		  <label for="usr">Company Name:</label>
		  <input type="text" class="form-control" id="usr" name="cat_cmp">
		</div>
      </div>
      <div class="modal-footer">
        <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
        <button type="submit" class="btn btn-success" >Save</button>
      </div>
    </div>
</form>
  </div>
</div>
  
  
  <!-- Modal -->
<div id="edit-job-categories" class="modal fade" role="dialog">
  <div class="modal-dialog">
<form method="post" action="<?php echo base_url(); ?>main_controller/edit_jobcats">
    <!-- Modal content-->
    <div class="modal-content">
      <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal">&times;</button>
        <h4 class="modal-title">Add Job Categories</h4>
      </div>
      <div class="modal-body">
        <div class="form-group">
		  <label for="usr">Category Name:</label>
		  <input type="text" class="form-control" id="edit_cat_name" name="edit_cat_name">
		  <input type="hidden" class="form-control" id="edit_cat_id" name="edit_cat_id">
		</div>
		<div class="form-group">
		  <label for="usr">Qualification:</label>
		  <input type="text" class="form-control" id="edit_cat_qualification" name="edit_cat_qualification">
		</div>
		<div class="form-group">
		  <label for="usr">Address:</label>
		  <input type="text" class="form-control" id="edit_cat_add" name="edit_cat_add">
		</div>
		<div class="form-group">
		  <label for="usr">Salary:</label>
		  <input type="text" class="form-control" id="edit_cat_sal" name="edit_cat_sal">
		</div>
		<div class="form-group">
		  <label for="usr">Company Name:</label>
		  <input type="text" class="form-control" id="edit_cat_cmp" name="edit_cat_cmp">
		</div>
      </div>
      <div class="modal-footer">
        <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
        <button type="submit" class="btn btn-success" >Save</button>
      </div>
    </div>
</form>
  </div>
</div>
  
  
  
  
  
<!-- Modal -->
<div id="delete-client" class="modal fade" role="dialog">
  <div class="modal-dialog">
<form method="post" action="<?php echo base_url(); ?>main_controller/delete_jobcats">
    <!-- Modal content-->
    <div class="modal-content">
      <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal">&times;</button>
        <h4 class="modal-title">Delete Job</h4>
      </div>
      <div class="modal-body">
        <div class="form-group">
		  <label for="usr">Do you want to Delete Job Category?</label>
		 
		  <input type="hidden" class="form-control" id="del_id" name="del_id">
		</div>
		
      <div class="modal-footer">
        <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
        <button type="submit" class="btn btn-success" >Delete</button>
      </div>
    </div>
</form>
  </div>
  </div> 
</div>   
<?php include_once('footer.php'); ?>
<script>
function set_data(id,title,qualification,add,sal,cmp){
	$("#edit_cat_name").val(title); //alert(fname);
	$("#edit_cat_id").val(id); //alert(page_name);
	$("#edit_cat_qualification").val(qualification); //alert(page_name);
	$("#edit_cat_add").val(add); //alert(page_name);
	$("#edit_cat_sal").val(sal); //alert(page_name);
	$("#edit_cat_cmp").val(cmp); //alert(page_name);
	
	
}
function del_data(id){
	$("#del_id").val(id);
}
</script>
