. * * @brief Displays contacts list in search mode * * @file * @author * @date $date$ * @version $Revision$ */ /* * Fichier appelé par la function ajax multiLink. Elle permet de mettre en session les données lorsqu'on clique sur le checkbox. */ //$_SESSION['stockCheckbox'] = null; if(isset($_REQUEST['uncheckAll'])){ unset($_SESSION['stockCheckbox']); }else if (isset($_REQUEST['courrier_purpose'])) { $key=false; # Append something onto the $name variable so that you can see that it passed through your PHP script. $courrier = functions::xssafe($_REQUEST['courrier_purpose']); if(!empty($_SESSION['stockCheckbox'])){ $key = in_array($courrier, $_SESSION['stockCheckbox']); if($key ==true){ unset($_SESSION['stockCheckbox'][array_search($courrier, $_SESSION['stockCheckbox'])]); $_SESSION['stockCheckbox']=array_values($_SESSION['stockCheckbox']); echo json_encode($_SESSION['stockCheckbox']); exit(); } } if(empty($_SESSION['stockCheckbox'])){ $tableau[] = $courrier; $_SESSION['stockCheckbox'] = $tableau; echo json_encode($_SESSION['stockCheckbox']); }elseif($key==false and !empty($_SESSION['stockCheckbox'])){ array_push($_SESSION['stockCheckbox'],$courrier); echo json_encode($_SESSION['stockCheckbox']); } # I'm sending back a json structure in case there are multiple pieces of information you'd like # to pass back. } exit; ?>