First and Second Order Phase Transitions and Magnetic Hysteresis in a Superconducting Plate