<?                                             
////////////////////////////////////////////////////////////////////////
/*SMI - SHOUTcast Management Interface                                  
A web based shoutcast server management program                         
Founding Author: Scott D. Harvanek <scotth@sourcemirrors.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.

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 Street, Fifth Floor, Boston, MA 02110-1301 USA.*/
////////////////////////////////////////////////////////////////////////
//
// Here we setup our function to connect to our MySQL server
//
//////////////////////////////////////////////////
$db = false;
function connectdb(){
include('./config.php');
global $db;
$db = mysql_connect("$dbhost", "$dbuser", "$dbpass") or die('Script Could not connect to database');
mysql_select_db("$dbname",$db);
return $db;
}


//////////////////////////////////////////////////
//
// Get our servers configured playlist
//
//////////////////////////////////////////////////

function getserverpls(){
include('./config.php');
connectdb();
$query = mysql_query("Select playlist FROM servers WHERE id='".$sid."'");
$pid = mysql_fetch_row($query);
return $pid[0];
}

//////////////////////////////////////////////////
//
// Add request function
//
//////////////////////////////////////////////////

function addrequest($fid){
connectdb();
mysql_query("INSERT INTO requests(file) VALUES('".$fid."')");
}

