<?php
session_start();
require_once('includes/config.php'); 
include 'email.php';
$tablename="save_order";
$order_date=date("Y-m-d");   
$result=$con->query("SELECT * from ".$tablename." WHERE order_date='$order_date' and job_status='0' and updated_email='0' order by id desc");
if($result->num_rows > 0) {
while($row = $result->fetch_assoc()) {
$tamp=intval($row['created_time']);
if(time() - $tamp > 1800){ 
$vendor_id=$row['vendor_id'];
$vensql=$con->query("SELECT name,phone from user_details WHERE user_id='$vendor_id'");
$vendorrow=mysqli_fetch_array($vensql);
$name=$vendorrow['name'];
$phone=$vendorrow['phone'];
$order_id=$row['id'];
$html='<h1>Hi Admin,</h1> 
            <p>The following Order ID #'.$order_id.' not response by the vendor.</p><p>Vendor Name : <b>'.$name.'</b></p><p>Vendor Phone : <b>'.$phone.'</b></p>';
sendemail("soundar@instasoftech.com","Vendor not response #$order_id",$html);
$update=$con->query("UPDATE ".$tablename." SET updated_email='1' WHERE id='$order_id'");
}
}
}
?>			