Collections functions
Encryption functions
General functions
Render functions
Theme permission functions
Video functions
Resource functions

get_user_requests()

Description

Fetch a list of all requests for a user

Parameters

ColumnTypeDefaultDescription
$excludecompleted boolean false Exclude requests that have already been completed
$returnsql mixed false Return the SQL for the execution rather than the results

Return

void

Location

include/request_functions.php lines 31 to 37

Definition

 
function get_user_requests($excludecompleted=false,$returnsql=false)
    {
    global 
$userref;
    if (!
is_numeric($userref)){ return false; }
    
$sql="select u.username,u.fullname,r.*,if(collection.ref is null,'0',collection.ref) collection_id, (select count(*) from collection_resource cr where cr.collection=r.collection) c from request r left outer join user u on r.user=u.ref left join collection on r.collection = collection.ref where r.user = '" $userref "'" . ($excludecompleted?" AND status<>2":"") . " order by ref desc";
    return 
$returnsql?$sql:sql_query($sql);
    }

This article was last updated 30th November 2020 16:05 Europe/London time based on the source file dated 28th September 2020 10:05 Europe/London time.