<?php
require 'app/config.php';

   if($_POST['action']=="get_reminder_data"){
   $this_date=$_POST['date'];
   
 $stmt_date =$db->prepare("SELECT * FROM phone WHERE send_time > ? AND send_time < ?");
 $stmt_date->execute([$this_date .' 00:00:00' , $this_date .' 23:59:00']);
$data=[];
$rows = $stmt_date->fetchAll();
 foreach ($rows as $row) {
     
     $data[]=$row;
 }
  echo json_encode($data);
   }elseif($_POST['action']=="get_all_reminder_data"){
       $stmt_date =$db->prepare("SELECT * FROM phone ");
 $stmt_date->execute();
$data=[];
$rows = $stmt_date->fetchAll();
 foreach ($rows as $row) {
     
     $data[]=$row;
 }
  echo json_encode($data);
   }