How does Prop 36 affect possible charges and punishment?

If you go into the Prop 36 program, you plead guilty and are sentenced, but if you complete the program you can petition to have the case dismissed.