<script type="text/javascript">
function sub_onclick2()
{
	if(document.form1.fullName.value=="")
	{
		alert("<?php echo sprintf($insert,$usersLBL["fullName"]);?>");
		document.form1.fullName.focus();
		return false;
	}
	if(document.form1.userName.value=="")
	{
		alert("<?php echo sprintf($insert,$usersLBL["userName"]);?>");
		document.form1.userName.focus();
		return false;
	}
	if(document.form1.password.value=="")
	{
		alert("<?php echo sprintf($insert,$usersLBL["password"]);?>");
		document.form1.password.focus();
		return false;
	}
	if(document.form1.passwordConfirm.value=="")
	{
		alert("<?php echo sprintf($insert,$usersLBL["passwordConfirm"]);?>");
		document.form1.passwordConfirm.focus();
		return false;
	}
	if(document.form1.passwordConfirm.value != document.form1.password.value)
	{
		alert("<?php echo $usersLBL["passwordConfirmNot"];?>");
		document.form1.passwordConfirm.focus();
		return false;
	}
	if(document.form1.mobile.value=="")
	{
		alert("<?php echo sprintf($insert,$usersLBL["mobile"]);?>");
		document.form1.mobile.focus();
		return false;
	}
	s=document.form1.mobile.value;
	if (s.length<9)
	{
		alert("<?php echo $usersLBL["enterCorrectNum"];?>");
		document.form1.mobile.focus();
		return false;
	}
	for (var i = 0; i < s.length; i++)
	{
		var c = s.charAt(i);
		if (!((c >= "0") && (c <= "9")))
		{
			alert("<?php echo $usersLBL["enterCorrectNum"];?>");
			document.form1.mobile.focus();	
			return false;
		}
	}
	return true;	
}
</script>
<form name="form1" action="usersModalAdd2.php" method="post" onsubmit="return sub_onclick2()">
   <div class="modal fade modal-fullscreen " style="z-index:10000;padding-<?php echo $align;?>:0px" id="addModModal" tabindex="-1" role="dialog" aria-labelledby="addModTitle" 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="addModTitle"><?php echo $usersLBL["addUser"];?></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="form-group" style="margin-bottom: 15px;">
                  <input type="text" class="form-control" name="fullName" placeholder="<?php echo $usersLBL["fullName"];?>">
               </div>
               
               <div class="form-group" style="margin-bottom: 15px;">
                  <input type="text" class="form-control" name="userName" placeholder="<?php echo $usersLBL["userName"];?>">
               </div>
               
               <div class="form-group" style="margin-bottom: 15px;">
                  <input type="password" class="form-control" name="password" placeholder="<?php echo $usersLBL["password"];?>">
               </div>
               
               <div class="form-group" style="margin-bottom: 15px;">
                  <input type="password" class="form-control" name="passwordConfirm" placeholder="<?php echo $usersLBL["passwordConfirm"];?>">
               </div>
               
               <div class="form-group" style="margin-bottom: 15px;">
                  <input type="text" class="form-control" name="mobile" placeholder="<?php echo $usersLBL["mobile"];?>">
               </div>
               
               <div class="form-group" style="margin-bottom: 15px;">
                  <input type="text" class="form-control" name="email" placeholder="<?php echo $usersLBL["email"];?>">
               </div>
               
               <div class="form-group">
                <label for="sender2" class="col-form-label myModalLabel"> <?php echo $usersLBL["sender"];?> :</label>
                  <?php
					$userActiveArr = array();
					$userActive = getSenderAvailability($userAccount);
					if(!empty($userActive)){
						$userActiveArr = explode(",", $userActive);
						$userActiveArr = array_filter($userActiveArr);
					}
					?>
                    <select name="sender2" id="sender2"  class="form-control"  style="padding:0px">
                        <option value="0"><?php echo $usersLBL["withOutSenderSelect"]?></option>
                        <?php
                        foreach ($userActiveArr as $value) {
                            ?>
                            <option value="<?php echo $value; ?>"><?php echo $value;?></option>
                            <?php
                        }
                        ?>
                    </select>
                    
               </div>
            </div>
            <div class="modal-footer">
               <button type="button" class="btn bg-danger btn-flat text-white m-1" data-dismiss="modal"><?php echo $button["close"];?></button>
               <input type="submit" value='<?php echo $button["add"];?>' name="sub" class="btn bg-primary btn-flat text-white m-1">
            </div>
         </div>
      </div>
   </div>
</form>