<?php
  /**************************************************************************\
  * phpGroupWare - phpgw_dj                                                  *
  * 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: show.php,v 1.8 2001/09/30 06:31:55 milosch Exp $ */

	$GLOBALS['phpgw_info']['flags'] = array(
		'noheader'   => True,
		'nonavbar'   => True,
		'currentapp' => 'dj'
	);
	include('../header.inc.php');

	$request = $HTTP_POST_VARS['request'] ? $HTTP_POST_VARS['request'] : $HTTP_GET_VARS['request'];
	$addshow = $HTTP_POST_VARS['addshow'] ? $HTTP_POST_VARS['addshow'] : $HTTP_GET_VARS['addshow'];
	$songlist = $HTTP_POST_VARS['songlist'] ? $HTTP_POST_VARS['songlist'] : $HTTP_GET_VARS['songlist'];

	if ($request)
	{
		$ssonglist = rawurlencode(serialize($songlist));
		Header('Location: ' . $GLOBALS['phpgw']->link('/dj/request.php',"songlist=" . $ssonglist . "&cat_id=$cat_id&start=$start"));
		$GLOBALS['phpgw']->common->phpgw_exit();
	}

	$GLOBALS['phpgw']->common->phpgw_header();
	echo parse_navbar();

	if ($addshow)
	{
		echo '<br>called from addshow button.' . "\n";
		@reset($songlist);
		while (list($key,$id) = @each($songlist))
		{
			$GLOBALS['phpgw']->db->query("SELECT song_artist,song_title FROM phpgw_dj_songlist WHERE song_id='$id'");
			$GLOBALS['phpgw']->db->next_record();
			echo '<br>' . $id . ': ' . $GLOBALS['phpgw']->db->f(0) . ' - ' . $GLOBALS['phpgw']->db->f(1) . "\n";
		}
/*		@reset($songlist);
		$sql = "INSERT INTO phpgw_dj_shows (show_name,show_data,show_owner) VALUES ("
			. "'" . "show name" . "',"
			. "'" . serialize($songlist) . "',"
			. $GLOBALS['phpgw_info']['user']['account_id'] . ")";
		$GLOBALS['phpgw']->db->query($sql);
*/			
	}
	echo '<br>Not yet implemented' . "\n";
	$GLOBALS['phpgw']->common->phpgw_footer();
?>
