<?php
	session_start();

	$data='';
	$condition='';
	
//echo 'on y est '.$_GET['colorH'].' / '.$_GET['colorF'];	
 
	$DS= DIRECTORY_SEPARATOR;
	$ROOT=dirname(dirname(dirname(dirname(__FILE__))));
	define('BASE_URL',dirname(dirname(dirname(dirname($_SERVER['SCRIPT_NAME']))))); 

	require $ROOT.$DS.'webroot'.$DS.'includes'.$DS.'lib_inc.php';
	//require $ROOT.$DS.'core'.$DS.'functions.php'; 
	require $ROOT.$DS.'core'.$DS.'Router.php'; 
	require $ROOT.$DS.'config'.$DS.'conf.php';

	require $ROOT.$DS.'core'.$DS.'Model.php'; 
	$Users = new Model();
	
	$table = 'oxg_users';
	$Users->table = $table;	

	if (isset($_GET['colorH'])) {
		$_SESSION['s_colorH'] = $_GET['colorH'];
		$_SESSION['s_colorF'] = $_GET['colorF'];
		$condition = "login='".$_SESSION['s_user']."'";
		$data=array('colorH'=>"#".$_GET['colorH'],'colorF'=>"#".$_GET['colorF']);
		$result_upd=$Users->update($data,$condition);
		
		echo $_SESSION['s_colorH'] .'$'.$_SESSION['s_colorF'];
		
	}

	if (isset($_GET['skin'])) {
		$_SESSION['s_skin'] = $_GET['skin'];
		
		$condition = "login='".$_SESSION['s_user']."'";
		$data=array('skin'=>$_GET['skin']);
		$result_upd=$Users->update($data,$condition);
		
		echo $_SESSION['s_skin'];
	}

			


				
				
				


	