<?php
	$sch = "";
	if ($_POST) {
		if (isset($_POST["schClients"])) {
			$search = nettoie_input(trim($_POST["schClients"]));
			$sch = 'c.libelle LIKE "%' . $search . '%" OR c.adresse1  LIKE "%' . $search . '%" OR c.cp LIKE "%' . $search . '%" OR c.ville LIKE "%' . $search . '%" OR c.contact_nom LIKE "%' . $search . '%" OR c.contact_prenom LIKE "%' . $search . '%" OR c.contact_fonction LIKE "%' . $search . '%" ';
		}
	}

//! On récupère la liste des clients
	$sql = 'SELECT c.* FROM clients c ';
	if ($sch != "") {
		$sql .= 'WHERE ' . $sch;
	}
	$sql .= 'ORDER BY c.libelle';
	$aModel["clients"] = getinfos($sql, "gen");
