[insert_php]
require_once(ABSPATH . ‘wp-config.php’);
$connection = mysqli_connect(DB_HOST, DB_USER, DB_PASSWORD);
mysqli_select_db($connection, DB_NAME);
$result = mysqli_query($connection,”SELECT wp_bookly_customers.first_name,wp_bookly_customers.last_name,wp_bookly_staff.full_name,wp_bookly_customer_appointments.sms,wp_bookly_customer_appointments.appointment_id,wp_bookly_customers.phone,wp_bookly_appointments.id,DATE_FORMAT(wp_bookly_appointments.start_date, ‘%d/%m/%Y’) AS ChangedStartDate, DATE_FORMAT(wp_bookly_appointments.start_date, ‘%H:%i %p’)AS ChangedStartTime, DATE_FORMAT(wp_bookly_appointments.end_date, ‘%H:%i %p’)AS ChangedEndTime
,wp_bookly_payments.status FROM wp_bookly_customer_appointments
INNER JOIN `wp_bookly_appointments` ON `wp_bookly_appointments`.`id` = `wp_bookly_customer_appointments`.`appointment_id`
INNER JOIN `wp_bookly_customers` ON `wp_bookly_customer_appointments`.`customer_id` = `wp_bookly_customers`.`id`
INNER JOIN `wp_bookly_staff` ON `wp_bookly_appointments`.`staff_id`= `wp_bookly_staff`.`id`
INNER JOIN `wp_bookly_services` ON `wp_bookly_appointments`.`service_id`= `wp_bookly_services`.`id`
INNER JOIN wp_bookly_payments ON wp_bookly_customer_appointments.payment_id = wp_bookly_payments.id
WHERE wp_bookly_appointments.start_date >= NOW() – INTERVAL 30 DAY
ORDER BY start_date ASC”);
echo ”
“;
echo ”
“;while($row = mysqli_fetch_array($result))
{$smsstatus= ” “. $row[‘sms’] .””;echo “”;// echo “”;// echo “”;
echo “”;
//echo “”;
echo “”;
echo “”;
echo “”;
//echo “”;
echo “”;//echo “”;
echo “”;If ($smsstatus==0)
{
echo “”;
}elseecho “”;
echo “”;
}
echo ”
Patient Name | Doctor | Phone | Date | Time | Payment | SMS | ||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
” . “$smsstatus” . “ | ” . $row[‘appointment_id’] . “ | ” . $row[‘first_name’] . “” . $row[‘last_name’].” | ” . $row[‘title’] . “ | ” . $row[‘full_name’] . “ | ” . $row[‘phone’] . “ | ” . $row[‘ChangedStartDate’] . “ | ” . $row[‘ChangedStartTime’] . “ | ” . $row[‘ChangedStartTime’] .” – “. $row[‘ChangedEndTime’] . “ | ” . $row[‘type’] . “ | ” . $row[‘status’] . “ | sms sent |
“;
[/insert_php]