getMemberId()
), __FILE__, __LINE__);
- // Do we enougth receivers left?
+ // Are there still receivers left?
if (SQL_NUMROWS($result) >= postRequestElement('receiver')) {
// Load receivers from database
$TEST = array(); $count = '0';
bigintval(postRequestElement('zip'), true, false),
), __FILE__, __LINE__);
}
+
+ // Get insert id
+ $id = SQL_INSERTID();
} else {
// Change current order
if (isExtensionActive('html_mail')) {
}
}
- // Do we need to get the id number?
- if ($id == '0') {
- // Order is placed as temporary. We need to get it's id for the frametester
- $result = SQL_QUERY_ESC("SELECT `id` FROM `{?_MYSQL_PREFIX?}_pool` WHERE `sender`=%s AND `subject`='%s' AND `payment_id`=%s AND `data_type`='TEMP' AND `timestamp`=UNIX_TIMESTAMP() LIMIT 1",
- array(
- getMemberId(),
- postRequestElement('subject'),
- bigintval(postRequestElement('mail_type'))
- ), __FILE__, __LINE__);
-
- // Get pool id
- list($id) = SQL_FETCHROW($result);
-
- // Free result
- SQL_FREERESULT($result);
- } // END - if
+ // Make sure only valid id numbers can pass
+ assert((!is_bool($id)) && ($id > 0));
- // id is received so we can redirect the user, used points will be added when he send's out the mail
+ // Id is received so we can redirect the user, used points will be added when he send's out the mail
$url = 'modules.php?module=frametester&order=' . $id;
} elseif ($content['target_send'] == '0') {
// Not enougth receivers found which can receive mails