<div class="modal fade" id="blockuser<?php echo $id ?>" tabindex="-1" role="form" aria-labelledby="myModalLabel" aria-hidden="true">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true"> Cancel &times;</button>
                <h4 class="modal-title" id="myModalLabel">Confirm User Deactivation &nbsp;&nbsp;&nbsp;
				Name: <?php echo $Fname." ". $Lname ?> &nbsp;&nbsp; Groups: &nbsp;<?php echo $numrows  ?> </h4>
            </div>
				<div class="modal-body">
			   
					<form name="contacts" data-parsley-validate class="form-horizontal form-label-left" method="post" action="">
                          <input type="text" style="display:none;" id="uid" name="uid" value="<?php echo $id ?>" required="required" class="form-control col-md-3 col-xs-3" />
						
					 <b style="text-align:center;"> Are you sure you want to Block this user ?   </b>
				
							
				</div>
            <div class="modal-footer">
			<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
			<input type="submit" class="btn btn-danger" name="delete" value="Block User" />
                
            </div>
			</form>
			
			<?php
			if(isset($_POST['delete'])){
				$userid = $_POST['uid'];
				// check whether user is already blocked
				$s=mysql_query("select * from airtime_customer where customer_id='$userid' ");
				$reslt = mysql_fetch_assoc($s);
				
				if($reslt['status'] == "Blocked"){
					// error
					echo ' <div class="col-md-offset-3 col-md-9">
												<button id="btn-signup" type="button" class="btn btn-error"><i class="icon-hand-right"></i>User Already Blocked! </button>
                                         
												</div>';
				}
				else 
					$sql=mysql_query("update airtime_customer set status='Blocked' where customer_id='$userid' ") or die (mysql_error());
					
			?>
					<script>
					window.location="viewuser.php";
					</script >
						<?php
			}
			?>
        </div>
    </div>
</div>
