search.php
changeset 2 9a485c41cfcf
parent 1 58094faf794d
child 3 64525a2eb098
equal deleted inserted replaced
1:58094faf794d 2:9a485c41cfcf
    33 
    33 
    34 
    34 
    35 // we will continue after the search form ... 
    35 // we will continue after the search form ... 
    36 include_once('inc/header.inc.php');
    36 include_once('inc/header.inc.php');
    37 ?>
    37 ?>
    38 <P><H2>Search zones or records</H2></P>
    38 <P><H2><? echo _('Search zones or records'); ?></H2></P>
    39 <P CLASS="nav">
    39 <P CLASS="nav">
    40 <A HREF="index.php">DNS Admin</A> 
    40 <A HREF="index.php"><? echo _('DNS Admin'); ?></A> 
    41 <?
    41 <?
    42 if (level(10))
    42 if (level(10))
    43 {
    43 {
    44 	?><A HREF="users.php">User Admin</A> <A HREF="seq_update.php">Synchronize Database</A><?
    44 	?><A HREF="users.php"><? echo _('User Admin'); ?></A> <A HREF="seq_update.php"><? echo _('Synchronize Database'); ?></A><?
    45 }
    45 }
    46 ?>
    46 ?>
    47 </P><BR>
    47 </P><BR>
    48 Type a hostname or a record in the box below and press search to see if the record exists in the system.
    48 <? echo _('Type a hostname or a record in the box below and press search to see if the record exists in the system.'); ?>
    49 	<table border = "0" cellspacing = "4">
    49 	<table border = "0" cellspacing = "4">
    50 	<form method = "post" action="<?=$_SERVER['PHP_SELF']?>">
    50 	<form method = "post" action="<?=$_SERVER['PHP_SELF']?>">
    51 		<tr>
    51 		<tr>
    52 			<td class = "tdbg"><b>Enter a hostname or IP address</b></td>
    52 			<td class = "tdbg"><b><? echo _('Enter a hostname or IP address'); ?></b></td>
    53 			<td width = "510" class = "tdbg"><input type = "text" class = "input" name = "q"></td>
    53 			<td width = "510" class = "tdbg"><input type = "text" class = "input" name = "q"></td>
    54 		</tr>
    54 		</tr>
    55 		<tr>
    55 		<tr>
    56 			<td class = "tdbg">&nbsp;</td>
    56 			<td class = "tdbg">&nbsp;</td>
    57 			<td class = "tdbg"><input type = "submit" class = "button" name = "s_submit" value = "Search"></td>
    57 			<td class = "tdbg"><input type = "submit" class = "button" name = "s_submit" value = "<? echo _('Search'); ?>"></td>
    58 		</tr>
    58 		</tr>
    59 	</form>
    59 	</form>
    60 	</table>
    60 	</table>
    61 
    61 
    62 
    62 
    68 
    68 
    69   	// let's check if we found any domains ...
    69   	// let's check if we found any domains ...
    70 	if (count($search_result) == 2 && count($search_result['domains']))
    70 	if (count($search_result) == 2 && count($search_result['domains']))
    71   	{
    71   	{
    72 	?>
    72 	?>
    73 	<b>Domains found:</b>
    73 	<b><? echo _('Domains found'); ?>:</b>
    74 	<p>
    74 	<p>
    75 	<table border = "0" cellspacing = "4">
    75 	<table border = "0" cellspacing = "4">
    76 		<tr style = "font-weight: Bold;">
    76 		<tr style = "font-weight: Bold;">
    77 			<td class = "tdbg">&nbsp;</td>
    77 			<td class = "tdbg">&nbsp;</td>
    78 			<td class = "tdbg">Name</td>
    78 			<td class = "tdbg"><? echo _('Name'); ?></td>
    79 			<td class = "tdbg">Records</td>
    79 			<td class = "tdbg"><? echo _('Records'); ?></td>
    80 			<td class = "tdbg">Owner</td>
    80 			<td class = "tdbg"><? echo _('Owner'); ?></td>
    81 		</tr>
    81 		</tr>
    82 		<?php
    82 		<?php
    83 		foreach($search_result['domains'] as $d)
    83 		foreach($search_result['domains'] as $d)
    84 		{
    84 		{
    85 			?>	
    85 			?>	
    86 			<tr>
    86 			<tr>
    87 			<td class = "tdbg">
    87 			<td class = "tdbg">
    88 			<?php 
    88 			<?php 
    89 			if (level(5))
    89 			if (level(5))
    90 			{
    90 			{
    91 				echo '<a href = "delete_domain.php?id='.$d['id'].'"><img src = "images/delete.gif" alt = "[ delete zone ]" border = "0"></a>';
    91 				echo '<a href = "delete_domain.php?id='.$d['id'].'"><img src = "images/delete.gif" alt = "[ ' .  _('delete zone') . ' ]" border = "0"></a>';
    92 			}
    92 			}
    93 			else 
    93 			else 
    94 			{
    94 			{
    95 				echo '&nbsp;';
    95 				echo '&nbsp;';
    96 			}
    96 			}
   111 	
   111 	
   112 	// any records ?!
   112 	// any records ?!
   113 	if(count($search_result['records']))
   113 	if(count($search_result['records']))
   114 	{
   114 	{
   115 		?>
   115 		?>
   116 		<b>Records found:</b>
   116 		<b><? echo _('Records found'); ?>:</b>
   117 		<p>
   117 		<p>
   118 		<table border = "0" cellspacing = "4">
   118 		<table border = "0" cellspacing = "4">
   119 			<tr style = "font-weight: Bold;">
   119 			<tr style = "font-weight: Bold;">
   120 				<td class = "tdbg">&nbsp;</td>
   120 				<td class = "tdbg">&nbsp;</td>
   121 				<td class = "tdbg">Name</td>
   121 				<td class = "tdbg"><? echo _('Name'); ?></td>
   122 				<td class = "tdbg">Type</td>
   122 				<td class = "tdbg"><? echo _('Type'); ?></td>
   123 				<td class = "tdbg">Content</td>
   123 				<td class = "tdbg"><? echo _('Content'); ?></td>
   124 				<td class = "tdbg">Priority</td>
   124 				<td class = "tdbg"><? echo _('Priority'); ?></td>
   125 				<td class = "tdbg">TTL</td>
   125 				<td class = "tdbg"><? echo _('TTL'); ?></td>
   126 			</tr>
   126 			</tr>
   127 		<?php
   127 		<?php
   128 		foreach($search_result['records'] as $r)
   128 		foreach($search_result['records'] as $r)
   129 		{
   129 		{
   130 		?>
   130 		?>
   136 			  ($GLOBALS["ALLOW_NS_EDIT"] && $r["type"] == "NS") ||
   136 			  ($GLOBALS["ALLOW_NS_EDIT"] && $r["type"] == "NS") ||
   137 			  ($r["type"] == "NS" && get_name_from_record_id($r["id"]) != get_domain_name_from_id(recid_to_domid($r["id"])) && 
   137 			  ($r["type"] == "NS" && get_name_from_record_id($r["id"]) != get_domain_name_from_id(recid_to_domid($r["id"])) && 
   138 			  $GLOBALS["ALLOW_NS_EDIT"] != 1))
   138 			  $GLOBALS["ALLOW_NS_EDIT"] != 1))
   139 			{
   139 			{
   140 				?>
   140 				?>
   141 				<a href = "edit_record.php?id=<?=$r['id']?>&amp;domain=<?=$r['domain_id']?>"><img src = "images/edit.gif" alt = "[ edit record ]" border = "0"></a>
   141 				<a href = "edit_record.php?id=<?=$r['id']?>&amp;domain=<?=$r['domain_id']?>"><img src = "images/edit.gif" alt = "[ <? echo _('edit record'); ?> ]" border = "0"></a>
   142 				<a href = "delete_record.php?id=<?=$r['id']?>&amp;domain=<?=$r['domain_id']?>"><img src = "images/delete.gif" alt = "[ delete record ]" border = "0"></a>
   142 				<a href = "delete_record.php?id=<?=$r['id']?>&amp;domain=<?=$r['domain_id']?>"><img src = "images/delete.gif" alt = "[ <? echo _('delete record'); ?> ]" border = "0"></a>
   143 				<?php 
   143 				<?php 
   144 			} // big if ;-)
   144 			} // big if ;-)
   145 			?>
   145 			?>
   146 			</td>
   146 			</td>
   147 			<td style = "border: 1px solid #000000;"><?=$r['name']?></td>
   147 			<td style = "border: 1px solid #000000;"><?=$r['name']?></td>
   168 	{
   168 	{
   169 	?>
   169 	?>
   170 		<table border = "0" cellspacing = "4">
   170 		<table border = "0" cellspacing = "4">
   171 			<tr>
   171 			<tr>
   172 				<td width = "510" class = "tdbg">
   172 				<td width = "510" class = "tdbg">
   173 				Nothing found for query "<?=$_POST['q']?>"
   173 				<? echo _('Nothing found for query'); ?> "<?=$_POST['q']?>"
   174 				</td>
   174 				</td>
   175 			</tr>
   175 			</tr>
   176 		</table>
   176 		</table>
   177 	<?
   177 	<?
   178 	}
   178 	}