1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71
|
<?php
session_start();
include_once 'class/ManagerUsers.php';
$userManager = new ManagerUsers();
include 'isLogin.php';
if (empty($_SESSION['current_user_id']))
header("Location: index.php");
$titleHtml = "Rechercher un client";
include 'header.php';
if(isset($_POST['test']) && !empty($_POST['test'])) {
echo "<h1>toto</h1>";
// $userName = $userManager->findUserByName();
// $userLastname = $userManager->findUserByLastname();
// $userEmail = $userManager->findUserByEmail();
}
?>
Par son nom :<br />
<input id="searchName" type="search"></input>
<select style="display:none" multiple class="form-control">
<?php
// <option> dynamique avec les éléments récupérés
?>
</select>
<br />
Par son Prénom :<br />
<input id="searchLastname" type="search"></input>
<select style="display:none" multiple class="form-control">
<?php
// <option> dynamique avec les éléments récupérés
?>
</select>
<br />
Par son email :<br />
<input id="email" type="search"></input>
<select style="display:none" multiple class="form-control">
<?php
// <option> dynamique avec les éléments récupérés
?>
</select>
<script>
$(document).ready(function(){
$("#searchName").keyup(function(){
var myname = $('#searchName').val();
$.ajax({
type : 'POST',
url : 'search.php',
data : 'test=' + myname,
dataType : 'html',
success : function(code_html, statut){
alert(code_html);
// alert(myname);
},
error : function(resultat, statut, erreur){
alert('nop');
}
});
});
});
</script>
<?php include 'footer.php'; ?> |
Partager