<?php 
include('../../config.php');
//require_once('../auth/auth.php');

// $note_query_data=  mysqli_query($conn,"SELECT `n_id`, `coid`, `bid`, `brid`, `note_head`, `note_body`, `userid`, `date`, `active` FROM `notebook` where  n_id ");
//   $count= mysqli_num_rows($note_query_data);
//  header('Content-Type:application/json');
//   if($count>0){
//               while ($row_nv= mysqli_fetch_array ($note_query_data) )
//               {
//                   $arr=$row_nv;
//               }
//                   echo json_encode(['status'=>true,'data'=>$arr,'result'=>'found']);
//             }else
//             {
//                   echo json_encode(['status'=>true,'data'=>'No Data Found','result'=>'not']);
//             }
        
//echo "Api Working";

 $bidqsss = mysqli_query($conn,"SELECT sms_senderid FROM branch WHERE coid='5'")or die(mysqli_error($conn));
     $row = mysqli_fetch_assoc($bidqsss);
       $sms_senderid= $row['sms_senderid'];
    
$messe_query_data=  mysqli_query($smsdb,"SELECT `ID`, `number`, `message`, `schedule`, `sentDate`, `deliveredDate`, `expiryDate`, `status`, `resultCode`, `errorCode`, `retries`, `userID`, `deviceID`, `simSlot`, `groupID`, `type`, `attachments` FROM `Message` where  deviceID='$sms_senderid' ");
 echo  $smscount= mysqli_num_rows($messe_query_data);
 header('Content-Type:application/json');
  if($smscount>0){
              while ($row_nv= mysqli_fetch_array ($note_query_data) )
              {
                  $arr=$row_nv;
              }
                  echo json_encode(['status'=>true,'data'=>$arr,'result'=>'found']);
            }else
            {
                  echo json_encode(['status'=>true,'data'=>'No Data Found','result'=>'not']);
            }
        










?>