2 // Copyright (C) 2006 Rod Roark <rod@sunsetsystems.com>
4 // This program is free software; you can redistribute it and/or
5 // modify it under the terms of the GNU General Public License
6 // as published by the Free Software Foundation; either version 2
7 // of the License, or (at your option) any later version.
9 require_once("../globals.php");
10 require_once("$srcdir/acl.inc");
12 $form_fname = trim($_POST['form_fname']);
13 $form_lname = trim($_POST['form_lname']);
14 $form_specialty = trim($_POST['form_specialty']);
16 $query = "SELECT * FROM users WHERE active = 1 ";
17 if ($form_lname) $query .= "AND lname LIKE '$form_lname%' ";
18 if ($form_fname) $query .= "AND fname LIKE '$form_fname%' ";
19 if ($form_specialty) $query .= "AND specialty LIKE '%$form_specialty%' ";
20 $query .= "ORDER BY lname, fname, mname LIMIT 500";
21 $res = sqlStatement($query);
27 <link rel
=stylesheet href
='<? echo $css_header ?>' type
='text/css'>
28 <title
><?php
xl('Address Book','e'); ?
></title
>
32 font
-family
: Arial
, Helvetica
, sans
-serif
;
36 a
, a
:visited
, a
:hover
{
45 background
-color
:#cccccc;
53 font
-family
:monospace
;
60 border-bottom-width:1px;
61 border-left-width:0px;
62 border-right-width:0px;
64 border
-color
: #000000;
65 background
-color
:transparent
;
69 font
-family
:sans
-serif
;
75 <script type
="text/javascript" src
="../../library/dialog.js"></script
>
77 <script language
="JavaScript">
79 // Callback from popups to refresh this display.
80 function refreshme() {
82 document
.forms
[0].submit();
85 // Process click to pop up the add/edit window.
86 function doedclick(userid
) {
87 dlgopen('addrbook_edit.php?userid=' + userid
, '_blank', 700, 550);
94 <body
<?
echo $top_bg_line;?
>>
96 <form method
='post' action
='addrbook_list.php'>
98 <table border
='0' cellpadding
='5' cellspacing
='0' width
='100%'>
100 <td height
="1" colspan
="2">
103 <tr
class='search'> <!-- bgcolor
='#ddddff' -->
105 <?
xl('First Name:','e')?
>
106 <input type
='text' name
='form_fname' size
='10' value
='<?php echo $form_fname; ?>'
107 class='inputtext' title
='<?php xl("All or part of the first name","e") ?>' /> 
;
108 <?
xl('Last Name:','e')?
>
109 <input type
='text' name
='form_lname' size
='10' value
='<?php echo $form_lname; ?>'
110 class='inputtext' title
='<?php xl("All or part of the last name","e") ?>' /> 
;
111 <?
xl('Specialty:','e')?
>
112 <input type
='text' name
='form_specialty' size
='10' value
='<?php echo $form_specialty; ?>'
113 class='inputtext' title
='<?php xl("Any part of the desired specialty","e") ?>' /> 
; 
;
114 <input type
='submit' class='button' name
='form_search' value
='<?xl("Search","e")?>' />
117 <input type
='button' class='button' value
='Add New' onclick
='doedclick(0)' />
121 <td height
="1" colspan
="2">
126 <table width
='100%' cellpadding
='1' cellspacing
='2'>
128 <td title
='Click to view or edit'><?php
xl('Name','e'); ?
></td
>
129 <td
><?php
xl('Local','e'); ?
></td
><!-- empty for external
-->
130 <td
><?php
xl('Specialty','e'); ?
></td
>
131 <td
><?php
xl('Phone','e'); ?
></td
>
132 <td
><?php
xl('Mobile','e'); ?
></td
>
133 <td
><?php
xl('Fax','e'); ?
></td
>
134 <td
><?php
xl('Email','e'); ?
></td
>
135 <td
><?php
xl('Street','e'); ?
></td
>
136 <td
><?php
xl('City','e'); ?
></td
>
137 <td
><?php
xl('State','e'); ?
></td
>
138 <td
><?php
xl('Postal','e'); ?
></td
>
142 while ($row = sqlFetchArray($res)) {
144 $bgcolor = "#" . (($encount & 1) ?
"ddddff" : "ffdddd");
145 $username = $row['username'];
146 if (! $row['active']) $username = '--';
147 echo " <tr class='detail' bgcolor='$bgcolor' style='cursor:pointer' " .
148 "onclick='doedclick(" . $row['id'] . ")'>\n";
149 echo " <td>" . $row['lname'] . ', ' . $row['fname'] . ' ' . $row['mname'] . "</td>\n";
150 echo " <td>" . ($username ?
'*' : '') . "</td>\n";
151 echo " <td>" . $row['specialty'] . "</td>\n";
152 echo " <td>" . $row['phonew1'] . "</td>\n";
153 echo " <td>" . $row['phonecell'] . "</td>\n";
154 echo " <td>" . $row['fax'] . "</td>\n";
155 echo " <td>" . $row['email'] . "</td>\n";
156 echo " <td>" . $row['street'] . "</td>\n";
157 echo " <td>" . $row['city'] . "</td>\n";
158 echo " <td>" . $row['state'] . "</td>\n";
159 echo " <td>" . $row['zip'] . "</td>\n";