r1834 + use POST to add multiple objects
[racktables] / index.php
1 <?php
2
3 require 'inc/init.php';
4 authorize();
5
6 echo '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">'."\n";
7 echo '<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">'."\n";
8 echo '<head><title>' . getTitle ($pageno, $tabno) . "</title>\n";
9 echo '<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />';
10 echo "<link rel=stylesheet type='text/css' href=pi.css />\n";
11 echo "<link rel=icon href='" . getFaviconURL() . "' type='image/x-icon' />";
12 echo "<style type='text/css'>\n";
13 // Print style information
14 foreach (array ('F', 'A', 'U', 'T', 'Th', 'Tw', 'Thw') as $statecode)
15 {
16 echo "td.state_${statecode} {\n";
17 echo "\ttext-align: center;\n";
18 echo "\tbackground-color: #" . (getConfigVar ('color_' . $statecode)) . ";\n";
19 echo "\tfont: bold 10px Verdana, sans-serif;\n";
20 echo "}\n\n";
21 }
22 ?>
23 .validation-error {
24 border:1px solid red;
25 }
26
27 .validation-success {
28 border:1px solid green;
29 }
30 </style>
31 <script language='javascript' type='text/javascript' src='js/live_validation.js'></script>
32 <script type="text/javascript">
33 function init() {
34 document.add_new_range.range.setAttribute('match', "^\\d\\d?\\d?\\.\\d\\d?\\d?\\.\\d\\d?\\d?\\.\\d\\d?\\d?\\/\\d\\d?$");
35
36 Validate.init();
37 }
38 window.onload=init;
39 </script>
40 </head>
41 <body>
42 <table border=0 cellpadding=0 cellspacing=0 width='100%' height='100%' class=maintable>
43 <tr class=mainheader>
44 <td colspan=2>
45 <table width='100%' cellspacing=0 cellpadding=2 border=0>
46 <tr>
47 <td valign=top><a href='http://racktables.org/'><?php printImageHREF ('logo'); ?></a></td>
48 <td valign=top><div class=greeting><?php printGreeting(); ?></div></td>
49 </tr>
50 </table>
51 </td>
52 </tr>
53
54 <tr>
55 <td class="menubar" colspan=2>
56 <table border="0" width="100%" cellpadding="3" cellspacing="0">
57 <tr>
58 <?php showPathAndSearch ($pageno); ?>
59 </tr>
60 </table>
61 </td>
62 </tr>
63
64 <tr>
65 <?php
66 showTabs ($pageno, $tabno);
67 ?>
68 </tr>
69
70 <tr>
71 <td colspan=2>
72 <?php
73 if (isset ($tabhandler[$pageno][$tabno]))
74 {
75 if (isset ($page[$pageno]['bypass']) && isset ($page[$pageno]['bypass_type']))
76 {
77 switch ($page[$pageno]['bypass_type'])
78 {
79 case 'uint':
80 assertUIntArg ($page[$pageno]['bypass']);
81 break;
82 default:
83 showError ("Dispatching error for bypass parameter");
84 break;
85 }
86 $tabhandler[$pageno][$tabno] ($_REQUEST[$page[$pageno]['bypass']]);
87 }
88 else
89 $tabhandler[$pageno][$tabno] ();
90 }
91 elseif (isset ($page[$pageno]['handler']))
92 $page[$pageno]['handler'] ($tabno);
93 else
94 showError ("Failed to find handler for page '${pageno}', tab '${tabno}'");
95 ?>
96 </td>
97 </tr>
98 </table>
99 </body>
100 </html>