home *** CD-ROM | disk | FTP | other *** search
/ Chip 2004 April / CMCD0404.ISO / Software / Freeware / Programare / groupoffice-com-2.01 / modules / addressbook / import.php < prev    next >
PHP Script  |  2004-03-08  |  19KB  |  495 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. $post_action = isset($post_action) ? $post_action : '';
  15.  
  16. $GO_SECURITY->authenticate();
  17. $GO_MODULES->authenticate('addressbook');
  18. require($GO_LANGUAGE->get_language_file('contacts'));
  19.  
  20. $task = isset($_REQUEST['task']) ? $_REQUEST['task'] : '';
  21. $addressbook_id = isset($_REQUEST['addressbook_id']) ? $_REQUEST['addressbook_id'] : '0';
  22. $return_to = (isset($_REQUEST['return_to']) && $_REQUEST['return_to'] != '') ? $_REQUEST['return_to'] : $_SERVER['HTTP_REFERER'];;
  23.  
  24. //load contact management class
  25. require($GO_CONFIG->class_path."addressbook.class.inc");
  26. $ab = new addressbook();
  27.  
  28. require($GO_THEME->theme_path."header.inc");
  29. ?>
  30. <script type="text/javascript" langugae="javascript">
  31. <!--
  32.  
  33. function import_data()
  34. {
  35.     document.forms[0].task.value='import';
  36.     document.forms[0].submit();
  37. }
  38.  
  39. -->
  40. </script>
  41.  
  42. <form name="import" method="post" action="<?php echo $_SERVER['PHP_SELF']; ?>">
  43. <input type="hidden" name="task" value="import" />
  44. <input type="hidden" name="return_to" value="<?php echo $return_to; ?>" />
  45.  
  46. <?php
  47. $tabtable = new tabtable('export_tab', $contacts_import, '460', '400', '120', '', true);
  48. $tabtable->print_head();
  49. echo '<table border="0" cellpadding="5"><tr><td>';
  50. if ($task == 'import')
  51. {
  52.     $contact_groups[''] = 0;
  53.     $group_mode = isset($_POST['group_mode']) ? $_POST['group_mode'] : 'group_name';
  54.     $group_id = isset($_POST['group_id']) ? $_POST['group_id'] : 'group_id';
  55.     if ($group_mode == 'file')
  56.     {
  57.         $ab->get_groups($_POST['addressbook_id']);
  58.         while ($ab->next_record())
  59.         {
  60.             $contact_groups[$ab->f('name')] = $ab->f('id');
  61.         }
  62.     }
  63.  
  64.     $seperator = isset($_POST['seperator']) ? $_POST['seperator'] : ';';
  65.  
  66.     $fp = fopen($_POST['csv_file'], "r");
  67.  
  68.     if (!$fp || !$addressbook = $ab->get_addressbook($_POST['addressbook_id']))
  69.     {
  70.         unlink($_POST['csv_file']);
  71.         $feedback = "<p class=\"Error\">".$strDataError."</p>";
  72.  
  73.     }else
  74.     {
  75.         fgets($fp, 4096);
  76.         while (!feof($fp))
  77.         {
  78.             $line = str_replace('"', '',fgets($fp, 4096));
  79.  
  80.             $record = explode($seperator, $line);
  81.             if ($_POST['import_type'] == 'contacts')
  82.             {
  83.                 if((isset($record[$_POST['first_name']]) && $record[$_POST['first_name']] != "") || (isset($record[$_POST['last_name']]) && $record[$_POST['last_name']] != ''))
  84.                 {
  85.                     if ($group_mode == 'file')
  86.                     {
  87.                         $group_name = trim($record[$_POST['group_record']]);
  88.                         if (isset($contact_groups[stripslashes($group_name)]))
  89.                         {
  90.                             $group_id = $contact_groups[$group_name];
  91.                         }else
  92.                         {
  93.                             $ab2= new addressbook();
  94.                             $group_id = $ab2->add_group($_POST['addressbook_id'], $group_name);
  95.                             $contact_groups[$group_name] = $group_id;
  96.                         }
  97.                     }
  98.                     $title = isset($record[$_POST['title']]) ? addslashes(trim($record[$_POST['title']])) : '';
  99.                     $first_name = addslashes(trim($record[$_POST['first_name']]));
  100.                     $middle_name = isset($record[$_POST['middle_name']]) ? addslashes(trim($record[$_POST['middle_name']])) : '';
  101.                     $last_name = addslashes(trim($record[$_POST['last_name']]));
  102.                     $initials = isset($record[$_POST['initials']]) ? addslashes(trim($record[$_POST['initials']])) : '';
  103.                     $sex = isset($record[$_POST['sex']]) ? addslashes(trim($record[$_POST['sex']])) : 'M';
  104.                     $birthday = isset($record[$_POST['birthday']]) ? addslashes(trim($record[$_POST['birthday']])) : '';
  105.                     $email = isset($record[$_POST['email']]) ? addslashes(trim($record[$_POST['email']])) : '';
  106.                     $work_phone = isset($record[$_POST['work_phone']]) ? addslashes(trim($record[$_POST['work_phone']])) : '';
  107.                     $home_phone = isset($record[$_POST['home_phone']]) ? addslashes(trim($record[$_POST['home_phone']])) : '';
  108.                     $fax = isset($record[$_POST['fax']]) ? addslashes(trim($record[$_POST['fax']])) : '';
  109.                     $work_fax = isset($record[$_POST['work_fax']]) ? addslashes(trim($record[$_POST['work_fax']])) : '';
  110.                     $cellular = isset($record[$_POST['cellular']]) ? addslashes(trim($record[$_POST['cellular']])) : '';
  111.                     $country = isset($record[$_POST['country']]) ? addslashes(trim($record[$_POST['country']])) : '';
  112.                     $state = isset($record[$_POST['state']]) ? addslashes(trim($record[$_POST['state']])) : '';
  113.                     $city = isset($record[$_POST['city']]) ? addslashes(trim($record[$_POST['city']])) : '';
  114.                     $zip = isset($record[$_POST['zip']]) ? addslashes(trim($record[$_POST['zip']])) : '';
  115.                     $address = isset($record[$_POST['address']]) ? addslashes(trim($record[$_POST['address']])) : '';
  116.                     $company_name = isset($record[$_POST['company_name']]) ? addslashes(trim($record[$_POST['company_name']])) : '';
  117.                     $department = isset($record[$_POST['department']]) ? addslashes(trim($record[$_POST['department']])) : '';
  118.                     $function = isset($record[$_POST['function']]) ? addslashes(trim($record[$_POST['function']])) : '';
  119.  
  120.                     $acl_read = $GO_SECURITY->get_new_acl('contact read');
  121.                     $acl_write = $GO_SECURITY->get_new_acl('contact write');
  122.  
  123.                     if ($acl_read > 0 && $acl_write > 0)
  124.                     {
  125.                         if ($company_name != '')
  126.                         {
  127.                             $company_id = $ab->get_company_id_by_name($company_name, $_POST['addressbook_id']);
  128.                         }else
  129.                         {
  130.                             $company_id = 0;
  131.                         }
  132.                         if($ab->add_contact("", $_POST['addressbook_id'], $first_name, $middle_name, $last_name, $initials, $title, $sex, $birthday, $email, $work_phone, $home_phone, $fax, $cellular, $country, $state, $city, $zip, $address, $company_id, $work_fax, $department, $function,'', $group_id, '', $acl_read, $acl_write))
  133.                         {
  134.                             $GO_SECURITY->copy_acl($addressbook['acl_read'], $acl_read);
  135.                             $GO_SECURITY->copy_acl($addressbook['acl_write'], $acl_write);
  136.                         }else
  137.                         {
  138.                             $GO_SECURITY->delete_acl($acl_read);
  139.                             $GO_SECURITY->delete_acl($acl_write);
  140.                         }
  141.                     }
  142.                 }
  143.             }else
  144.             {
  145.                 if(isset($record[$_POST['name']]) && $record[$_POST['name']] != '')
  146.                 {
  147.                     $name = addslashes(trim($record[$_POST['name']]));
  148.                     $email = isset($record[$_POST['email']]) ? addslashes(trim($record[$_POST['email']])) : '';
  149.                     $phone = isset($record[$_POST['phone']]) ? addslashes(trim($record[$_POST['phone']])) : '';
  150.                     $fax = isset($record[$_POST['fax']]) ? addslashes(trim($record[$_POST['fax']])) : '';
  151.                     $country = isset($record[$_POST['country']]) ? addslashes(trim($record[$_POST['country']])) : '';
  152.                     $state = isset($record[$_POST['state']]) ? addslashes(trim($record[$_POST['state']])) : '';
  153.                     $city = isset($record[$_POST['city']]) ? addslashes(trim($record[$_POST['city']])) : '';
  154.                     $zip = isset($record[$_POST['zip']]) ? addslashes(trim($record[$_POST['zip']])) : '';
  155.                     $address = isset($record[$_POST['address']]) ? addslashes(trim($record[$_POST['address']])) : '';
  156.                     $homepage = isset($record[$_POST['homepage']]) ? addslashes(trim($record[$_POST['homepage']])) : '';
  157.                     $bank_no = isset($record[$_POST['bank_no']]) ? addslashes(trim($record[$_POST['bank_no']])) : '';
  158.                     $vat_no = isset($record[$_POST['vat_no']]) ? addslashes(trim($record[$_POST['vat_no']])) : '';
  159.  
  160.                     $acl_read = $GO_SECURITY->get_new_acl('contact read');
  161.                     $acl_write = $GO_SECURITY->get_new_acl('contact write');
  162.  
  163.                     if ($acl_read > 0 && $acl_write > 0)
  164.                     {
  165.                         if ($ab->add_company($_POST['addressbook_id'], $name, $address, $zip, $city, $state, $country, $email, $phone, $fax, $homepage, $bank_no, $vat_no, $acl_read, $acl_write))
  166.                         {
  167.                             $GO_SECURITY->copy_acl($addressbook['acl_read'], $acl_read);
  168.                             $GO_SECURITY->copy_acl($addressbook['acl_write'], $acl_write);
  169.                         }else
  170.                         {
  171.                             $GO_SECURITY->delete_acl($acl_read);
  172.                             $GO_SECURITY->delete_acl($acl_write);
  173.                         }
  174.                     }
  175.                 }
  176.             }
  177.         }
  178.         fclose($fp);
  179.         unlink($_POST['csv_file']);
  180.         echo  $contacts_import_success;
  181.         echo '<br /><br />';
  182.         $button = new button($cmdOk, "javascript:document.location='".$return_to."'");
  183.     }
  184.  
  185. }
  186.  
  187. if ($task == 'upload')
  188. {
  189.  
  190.     $csv_file = $GO_CONFIG->tmpdir.'contacts_import_csv_'.$GO_SECURITY->user_id.'.csv';
  191.  
  192.     if (isset($_FILES['csv_file']) && is_uploaded_file($_FILES['csv_file']['tmp_name']))
  193.     {
  194.         if(!copy($_FILES['csv_file']['tmp_name'], $csv_file))
  195.         {
  196.             unset($csv_file);
  197.             echo '<p class="Error">'.$fbNoFile.'</p>';
  198.             echo '<br /><br />';
  199.             $button = new button($cmdOk, "javascript:document.location='".$return_to."'");
  200.  
  201.         }
  202.     }elseif(!file_exists($csv_file))
  203.     {
  204.         unset($csv_file);
  205.         echo '<p class="Error">'.$fbNoFile.'</p>';
  206.         echo '<br /><br />';
  207.         $button = new button($cmdOk, "javascript:document.location='".$return_to."'");
  208.     }
  209.  
  210.     if (isset($csv_file))
  211.     {
  212.         echo '<input type="hidden" name="addressbook_id" value="'.$addressbook_id.'">';
  213.         echo '<input type="hidden" value="'.$csv_file.'" name="csv_file" />';
  214.         $fp = fopen($csv_file, 'r');
  215.  
  216.         if ($fp)
  217.         {
  218.             $line = str_replace('"','',fgets($fp, 4096));
  219.             fclose($fp);
  220.             $seperator=';';
  221.  
  222.             $record = explode($seperator, $line);
  223.  
  224.             //when nothing gets exploded then try again with different seperator
  225.             if (strlen($record[0]) == strlen($line))
  226.             {
  227.                 $seperator = ',';
  228.                 $record = explode($seperator, $line);
  229.             }
  230.             //when it's still not exploded then the file is not compatible.
  231.             if (strlen($record[0]) == strlen($line))
  232.             {
  233.                 echo '<p class="Error">'.$contacts_import_incompatible.'</p>';
  234.             }else
  235.             {
  236.                 echo '<input type="hidden" name="seperator" value="'.$seperator.'">';
  237.                 echo '<input type="hidden" name="import_type" value="'.$_POST['import_type'].'">';
  238.                 if (isset($feedback))
  239.                 {
  240.                     echo $feedback;
  241.                 }
  242.                 echo $contacts_import_feedback.'<br /><br />';
  243.  
  244.                 if ($_POST['import_type'] == 'contacts')
  245.                 {
  246.                     echo '<table border="0" cellpadding="2" cellspacing="0">';
  247.                     $group_mode = isset($_POST['group_mode']) ? $_POST['group_mode'] : 'group_name';
  248.  
  249.                     if ($ab->get_groups($addressbook_id) > 0)
  250.                     {
  251.                         $check = $group_mode == 'group_name' ? 'checked' : '';
  252.                         echo '<tr><td><input type="radio" name="group_mode" value="group_name" '.$check.' />'.$contacts_import_to_group.': </td><td>';
  253.                         $group_id = isset($_POST['group_id']) ? $_POST['group_id'] : 0;
  254.                         $dropbox = new dropbox();
  255.                         $dropbox->add_value('0',$contacts_other);
  256.                         $dropbox->add_sql_data('ab','id','name');
  257.                         $dropbox->print_dropbox('group_id',$group_id);
  258.                         echo '</td></tr>';
  259.                         $check = $group_mode == 'file' ? 'checked' : '';
  260.                         echo '<tr><td><input type="radio" name="group_mode" value="file" '.$check.'  />'.$contacts_auto_group.': </td><td>';
  261.                     }else
  262.                     {
  263.                         $check = $group_mode == 'file' ? true : false;
  264.                         echo '<tr><td><input type="hidden" name="group_id" value="0" />';
  265.                         $checkbox = new checkbox('group_mode', 'file', $ab_group_on_file, $check);
  266.                         echo ':</td><td>';
  267.                     }
  268.                     $dropbox = new dropbox();
  269.                     for ($n=0;$n<sizeof($record);$n++)
  270.                     {
  271.                         $dropbox->add_value($n,$record[$n]);
  272.                     }
  273.                     $group_record = isset($_POST['group_record']) ? $_POST['group_record'] : 0;
  274.                     $dropbox->print_dropbox('group_record', $group_record);
  275.                     echo '</td></tr></table><br />';
  276.  
  277.                     $dropbox = new dropbox();
  278.                     $required_dropbox = new dropbox();
  279.                     $dropbox->add_value('-1',$strNotIncluded);
  280.                     for ($n=0;$n<sizeof($record);$n++)
  281.                     {
  282.                         $required_dropbox->add_value($n,$record[$n]);
  283.                         $dropbox->add_value($n,$record[$n]);
  284.                     }
  285.  
  286.  
  287.                     echo '<table border="0" cellpadding="4" cellspacing="0">';
  288.                     echo '<tr><td><h3>Group-Office</h3></td>';
  289.                     echo '<td><h3>CSV</h3></td></tr>';
  290.  
  291.                     $title = isset($_POST['title']) ? $_POST['title'] : -1;
  292.                     echo '<tr><td>'.$strTitle.':</td><td>';
  293.                     $dropbox->print_dropbox('title', $title);
  294.                     echo '</td></tr>';
  295.  
  296.                     $first_name = isset($_POST['first_name']) ? $_POST['first_name'] : 0;
  297.                     echo '<tr><td>'.$strFirstName.':</td><td>';
  298.                     $required_dropbox->print_dropbox('first_name', $first_name);
  299.                     echo '</td></tr>';
  300.  
  301.                     $middle_name = isset($_POST['middle_name']) ? $_POST['middle_name'] : -1;
  302.                     echo '<tr><td>'.$strMiddleName.':</td><td>';
  303.                     $dropbox->print_dropbox('middle_name', $middle_name);
  304.                     echo '</td></tr>';
  305.  
  306.                     $last_name = isset($_POST['last_name']) ? $_POST['last_name'] : 0;
  307.                     echo '<tr><td>'.$strLastName.':</td><td>';
  308.                     $required_dropbox->print_dropbox('last_name', $last_name);
  309.                     echo '</td></tr>';
  310.  
  311.                     $initials = isset($_POST['initials']) ? $_POST['initials'] : -1;
  312.                     echo '<tr><td>'.$strInitials.':</td><td>';
  313.                     $dropbox->print_dropbox('initials', $initials);
  314.                     echo '</td></tr>';
  315.  
  316.                     $sex = isset($_POST['sex']) ? $_POST['sex'] : -1;
  317.                     echo '<tr><td>'.$strSex.':</td><td>';
  318.                     $dropbox->print_dropbox('sex', $sex);
  319.                     echo '</td></tr>';
  320.  
  321.                     $birthday = isset($_POST['birthday']) ? $_POST['birthday'] : -1;
  322.                     echo '<tr><td>'.$strBirthday.':</td><td>';
  323.                     $dropbox->print_dropbox('birthday', $birthday);
  324.                     echo '</td></tr>';
  325.  
  326.                     $address = isset($_POST['address']) ? $_POST['address'] : -1;
  327.                     echo '<tr><td>'.$strAddress.':</td><td>';
  328.                     $dropbox->print_dropbox('address', $address);
  329.                     echo '</td></tr>';
  330.  
  331.                     $zip = isset($_POST['zip']) ? $_POST['zip'] : -1;
  332.                     echo '<tr><td>'.$strZip.':</td><td>';
  333.                     $dropbox->print_dropbox('zip', $zip);
  334.                     echo '</td></tr>';
  335.  
  336.                     $city = isset($_POST['city']) ? $_POST['city'] : -1;
  337.                     echo '<tr><td>'.$strCity.':</td><td>';
  338.                     $dropbox->print_dropbox('city', $city);
  339.                     echo '</td></tr>';
  340.  
  341.                     $state = isset($_POST['state']) ? $_POST['state'] : -1;
  342.                     echo '<tr><td>'.$strState.':</td><td>';
  343.                     $dropbox->print_dropbox('state', $state);
  344.                     echo '</td></tr>';
  345.  
  346.                     $country = isset($_POST['country']) ? $_POST['country'] : -1;
  347.                     echo '<tr><td>'.$strCountry.':</td><td>';
  348.                     $dropbox->print_dropbox('country', $country);
  349.                     echo '</td></tr>';
  350.  
  351.                     $email = isset($_POST['email']) ? $_POST['email'] : -1;
  352.                     echo '<tr><td>'.$strEmail.':</td><td>';
  353.                     $dropbox->print_dropbox('email', $email);
  354.                     echo '</td></tr>';
  355.  
  356.                     $home_phone = isset($_POST['home_phone']) ? $_POST['home_phone'] : -1;
  357.                     echo '<tr><td>'.$strPhone.':</td><td>';
  358.                     $dropbox->print_dropbox('home_phone', $home_phone);
  359.                     echo '</td></tr>';
  360.  
  361.                     $fax = isset($_POST['fax']) ? $_POST['fax'] : -1;
  362.                     echo '<tr><td>'.$strFax.':</td><td>';
  363.                     $dropbox->print_dropbox('fax', $fax);
  364.                     echo '</td></tr>';
  365.  
  366.                     $work_phone = isset($_POST['work_phone']) ? $_POST['work_phone'] : -1;
  367.                     echo '<tr><td>'.$strWorkphone.':</td><td>';
  368.                     $dropbox->print_dropbox('work_phone', $work_phone);
  369.                     echo '</td></tr>';
  370.  
  371.                     $work_fax = isset($_POST['work_fax']) ? $_POST['work_fax'] : -1;
  372.                     echo '<tr><td>'.$strWorkFax.':</td><td>';
  373.                     $dropbox->print_dropbox('work_fax', $work_fax);
  374.                     echo '</td></tr>';
  375.  
  376.                     $cellular = isset($_POST['cellular']) ? $_POST['cellular'] : -1;
  377.                     echo '<tr><td>'.$strCellular.':</td><td>';
  378.                     $dropbox->print_dropbox('cellular', $cellular);
  379.                     echo '</td></tr>';
  380.  
  381.                     $company_name = isset($_POST['company_name']) ? $_POST['company_name'] : -1;
  382.                     echo '<tr><td>'.$strCompany.':</td><td>';
  383.                     $dropbox->print_dropbox('company_name', $company_name);
  384.                     echo '</td></tr>';
  385.  
  386.                     $department = isset($_POST['department']) ? $_POST['department'] : -1;
  387.                     echo '<tr><td>'.$strDepartment.':</td><td>';
  388.                     $dropbox->print_dropbox('department', $department);
  389.                     echo '</td></tr>';
  390.  
  391.                     $function = isset($_POST['function']) ? $_POST['function'] : -1;
  392.                     echo '<tr><td>'.$strFunction.':</td><td>';
  393.                     $dropbox->print_dropbox('function', $function);
  394.                     echo '</td></tr>';
  395.                     echo '</table>';
  396.                 }else
  397.                 {
  398.                     $dropbox = new dropbox();
  399.                     $required_dropbox = new dropbox();
  400.                     $dropbox->add_value('',$strNotIncluded);
  401.                     for ($n=0;$n<sizeof($record);$n++)
  402.                     {
  403.                         $dropbox->add_value($n,$record[$n]);
  404.                         $required_dropbox->add_value($n,$record[$n]);
  405.                     }
  406.                     echo '<table border="0" cellpadding="4" cellspacing="0">';
  407.                     echo '<tr><td><h3>Group-Office</h3></td>';
  408.                     echo '<td><h3>CSV</h3></td></tr>';
  409.                     $name = isset($_POST['name']) ? $_POST['name'] : 0;
  410.                     echo '<tr><td>'.$strName.':</td><td>';
  411.                     $required_dropbox->print_dropbox('name', $name);
  412.                     echo '</td></tr>';
  413.  
  414.                     $address = isset($_POST['address']) ? $_POST['address'] : -1;
  415.                     echo '<tr><td>'.$strAddress.':</td><td>';
  416.                     $dropbox->print_dropbox('address', $address);
  417.                     echo '</td></tr>';
  418.  
  419.                     $zip = isset($_POST['zip']) ? $_POST['zip'] : -1;
  420.                     echo '<tr><td>'.$strZip.':</td><td>';
  421.                     $dropbox->print_dropbox('zip', $zip);
  422.                     echo '</td></tr>';
  423.  
  424.                     $city = isset($_POST['city']) ? $_POST['city'] : -1;
  425.                     echo '<tr><td>'.$strCity.':</td><td>';
  426.                     $dropbox->print_dropbox('city', $city);
  427.                     echo '</td></tr>';
  428.  
  429.                     $state = isset($_POST['state']) ? $_POST['state'] : -1;
  430.                     echo '<tr><td>'.$strState.':</td><td>';
  431.                     $dropbox->print_dropbox('state', $state);
  432.                     echo '</td></tr>';
  433.  
  434.                     $country = isset($_POST['country']) ? $_POST['country'] : -1;
  435.                     echo '<tr><td>'.$strCountry.':</td><td>';
  436.                     $dropbox->print_dropbox('country', $country);
  437.                     echo '</td></tr>';
  438.  
  439.                     $email = isset($_POST['email']) ? $_POST['email'] : -1;
  440.                     echo '<tr><td>'.$strEmail.':</td><td>';
  441.                     $dropbox->print_dropbox('email', $email);
  442.                     echo '</td></tr>';
  443.  
  444.                     $phone = isset($_POST['phone']) ? $_POST['phone'] : -1;
  445.                     echo '<tr><td>'.$strPhone.':</td><td>';
  446.                     $dropbox->print_dropbox('phone', $phone);
  447.                     echo '</td></tr>';
  448.  
  449.                     $fax = isset($_POST['fax']) ? $_POST['fax'] : -1;
  450.                     echo '<tr><td>'.$strFax.':</td><td>';
  451.                     $dropbox->print_dropbox('fax', $fax);
  452.                     echo '</td></tr>';
  453.  
  454.                     $homepage = isset($_POST['homepage']) ? $_POST['homepage'] :-1;
  455.                     echo '<tr><td>'.$strHomepage.':</td><td>';
  456.                     $dropbox->print_dropbox('homepage', $homepage);
  457.                     echo '</td></tr>';
  458.  
  459.                     $bank_no = isset($_POST['bank_no']) ? $_POST['bank_no'] : -1;
  460.                     echo '<tr><td>'.$ab_bank_no.':</td><td>';
  461.                     $dropbox->print_dropbox('bank_no', $bank_no);
  462.                     echo '</td></tr>';
  463.  
  464.                     $vat_no = isset($_POST['vat_no']) ? $_POST['vat_no'] : -1;
  465.                     echo '<tr><td>'.$ab_vat_no.':</td><td>';
  466.                     $dropbox->print_dropbox('vat_no', $vat_no);
  467.                     echo '</td></tr>';
  468.                     echo '</table>';
  469.                 }
  470.  
  471.                 echo "<tr><td colspan=\"2\"><br />";
  472.                 $button = new button($cmdOk, 'javascript:import_data()');
  473.                 echo '  ';
  474.                 $button = new button($cmdClose, "javascript:document.location='".$return_to."'");
  475.                 echo "</td></tr>";
  476.                 echo "</table>";
  477.                 echo "</td></tr>";
  478.                 echo "</table>";
  479.                 $tabtable->print_foot();
  480.                 echo "</td></tr>";
  481.                 echo "</table>";
  482.                 require($GO_THEME->theme_path.'footer.inc');
  483.                 exit();
  484.             }
  485.         }
  486.     }
  487. }
  488. echo '</td></tr></table>';
  489. $tabtable->print_foot();
  490. ?>
  491. </form>
  492. <?php
  493. require($GO_THEME->theme_path.'footer.inc');
  494. ?>
  495.