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