当我的经过时间(在数据库中)达到3小时,6小时和1小时时,我想自动向特定群组(outlook)发送电子邮件。 12小时。我搜索了很多,但我无法找到答案。下面是我的编码,显示到目前为止的经过时间。我更喜欢用代码而不是cron工作。希望你们都能帮忙!
提前致谢!!
<?php
$i = 1;
while ($csv=mysqli_fetch_assoc($records)){
$A=$csv['Name'];
$B=$csv['SRNumber'];
$C=$csv['ServiceImpact'];
$D=$csv['CustomerRefNo'];
$E=$csv['ReportedDateAndTime'];
$K=['ElapsedTime'];
?>
<tr>
<td><?php echo $A; ?></td>
<td><?php echo $B; ?></td>
<td><?php echo $C; ?></td>
<td><?php echo $D; ?></td>
<td><?php echo $E; ?></td>
<td><?php echo $K; ?></td>
<td><?php
date_default_timezone_set('Asia/Colombo');
$the_time = date('H:i');
$sql="SELECT ReportedDateAndTime FROM csv";
$result=$conn->query($sql);
while ($row = $result->fetch_assoc()){
$new_time=$row['ReportedDateAndTime'];
$datetime1 = new DateTime($the_time);
$datetime2 = new DateTime($new_time);
$interval = $datetime2->diff($datetime1);
$hours=$interval->format('%h');
$minutes= $interval->format('%i');
$seconds= $interval->format('%s');
echo $hours." Hours ".$minutes." Minutes ".$seconds." Seconnds</br></br>";
} ?>
</td>
<td>
<a href="Escalation_Display.php?delete=<?php echo $B?>" onclick="return confirm('SR Resolved?');">Archive</a>
</td>
</tr>
<?php
$i++;}
if(isset($_GET['delete'])){
$delete_id = $_GET['delete'];
mysqli_query($conn, "DELETE FROM csv WHERE SRNumber = '$delete_id'");
header("location:Escalation_Display.php");
}?>