<?php
if($_POST["project_selected"] != null || $_POST["project_selected"] != "" ){
	echo "project_selected:".$project_selected = $_POST["project_selected"];
	$_SESSION["project_selected"] = $project_selected;
	/* Database credentials. Assuming you are running MySQL
	server with default setting (user 'root' with no password) */
	if($project_selected == 1){
		echo "phssb_rpms_ppr";
		define('DB_SERVER', 'localhost');
		define('DB_USERNAME', 'root');
		define('DB_PASSWORD', 'admin');
		define('DB_NAME', 'phssb_rpms_ppr');


		/* Attempt to connect to MySQL database */
		$link = mysqli_connect(DB_SERVER, DB_USERNAME, DB_PASSWORD, DB_NAME);
		 
		// Check connection
		if($link === false){
			die("ERROR: Could not connect. " . mysqli_connect_error());
		}
	}
	else if($project_selected == 2 )
	{
		echo "phssb_rpms_hp";
		define('DB_SERVER', 'localhost');
		define('DB_USERNAME', 'root');
		define('DB_PASSWORD', 'admin');
		define('DB_NAME', 'phssb_rpms_hp');


		/* Attempt to connect to MySQL database */
		$link = mysqli_connect(DB_SERVER, DB_USERNAME, DB_PASSWORD, DB_NAME);
		 
		// Check connection
		if($link === false){
			die("ERROR: Could not connect. " . mysqli_connect_error());
		}
	}
	else if($project_selected == 3){
		echo "phssb_rpms_sss";
		define('DB_SERVER', 'localhost');
		define('DB_USERNAME', 'root');
		define('DB_PASSWORD', 'admin');
		define('DB_NAME', 'phssb_rpms_sss');


		/* Attempt to connect to MySQL database */
		$link = mysqli_connect(DB_SERVER, DB_USERNAME, DB_PASSWORD, DB_NAME);
		 
		// Check connection
		if($link === false){
			die("ERROR: Could not connect. " . mysqli_connect_error());
		}
	}
}
else if($_GET["project"] != null || $_GET["project"] != ""){
$project = $_GET["project"];
if($project == 1)
	require_once "config_ppr.php";
else if($project == 2)
	require_once "config_hp.php";
else if($project == 2)
	require_once "config_sss.php";
}
?>