I managed to get this working by doing the following:
After Line 221:
$temp_values = $values;
After line 248, just before the unset:
// Now add auto blackout
if ( !$res->is_blackout )
{
$end = $res->get_end() + 15;
$newid = $this->get_new_id();
$temp_values[0] = $newid;
$temp_values[5] = $res->get_end();
$temp_values[6] = $end;
$temp_values[10] = 1;
$query = 'INSERT INTO ' . $this->get_table(TBL_RESERVATIONS) . ' VALUES(?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)';
$q = $this->db->prepare($query);
$result = $this->db->execute($q, $temp_values);
$this->check_for_error($result);
// Insert the user participation data
$values = null;
$values[] = array($newid, $res->get_memberid(), 1, 0, 1, 1, null);
$query = 'INSERT INTO ' . $this->get_table(TBL_RESERVATION_USERS) . ' VALUES(?,?,?,?,?,?,?)';
$q = $this->db->prepare($query);
$result = $this->db->executeMultiple($q, $values);
$this->check_for_error($result);
}