$sql="SELECT s.rowid, s.nom as name, s.client, s.cp as zip, s.ville, st.libelle as stcomm, s.prefix_comm, s.code_client, s.code_compta, s.status as status,";
$sql="SELECT s.rowid, s.nom as name, s.client, s.cp as zip, s.town, st.libelle as stcomm, s.prefix_comm, s.code_client, s.code_compta, s.status as status,";
$sql.=" s.datec, s.datea, s.canvas";
// We'll need these fields in order to filter by sale (including the case where the user can only see his prospects)
if($search_sale)$sql.=", sc.fk_soc, sc.fk_user";
...
...
@@ -117,7 +117,7 @@ if ($search_categ > 0) $sql.= " AND cs.fk_categorie = ".$search_categ;
if($search_categ==-2)$sql.=" AND cs.fk_categorie IS NULL";
if($search_nom)$sql.=" AND s.nom LIKE '%".$db->escape($search_nom)."%'";
if($search_zipcode)$sql.=" AND s.cp LIKE '".$db->escape($search_zipcode)."%'";
if($search_ville)$sql.=" AND s.ville LIKE '%".$db->escape($search_ville)."%'";
if($search_town)$sql.=" AND s.town LIKE '%".$db->escape($search_town)."%'";
if($search_code)$sql.=" AND s.code_client LIKE '%".$db->escape($search_code)."%'";
if($search_compta)$sql.=" AND s.code_compta LIKE '%".$db->escape($search_compta)."%'";