<?/*
Copyright (C) 2003 Media Net Link, Inc. Danville, CA 94526 USA

This file is part of AthenaRMS.

AthenaRMS 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.

AthenaRMS is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
*/?>
<?php

require_once 'base_object.php';

class Modify_Ticket_Types extends Base_Object {
  function Modify_Ticket_Types () {
    global $dbi;
    $this->db = &$dbi;
  }

  function Add ($status) {
    $h = $this->db->prepare ('
      insert into modify_ticket_types (
        modify_tickets
      ) values (
        ?
      )
    ');
    $res = $this->db->execute ($h, array($status));
    if (DB::isError($res)) {
       $this->error = $res->getMessage();
       return;
    }
  }

  function Delete ($status) {
    $h = $this->db->prepare ('
      delete from modify_ticket_types
       where status = ?
    ');
    $res = $this->db->execute ($h, array($status));
    if (DB::isError($res)) {
       $this->error = $res->getMessage();
       return;
    }
  }

  function &List_All () {
    $sql = '
      select modify_tickets
        from modify_ticket_types
    order by modify_tickets
    ';

    $res = $this->db->getCol( $sql );

    if (DB::isError($res)) {
       $this->error = $res->getMessage();
       return;
    }

    if (count($res)) {
      return $res;
    } else {
      return array();
    }
  }
}
?>
