<?php
$wp = file_get_contents('/home/monara/public_html/Hotel_Sapphire/wp-config.php');
preg_match("/define\(\s*'DB_PASSWORD'\s*,\s*'([^']*)'/", $wp, $p);
$pdo = new PDO('mysql:host=localhost;dbname=monara_hotel;charset=utf8','monara_hotel',$p[1]);
echo "=== booking payment types ===\n";
foreach ($pdo->query("SELECT action_type, paypal_payment_status, COUNT(*) c, ROUND(SUM(final_trip_price),2) total FROM wp_eagle_booking GROUP BY action_type, paypal_payment_status") as $r)
    echo "{$r['action_type']} | {$r['paypal_payment_status']} | n={$r['c']} | sum=\${$r['total']}\n";
echo "\nrecent:\n";
foreach ($pdo->query("SELECT id,guest_name,guest_email,final_trip_price,action_type,paypal_payment_status,booking_date FROM wp_eagle_booking ORDER BY id DESC LIMIT 5") as $r)
    echo implode(' | ',$r)."\n";
echo "\ncinema: ";
echo file_exists('/home/monara/public_html/cinema_booking/submit.php')?'submit.php exists':'no submit';
echo "\n";
