Skip to content
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
29 lines (27 sloc) 686 Bytes
if (!defined("POUET_API")) exit();
$terms = split_search_terms( $_GET["q"] );
if ($terms)
$s = new BM_Query("parties");
$s->AddField("p.c as prods");
$s->AddJoin("left","(select party, count(*) as c from prods group by party) as p"," =");
$s->AddOrder(" ASC");
foreach($terms as $term)
$s->AddWhere(sprintf_esc(" LIKE '%%%s%%'",_like($term)));
$parties = $s->perform();
$result = new stdClass();
if ($parties)
$result->success = true;
$result->results = $parties;
$result->error = true;
You can’t perform that action at this time.