PHP/jQuery code for BIT third year project