<?php
  /**************************************************************************\
  * phpGroupWare - Brewer Main Brew Calc                                     *
  * http://www.phpgroupware.org                                              *
  * Written by Miles Lott [milosch@phpgroupware.org]                         *
  * -----------------------------------------------                          *
  *  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: std_test.php,v 1.1 2001/06/29 03:09:22 milosch Exp $ */

	$phpgw_info["flags"] = array(
		'currentapp' => 'brewer',
		'enable_sbox_class' => True,
		'enable_nextmatchs_class' => True
	);

	include('../header.inc.php');

	$tbldef = array(
		'phpgw_brewer_recipes', array(
			'id'             => 0,
			'name'           => '',
			'style'          => 0,
			'total_vol'      => 0,
			'vol_units'      => '',
			'boil_vol'       => 0,
			'boil_units'     => '',
			'boil_time'      => 0,
			'yeasts'         => array(),
			'num_yeasts'     => 0,
			'yeast_amounts'  => array(),
			'yeast_units'    => '',
			'malts'          => '',
			'num_malts'      => 0,
			'malt_amounts'   => array(),
			'malt_colors'    => array(),
			'malt_gravities' => array(),
			'malt_units'     => '',
			'hops'           => '',
			'num_hops'       => 0,
			'hop_amounts'    => array(),
			'hop_units'      => '',
			'hop_times'      => array(),
			'hop_IBUs'       => array(),
			'hop_bag'        => '',
			'IBU_method'     => '',
			'extraction_efficiency' => 0,
			'apparent_attenuation'  => 0,
			'real_attenuation'      => 0,
			'original_gravity'      => 0,
			'final_gravity'         => 0,
			'alcohol_by_volume'     => 0,
			'color'          => '',
			'IBUs'           => ''
		)
	);
	$obj = CreateObject('brewer.std',$tbldef);
	$obj->debug = True;
	$obj->qfields = 'name,original_gravity,final_gravity';
	$obj->qstr = 'ale';

	$obj->get_list();

	if($obj->debug)
	{
		echo '<pre>';
		print_r($obj->data);
		echo '</pre>';
	}
	$info = $obj->db->metadata('phpgw_brewer_recipes');

	//$obj->qfields = '';
	$obj->qstr = '';
	$obj->get(5);

	if($obj->debug)
	{
		echo '<pre>';
		print_r($info);
		print_r($obj->data);
		echo '</pre>';
	}

	$phpgw->common->phpgw_footer();
?>
