<?php
namespace App\Controllers;

use CodeIgniter\Controller;
use App\Models\SessionModel;
use App\Models\GuestModel;
use App\Models\CheckinModel;
use App\Models\ReplacementModel;


class Debug extends BaseController {

    private $model, $guestmodel, $sessionmodel;

    function __construct() {
        parent::__construct();
        $this->model = new CheckinModel();
        $this->guestmodel = new GuestModel();
        $this->sessionmodel = new SessionModel();
        $this->replacementmodel = new ReplacementModel();
        helper(['functions', 'twilio']);
    }

    function dry_run($case = 'default') {
        $case = strtolower($case);
        if(method_exists($this, $case))
            $this->$case();
        else

            echo "The Testing Case isn't defined. Please define one.";

    }

    function default() {

    }

    function whatsapp() {
         $to = "whatsapp:+97477631967"; // Customer's WhatsApp number
        $body = "Hello Junaid! Did you receive the message? Please confirm!";
        $url = "https://graduation.zoomarts.com/public/vvipinvitation.pdf";

        // Send WhatsApp message
        $message_sid = send_whatsapp_message($to, $body, $url);

        if ($message_sid) {
            echo "WhatsApp message sent successfully. SID: " . $message_sid;
        } else {
            echo "Failed to send WhatsApp message.";
        }
    }
    
}