1 |
<? |
2 |
|
3 |
$opts = array(); |
4 |
$url = array(); |
5 |
|
6 |
include_once( "global.inc" ); |
7 |
|
8 |
$params["editlink"] = "$PHP_SELF?what=edit"; |
9 |
$params["newlink"] = "$PHP_SELF?what=new"; |
10 |
$params["addmultiplelink"] = "$PHP_SELF?what=multi"; |
11 |
|
12 |
$url["home"] = "$PHP_SELF"; |
13 |
|
14 |
function html_before_form() |
15 |
{ |
16 |
?> |
17 |
<HTML> |
18 |
<HEAD> |
19 |
<link rel="stylesheet" type="text/css" href="styles.css"> |
20 |
</HEAD> |
21 |
<BODY bgcolor="#FFFFFF"> |
22 |
<? |
23 |
} |
24 |
function html_after_form() |
25 |
{ |
26 |
?> |
27 |
</BODY> |
28 |
</HTML> |
29 |
<? |
30 |
} |
31 |
|
32 |
if ($what=="edit" || $what=="new" || $REQUEST_METHOD == "POST" || isset($ph_action)) { |
33 |
|
34 |
include_once( "$phormationdir/form.php" ); |
35 |
include_once( "$phormationdir/file_upload.php" ); |
36 |
|
37 |
form_main( "$table", $params["key"], $fields, $names, $types, $record_id, $url, $opts ); |
38 |
|
39 |
} elseif ($what=="multi") { |
40 |
|
41 |
include_once( "$phormationdir/form.php" ); |
42 |
include_once( "$phormationdir/multiform.php" ); |
43 |
include_once( "$phormationdir/file_upload.php" ); |
44 |
|
45 |
if( empty( $numforms ) ) { |
46 |
$numforms = 2; |
47 |
} |
48 |
|
49 |
$opts["maxforms"] = 10; |
50 |
$opts["numforms_prompt"] = "Select the number of records to create:"; |
51 |
$opts["item_heading"] = "Multiple edit"; |
52 |
|
53 |
multiform_main( "$table", $params["key"], $fields, $names, $types, $record_id, $url, $opts, $numforms ); |
54 |
|
55 |
} else { |
56 |
include_once( "$phormationdir/displaytable.php" ); |
57 |
table_index( $fields, $names, $params ); |
58 |
} |
59 |
|
60 |
?> |