Location: PHPKode > projects > ConPortal > conportal/inc/checkout.php
<?php
/*
 *  ConPortal - Pomona College ITS scheduling appplication
 *  Copyright (C) 2005-2006  Pomona College
 *
 *  This program is free software; you can redistribute it and/or modify
 *  it under the terms of version 2 of the GNU General Public License
 *  as published by the Free Software Foundation.
 *
 *  This program 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., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 */

function get_checkout_items()
{
    $result = safeQuery("select * from checkout_items");
    if (!mysql_num_rows($result))
        return NULL;
    $data = array();
    while ($row = mysql_fetch_assoc($result))
        $data[] = $row;
    //FIXME: We need to be stripping slashes here.
    return $data;
}

function add_checkout_item($name,$number)
{
  db_connect($db);
  if (!(is_numeric($number)&&intval($number)==$number))
  {
    die("The number specified is invalid.");
  }
  $name = addslashes($name);
  $query = "insert into checkout_items set name=\"".$name.
           "\", total=\"".$number."\"";
  mysql_query($query);
  return;
}
?>
Return current item: ConPortal