root/modules/branches/2.8/dundicheck/page.dundicheck.php

Revision 6053, 2.7 kB (checked in by p_lindheimer, 5 years ago)

#2918 add dundicheck module to 2.5

Line 
1 <?php /* $Id: page.ringgroups.php 5340 2007-12-04 19:10:53Z p_lindheimer $ */
2 //Copyright (C) 2008 Astrogen LLC (philippe at freepbx dot org)
3 //This program is free software; you can redistribute it and/or
4 //modify it under the terms of the GNU General Public License
5 //as published by the Free Software Foundation; either version 2
6 //of the License, or (at your option) any later version.
7 //
8 //This program is distributed in the hope that it will be useful,
9 //but WITHOUT ANY WARRANTY; without even the implied warranty of
10 //MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
11 //GNU General Public License for more details.
12
13 $dispnum = 'dundicheck'; //used for switch on config.php
14 $extdisplay = isset($_REQUEST['extdisplay'])?$_REQUEST['extdisplay']:'';
15 $type = isset($_REQUEST['type'])?$_REQUEST['type']:'tool';
16 $dundiconflict = isset($_REQUEST['dundiconflict'])?$_REQUEST['dundiconflict']:'';
17
18 ?>
19 </div>
20 <div class="content">
21
22 <?php
23
24 if ($extdisplay != "") {
25     echo "<h2>".sprintf(_("DUNDi Information: %s"),$extdisplay)."</h2>";
26     if ($dundiconflict == 'true') {
27         echo sprintf(_("The number you are trying to use, %s, is currently available from one of the DUNDi routes you have configured on your system. As a result you cannot use this number on this system. Even if the route configuration does not pass this number you will still be blocked from creating it. If this is not an error, then you will have to un-publish this number on your remote DUNDi setup, disable the DUNDi trunk in question, or disable this module to avoid the checks. Otherwise, remove %s from the remote system before creating this one."),$extdisplay,$extdisplay);
28     }
29     $list = dundicheck_lookup_all($extdisplay);
30     if (empty($list)) {
31         echo "<h5>"._("No matches found")."</h5>";
32     } else {
33         foreach ($list as $map => $line) {
34             echo "<h5>".sprintf(_("Results from DUNDi trunk: %s"),$map)."</h5>";
35             $output = explode("\n",$line);
36             unset($output[0]);
37             foreach ($output as $item) {
38                 echo $item."<br />";
39             }
40         }
41     }
42 ?>
43
44 <?php
45 } else {
46     echo "<h2>".sprintf(_("DUNDi Lookup"))."</h2>";
47 }
48
49 ?>
50 <form name="dundicheck" action="<?php  $_SERVER['PHP_SELF'] ?>" method="post">
51     <input type="hidden" name="display" value="<?php echo $dispnum?>">
52     <input type="hidden" name="type" value="<?php echo $type?>">
53     <table>
54         <tr>
55             <td class="label" align="right"><?php echo ($extdisplay == '')?_("Lookup Number:"):_("Lookup Another Number:")?></td>
56             <td class="type"><input name="extdisplay" type="text" size="12" value="<?php htmlspecialchars($extdisplay);?>"></td>
57             <td valign="top" class="label">
58                 <input type="submit" class="button" value="<?php echo _("Lookup")?>">
59             </td>
60         </tr>
61        
62         <tr>
63             <td height="8"></td>
64             <td></td>
65         </tr>
66     </table>
67 </form>
68
Note: See TracBrowser for help on using the browser.