<?php
//	 for debug
/*
	error_reporting(E_ALL);          //���php error
		ini_set("display_errors", 1);	//���php ERROR
ini_set('display_startup_errors', TRUE);
	ini_set("max_execution_time",90);
var_dump($_POST);
*/

	$principal = array("1234");   //校長的STAFFCODE from SAMS
	$vineprincipal = array( "2345" , "2346");  // 副校長的STAFFCODE
	$principalhelp = array("3456");  //助理校長的STAFFCODE

		$host = 'localhost';   	// 數據庫服務器
		$user = 'userid';   		// 數據庫用戶名
		$password = 'P@ssw0rd123';   		// 數據庫密碼
		$sportdaydatabase = 'sportday'; //運動會數據庫
	$ip = $_SERVER["SERVER_NAME"];
	$base_dir  = __DIR__;
	$doc_root  = preg_replace("!{$_SERVER['SCRIPT_NAME']}$!", '', $_SERVER['SCRIPT_FILENAME']);
	$folder = preg_replace("!^{$doc_root}!", '', $base_dir);;
	$url = $ip.$folder;
	$splink = 	mysqli_connect($host, $user, $password, $sportdaydatabase);
	if ($splink->connect_errno) {
    	echo "Failed to connect to MySQL: (" . $splink->connect_errno . ") " . $splink->connect_error;
	}
    $result = 	mysqli_set_charset($splink, "utf8"); //設定以UTF-8連結數據庫



?>