getAuthData('id'); $punches = new DB_DataObject_punch(); $where = "uid = '" . $uid . "'"; $having = ''; if ($_GET['tag']) { $having .= " HAVING FIND_IN_SET('" . addslashes($_GET['tag']) . "', tags)"; } $punches->query("SELECT punch.id,start,end,uid,GROUP_CONCAT(tag ORDER BY tag SEPARATOR \",\") as tags FROM {$punches->__table} INNER JOIN freetagged_objects AS f_rel ON f_rel.object_id = punch.id INNER JOIN freetags AS f ON f.id = f_rel.tag_id WHERE $where GROUP by punch.id $having;"); $tpl->assignRef('punches', $punches); $tpl->assign('title', "Punch list"); $tpl->assign('uid', $uid); $tpl->assignRef('freetag', $freetag); $tpl->display('index.tpl.php'); if ($tpl->isError($result)) { echo "There was an error displaying the template.
"; print_r($result); echo ""; } ?>