table = $table; $this->id = $id; $this->title = $title; $this->subject = $subject; $this->message = $message; } function selectEmailPrint($emailFields, $columns) { if ($emailFields) { print_fieldset("email", ('E-mail')); echo "
\n"; echo script("qsl('div').onkeydown = partial(bodyKeydown, 'email');"); echo "

" . ('From') . ": \n"; echo ('Subject') . ": \n"; echo "

" . ('Attachments') . ": "; echo script("qsl('input').onchange = function () { this.onchange = function () { }; var el = this.cloneNode(true); el.value = ''; this.parentNode.appendChild(el); };"); echo "

" . (count($emailFields) == 1 ? '' : html_select("email_field", $emailFields)); echo "" . confirm(); echo "

\n"; echo "\n"; return true; } } function selectEmailProcess($where, $foreignKeys) { $connection = connection(); if ($_POST["email_id"]) { $result = $connection->query("SELECT $this->subject, $this->message FROM $this->table WHERE $this->id = " . q($_POST["email_id"])); $row = $result->fetch_row(); $_POST["email_subject"] = $row[0]; $_POST["email_message"] = $row[1]; } } }