- /*
- //todo: convert q() to DBA::Select()
- $statement = DBA::Select('`queue` AS `q`, `contact` AS `c`',
- [ '`c`.`name`', '`c`.`nurl`', '`q`.`id`', '`q`.`network`', "CONVERT_TZ(`q`.`created`, 'UTC' " . Config::get('system', 'default_timezone') . ') as created', "CONVERT_TZ(`q`.`last`, 'UTC', " . Config::get('system', 'default_timezone') . "') as last" ],
- '`c`.`id`' => '`q`.`cid`',
- ['order'=> ['`q`.`cid`, `q`.`created`']]
- );
- $r = DBA::toArray($statement);
- */
-
- $r = q("SELECT `c`.`name`, `c`.`nurl`, `q`.`id`, `q`.`network`, `q`.`created`, `q`.`last`
- FROM `queue` AS `q`, `contact` AS `c`
- WHERE `c`.`id` = `q`.`cid`
- ORDER BY `q`.`cid`, `q`.`created`;");
+ $entries = DBA::p("SELECT `contact`.`name`, `contact`.`nurl`,
+ `queue`.`id`, `queue`.`network`, `queue`.`created`, `queue`.`last`
+ FROM `queue` INNER JOIN `contact` ON `contact`.`id` = `queue`.`cid`
+ ORDER BY `queue`.`cid`, `queue`.`created`");