$acc) { $accOptions .= ''; } print '

Show Submissions

'; $q = "SELECT `topicname`, `short`, COUNT(*) AS `num` FROM `" . OCC_TABLE_TOPIC . "`, `" . OCC_TABLE_PAPERTOPIC . "`, `" . OCC_TABLE_PAPER . "` WHERE `" . OCC_TABLE_TOPIC . "`.`topicid`=`" . OCC_TABLE_PAPERTOPIC . "`.`topicid` AND `" . OCC_TABLE_PAPERTOPIC . "`.`paperid`=`" . OCC_TABLE_PAPER . "`.`paperid` $accSQL GROUP BY `" . OCC_TABLE_TOPIC . "`.`topicid` ORDER BY "; if (!isset($_REQUEST['s']) || ($_REQUEST['s']=="topicname")) { $q .= "`topicname`"; $tsort = 'Topic
' . $OC_sortImg; $nsort = 'Count'; } else { $q .= "`num`"; $nsort = 'Count
' . $OC_sortImg; $tsort = 'Topic'; } $r = ocsql_query($q) or err('Unable to get information'); if (ocsql_num_rows($r) == 0) { print 'No submissions available

'; } else { print ''; $row = 1; while ($l = ocsql_fetch_array($r)) { print '\n"; if ($row==1) { $row=2; } else { $row=1; } } print "
' . $tsort . '' . $nsort .'
' . safeHTMLstr(useTopic($l['short'],$l['topicname'])) . '' . $l['num'] . "
"; } printFooter(); ?>