<?php
	$act=$_GET['act'];

	switch ($act){
		case 'update_sName':
			$sid=$_GET['sid'];
			$sName=$_GET['sName'];
			update_sName($sid,$sName);
			break;
		case 'update_sCode':
			$sid=$_GET['sid'];
			$sCode=$_GET['sCode'];
			update_sCode($sid,$sCode);
			break;
	}


	function update_sName($sid,$sName){
		include($_SERVER['DOCUMENT_ROOT'] ."/_ps2020/config/connect.php");

			$result = $conn->query("UPDATE school_class SET class_name='".$sName."' WHERE class_id='".$sid."'");

		$conn->close();
	}

	function update_sCode($sid,$sCode){
		include($_SERVER['DOCUMENT_ROOT'] ."/_ps2020/config/connect.php");

			if ( $conn->query("UPDATE school_class SET specific_classCode='".$sCode."' WHERE class_id='".$sid."'") === true ){
				echo 1;
			}

		$conn->close();
	}
?>