<?xml version="1.0" encoding="UTF-8"?>
<scenario begin="select_product">

	<!-- AirCash -->
	<screen id="select_product" type="selector/image" title="Alege produsul">
		<fields>
			<selector-field id="product_value" title="Produs">
				<items type="static">
					<item value="25" title="25 RON" image="aircash_25.png"/>
					<item value="50" title="50 RON" image="aircash_50.png"/>
					<item value="100" title="100 RON" image="aircash_100.png"/>
					<item value="150" title="150 RON" image="aircash_150.png"/>
					<item value="200" title="200 RON" image="aircash_200.png"/>
					<item value="300" title="300 RON" image="aircash_300.png"/>
				</items>
			</selector-field>
		</fields>
		<actions>
			<action type="Next" title="Inainte">
				<goto target="account"/>
			</action>
			<action type="Prev" title="Inapoi">
				<goto target="exit"/>
			</action>
			<action type="Exit" title="Pagina principala">
				<goto target="exit"/>
			</action>
		</actions>
	</screen>

	<!-- Adresa de email -->
	<screen id="account" type="group" title="Email">
		<fields>
			<text-field id="id1" keyboard="any:[en,symb]:lower:true" max-len="99" message="Introduceti adresa de email" title="Email" default="">
				<validator type="regex">
					<rules>
						<rule regex="^[-\w.]+@([A-z0-9][-A-z0-9]+\.)+[A-z]{2,4}$"/>
					</rules>
				</validator>
				<help>
					<![CDATA[<html><center>Introduceti adresa dvs de email]]>
				</help>
			</text-field>
		</fields>
		<actions>
			<action type="Next" title="Inainte">
				<goto target="confirm"/>
<!--				<set key="service_name" value="psc"/>-->
<!--&lt;!&ndash;				<load from="point.id" key="trm_id"/>&ndash;&gt;-->
<!--				<online-request type="default" function="check_request" params="id1,service_name">-->
<!--					<actions>-->
<!--						<action type="success">-->
<!--							<if condition="code == 0">-->
<!--								<then>-->
<!--									<goto target="confirm"/>-->
<!--								</then>-->
<!--								<else>-->
<!--									<dialog type="Info" title="Eroare" message="Eroare: {0}" timeout="10" default="okay" mess-params="exception">-->
<!--										<actions>-->
<!--											<action type="okay" title="OK">-->
<!--												<cancel/>-->
<!--											</action>-->
<!--										</actions>-->
<!--									</dialog>-->
<!--								</else>-->
<!--							</if>-->
<!--						</action>-->
<!--						<action type="error">-->
<!--							<dialog type="Info" title="Eroare" message="A intervenit o eroare, va rugam sa incercati din nou" timeout="10" default="okay">-->
<!--								<actions>-->
<!--									<action type="okay" title="OK">-->
<!--										<cancel/>-->
<!--									</action>-->
<!--								</actions>-->
<!--							</dialog>-->
<!--						</action>-->
<!--					</actions>-->
<!--				</online-request>-->
			</action>
			<action type="Prev" title="Inapoi">
				<goto target="select_product"/>
			</action>
			<action type="Exit" title="Acasa">
				<goto target="exit"/>
			</action>
		</actions>
	</screen>

	<!-- Confirmare -->
	<screen id="confirm" type="confirm" title="Confirmare">
		<fields list="id1,product_value"/>
		<actions>
			<action type="Next" title="Achita">
				<set-sum from="product_value" type="units"/>
				<dialog type="Info" title="Info" message="Sunteti de acord cu prelucrarea datelor cu caracter personal in scopuri de marketing?" timeout="10" default="cancel" mess-params="name">
					<actions>
						<action type="okay" title="Da">
							<set key="gdpr" value="1"/>
							<goto target="pay"/>
						</action>
						<action type="cancel" title="Nu">
							<set key="gdpr" value="0"/>
							<goto target="pay"/>
						</action>
					</actions>
				</dialog>
			</action>
			<action type="Prev" title="Inapoi">
				<goto target="account"/>
			</action>
			<action type="Exit" title="Acasa">
				<goto target="exit"/>
			</action>
		</actions>
	</screen>
</scenario>
