<form name="formMsgFree" action="msgFreeUpdate.php" method="post">
   <div class="modal fade modal-fullscreen " style="z-index:10000;padding-<?php echo $align;?>:0px" id="balanceModal" tabindex="-1" role="dialog" aria-labelledby="balanceModalTitle" aria-hidden="true">
      <div class="modal-dialog modal-dialog-centered" role="document">
         <div class="modal-content text-right">
            <div class="modal-header modal-header-primary">
               <h5 class="modal-title" id="balanceModalTitle"><?php echo $usersLBL["balance"];?> : <span id="balanceFullName" class=""></span></h5>
               <button type="button" class="close slidedown" data-dismiss="modal" aria-label="Close">
               <span aria-hidden="true">&times;</span>
               </button>
            </div>
            <div class="modal-body" style="text-align: <?php echo $align;?>;">
            
            <div class="col-12 mb-4 alert-div" id="chargeTrue" style="display:none">
                <div class="alert alert-success alert-dismissible fade show" role="alert">
                    <button type="button" class="close" data-dismiss="alert" aria-label="Close">
                        <span aria-hidden="true">x</span>
                    </button>
                    <?php echo $usersLBL["sucessEdit"];?>
                </div>
            </div>
            <div class="col-12 mb-4 alert-div" id="chargeFalse" style="display:none">
                <div class="alert alert-danger alert-dismissible fade show" role="alert">
                    <button type="button" class="close" data-dismiss="alert" aria-label="Close">
                        <span aria-hidden="true">x</span>
                    </button>
                    <?php echo $usersLBL["dangerEdit"];?>
                </div>
            </div>
           <div class="form-group" style="display:inline-flex">
              <label for="maxNumMsg" class="col-form-label myModalLabel"> <?php echo $usersLBL["maxNumMsg"];?>: </label>&nbsp;
              <input type="text" class="form-control" id="maxNumMsg" name="maxNumMsg" style="width:20%">
           </div>
           <div id="lastChargeDiv" style="display:none">
              <label for="lastCharge" class="col-form-label myModalLabel"><?php echo $usersLBL["lastCharge"];?> : </label>
              <span id="lastCharge" class=""></span>
           </div>
               <img id="waitIcon3" src="../images/ajax-loader.gif" style="display:none" />
            </div>
            <div class="modal-footer">
            	<input type="hidden" value="" name="userId"  id="userId"/>
               <button type="button" class="btn bg-danger btn-flat text-white m-1" data-dismiss="modal"><?php echo $button["close"];?></button>
               <input type="button" value='<?php echo $button["charge"];?>' onclick="charge()" class="btn bg-primary btn-flat text-white m-1">
            </div>
         </div>
      </div>
   </div>
    <input type=hidden name="idUser22" id="idUser22">
</form>
<script>
function charge()
{
	if(document.getElementById("maxNumMsg").value=="")
	{
		alert("<?php echo $usersLBL["enterMaxNumMsg"];?>");
		document.getElementById("maxNumMsg").focus();
		return false;
	}
	$("#waitIcon3").show();
	$.post("chargeUser2.php",{ id:$("#idUser22").val(),maxNumMsg:$("#maxNumMsg").val(),rand:Math.random() } ,function(res){
		data=res.split('#$#');
		$("#maxNumMsg").val('');		
		if(data[0] == 1)
		{
			$("#chargeFalse").hide();
			$("#chargeTrue").show();
		}
		else
		{
			$("#chargeTrue").hide();
			$("#chargeFalse").show();
		}
		$("#waitIcon3").hide();
	});
}
</script>