0x1998 - MANAGER
Edit File: aj_skillDispo.php
<script> $(document).ready(function(){ $('#all').click(function(event) { var tab = document.getElementsByTagName("input"); for (var i = 0; i < tab.length; i++) { if (tab[i].type == "checkbox") tab[i].checked = true; } }); $('#none').click(function(event) { var tab = document.getElementsByTagName("input"); for (var i = 0; i < tab.length; i++) { if (tab[i].type == "checkbox") tab[i].checked = false; } }); }); function select_skill(user,skill) { $.post( "aj_enregSkill.php", {user:user,skill:skill,action:'ajout'}, function(html) { charge(); } ); } </script> <?php include 'config/garde.php'; if (isset($_GET['user'])) $user=$_GET['user']; if (isset($_GET['profil'])) $profil=$_GET['profil']; $return=mysqli_query($link,"select list_skill_id, list_skill_denom from list_skill where list_skill_profil='".$profil."' and list_skill_id not in (select user_skill from user_skill where user_id='".$user."')"); $nbre=0; while($row=mysqli_fetch_array($return)) { echo " <div> <label> <span class=\"badge\" onclick=\"select_skill(".$user.",".$row['list_skill_id'].")\">".$row['list_skill_denom']."</span> </label> </div>"; $nbre++; } ?>