email.php File Reference

display a list of e-mails sent to customer More...

Go to the source code of this file.

Functions

 view_email ($smarty, $INPUT, $db)
 display e-mail messages


Detailed Description

display a list of e-mails sent to customer

Definition in file email.php.


Function Documentation

view_email ( smarty,
INPUT,
db 
)

display e-mail messages

This function displays all e-mails that have been sent to the customer (i.e. professor) via the "send an email" functionality.

(Library staff can send an e-mail message to the professor who has ordered a document for his/her document collection.)

Parameters:
$smarty -- Smarty template engine handle
$INPUT['document_id'] -- Only show e-mails related to this document
$db -- MySQL database handle

Definition at line 26 of file email.php.

References $validation_info, check_input(), do_template(), and sql_query().

00026                                           {
00027 
00028 global $_SESSION, $validation_info;
00029 
00030 $defaults = array (
00031 );      
00032 
00033 ## check user input 
00034 
00035 # $INPUT = array_merge($defaults, $_GET, $_POST);
00036 
00037 $INPUT = array_merge($defaults, $INPUT);
00038 $errors = check_input($INPUT, $validation_info); 
00039 
00040 if ($debug_level > 10) {
00041          print "<hr><pre>Input: ";
00042         print_r($INPUT);
00043         print "</pre><hr>";
00044 }
00045 
00046 if (!empty($errors)) {
00047         user_error("Missing or malformed input parameter(s): " . join($errors, ", "),
00048                 E_USER_ERROR); 
00049 }
00050 
00051 
00052 $sql_param = array ( 
00053         "table" => "email", 
00054         "tables" => "email,user,degree", 
00055         "cond" => "degree.id = user.degree_id AND user.id = email.user_id AND email.document_id = " . $INPUT['document_id'], 
00056         "columns" => "email.*,user.surname,user.forename,user.sex,degree.description AS degree_description",
00057         "order" => "email.created DESC",
00058 );
00059 
00060 
00061 $tpl_vars = $INPUT;
00062 $tpl_vars['email']  = sql_query('select', $sql_param, $db);
00063 
00064 do_template($smarty, 'email.tpl', $tpl_vars);
00065 exit(0);
00066 
00067 }

Here is the call graph for this function:


Generated on Fri Jul 14 17:38:57 2006 for semapp by  doxygen 1.4.7