equal
deleted
inserted
replaced
1 <? |
1 <? |
2 session_start(); |
2 session_start(); |
3 // +--------------------------------------------------------------------+ |
|
4 // | PowerAdmin | |
|
5 // +--------------------------------------------------------------------+ |
|
6 // | Copyright (c) 1997-2002 The PowerAdmin Team | |
|
7 // +--------------------------------------------------------------------+ |
|
8 // | This source file is subject to the license carried by the overal | |
|
9 // | program PowerAdmin as found on http://poweradmin.sf.net | |
|
10 // | The PowerAdmin program falls under the QPL License: | |
|
11 // | http://www.trolltech.com/developer/licensing/qpl.html | |
|
12 // +--------------------------------------------------------------------+ |
|
13 // | Authors: Roeland Nieuwenhuis <trancer <AT> trancer <DOT> nl> | |
|
14 // | Sjeemz <sjeemz <AT> sjeemz <DOT> nl> | |
|
15 // +--------------------------------------------------------------------+ |
|
16 |
|
17 // Filename: toolkit.inc.php |
|
18 // Startdate: 26-10-2002 |
|
19 // Description: general functions needed on a large variety of locations. |
|
20 // Kills the db.inc.php. |
|
21 // If you include this file you include the whole 'backend' |
|
22 // |
|
23 // $Id: toolkit.inc.php,v 1.13 2003/02/24 01:46:31 azurazu Exp $ |
|
24 // |
|
25 |
3 |
26 /************* |
4 /************* |
27 * Constants * |
5 * Constants * |
28 *************/ |
6 *************/ |
29 |
7 |
62 /* Database connection */ |
40 /* Database connection */ |
63 |
41 |
64 require_once("database.inc.php"); |
42 require_once("database.inc.php"); |
65 // Generates $db variable to access database. |
43 // Generates $db variable to access database. |
66 |
44 |
|
45 |
|
46 // Array of the available zone types |
|
47 $server_types = array("MASTER", "SLAVE", "NATIVE"); |
|
48 |
|
49 |
67 /************* |
50 /************* |
68 * Includes * |
51 * Includes * |
69 *************/ |
52 *************/ |
70 |
53 |
71 require_once("error.inc.php"); |
54 require_once("error.inc.php"); |
86 |
69 |
87 function show_pages($amount,$rowamount,$id='') |
70 function show_pages($amount,$rowamount,$id='') |
88 { |
71 { |
89 if ($amount > $rowamount) { |
72 if ($amount > $rowamount) { |
90 if (!isset($_GET["start"])) $_GET["start"]=1; |
73 if (!isset($_GET["start"])) $_GET["start"]=1; |
91 echo "<br /><br />" . _('Show page') . " "; |
74 echo _('Show page') . "<br>"; |
92 for ($i=1;$i<=ceil($amount / $rowamount);$i++) { |
75 for ($i=1;$i<=ceil($amount / $rowamount);$i++) { |
93 if ($_GET["start"] == $i) { |
76 if ($_GET["start"] == $i) { |
94 echo "[ <b>".$i."</b> ] "; |
77 echo "[ <b>".$i."</b> ] "; |
95 } else { |
78 } else { |
96 echo "[ <a href=\"".$_SERVER["PHP_SELF"]."?start=".$i; |
79 echo "[ <a href=\"".$_SERVER["PHP_SELF"]."?start=".$i; |
97 if ($id!='') echo "&id=".$id; |
80 if ($id!='') echo "&id=".$id; |
98 echo "\">".$i."</a> ] "; |
81 echo "\">".$i."</a> ] "; |
99 } |
82 } |
100 } |
83 } |
101 echo "</small>"; |
|
102 } |
84 } |
103 } |
85 } |
104 |
86 |
105 /* |
87 /* |
106 * Display the alphabetic option: [0-9] [a] [b] .. [z] |
88 * Display the alphabetic option: [0-9] [a] [b] .. [z] |
114 } else { |
96 } else { |
115 $letter_taken[$dom["name"][0]] = 1; |
97 $letter_taken[$dom["name"][0]] = 1; |
116 } |
98 } |
117 } |
99 } |
118 |
100 |
119 echo _('Show domains beginning with:') . "<br />"; |
101 echo _('Show zones beginning with:') . "<br>"; |
120 if ($letterstart == 1) { |
102 if ($letterstart == 1) { |
121 echo "[ <b>0-9</b> ] "; |
103 echo "[ <b>0-9</b> ] "; |
122 } elseif ($letter_taken["0"] != 1) { |
104 } elseif ($letter_taken["0"] != 1) { |
123 echo "[ 0-9 ] "; |
105 echo "[ 0-9 ] "; |
124 } else { |
106 } else { |
125 echo "[ <a href=\"".$_SERVER["PHP_SELF"]."?letter=1\">0-9</a> ] "; |
107 echo "[ <a href=\"".$_SERVER["PHP_SELF"]."?letter=1\">0-9</a> ] "; |
126 } |
108 } |
127 |
109 |
128 foreach (range('a','z') as $letter) { |
110 foreach (range('a','z') as $letter) { |
129 if ($letterstart === $letter) { |
111 if ($letterstart === $letter) { |
130 echo "[ <b>".$letter."</b> ] "; |
112 echo "[ <span class=\"lettertaken\">".$letter."</span> ] "; |
131 } elseif ($letter_taken[$letter] != 1) { |
113 } elseif ($letter_taken[$letter] != 1) { |
132 echo "[ <span style=\"color:#999\">".$letter."</span> ] "; |
114 echo "[ <span class=\"letternotavailble\">".$letter."</span> ] "; |
133 } else { |
115 } else { |
134 echo "[ <a href=\"".$_SERVER["PHP_SELF"]."?letter=".$letter."\">".$letter."</a> ] "; |
116 echo "[ <a href=\"".$_SERVER["PHP_SELF"]."?letter=".$letter."\">".$letter."</a> ] "; |
135 } |
117 } |
136 } |
118 } |
137 } |
119 } |
144 // General function for printing critical errors. |
126 // General function for printing critical errors. |
145 if ($msg) |
127 if ($msg) |
146 { |
128 { |
147 include_once("header.inc.php"); |
129 include_once("header.inc.php"); |
148 ?> |
130 ?> |
149 <P><TABLE CLASS="error"><TR><TD CLASS="error"><H2><? echo _('Oops! An error occured!'); ?></H2> |
131 <p><? echo _('Oops! An error occured!'); ?></p> |
150 <BR> |
132 <p><? echo nl2br($msg) ?></p> |
151 <FONT STYLE="font-weight: Bold"><?= nl2br($msg) ?><BR><BR><a href="javascript:history.go(-1)"><< <? echo _('back'); ?></a></FONT><BR></TD></TR></TABLE></P> |
|
152 <? |
133 <? |
153 include_once("footer.inc.php"); |
134 include_once("footer.inc.php"); |
154 die(); |
135 die(); |
155 } |
136 } |
156 else |
137 else |