<?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"/><!--for alert notification --->
      <link rel='stylesheet prefetch' href='https://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/export/examples.css">
      <link rel="stylesheet" href="asset/export/bootstrap-table.css">
  <!--for alert notification --->
      <script src="asset/sweetalert.js"></script>

    <style>
        #table{ font-size: 13px; }

    </style>

  </head>

  <body>

    <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="#" 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-lg-12">
                        <div>
						 <form name="bulk_action_form"  method="post" onSubmit="return delete_confirm();"/>
                            <div class="container-fluid">

                                <div id="toolbar">

                                    <ul class="list-inline">
                                        <li>
                                            <select class="form-control">
                                                <option value="">Export Basic</option>
                                                <option value="all">Export All</option>
                                                <option value="selected">Export Selected</option>
                                            </select>
                                        </li>
                                        <li><button type="submit" class="btn btn-danger" name="bulk_delete_submit" value="Delete">Delete</button></li>
                                    </ul>
                                </div>

                            </div>
                            <table data-toggle="table" id="table"
                       data-row-style="rowStyle"

                       data-show-refresh="true"
                       data-show-toggle="true"
                       data-show-columns="true"
                       data-search="true"
                       data-select-item-name="toolbar1"
                       data-pagination="true"
                       data-sort-name="name"
                       data-sort-order="desc"
                       data-single-select="false"
                       data-click-to-select="true"
                       data-maintain-selected="true"

                       data-show-export="true"
                       data-pagination="true"
                       data-click-to-select="true"
                       data-toolbar="#toolbar"


                       >
                 <thead >
                    <tr style="background:#ccc;">
                        <th data-field="id"></th>
                        <th data-sortable="true">Job ID</th>
                        <th data-sortable="true">First Name</th>
                        <th data-sortable="true">Last Name</th>

                        <th  data-sortable="true">Email Id</th>
                        <th  data-sortable="true">Phone No</th>

                      
                        <th  data-sortable="true">Resume</th>

                      </tr>
                  </thead>
				                    <tbody>
                                                      <?php $result= mysqli_query($conn,"SELECT * FROM experience");
															while($row = mysqli_fetch_array($result)){

															?>

                                                               <tr>
                                   <td><input type="checkbox" name="checked_id[]" class="checkbox" value="<?php echo $row['id']; ?>"/></td>
			        <td ><?php echo $row['jobs_id']; ?></td>
				<td ><?php echo $row['first_name']; ?></td>
			       <td ><?php echo $row['last_name']; ?></td>
	                       <td ><?php echo $row['email_id']; ?></td>
			    <td ><?php echo $row['phone_no']; ?></td>
			
  <td><a href="uploads/<?php echo $row['resume'] ?>" target="_blank"><button type="button" class="btn btn-success btn-xs" >Download</button></a></td>                                                               </tr>

                                                                    <?php } ?>
                  </tbody>

               </table>

                        </div>
						</form>
                </div>

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

if(isset($_POST['bulk_delete_submit'])){
    $idArr = $_POST['checked_id'];
    foreach($idArr as $id){
        mysqli_query($conn,"DELETE FROM experience WHERE id=".$id);

    }
    $_SESSION['success_msg'] = 'Users have been deleted successfully.';
	?>
		<script>
		
		
		swal({ 
    title: "Deleted!",
    text: "You have been deleted successfully.",
    type: "success" 
   },
     function(){
    window.location.href = 'Experiences.php';
    });
    
		
	
       
        </script>
		<?php

}


?>

      <!----CDN------>

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

    <script src="asset/admin.js"></script>
            <script src="https://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>
    	$(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;
      }
  </style>

  </body>
</html>
