(1) Make such orders or judgments as may be necessary to prevent the use or employment by a person of any practices declared to be a violation of this act; (2) make such orders or judgments as may be necessary to compensate the state or any persons for damages sustained; or (3) grant other appropriate relief. (d) Upon a showing by the attorney general, county or district attorney in an application