Thanks a lot velden!
Totally forgot about LISE's api
After fiddling around a bit, I came up with the following (test) UDT, where I retrieve different field values and filter/search on params values, that seems to work:
Code: Select all
$mod = cmsms()->GetModuleInstance('LISEyourinstancename');
$parms['pagelimit'] = 1000;
$parms['showall'] = true; // <- To disable time control queries
$parms['xs_issued'] = 1; // <- Filter/Search a field value
$item_query = new LISEItemQuery($mod, $parms);
$item_query->AppendTo(LISEQuery::VARTYPE_WHERE, 'A.active = 1');
$result = $item_query->Execute(true);
$items = array(); // Holds structured data
while ($result && $row = $result->FetchRow())
{
// Initialize an object
$obj = $mod->InitiateItem(array("item_id", "title", "email", "type", "return_date"));
LISEItemOperations::Load($mod, $obj, $row);
// Append to $items as an associative array
$items[] = array(
'title' => $obj->title,
'email' => $obj->email,
'type' => $obj->type,
'return_date' => $obj->return_date
);
}
// Access each row and its fields
foreach ($items as $item) {
echo "Title: " . $item['title'] . "<br>";
echo "Email: " . $item['email'] . "<br>";
echo "Type: " . $item['type'] . "<br>";
echo "Return Date: " . $item['return_date'] . "<br><br>";
}
Now I just need to have the code implemented in my mail script, where a user gets an email if they have not returned a borrowed item on the specified return date.