search.php
changeset 71 e1b918eaf69a
parent 62 ce4919f37489
child 79 0c0aa144356a
equal deleted inserted replaced
70:47248e2af079 71:e1b918eaf69a
    29 
    29 
    30 // we will continue after the search form ... 
    30 // we will continue after the search form ... 
    31 include_once('inc/header.inc.php');
    31 include_once('inc/header.inc.php');
    32 ?>
    32 ?>
    33 
    33 
    34     <h2><? echo _('Search zones or records'); ?></h2>
    34     <h2><?php echo _('Search zones or records'); ?></h2>
    35     <h3>Query</h3>
    35     <h3>Query</h3>
    36     <table>
    36     <table>
    37      <form method="post" action="<? echo $_SERVER['PHP_SELF']?>">
    37      <form method="post" action="<?php echo $_SERVER['PHP_SELF']?>">
    38       <tr>
    38       <tr>
    39        <td class="n"><? echo _('Enter a hostname or IP address'); ?></td>
    39        <td class="n"><?php echo _('Enter a hostname or IP address'); ?></td>
    40        <td class="n"><input type="text" class="input" name="q"></td>
    40        <td class="n"><input type="text" class="input" name="q"></td>
    41       </tr>
    41       </tr>
    42       <tr>
    42       <tr>
    43        <td class="n">&nbsp;</td>
    43        <td class="n">&nbsp;</td>
    44        <td class="n"><input type="submit" class="button" name="s_submit" value="<? echo _('Search'); ?>"></td>
    44        <td class="n"><input type="submit" class="button" name="s_submit" value="<?php echo _('Search'); ?>"></td>
    45       </tr>
    45       </tr>
    46      </form>
    46      </form>
    47     </table>
    47     </table>
    48       
    48       
    49 <?php
    49 <?php
    54 
    54 
    55   	// let's check if we found any domains ...
    55   	// let's check if we found any domains ...
    56 	if (count($search_result) == 2 && count($search_result['domains']))
    56 	if (count($search_result) == 2 && count($search_result['domains']))
    57   	{
    57   	{
    58 	?>
    58 	?>
    59 	<h4><? echo _('Zones found'); ?>:</h4>
    59 	<h4><?php echo _('Zones found'); ?>:</h4>
    60 	<table>
    60 	<table>
    61 	 <tr>
    61 	 <tr>
    62 	  <th>&nbsp;</th>
    62 	  <th>&nbsp;</th>
    63 	  <th><? echo _('Name'); ?></th>
    63 	  <th><?php echo _('Name'); ?></th>
    64 	  <th><? echo _('Records'); ?></th>
    64 	  <th><?php echo _('Records'); ?></th>
    65 	  <th><? echo _('Owner'); ?></th>
    65 	  <th><?php echo _('Owner'); ?></th>
    66          </tr>
    66          </tr>
    67 <?php
    67 <?php
    68 foreach($search_result['domains'] as $d)
    68 foreach($search_result['domains'] as $d)
    69 {
    69 {
    70 ?>
    70 ?>
    71          <tr>
    71          <tr>
    72 <?
    72 <?php
    73   if (level(5))
    73   if (level(5))
    74   {
    74   {
    75   ?>
    75   ?>
    76      <td class="n">
    76      <td class="n">
    77       <a href="edit.php?id=<? echo $d["id"] ?>"><img src="images/edit.gif" title="<? echo _('Edit zone') . " " . $d['name']; ?>" alt="[ <? echo _('Edit zone') . " " . $d['name']; ?> ]"></a>
    77       <a href="edit.php?id=<?php echo $d["id"] ?>"><img src="images/edit.gif" title="<?php echo _('Edit zone') . " " . $d['name']; ?>" alt="[ <?php echo _('Edit zone') . " " . $d['name']; ?> ]"></a>
    78       <a href="delete_domain.php?id=<? echo $d["id"] ?>"><img src="images/delete.gif" title="<? print _('Delete zone') . " " . $d['name']; ?>" alt="[<? echo _('Delete zone') . " " . $d['name']; ?>]"></a>
    78       <a href="delete_domain.php?id=<?php echo $d["id"] ?>"><img src="images/delete.gif" title="<?php print _('Delete zone') . " " . $d['name']; ?>" alt="[<?php echo _('Delete zone') . " " . $d['name']; ?>]"></a>
    79      </td>
    79      </td>
    80 <?
    80 <?php
    81 }
    81 }
    82 else
    82 else
    83 {
    83 {
    84 ?>
    84 ?>
    85      <td class="n">
    85      <td class="n">
    86       &nbsp;
    86       &nbsp;
    87      </td>
    87      </td>
    88 <?
    88 <?php
    89 }
    89 }
    90 ?>
    90 ?>
    91      <td class="y"><? echo $d['name']?></td>
    91      <td class="y"><?php echo $d['name']?></td>
    92      <td class="y"><? echo $d['numrec']?></td>
    92      <td class="y"><?php echo $d['numrec']?></td>
    93      <td class="y"><? echo get_owner_from_id($d['owner'])?></td>
    93      <td class="y"><?php echo get_owner_from_id($d['owner'])?></td>
    94     </tr>
    94     </tr>
    95 			<?php
    95 			<?php
    96 		} // end foreach ...
    96 		} // end foreach ...
    97 		?>
    97 		?>
    98 	</table>
    98 	</table>
   102 	
   102 	
   103 	// any records ?!
   103 	// any records ?!
   104 	if(count($search_result['records']))
   104 	if(count($search_result['records']))
   105 	{
   105 	{
   106 		?>
   106 		?>
   107 		<b><? echo _('Records found'); ?>:</b>
   107 		<b><?php echo _('Records found'); ?>:</b>
   108 		<p>
   108 		<p>
   109 		<table>
   109 		<table>
   110 			<tr>
   110 			<tr>
   111 				<td class="n">&nbsp;</td>
   111 				<td class="n">&nbsp;</td>
   112 				<td class="n"><? echo _('Name'); ?></td>
   112 				<td class="n"><?php echo _('Name'); ?></td>
   113 				<td class="n"><? echo _('Type'); ?></td>
   113 				<td class="n"><?php echo _('Type'); ?></td>
   114 				<td class="n"><? echo _('Content'); ?></td>
   114 				<td class="n"><?php echo _('Content'); ?></td>
   115 				<td class="n"><? echo _('Priority'); ?></td>
   115 				<td class="n"><?php echo _('Priority'); ?></td>
   116 				<td class="n"><? echo _('TTL'); ?></td>
   116 				<td class="n"><?php echo _('TTL'); ?></td>
   117 			</tr>
   117 			</tr>
   118 		<?php
   118 		<?php
   119 		foreach($search_result['records'] as $r)
   119 		foreach($search_result['records'] as $r)
   120 		{
   120 		{
   121 		?>
   121 		?>
   127 			  ($GLOBALS["ALLOW_NS_EDIT"] && $r["type"] == "NS") ||
   127 			  ($GLOBALS["ALLOW_NS_EDIT"] && $r["type"] == "NS") ||
   128 			  ($r["type"] == "NS" && get_name_from_record_id($r["id"]) != get_domain_name_from_id(recid_to_domid($r["id"])) && 
   128 			  ($r["type"] == "NS" && get_name_from_record_id($r["id"]) != get_domain_name_from_id(recid_to_domid($r["id"])) && 
   129 			  $GLOBALS["ALLOW_NS_EDIT"] != 1))
   129 			  $GLOBALS["ALLOW_NS_EDIT"] != 1))
   130 			{
   130 			{
   131 				?>
   131 				?>
   132 				<a href="edit_record.php?id=<? echo $r['id']?>&amp;domain=<? echo $r['domain_id']?>"><img src="images/edit.gif" alt="[ <? echo _('Edit record'); ?> ]" border="0"></a>
   132 				<a href="edit_record.php?id=<?php echo $r['id']?>&amp;domain=<?php echo $r['domain_id']?>"><img src="images/edit.gif" alt="[ <?php echo _('Edit record'); ?> ]" border="0"></a>
   133 				<a href="delete_record.php?id=<? echo $r['id']?>&amp;domain=<? echo $r['domain_id']?>"><img src="images/delete.gif" alt="[ <? echo _('Delete record'); ?> ]" border="0"></a>
   133 				<a href="delete_record.php?id=<?php echo $r['id']?>&amp;domain=<?php echo $r['domain_id']?>"><img src="images/delete.gif" alt="[ <?php echo _('Delete record'); ?> ]" border="0"></a>
   134 				<?php 
   134 				<?php 
   135 			} // big if ;-)
   135 			} // big if ;-)
   136 			?>
   136 			?>
   137 			</td>
   137 			</td>
   138 			<td class="y"><? echo $r['name']?></td>
   138 			<td class="y"><?php echo $r['name']?></td>
   139 			<td class="y"><? echo $r['type']?></td>
   139 			<td class="y"><?php echo $r['type']?></td>
   140 			<td class="y"><? echo $r['content']?></td>
   140 			<td class="y"><?php echo $r['content']?></td>
   141 			<?php
   141 			<?php
   142 			if ($r['prio'] != 0)
   142 			if ($r['prio'] != 0)
   143 			{
   143 			{
   144 				?><td class="y"><? echo $r['prio']?></td><?php
   144 				?><td class="y"><?php echo $r['prio']?></td><?php
   145 			}
   145 			}
   146 			else 
   146 			else 
   147 			{
   147 			{
   148 			?><td class="n"></td><?php
   148 			?><td class="n"></td><?php
   149 			} // else
   149 			} // else
   150 			?><td class="y"><? echo $r['ttl']?></td>
   150 			?><td class="y"><?php echo $r['ttl']?></td>
   151 			</tr>
   151 			</tr>
   152 			<?php
   152 			<?php
   153 		} // foreach
   153 		} // foreach
   154 	?>
   154 	?>
   155 	</table>
   155 	</table>
   159 	{
   159 	{
   160 	?>
   160 	?>
   161 		<table border="0" cellspacing="4">
   161 		<table border="0" cellspacing="4">
   162 			<tr>
   162 			<tr>
   163 				<td width="510" class="n">
   163 				<td width="510" class="n">
   164 				<? echo _('Nothing found for query'); ?> "<? echo $_POST['q']?>".
   164 				<?php echo _('Nothing found for query'); ?> "<?php echo $_POST['q']?>".
   165 				</td>
   165 				</td>
   166 			</tr>
   166 			</tr>
   167 		</table>
   167 		</table>
   168 	<?
   168 	<?php
   169 	}
   169 	}
   170 		
   170 		
   171 }
   171 }
   172 include_once('inc/footer.inc.php');
   172 include_once('inc/footer.inc.php');
   173 ?>
   173 ?>