<div class="sgcontainer">
	<?php include_once('headerMenu.php') ;?>
     <div id="avanak-content" class="sgrow">
        <div class="setting-page">
			<h2 class="hndle"><span class="yekan">خدمات</span></h2>
			<div class="inside">
				<div class="main" style="height:auto">
					
						<div class="form-field term-slug-wrap clearfix">
							<label for="username">ارسال کد یکبار مصرف</label>
							<div style="width:100%">
								<input type="text" name="otc" id="otc" class="ltr">
							</div>
							<div style="width:100%">
								<span onclick="sendotc()" class="button-primary yekan text-normal pull-left">ارسال کد</span>
							</div>
						</div>
					
					
						<div class="form-field term-slug-wrap clearfix">
							<label for="username">دریافت مانده حساب</label>
							<div style="width:100%">
								<span onclick="getAmount()" class="button-primary yekan text-normal pull-left">دریافت موجودی حساب</span>
								<p id="mandeHesab"></p>
							</div>
						</div>
						
					</div>
					<br>
					<div style="width:100%">
						<br><br>
						<p class="userStatusPlace yekan"></p>
					</div>
				</div>
			</div>
		</div>
    </div>
</div>
    <script>
        function sendotc() {
            $.ajax({
                type: "POST",
                url: "/wp-admin/admin-ajax.php",
                data: {action: 'sendotc', number: $("#otc").val()},
                success: function (d) {
                    $(".userStatusPlace").html('کد یکبار مصرف شما : ' + d);
                }
            });
        }
        function getAmount() {
            $.ajax({
                type: "POST",
                url: "/wp-admin/admin-ajax.php",
                data: {action: 'amount'},
                success: function (d) {
                    $("#mandeHesab").text(`مانده حساب شما : ${d} ریال`);
                }
            });
        }
    </script>