Location: PHPKode > projects > Phpgw Time Tracking Add On App > timetrack/deletecustomer.php
<?php
  /**************************************************************************\
  * phpgwtimetrack - phpGroupWare addon application                          *
  * http://phpgwtimetrack.sourceforge.net                                    *
  * Written by Robert Schader <hide@address.com>                         *
  * --------------------------------------------                             *
  *  This program is free software; you can redistribute it and/or modify it *
  *  under the terms of the GNU General Public License as published by the   *
  *  Free Software Foundation; either version 2 of the License, or (at your  *
  *  option) any later version.                                              *
  \**************************************************************************/

  /* $Id: deletecustomer.php,v 1.3 2001/01/08 21:28:36 rschader Exp $ */

  if ($confirm) {
     $phpgw_info["flags"] = array("noheader" => True, "nonavbar" => True);
  }

  $phpgw_info["flags"]["enable_nextmatchs_class"] = "True";
  $phpgw_info["flags"]["currentapp"] = "timetrack";
  include("../header.inc.php");

  if (($cid) && (! $confirm)) {
     ?>
     <center>
      <table border=0 with=65%>
       <tr colspan=2>
        <td align=center>
         <?php echo lang("Are you sure you want to delete this customer ?"); ?>
        <td>
       </tr>
       <tr colspan=2>
        <td align=center>
         <?php echo lang("Any addressbook entries for this customer will also be deleted!"); ?>
        </td>
       </tr>
       <tr>
         <td>
           <a href="<?php echo $phpgw->link("customers.php") . "\">" . lang("No"); ?></a>
         </td>
         <td>
           <a href="<?php echo $phpgw->link("deletecustomer.php","cid=$cid&confirm=true") . "\">" . lang("Yes"); ?></a>
         </td>
       </tr>
      </table>
     </center>
     <?
     $phpgw->common->phpgw_footer();
  }

  if ($confirm) {

     $table_locks = array('addressbook','customers');
     $phpgw->db->lock($table_locks);

     $phpgw->db->query("delete from addressbook where ab_company_id='$cid'");
     $phpgw->db->query("delete from customers where company_id='$cid'");
     $phpgw->db->unlock();

     Header("Location: " . $phpgw->link("customers.php"));
  }
?>
Return current item: Phpgw Time Tracking Add On App