<?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.4.1 2006/10/24 06:53:05 skwashd Exp $ */

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

	$request = $_POST['request'] ? $_POST['request'] : $_GET['request'];
	$addshow = $_POST['addshow'] ? $_POST['addshow'] : $_GET['addshow'];
	$songlist = $_POST['songlist'] ? $_POST['songlist'] : $_GET['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();
?>
