action.php File Reference

perform various actions on a database record More...

Go to the source code of this file.

Variables

 $lang = (isset($_REQUEST['lang'])) ? $_REQUEST['lang'] : $lang_default
 $text = $text_multi[$lang]
 $buttons = $buttons_multi[$lang]
 $months = $months_multi[$lang]
 $valid_params
 $default_params
 $link = mysql_pconnect($dbhost, $dbuser, $dbpass)) or db_error_mysql()
 $q = "select * from persons where id='@id@'"
 $r = db_query_mysql($link, $q, array('@id@' => $_SESSION['id']))
 $status = $r[1]["status"]
 $f = $_SESSION["field"]
 $_SESSION ['cancelURL'] = $cancel
 $_SESSION ['finishURL'] = $finish
 $_SESSION [$k] = (isset($r[1][0])) ? $r[1][0] : ""
 $kw ['@id @'] = $_SESSION['id']
 $q
 $q
 $q
 $_SESSION ["action"] = "show"
 $_SESSION ["button"] = ""
 $q = "delete from addresses where person_id='@id@' ; "
 $_SESSION ["action"] = "show"
 $_SESSION ["button"] = ""
 $_SESSION ["button"] = ""
 $q = "UPDATE persons set status='old' where id='@id@'"
 $status = "old"
 $q = $fields['barcode']['update']
 $_SESSION ["force_submit"] = FALSE
else $_SESSION ["action"] = "submit-check"
 $table1
 HTML table templates for use with print_table().
 $table2
 $table3
 $table4
 $f = $_SESSION["field"]
 $q = $fields["notabene"]["view_query"]
 $r = db_query_mysql($link, $q, array('@id@' => $_SESSION['id']))
 $pica_id = (isset($r[1][0])) ? "[" . $r[1][0] . "]" : ""
 $url = "action.php?id=" . $_SESSION['id'] . "&action=show"
 $kw
 $kw = array( '@id@' => $_SESSION['id'], '@lang@' => $lang)
print< form > print $lang
print $_SESSION ["id"]
print $_SESSION ["action"]
print< strong > $text ['barcode']
nbsp
 print
print $buttons ['submit']
else print
 print
 print
print $buttons ['goto_index']
print $buttons ['edit']
 print
 print
print $text ['info_1']
print $text ['user_account_conflict']
print</tr > print</table
> print 
$text ['confirm_submit']
print $buttons ['ok']
print $buttons ['cancel']


Detailed Description

perform various actions on a database record

This script is part of the library staff's web frontend. It produces a detailed view of an applicant's personal record, and allows the staff to perform various actions, namely to:

Parameters:
action which action to perform ("show", "delete", ...)
id number of record on which to perform the action
field on which to perform the action (only for action="edit")
button whether the user pressed a submit button, and which one
value user input from a HTML form (e.g. while editing a record)
Examples of usage:

action.php?id=127&action=show
show record #127
action.php?id=127&action=edit&field=last_name
edit field 'last_name'
action.php?id=127&action=submit
submit record to PICA
action.php?id=127&action=print
print application form
action.php?id=127&action=delete
delete record

Definition in file action.php.


Variable Documentation

$table1

Initial value:

 array(
        array(  "label" => $fields['last_name']["label"],
                "query" => $fields['last_name']["view_query"]
             ),
        array(  "label" => $fields['first_name']["label"],
                "query" => $fields['first_name']["view_query"]
             ),
        array(  "label" => $fields['title']["label"],
                "query" => $fields['title']["view_query"]
             ),
        array(  "label" => $fields['sex']["label"],
                "query" => $fields['sex']["view_query"]
             )
)
HTML table templates for use with print_table().

The variables $table1 ... $table4 are templates for use in conjunction with print_table().

The format of the templates is as follows: Each sub-array describes a row in the table. The meaning of the elements in each sub-array is:

"label"
is a human-readable string describing the meaning of the field
"query"
is a SQL query which yields the value of the field

Definition at line 325 of file action.php.


Generated on Mon Aug 28 09:46:10 2006 for anmeldung by  doxygen 1.4.7