<?php

function get_period($school_period_id,$title='',$column='TITLE')
{	global $_SYSTEM;

	if(!$_SYSTEM['get_period'])
	{
		$sql = "SELECT TITLE,SHORT_NAME,SCHOOL_PERIOD_ID,SORT_ORDER,LENGTH,LENGTH_SUN,LENGTH_MON,LENGTH_TUE,LENGTH_WED,LENGTH_THU,LENGTH_FRI,LENGTH_SAT FROM SCHOOL_PERIODS WHERE SCHOOL_YEAR='".get_school_year()."'";
		$_SYSTEM['get_period'] = db_request(db_execute($sql),array(),array('SCHOOL_PERIOD_ID'));
	}
	
	return $_SYSTEM['get_period'][$school_period_id][1][$column];
}
?>