<div class="modal fade" id="delete<?php echo $idss  ?>" 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">  Group: <?php echo $names ?>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
				&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;No. of Contacts: <?php echo $nums  ?> </h4>
            </div>
				<div class="modal-body">
			   
				<form name="contacts" data-parsley-validate class="form-horizontal form-label-left" method="post" action="">
					 
					    <div class="form-group" style="display:none;" >
                            <label > First Name <span class="required"> </span> </label>
						        <div class="col-md-4 col-sm-4 col-xs-5">
                                     <input type="text" id="em" name="em" value="<?php echo $idss ?>" required="required" class="form-control col-md-3 col-xs-3" />
                                </div> 
                       </div> 
                       
                         <div class="form-group" style="display:none;" >
                            <label > First Name <span class="required"> </span> </label>
						        <div class="col-md-4 col-sm-4 col-xs-5">
                                     <input type="text" id="em" name="gnm" value="<?php echo $names ?>" required="required" class="form-control col-md-3 col-xs-3" />
                                </div> 
                       </div>
                       
					        <b></b>Deleting this group will affect all Contacts atttached to <?php echo $names ?> Group.</b>
					        <br/>
					        <p> Are you sure you want to <b style="color:red;">DELETE</b> this Group ?? </p>
							
							
				</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="Delete" />
              
            </div>
			</form>
			<?php
			   if(isset($_POST['delete'])){
				   
				   $gid = $_POST['em'];
				   $gname = $_POST['gnm'];
				   
				    $s = mysql_query("delete from airtime_groups where group_id = '$gid' and customer_id = '$session_id' ");
				    
				    if($s){
				       $sql = mysql_query("update airtime_contacts set group_id = '0' where customer_id = '$session_id' and group_id = '$gid' ");
				       
				       	?>
				            <script>
					             window.location="delete2.php?gnm=<?php echo  $gname; ?>";
					        </script>
			        	<?php
				       
				    }
				   
			   }
			
			
			?>
        </div>
    </div>
</div>