home *** CD-ROM | disk | FTP | other *** search
/ Chip 2004 April / CMCD0404.ISO / Software / Freeware / Programare / groupoffice-com-2.01 / modules / addressbook / select.php < prev    next >
PHP Script  |  2004-03-08  |  19KB  |  552 lines

  1. <?php
  2. /*
  3. Copyright Intermesh 2003
  4. Author: Merijn Schering <mschering@intermesh.nl>
  5. Version: 1.0 Release date: 08 July 2003
  6.  
  7. This program is free software; you can redistribute it and/or modify it
  8. under the terms of the GNU General Public License as published by the
  9. Free Software Foundation; either version 2 of the License, or (at your
  10. option) any later version.
  11. */
  12.  
  13. require("../../Group-Office.php");
  14. $GO_SECURITY->authenticate();
  15.  
  16. require($GO_LANGUAGE->get_language_file('contacts'));
  17.  
  18. $GO_FIELD = isset($_REQUEST['GO_FIELD']) ? $_REQUEST['GO_FIELD'] : '';
  19. $GO_HANDLER = isset($_REQUEST['GO_HANDLER']) ? $_REQUEST['GO_HANDLER'] : '';
  20.  
  21. $post_action = isset($_REQUEST['post_action']) ? $_REQUEST['post_action'] : '';
  22.  
  23. if ($post_action == 'search')
  24. {
  25.     if (isset($_REQUEST['search_type']))
  26.     {
  27.         SetCookie("ab_search_type",$_REQUEST['search_type'],time()+3600*24*365,"/","",0);
  28.         $_COOKIE['ab_search_type'] = $_REQUEST['search_type'];
  29.  
  30.         if ($_REQUEST['search_type'] == 'companies')
  31.         {
  32.             SetCookie("ab_search_companies_field",$_REQUEST['search_field'],time()+3600*24*365,"/","",0);
  33.             $_COOKIE['ab_search_companies_field'] = $_REQUEST['search_field'];
  34.         }else
  35.         {
  36.             SetCookie("ab_search_contacts_field",$_REQUEST['search_field'],time()+3600*24*365,"/","",0);
  37.             $_COOKIE['ab_search_contacts_field'] = $_REQUEST['search_field'];
  38.         }
  39.     }
  40.  
  41.     if (isset($_REQUEST['search_addressbook_id']))
  42.     {
  43.         SetCookie("ab_search_addressbook_id",$_REQUEST['search_addressbook_id'],time()+3600*24*365,"/","",0);
  44.         $_COOKIE['ab_search_addressbook_id'] = $_REQUEST['search_addressbook_id'];
  45.     }
  46.  
  47. }
  48.  
  49. $pass_value = isset($_REQUEST['pass_value']) ? $_REQUEST['pass_value'] : 'email';
  50. $multiselect = (isset($_REQUEST['multiselect']) && $_REQUEST['multiselect'] == 'true') ? true : false;
  51. $require_email_address = (isset($_REQUEST['require_email_address']) && $_REQUEST['require_email_address'] == 'true') ? true : false;
  52. $show_users = (isset($_REQUEST['show_users']) && $_REQUEST['show_users'] == 'true') ? true : false;
  53. $show_contacts = (isset($_REQUEST['show_contacts']) && $_REQUEST['show_contacts'] == 'true') ? true : false;
  54. $show_companies = (isset($_REQUEST['show_companies']) && $_REQUEST['show_companies'] == 'true') ? true : false;
  55.  
  56. if ($show_contacts || $show_companies)
  57. {
  58.     $GO_MODULES->authenticate('addressbook');
  59. }
  60.  
  61. $_COOKIE['ab_search_type'] = isset($_COOKIE['ab_search_type']) ? $_COOKIE['ab_search_type'] : 'contacts';
  62. $search_type = isset($_POST['search_type']) ? $_POST['search_type'] : $_COOKIE['ab_search_type'];
  63.  
  64. $page_title = $contacts_select;
  65.  
  66. require($GO_THEME->theme_path."header.inc");
  67. require($GO_CONFIG->class_path."addressbook.class.inc");
  68. $ab1 = new addressbook();
  69. $ab2 = new addressbook();
  70.  
  71. if ($search_type != 'users')
  72. {
  73.     $addressbook_id = isset($_REQUEST['addressbook_id']) ? $_REQUEST['addressbook_id'] : $ab1->get_default_addressbook($GO_SECURITY->user_id);
  74.     if (!$addressbook_id)
  75.     {
  76.         $addressbook_id = $ab1->add_addressbook($GO_SECURITY->user_id, $_SESSION['GO_SESSION']['name']);
  77.     }
  78.  
  79.     $addressbook = $ab1->get_addressbook($addressbook_id);
  80. }
  81. ?>
  82. <script type="text/javascript" language="javascript">
  83. var nav4 = window.Event ? true : false;
  84. function processkeypress(e)
  85. {
  86.     if(nav4)
  87.     {
  88.         var whichCode = e.which;
  89.     }else
  90.      {
  91.         var whichCode = event.keyCode;
  92.     }
  93.  
  94.     if (whichCode == 13)
  95.     {
  96.         search();
  97.         return true;
  98.     }
  99. }
  100. if (window.Event) //if Navigator 4.X
  101. {
  102.     document.captureEvents(Event.KEYPRESS)
  103. }
  104. document.onkeypress = processkeypress;
  105.  
  106.  
  107. function search()
  108. {
  109.     document.select.action = "<?php echo $_SERVER['PHP_SELF']; ?>";
  110.     document.select.post_action.value = 'search';
  111.     document.select.submit();
  112. }
  113.  
  114. function item_click(id, check_box)
  115. {
  116.     var item = get_object(id);
  117.     if (item)
  118.     {
  119.         if (check_box.checked)
  120.         {
  121.             item.className = 'Table2';
  122.         }else
  123.         {
  124.             item.className = 'Table1';
  125.         }
  126.     }
  127. }
  128.  
  129. function invert_selection()
  130. {
  131.     for (var i=0;i<document.forms[0].elements.length;i++)
  132.     {
  133.         if(document.forms[0].elements[i].type == 'checkbox' && document.forms[0].elements[i].name != 'dummy')
  134.         {
  135.             document.forms[0].elements[i].checked = !(document.forms[0].elements[i].checked);
  136.             item_click(document.forms[0].elements[i]);
  137.         }
  138.     }
  139. }
  140.  
  141. function change_addressbook()
  142. {
  143.     document.select.action = "<?php echo $_SERVER['PHP_SELF']; ?>";
  144.     document.select.submit();
  145. }
  146.  
  147. function _click(clicked_value, clicked_type)
  148. {
  149.     document.select.clicked_type.value=clicked_type;
  150.     document.select.clicked_value.value=clicked_value;
  151.     document.select.submit();
  152. }
  153.  
  154. function letter_click(letter)
  155. {
  156.     document.select.action = "<?php echo $_SERVER['PHP_SELF']; ?>";
  157.     document.select.post_action.value = 'search';
  158.     document.select.task.value='show_letter';
  159.     document.select.query.value=letter;
  160.     document.select.submit();
  161. }
  162. </script>
  163. <form method="post" name="select" action="<?php echo $GO_HANDLER; ?>">
  164. <input type="hidden" value="<?php echo $newdirection; ?>" name="newdirection" />
  165. <?php
  166. if ($multiselect)
  167. {
  168.     echo '<input type="hidden" value="true" name="multiselect" />';
  169. }
  170. if($require_email_address)
  171. {
  172.     echo '<input type="hidden" value="true" name="require_email_address" />';
  173. }
  174. if($show_users)
  175. {
  176.     echo '<input type="hidden" value="true" name="show_users" />';
  177.     $types_used[] = 'users';
  178. }
  179. if($show_contacts)
  180. {
  181.     echo '<input type="hidden" value="true" name="show_contacts" />';
  182.     $types_used[] = 'contacts';
  183. }
  184. if($show_companies)
  185. {
  186.     $types_used[]='companies';
  187.     echo '<input type="hidden" value="true" name="show_companies" />';
  188. }
  189. $search_type = in_array($search_type, $types_used) ? $search_type : $types_used[0];
  190. ?>
  191. <input type="hidden" name="pass_value" value="<?php echo $pass_value; ?>" />
  192. <input type="hidden" name="post_action" />
  193. <input type="hidden" name="task" />
  194. <input type="hidden" name="GO_FIELD" value="<?php echo $_REQUEST['GO_FIELD']; ?>" />
  195. <input type="hidden" name="GO_HANDLER" value="<?php echo $_REQUEST['GO_HANDLER']; ?>" />
  196. <input type="hidden" name="clicked_value" />
  197. <input type="hidden" name="clicked_type" />
  198.  
  199. <?php
  200. echo '<table border="0" cellpadding="5" cellspacing="0" width="100%">';
  201.  
  202. $contacts = isset($_POST['contacts']) ? $_POST['contacts'] : array();
  203. $users = isset($_POST['users']) ? $_POST['users'] : array();
  204. $companies = isset($_POST['companies']) ? $_POST['companies'] : array();
  205.  
  206. if (isset($_REQUEST['address_string']))
  207. {
  208.     $addresses = cut_address($_REQUEST['address_string'],$charset);
  209. }else
  210. {
  211.     $addresses = isset($_POST['addresses']) ? $_POST['addresses'] : array();;
  212. }
  213.  
  214. if ($pass_value == 'email')
  215. {
  216.     $addresses = array_merge($addresses, $contacts, $users, $companies);
  217. }
  218. ?>
  219. <table border="0" cellpadding="0" cellspacing="3">
  220. <tr height="30">
  221.     <td nowrap>
  222.     <h2>
  223.     <a href="javascript:letter_click('A')">A</a>  
  224.     <a href="javascript:letter_click('B')">B</a>  
  225.     <a href="javascript:letter_click('C')">C</a>  
  226.     <a href="javascript:letter_click('D')">D</a>  
  227.     <a href="javascript:letter_click('E')">E</a>  
  228.     <a href="javascript:letter_click('F')">F</a>  
  229.     <a href="javascript:letter_click('G')">G</a>  
  230.     <a href="javascript:letter_click('H')">H</a>  
  231.     <a href="javascript:letter_click('I')">I</a>  
  232.     <a href="javascript:letter_click('J')">J</a>  
  233.     <a href="javascript:letter_click('K')">K</a>  
  234.     <a href="javascript:letter_click('L')">L</a>  
  235.     <a href="javascript:letter_click('M')">M</a>  
  236.     <a href="javascript:letter_click('N')">N</a>  
  237.     <a href="javascript:letter_click('O')">O</a>  
  238.     <a href="javascript:letter_click('P')">P</a>  
  239.     <a href="javascript:letter_click('Q')">Q</a>  
  240.     <a href="javascript:letter_click('R')">R</a>  
  241.     <a href="javascript:letter_click('S')">S</a>  
  242.     <a href="javascript:letter_click('T')">T</a>  
  243.     <a href="javascript:letter_click('U')">U</a>  
  244.     <a href="javascript:letter_click('V')">V</a>  
  245.     <a href="javascript:letter_click('W')">W</a>  
  246.     <a href="javascript:letter_click('X')">X</a>  
  247.     <a href="javascript:letter_click('Y')">Y</a>  
  248.     <a href="javascript:letter_click('Z')">Z</a>  
  249.     </h2>
  250.     </td>
  251. </tr>
  252. <tr>
  253.     <td>
  254.     <?php
  255.     echo '<table border="0"><tr><td>'.$ab_search_for.':</td><td><table border="0" cellpadding="0" cellspacing="0"><tr><td>';
  256.  
  257.     $_COOKIE['ab_search_field'] = isset($_COOKIE['ab_search_field']) ? $_COOKIE['ab_search_field'] : 'first_name';
  258.     $search_field = isset($_POST['search_field']) ? $_POST['search_field'] : $_COOKIE['ab_search_field'];
  259.  
  260.     $_COOKIE['ab_search_companies_field'] = isset($_COOKIE['ab_search_companies_field']) ? $_COOKIE['ab_search_companies_field'] : 'name';
  261.     $_COOKIE['ab_search_contacts_field'] = isset($_COOKIE['ab_search_contacts_field']) ? $_COOKIE['ab_search_contacts_field'] : 'first_name';
  262.  
  263.     $search_field = ($search_type == 'contacts' || $search_type == 'users') ? $_COOKIE['ab_search_contacts_field'] : $_COOKIE['ab_search_companies_field'];
  264.  
  265.     $dropbox = new dropbox();
  266.     if ($show_users)
  267.     {
  268.         $dropbox->add_value('users', $contacts_members);
  269.     }
  270.     if ($show_contacts)
  271.     {
  272.         $dropbox->add_value('contacts', $contacts_contacts);
  273.     }
  274.     if ($show_companies)
  275.     {
  276.         $dropbox->add_value('companies', $ab_companies);
  277.     }
  278.     $dropbox->print_dropbox('search_type', $search_type, 'onchange="javascript:change_addressbook()"');
  279.     echo '</td>';
  280.  
  281.     $_COOKIE['ab_search_addressbook_id'] = isset($_COOKIE['ab_search_addressbook_id']) ? $_COOKIE['ab_search_addressbook_id'] : '0';
  282.     $search_addressbook_id = isset($_REQUEST['search_addressbook_id']) ? $_REQUEST['search_addressbook_id'] : $_COOKIE['ab_search_addressbook_id'];
  283.     if ($search_type != 'users' && $ab1->get_subscribed_addressbooks($GO_SECURITY->user_id) > 1)
  284.     {
  285.         $subscribed_addressbooks = new dropbox();
  286.  
  287.         $subscribed_addressbooks->add_value('0', $ab_all_your_addressbooks);
  288.  
  289.         while ($ab1->next_record())
  290.         {
  291.             $subscribed_addressbooks->add_value($ab1->f('id'), $ab1->f('name'));
  292.         }
  293.         echo '<td>'.$ab_search_in.' </td><td>';
  294.         $subscribed_addressbooks->print_dropbox('search_addressbook_id', $search_addressbook_id);
  295.         echo '</td>';
  296.     }else
  297.     {
  298.         echo '<input type="hidden" name="search_addressbook_id" value="'.$search_addressbook_id.'" />';
  299.     }
  300.  
  301.     $_COOKIE['ab_search_companies_field'] = isset($_COOKIE['ab_search_companies_field']) ? $_COOKIE['ab_search_companies_field'] : 'name';
  302.     $_COOKIE['ab_search_contacts_field'] = isset($_COOKIE['ab_search_contacts_field']) ? $_COOKIE['ab_search_contacts_field'] : 'first_name';
  303.  
  304.     $search_field = ($search_type == 'contacts' || $search_type == 'users') ? $_COOKIE['ab_search_contacts_field'] : $_COOKIE['ab_search_companies_field'];
  305.  
  306.     $dropbox = new dropbox();
  307.  
  308.     if ($search_type == 'companies')
  309.     {
  310.         $dropbox->add_value('name', $strName);
  311.         $dropbox->add_value('email', $strEmail);
  312.         $dropbox->add_value('address',$strAddress);
  313.         $dropbox->add_value('city', $strCity);
  314.         $dropbox->add_value('zip',$strZip);
  315.         $dropbox->add_value('state',$strState);
  316.         $dropbox->add_value('country', $strCountry);
  317.     }else
  318.     {
  319.         $dropbox->add_value('first_name', $strFirstName);
  320.         $dropbox->add_value('last_name', $strLastName);
  321.         $dropbox->add_value('email', $strEmail);
  322.         $dropbox->add_value('department',$strDepartment);
  323.         $dropbox->add_value('function',$strFunction);
  324.         $dropbox->add_value('address',$strAddress);
  325.         $dropbox->add_value('city', $strCity);
  326.         $dropbox->add_value('zip',$strZip);
  327.         $dropbox->add_value('state',$strState);
  328.         $dropbox->add_value('country', $strCountry);
  329.         $dropbox->add_value('comment', $ab_comment);
  330.     }
  331.     echo '<td>'.$ab_search_on.' </td><td>';
  332.     $dropbox->print_dropbox('search_field', $search_field);
  333.     echo '</td></tr></table></td></tr>';
  334.     ?>
  335.     <tr>
  336.         <td><?php echo $ab_search_keyword; ?>:</td>
  337.         <td colspan="3"><input type="text" name="query" size="31" maxlength="255" class="textbox" value="<?php if (isset($_POST['query'])) echo $_POST['query']; ?>">
  338.         <?php
  339.         $button = new button($cmdSearch, "javascript:search()");
  340.         ?>
  341.         </td>
  342.     </tr>
  343.     </table>
  344.     </td>
  345. </tr>
  346. </table>
  347. <br />
  348.  
  349. <?php
  350. if ($post_action == 'search')
  351. {
  352.     if ($_POST['task'] == 'show_letter')
  353.     {
  354.         $query = $_POST['query'].'%';
  355.     }else
  356.     {
  357.         $query = '%'.$_POST['query'].'%';
  358.     }
  359.  
  360.     if ($search_type == 'contacts' || $search_type == 'users')
  361.     {
  362.  
  363.         if ($search_type == 'users')
  364.         {
  365.             $click_type = 'user';
  366.             $array_name = 'users[]';
  367.             require_once($GO_CONFIG->class_path.'users.class.inc');
  368.             $ab1 = new users();
  369.             $ab1->search($query, $search_field, $GO_SECURITY->user_id);
  370.         }else
  371.         {
  372.             $click_type = 'contact';
  373.             $array_name = 'contacts[]';
  374.             $ab1->search_contacts($GO_SECURITY->user_id, $query, $search_field, $search_addressbook_id);
  375.         }
  376.         $count = 0;
  377.         $search_results = '';
  378.         while ($ab1->next_record())
  379.         {
  380.             if ((!$require_email_address || $ab1->f("email") != '') && (($search_type == 'users' && $GO_SECURITY->has_permission($GO_SECURITY->user_id, $ab1->f('acl_id'))) || ($search_type != 'users' && ($GO_SECURITY->has_permission($GO_SECURITY->user_id, $ab1->f('acl_read')) || $GO_SECURITY->has_permission($GO_SECURITY->user_id, $ab1->f('acl_write'))))))
  381.             {
  382.                 $class="Table1";
  383.                 $check = "";
  384.  
  385.                 if ($pass_value == 'email')
  386.                 {
  387.                     if ($ab1->f("email") != "")
  388.                     {
  389.                         $key = array_search($ab1->f("email"), $addresses);
  390.                     }else
  391.                     {
  392.                         $key = false;
  393.                     }
  394.                     if (is_int($key))
  395.                     {
  396.                         unset($addresses[$key]);
  397.                         $check = "checked";
  398.                         $class = "Table2";
  399.                     }
  400.                 }elseif($search_type == 'users')
  401.                 {
  402.                     $key = array_search($ab1->f($pass_value), $users);
  403.  
  404.                     if (is_int($key))
  405.                     {
  406.                         unset($users[$key]);
  407.                         $check = "checked";
  408.                         $class = "Table2";
  409.                     }
  410.                 }elseif($search_type == 'contracts')
  411.                 {
  412.                     $key = array_search($ab1->f($pass_value), $contacts);
  413.  
  414.                     if (is_int($key))
  415.                     {
  416.                         unset($contacts[$key]);
  417.                         $check = "checked";
  418.                         $class = "Table2";
  419.                     }
  420.                 }
  421.  
  422.                 $search_results .= "<tr id=\"".$ab1->f('id')."\" class=\"".$class."\" height=\"20\"><td> </td>\n";
  423.                 if ($multiselect)
  424.                 {
  425.                     $search_results .= '<td><input onclick="javascript:item_click('.$ab1->f("id").', this);" type="checkbox" name="'.$array_name.'" value="'.$ab1->f($pass_value).'" '.$check.' /></td>';
  426.                 }
  427.  
  428.                 if ($search_type != 'users' && $ab1->f('color') != '')
  429.                 {
  430.                     $style = ' style="color: '.$ab1->f('color').';"';
  431.                 }else
  432.                 {
  433.                     $style = '';
  434.                 }
  435.                 $middle_name = $ab1->f('middle_name') == '' ? '' : $ab1->f('middle_name').' ';
  436.                 $name = $ab1->f('first_name').' '.$middle_name.$ab1->f('last_name');
  437.  
  438.                 $search_results .= '<td><a'.$style.' href="javascript:_click(\''.$ab1->f($pass_value).'\', \''.$click_type.'\');" class="normal">'.$name.'</a> </td>';
  439.                 $search_results .= "<td>".mail_to(empty_to_stripe($ab1->f("email")))." </td>\n";
  440.                 $search_results .= "</tr>\n";
  441.                 $search_results .= '<tr><td colspan="99" height="1"><img src="'.$GO_THEME->images['cccccc'].'" border="0" height="1" width="100%" /></td></tr>';
  442.                 $count++;
  443.             }
  444.         }
  445.         echo '<tr><td><h2>'.$count.' '.$contacts_results.'</h2>';
  446.         echo '<tr><td>';
  447.  
  448.         if ($count > 0)
  449.         {
  450.             echo '<table border="0" cellpadding="0" cellspacing="0" width="100%">';
  451.             echo '<tr>';
  452.             echo '<td class="TableHead2" colspan="2"> </td>';
  453.             echo '<td class="TableHead2">'.$strName.'</td>';
  454.             echo '<td class="TableHead2">'.$strEmail.'</td>';
  455.             echo '</tr>';
  456.             echo $search_results;
  457.             echo '</table>';
  458.         }
  459.     }else
  460.     {
  461.         $ab1->search_companies($GO_SECURITY->user_id, $query, $search_field, $search_addressbook_id);
  462.  
  463.         $count = 0;
  464.         $search_results = '';
  465.         while ($ab1->next_record())
  466.         {
  467.             if ((!$require_email_address || $ab1->f("email") != '') && (($GO_SECURITY->has_permission($GO_SECURITY->user_id, $ab1->f('acl_read')) || $GO_SECURITY->has_permission($GO_SECURITY->user_id, $ab1->f('acl_write')))))
  468.             {
  469.                 $count++;
  470.  
  471.                 $class="Table1";
  472.                 $check = "";
  473.  
  474.                 if ($pass_value == 'email')
  475.                 {
  476.                     if ($ab1->f("email") != "")
  477.                     {
  478.                         $key = array_search($ab1->f("email"), $addresses);
  479.                     }else
  480.                     {
  481.                         $key = false;
  482.                     }
  483.                     if (is_int($key))
  484.                     {
  485.                         unset($addresses[$key]);
  486.                         $check = "checked";
  487.                         $class = "Table2";
  488.                     }
  489.                 }else
  490.                 {
  491.                     $key = array_search($ab1->f($pass_value), $companies);
  492.                     if (is_int($key))
  493.                     {
  494.                         unset($companies[$key]);
  495.                         $check = "checked";
  496.                         $class = "Table2";
  497.                     }
  498.                 }
  499.  
  500.                 $search_results .= "<tr id=\"".$ab1->f('id')."\" class=\"".$class."\" height=\"20\">\n";
  501.                 if ($multiselect)
  502.                 {
  503.                     $search_results .= '<td><input onclick="javascript:item_click('.$ab1->f("id").', this);" type="checkbox" name="companies[]" value="'.$ab1->f($pass_value).'" '.$check.' /></td>';
  504.                 }
  505.                 $search_results .= '<td><a href="javascript:_click(\''.$ab1->f($pass_value).'\', \'company\');" class="normal">'.$ab1->f('name').'</a> </td>';
  506.                 $search_results .= "<td>".mail_to(empty_to_stripe($ab1->f("email")), empty_to_stripe($ab1->f("email")),'normal',true, $ab1->f("id"))." </td>\n";
  507.                 $search_results .= "</tr>\n";
  508.                 $search_results .= '<tr><td colspan="99" height="1"><img src="'.$GO_THEME->images['cccccc'].'" border="0" height="1" width="100%" /></td></tr>';
  509.             }
  510.         }
  511.  
  512.         $result_str =  ($count == 1) ? $count.' '.$contacts_result : $count.' '.$contacts_results;
  513.         echo '<br /><h2>'.$result_str.'</h2>';
  514.  
  515.         if ($count > 0)
  516.         {
  517.             echo '<table border="0" cellpadding="0" cellspacing="0" width="100%">';
  518.             echo '<tr>';
  519.             echo '<td class="TableHead2" width="16"><input type="checkbox" name="dummy" value="dummy" onclick="javascript:invert_selection()" /></td>';
  520.             echo '<td class="TableHead2">'.$strName.'</td>';
  521.             echo '<td class="TableHead2">'.$strEmail.'</td>';
  522.             echo '</tr>';
  523.  
  524.             echo $search_results;
  525.  
  526.             echo '</table>';
  527.         }
  528.     }
  529. }
  530.  
  531. echo '<table border="0" width="100%"><tr><td align="center"><br />';
  532. if($multiselect && ($post_action == 'search' && $count > 0))
  533. {
  534.     $button = new button($cmdAdd,'javascript:document.forms[0].submit()');
  535.     echo '  ';
  536. }
  537. $button = new button($cmdCancel,'javascript:window.close();');
  538. echo '</td></tr></table>';
  539.  
  540.  
  541. while($address = array_pop($addresses))
  542. {
  543.     echo '<input type="hidden" name="addresses[]" value="'.$address.'" />';
  544. }
  545.  
  546.  
  547.  
  548. echo '</form>';
  549. echo '<script type="text/javascript">document.select.query.focus();</script>';
  550. require($GO_THEME->theme_path."footer.inc");
  551. ?>
  552.