Collections functions
General functions
Node functions
Render functions
Theme permission functions
User functions
Resource functions

get_research_requests()

Parameters

ColumnTypeDefaultDescription
$find ""
$order_by "name"
$sort "ASC"

Location

include/research_functions.php lines 89 to 108

Definition

 
function get_research_requests($find="",$order_by="name",$sort="ASC")
    {
    
$searchsql="";
    
$use_order_by "";
    
$use_sort validate_sort_value($sort) ? $sort 'ASC';
    
$parameters=array();
    if (
$find!="") {
        
$searchsql="WHERE name like ? or description like ? or contact like ? or ref=?"
        
$parameters=array("s","%{$find}%""s","%{$find}%""s","%{$find}%""i",(int)$find);
    }
    if (
in_array($order_by, array("ref","name","created","status","assigned_to","collection")))
        {
        
$use_order_by $order_by;      
        }

    return 
ps_query("select " columns_in("research_request","r") . ",(select username from user u where u.ref=r.user) username, 
        (select username from user u where u.ref=r.assigned_to) assigned_username from research_request r 
        
$searchsql 
        order by 
$use_order_by $use_sort"$parameters);
    }

This article was last updated 24th May 2024 11:35 Europe/London time based on the source file dated 16th May 2024 18:10 Europe/London time.