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 >
Encoding:
PHP Script  |  2004-03-08  |  18.3 KB  |  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.  
  201. echo '<table border="0" cellpadding="5" cellspacing="0" width="100%">';
  202.  
  203. $contacts = isset($_POST['contacts']) ? $_POST['contacts'] : array();
  204. $users = isset($_POST['users']) ? $_POST['users'] : array();
  205. $companies = isset($_POST['companies']) ? $_POST['companies'] : array();
  206.  
  207. if (isset($_REQUEST['address_string']))
  208. {
  209.     $addresses = cut_address($_REQUEST['address_string'],$charset);
  210. }else
  211. {
  212.     $addresses = isset($_POST['addresses']) ? $_POST['addresses'] : array();;
  213. }
  214.  
  215. if ($pass_value == 'email')
  216. {
  217.     $addresses = array_merge($addresses, $contacts, $users, $companies);
  218. }
  219. ?>
  220. <table border="0" cellpadding="0" cellspacing="3">
  221. <tr height="30">
  222.     <td nowrap>
  223.     <h2>
  224.     <a href="javascript:letter_click('A')">A</a>  
  225.     <a href="javascript:letter_click('B')">B</a>  
  226.     <a href="javascript:letter_click('C')">C</a>  
  227.     <a href="javascript:letter_click('D')">D</a>  
  228.     <a href="javascript:letter_click('E')">E</a>  
  229.     <a href="javascript:letter_click('F')">F</a>  
  230.     <a href="javascript:letter_click('G')">G</a>  
  231.     <a href="javascript:letter_click('H')">H</a>  
  232.     <a href="javascript:letter_click('I')">I</a>  
  233.     <a href="javascript:letter_click('J')">J</a>  
  234.     <a href="javascript:letter_click('K')">K</a>  
  235.     <a href="javascript:letter_click('L')">L</a>  
  236.     <a href="javascript:letter_click('M')">M</a>  
  237.     <a href="javascript:letter_click('N')">N</a>  
  238.     <a href="javascript:letter_click('O')">O</a>  
  239.     <a href="javascript:letter_click('P')">P</a>  
  240.     <a href="javascript:letter_click('Q')">Q</a>  
  241.     <a href="javascript:letter_click('R')">R</a>  
  242.     <a href="javascript:letter_click('S')">S</a>  
  243.     <a href="javascript:letter_click('T')">T</a>  
  244.     <a href="javascript:letter_click('U')">U</a>  
  245.     <a href="javascript:letter_click('V')">V</a>  
  246.     <a href="javascript:letter_click('W')">W</a>  
  247.     <a href="javascript:letter_click('X')">X</a>  
  248.     <a href="javascript:letter_click('Y')">Y</a>  
  249.     <a href="javascript:letter_click('Z')">Z</a>  
  250.     </h2>
  251.     </td>
  252. </tr>
  253. <tr>
  254.     <td>
  255.     <?php
  256.     echo '<table border="0"><tr><td>'.$ab_search_for.':</td><td><table border="0" cellpadding="0" cellspacing="0"><tr><td>';
  257.  
  258.     $_COOKIE['ab_search_field'] = isset($_COOKIE['ab_search_field']) ? $_COOKIE['ab_search_field'] : 'first_name';
  259.     $search_field = isset($_POST['search_field']) ? $_POST['search_field'] : $_COOKIE['ab_search_field'];
  260.  
  261.     $_COOKIE['ab_search_companies_field'] = isset($_COOKIE['ab_search_companies_field']) ? $_COOKIE['ab_search_companies_field'] : 'name';
  262.     $_COOKIE['ab_search_contacts_field'] = isset($_COOKIE['ab_search_contacts_field']) ? $_COOKIE['ab_search_contacts_field'] : 'first_name';
  263.  
  264.     $search_field = ($search_type == 'contacts' || $search_type == 'users') ? $_COOKIE['ab_search_contacts_field'] : $_COOKIE['ab_search_companies_field'];
  265.  
  266.     $dropbox = new dropbox();
  267.     if ($show_users)
  268.     {
  269.         $dropbox->add_value('users', $contacts_members);
  270.     }
  271.     if ($show_contacts)
  272.     {
  273.         $dropbox->add_value('contacts', $contacts_contacts);
  274.     }
  275.     if ($show_companies)
  276.     {
  277.         $dropbox->add_value('companies', $ab_companies);
  278.     }
  279.     $dropbox->print_dropbox('search_type', $search_type, 'onchange="javascript:change_addressbook()"');
  280.     echo '</td>';
  281.  
  282.     $_COOKIE['ab_search_addressbook_id'] = isset($_COOKIE['ab_search_addressbook_id']) ? $_COOKIE['ab_search_addressbook_id'] : '0';
  283.     $search_addressbook_id = isset($_REQUEST['search_addressbook_id']) ? $_REQUEST['search_addressbook_id'] : $_COOKIE['ab_search_addressbook_id'];
  284.     if ($search_type != 'users' && $ab1->get_subscribed_addressbooks($GO_SECURITY->user_id) > 1)
  285.     {
  286.         $subscribed_addressbooks = new dropbox();
  287.  
  288.         $subscribed_addressbooks->add_value('0', $ab_all_your_addressbooks);
  289.  
  290.         while ($ab1->next_record())
  291.         {
  292.             $subscribed_addressbooks->add_value($ab1->f('id'), $ab1->f('name'));
  293.         }
  294.         echo '<td>'.$ab_search_in.' </td><td>';
  295.         $subscribed_addressbooks->print_dropbox('search_addressbook_id', $search_addressbook_id);
  296.         echo '</td>';
  297.     }else
  298.     {
  299.         echo '<input type="hidden" name="search_addressbook_id" value="'.$search_addressbook_id.'" />';
  300.     }
  301.  
  302.     $_COOKIE['ab_search_companies_field'] = isset($_COOKIE['ab_search_companies_field']) ? $_COOKIE['ab_search_companies_field'] : 'name';
  303.     $_COOKIE['ab_search_contacts_field'] = isset($_COOKIE['ab_search_contacts_field']) ? $_COOKIE['ab_search_contacts_field'] : 'first_name';
  304.  
  305.     $search_field = ($search_type == 'contacts' || $search_type == 'users') ? $_COOKIE['ab_search_contacts_field'] : $_COOKIE['ab_search_companies_field'];
  306.  
  307.     $dropbox = new dropbox();
  308.  
  309.     if ($search_type == 'companies')
  310.     {
  311.         $dropbox->add_value('name', $strName);
  312.         $dropbox->add_value('email', $strEmail);
  313.         $dropbox->add_value('address',$strAddress);
  314.         $dropbox->add_value('city', $strCity);
  315.         $dropbox->add_value('zip',$strZip);
  316.         $dropbox->add_value('state',$strState);
  317.         $dropbox->add_value('country', $strCountry);
  318.     }else
  319.     {
  320.         $dropbox->add_value('first_name', $strFirstName);
  321.         $dropbox->add_value('last_name', $strLastName);
  322.         $dropbox->add_value('email', $strEmail);
  323.         $dropbox->add_value('department',$strDepartment);
  324.         $dropbox->add_value('function',$strFunction);
  325.         $dropbox->add_value('address',$strAddress);
  326.         $dropbox->add_value('city', $strCity);
  327.         $dropbox->add_value('zip',$strZip);
  328.         $dropbox->add_value('state',$strState);
  329.         $dropbox->add_value('country', $strCountry);
  330.         $dropbox->add_value('comment', $ab_comment);
  331.     }
  332.     echo '<td>'.$ab_search_on.' </td><td>';
  333.     $dropbox->print_dropbox('search_field', $search_field);
  334.     echo '</td></tr></table></td></tr>';
  335.     ?>
  336.     <tr>
  337.         <td><?php echo $ab_search_keyword; ?>:</td>
  338.         <td colspan="3"><input type="text" name="query" size="31" maxlength="255" class="textbox" value="<?php if (isset($_POST['query'])) echo $_POST['query']; ?>">
  339.         <?php
  340.         $button = new button($cmdSearch, "javascript:search()");
  341.         ?>
  342.         </td>
  343.     </tr>
  344.     </table>
  345.     </td>
  346. </tr>
  347. </table>
  348. <br />
  349.  
  350. <?php
  351. if ($post_action == 'search')
  352. {
  353.     if ($_POST['task'] == 'show_letter')
  354.     {
  355.         $query = $_POST['query'].'%';
  356.     }else
  357.     {
  358.         $query = '%'.$_POST['query'].'%';
  359.     }
  360.  
  361.     if ($search_type == 'contacts' || $search_type == 'users')
  362.     {
  363.  
  364.         if ($search_type == 'users')
  365.         {
  366.             $click_type = 'user';
  367.             $array_name = 'users[]';
  368.             require_once($GO_CONFIG->class_path.'users.class.inc');
  369.             $ab1 = new users();
  370.             $ab1->search($query, $search_field, $GO_SECURITY->user_id);
  371.         }else
  372.         {
  373.             $click_type = 'contact';
  374.             $array_name = 'contacts[]';
  375.             $ab1->search_contacts($GO_SECURITY->user_id, $query, $search_field, $search_addressbook_id);
  376.         }
  377.         $count = 0;
  378.         $search_results = '';
  379.         while ($ab1->next_record())
  380.         {
  381.             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'))))))
  382.             {
  383.                 $class="Table1";
  384.                 $check = "";
  385.  
  386.                 if ($pass_value == 'email')
  387.                 {
  388.                     if ($ab1->f("email") != "")
  389.                     {
  390.                         $key = array_search($ab1->f("email"), $addresses);
  391.                     }else
  392.                     {
  393.                         $key = false;
  394.                     }
  395.                     if (is_int($key))
  396.                     {
  397.                         unset($addresses[$key]);
  398.                         $check = "checked";
  399.                         $class = "Table2";
  400.                     }
  401.                 }elseif($search_type == 'users')
  402.                 {
  403.                     $key = array_search($ab1->f($pass_value), $users);
  404.  
  405.                     if (is_int($key))
  406.                     {
  407.                         unset($users[$key]);
  408.                         $check = "checked";
  409.                         $class = "Table2";
  410.                     }
  411.                 }elseif($search_type == 'contracts')
  412.                 {
  413.                     $key = array_search($ab1->f($pass_value), $contacts);
  414.  
  415.                     if (is_int($key))
  416.                     {
  417.                         unset($contacts[$key]);
  418.                         $check = "checked";
  419.                         $class = "Table2";
  420.                     }
  421.                 }
  422.  
  423.                 $search_results .= "<tr id=\"".$ab1->f('id')."\" class=\"".$class."\" height=\"20\"><td> </td>\n";
  424.                 if ($multiselect)
  425.                 {
  426.                     $search_results .= '<td><input onclick="javascript:item_click('.$ab1->f("id").', this);" type="checkbox" name="'.$array_name.'" value="'.$ab1->f($pass_value).'" '.$check.' /></td>';
  427.                 }
  428.  
  429.                 if ($search_type != 'users' && $ab1->f('color') != '')
  430.                 {
  431.                     $style = ' style="color: '.$ab1->f('color').';"';
  432.                 }else
  433.                 {
  434.                     $style = '';
  435.                 }
  436.                 $middle_name = $ab1->f('middle_name') == '' ? '' : $ab1->f('middle_name').' ';
  437.                 $name = $ab1->f('first_name').' '.$middle_name.$ab1->f('last_name');
  438.  
  439.                 $search_results .= '<td><a'.$style.' href="javascript:_click(\''.$ab1->f($pass_value).'\', \''.$click_type.'\');" class="normal">'.$name.'</a> </td>';
  440.                 $search_results .= "<td>".mail_to(empty_to_stripe($ab1->f("email")))." </td>\n";
  441.                 $search_results .= "</tr>\n";
  442.                 $search_results .= '<tr><td colspan="99" height="1"><img src="'.$GO_THEME->images['cccccc'].'" border="0" height="1" width="100%" /></td></tr>';
  443.                 $count++;
  444.             }
  445.         }
  446.         echo '<tr><td><h2>'.$count.' '.$contacts_results.'</h2>';
  447.         echo '<tr><td>';
  448.  
  449.         if ($count > 0)
  450.         {
  451.             echo '<table border="0" cellpadding="0" cellspacing="0" width="100%">';
  452.             echo '<tr>';
  453.             echo '<td class="TableHead2" colspan="2"> </td>';
  454.             echo '<td class="TableHead2">'.$strName.'</td>';
  455.             echo '<td class="TableHead2">'.$strEmail.'</td>';
  456.             echo '</tr>';
  457.             echo $search_results;
  458.             echo '</table>';
  459.         }
  460.     }else
  461.     {
  462.         $ab1->search_companies($GO_SECURITY->user_id, $query, $search_field, $search_addressbook_id);
  463.  
  464.         $count = 0;
  465.         $search_results = '';
  466.         while ($ab1->next_record())
  467.         {
  468.             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')))))
  469.             {
  470.                 $count++;
  471.  
  472.                 $class="Table1";
  473.                 $check = "";
  474.  
  475.                 if ($pass_value == 'email')
  476.                 {
  477.                     if ($ab1->f("email") != "")
  478.                     {
  479.                         $key = array_search($ab1->f("email"), $addresses);
  480.                     }else
  481.                     {
  482.                         $key = false;
  483.                     }
  484.                     if (is_int($key))
  485.                     {
  486.                         unset($addresses[$key]);
  487.                         $check = "checked";
  488.                         $class = "Table2";
  489.                     }
  490.                 }else
  491.                 {
  492.                     $key = array_search($ab1->f($pass_value), $companies);
  493.                     if (is_int($key))
  494.                     {
  495.                         unset($companies[$key]);
  496.                         $check = "checked";
  497.                         $class = "Table2";
  498.                     }
  499.                 }
  500.  
  501.                 $search_results .= "<tr id=\"".$ab1->f('id')."\" class=\"".$class."\" height=\"20\">\n";
  502.                 if ($multiselect)
  503.                 {
  504.                     $search_results .= '<td><input onclick="javascript:item_click('.$ab1->f("id").', this);" type="checkbox" name="companies[]" value="'.$ab1->f($pass_value).'" '.$check.' /></td>';
  505.                 }
  506.                 $search_results .= '<td><a href="javascript:_click(\''.$ab1->f($pass_value).'\', \'company\');" class="normal">'.$ab1->f('name').'</a> </td>';
  507.                 $search_results .= "<td>".mail_to(empty_to_stripe($ab1->f("email")), empty_to_stripe($ab1->f("email")),'normal',true, $ab1->f("id"))." </td>\n";
  508.                 $search_results .= "</tr>\n";
  509.                 $search_results .= '<tr><td colspan="99" height="1"><img src="'.$GO_THEME->images['cccccc'].'" border="0" height="1" width="100%" /></td></tr>';
  510.             }
  511.         }
  512.  
  513.         $result_str =  ($count == 1) ? $count.' '.$contacts_result : $count.' '.$contacts_results;
  514.         echo '<br /><h2>'.$result_str.'</h2>';
  515.  
  516.         if ($count > 0)
  517.         {
  518.             echo '<table border="0" cellpadding="0" cellspacing="0" width="100%">';
  519.             echo '<tr>';
  520.             echo '<td class="TableHead2" width="16"><input type="checkbox" name="dummy" value="dummy" onclick="javascript:invert_selection()" /></td>';
  521.             echo '<td class="TableHead2">'.$strName.'</td>';
  522.             echo '<td class="TableHead2">'.$strEmail.'</td>';
  523.             echo '</tr>';
  524.  
  525.             echo $search_results;
  526.  
  527.             echo '</table>';
  528.         }
  529.     }
  530. }
  531.  
  532. echo '<table border="0" width="100%"><tr><td align="center"><br />';
  533. if($multiselect && ($post_action == 'search' && $count > 0))
  534. {
  535.     $button = new button($cmdAdd,'javascript:document.forms[0].submit()');
  536.     echo '  ';
  537. }
  538. $button = new button($cmdCancel,'javascript:window.close();');
  539. echo '</td></tr></table>';
  540.  
  541.  
  542. while($address = array_pop($addresses))
  543. {
  544.     echo '<input type="hidden" name="addresses[]" value="'.$address.'" />';
  545. }
  546.  
  547.  
  548.  
  549. echo '</form>';
  550. echo '<script type="text/javascript">document.select.query.focus();</script>';
  551. require($GO_THEME->theme_path."footer.inc");
  552. ?>
  553.