This is a snip of PHP code that is not working properly.
The search form is displayed but "Nothing was found by your request. Try to redefine search terms" is returned when searching by string. The search by date part works great?
Any help you be greatly appreciated.
The search form is displayed but "Nothing was found by your request. Try to redefine search terms" is returned when searching by string. The search by date part works great?
Any help you be greatly appreciated.
PHP:
function display_search_form(){
global $db, $t;
$t->assign('az', get_az());
$products = & $db->get_products_list();
$pp = array();
foreach ($products as $p) $pp[ $p['product_id'] ] = $p['title'] ;
$t->assign('products', $pp);
$user_fields = array();
foreach ($GLOBALS['member_additional_fields'] as $f){
if ($f['name'] == 'is_locked') continue;
if ($f['name'] == 'i_agree') continue;
if ($f['name'] == 'is_approved') continue;
if ($f['type'] == 'hidden') continue;
$user_fields[$f['name']] = $f['title'];
}
$t->assign('member_fields', $user_fields);
$t->display('admin/user_search.html');
}
function search_by_string(){
global $q, $q_where;
global $db, $t;
$ul = & $db->users_find_by_string($q, $q_where);
if (count($ul) == 0){
$t->assign('error', 'Nothing was found by your request. Try to redefine search terms');
display_search_form();
return;
}
global $all_count, $count, $start;
$all_count = count($ul);
$ul = @array_slice($ul, $start, $count);
$t->assign('ul', $ul);
$t->display('admin/user_search_res.html');
}
function search_by_product(){
global $product_id, $include_expired;
global $db, $t;
$ul = & $db->users_find_by_product($product_id, $include_expired);
if (count($ul) == 0){
$t->assign('error', 'Nothing was found by your request. Try to redefine search terms');
display_search_form();
return;
}
global $all_count, $count, $start;
$all_count = count($ul);
$ul = @array_slice($ul, $start, $count);
$t->assign('ul', $ul);
$t->display('admin/user_search_res.html');
}
function search_by_date(){
global $search_type;
global $db, $t;
set_date_from_smarty('date', $_GET);
$ul = & $db->users_find_by_date($_GET['date'], $search_type);
if (count($ul) == 0){
$t->assign('error', 'Nothing was found by your request. Try to redefine search terms');
display_search_form();
return;
}
global $all_count, $count, $start;
$all_count = count($ul);
$ul = @array_slice($ul, $start, $count);
$t->assign('ul', $ul);
$t->display('admin/user_search_res.html');
}




