
  
<?php
include("include/dbconnect.php");
$select = mysql_query("SELECT * FROM eyetbl ORDER BY id DESC")or die("user handgesture error </br>".mysql_error());
?>
 <?php
        	$q1=mysql_query("select * from  eyetbl  ORDER BY id DESC LIMIT 1 ");
		$n1=mysql_num_rows($q1);
		if($n1>0)
		{
		$r1=mysql_fetch_array($q1);
		$idd=$r1['id'];
		$hrt=$r1['m1'];
		$sts=$r1['Status'];
	//	$mob=$row['mobile'];

if($sts=="1")
{
 echo $hrt;
  $mobile='6381072105';
	  
echo '<iframe src="https://myprojectfinal.in/message/messageapi.php?status=1&number='.$mobile.'&mes='.$hrt.'" style="display:block"></iframe>';
$qry=mysql_query("Update  eyetbl set Status='0' where id='$idd' ");
    
    
}


}

if($_REQUEST['act']=="delall")
{
    $ii= $_REQUEST['did'];
    $ed= $_REQUEST['act'];
    $mq=mysql_query("delete from eyetbl");
    
     if($mq)
	{

	?>
	<script language="javascript">
	window.location.href="display.php";
	</script>
	<?php
	}
}

if($_REQUEST['act']=="del")
{
    $ii= $_REQUEST['did'];
    $ed= $_REQUEST['act'];
    $mq=mysql_query("delete from eyetbl where id='$ii'");
    
     if($mq)
	{

	?>
	<script language="javascript">
	window.location.href="display.php";
	</script>
	<?php
	}
}
?>
<html>
<head>
    <meta http-equiv="refresh" content="120">
<title><?php include("include/title.php"); ?></title>
<link href="style.css" rel="stylesheet" type="text/css">
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>

<body>
<form id="form1" name="form1" method="post" action="">
     
  <table width="100%" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF">
    
    
     <tr>
      <td colspan="2" align="center" class="heading"><?php include("include/title.php"); ?></td>
    </tr>
    <tr>
      <td colspan="2" align="center" class="subhead"><?php include("include/link_home.php"); ?></td>
    </tr>
   
  
        
    
      <td width="100%" align="center" valign="top"><p>&nbsp;</p>
        <a href="display.php?act=delall&did=<?php echo $rrow['id']; ?>"><i class="fa fa-trash" aria-hidden="true"></i> DELETE ALL</a>
        <table width="385" height="171" border="0" cellpadding="5" cellspacing="0" class="border">
         
          
          <table width="644" border="1" align="center" cellpadding="5">
    <tr>
      <th width="119" class="bg1" scope="row">Sno</th>
      <th width="262" class="bg1">Message</th>
       
       
       <th width="262" class="bg1">Date</th>
          <th width="262" class="bg1">ACTION</th>
    </tr>
 <?php
		  $r = 0;
		  while($rrow = mysql_fetch_array($select)){
		  $r++;
		  ?>
    <tr>
      <td class="bg2" scope="row">
      <?php echo $r; ?></td>
      <td class="bg2"><?php echo $rrow['m1']; ?></td>
      
       <td class="bg2"><?php echo $rrow['rdate']; ?></td>
        <td><a href="display.php?act=del&did=<?php echo $rrow['id']; ?>"><i class="fa fa-trash" aria-hidden="true"></i> DELETE</a></td>
    </tr>

         <?php
		
	}	
	
	?>

        </table>
        <p>&nbsp;</p>
        
      </td>
     
    </tr>
    <tr>
      <td colspan="2" align="center" class="foot">&nbsp;</td>
    </tr>
  </table>
 
</form>
</body>
</html>