<?php
	session_start();
	define ( '_source' , './sources/');
	define ( '_lib' , './libraries/');
    define ( '_template' , './templates/');
	include_once _lib."config.php";
	include_once _lib."AntiSQLInjection.php";
	include_once _lib."constant.php";
	include_once _lib."functions.php";
	include_once _lib."class.database.php";

	$d = new database($config['database']);

	if(!isset($_SESSION['value']))
	{
		$_SESSION['value']='1';
		}
	if(empty($_SESSION['lang']))
	{
		$_SESSION['lang']='vi';
	}

	if(!empty($_GET['lang'])){
			$_SESSION['lang']=$_GET['lang'];
			header("location:".$_SESSION['links']);
	}
	$lang=$_SESSION['lang'];

	// include_once _lib."functions_share.php";
	// if($_POST['command']=='add' && $_POST['productid']>0){
	// $pid=$_POST['productid'];
	// $size=$_POST['idsize'];
 //    $mau=$_POST['idmau'];
	// $q=(int)$_POST['quality'] ? $_POST['quality'] : "1";
	// addtocart($pid,$q,$mau,$size);
	// redirect("gio-hang.html");}

	// include_once _lib."functions_giohang.php";
	include_once _source."lang_$lang.php";
	include_once _lib."file_requick.php";
	include_once _lib."counter.php";
	include_once _lib."web_config.php";
	include_once _source."template.php";
	$_SESSION['links']=getCurrentPageURL();
	include 'desktop.php';
?>