<?php
include("include/dbconnect.php");
$uname=$_SESSION['uname'];
extract($_POST);
?>
<html>
<head>
<title><?php include("include/title.php"); ?></title>
<link href="style.css" rel="stylesheet" type="text/css">
<script language="javascript" src="include/menu.js"></script>
</head>

<body>
<form id="form1" name="form1" method="post" action="">
  <table width="95%" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF">
    <tr>
      <td align="center"><?php include("include/header1.php"); ?></td>
    </tr>
    <tr>
      <td align="left" class="subhead"><?php include("include/link_admin.php"); ?></td>
    </tr>
    <tr>
      <td align="center" valign="top"><p class="txt1">&nbsp;</p>
        <h3>Motor Fault</h3>
        
        <?php
        	$q1=mysql_query("select * from  response  ORDER BY id DESC LIMIT 1 ");
		$n1=mysql_num_rows($q1);
		if($n1>0)
		{
		$r1=mysql_fetch_array($q1);
		$idd=$r1['id'];
		$hrt=$row['heart'];
	//	$mob=$row['mobile'];
	

 if($r1['heart']<50||$r1['heart']>90)
{
    	$mobile=919445721729;
//	$mes='*Energy Monitoring: ';
	$message=$mes.$heart;
echo '<h3 style="color:#990033" align="center">'.$message.'</h3>';

//echo '<iframe src="http://pay4sms.in/sendsms/?token=b90fccf22ade05ad09ca1cb25f5ba7dc&credit=1&sender= Myproject&message='.$message.'&number=91'.$mobile.'" style="display:block"></iframe>';
//echo '<iframe src="http://pay4sms.in/sendsms/?token=b90fccf22ade05ad09ca1cb25f5ba7dc&credit=1&message='.$message.'&number='.$mobile.'" style="display:block"></iframe>';
}





		}
        
    
  
	

?>
        
        
        
        <p><?php
		
		
		$select = mysql_query("SELECT * FROM healthnsn  ORDER BY id DESC") or die("select quee error".mysql_error());
		?></p>
        <table width="80%" height="78" border="0" align="center">
          <tr align="center" bgcolor="#999999">
            <th bgcolor="#DDDDDD" scope="col">Sno:</th>
            <th bgcolor="#DDDDDD" scope="col"><LABEL for="checkbox_row_2">Information</LABEL></th>
            <th bgcolor="#DDDDDD" scope="col">Date</th>
        
           <!-- <th bgcolor="#DDDDDD" scope="col">Delivery</th>-->
          </tr>
		  <?php
		  $p = 0;
		  while($row = mysql_fetch_array($select)){
		  $p++;
		  ?>
          <tr align="center" bgcolor="#CCCCFF">
            <td><?php echo $p; ?></td>
            <td><?php echo $row['temp']; ?></td>
            <td><?php echo $row['rdate']; ?></td>
            
            
      
    <!-- <td><a href="delivered.php?act=ok&id=<?php echo $row['pid']; ?>">Click</a></td>-->
          </tr>
		  <?php
		  }
		  ?>
        </table>
        <p>&nbsp;</p>
		<p class="txt1">&nbsp;</p>
        <p>&nbsp;</p>
      <p>&nbsp;</p>
      <p></p></td>
    </tr>
    <tr>
      <td align="center" class="subhead">&nbsp;</td>
    </tr>
  </table>
</form>
</body>
</html>
