Conditions | 5 |
Paths | 16 |
Total Lines | 47 |
Code Lines | 31 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php declare(strict_types=1); |
||
8 | function b_waiting_smartfaq() |
||
9 | { |
||
10 | /** @var \XoopsMySQLDatabase $xoopsDB */ |
||
11 | $xoopsDB = \XoopsDatabaseFactory::getDatabaseConnection(); |
||
12 | $ret = []; |
||
13 | |||
14 | // smartfaq submitted |
||
15 | $block = []; |
||
16 | $result = $xoopsDB->query('SELECT COUNT(*) FROM ' . $xoopsDB->prefix('smartfaq_faq') . ' WHERE status=4'); |
||
17 | if ($result) { |
||
18 | $block['adminlink'] = XOOPS_URL . '/modules/smartfaq/admin/index.php?statussel=4'; |
||
19 | [$block['pendingnum']] = $xoopsDB->fetchRow($result); |
||
|
|||
20 | $block['lang_linkname'] = _PI_WAITING_SUBMITTED; |
||
21 | } |
||
22 | $ret[] = $block; |
||
23 | |||
24 | // smartfaq asked |
||
25 | $block = []; |
||
26 | $result = $xoopsDB->query('SELECT COUNT(*) FROM ' . $xoopsDB->prefix('smartfaq_faq') . ' WHERE status=1'); |
||
27 | if ($result) { |
||
28 | $block['adminlink'] = XOOPS_URL . '/modules/smartfaq/admin/index.php?statussel=1'; |
||
29 | [$block['pendingnum']] = $xoopsDB->fetchRow($result); |
||
30 | $block['lang_linkname'] = _PI_WAITING_ASKED; |
||
31 | } |
||
32 | $ret[] = $block; |
||
33 | |||
34 | // smartfaq new answer |
||
35 | $block = []; |
||
36 | $result = $xoopsDB->query('SELECT COUNT(*) FROM ' . $xoopsDB->prefix('smartfaq_faq') . ' WHERE status=6'); |
||
37 | if ($result) { |
||
38 | $block['adminlink'] = XOOPS_URL . '/modules/smartfaq/admin/index.php?statussel=6'; |
||
39 | [$block['pendingnum']] = $xoopsDB->fetchRow($result); |
||
40 | $block['lang_linkname'] = _PI_WAITING_NEWANSWERS; |
||
41 | } |
||
42 | $ret[] = $block; |
||
43 | |||
44 | // smartfaq answered |
||
45 | $block = []; |
||
46 | $result = $xoopsDB->query('SELECT COUNT(*) FROM ' . $xoopsDB->prefix('smartfaq_faq') . ' WHERE status=3'); |
||
47 | if ($result) { |
||
48 | $block['adminlink'] = XOOPS_URL . '/modules/smartfaq/admin/index.php?statussel=3'; |
||
49 | [$block['pendingnum']] = $xoopsDB->fetchRow($result); |
||
50 | $block['lang_linkname'] = _PI_WAITING_ANSWERED; |
||
51 | } |
||
52 | $ret[] = $block; |
||
53 | |||
54 | return $ret; |
||
55 | } |
||
56 |