+addMenuDescription('member', __FILE__);
+
+// Init output
+$main_content = array();
+
+// Load waiting/pending orders
+$result = SQL_QUERY_ESC("SELECT
+ `id`, `cat_id`, `payment_id`, `subject`, `url`, `timestamp`, `target_send`, `data_type`, `zip`
+FROM
+ `{?_MYSQL_PREFIX?}_pool`
+WHERE
+ `sender`=%s AND `data_type` != 'SEND'
+ORDER BY
+ `timestamp` DESC",
+ array(getMemberId()), __FILE__, __LINE__);
+
+// Are there mails left in pool?
+if (SQL_NUMROWS($result) > 0) {
+ // Load all orders
+ $OUT = ''; $SW = 2;
+ while ($data = SQL_FETCHARRAY($result)) {
+ // Is the ZIP code set? If not, set dashes
+ if (empty($data['zip'])) $data['zip'] = '---';
+
+ // Prepare content for output
+ $content = array(
+ 'sw' => $SW,
+ 'id' => $data['id'],
+ 'cat' => getCategory($data['cat_id']),
+ 'pay' => getPaymentTitlePrice($data['payment_id']),
+ 'subject' => $data['subject'],
+ 'url' => generateDerefererUrl($data['url']),
+ 'timestamp' => generateDateTime($data['timestamp'], 2),
+ 'target_send' => $data['target_send'],
+ 'type' => translatePoolType($data['data_type']),
+ 'zip' => $data['zip']
+ );
+
+ // Load template
+ $OUT .= loadTemplate('member_pool_row', true, $content);
+
+ // Switch color
+ $SW = 3 - $SW;
+ } // END - if
+
+ // Load main template
+ $main_content['pool'] = loadTemplate('member_pool_table', true, $OUT);
+} else {
+ // No mails in pool!
+ $main_content['pool'] = loadTemplate('admin_settings_saved', true, getMessage('MEMBER_NO_MAILS_IN_POOL'));
+}
+
+// Free result
+SQL_FREERESULT($result);